summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/CMakeLists.txt26
-rw-r--r--mysql-test/collections/buildbot_suites.bat1
-rw-r--r--mysql-test/collections/default.experimental2
-rw-r--r--mysql-test/collections/mysql-trunk.daily3
-rw-r--r--mysql-test/disabled.def4
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test9
-rw-r--r--mysql-test/extra/binlog_tests/binlog_incident-master.opt (renamed from mysql-test/suite/binlog/t/binlog_incident-master.opt)0
-rw-r--r--mysql-test/extra/binlog_tests/binlog_incident.inc68
-rw-r--r--mysql-test/extra/binlog_tests/binlog_index.inc278
-rw-r--r--mysql-test/extra/binlog_tests/binlog_ioerr.inc36
-rw-r--r--mysql-test/extra/binlog_tests/binlog_mysqlbinlog-cp932.inc50
-rw-r--r--mysql-test/extra/binlog_tests/binlog_row_annotate.inc211
-rw-r--r--mysql-test/extra/binlog_tests/binlog_write_error.inc108
-rw-r--r--mysql-test/extra/binlog_tests/binlog_xa_recover.inc281
-rw-r--r--mysql-test/extra/binlog_tests/database.test2
-rw-r--r--mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc3
-rw-r--r--mysql-test/extra/rpl_tests/multisource.inc304
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test1
-rw-r--r--mysql-test/extra/rpl_tests/rpl_binlog_errors.inc422
-rw-r--r--mysql-test/extra/rpl_tests/rpl_cant_read_event_incident.inc83
-rw-r--r--mysql-test/extra/rpl_tests/rpl_checksum.inc334
-rw-r--r--mysql-test/extra/rpl_tests/rpl_checksum_cache.inc261
-rw-r--r--mysql-test/extra/rpl_tests/rpl_corruption.inc176
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ddl.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extra_col_master.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extra_col_slave.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_foreign_key.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_gtid_basic.inc568
-rw-r--r--mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test290
-rw-r--r--mysql-test/extra/rpl_tests/rpl_incident.inc54
-rw-r--r--mysql-test/extra/rpl_tests/rpl_init_slave_errors.inc95
-rw-r--r--mysql-test/extra/rpl_tests/rpl_innodb.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata_local.inc246
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loadfile.inc120
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loadfile.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_mixing_engines.test7
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test119
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test347
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test307
-rw-r--r--mysql-test/extra/rpl_tests/rpl_packet.inc184
-rw-r--r--mysql-test/extra/rpl_tests/rpl_parallel.inc2479
-rw-r--r--mysql-test/extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc40
-rw-r--r--mysql-test/extra/rpl_tests/rpl_partition.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_relayrotate.inc18
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_blob.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_func003.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_img.test241
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_img_blobs.test179
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp003.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_semi_sync.inc580
-rw-r--r--mysql-test/extra/rpl_tests/rpl_skip_replication.inc402
-rw-r--r--mysql-test/extra/rpl_tests/rpl_special_charset.inc32
-rw-r--r--mysql-test/extra/rpl_tests/rpl_sporadic_master.inc32
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ssl.inc117
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_relay_ign_space.inc107
-rw-r--r--mysql-test/extra/rpl_tests/rpl_sv_relay_space.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_switch_stm_row_mixed.inc631
-rw-r--r--mysql-test/extra/rpl_tests/rpl_sync.inc159
-rw-r--r--mysql-test/extra/rpl_tests/rpl_temporal_format_default_to_default.inc82
-rw-r--r--mysql-test/extra/rpl_tests/rpl_trig004.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_typeconv.inc78
-rw-r--r--mysql-test/include/analyze-format.inc3
-rw-r--r--mysql-test/include/assert_grep.inc154
-rw-r--r--mysql-test/include/binlog_parallel_replication_marks.test80
-rw-r--r--mysql-test/include/binlog_start_pos.inc10
-rw-r--r--mysql-test/include/check-testcase.test4
-rw-r--r--mysql-test/include/check-warnings.test4
-rw-r--r--mysql-test/include/concurrent.inc2
-rw-r--r--mysql-test/include/crash_mysqld.inc18
-rw-r--r--mysql-test/include/ctype_innodb_like.inc7
-rw-r--r--mysql-test/include/ctype_like_cond_propagation.inc16
-rw-r--r--mysql-test/include/ctype_numconv.inc4
-rw-r--r--mysql-test/include/ctype_thai.inc156
-rw-r--r--mysql-test/include/ctype_uca_w2.inc65
-rw-r--r--mysql-test/include/ctype_utf8_ilseq.inc18
-rw-r--r--mysql-test/include/ctype_utf8mb4.inc73
-rw-r--r--mysql-test/include/default_client.cnf6
-rw-r--r--mysql-test/include/default_mysqld.cnf8
-rw-r--r--mysql-test/include/default_ndbd.cnf27
-rw-r--r--mysql-test/include/diff_servers.inc67
-rw-r--r--mysql-test/include/equal_fields_propagation_datetime.inc64
-rw-r--r--mysql-test/include/explain_non_select.inc2
-rw-r--r--mysql-test/include/filter_file.inc11
-rw-r--r--mysql-test/include/func_hybrid_type.inc81
-rw-r--r--mysql-test/include/func_str_ascii_checksum.inc24
-rw-r--r--mysql-test/include/galera_clear_sync_point.inc1
-rw-r--r--mysql-test/include/galera_cluster.inc12
-rw-r--r--mysql-test/include/galera_connect.inc48
-rw-r--r--mysql-test/include/galera_diff.inc100
-rw-r--r--mysql-test/include/galera_end.inc25
-rw-r--r--mysql-test/include/galera_init.inc26
-rw-r--r--mysql-test/include/galera_set_sync_point.inc1
-rw-r--r--mysql-test/include/galera_signal_sync_point.inc1
-rw-r--r--mysql-test/include/galera_wait_ready.inc2
-rw-r--r--mysql-test/include/galera_wait_sync_point.inc6
-rw-r--r--mysql-test/include/grant_cache.inc8
-rw-r--r--mysql-test/include/have_aria.inc4
-rw-r--r--mysql-test/include/have_innodb.combinations13
-rw-r--r--mysql-test/include/have_innodb_32k.inc6
-rw-r--r--mysql-test/include/have_innodb_64k.inc4
-rw-r--r--mysql-test/include/have_innodb_bzip2.inc4
-rw-r--r--mysql-test/include/have_innodb_disallow_writes.inc6
-rw-r--r--mysql-test/include/have_innodb_lz4.inc4
-rw-r--r--mysql-test/include/have_innodb_lzma.inc4
-rw-r--r--mysql-test/include/have_innodb_lzo.inc4
-rw-r--r--mysql-test/include/have_innodb_snappy.inc4
-rw-r--r--mysql-test/include/have_max_indexes_128.inc5
-rw-r--r--mysql-test/include/have_max_indexes_64.inc5
-rw-r--r--mysql-test/include/have_multi_ndb.inc52
-rw-r--r--mysql-test/include/have_mutex_deadlock_detector.inc7
-rw-r--r--mysql-test/include/have_ndb.inc2
-rw-r--r--mysql-test/include/have_ndb_extra.inc2
-rw-r--r--mysql-test/include/have_ndbapi_examples.inc4
-rw-r--r--mysql-test/include/have_sequence.inc4
-rw-r--r--mysql-test/include/have_sequence.opt1
-rw-r--r--mysql-test/include/have_wsrep.inc8
-rw-r--r--mysql-test/include/have_wsrep_enabled.inc11
-rw-r--r--mysql-test/include/have_wsrep_provider.inc6
-rw-r--r--mysql-test/include/have_xtradb.combinations4
-rw-r--r--mysql-test/include/icp_tests.inc14
-rw-r--r--mysql-test/include/innodb_encrypt_log.combinations7
-rw-r--r--mysql-test/include/innodb_encrypt_log.inc4
-rw-r--r--mysql-test/include/innodb_page_size.combinations8
-rw-r--r--mysql-test/include/innodb_undo_tablespaces.combinations5
-rw-r--r--mysql-test/include/innodb_undo_tablespaces.inc3
-rw-r--r--mysql-test/include/loaddata_autocom.inc3
-rw-r--r--mysql-test/include/maria_verify_recovery.inc2
-rw-r--r--mysql-test/include/max_indexes.inc2
-rw-r--r--mysql-test/include/mix2.inc10
-rw-r--r--mysql-test/include/mtr_check.sql9
-rw-r--r--mysql-test/include/mtr_warnings.sql7
-rw-r--r--mysql-test/include/mysqlhotcopy.inc2
-rw-r--r--mysql-test/include/ndb_backup.inc48
-rw-r--r--mysql-test/include/ndb_backup_print.inc9
-rw-r--r--mysql-test/include/ndb_default_cluster.inc4
-rw-r--r--mysql-test/include/ndb_master-slave.inc12
-rw-r--r--mysql-test/include/ndb_master-slave_2ch.inc67
-rw-r--r--mysql-test/include/ndb_not_readonly.inc36
-rw-r--r--mysql-test/include/ndb_restore_master.inc8
-rw-r--r--mysql-test/include/ndb_restore_slave_eoption.inc11
-rw-r--r--mysql-test/include/ndb_setup_slave.inc27
-rw-r--r--mysql-test/include/ndb_wait_connected.inc26
-rw-r--r--mysql-test/include/not_encrypted.inc4
-rw-r--r--mysql-test/include/not_ndb.inc7
-rw-r--r--mysql-test/include/not_ndb_default.inc4
-rw-r--r--mysql-test/include/ps_create.inc3
-rw-r--r--mysql-test/include/ps_query.inc2
-rw-r--r--mysql-test/include/query_cache.inc4
-rw-r--r--mysql-test/include/query_cache_partitions.inc3
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc3
-rw-r--r--mysql-test/include/reset_master_slave.inc (renamed from mysql-test/suite/multi_source/reset_master_slave.inc)0
-rw-r--r--mysql-test/include/restart_mysqld.inc3
-rw-r--r--mysql-test/include/rpl_init.inc16
-rw-r--r--mysql-test/include/rpl_multi_engine2.inc4
-rw-r--r--mysql-test/include/rpl_row_img_general_loop.inc42
-rw-r--r--mysql-test/include/rpl_row_img_set.inc55
-rw-r--r--mysql-test/include/safe_set_to_maybe_ro_var.inc23
-rw-r--r--mysql-test/include/select_ndb_apply_status.inc13
-rw-r--r--mysql-test/include/show_all_slaves_status.inc65
-rw-r--r--mysql-test/include/show_binlog_events.inc8
-rw-r--r--mysql-test/include/show_binlog_events2.inc2
-rw-r--r--mysql-test/include/show_events.inc23
-rw-r--r--mysql-test/include/show_gtid_list.inc15
-rw-r--r--mysql-test/include/show_relaylog_events.inc3
-rw-r--r--mysql-test/include/start_mysqld.inc3
-rw-r--r--mysql-test/include/sync_slave_sql_with_master.inc53
-rw-r--r--mysql-test/include/type_hrtime.inc14
-rw-r--r--mysql-test/include/type_temporal_zero_default.inc75
-rw-r--r--mysql-test/include/wait_condition.inc1
-rw-r--r--mysql-test/include/wait_for_ndb_to_binlog.inc26
-rw-r--r--mysql-test/include/wait_for_sql_thread_read_all.inc (renamed from mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc)0
-rw-r--r--mysql-test/include/wait_until_ready.inc34
-rw-r--r--mysql-test/include/wait_wsrep_ready.inc18
-rw-r--r--mysql-test/include/word_size.combinations3
-rw-r--r--mysql-test/include/word_size.inc4
-rw-r--r--mysql-test/include/write_var_to_file.inc3
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm212
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc22
-rwxr-xr-xmysql-test/lib/generate-ssl-certs.sh21
-rw-r--r--mysql-test/lib/mtr_cases.pm40
-rw-r--r--mysql-test/lib/mtr_report.pm4
-rw-r--r--mysql-test/lib/v1/mtr_cases.pl53
-rw-r--r--mysql-test/lib/v1/mtr_process.pl136
-rw-r--r--mysql-test/lib/v1/mtr_report.pl4
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl1158
-rw-r--r--mysql-test/lib/v1/ndb_config_1_node.ini47
-rw-r--r--mysql-test/lib/v1/ndb_config_2_node.ini55
-rwxr-xr-xmysql-test/mysql-test-run.pl577
-rw-r--r--mysql-test/r/alter_table.result36
-rw-r--r--mysql-test/r/alter_table_online.result32
-rw-r--r--mysql-test/r/analyze_format_json.result749
-rw-r--r--mysql-test/r/analyze_stmt.result336
-rw-r--r--mysql-test/r/analyze_stmt_orderby.result586
-rw-r--r--mysql-test/r/analyze_stmt_privileges.result41
-rw-r--r--mysql-test/r/analyze_stmt_privileges2.result5237
-rw-r--r--mysql-test/r/analyze_stmt_slow_query_log.result18
-rw-r--r--mysql-test/r/auth_named_pipe.result10
-rw-r--r--mysql-test/r/bench_count_distinct.result2
-rw-r--r--mysql-test/r/bigint.result8
-rw-r--r--mysql-test/r/blackhole_plugin.result2
-rw-r--r--mysql-test/r/bug13633383.result61
-rw-r--r--mysql-test/r/cache_innodb.result3
-rw-r--r--mysql-test/r/case.result171
-rw-r--r--mysql-test/r/cast.result140
-rw-r--r--mysql-test/r/change_user.result9
-rw-r--r--mysql-test/r/compare.result2
-rw-r--r--mysql-test/r/compound.result171
-rw-r--r--mysql-test/r/concurrent_innodb_safelog.result2
-rw-r--r--mysql-test/r/concurrent_innodb_unsafelog.result2
-rw-r--r--mysql-test/r/connect.result7
-rw-r--r--mysql-test/r/create-big.result12
-rw-r--r--mysql-test/r/create.result825
-rw-r--r--mysql-test/r/create_drop_binlog.result392
-rw-r--r--mysql-test/r/create_drop_db.result40
-rw-r--r--mysql-test/r/create_drop_event.result48
-rw-r--r--mysql-test/r/create_drop_function.result54
-rw-r--r--mysql-test/r/create_drop_index.result44
-rw-r--r--mysql-test/r/create_drop_procedure.result47
-rw-r--r--mysql-test/r/create_drop_role.result75
-rw-r--r--mysql-test/r/create_drop_server.result37
-rw-r--r--mysql-test/r/create_drop_trigger.result37
-rw-r--r--mysql-test/r/create_drop_udf.result38
-rw-r--r--mysql-test/r/create_drop_user.result43
-rw-r--r--mysql-test/r/create_drop_view.result59
-rw-r--r--mysql-test/r/create_or_replace.result6
-rw-r--r--mysql-test/r/create_or_replace_permission.result53
-rw-r--r--mysql-test/r/create_w_max_indexes_128.result1250
-rw-r--r--mysql-test/r/create_w_max_indexes_64.result783
-rw-r--r--mysql-test/r/ctype_big5.result178
-rw-r--r--mysql-test/r/ctype_binary.result381
-rw-r--r--mysql-test/r/ctype_collate.result2
-rw-r--r--mysql-test/r/ctype_cp1250_ch.result126
-rw-r--r--mysql-test/r/ctype_cp1251.result313
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result217
-rw-r--r--mysql-test/r/ctype_eucjpms.result288
-rw-r--r--mysql-test/r/ctype_euckr.result182
-rw-r--r--mysql-test/r/ctype_filename.result7
-rw-r--r--mysql-test/r/ctype_gb2312.result166
-rw-r--r--mysql-test/r/ctype_gbk.result1002
-rw-r--r--mysql-test/r/ctype_latin1.result552
-rw-r--r--mysql-test/r/ctype_latin1_de.result8
-rw-r--r--mysql-test/r/ctype_latin2.result10
-rw-r--r--mysql-test/r/ctype_latin2_ch.result125
-rw-r--r--mysql-test/r/ctype_ldml.result23
-rw-r--r--mysql-test/r/ctype_like_range.result1106
-rw-r--r--mysql-test/r/ctype_many.result22
-rw-r--r--mysql-test/r/ctype_mb.result8
-rw-r--r--mysql-test/r/ctype_sjis.result247
-rw-r--r--mysql-test/r/ctype_tis620.result248
-rw-r--r--mysql-test/r/ctype_uca.result1842
-rw-r--r--mysql-test/r/ctype_uca_innodb.result38
-rw-r--r--mysql-test/r/ctype_uca_partitions.result86
-rw-r--r--mysql-test/r/ctype_ucs.result408
-rw-r--r--mysql-test/r/ctype_ujis.result289
-rw-r--r--mysql-test/r/ctype_upgrade.result36
-rw-r--r--mysql-test/r/ctype_utf16.result94
-rw-r--r--mysql-test/r/ctype_utf16_uca.result716
-rw-r--r--mysql-test/r/ctype_utf16le.result94
-rw-r--r--mysql-test/r/ctype_utf32.result55
-rw-r--r--mysql-test/r/ctype_utf32_uca.result716
-rw-r--r--mysql-test/r/ctype_utf8.result739
-rw-r--r--mysql-test/r/ctype_utf8mb4.result157
-rw-r--r--mysql-test/r/ctype_utf8mb4_heap.result139
-rw-r--r--mysql-test/r/ctype_utf8mb4_innodb.result141
-rw-r--r--mysql-test/r/ctype_utf8mb4_myisam.result141
-rw-r--r--mysql-test/r/ctype_utf8mb4_uca.result702
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result37
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result37
-rw-r--r--mysql-test/r/default.result16
-rw-r--r--mysql-test/r/delayed.result34
-rw-r--r--mysql-test/r/delete_returning_grant.result3
-rw-r--r--mysql-test/r/delimiter_command_case_sensitivity.result (renamed from mysql-test/r/have_mutex_deadlock_detector.require)0
-rw-r--r--mysql-test/r/derived.result50
-rw-r--r--mysql-test/r/derived_view.result21
-rw-r--r--mysql-test/r/distinct.result24
-rw-r--r--mysql-test/r/drop_bad_db_type.result21
-rw-r--r--mysql-test/r/enforce_storage_engine.result154
-rw-r--r--mysql-test/r/enforce_storage_engine_opt.result15
-rw-r--r--mysql-test/r/errors.result4
-rw-r--r--mysql-test/r/events_1.result1
-rw-r--r--mysql-test/r/events_2.result1
-rw-r--r--mysql-test/r/events_bugs.result11
-rw-r--r--mysql-test/r/events_trans.result1
-rw-r--r--mysql-test/r/events_trans_notembedded.result1
-rw-r--r--mysql-test/r/explain_json.result1545
-rw-r--r--mysql-test/r/explain_json_format_partitions.result86
-rw-r--r--mysql-test/r/explain_json_innodb.result57
-rw-r--r--mysql-test/r/fast_prefix_index_fetch_innodb.result102
-rw-r--r--mysql-test/r/features.result1
-rw-r--r--mysql-test/r/file_contents.result2
-rw-r--r--mysql-test/r/fix_priv_tables.result1
-rw-r--r--mysql-test/r/flush-innodb-notembedded.result1
-rw-r--r--mysql-test/r/flush2.result22
-rw-r--r--mysql-test/r/flush_read_lock.result3
-rw-r--r--mysql-test/r/fulltext_order_by.result6
-rw-r--r--mysql-test/r/func_compress.result29
-rw-r--r--mysql-test/r/func_crypt.result80
-rw-r--r--mysql-test/r/func_digest.result32
-rw-r--r--mysql-test/r/func_encrypt.result18
-rw-r--r--mysql-test/r/func_gconcat.result81
-rw-r--r--mysql-test/r/func_group.result136
-rw-r--r--mysql-test/r/func_hybrid_type.result3431
-rw-r--r--mysql-test/r/func_if.result5
-rw-r--r--mysql-test/r/func_in.result34
-rw-r--r--mysql-test/r/func_like.result54
-rw-r--r--mysql-test/r/func_math.result12
-rw-r--r--mysql-test/r/func_misc.result51
-rw-r--r--mysql-test/r/func_regexp_pcre.result53
-rw-r--r--mysql-test/r/func_set.result4
-rw-r--r--mysql-test/r/func_str.result318
-rw-r--r--mysql-test/r/func_system.result6
-rw-r--r--mysql-test/r/func_test.result81
-rw-r--r--mysql-test/r/func_time.result429
-rw-r--r--mysql-test/r/func_time_hires.result16
-rw-r--r--mysql-test/r/func_weight_string.result50
-rw-r--r--mysql-test/r/gis-debug.result2
-rw-r--r--mysql-test/r/gis-precise.result34
-rw-r--r--mysql-test/r/gis-rtree.result48
-rw-r--r--mysql-test/r/gis.result222
-rw-r--r--mysql-test/r/grant.result15
-rw-r--r--mysql-test/r/grant2.result5
-rw-r--r--mysql-test/r/grant3.result3
-rw-r--r--mysql-test/r/grant4.result37
-rw-r--r--mysql-test/r/grant_4332.result3
-rw-r--r--mysql-test/r/grant_cache_no_prot.result8
-rw-r--r--mysql-test/r/grant_cache_ps_prot.result8
-rw-r--r--mysql-test/r/grant_explain_non_select.result22
-rw-r--r--mysql-test/r/grant_lowercase.result7
-rw-r--r--mysql-test/r/grant_lowercase_fs.result2
-rw-r--r--mysql-test/r/group_by.result178
-rw-r--r--mysql-test/r/group_by_innodb.result35
-rw-r--r--mysql-test/r/group_min_max.result206
-rw-r--r--mysql-test/r/handlersocket.result2
-rw-r--r--mysql-test/r/have_ndb_extra.require3
-rw-r--r--mysql-test/r/have_ndbapi_examples.require2
-rw-r--r--mysql-test/r/having.result20
-rw-r--r--mysql-test/r/help.result2
-rw-r--r--mysql-test/r/host_cache_size_functionality.result2
-rw-r--r--mysql-test/r/implicit_commit.result1
-rw-r--r--mysql-test/r/index_intersect.result5
-rw-r--r--mysql-test/r/index_intersect_innodb.result2
-rw-r--r--mysql-test/r/index_merge_myisam.result2
-rw-r--r--mysql-test/r/information_schema-big.result6
-rw-r--r--mysql-test/r/information_schema.result137
-rw-r--r--mysql-test/r/information_schema_all_engines.result46
-rw-r--r--mysql-test/r/information_schema_db.result3
-rw-r--r--mysql-test/r/information_schema_inno.result5
-rw-r--r--mysql-test/r/information_schema_linux.result7
-rw-r--r--mysql-test/r/information_schema_routines.result2
-rw-r--r--mysql-test/r/innodb_ext_key.result148
-rw-r--r--mysql-test/r/innodb_group.result13
-rw-r--r--mysql-test/r/innodb_icp.result14
-rw-r--r--mysql-test/r/innodb_load_xa.result11
-rw-r--r--mysql-test/r/innodb_mrr_cpk.result2
-rw-r--r--mysql-test/r/insert.result34
-rw-r--r--mysql-test/r/insert_notembedded.result4
-rw-r--r--mysql-test/r/insert_update.result4
-rw-r--r--mysql-test/r/join.result3
-rw-r--r--mysql-test/r/join_cache.result67
-rw-r--r--mysql-test/r/join_outer.result95
-rw-r--r--mysql-test/r/join_outer_jcl6.result95
-rw-r--r--mysql-test/r/key.result12
-rw-r--r--mysql-test/r/kill.result17
-rw-r--r--mysql-test/r/loaddata.result24
-rw-r--r--mysql-test/r/loadxml.result11
-rw-r--r--mysql-test/r/lock_multi.result2
-rw-r--r--mysql-test/r/log_slow.result3
-rw-r--r--mysql-test/r/log_state.result17
-rw-r--r--mysql-test/r/log_tables.result44
-rw-r--r--mysql-test/r/log_tables_upgrade.result13
-rw-r--r--mysql-test/r/lowercase_fs_off.result3
-rw-r--r--mysql-test/r/lowercase_table4.result3
-rw-r--r--mysql-test/r/lowercase_table_grant.result1
-rw-r--r--mysql-test/r/lowercase_table_qcache.result5
-rw-r--r--mysql-test/r/max_statement_time.result183
-rw-r--r--mysql-test/r/mdl_sync.result15
-rw-r--r--mysql-test/r/merge.result13
-rw-r--r--mysql-test/r/metadata.result4
-rw-r--r--mysql-test/r/mix2_myisam.result10
-rw-r--r--mysql-test/r/multi_update.result5
-rw-r--r--mysql-test/r/myisam-optimize.result69
-rw-r--r--mysql-test/r/myisam-system.result6
-rw-r--r--mysql-test/r/myisam.result8
-rw-r--r--mysql-test/r/myisam_explain_non_select_all.result9
-rw-r--r--mysql-test/r/myisam_icp.result20
-rw-r--r--mysql-test/r/mysql.result15
-rw-r--r--mysql-test/r/mysql_comments.result2
-rw-r--r--mysql-test/r/mysql_plugin.result132
-rw-r--r--mysql-test/r/mysql_tzinfo_to_sql_symlink.result20
-rw-r--r--mysql-test/r/mysql_upgrade-6984.result13
-rw-r--r--mysql-test/r/mysql_upgrade.result182
-rw-r--r--mysql-test/r/mysql_upgrade_no_innodb.result13
-rw-r--r--mysql-test/r/mysql_upgrade_noengine.result297
-rw-r--r--mysql-test/r/mysql_upgrade_ssl.result13
-rw-r--r--mysql-test/r/mysql_upgrade_view.result40
-rw-r--r--mysql-test/r/mysqlbinlog-innodb.result4
-rw-r--r--mysql-test/r/mysqlbinlog.result20
-rw-r--r--mysql-test/r/mysqlbinlog_raw_mode.result274
-rw-r--r--mysql-test/r/mysqlbinlog_row_big.result2
-rw-r--r--mysql-test/r/mysqlbinlog_row_minimal.result300
-rw-r--r--mysql-test/r/mysqlcheck.result2
-rw-r--r--mysql-test/r/mysqld--help,win.rdiff71
-rw-r--r--mysql-test/r/mysqld--help.result322
-rw-r--r--mysql-test/r/mysqld_help_crash-9183.result3
-rw-r--r--mysql-test/r/mysqldump-max.result10
-rw-r--r--mysql-test/r/mysqldump-nl.result2
-rw-r--r--mysql-test/r/mysqldump.result219
-rw-r--r--mysql-test/r/mysqltest.result4
-rw-r--r--mysql-test/r/ndb_default_cluster.require2
-rw-r--r--mysql-test/r/not_embedded_server.result4
-rw-r--r--mysql-test/r/not_ndb.require2
-rw-r--r--mysql-test/r/not_ndb_default.require2
-rw-r--r--mysql-test/r/null.result1218
-rw-r--r--mysql-test/r/old-mode.result58
-rw-r--r--mysql-test/r/openssl_1.result7
-rw-r--r--mysql-test/r/openssl_6975,tlsv10.result12
-rw-r--r--mysql-test/r/openssl_6975,tlsv12.result8
-rw-r--r--mysql-test/r/order_by.result207
-rw-r--r--mysql-test/r/order_by_innodb.result37
-rw-r--r--mysql-test/r/order_by_optimizer_innodb.result98
-rw-r--r--mysql-test/r/parser.result234
-rw-r--r--mysql-test/r/partition.result13
-rw-r--r--mysql-test/r/partition_alter.result61
-rw-r--r--mysql-test/r/partition_bug18198.result3
-rw-r--r--mysql-test/r/partition_cache.result3
-rw-r--r--mysql-test/r/partition_cache_innodb.result3
-rw-r--r--mysql-test/r/partition_cache_myisam.result3
-rw-r--r--mysql-test/r/partition_column.result2
-rw-r--r--mysql-test/r/partition_datatype.result18
-rw-r--r--mysql-test/r/partition_example.result4
-rw-r--r--mysql-test/r/partition_exchange.result62
-rw-r--r--mysql-test/r/partition_grant.result1
-rw-r--r--mysql-test/r/partition_hash.result2
-rw-r--r--mysql-test/r/partition_innodb.result2
-rw-r--r--mysql-test/r/partition_innodb_plugin.result2
-rw-r--r--mysql-test/r/partition_not_blackhole.result2
-rw-r--r--mysql-test/r/partition_pruning.result81
-rw-r--r--mysql-test/r/partition_symlink.result6
-rw-r--r--mysql-test/r/partition_windows.result4
-rw-r--r--mysql-test/r/perror.result2
-rw-r--r--mysql-test/r/plugin.result31
-rw-r--r--mysql-test/r/plugin_auth.result5
-rw-r--r--mysql-test/r/plugin_auth_qa.result1
-rw-r--r--mysql-test/r/plugin_loaderr.result2
-rw-r--r--mysql-test/r/plugin_not_embedded.result1
-rw-r--r--mysql-test/r/processlist.result18
-rw-r--r--mysql-test/r/ps.result84
-rw-r--r--mysql-test/r/ps_1general.result15
-rw-r--r--mysql-test/r/ps_2myisam.result37
-rw-r--r--mysql-test/r/ps_3innodb.result37
-rw-r--r--mysql-test/r/ps_4heap.result37
-rw-r--r--mysql-test/r/ps_5merge.result78
-rw-r--r--mysql-test/r/ps_ddl.result29
-rw-r--r--mysql-test/r/query_cache.result15
-rw-r--r--mysql-test/r/query_cache_debug.result1
-rw-r--r--mysql-test/r/query_cache_merge.result5
-rw-r--r--mysql-test/r/query_cache_notembedded.result12
-rw-r--r--mysql-test/r/query_cache_ps_no_prot.result3
-rw-r--r--mysql-test/r/query_cache_ps_ps_prot.result3
-rw-r--r--mysql-test/r/query_cache_with_views.result3
-rw-r--r--mysql-test/r/range.result96
-rw-r--r--mysql-test/r/range_mrr_icp.result96
-rw-r--r--mysql-test/r/read_only.result5
-rw-r--r--mysql-test/r/read_only_innodb.result2
-rw-r--r--mysql-test/r/repair.result2
-rw-r--r--mysql-test/r/repair_symlink-5543.result8
-rw-r--r--mysql-test/r/row.result36
-rw-r--r--mysql-test/r/select.result15
-rw-r--r--mysql-test/r/select_jcl6.result15
-rw-r--r--mysql-test/r/select_pkeycache.result15
-rw-r--r--mysql-test/r/selectivity.result19
-rw-r--r--mysql-test/r/selectivity_innodb.result34
-rw-r--r--mysql-test/r/servers.result20
-rw-r--r--mysql-test/r/set_password_plugin-9835.result6
-rw-r--r--mysql-test/r/set_statement.result1223
-rw-r--r--mysql-test/r/set_statement_debug.result22
-rw-r--r--mysql-test/r/set_statement_notembedded.result18
-rw-r--r--mysql-test/r/set_statement_notembedded_binlog.result108
-rw-r--r--mysql-test/r/set_statement_profiling.result4
-rw-r--r--mysql-test/r/show.result12
-rw-r--r--mysql-test/r/show_check.result107
-rw-r--r--mysql-test/r/show_explain.result7
-rw-r--r--mysql-test/r/show_grants_with_plugin-7985.result8
-rw-r--r--mysql-test/r/single_delete_update.result32
-rw-r--r--mysql-test/r/single_delete_update_innodb.result32
-rw-r--r--mysql-test/r/skip_grants.result15
-rw-r--r--mysql-test/r/skip_name_resolve.result1
-rw-r--r--mysql-test/r/slowlog_enospace-10508.result60
-rw-r--r--mysql-test/r/sp-destruct.result3
-rw-r--r--mysql-test/r/sp-error.result30
-rw-r--r--mysql-test/r/sp-lock.result2
-rw-r--r--mysql-test/r/sp-security.result37
-rw-r--r--mysql-test/r/sp-ucs2.result18
-rw-r--r--mysql-test/r/sp.result269
-rw-r--r--mysql-test/r/sp_notembedded.result3
-rw-r--r--mysql-test/r/sp_trans.result1
-rw-r--r--mysql-test/r/sql_mode.result2
-rw-r--r--mysql-test/r/ssl.result9
-rw-r--r--mysql-test/r/stack-crash.result10
-rw-r--r--mysql-test/r/stat_tables_par.result12
-rw-r--r--mysql-test/r/stat_tables_par_innodb.result12
-rw-r--r--mysql-test/r/stat_tables_rbr.result25
-rw-r--r--mysql-test/r/statistics.result60
-rw-r--r--mysql-test/r/statistics_index_crash-7362.result2
-rw-r--r--mysql-test/r/status.result1
-rw-r--r--mysql-test/r/status_user.result223
-rw-r--r--mysql-test/r/strict.result24
-rw-r--r--mysql-test/r/subselect.result81
-rw-r--r--mysql-test/r/subselect2.result4
-rw-r--r--mysql-test/r/subselect3.result1
-rw-r--r--mysql-test/r/subselect3_jcl6.result1
-rw-r--r--mysql-test/r/subselect4.result16
-rw-r--r--mysql-test/r/subselect_cache.result225
-rw-r--r--mysql-test/r/subselect_innodb.result41
-rw-r--r--mysql-test/r/subselect_mat.result59
-rw-r--r--mysql-test/r/subselect_no_exists_to_in.result81
-rw-r--r--mysql-test/r/subselect_no_mat.result81
-rw-r--r--mysql-test/r/subselect_no_opts.result81
-rw-r--r--mysql-test/r/subselect_no_scache.result81
-rw-r--r--mysql-test/r/subselect_no_semijoin.result81
-rw-r--r--mysql-test/r/subselect_sj.result14
-rw-r--r--mysql-test/r/subselect_sj2.result23
-rw-r--r--mysql-test/r/subselect_sj2_jcl6.result23
-rw-r--r--mysql-test/r/subselect_sj2_mat.result23
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result14
-rw-r--r--mysql-test/r/subselect_sj_mat.result44
-rw-r--r--mysql-test/r/symlink.result15
-rw-r--r--mysql-test/r/system_mysql_db.result5
-rw-r--r--mysql-test/r/system_mysql_db_fix30020.result311
-rw-r--r--mysql-test/r/system_mysql_db_fix40123.result5
-rw-r--r--mysql-test/r/system_mysql_db_fix50030.result5
-rw-r--r--mysql-test/r/system_mysql_db_fix50117.result5
-rw-r--r--mysql-test/r/table_elim.result10
-rw-r--r--mysql-test/r/table_options-5867.result4
-rw-r--r--mysql-test/r/temp_table.result19
-rw-r--r--mysql-test/r/temp_table_frm.result21
-rw-r--r--mysql-test/r/temporal_literal.result68
-rw-r--r--mysql-test/r/timezone_grant.result2
-rw-r--r--mysql-test/r/trigger-compat.result4
-rw-r--r--mysql-test/r/trigger.result45
-rw-r--r--mysql-test/r/trigger_no_defaults-11698.result40
-rw-r--r--mysql-test/r/trigger_notembedded.result15
-rw-r--r--mysql-test/r/trigger_null-8605.result366
-rw-r--r--mysql-test/r/truncate.result2
-rw-r--r--mysql-test/r/type_bit.result24
-rw-r--r--mysql-test/r/type_blob.result8
-rw-r--r--mysql-test/r/type_date.result371
-rw-r--r--mysql-test/r/type_datetime.result318
-rw-r--r--mysql-test/r/type_decimal.result9
-rw-r--r--mysql-test/r/type_enum.result52
-rw-r--r--mysql-test/r/type_float.result116
-rw-r--r--mysql-test/r/type_int.result38
-rw-r--r--mysql-test/r/type_newdecimal.result292
-rw-r--r--mysql-test/r/type_num.result1251
-rw-r--r--mysql-test/r/type_ranges.result21
-rw-r--r--mysql-test/r/type_set.result52
-rw-r--r--mysql-test/r/type_temporal_innodb.result156
-rw-r--r--mysql-test/r/type_time.result824
-rw-r--r--mysql-test/r/type_time_6065.result48
-rw-r--r--mysql-test/r/type_timestamp.result255
-rw-r--r--mysql-test/r/type_timestamp_hires.result12
-rw-r--r--mysql-test/r/type_varchar.result62
-rw-r--r--mysql-test/r/type_year.result45
-rw-r--r--mysql-test/r/union.result234
-rw-r--r--mysql-test/r/update_innodb.result26
-rw-r--r--mysql-test/r/upgrade.result2
-rw-r--r--mysql-test/r/user_limits.result5
-rw-r--r--mysql-test/r/user_var-binlog.result2
-rw-r--r--mysql-test/r/user_var.result16
-rw-r--r--mysql-test/r/userstat.result229
-rw-r--r--mysql-test/r/varbinary.result4
-rw-r--r--mysql-test/r/variables-notembedded.result43
-rw-r--r--mysql-test/r/variables.result34
-rw-r--r--mysql-test/r/view.result157
-rw-r--r--mysql-test/r/view_debug.result20
-rw-r--r--mysql-test/r/view_grant.result76
-rw-r--r--mysql-test/r/warnings_engine_disabled.result2
-rw-r--r--mysql-test/r/xa_sync.result24
-rw-r--r--mysql-test/r/xml.result6
-rw-r--r--mysql-test/std_data/Index.xml10
-rw-r--r--mysql-test/std_data/bad2_master.info35
-rw-r--r--mysql-test/std_data/bad3_master.info37
-rw-r--r--mysql-test/std_data/bad4_master.info35
-rw-r--r--mysql-test/std_data/bad5_master.info35
-rw-r--r--mysql-test/std_data/bad6_master.info36
-rw-r--r--mysql-test/std_data/bad_master.info35
-rw-r--r--mysql-test/std_data/binlog-header.logbin0 -> 120 bytes
-rw-r--r--mysql-test/std_data/cacert.pem115
-rw-r--r--mysql-test/std_data/cakey.pem28
-rw-r--r--mysql-test/std_data/client-cert.pem90
-rw-r--r--mysql-test/std_data/client-key.pem26
-rw-r--r--mysql-test/std_data/empty_file0
-rw-r--r--mysql-test/std_data/funcs_1/ndb_tb1.txt10
-rw-r--r--mysql-test/std_data/funcs_1/ndb_tb2.txt10
-rw-r--r--mysql-test/std_data/funcs_1/ndb_tb3.txt10
-rw-r--r--mysql-test/std_data/funcs_1/ndb_tb4.txt10
-rw-r--r--mysql-test/std_data/galera-cert.pem26
-rw-r--r--mysql-test/std_data/galera-key.pem28
-rw-r--r--mysql-test/std_data/galera-upgrade-ca-cert.pem40
-rw-r--r--mysql-test/std_data/galera-upgrade-server-cert.pem20
-rw-r--r--mysql-test/std_data/galera-upgrade-server-key.pem28
-rw-r--r--mysql-test/std_data/keys.txt12
-rw-r--r--mysql-test/std_data/keys2.txt8
-rw-r--r--mysql-test/std_data/keys3.txt7
-rw-r--r--mysql-test/std_data/loaddata/mdev12696.xml9
-rw-r--r--mysql-test/std_data/logkey.txt2
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-1-0.1.Databin116228 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-1-0.2.Databin113556 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-1.1.ctlbin7936 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-1.1.logbin7592 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-1.2.ctlbin7936 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-1.2.logbin7128 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Databin19084 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Databin16392 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctlbin2592 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.1.logbin44 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctlbin2592 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.2.logbin44 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51/BACKUP-1-0.1.Databin110596 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51/BACKUP-1-0.2.Databin103180 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51/BACKUP-1.1.ctlbin12320 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51/BACKUP-1.1.logbin7592 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51/BACKUP-1.2.ctlbin12320 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51/BACKUP-1.2.logbin6996 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Databin43068 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Databin30276 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctlbin33964 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.logbin44 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctlbin33964 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.logbin44 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Databin23788 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Databin49556 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctlbin33964 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.logbin44 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctlbin33964 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.logbin44 -> 0 bytes
-rw-r--r--mysql-test/std_data/ndb_config_config.ini55
-rw-r--r--mysql-test/std_data/ndb_config_mycnf1.cnf15
-rw-r--r--mysql-test/std_data/ndb_config_mycnf2.cnf31
-rw-r--r--mysql-test/std_data/server-cert.pem90
-rw-r--r--mysql-test/std_data/server-key.pem26
-rw-r--r--mysql-test/std_data/server8k-cert.pem248
-rw-r--r--mysql-test/std_data/server8k-key.pem194
-rw-r--r--mysql-test/std_data/serversan-cert.pem60
-rw-r--r--mysql-test/std_data/serversan-key.pem16
-rwxr-xr-xmysql-test/std_data/wsrep_notify.sh99
-rw-r--r--mysql-test/suite.pm17
-rw-r--r--mysql-test/suite/archive/archive.result2
-rw-r--r--mysql-test/suite/archive/archive_gis.result8
-rw-r--r--mysql-test/suite/archive/archive_plugin.result5
-rw-r--r--mysql-test/suite/archive/archive_plugin.test2
-rw-r--r--mysql-test/suite/archive/discover_5438.result1
-rw-r--r--mysql-test/suite/archive/discover_5438.test1
-rw-r--r--mysql-test/suite/binlog/r/binlog_database.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_dmls_on_tmp_tables_readonly.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result78
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_gtid_delete_domain_debug.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb_row.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_mdev717.result40
-rw-r--r--mysql-test/suite/binlog/r/binlog_multi_engine.result106
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result661
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result814
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result774
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result47
-rw-r--r--mysql-test/suite/binlog/r/binlog_old_versions.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result94
-rw-r--r--mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result93
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_annotate.result154
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result14
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result24
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result46
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result24
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_log_bin.result9
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result9
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_relay_log.result15
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result15
-rw-r--r--mysql-test/suite/binlog/r/mysqladmin.result12
-rw-r--r--mysql-test/suite/binlog/t/binlog_dmls_on_tmp_tables_readonly.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test137
-rw-r--r--mysql-test/suite/binlog/t/binlog_grant.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_gtid_delete_domain_debug.test11
-rw-r--r--mysql-test/suite/binlog/t/binlog_incident.test30
-rw-r--r--mysql-test/suite/binlog/t/binlog_index.test267
-rw-r--r--mysql-test/suite/binlog/t/binlog_ioerr.test31
-rw-r--r--mysql-test/suite/binlog/t/binlog_mdev717.test46
-rw-r--r--mysql-test/suite/binlog/t/binlog_multi_engine.test110
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test27
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_old_versions.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_parallel_replication_marks_row.test3
-rw-r--r--mysql-test/suite/binlog/t/binlog_parallel_replication_marks_stm_mix.test3
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_annotate.test190
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_verbose.test19
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt2
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt2
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_write_error.test103
-rw-r--r--mysql-test/suite/binlog/t/binlog_xa_recover.test276
-rw-r--r--mysql-test/suite/binlog/t/mysqladmin.test12
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_incident.combinations8
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_incident.result13
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_incident.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_index.result187
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_index.test1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_ioerr.result32
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_ioerr.test1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932-master.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.result19
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate-master.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.result723
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_write_error.result108
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_write_error.test1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_xa_recover.result216
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_xa_recover.test1
-rw-r--r--mysql-test/suite/binlog_encryption/disabled.def2
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master.result622
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master.test183
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_lost_key.result111
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_lost_key.test205
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf5
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result87
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test151
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_slave.cnf12
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_slave.result175
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_slave.test117
-rw-r--r--mysql-test/suite/binlog_encryption/encryption_algorithms.combinations5
-rw-r--r--mysql-test/suite/binlog_encryption/encryption_algorithms.inc2
-rw-r--r--mysql-test/suite/binlog_encryption/encryption_combo.cnf5
-rw-r--r--mysql-test/suite/binlog_encryption/encryption_combo.result78
-rw-r--r--mysql-test/suite/binlog_encryption/encryption_combo.test136
-rw-r--r--mysql-test/suite/binlog_encryption/multisource.cnf17
-rw-r--r--mysql-test/suite/binlog_encryption/multisource.result205
-rw-r--r--mysql-test/suite/binlog_encryption/multisource.test2
-rw-r--r--mysql-test/suite/binlog_encryption/my.cnf27
-rw-r--r--mysql-test/suite/binlog_encryption/mysqlbinlog.result6
-rw-r--r--mysql-test/suite/binlog_encryption/mysqlbinlog.test21
-rw-r--r--mysql-test/suite/binlog_encryption/restart_server.inc35
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_binlog_errors.cnf7
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_binlog_errors.result275
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_binlog_errors.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result21
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum.cnf10
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum.result161
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum_cache.result119
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum_cache.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_corruption.cnf9
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_corruption.result51
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_corruption.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_gtid_basic.cnf24
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_gtid_basic.result481
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_gtid_basic.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_incident.cnf7
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_incident.result38
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_incident.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result19
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loaddata_local.result125
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loaddata_local.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loadfile.result242
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loadfile.test11
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result186
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test7
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_packet.cnf10
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_packet.result58
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_packet.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel.result1774
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.cnf6
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.result12
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_relayrotate-slave.opt5
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_relayrotate.result13
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_relayrotate.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_semi_sync.result465
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_semi_sync.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_skip_replication.cnf6
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_skip_replication.result252
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_skip_replication.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_special_charset.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_special_charset.result8
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_special_charset.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sporadic_master-master.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sporadic_master.result23
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sporadic_master.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_ssl.result47
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_ssl.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space-slave.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.result5
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result428
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync-master.opt2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync-slave.opt2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync.result41
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.cnf6
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.result83
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.cnf6
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.result85
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test6
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.cnf6
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.result85
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test4
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_typeconv.result540
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_typeconv.test1
-rw-r--r--mysql-test/suite/binlog_encryption/suite.pm18
-rw-r--r--mysql-test/suite/binlog_encryption/testdata.inc207
-rw-r--r--mysql-test/suite/binlog_encryption/testdata.opt1
-rw-r--r--mysql-test/suite/csv/csv.result54
-rw-r--r--mysql-test/suite/csv/csv.test43
-rw-r--r--mysql-test/suite/encryption/disabled.def15
-rw-r--r--mysql-test/suite/encryption/include/have_example_key_management_plugin.inc4
-rw-r--r--mysql-test/suite/encryption/include/have_example_key_management_plugin.opt2
-rw-r--r--mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations11
-rw-r--r--mysql-test/suite/encryption/include/have_file_key_management_plugin.inc4
-rw-r--r--mysql-test/suite/encryption/include/innodb-util.pl126
-rw-r--r--mysql-test/suite/encryption/r/aria_tiny.result5
-rw-r--r--mysql-test/suite/encryption/r/create_or_replace.result21
-rw-r--r--mysql-test/suite/encryption/r/debug_key_management.result17
-rw-r--r--mysql-test/suite/encryption/r/encrypt_and_grep.result74
-rw-r--r--mysql-test/suite/encryption/r/encryption_force.result60
-rw-r--r--mysql-test/suite/encryption/r/filekeys_emptyfile.result10
-rw-r--r--mysql-test/suite/encryption/r/filekeys_encfile.result38
-rw-r--r--mysql-test/suite/encryption/r/filekeys_encfile_bad.result9
-rw-r--r--mysql-test/suite/encryption/r/filekeys_encfile_badfile.result9
-rw-r--r--mysql-test/suite/encryption/r/filekeys_encfile_file.result38
-rw-r--r--mysql-test/suite/encryption/r/filekeys_encfile_no.result9
-rw-r--r--mysql-test/suite/encryption/r/filekeys_nofile.result9
-rw-r--r--mysql-test/suite/encryption/r/filekeys_syntax.result149
-rw-r--r--mysql-test/suite/encryption/r/filekeys_tooshort.result10
-rw-r--r--mysql-test/suite/encryption/r/filekeys_unencfile.result9
-rw-r--r--mysql-test/suite/encryption/r/innochecksum.result45
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result116
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result59
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change3.result43
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result24
-rw-r--r--mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff38
-rw-r--r--mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff38
-rw-r--r--mysql-test/suite/encryption/r/innodb-checksum-algorithm.result646
-rw-r--r--mysql-test/suite/encryption/r/innodb-compressed-blob.result23
-rw-r--r--mysql-test/suite/encryption/r/innodb-discard-import-change.result105
-rw-r--r--mysql-test/suite/encryption/r/innodb-discard-import.result136
-rw-r--r--mysql-test/suite/encryption/r/innodb-encr-threads.result7
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-alter.result52
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-disable.result26
-rw-r--r--mysql-test/suite/encryption/r/innodb-first-page-read.result98
-rw-r--r--mysql-test/suite/encryption/r/innodb-force-corrupt.result29
-rw-r--r--mysql-test/suite/encryption/r/innodb-key-rotation-disable.result62
-rw-r--r--mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result19
-rw-r--r--mysql-test/suite/encryption/r/innodb-log-encrypt.result55
-rw-r--r--mysql-test/suite/encryption/r/innodb-missing-key.result54
-rw-r--r--mysql-test/suite/encryption/r/innodb-page_encryption-32k.result125
-rw-r--r--mysql-test/suite/encryption/r/innodb-page_encryption.result277
-rw-r--r--mysql-test/suite/encryption/r/innodb-page_encryption_compression.result73
-rw-r--r--mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result128
-rw-r--r--mysql-test/suite/encryption/r/innodb-read-only.result3
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-badkey.result45
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-nokeys.result37
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption-page-compression.result184
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption.result69
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_discard_import.result123
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_filekeys.result67
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_is.result14
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_row_compressed.result153
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_tables.result161
-rw-r--r--mysql-test/suite/encryption/r/innodb_first_page.result5
-rw-r--r--mysql-test/suite/encryption/r/innodb_lotoftables.result1235
-rw-r--r--mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result141
-rw-r--r--mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result153
-rw-r--r--mysql-test/suite/encryption/r/innodb_scrub.result138
-rw-r--r--mysql-test/suite/encryption/r/innodb_scrub_background.result160
-rw-r--r--mysql-test/suite/encryption/r/second_plugin-12863.result7
-rw-r--r--mysql-test/suite/encryption/r/tempfiles.result46
-rw-r--r--mysql-test/suite/encryption/suite.pm16
-rw-r--r--mysql-test/suite/encryption/t/aria_tiny.test12
-rw-r--r--mysql-test/suite/encryption/t/create_or_replace.opt1
-rw-r--r--mysql-test/suite/encryption/t/create_or_replace.test142
-rw-r--r--mysql-test/suite/encryption/t/debug_key_management.opt5
-rw-r--r--mysql-test/suite/encryption/t/debug_key_management.test26
-rw-r--r--mysql-test/suite/encryption/t/encrypt_and_grep.opt7
-rw-r--r--mysql-test/suite/encryption/t/encrypt_and_grep.test127
-rw-r--r--mysql-test/suite/encryption/t/encryption_force.opt2
-rw-r--r--mysql-test/suite/encryption/t/encryption_force.test39
-rw-r--r--mysql-test/suite/encryption/t/filekeys-data.encbin0 -> 416 bytes
-rw-r--r--mysql-test/suite/encryption/t/filekeys-data.key2
-rw-r--r--mysql-test/suite/encryption/t/filekeys-tooshort.enc1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_badtest.inc18
-rw-r--r--mysql-test/suite/encryption/t/filekeys_emptyfile.opt1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_emptyfile.test4
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile.opt2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile.test1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_bad.opt2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_bad.test2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_badfile.opt2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_badfile.test2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_file.opt2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_file.test1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_no.opt1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_encfile_no.test2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_goodtest.inc18
-rw-r--r--mysql-test/suite/encryption/t/filekeys_nofile.test2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_plugin.inc4
-rw-r--r--mysql-test/suite/encryption/t/filekeys_plugin.opt1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_plugin_exists.inc4
-rw-r--r--mysql-test/suite/encryption/t/filekeys_syntax.opt1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_syntax.test109
-rw-r--r--mysql-test/suite/encryption/t/filekeys_tooshort.opt3
-rw-r--r--mysql-test/suite/encryption/t/filekeys_tooshort.test4
-rw-r--r--mysql-test/suite/encryption/t/filekeys_unencfile.opt2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_unencfile.test2
-rw-r--r--mysql-test/suite/encryption/t/innochecksum.test285
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test123
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test103
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change3.test121
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.opt4
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test43
-rw-r--r--mysql-test/suite/encryption/t/innodb-checksum-algorithm.test123
-rw-r--r--mysql-test/suite/encryption/t/innodb-compressed-blob.combinations12
-rw-r--r--mysql-test/suite/encryption/t/innodb-compressed-blob.test43
-rw-r--r--mysql-test/suite/encryption/t/innodb-discard-import-change.test131
-rw-r--r--mysql-test/suite/encryption/t/innodb-discard-import.test135
-rw-r--r--mysql-test/suite/encryption/t/innodb-encr-threads.test14
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-alter.test96
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-disable.test52
-rw-r--r--mysql-test/suite/encryption/t/innodb-first-page-read.opt5
-rw-r--r--mysql-test/suite/encryption/t/innodb-first-page-read.test109
-rw-r--r--mysql-test/suite/encryption/t/innodb-force-corrupt.test92
-rw-r--r--mysql-test/suite/encryption/t/innodb-key-rotation-disable.opt5
-rw-r--r--mysql-test/suite/encryption/t/innodb-key-rotation-disable.test88
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt6
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test41
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt.opt6
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt.test97
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.opt5
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.test66
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption-32k.opt2
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption-32k.test96
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption.test169
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption_compression.test81
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.opt3
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test113
-rw-r--r--mysql-test/suite/encryption/t/innodb-read-only.opt3
-rw-r--r--mysql-test/suite/encryption/t/innodb-read-only.test34
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-badkey.opt5
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-badkey.test100
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-nokeys.opt3
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-nokeys.test80
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption-page-compression.opt7
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption-page-compression.test136
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption.opt8
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption.test78
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_discard_import.opt8
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_discard_import.test163
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_filekeys.opt1
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_filekeys.test145
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_is.opt1
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_is.test31
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_row_compressed.opt4
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_row_compressed.test125
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_tables.opt7
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_tables.test114
-rw-r--r--mysql-test/suite/encryption/t/innodb_first_page.opt2
-rw-r--r--mysql-test/suite/encryption/t/innodb_first_page.test32
-rw-r--r--mysql-test/suite/encryption/t/innodb_lotoftables.opt3
-rw-r--r--mysql-test/suite/encryption/t/innodb_lotoftables.test240
-rw-r--r--mysql-test/suite/encryption/t/innodb_onlinealter_encryption.opt5
-rw-r--r--mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test143
-rw-r--r--mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test96
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub.opt9
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub.test147
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub_background.opt9
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub_background.test170
-rw-r--r--mysql-test/suite/encryption/t/second_plugin-12863.test16
-rw-r--r--mysql-test/suite/encryption/t/tempfiles.test74
-rw-r--r--mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result5
-rw-r--r--mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result5
-rw-r--r--mysql-test/suite/engines/funcs/r/jp_comment_older_compatibility1.result10
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_bit.test1
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_loadfile.test4
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_log_pos.test1
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_ps.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test1
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test1
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_sp005.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_sp009.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_until.test1
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_view01.test7
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_sp_effects.test1
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test1
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_number.result18
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_year.result8
-rw-r--r--mysql-test/suite/engines/iuds/r/update_decimal.result4
-rw-r--r--mysql-test/suite/engines/iuds/t/type_bit_iuds.test128
-rwxr-xr-xmysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl3
-rw-r--r--mysql-test/suite/federated/assisted_discovery.result32
-rw-r--r--mysql-test/suite/federated/assisted_discovery.test24
-rw-r--r--mysql-test/suite/federated/federated_bug_35333.result2
-rw-r--r--mysql-test/suite/federated/federated_server.result2
-rw-r--r--mysql-test/suite/federated/federated_server.test2
-rw-r--r--mysql-test/suite/federated/federatedx.result9
-rw-r--r--mysql-test/suite/federated/federatedx.test7
-rw-r--r--mysql-test/suite/federated/net_thd_crash-12725.result10
-rw-r--r--mysql-test/suite/federated/net_thd_crash-12725.test17
-rw-r--r--mysql-test/suite/federated/net_thd_crash-12951.result11
-rw-r--r--mysql-test/suite/federated/net_thd_crash-12951.test23
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_load.inc14
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_priv.inc4
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_routines.inc1
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_triggers.inc2
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_views.inc5
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_priv.inc34
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_val.inc15
-rw-r--r--mysql-test/suite/funcs_1/datadict/tables2.inc8
-rw-r--r--mysql-test/suite/funcs_1/include/innodb_tb4.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/memory_tb4.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/myisam_tb4.inc2
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb1.inc70
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb2.inc63
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb3.inc70
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb4.inc70
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result126
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_06.result3
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_08.result1
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result1
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0407.result3
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_08.result3
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_09.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns.result15
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_innodb.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result100
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result100
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_memory.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result34
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result21
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines_innodb,innodb_plugin.rdiff11
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines_innodb.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines.result1
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result3
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_innodb.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is.result150
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is_embedded.result150
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_memory.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_myisam.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_user_privileges.result66
-rw-r--r--mysql-test/suite/funcs_1/r/is_views.result35
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result126
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_06.result2
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0407.result2
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_08.result2
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_09.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result2
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result126
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_06.result2
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0407.result2
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_08.result2
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_09.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views-big.result2
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result167
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result167
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_no_prot.result48
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_ps.result48
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result32
-rw-r--r--mysql-test/suite/funcs_1/storedproc/storedproc_06.inc3
-rw-r--r--mysql-test/suite/funcs_1/t/innodb_storedproc_06.test1
-rw-r--r--mysql-test/suite/funcs_1/t/innodb_storedproc_08.test1
-rw-r--r--mysql-test/suite/funcs_1/t/innodb_trig_03.test1
-rw-r--r--mysql-test/suite/funcs_1/t/innodb_trig_0407.test1
-rw-r--r--mysql-test/suite/funcs_1/t/innodb_trig_08.test1
-rw-r--r--mysql-test/suite/funcs_1/t/is_columns_mysql.test1
-rw-r--r--mysql-test/suite/funcs_1/t/storedproc.test2
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_0407.inc4
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_08.inc2
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_09.inc3
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc2
-rw-r--r--mysql-test/suite/funcs_1/views/func_view.inc4
-rw-r--r--mysql-test/suite/funcs_1/views/views_master.inc11
-rw-r--r--mysql-test/suite/funcs_2/charset/charset_master.test4
-rw-r--r--mysql-test/suite/funcs_2/include/check_charset.inc4
-rw-r--r--mysql-test/suite/funcs_2/readme.txt5
-rw-r--r--mysql-test/suite/galera/disabled.def61
-rw-r--r--mysql-test/suite/galera/galera_2nodes.cnf46
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_master.cnf70
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf83
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf87
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_slave.cnf77
-rw-r--r--mysql-test/suite/galera/galera_3nodes_as_slave.cnf97
-rw-r--r--mysql-test/suite/galera/galera_4nodes.cnf74
-rw-r--r--mysql-test/suite/galera/include/auto_increment_offset_restore.inc41
-rw-r--r--mysql-test/suite/galera/include/auto_increment_offset_save.inc45
-rw-r--r--mysql-test/suite/galera/include/galera_have_debug_sync.inc9
-rw-r--r--mysql-test/suite/galera/include/galera_load_provider.inc10
-rw-r--r--mysql-test/suite/galera/include/galera_reset_cluster_address.inc12
-rw-r--r--mysql-test/suite/galera/include/galera_resume.inc9
-rw-r--r--mysql-test/suite/galera/include/galera_sst_restore.inc29
-rw-r--r--mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc24
-rw-r--r--mysql-test/suite/galera/include/galera_st_clean_slave.inc113
-rw-r--r--mysql-test/suite/galera/include/galera_st_disconnect_slave.inc105
-rw-r--r--mysql-test/suite/galera/include/galera_st_kill_slave.inc108
-rw-r--r--mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc123
-rw-r--r--mysql-test/suite/galera/include/galera_st_shutdown_slave.inc105
-rw-r--r--mysql-test/suite/galera/include/galera_unload_provider.inc7
-rw-r--r--mysql-test/suite/galera/include/galera_wsrep_recover.inc23
-rw-r--r--mysql-test/suite/galera/include/kill_galera.inc21
-rw-r--r--mysql-test/suite/galera/include/print_gtid.inc11
-rw-r--r--mysql-test/suite/galera/include/shutdown_mysqld.inc18
-rw-r--r--mysql-test/suite/galera/include/start_mysqld.inc22
-rw-r--r--mysql-test/suite/galera/my.cnf1
-rw-r--r--mysql-test/suite/galera/r/GAL-382.result6
-rw-r--r--mysql-test/suite/galera/r/GAL-401.result23
-rw-r--r--mysql-test/suite/galera/r/GAL-419.result4
-rw-r--r--mysql-test/suite/galera/r/GAL-480.result39
-rw-r--r--mysql-test/suite/galera/r/MW-252.result7
-rw-r--r--mysql-test/suite/galera/r/MW-258.result34
-rw-r--r--mysql-test/suite/galera/r/MW-259.result12
-rw-r--r--mysql-test/suite/galera/r/MW-284.result16
-rw-r--r--mysql-test/suite/galera/r/MW-285.result19
-rw-r--r--mysql-test/suite/galera/r/MW-286.result13
-rw-r--r--mysql-test/suite/galera/r/MW-292.result30
-rw-r--r--mysql-test/suite/galera/r/MW-309.result22
-rw-r--r--mysql-test/suite/galera/r/MW-313.result32
-rw-r--r--mysql-test/suite/galera/r/MW-328A.result21
-rw-r--r--mysql-test/suite/galera/r/MW-328B.result17
-rw-r--r--mysql-test/suite/galera/r/MW-328C.result17
-rw-r--r--mysql-test/suite/galera/r/MW-328D.result15
-rw-r--r--mysql-test/suite/galera/r/MW-328E.result15
-rw-r--r--mysql-test/suite/galera/r/MW-329.result21
-rw-r--r--mysql-test/suite/galera/r/MW-336.result42
-rw-r--r--mysql-test/suite/galera/r/MW-357.result6
-rw-r--r--mysql-test/suite/galera/r/MW-369.result155
-rw-r--r--mysql-test/suite/galera/r/MW-388.result46
-rw-r--r--mysql-test/suite/galera/r/MW-402.result192
-rw-r--r--mysql-test/suite/galera/r/MW-44.result14
-rw-r--r--mysql-test/suite/galera/r/MW-86-wait1.result48
-rw-r--r--mysql-test/suite/galera/r/MW-86-wait8.result50
-rw-r--r--mysql-test/suite/galera/r/basic.result30
-rw-r--r--mysql-test/suite/galera/r/binlog_checksum.result36
-rw-r--r--mysql-test/suite/galera/r/create.result84
-rw-r--r--mysql-test/suite/galera/r/enforce_storage_engine.result22
-rw-r--r--mysql-test/suite/galera/r/enforce_storage_engine2.result24
-rw-r--r--mysql-test/suite/galera/r/ev51914.result162
-rw-r--r--mysql-test/suite/galera/r/fk.result96
-rw-r--r--mysql-test/suite/galera/r/galera#414.result5
-rw-r--r--mysql-test/suite/galera/r/galera_account_management.result47
-rw-r--r--mysql-test/suite/galera/r/galera_admin.result43
-rw-r--r--mysql-test/suite/galera/r/galera_alter_engine_innodb.result10
-rw-r--r--mysql-test/suite/galera/r/galera_alter_engine_myisam.result11
-rw-r--r--mysql-test/suite/galera/r/galera_alter_table_force.result10
-rw-r--r--mysql-test/suite/galera/r/galera_applier_ftwrl_table.result15
-rw-r--r--mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result26
-rw-r--r--mysql-test/suite/galera/r/galera_as_master.result49
-rw-r--r--mysql-test/suite/galera/r/galera_as_master_gtid.result59
-rw-r--r--mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result15
-rw-r--r--mysql-test/suite/galera/r/galera_as_master_large.result30
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave.result15
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_autoinc.result80
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_gtid.result16
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_nonprim.result18
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_preordered.result19
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_replication_bundle.result15
-rw-r--r--mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result36
-rw-r--r--mysql-test/suite/galera/r/galera_bf_abort.result10
-rw-r--r--mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result15
-rw-r--r--mysql-test/suite/galera/r/galera_bf_abort_for_update.result10
-rw-r--r--mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result8
-rw-r--r--mysql-test/suite/galera/r/galera_bf_abort_get_lock.result12
-rw-r--r--mysql-test/suite/galera/r/galera_bf_abort_lock_table.result12
-rw-r--r--mysql-test/suite/galera/r/galera_bf_abort_sleep.result9
-rw-r--r--mysql-test/suite/galera/r/galera_bf_lock_wait.result18
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_cache_size.result12
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_checksum.result10
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result9
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result6
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_row_image.result79
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result12
-rw-r--r--mysql-test/suite/galera/r/galera_concurrent_ctas.result1
-rw-r--r--mysql-test/suite/galera/r/galera_create_function.result58
-rw-r--r--mysql-test/suite/galera/r/galera_create_procedure.result53
-rw-r--r--mysql-test/suite/galera/r/galera_create_table_like.result47
-rw-r--r--mysql-test/suite/galera/r/galera_create_trigger.result42
-rw-r--r--mysql-test/suite/galera/r/galera_ddl_multiline.result80
-rw-r--r--mysql-test/suite/galera/r/galera_defaults.result122
-rw-r--r--mysql-test/suite/galera/r/galera_delete_limit.result19
-rw-r--r--mysql-test/suite/galera/r/galera_desync_overlapped.result45
-rw-r--r--mysql-test/suite/galera/r/galera_drop_multi.result20
-rw-r--r--mysql-test/suite/galera/r/galera_enum.result37
-rw-r--r--mysql-test/suite/galera/r/galera_events.result18
-rw-r--r--mysql-test/suite/galera/r/galera_fk_cascade_delete.result30
-rw-r--r--mysql-test/suite/galera/r/galera_fk_cascade_update.result30
-rw-r--r--mysql-test/suite/galera/r/galera_fk_conflict.result23
-rw-r--r--mysql-test/suite/galera/r/galera_fk_mismatch.result25
-rw-r--r--mysql-test/suite/galera/r/galera_fk_multicolumn.result35
-rw-r--r--mysql-test/suite/galera/r/galera_fk_multitable.result22
-rw-r--r--mysql-test/suite/galera/r/galera_fk_no_pk.result28
-rw-r--r--mysql-test/suite/galera/r/galera_fk_selfreferential.result13
-rw-r--r--mysql-test/suite/galera/r/galera_fk_setnull.result30
-rw-r--r--mysql-test/suite/galera/r/galera_flush.result88
-rw-r--r--mysql-test/suite/galera/r/galera_flush_local.result145
-rw-r--r--mysql-test/suite/galera/r/galera_forced_binlog_format.result43
-rw-r--r--mysql-test/suite/galera/r/galera_ftwrl.result16
-rw-r--r--mysql-test/suite/galera/r/galera_ftwrl_drain.result26
-rw-r--r--mysql-test/suite/galera/r/galera_fulltext.result26
-rw-r--r--mysql-test/suite/galera/r/galera_gcache_recover.result18
-rw-r--r--mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result19
-rw-r--r--mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result107
-rw-r--r--mysql-test/suite/galera/r/galera_gcs_fc_limit.result17
-rw-r--r--mysql-test/suite/galera/r/galera_gcs_fragment.result24
-rw-r--r--mysql-test/suite/galera/r/galera_gcs_max_packet_size.result15
-rw-r--r--mysql-test/suite/galera/r/galera_gra_log.result41
-rw-r--r--mysql-test/suite/galera/r/galera_gtid.result12
-rw-r--r--mysql-test/suite/galera/r/galera_gtid_slave.result26
-rw-r--r--mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result130
-rw-r--r--mysql-test/suite/galera/r/galera_insert_ignore.result52
-rw-r--r--mysql-test/suite/galera/r/galera_insert_multi.result58
-rw-r--r--mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result184
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mysqldump.result285
-rw-r--r--mysql-test/suite/galera/r/galera_ist_progress.result19
-rw-r--r--mysql-test/suite/galera/r/galera_ist_recv_bind.result13
-rw-r--r--mysql-test/suite/galera/r/galera_ist_restart_joiner.result32
-rw-r--r--mysql-test/suite/galera/r/galera_ist_rsync.result358
-rw-r--r--mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result357
-rw-r--r--mysql-test/suite/galera/r/galera_kill_applier.result4
-rw-r--r--mysql-test/suite/galera/r/galera_kill_ddl.result8
-rw-r--r--mysql-test/suite/galera/r/galera_kill_largechanges.result14
-rw-r--r--mysql-test/suite/galera/r/galera_kill_nochanges.result10
-rw-r--r--mysql-test/suite/galera/r/galera_kill_smallchanges.result11
-rw-r--r--mysql-test/suite/galera/r/galera_lock_table.result21
-rw-r--r--mysql-test/suite/galera/r/galera_log_bin.result59
-rw-r--r--mysql-test/suite/galera/r/galera_log_output_csv.result18
-rw-r--r--mysql-test/suite/galera/r/galera_many_columns.result32
-rw-r--r--mysql-test/suite/galera/r/galera_many_indexes.result123
-rw-r--r--mysql-test/suite/galera/r/galera_many_rows.result32
-rw-r--r--mysql-test/suite/galera/r/galera_many_tables_nopk.result17
-rw-r--r--mysql-test/suite/galera/r/galera_many_tables_pk.result21
-rw-r--r--mysql-test/suite/galera/r/galera_mdev_10812.result11
-rw-r--r--mysql-test/suite/galera/r/galera_mdev_13787.result3
-rw-r--r--mysql-test/suite/galera/r/galera_mdl_race.result38
-rw-r--r--mysql-test/suite/galera/r/galera_migrate.result79
-rw-r--r--mysql-test/suite/galera/r/galera_multi_database.result28
-rw-r--r--mysql-test/suite/galera/r/galera_myisam_autocommit.result24
-rw-r--r--mysql-test/suite/galera/r/galera_myisam_transactions.result34
-rw-r--r--mysql-test/suite/galera/r/galera_nopk_bit.result27
-rw-r--r--mysql-test/suite/galera/r/galera_nopk_blob.result27
-rw-r--r--mysql-test/suite/galera/r/galera_nopk_large_varchar.result30
-rw-r--r--mysql-test/suite/galera/r/galera_nopk_unicode.result24
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result33
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result18
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result15
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_simple.result28
-rw-r--r--mysql-test/suite/galera/r/galera_pc_ignore_sb.result12
-rw-r--r--mysql-test/suite/galera/r/galera_pk_bigint_signed.result26
-rw-r--r--mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result23
-rw-r--r--mysql-test/suite/galera/r/galera_prepared_statement.result33
-rw-r--r--mysql-test/suite/galera/r/galera_query_cache.result57
-rw-r--r--mysql-test/suite/galera/r/galera_query_cache_sync_wait.result53
-rw-r--r--mysql-test/suite/galera/r/galera_read_only.result18
-rw-r--r--mysql-test/suite/galera/r/galera_repl_key_format_flat16.result18
-rw-r--r--mysql-test/suite/galera/r/galera_repl_max_ws_size.result12
-rw-r--r--mysql-test/suite/galera/r/galera_restart_nochanges.result9
-rw-r--r--mysql-test/suite/galera/r/galera_restart_on_unknown_option.result40
-rw-r--r--mysql-test/suite/galera/r/galera_roles.result195
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_add_pk.result26
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_drop_pk.result42
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_error.result21
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_simple.result21
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result41
-rw-r--r--mysql-test/suite/galera/r/galera_sbr.result14
-rw-r--r--mysql-test/suite/galera/r/galera_sbr_binlog.result14
-rw-r--r--mysql-test/suite/galera/r/galera_serializable.result27
-rw-r--r--mysql-test/suite/galera/r/galera_server.result20
-rw-r--r--mysql-test/suite/galera/r/galera_split_brain.result4
-rw-r--r--mysql-test/suite/galera/r/galera_sql_log_bin_zero.result12
-rw-r--r--mysql-test/suite/galera/r/galera_ssl.result18
-rw-r--r--mysql-test/suite/galera/r/galera_ssl_compression.result22
-rw-r--r--mysql-test/suite/galera/r/galera_ssl_upgrade.result15
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump.result460
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result109
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync.result359
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result3
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result359
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result3
-rw-r--r--mysql-test/suite/galera/r/galera_status_cluster.result12
-rw-r--r--mysql-test/suite/galera/r/galera_status_local_index.result13
-rw-r--r--mysql-test/suite/galera/r/galera_status_local_state.result14
-rw-r--r--mysql-test/suite/galera/r/galera_suspend_slave.result13
-rw-r--r--mysql-test/suite/galera/r/galera_sync_wait_show.result39
-rw-r--r--mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result42
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ddl_error.result19
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result31
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result23
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ddl_locking.result41
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result23
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ddl_sequential.result35
-rw-r--r--mysql-test/suite/galera/r/galera_toi_drop_database.result24
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ftwrl.result12
-rw-r--r--mysql-test/suite/galera/r/galera_toi_lock_exclusive.result17
-rw-r--r--mysql-test/suite/galera/r/galera_toi_lock_shared.result12
-rw-r--r--mysql-test/suite/galera/r/galera_toi_truncate.result15
-rw-r--r--mysql-test/suite/galera/r/galera_transaction_read_only.result21
-rw-r--r--mysql-test/suite/galera/r/galera_transaction_replay.result59
-rw-r--r--mysql-test/suite/galera/r/galera_truncate.result29
-rw-r--r--mysql-test/suite/galera/r/galera_truncate_temporary.result63
-rw-r--r--mysql-test/suite/galera/r/galera_unicode_identifiers.result46
-rw-r--r--mysql-test/suite/galera/r/galera_unicode_pk.result31
-rw-r--r--mysql-test/suite/galera/r/galera_update_limit.result17
-rw-r--r--mysql-test/suite/galera/r/galera_v1_row_events.result10
-rw-r--r--mysql-test/suite/galera/r/galera_var_OSU_method.result16
-rw-r--r--mysql-test/suite/galera/r/galera_var_OSU_method2.result19
-rw-r--r--mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result61
-rw-r--r--mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result30
-rw-r--r--mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result22
-rw-r--r--mysql-test/suite/galera/r/galera_var_cluster_address.result40
-rw-r--r--mysql-test/suite/galera/r/galera_var_desync_on.result31
-rw-r--r--mysql-test/suite/galera/r/galera_var_dirty_reads.result46
-rw-r--r--mysql-test/suite/galera/r/galera_var_fkchecks.result26
-rw-r--r--mysql-test/suite/galera/r/galera_var_gtid_domain_id.result74
-rw-r--r--mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result12
-rw-r--r--mysql-test/suite/galera/r/galera_var_load_data_splitting.result9
-rw-r--r--mysql-test/suite/galera/r/galera_var_log_bin.result10
-rw-r--r--mysql-test/suite/galera/r/galera_var_max_ws_rows.result135
-rw-r--r--mysql-test/suite/galera/r/galera_var_max_ws_size.result17
-rw-r--r--mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result12
-rw-r--r--mysql-test/suite/galera/r/galera_var_node_address.result11
-rw-r--r--mysql-test/suite/galera/r/galera_var_notify_cmd.result10
-rw-r--r--mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result8
-rw-r--r--mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result87
-rw-r--r--mysql-test/suite/galera/r/galera_var_retry_autocommit.result32
-rw-r--r--mysql-test/suite/galera/r/galera_var_slave_threads.result115
-rw-r--r--mysql-test/suite/galera/r/galera_var_sync_wait.result27
-rw-r--r--mysql-test/suite/galera/r/galera_var_wsrep_on_off.result19
-rw-r--r--mysql-test/suite/galera/r/galera_wan.result14
-rw-r--r--mysql-test/suite/galera/r/galera_wan_restart_ist.result53
-rw-r--r--mysql-test/suite/galera/r/galera_wan_restart_sst.result54
-rw-r--r--mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result33
-rw-r--r--mysql-test/suite/galera/r/galera_wsrep_log_conficts.result18
-rw-r--r--mysql-test/suite/galera/r/galera_wsrep_new_cluster.result36
-rw-r--r--mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result5
-rw-r--r--mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result14
-rw-r--r--mysql-test/suite/galera/r/galera_zero_length_column.result38
-rw-r--r--mysql-test/suite/galera/r/grant.result17
-rw-r--r--mysql-test/suite/galera/r/lp1276424.result11
-rw-r--r--mysql-test/suite/galera/r/lp1347768.result17
-rw-r--r--mysql-test/suite/galera/r/lp1376747-2.result19
-rw-r--r--mysql-test/suite/galera/r/lp1376747-3.result21
-rw-r--r--mysql-test/suite/galera/r/lp1376747-4.result40
-rw-r--r--mysql-test/suite/galera/r/lp1376747.result19
-rw-r--r--mysql-test/suite/galera/r/lp1438990.result21
-rw-r--r--mysql-test/suite/galera/r/lp959512.result24
-rw-r--r--mysql-test/suite/galera/r/mdev_10518.result74
-rw-r--r--mysql-test/suite/galera/r/mdev_9290.result14
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#110.result38
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#198.result21
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#201.result3
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#237.result11
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#247.result11
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#31.result10
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#33.result104
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#90.result31
-rw-r--r--mysql-test/suite/galera/r/partition.result140
-rw-r--r--mysql-test/suite/galera/r/pxc-421.result38
-rw-r--r--mysql-test/suite/galera/r/query_cache.result1645
-rw-r--r--mysql-test/suite/galera/r/rename.result39
-rw-r--r--mysql-test/suite/galera/r/rpl_row_annotate.result66
-rw-r--r--mysql-test/suite/galera/r/sql_log_bin.result53
-rw-r--r--mysql-test/suite/galera/r/unique_key.result47
-rw-r--r--mysql-test/suite/galera/r/view.result52
-rw-r--r--mysql-test/suite/galera/suite.pm86
-rw-r--r--mysql-test/suite/galera/t/GAL-382.test16
-rw-r--r--mysql-test/suite/galera/t/GAL-401.test56
-rw-r--r--mysql-test/suite/galera/t/GAL-419.test35
-rw-r--r--mysql-test/suite/galera/t/GAL-480.test46
-rw-r--r--mysql-test/suite/galera/t/MW-252.test42
-rw-r--r--mysql-test/suite/galera/t/MW-258.test42
-rw-r--r--mysql-test/suite/galera/t/MW-259.test42
-rw-r--r--mysql-test/suite/galera/t/MW-284.cnf1
-rw-r--r--mysql-test/suite/galera/t/MW-284.test63
-rw-r--r--mysql-test/suite/galera/t/MW-285.test31
-rw-r--r--mysql-test/suite/galera/t/MW-286.test33
-rw-r--r--mysql-test/suite/galera/t/MW-292.test79
-rw-r--r--mysql-test/suite/galera/t/MW-309.test32
-rw-r--r--mysql-test/suite/galera/t/MW-313-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-313.test51
-rw-r--r--mysql-test/suite/galera/t/MW-328-footer.inc18
-rw-r--r--mysql-test/suite/galera/t/MW-328-header.inc29
-rw-r--r--mysql-test/suite/galera/t/MW-328A.test56
-rw-r--r--mysql-test/suite/galera/t/MW-328B.test36
-rw-r--r--mysql-test/suite/galera/t/MW-328C.test36
-rw-r--r--mysql-test/suite/galera/t/MW-328D.test40
-rw-r--r--mysql-test/suite/galera/t/MW-328E.test41
-rw-r--r--mysql-test/suite/galera/t/MW-329-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-329.test85
-rw-r--r--mysql-test/suite/galera/t/MW-336.test64
-rw-r--r--mysql-test/suite/galera/t/MW-357.test13
-rw-r--r--mysql-test/suite/galera/t/MW-369.inc75
-rw-r--r--mysql-test/suite/galera/t/MW-369.test246
-rw-r--r--mysql-test/suite/galera/t/MW-388.test76
-rw-r--r--mysql-test/suite/galera/t/MW-402.test228
-rw-r--r--mysql-test/suite/galera/t/MW-44-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-44.test25
-rw-r--r--mysql-test/suite/galera/t/MW-86-wait1-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-86-wait1.test106
-rw-r--r--mysql-test/suite/galera/t/MW-86-wait8-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-86-wait8.test128
-rw-r--r--mysql-test/suite/galera/t/basic.test26
-rw-r--r--mysql-test/suite/galera/t/binlog_checksum.test36
-rw-r--r--mysql-test/suite/galera/t/create.test89
-rw-r--r--mysql-test/suite/galera/t/enforce_storage_engine.test33
-rw-r--r--mysql-test/suite/galera/t/enforce_storage_engine2.opt2
-rw-r--r--mysql-test/suite/galera/t/enforce_storage_engine2.test20
-rw-r--r--mysql-test/suite/galera/t/ev51914.test214
-rw-r--r--mysql-test/suite/galera/t/fk.test116
-rw-r--r--mysql-test/suite/galera/t/galera#414.cnf8
-rw-r--r--mysql-test/suite/galera/t/galera#414.test43
-rw-r--r--mysql-test/suite/galera/t/galera_account_management.test99
-rw-r--r--mysql-test/suite/galera/t/galera_admin.test86
-rw-r--r--mysql-test/suite/galera/t/galera_alter_engine_innodb.test17
-rw-r--r--mysql-test/suite/galera/t/galera_alter_engine_myisam.test25
-rw-r--r--mysql-test/suite/galera/t/galera_alter_table_force.test17
-rw-r--r--mysql-test/suite/galera/t/galera_applier_ftwrl_table.test34
-rw-r--r--mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test37
-rw-r--r--mysql-test/suite/galera/t/galera_as_master.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_as_master.test65
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid.cnf8
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid.test70
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf8
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test54
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_large.cnf4
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_large.test46
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave.test50
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_autoinc.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_autoinc.test83
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_gtid.cnf6
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_gtid.test67
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_nonprim.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_nonprim.test96
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_preordered.cnf3
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_preordered.test84
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_replication_bundle.cnf4
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_replication_bundle.test48
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test95
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort.test34
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test39
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort_for_update.test29
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test30
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort_get_lock.test36
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort_lock_table.test36
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort_sleep.test30
-rw-r--r--mysql-test/suite/galera/t/galera_bf_lock_wait.test52
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_cache_size.test35
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_checksum-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_checksum.test22
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test21
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test15
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_row_image.test100
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test28
-rw-r--r--mysql-test/suite/galera/t/galera_concurrent_ctas.test57
-rw-r--r--mysql-test/suite/galera/t/galera_create_function.test53
-rw-r--r--mysql-test/suite/galera/t/galera_create_procedure.test52
-rw-r--r--mysql-test/suite/galera/t/galera_create_table_like.test50
-rw-r--r--mysql-test/suite/galera/t/galera_create_trigger.test43
-rw-r--r--mysql-test/suite/galera/t/galera_ddl_multiline.test54
-rw-r--r--mysql-test/suite/galera/t/galera_defaults.test71
-rw-r--r--mysql-test/suite/galera/t/galera_delete_limit.test52
-rw-r--r--mysql-test/suite/galera/t/galera_desync_overlapped.test59
-rw-r--r--mysql-test/suite/galera/t/galera_drop_multi.test41
-rw-r--r--mysql-test/suite/galera/t/galera_enum.test62
-rw-r--r--mysql-test/suite/galera/t/galera_events.test53
-rw-r--r--mysql-test/suite/galera/t/galera_fk_cascade_delete.test41
-rw-r--r--mysql-test/suite/galera/t/galera_fk_cascade_update.test41
-rw-r--r--mysql-test/suite/galera/t/galera_fk_conflict.test41
-rw-r--r--mysql-test/suite/galera/t/galera_fk_mismatch.test38
-rw-r--r--mysql-test/suite/galera/t/galera_fk_multicolumn.test42
-rw-r--r--mysql-test/suite/galera/t/galera_fk_multitable.test32
-rw-r--r--mysql-test/suite/galera/t/galera_fk_no_pk.test37
-rw-r--r--mysql-test/suite/galera/t/galera_fk_selfreferential.test24
-rw-r--r--mysql-test/suite/galera/t/galera_fk_setnull.test36
-rw-r--r--mysql-test/suite/galera/t/galera_flush-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_flush.test273
-rw-r--r--mysql-test/suite/galera/t/galera_flush_local.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_flush_local.test142
-rw-r--r--mysql-test/suite/galera/t/galera_forced_binlog_format-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_forced_binlog_format.test45
-rw-r--r--mysql-test/suite/galera/t/galera_ftwrl.test39
-rw-r--r--mysql-test/suite/galera/t/galera_ftwrl_drain.test69
-rw-r--r--mysql-test/suite/galera/t/galera_fulltext.test62
-rw-r--r--mysql-test/suite/galera/t/galera_gcache_recover.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_gcache_recover.test77
-rw-r--r--mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf9
-rw-r--r--mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test59
-rw-r--r--mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf9
-rw-r--r--mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test216
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_fc_limit.test59
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_fragment.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_fragment.test66
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_max_packet_size.test26
-rw-r--r--mysql-test/suite/galera/t/galera_gra_log.test38
-rw-r--r--mysql-test/suite/galera/t/galera_gtid-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_gtid.test27
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave.cnf18
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave.test78
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf18
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test207
-rw-r--r--mysql-test/suite/galera/t/galera_insert_ignore.test60
-rw-r--r--mysql-test/suite/galera/t/galera_insert_multi.test122
-rw-r--r--mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test12
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mysqldump.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mysqldump.test17
-rw-r--r--mysql-test/suite/galera/t/galera_ist_progress.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_ist_progress.test76
-rw-r--r--mysql-test/suite/galera/t/galera_ist_recv_bind.cnf8
-rw-r--r--mysql-test/suite/galera/t/galera_ist_recv_bind.test55
-rw-r--r--mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf4
-rw-r--r--mysql-test/suite/galera/t/galera_ist_restart_joiner.test113
-rw-r--r--mysql-test/suite/galera/t/galera_ist_rsync.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_ist_rsync.test13
-rw-r--r--mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test9
-rw-r--r--mysql-test/suite/galera/t/galera_kill_applier.test26
-rw-r--r--mysql-test/suite/galera/t/galera_kill_ddl.test44
-rw-r--r--mysql-test/suite/galera/t/galera_kill_largechanges.test43
-rw-r--r--mysql-test/suite/galera/t/galera_kill_nochanges.test24
-rw-r--r--mysql-test/suite/galera/t/galera_kill_smallchanges.test39
-rw-r--r--mysql-test/suite/galera/t/galera_lock_table.test43
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin.test39
-rw-r--r--mysql-test/suite/galera/t/galera_log_output_csv-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_log_output_csv.test24
-rw-r--r--mysql-test/suite/galera/t/galera_many_columns.test63
-rw-r--r--mysql-test/suite/galera/t/galera_many_indexes.test74
-rw-r--r--mysql-test/suite/galera/t/galera_many_rows.test54
-rw-r--r--mysql-test/suite/galera/t/galera_many_tables_nopk.test109
-rw-r--r--mysql-test/suite/galera/t/galera_many_tables_pk.test101
-rw-r--r--mysql-test/suite/galera/t/galera_mdev_10812.test27
-rw-r--r--mysql-test/suite/galera/t/galera_mdev_13787.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_mdev_13787.test6
-rw-r--r--mysql-test/suite/galera/t/galera_mdl_race.test79
-rw-r--r--mysql-test/suite/galera/t/galera_migrate.cnf59
-rw-r--r--mysql-test/suite/galera/t/galera_migrate.test204
-rw-r--r--mysql-test/suite/galera/t/galera_multi_database.test43
-rw-r--r--mysql-test/suite/galera/t/galera_myisam_autocommit.test45
-rw-r--r--mysql-test/suite/galera/t/galera_myisam_transactions.test36
-rw-r--r--mysql-test/suite/galera/t/galera_nopk_bit.test46
-rw-r--r--mysql-test/suite/galera/t/galera_nopk_blob.test46
-rw-r--r--mysql-test/suite/galera/t/galera_nopk_large_varchar.test50
-rw-r--r--mysql-test/suite/galera/t/galera_nopk_unicode.test43
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test51
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test51
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test54
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_simple.test56
-rw-r--r--mysql-test/suite/galera/t/galera_pc_ignore_sb.test46
-rw-r--r--mysql-test/suite/galera/t/galera_pk_bigint_signed.test46
-rw-r--r--mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test45
-rw-r--r--mysql-test/suite/galera/t/galera_prepared_statement.test45
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache.test67
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_sync_wait.test89
-rw-r--r--mysql-test/suite/galera/t/galera_read_only.test39
-rw-r--r--mysql-test/suite/galera/t/galera_repl_key_format_flat16.test34
-rw-r--r--mysql-test/suite/galera/t/galera_repl_max_ws_size.test29
-rw-r--r--mysql-test/suite/galera/t/galera_restart_nochanges.test40
-rw-r--r--mysql-test/suite/galera/t/galera_restart_on_unknown_option.test157
-rw-r--r--mysql-test/suite/galera/t/galera_roles.test201
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_add_pk.test43
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_drop_pk.test58
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_error.test31
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_simple.test34
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test86
-rw-r--r--mysql-test/suite/galera/t/galera_sbr.test27
-rw-r--r--mysql-test/suite/galera/t/galera_sbr_binlog-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_sbr_binlog.test28
-rw-r--r--mysql-test/suite/galera/t/galera_serializable.test76
-rw-r--r--mysql-test/suite/galera/t/galera_server.test28
-rw-r--r--mysql-test/suite/galera/t/galera_split_brain.test47
-rw-r--r--mysql-test/suite/galera/t/galera_sql_log_bin_zero.test26
-rw-r--r--mysql-test/suite/galera/t/galera_ssl.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_ssl.test25
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_compression.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_compression.test35
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_upgrade.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_upgrade.test49
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump.test18
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf22
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test29
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync.test9
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf24
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test13
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test19
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test13
-rw-r--r--mysql-test/suite/galera/t/galera_status_cluster.test18
-rw-r--r--mysql-test/suite/galera/t/galera_status_local_index.test21
-rw-r--r--mysql-test/suite/galera/t/galera_status_local_state.test28
-rw-r--r--mysql-test/suite/galera/t/galera_suspend_slave.test64
-rw-r--r--mysql-test/suite/galera/t/galera_sync_wait_show.test70
-rw-r--r--mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test120
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_error.test29
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test70
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test49
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_locking.test76
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test30
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_sequential.test29
-rw-r--r--mysql-test/suite/galera/t/galera_toi_drop_database.test56
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ftwrl.test22
-rw-r--r--mysql-test/suite/galera/t/galera_toi_lock_exclusive.test38
-rw-r--r--mysql-test/suite/galera/t/galera_toi_lock_shared.test23
-rw-r--r--mysql-test/suite/galera/t/galera_toi_truncate.test43
-rw-r--r--mysql-test/suite/galera/t/galera_transaction_read_only.test58
-rw-r--r--mysql-test/suite/galera/t/galera_transaction_replay.test124
-rw-r--r--mysql-test/suite/galera/t/galera_truncate.test57
-rw-r--r--mysql-test/suite/galera/t/galera_truncate_temporary.test82
-rw-r--r--mysql-test/suite/galera/t/galera_udf-master.opt2
-rw-r--r--mysql-test/suite/galera/t/galera_unicode_identifiers.test72
-rw-r--r--mysql-test/suite/galera/t/galera_unicode_pk.test64
-rw-r--r--mysql-test/suite/galera/t/galera_update_limit.test55
-rw-r--r--mysql-test/suite/galera/t/galera_v1_row_events-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_v1_row_events.test21
-rw-r--r--mysql-test/suite/galera/t/galera_var_OSU_method.test45
-rw-r--r--mysql-test/suite/galera/t/galera_var_OSU_method2.test47
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test105
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test53
-rw-r--r--mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test43
-rw-r--r--mysql-test/suite/galera/t/galera_var_cluster_address.test78
-rw-r--r--mysql-test/suite/galera/t/galera_var_desync_on.test62
-rw-r--r--mysql-test/suite/galera/t/galera_var_dirty_reads.test76
-rw-r--r--mysql-test/suite/galera/t/galera_var_fkchecks.test40
-rw-r--r--mysql-test/suite/galera/t/galera_var_gtid_domain_id.cnf16
-rw-r--r--mysql-test/suite/galera/t/galera_var_gtid_domain_id.test53
-rw-r--r--mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test33
-rw-r--r--mysql-test/suite/galera/t/galera_var_load_data_splitting.test39
-rw-r--r--mysql-test/suite/galera/t/galera_var_log_bin.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_var_log_bin.test22
-rw-r--r--mysql-test/suite/galera/t/galera_var_max_ws_rows.test176
-rw-r--r--mysql-test/suite/galera/t/galera_var_max_ws_size.test46
-rw-r--r--mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test30
-rw-r--r--mysql-test/suite/galera/t/galera_var_node_address.cnf10
-rw-r--r--mysql-test/suite/galera/t/galera_var_node_address.test25
-rw-r--r--mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_var_notify_cmd.test14
-rw-r--r--mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test21
-rw-r--r--mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test149
-rw-r--r--mysql-test/suite/galera/t/galera_var_retry_autocommit.test98
-rw-r--r--mysql-test/suite/galera/t/galera_var_slave_threads.test84
-rw-r--r--mysql-test/suite/galera/t/galera_var_sync_wait.test53
-rw-r--r--mysql-test/suite/galera/t/galera_var_wsrep_on_off.test32
-rw-r--r--mysql-test/suite/galera/t/galera_wan.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_wan.test30
-rw-r--r--mysql-test/suite/galera/t/galera_wan_restart_ist.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_wan_restart_ist.test161
-rw-r--r--mysql-test/suite/galera/t/galera_wan_restart_sst.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_wan_restart_sst.test149
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test57
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_log_conficts.test55
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_new_cluster.test24
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test20
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test50
-rw-r--r--mysql-test/suite/galera/t/galera_zero_length_column.test41
-rw-r--r--mysql-test/suite/galera/t/grant.test25
-rw-r--r--mysql-test/suite/galera/t/lp1276424.test17
-rw-r--r--mysql-test/suite/galera/t/lp1347768.test24
-rw-r--r--mysql-test/suite/galera/t/lp1376747-2.test22
-rw-r--r--mysql-test/suite/galera/t/lp1376747-3.test28
-rw-r--r--mysql-test/suite/galera/t/lp1376747-4.test53
-rw-r--r--mysql-test/suite/galera/t/lp1376747.test24
-rw-r--r--mysql-test/suite/galera/t/lp1438990.test38
-rw-r--r--mysql-test/suite/galera/t/lp959512.test26
-rw-r--r--mysql-test/suite/galera/t/mdev_10518.cnf17
-rw-r--r--mysql-test/suite/galera/t/mdev_10518.test53
-rw-r--r--mysql-test/suite/galera/t/mdev_9290.test24
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#110.test51
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#198.test39
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#201-master.opt1
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#201.test32
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#237.test34
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#247.test23
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#31.test53
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#33.cnf8
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#33.test18
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#90.test65
-rw-r--r--mysql-test/suite/galera/t/partition.test207
-rw-r--r--mysql-test/suite/galera/t/pxc-421.test65
-rw-r--r--mysql-test/suite/galera/t/query_cache.opt1
-rw-r--r--mysql-test/suite/galera/t/query_cache.test1002
-rw-r--r--mysql-test/suite/galera/t/rename.test53
-rw-r--r--mysql-test/suite/galera/t/rpl_row_annotate.cnf6
-rw-r--r--mysql-test/suite/galera/t/rpl_row_annotate.test42
-rw-r--r--mysql-test/suite/galera/t/sql_log_bin.test56
-rw-r--r--mysql-test/suite/galera/t/unique_key.test54
-rw-r--r--mysql-test/suite/galera/t/view.test50
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def3
-rw-r--r--mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf122
-rw-r--r--mysql-test/suite/galera_3nodes/galera_3nodes.cnf66
-rw-r--r--mysql-test/suite/galera_3nodes/include/galera_suspend.inc14
-rw-r--r--mysql-test/suite/galera_3nodes/my.cnf1
-rw-r--r--mysql-test/suite/galera_3nodes/r/GAL-501.result14
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result17
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result12
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result19
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_garbd.result17
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result231
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result11
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result26
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result14
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result18
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result46
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result13
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result26
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_pc_weight.result121
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result26
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_slave_options_do.result28
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_slave_options_ignore.result28
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result48
-rw-r--r--mysql-test/suite/galera_3nodes/suite.pm55
-rw-r--r--mysql-test/suite/galera_3nodes/t/GAL-501.cnf26
-rw-r--r--mysql-test/suite/galera_3nodes/t/GAL-501.test38
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test53
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test33
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test67
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_garbd.test64
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf28
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test292
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test58
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf22
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test56
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf22
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test32
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf26
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test62
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf11
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test101
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test38
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.cnf5
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test91
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_pc_weight.cnf5
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_pc_weight.test128
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test163
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_slave_options_do.cnf7
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_slave_options_do.test34
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.cnf7
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.test34
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test112
-rw-r--r--mysql-test/suite/handler/innodb.result1
-rw-r--r--mysql-test/suite/innodb/include/ibd_convert.pl24
-rw-r--r--mysql-test/suite/innodb/include/innodb-page-compression.inc131
-rw-r--r--mysql-test/suite/innodb/include/innodb-wl6045.inc22
-rw-r--r--mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc15
-rw-r--r--mysql-test/suite/innodb/include/no_checkpoint_end.inc35
-rw-r--r--mysql-test/suite/innodb/include/no_checkpoint_start.inc5
-rw-r--r--mysql-test/suite/innodb/r/101_compatibility.result45
-rw-r--r--mysql-test/suite/innodb/r/binlog_consistent.result75
-rw-r--r--mysql-test/suite/innodb/r/create_isl_with_direct.result10
-rw-r--r--mysql-test/suite/innodb/r/data_types.result6
-rw-r--r--mysql-test/suite/innodb/r/defrag_mdl-9155.result15
-rw-r--r--mysql-test/suite/innodb/r/doublewrite.result251
-rw-r--r--mysql-test/suite/innodb/r/fake_changes-7000.result6
-rw-r--r--mysql-test/suite/innodb/r/group_commit.result6
-rw-r--r--mysql-test/suite/innodb/r/group_commit_binlog_pos.result2
-rw-r--r--mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result2
-rw-r--r--mysql-test/suite/innodb/r/group_commit_crash.result1
-rw-r--r--mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result1
-rw-r--r--mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result6
-rw-r--r--mysql-test/suite/innodb/r/innochecksum.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb-16k.result981
-rw-r--r--mysql-test/suite/innodb/r/innodb-32k-crash.result291
-rw-r--r--mysql-test/suite/innodb/r/innodb-32k.result869
-rw-r--r--mysql-test/suite/innodb/r/innodb-64k-crash.result594
-rw-r--r--mysql-test/suite/innodb/r/innodb-64k.result1086
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-autoinc.result16
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-tempfile.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result20
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc.result46
-rw-r--r--mysql-test/suite/innodb/r/innodb-bigblob.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-blob.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result5
-rw-r--r--mysql-test/suite/innodb/r/innodb-corrupted-table.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-enlarge-blob.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb-flush-changed-page-bitmaps.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-online,crypt.rdiff20
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-online-fk.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-online.result87
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb-lock-schedule-algorithm.result89
-rw-r--r--mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_default.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lz4.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lzma.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lzo.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_snappy.result99
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_tables.result120
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_zip.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb-table-online,crypt.rdiff20
-rw-r--r--mysql-test/suite/innodb/r/innodb-table-online.result101
-rw-r--r--mysql-test/suite/innodb/r/innodb-update-insert.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-debug.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5980-alter.result16
-rw-r--r--mysql-test/suite/innodb/r/innodb.result5
-rw-r--r--mysql-test/suite/innodb/r/innodb_blob_truncate.result19
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14147491.result30
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug21704.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53756.result17
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59641.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_ctype_ldml.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_binlog.result29
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_concurrent.result61
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_stats.result175
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result38
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment.result124
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result116
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment_small.result24
-rw-r--r--mysql-test/suite/innodb/r/innodb_force_pk.result65
-rw-r--r--mysql-test/suite/innodb/r/innodb_gis.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result20
-rw-r--r--mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result388
-rw-r--r--mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result591
-rw-r--r--mysql-test/suite/innodb/r/innodb_monitor.result31
-rw-r--r--mysql-test/suite/innodb/r/innodb_multi_update.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_mutexes.result21
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result394
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result26
-rw-r--r--mysql-test/suite/innodb/r/innodb_uninstall.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_zip_innochecksum.result91
-rw-r--r--mysql-test/suite/innodb/r/innodb_zip_innochecksum2.result160
-rw-r--r--mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result227
-rw-r--r--mysql-test/suite/innodb/r/log_data_file_size.result9
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k.rdiff96
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k.rdiff96
-rw-r--r--mysql-test/suite/innodb/r/table_flags.result8
-rw-r--r--mysql-test/suite/innodb/r/trigger.result23
-rw-r--r--mysql-test/suite/innodb/t/101_compatibility.test104
-rw-r--r--mysql-test/suite/innodb/t/binlog_consistent.test17
-rw-r--r--mysql-test/suite/innodb/t/create_isl_with_direct.opt1
-rw-r--r--mysql-test/suite/innodb/t/create_isl_with_direct.test28
-rw-r--r--mysql-test/suite/innodb/t/defrag_mdl-9155.test22
-rw-r--r--mysql-test/suite/innodb/t/doublewrite.test435
-rw-r--r--mysql-test/suite/innodb/t/fake_changes-7000.test9
-rw-r--r--mysql-test/suite/innodb/t/group_commit.test6
-rw-r--r--mysql-test/suite/innodb/t/group_commit_binlog_pos.test3
-rw-r--r--mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test4
-rw-r--r--mysql-test/suite/innodb/t/group_commit_crash.test2
-rw-r--r--mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test2
-rw-r--r--mysql-test/suite/innodb/t/group_commit_no_optimize_thread.test6
-rw-r--r--mysql-test/suite/innodb/t/innochecksum.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-16k-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-16k.test979
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-crash-master.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-crash.test195
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-master.opt4
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k.test770
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-crash-master.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-crash.test386
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-master.opt4
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k.test661
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-tempfile.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test46
-rw-r--r--mysql-test/suite/innodb/t/innodb-bigblob.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-bigblob.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-blob.test29
-rw-r--r--mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test29
-rw-r--r--mysql-test/suite/innodb/t/innodb-enlarge-blob.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb-enlarge-blob.test29
-rw-r--r--mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-online.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-online.test77
-rw-r--r--mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.test106
-rw-r--r--mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test25
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_default.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lz4.test12
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzma.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzo.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_snappy.test13
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_tables.test101
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_zip.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online.test89
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522-debug.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb_blob_truncate.test45
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug12400341.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14147491.test71
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53756.test66
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59641.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug60049.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_corrupt_bit.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_binlog.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_binlog.test21
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt4
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_concurrent.test122
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats.test125
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test77
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.test155
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment_fill_factor.opt4
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test210
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment_small.test28
-rw-r--r--mysql-test/suite/innodb/t/innodb_force_pk.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_force_pk.test49
-rw-r--r--mysql-test/suite/innodb/t/innodb_information_schema.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb_information_schema_buffer.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt3
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test400
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt3
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test604
-rw-r--r--mysql-test/suite/innodb/t/innodb_multi_update.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_mutexes-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_mutexes.test66
-rw-r--r--mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt67
-rw-r--r--mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test36
-rw-r--r--mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt3
-rw-r--r--mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test119
-rw-r--r--mysql-test/suite/innodb/t/innodb_uninstall.test12
-rw-r--r--mysql-test/suite/innodb/t/innodb_zip_innochecksum.opt4
-rw-r--r--mysql-test/suite/innodb/t/innodb_zip_innochecksum.test239
-rw-r--r--mysql-test/suite/innodb/t/innodb_zip_innochecksum2.opt4
-rw-r--r--mysql-test/suite/innodb/t/innodb_zip_innochecksum2.test118
-rw-r--r--mysql-test/suite/innodb/t/innodb_zip_innochecksum3.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb_zip_innochecksum3.test406
-rw-r--r--mysql-test/suite/innodb/t/log_data_file_size.opt2
-rw-r--r--mysql-test/suite/innodb/t/log_data_file_size.test80
-rw-r--r--mysql-test/suite/innodb/t/log_file_size.test2
-rw-r--r--mysql-test/suite/innodb/t/table_definition_cache_debug.opt1
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test8
-rw-r--r--mysql-test/suite/innodb/t/trigger.test47
-rw-r--r--mysql-test/suite/innodb_fts/r/crash_recovery.result78
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext_misc.result13
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext_order_by.result6
-rw-r--r--mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result5
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result97
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/misc_debug.result19
-rw-r--r--mysql-test/suite/innodb_fts/t/crash_recovery.test118
-rw-r--r--mysql-test/suite/innodb_fts/t/fulltext_misc.test3
-rw-r--r--mysql-test/suite/innodb_fts/t/fulltext_order_by.test5
-rw-r--r--mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test17
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test210
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test3
-rw-r--r--mysql-test/suite/innodb_fts/t/misc_debug.test41
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result2
-rw-r--r--mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result2
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test4
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test2
-rw-r--r--mysql-test/suite/jp/disabled.def2
-rw-r--r--mysql-test/suite/jp/r/jp_alter_sjis.result72
-rw-r--r--mysql-test/suite/jp/r/jp_alter_ucs2.result72
-rw-r--r--mysql-test/suite/jp/r/jp_alter_ujis.result72
-rw-r--r--mysql-test/suite/jp/r/jp_alter_utf8.result72
-rw-r--r--mysql-test/suite/jp/r/jp_convert_ucs2.result24
-rw-r--r--mysql-test/suite/jp/r/jp_convert_ujis.result96
-rw-r--r--mysql-test/suite/jp/r/jp_convert_utf8.result114
-rw-r--r--mysql-test/suite/maria/collations.result25
-rw-r--r--mysql-test/suite/maria/collations.test14
-rw-r--r--mysql-test/suite/maria/encrypt-wrong-key.result16
-rw-r--r--mysql-test/suite/maria/encrypt-wrong-key.test54
-rw-r--r--mysql-test/suite/maria/icp.result20
-rw-r--r--mysql-test/suite/maria/maria-recovery2-master.opt2
-rw-r--r--mysql-test/suite/maria/maria-recovery3.result2
-rw-r--r--mysql-test/suite/maria/maria2.result10
-rw-r--r--mysql-test/suite/maria/maria3.result1
-rw-r--r--mysql-test/suite/maria/ps_maria.result37
-rw-r--r--mysql-test/suite/mariabackup/apply-log-only-incr.result33
-rw-r--r--mysql-test/suite/mariabackup/apply-log-only-incr.test70
-rw-r--r--mysql-test/suite/mariabackup/apply-log-only.result10
-rw-r--r--mysql-test/suite/mariabackup/apply-log-only.test25
-rw-r--r--mysql-test/suite/mariabackup/auth_plugin_win.opt1
-rw-r--r--mysql-test/suite/mariabackup/auth_plugin_win.result5
-rw-r--r--mysql-test/suite/mariabackup/auth_plugin_win.test31
-rw-r--r--mysql-test/suite/mariabackup/bug1509812-master.opt1
-rw-r--r--mysql-test/suite/mariabackup/compress_qpress.result15
-rw-r--r--mysql-test/suite/mariabackup/compress_qpress.test24
-rw-r--r--mysql-test/suite/mariabackup/data_directory.result13
-rw-r--r--mysql-test/suite/mariabackup/data_directory.test23
-rw-r--r--mysql-test/suite/mariabackup/filekeys-data.encbin0 -> 416 bytes
-rw-r--r--mysql-test/suite/mariabackup/filekeys-data.key2
-rw-r--r--mysql-test/suite/mariabackup/full_backup.result13
-rw-r--r--mysql-test/suite/mariabackup/full_backup.test22
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.opt6
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.result19
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.test54
-rw-r--r--mysql-test/suite/mariabackup/include/have_file_key_management.inc4
-rw-r--r--mysql-test/suite/mariabackup/include/restart_and_restore.inc9
-rw-r--r--mysql-test/suite/mariabackup/incremental_backup.result26
-rw-r--r--mysql-test/suite/mariabackup/incremental_backup.test43
-rw-r--r--mysql-test/suite/mariabackup/incremental_encrypted.opt3
-rw-r--r--mysql-test/suite/mariabackup/incremental_encrypted.result20
-rw-r--r--mysql-test/suite/mariabackup/incremental_encrypted.test40
-rw-r--r--mysql-test/suite/mariabackup/mdev-14447.opt1
-rw-r--r--mysql-test/suite/mariabackup/mdev-14447.result19
-rw-r--r--mysql-test/suite/mariabackup/mdev-14447.test46
-rw-r--r--mysql-test/suite/mariabackup/missing_ibd.result6
-rw-r--r--mysql-test/suite/mariabackup/missing_ibd.test27
-rw-r--r--mysql-test/suite/mariabackup/partial.result13
-rw-r--r--mysql-test/suite/mariabackup/partial.test31
-rw-r--r--mysql-test/suite/mariabackup/partial_exclude.result12
-rw-r--r--mysql-test/suite/mariabackup/partial_exclude.test30
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.opt1
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.result22
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.test24
-rw-r--r--mysql-test/suite/mariabackup/small_ibd.result1
-rw-r--r--mysql-test/suite/mariabackup/small_ibd.test18
-rw-r--r--mysql-test/suite/mariabackup/suite.opt1
-rw-r--r--mysql-test/suite/mariabackup/suite.pm37
-rw-r--r--mysql-test/suite/mariabackup/xb_aws_key_management.opt3
-rw-r--r--mysql-test/suite/mariabackup/xb_aws_key_management.result16
-rw-r--r--mysql-test/suite/mariabackup/xb_aws_key_management.test18
-rw-r--r--mysql-test/suite/mariabackup/xb_compressed_encrypted.opt9
-rw-r--r--mysql-test/suite/mariabackup/xb_compressed_encrypted.result25
-rw-r--r--mysql-test/suite/mariabackup/xb_compressed_encrypted.test35
-rw-r--r--mysql-test/suite/mariabackup/xb_file_key_management.opt6
-rw-r--r--mysql-test/suite/mariabackup/xb_file_key_management.result17
-rw-r--r--mysql-test/suite/mariabackup/xb_file_key_management.test39
-rw-r--r--mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt8
-rw-r--r--mysql-test/suite/mariabackup/xb_fulltext_encrypted.result14
-rw-r--r--mysql-test/suite/mariabackup/xb_fulltext_encrypted.test23
-rw-r--r--mysql-test/suite/mariabackup/xb_history.result5
-rw-r--r--mysql-test/suite/mariabackup/xb_history.test8
-rw-r--r--mysql-test/suite/mariabackup/xb_page_compress.result28
-rw-r--r--mysql-test/suite/mariabackup/xb_page_compress.test44
-rw-r--r--mysql-test/suite/mariabackup/xb_partition.result64
-rw-r--r--mysql-test/suite/mariabackup/xb_partition.test87
-rw-r--r--mysql-test/suite/mariabackup/xbstream.result13
-rw-r--r--mysql-test/suite/mariabackup/xbstream.test22
-rw-r--r--mysql-test/suite/multi_source/gtid.test8
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.test8
-rw-r--r--mysql-test/suite/multi_source/info_logs.result12
-rw-r--r--mysql-test/suite/multi_source/info_logs.test19
-rw-r--r--mysql-test/suite/multi_source/load_data.test6
-rw-r--r--mysql-test/suite/multi_source/mdev-9544.cnf22
-rw-r--r--mysql-test/suite/multi_source/mdev-9544.result78
-rw-r--r--mysql-test/suite/multi_source/mdev-9544.test116
-rw-r--r--mysql-test/suite/multi_source/multisource.result78
-rw-r--r--mysql-test/suite/multi_source/multisource.test289
-rw-r--r--mysql-test/suite/multi_source/my.cnf1
-rw-r--r--mysql-test/suite/multi_source/relaylog_events.result26
-rw-r--r--mysql-test/suite/multi_source/relaylog_events.test13
-rw-r--r--mysql-test/suite/multi_source/reset_slave.result8
-rw-r--r--mysql-test/suite/multi_source/reset_slave.test12
-rw-r--r--mysql-test/suite/multi_source/simple.result31
-rw-r--r--mysql-test/suite/multi_source/simple.test21
-rw-r--r--mysql-test/suite/multi_source/skip_counter.test6
-rw-r--r--mysql-test/suite/multi_source/status_vars.test6
-rw-r--r--mysql-test/suite/multi_source/syntax.result6
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_discover.result33
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_discover.test70
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result6
-rw-r--r--mysql-test/suite/parts/inc/part_exch_drop_tabs.inc3
-rw-r--r--mysql-test/suite/parts/inc/part_exch_tabs.inc103
-rw-r--r--mysql-test/suite/parts/inc/partition.pre37
-rw-r--r--mysql-test/suite/parts/inc/partition_auto_increment.inc5
-rw-r--r--mysql-test/suite/parts/inc/partition_check.inc7
-rw-r--r--mysql-test/suite/parts/inc/partition_mgm.inc5
-rw-r--r--mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc2
-rw-r--r--mysql-test/suite/parts/inc/partition_syntax_2.inc22
-rw-r--r--mysql-test/suite/parts/inc/partition_timestamp.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_trigg3.inc2
-rw-r--r--mysql-test/suite/parts/inc/partition_value.inc6
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result296
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result136
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_innodb.result264
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_myisam.result168
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_innodb.result456
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_myisam.result264
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result280
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result280
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_maria.result248
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_myisam.result248
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result280
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result280
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_maria.result248
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_myisam.result248
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_innodb.result64
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_myisam.result64
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_innodb.result1608
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_myisam.result1608
-rw-r--r--mysql-test/suite/parts/r/partition_alter_myisam.result13
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_blackhole.result2
-rw-r--r--mysql-test/suite/parts/r/partition_basic_innodb.result392
-rw-r--r--mysql-test/suite/parts/r/partition_basic_myisam.result264
-rw-r--r--mysql-test/suite/parts/r/partition_basic_symlink_myisam.result320
-rw-r--r--mysql-test/suite/parts/r/partition_bit_innodb.result18
-rw-r--r--mysql-test/suite/parts/r/partition_bit_myisam.result18
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_innodb.result4
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_myisam.result4
-rw-r--r--mysql-test/suite/parts/r/partition_engine_innodb.result120
-rw-r--r--mysql-test/suite/parts/r/partition_engine_myisam.result120
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_innodb.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_myisam.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_myisam_innodb.result55
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_10.result2
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_11.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_14.result310
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_15.result57
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result8
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result8
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_2.result63
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_3.result155
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_6.result69
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result0
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result0
-rw-r--r--mysql-test/suite/parts/r/partition_exchange_innodb.result16
-rw-r--r--mysql-test/suite/parts/r/partition_exchange_memory.result16
-rw-r--r--mysql-test/suite/parts/r/partition_exchange_myisam.result16
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result2
-rw-r--r--mysql-test/suite/parts/r/partition_special_myisam.result2
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_innodb.result588
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_myisam.result588
-rw-r--r--mysql-test/suite/parts/t/partition_alter_myisam.test19
-rw-r--r--mysql-test/suite/parts/t/partition_debug_myisam-master.opt2
-rw-r--r--mysql-test/suite/parts/t/partition_exch_myisam_innodb.test14
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_10.test2
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_14.test142
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_15.test18
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_2.test61
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_3.test36
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_6.test48
-rw-r--r--mysql-test/suite/parts/t/partition_recover_myisam-master.opt2
-rw-r--r--mysql-test/suite/parts/t/partition_repair_myisam-master.opt2
-rw-r--r--mysql-test/suite/percona/innodb_sys_index.result3
-rw-r--r--mysql-test/suite/percona/innodb_sys_index.test1
-rw-r--r--mysql-test/suite/perfschema/include/connection_setup.inc5
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_setup.inc5
-rw-r--r--mysql-test/suite/perfschema/include/stage_setup.inc4
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_setup.inc4
-rw-r--r--mysql-test/suite/perfschema/include/table_io_result_helper.inc3
-rw-r--r--mysql-test/suite/perfschema/include/upgrade_check.inc14
-rw-r--r--mysql-test/suite/perfschema/r/bad_option_2.result2
-rw-r--r--mysql-test/suite/perfschema/r/column_privilege.result1
-rw-r--r--mysql-test/suite/perfschema/r/csv_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/digest_table_full.result8
-rw-r--r--mysql-test/suite/perfschema/r/discovery.result12
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_instruments.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_objects.result2
-rw-r--r--mysql-test/suite/perfschema/r/func_mutex.result14
-rw-r--r--mysql-test/suite/perfschema/r/global_read_lock.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result2
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result2
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result2
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result2
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result1
-rw-r--r--mysql-test/suite/perfschema/r/innodb_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/memory_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/merge_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/misc.result16
-rw-r--r--mysql-test/suite/perfschema/r/multi_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/myisam_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/nesting.result235
-rw-r--r--mysql-test/suite/perfschema/r/part_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_event.result54
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_func.result54
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_proc.result54
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_table.result54
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_view.result54
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result3
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result12
-rw-r--r--mysql-test/suite/perfschema/r/read_only.result1
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result2
-rw-r--r--mysql-test/suite/perfschema/r/rollback_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/rpl_gtid_func.result12
-rw-r--r--mysql-test/suite/perfschema/r/rpl_statements.result4
-rw-r--r--mysql-test/suite/perfschema/r/server_init.result4
-rw-r--r--mysql-test/suite/perfschema/r/setup_actors.result5
-rw-r--r--mysql-test/suite/perfschema/r/setup_instruments_defaults.result4
-rw-r--r--mysql-test/suite/perfschema/r/setup_objects.result16
-rw-r--r--mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result2
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_function.result2
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_global.result2
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_procedure.result2
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_table.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_digest.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_digests.result4
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest.result74
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_consumers.result78
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_long_query.result8
-rw-r--r--mysql-test/suite/perfschema/r/tampered_perfschema_table1.result6
-rw-r--r--mysql-test/suite/perfschema/r/temp_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/threads_mysql.result11
-rw-r--r--mysql-test/suite/perfschema/r/trigger_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/r/view_table_io.result11
-rw-r--r--mysql-test/suite/perfschema/t/bad_option_2.test25
-rw-r--r--mysql-test/suite/perfschema/t/column_privilege.test1
-rw-r--r--mysql-test/suite/perfschema/t/digest_table_full.test2
-rw-r--r--mysql-test/suite/perfschema/t/discovery.test15
-rw-r--r--mysql-test/suite/perfschema/t/func_mutex.test12
-rw-r--r--mysql-test/suite/perfschema/t/global_read_lock.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/misc.test15
-rw-r--r--mysql-test/suite/perfschema/t/nesting.test1
-rw-r--r--mysql-test/suite/perfschema/t/pfs_upgrade_event.test12
-rw-r--r--mysql-test/suite/perfschema/t/pfs_upgrade_func.test12
-rw-r--r--mysql-test/suite/perfschema/t/pfs_upgrade_proc.test12
-rw-r--r--mysql-test/suite/perfschema/t/pfs_upgrade_table.test14
-rw-r--r--mysql-test/suite/perfschema/t/pfs_upgrade_view.test14
-rw-r--r--mysql-test/suite/perfschema/t/privilege.test3
-rw-r--r--mysql-test/suite/perfschema/t/privilege_table_io.test1
-rw-r--r--mysql-test/suite/perfschema/t/read_only.test1
-rw-r--r--mysql-test/suite/perfschema/t/rpl_gtid_func.test4
-rw-r--r--mysql-test/suite/perfschema/t/rpl_statements.test4
-rw-r--r--mysql-test/suite/perfschema/t/server_init.test3
-rw-r--r--mysql-test/suite/perfschema/t/setup_actors.test5
-rw-r--r--mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/setup_instruments_defaults.test2
-rw-r--r--mysql-test/suite/perfschema/t/short_option_1-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_1_digest-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_digests.test2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_nothing-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest.test2
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_consumers.test4
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_long_query.test2
-rw-r--r--mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/tampered_perfschema_table1.test25
-rw-r--r--mysql-test/suite/plugins/r/audit_null.result1
-rw-r--r--mysql-test/suite/plugins/r/auth_ed25519.result50
-rw-r--r--mysql-test/suite/plugins/r/auth_v0100.result1
-rw-r--r--mysql-test/suite/plugins/r/binlog-simple_plugin_check.result19
-rw-r--r--mysql-test/suite/plugins/r/cracklib_password_check.result50
-rw-r--r--mysql-test/suite/plugins/r/locales.result143
-rw-r--r--mysql-test/suite/plugins/r/pam_cleartext.result2
-rw-r--r--mysql-test/suite/plugins/r/qc_info.result27
-rw-r--r--mysql-test/suite/plugins/r/qc_info_priv.result21
-rw-r--r--mysql-test/suite/plugins/r/show_all_plugins.result7
-rw-r--r--mysql-test/suite/plugins/r/simple_password_check.result160
-rw-r--r--mysql-test/suite/plugins/r/two_password_validations.result21
-rw-r--r--mysql-test/suite/plugins/r/unix_socket.result1
-rw-r--r--mysql-test/suite/plugins/t/audit_null.test1
-rw-r--r--mysql-test/suite/plugins/t/auth_ed25519.test44
-rw-r--r--mysql-test/suite/plugins/t/auth_v0100.test1
-rw-r--r--mysql-test/suite/plugins/t/binlog-simple_plugin_check.test31
-rw-r--r--mysql-test/suite/plugins/t/cracklib_password_check.test45
-rw-r--r--mysql-test/suite/plugins/t/locales.test6
-rw-r--r--mysql-test/suite/plugins/t/pam_cleartext.test2
-rw-r--r--mysql-test/suite/plugins/t/qc_info.test6
-rw-r--r--mysql-test/suite/plugins/t/qc_info_init.inc23
-rw-r--r--mysql-test/suite/plugins/t/qc_info_priv.test2
-rw-r--r--mysql-test/suite/plugins/t/show_all_plugins.test2
-rw-r--r--mysql-test/suite/plugins/t/simple_password_check.test120
-rw-r--r--mysql-test/suite/plugins/t/two_password_validations.test38
-rw-r--r--mysql-test/suite/plugins/t/unix_socket.test2
-rw-r--r--mysql-test/suite/roles/acl_statistics.result106
-rw-r--r--mysql-test/suite/roles/acl_statistics.test66
-rw-r--r--mysql-test/suite/roles/admin.result29
-rw-r--r--mysql-test/suite/roles/admin.test2
-rw-r--r--mysql-test/suite/roles/create_and_drop_current.result1
-rw-r--r--mysql-test/suite/roles/create_and_drop_current.test1
-rw-r--r--mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result14
-rw-r--r--mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test28
-rw-r--r--mysql-test/suite/roles/definer.result61
-rw-r--r--mysql-test/suite/roles/definer.test3
-rw-r--r--mysql-test/suite/roles/drop_current_user-5176.result3
-rw-r--r--mysql-test/suite/roles/drop_current_user-5176.test1
-rw-r--r--mysql-test/suite/roles/grant-5771.result1
-rw-r--r--mysql-test/suite/roles/grant-5771.test1
-rw-r--r--mysql-test/suite/roles/grant_revoke_current.result15
-rw-r--r--mysql-test/suite/roles/grant_revoke_current.test7
-rw-r--r--mysql-test/suite/roles/grant_role_auto_create_user.result6
-rw-r--r--mysql-test/suite/roles/grant_role_auto_create_user.test8
-rw-r--r--mysql-test/suite/roles/i_s_applicable_roles_is_default.result80
-rw-r--r--mysql-test/suite/roles/i_s_applicable_roles_is_default.test63
-rw-r--r--mysql-test/suite/roles/password.result21
-rw-r--r--mysql-test/suite/roles/password.test23
-rw-r--r--mysql-test/suite/roles/prepare_stmt_with_role.result107
-rw-r--r--mysql-test/suite/roles/prepare_stmt_with_role.test85
-rw-r--r--mysql-test/suite/roles/recursive.result24
-rw-r--r--mysql-test/suite/roles/recursive_dbug.result24
-rw-r--r--mysql-test/suite/roles/rpl_definer.result16
-rw-r--r--mysql-test/suite/roles/set_default_role_clear.result35
-rw-r--r--mysql-test/suite/roles/set_default_role_clear.test52
-rw-r--r--mysql-test/suite/roles/set_default_role_for.result65
-rw-r--r--mysql-test/suite/roles/set_default_role_for.test87
-rw-r--r--mysql-test/suite/roles/set_default_role_invalid.result40
-rw-r--r--mysql-test/suite/roles/set_default_role_invalid.test62
-rw-r--r--mysql-test/suite/roles/set_default_role_new_connection.result48
-rw-r--r--mysql-test/suite/roles/set_default_role_new_connection.test47
-rw-r--r--mysql-test/suite/roles/set_default_role_ps-6960.result8
-rw-r--r--mysql-test/suite/roles/set_default_role_ps-6960.test15
-rw-r--r--mysql-test/suite/roles/set_role-recursive.result8
-rw-r--r--mysql-test/suite/roles/set_role-simple.result13
-rw-r--r--mysql-test/suite/roles/set_role-simple.test15
-rw-r--r--mysql-test/suite/roles/show_grants.result16
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.result57
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.test41
-rw-r--r--mysql-test/suite/rpl/include/hrtime.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_set_statement.inc31
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_mix.result7
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_row.result15
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_statement.result4
-rw-r--r--mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result19
-rw-r--r--mysql-test/suite/rpl/r/mysql-wsrep#110-2.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_EE_err.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_errors.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_grant.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_db.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_event.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_function.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_index.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_procedure.result64
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_role.result41
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_trigger.result48
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_udf.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_user.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_view.result99
-rw-r--r--mysql-test/suite/rpl/r/rpl_current_user.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_ddl.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter.result286
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result415
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result59
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result177
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_basic.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_crash.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result30
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result55
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_sort.result99
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime_row.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug28430.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result116
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel.result74
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_multilevel.result164
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic.result551
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result85
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_temptable.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_USER.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_UUID.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_8partition.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_select.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result250
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_blobs.result4733
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_eng_min.result3516
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result3516
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mixing_engines.result116
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result502
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp012.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig004.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_triggers.result64
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_triggers_sbr.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_view01.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result467
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result467
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result133
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_statement.result142
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_statement.test0
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_statement_default_master.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_replication.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_slow_query_log.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_maria.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_strict_password_validation.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_table_options.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result83
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result85
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result85
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56_dst.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result85
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result85
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result51
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_upgrade_master_info.result88
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_view_debug.result34
-rw-r--r--mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff11
-rw-r--r--mysql-test/suite/rpl/r/temporal_row-9560.result15
-rw-r--r--mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test35
-rw-r--r--mysql-test/suite/rpl/t/mysql-wsrep#110-2.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_EE_err.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors.test406
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_grant.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test78
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum.test327
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum_cache.test256
-rw-r--r--mysql-test/suite/rpl/t/rpl_commit_after_flush.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_corruption.test171
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_db.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_event.test27
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_function.test54
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_index.test19
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_procedure.test81
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_role.test48
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_trigger.test48
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_udf.test56
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_user.test51
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_view.test55
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ddl.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_delete_no_where.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_do_grant.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter.test431
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test399
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test98
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test221
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test79
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db_fail.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_basic.test538
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_crash.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test95
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev9033.cnf20
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test72
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_sort.test77
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_grant.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test49
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave_errors.test90
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test241
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test116
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update3.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_mysql_upgrade.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_optimize.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test178
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel.test2414
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_multilevel.cnf24
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_multilevel.test284
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic.test494
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.cnf9
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test74
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test35
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_temptable.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_001.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_USER.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_UUID.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_8partition.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_delayed_ins.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img.cnf21
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_blobs.cnf1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_blobs.test59
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_min.cnf1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_min.test39
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.cnf1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test39
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_max_relay_size.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test312
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp009.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp012.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig004.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_triggers.test51
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test43
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_view01.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test585
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test254
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_statement.test61
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_statement_default_master.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_replication.test378
-rw-r--r--mysql-test/suite/rpl/t/rpl_slow_query_log.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_special_charset.test27
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master.test27
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test111
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl1.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_loadfile.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test102
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_strict_password_validation.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test625
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync.test153
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mariadb53.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56_dst.test37
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mariadb53.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mysql56.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb53.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_2myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_3innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv.test73
-rw-r--r--mysql-test/suite/rpl/t/rpl_upgrade_master_info.test163
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_view_debug.test34
-rw-r--r--mysql-test/suite/rpl/t/temporal_row-9560-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/temporal_row-9560.combinations6
-rw-r--r--mysql-test/suite/rpl/t/temporal_row-9560.test20
-rw-r--r--mysql-test/suite/storage_engine/col_opt_not_null.result10
-rw-r--r--mysql-test/suite/storage_engine/col_opt_null.result10
-rw-r--r--mysql-test/suite/storage_engine/col_opt_unsigned.result10
-rw-r--r--mysql-test/suite/storage_engine/col_opt_zerofill.result10
-rw-r--r--mysql-test/suite/storage_engine/foreign_keys.test4
-rw-r--r--mysql-test/suite/storage_engine/select.result5
-rw-r--r--mysql-test/suite/storage_engine/select.test6
-rw-r--r--mysql-test/suite/storage_engine/type_char_indexes.result2
-rw-r--r--mysql-test/suite/storage_engine/type_float.result10
-rw-r--r--mysql-test/suite/storage_engine/type_spatial.result4
-rw-r--r--mysql-test/suite/storage_engine/type_spatial_indexes.result8
-rw-r--r--mysql-test/suite/stress/include/ddl7.inc4
-rw-r--r--mysql-test/suite/sys_vars/disabled.def2
-rw-r--r--mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc55
-rw-r--r--mysql-test/suite/sys_vars/inc/collation_basic.inc2
-rw-r--r--mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc112
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvars_server.inc69
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvars_server.opt1
-rw-r--r--mysql-test/suite/sys_vars/r/aria_encrypt_tables_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/back_log_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_row_image_basic.result100
-rw-r--r--mysql-test/suite/sys_vars/r/collation_connection_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/collation_database_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/collation_server_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/debug_crc_break_basic.result39
-rw-r--r--mysql-test/suite/sys_vars/r/debug_mutex_deadlock_detector_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/default_tmp_storage_engine_basic.result181
-rw-r--r--mysql-test/suite/sys_vars/r/delay_key_write_func.result39
-rw-r--r--mysql-test/suite/sys_vars/r/encrypt_tmp_disk_tables_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/enforce_storage_engine_basic.result39
-rw-r--r--mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result290
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result188
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result195
-rw-r--r--mysql-test/suite/sys_vars/r/have_ndbcluster_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_background_scrub_data_check_interval_basic.result72
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_background_scrub_data_compressed_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_background_scrub_data_interval_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_background_scrub_data_uncompressed_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buf_dump_status_frequency_basic.result42
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_compression_algorithm_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_basic.result18
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result37
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result42
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result42
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result28
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result33
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_disallow_writes_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_encrypt_log_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_encryption_rotate_key_age_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_encryption_rotation_iops_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_encryption_threads_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result25
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_force_primary_key_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result77
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_immediate_scrub_data_uncompressed_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result45
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_mtflush_threads_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_prefix_index_cluster_optimization_basic.result122
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_scrub_log_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_scrub_log_speed_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_use_mtflush_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result33
-rw-r--r--mysql-test/suite/sys_vars/r/join_buffer_size_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_basename_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_index_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result46
-rw-r--r--mysql-test/suite/sys_vars/r/log_tc_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/max_statement_time_basic.result172
-rw-r--r--mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result54
-rw-r--r--mysql-test/suite/sys_vars/r/max_user_connections_func.result1
-rw-r--r--mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_stats_method_func.result6
-rw-r--r--mysql-test/suite/sys_vars/r/mysql56_temporal_format_basic.result95
-rw-r--r--mysql-test/suite/sys_vars/r/mysql56_temporal_format_func.result63
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_limit_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_type_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_type_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result46
-rw-r--r--mysql-test/suite/sys_vars/r/rand_seed1_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/rand_seed2_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_basename_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_index_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic.result132
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_basic.result46
-rw-r--r--mysql-test/suite/sys_vars/r/secure_auth_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/show_vs_valstr.result10
-rw-r--r--mysql-test/suite/sys_vars/r/skip_parallel_replication_basic.result15
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_basic.result16
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_func.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/sync_master_info_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sync_relay_log_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff105
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_aria.result297
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff11
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_debug.result87
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff1243
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff571
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff688
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result2415
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff1244
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result4337
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff1280
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result5107
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff47
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_wsrep.result605
-rw-r--r--mysql-test/suite/sys_vars/r/table_open_cache_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/thread_pool_max_threads_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/thread_stack_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/version_ssl_library_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/wait_timeout_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_auto_increment_control_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result64
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_certify_nonpk_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_cluster_address_basic.result54
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_cluster_name_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_convert_lock_to_trx_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_dbug_option_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_debug_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_desync_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result54
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_drupal_282555_workaround_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_forced_binlog_format_basic.result51
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_gtid_domain_id_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_gtid_mode_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_load_data_splitting_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_log_conflicts_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_max_ws_rows_basic.result51
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_mysql_replication_bundle_basic.result52
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_node_address_basic.result49
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_node_incoming_address_basic.result56
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result61
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_on_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_osu_method_basic.result61
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_provider_basic.result40
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result49
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_recover_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_replicate_myisam_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_restart_slave_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_retry_autocommit_basic.result63
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_slave_fk_checks_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_slave_threads_basic.result49
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_slave_uk_checks_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_sst_auth_basic.result52
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_sst_donor_rejects_queries_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_sst_method_basic.result54
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_sst_receive_address_basic.result64
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result54
-rw-r--r--mysql-test/suite/sys_vars/t/aria_encrypt_tables_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_row_image_basic.test129
-rw-r--r--mysql-test/suite/sys_vars/t/debug_crc_break_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/debug_mutex_deadlock_detector_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/default_tmp_storage_engine_basic.test193
-rw-r--r--mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/delay_key_write_func.test46
-rw-r--r--mysql-test/suite/sys_vars/t/encrypt_tmp_disk_tables_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/enforce_storage_engine_basic.test40
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test8
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test8
-rw-r--r--mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_background_scrub_data_check_interval_basic.test54
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_background_scrub_data_compressed_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_background_scrub_data_interval_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_background_scrub_data_uncompressed_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buf_dump_status_frequency_basic.test39
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_basic.test20
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test27
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test37
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_disallow_writes_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_encrypt_log_basic.test50
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_encryption_rotate_key_age_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_encryption_rotation_iops_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_encryption_threads_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test120
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_force_primary_key_basic.test57
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_idle_flush_pct_basic.test63
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_immediate_scrub_data_uncompressed_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_mtflush_threads_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_prefix_index_cluster_optimization_basic.test76
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_scrub_log_basic.test50
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_scrub_log_speed_basic.test55
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_use_mtflush_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_basename_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_index_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test61
-rw-r--r--mysql-test/suite/sys_vars/t/log_tc_size_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/max_digest_length_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/max_statement_time_basic.test217
-rw-r--r--mysql-test/suite/sys_vars/t/max_user_connections_func.test1
-rw-r--r--mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test165
-rw-r--r--mysql-test/suite/sys_vars/t/mysql56_temporal_format_func.test66
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_limit_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_type_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/rand_seed1_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/rand_seed2_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_basename_basic.test16
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_index_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic.test180
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_point_basic.test40
-rw-r--r--mysql-test/suite/sys_vars/t/show_vs_valstr.test12
-rw-r--r--mysql-test/suite/sys_vars/t/skip_parallel_replication_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test34
-rw-r--r--mysql-test/suite/sys_vars/t/slave_run_triggers_for_rbr_basic.test30
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_func.test15
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_aria.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_aria.test7
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_debug.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_debug.test7
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_innodb.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_innodb.test19
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_server_embedded.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_server_notembedded.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_wsrep.test13
-rw-r--r--mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/version_ssl_library_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_auto_increment_control_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test45
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_certify_nonpk_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_cluster_address_basic.test49
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_cluster_name_basic.test40
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_convert_lock_to_trx_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test28
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_dbug_option_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_debug_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_desync_basic.test57
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test48
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_drupal_282555_workaround_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_forced_binlog_format_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_gtid_domain_id_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_gtid_mode_basic.test33
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_load_data_splitting_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_log_conflicts_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_max_ws_rows_basic.test45
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_mysql_replication_bundle_basic.test45
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_node_address_basic.test45
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_node_incoming_address_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test54
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_on_basic.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_on_basic.test45
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_osu_method_basic.test49
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_provider_basic.test39
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test51
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_recover_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_replicate_myisam_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_restart_slave_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_retry_autocommit_basic.test52
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_slave_fk_checks_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_slave_threads_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_slave_uk_checks_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_sst_auth_basic.test45
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_sst_donor_rejects_queries_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_sst_method_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_sst_receive_address_basic.test53
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test56
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_sync_wait_basic.test47
-rw-r--r--mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc16
-rw-r--r--mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc4
-rw-r--r--mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc20
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result12
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result12
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result51
-rw-r--r--mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_select_innodb.result2
-rw-r--r--mysql-test/suite/vcol/r/vcol_select_myisam.result2
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result53
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result53
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test31
-rw-r--r--mysql-test/suite/wsrep/README7
-rw-r--r--mysql-test/suite/wsrep/disabled.def1
-rw-r--r--mysql-test/suite/wsrep/include/check_galera_version.inc39
-rw-r--r--mysql-test/suite/wsrep/my.cnf12
-rw-r--r--mysql-test/suite/wsrep/r/alter_table_innodb.result8
-rw-r--r--mysql-test/suite/wsrep/r/binlog_format.result61
-rw-r--r--mysql-test/suite/wsrep/r/foreign_key.result19
-rw-r--r--mysql-test/suite/wsrep/r/mdev_10186.result11
-rw-r--r--mysql-test/suite/wsrep/r/mdev_6832.result11
-rw-r--r--mysql-test/suite/wsrep/r/mdev_7798.result13
-rw-r--r--mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result78
-rw-r--r--mysql-test/suite/wsrep/r/plugin.result3
-rw-r--r--mysql-test/suite/wsrep/r/pool_of_threads.result8
-rw-r--r--mysql-test/suite/wsrep/r/trans.result9
-rw-r--r--mysql-test/suite/wsrep/r/variables.result231
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_rpl.result22
-rw-r--r--mysql-test/suite/wsrep/suite.pm36
-rw-r--r--mysql-test/suite/wsrep/t/alter_table_innodb.opt1
-rw-r--r--mysql-test/suite/wsrep/t/alter_table_innodb.test10
-rw-r--r--mysql-test/suite/wsrep/t/binlog_format.opt1
-rw-r--r--mysql-test/suite/wsrep/t/binlog_format.test47
-rw-r--r--mysql-test/suite/wsrep/t/foreign_key.opt1
-rw-r--r--mysql-test/suite/wsrep/t/foreign_key.test20
-rw-r--r--mysql-test/suite/wsrep/t/mdev_10186.opt1
-rw-r--r--mysql-test/suite/wsrep/t/mdev_10186.test13
-rw-r--r--mysql-test/suite/wsrep/t/mdev_6832.opt1
-rw-r--r--mysql-test/suite/wsrep/t/mdev_6832.test15
-rw-r--r--mysql-test/suite/wsrep/t/mdev_7798.opt1
-rw-r--r--mysql-test/suite/wsrep/t/mdev_7798.test17
-rw-r--r--mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test40
-rw-r--r--mysql-test/suite/wsrep/t/plugin.test7
-rw-r--r--mysql-test/suite/wsrep/t/pool_of_threads.opt1
-rw-r--r--mysql-test/suite/wsrep/t/pool_of_threads.test12
-rw-r--r--mysql-test/suite/wsrep/t/trans.test14
-rw-r--r--mysql-test/suite/wsrep/t/variables.test140
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_rpl.cnf1
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_rpl.test44
-rw-r--r--mysql-test/t/alter_table.test35
-rw-r--r--mysql-test/t/alter_table_online.test24
-rw-r--r--mysql-test/t/analyze_format_json.test214
-rw-r--r--mysql-test/t/analyze_stmt.test275
-rw-r--r--mysql-test/t/analyze_stmt_orderby.test177
-rw-r--r--mysql-test/t/analyze_stmt_privileges.test50
-rw-r--r--mysql-test/t/analyze_stmt_privileges2.test5403
-rw-r--r--mysql-test/t/analyze_stmt_slow_query_log-master.opt1
-rw-r--r--mysql-test/t/analyze_stmt_slow_query_log.test38
-rw-r--r--mysql-test/t/auth_named_pipe-master.opt1
-rw-r--r--mysql-test/t/auth_named_pipe.test23
-rw-r--r--mysql-test/t/blackhole_plugin.test3
-rw-r--r--mysql-test/t/bootstrap.test1
-rw-r--r--mysql-test/t/case.test73
-rw-r--r--mysql-test/t/cast.test55
-rw-r--r--mysql-test/t/change_user.test12
-rw-r--r--mysql-test/t/compound.test159
-rw-r--r--mysql-test/t/connect.test9
-rw-r--r--mysql-test/t/create.test345
-rw-r--r--mysql-test/t/create_drop_binlog.test196
-rw-r--r--mysql-test/t/create_drop_db.test32
-rw-r--r--mysql-test/t/create_drop_event.test47
-rw-r--r--mysql-test/t/create_drop_function.test41
-rw-r--r--mysql-test/t/create_drop_index.test16
-rw-r--r--mysql-test/t/create_drop_procedure.test41
-rw-r--r--mysql-test/t/create_drop_role.test56
-rw-r--r--mysql-test/t/create_drop_server.test25
-rw-r--r--mysql-test/t/create_drop_trigger.test31
-rw-r--r--mysql-test/t/create_drop_udf.test37
-rw-r--r--mysql-test/t/create_drop_user.test46
-rw-r--r--mysql-test/t/create_drop_view.test27
-rw-r--r--mysql-test/t/create_or_replace.test2
-rw-r--r--mysql-test/t/create_or_replace_permission.test71
-rw-r--r--mysql-test/t/create_w_max_indexes_128.test571
-rw-r--r--mysql-test/t/create_w_max_indexes_64.test334
-rw-r--r--mysql-test/t/ctype_big5.test2
-rw-r--r--mysql-test/t/ctype_binary.test47
-rw-r--r--mysql-test/t/ctype_cp1250_ch.test1
-rw-r--r--mysql-test/t/ctype_cp1251.test35
-rw-r--r--mysql-test/t/ctype_cp932_binlog_stm.test2
-rw-r--r--mysql-test/t/ctype_eucjpms.test26
-rw-r--r--mysql-test/t/ctype_euckr.test6
-rw-r--r--mysql-test/t/ctype_filename.test5
-rw-r--r--mysql-test/t/ctype_gb2312.test2
-rw-r--r--mysql-test/t/ctype_gbk.test234
-rw-r--r--mysql-test/t/ctype_latin1.test128
-rw-r--r--mysql-test/t/ctype_latin2_ch.test3
-rw-r--r--mysql-test/t/ctype_ldml.test12
-rw-r--r--mysql-test/t/ctype_like_range.test19
-rw-r--r--mysql-test/t/ctype_many.test19
-rw-r--r--mysql-test/t/ctype_sjis.test2
-rw-r--r--mysql-test/t/ctype_tis620.test2
-rw-r--r--mysql-test/t/ctype_uca.test36
-rw-r--r--mysql-test/t/ctype_uca_partitions.test38
-rw-r--r--mysql-test/t/ctype_ucs.test43
-rw-r--r--mysql-test/t/ctype_ujis.test29
-rw-r--r--mysql-test/t/ctype_upgrade.test1
-rw-r--r--mysql-test/t/ctype_utf16.test35
-rw-r--r--mysql-test/t/ctype_utf16_uca.test13
-rw-r--r--mysql-test/t/ctype_utf16le.test34
-rw-r--r--mysql-test/t/ctype_utf32.test23
-rw-r--r--mysql-test/t/ctype_utf32_uca.test13
-rw-r--r--mysql-test/t/ctype_utf8.test146
-rw-r--r--mysql-test/t/ctype_utf8mb4.test64
-rw-r--r--mysql-test/t/ctype_utf8mb4_uca.test13
-rw-r--r--mysql-test/t/ddl_i18n_koi8r.test2
-rw-r--r--mysql-test/t/ddl_i18n_utf8.test2
-rw-r--r--mysql-test/t/default.test17
-rw-r--r--mysql-test/t/delayed.test41
-rw-r--r--mysql-test/t/delete_returning_grant.test4
-rw-r--r--mysql-test/t/delimiter_case_mdev_10728.sql3
-rw-r--r--mysql-test/t/delimiter_command_case_sensitivity.test4
-rw-r--r--mysql-test/t/derived.test34
-rw-r--r--mysql-test/t/derived_view.test4
-rw-r--r--mysql-test/t/distinct.test4
-rw-r--r--mysql-test/t/drop_bad_db_type.test6
-rw-r--r--mysql-test/t/enforce_storage_engine.test111
-rw-r--r--mysql-test/t/enforce_storage_engine_opt.opt1
-rw-r--r--mysql-test/t/enforce_storage_engine_opt.test7
-rw-r--r--mysql-test/t/errors.test15
-rw-r--r--mysql-test/t/events_1.test2
-rw-r--r--mysql-test/t/events_2.test2
-rw-r--r--mysql-test/t/events_bugs.test12
-rw-r--r--mysql-test/t/events_trans.test2
-rw-r--r--mysql-test/t/events_trans_notembedded.test1
-rw-r--r--mysql-test/t/explain_json.test398
-rw-r--r--mysql-test/t/explain_json_format_partitions.test17
-rw-r--r--mysql-test/t/explain_json_innodb.test28
-rw-r--r--mysql-test/t/fast_prefix_index_fetch_innodb.test150
-rw-r--r--mysql-test/t/features.test2
-rw-r--r--mysql-test/t/file_contents.test12
-rw-r--r--mysql-test/t/fix_priv_tables.test2
-rw-r--r--mysql-test/t/flush-innodb-notembedded.test2
-rw-r--r--mysql-test/t/flush2.test7
-rw-r--r--mysql-test/t/flush_read_lock.test3
-rw-r--r--mysql-test/t/fulltext_order_by.test5
-rw-r--r--mysql-test/t/func_compress.test26
-rw-r--r--mysql-test/t/func_crypt.test28
-rw-r--r--mysql-test/t/func_digest.test26
-rw-r--r--mysql-test/t/func_encrypt.test18
-rw-r--r--mysql-test/t/func_gconcat.test41
-rw-r--r--mysql-test/t/func_group.test95
-rw-r--r--mysql-test/t/func_hybrid_type.test461
-rw-r--r--mysql-test/t/func_if.test2
-rw-r--r--mysql-test/t/func_in.test17
-rw-r--r--mysql-test/t/func_like.test42
-rw-r--r--mysql-test/t/func_math.test2
-rw-r--r--mysql-test/t/func_misc.test29
-rw-r--r--mysql-test/t/func_regexp_pcre.test23
-rw-r--r--mysql-test/t/func_str.test67
-rw-r--r--mysql-test/t/func_test.test47
-rw-r--r--mysql-test/t/func_time.test80
-rw-r--r--mysql-test/t/func_weight_string.test36
-rw-r--r--mysql-test/t/gis-precise.test24
-rw-r--r--mysql-test/t/gis-rtree.test34
-rw-r--r--mysql-test/t/gis.test203
-rw-r--r--mysql-test/t/grant.test7
-rw-r--r--mysql-test/t/grant2.test3
-rw-r--r--mysql-test/t/grant3.test3
-rw-r--r--mysql-test/t/grant4.test36
-rw-r--r--mysql-test/t/grant_4332.test3
-rw-r--r--mysql-test/t/grant_explain_non_select.test5
-rw-r--r--mysql-test/t/grant_lowercase.test9
-rw-r--r--mysql-test/t/grant_lowercase_fs.test2
-rw-r--r--mysql-test/t/group_by.test102
-rw-r--r--mysql-test/t/group_by_innodb.test30
-rw-r--r--mysql-test/t/group_min_max.test87
-rw-r--r--mysql-test/t/having.test15
-rw-r--r--mysql-test/t/help.test2
-rw-r--r--mysql-test/t/host_cache_size_functionality.test2
-rw-r--r--mysql-test/t/implicit_commit.test2
-rw-r--r--mysql-test/t/index_intersect.test2
-rw-r--r--mysql-test/t/information_schema.test39
-rw-r--r--mysql-test/t/information_schema_all_engines-master.opt3
-rw-r--r--mysql-test/t/information_schema_all_engines.test2
-rw-r--r--mysql-test/t/information_schema_db.test6
-rw-r--r--mysql-test/t/information_schema_inno.test6
-rw-r--r--mysql-test/t/information_schema_linux.test10
-rw-r--r--mysql-test/t/information_schema_routines.test2
-rw-r--r--mysql-test/t/innodb_ext_key.test136
-rw-r--r--mysql-test/t/innodb_group.test22
-rw-r--r--mysql-test/t/innodb_load_xa.opt2
-rw-r--r--mysql-test/t/innodb_load_xa.test6
-rw-r--r--mysql-test/t/insert.test2
-rw-r--r--mysql-test/t/insert_notembedded.test6
-rw-r--r--mysql-test/t/insert_update.test6
-rw-r--r--mysql-test/t/join_cache.test34
-rw-r--r--mysql-test/t/join_outer.test81
-rw-r--r--mysql-test/t/key.test2
-rw-r--r--mysql-test/t/kill.test32
-rw-r--r--mysql-test/t/loadxml.test13
-rw-r--r--mysql-test/t/lock_multi.test2
-rw-r--r--mysql-test/t/lock_sync-master.opt1
-rw-r--r--mysql-test/t/log_state.test8
-rw-r--r--mysql-test/t/log_tables.test16
-rw-r--r--mysql-test/t/log_tables_upgrade.test1
-rw-r--r--[-rwxr-xr-x]mysql-test/t/long_tmpdir-master.sh1
-rw-r--r--mysql-test/t/lowercase_fs_off.test4
-rw-r--r--mysql-test/t/lowercase_fs_on.test2
-rw-r--r--[-rwxr-xr-x]mysql-test/t/lowercase_mixed_tmpdir-master.sh1
-rw-r--r--mysql-test/t/lowercase_table4.test3
-rw-r--r--mysql-test/t/lowercase_table_grant.test1
-rw-r--r--mysql-test/t/lowercase_table_qcache.test5
-rw-r--r--mysql-test/t/max_statement_time.test228
-rw-r--r--mysql-test/t/mdl_sync.test24
-rw-r--r--mysql-test/t/merge.test13
-rw-r--r--mysql-test/t/metadata.test4
-rw-r--r--mysql-test/t/multi_update.test5
-rw-r--r--mysql-test/t/myisam-optimize.test58
-rw-r--r--mysql-test/t/myisam_recover-master.opt2
-rw-r--r--mysql-test/t/mysql.test27
-rw-r--r--mysql-test/t/mysql_comments.test4
-rw-r--r--mysql-test/t/mysql_plugin.test368
-rw-r--r--mysql-test/t/mysql_upgrade.test29
-rw-r--r--mysql-test/t/mysql_upgrade_noengine.test57
-rw-r--r--mysql-test/t/mysql_upgrade_ssl.test3
-rw-r--r--mysql-test/t/mysql_upgrade_view.test2
-rw-r--r--mysql-test/t/mysqlbinlog-innodb.test1
-rw-r--r--mysql-test/t/mysqlbinlog.test16
-rw-r--r--mysql-test/t/mysqlbinlog_raw_mode.test387
-rw-r--r--mysql-test/t/mysqlbinlog_row_minimal.opt1
-rw-r--r--mysql-test/t/mysqlbinlog_row_minimal.test33
-rw-r--r--mysql-test/t/mysqld--help.test9
-rw-r--r--mysql-test/t/mysqld_help_crash-9183.test9
-rw-r--r--mysql-test/t/mysqldump-max.test8
-rw-r--r--mysql-test/t/mysqldump.test65
-rw-r--r--mysql-test/t/mysqltest.test28
-rw-r--r--mysql-test/t/not_embedded_server.test2
-rw-r--r--mysql-test/t/null.test730
-rw-r--r--mysql-test/t/old-mode.test44
-rw-r--r--mysql-test/t/openssl_1.test7
-rw-r--r--mysql-test/t/openssl_6975.test17
-rw-r--r--mysql-test/t/order_by.test135
-rw-r--r--mysql-test/t/order_by_innodb.test40
-rw-r--r--mysql-test/t/order_by_optimizer_innodb.test98
-rw-r--r--mysql-test/t/parser.test267
-rw-r--r--mysql-test/t/partition.test14
-rw-r--r--mysql-test/t/partition_alter.test48
-rw-r--r--mysql-test/t/partition_bug18198.test2
-rw-r--r--mysql-test/t/partition_column.test2
-rw-r--r--mysql-test/t/partition_grant.test1
-rw-r--r--mysql-test/t/partition_hash.test2
-rw-r--r--mysql-test/t/partition_innodb.test2
-rw-r--r--mysql-test/t/partition_not_blackhole.test2
-rw-r--r--mysql-test/t/partition_symlink.test3
-rw-r--r--mysql-test/t/plugin.test2
-rw-r--r--mysql-test/t/plugin_auth.test8
-rw-r--r--mysql-test/t/plugin_auth_qa.test3
-rw-r--r--mysql-test/t/plugin_not_embedded.test2
-rw-r--r--mysql-test/t/processlist.test20
-rw-r--r--mysql-test/t/ps.test17
-rw-r--r--mysql-test/t/ps_1general.test2
-rw-r--r--mysql-test/t/ps_4heap.test3
-rw-r--r--mysql-test/t/ps_5merge.test4
-rw-r--r--mysql-test/t/ps_ddl.test24
-rw-r--r--mysql-test/t/query_cache.test14
-rw-r--r--mysql-test/t/query_cache_debug.test1
-rw-r--r--mysql-test/t/query_cache_merge.test6
-rw-r--r--mysql-test/t/query_cache_notembedded-master.opt1
-rw-r--r--mysql-test/t/query_cache_notembedded.test14
-rw-r--r--mysql-test/t/query_cache_with_views.test4
-rw-r--r--mysql-test/t/range.test71
-rw-r--r--mysql-test/t/read_only.test8
-rw-r--r--mysql-test/t/read_only_innodb.test3
-rw-r--r--mysql-test/t/repair_symlink-5543.test7
-rw-r--r--mysql-test/t/row.test29
-rw-r--r--mysql-test/t/select.test6
-rw-r--r--mysql-test/t/selectivity.test6
-rw-r--r--mysql-test/t/selectivity_innodb.test33
-rw-r--r--mysql-test/t/servers.test16
-rw-r--r--mysql-test/t/set_password_plugin-9835.test3
-rw-r--r--mysql-test/t/set_statement.test1134
-rw-r--r--mysql-test/t/set_statement_debug.test24
-rw-r--r--mysql-test/t/set_statement_notembedded.test13
-rw-r--r--mysql-test/t/set_statement_notembedded_binlog.test87
-rw-r--r--mysql-test/t/set_statement_profiling.test9
-rw-r--r--mysql-test/t/show.test15
-rw-r--r--mysql-test/t/show_check-master.opt2
-rw-r--r--mysql-test/t/show_check.test9
-rw-r--r--mysql-test/t/show_explain.test2
-rw-r--r--mysql-test/t/show_grants_with_plugin-7985.test2
-rw-r--r--mysql-test/t/single_delete_update.test27
-rw-r--r--mysql-test/t/single_delete_update_innodb.test30
-rw-r--r--mysql-test/t/skip_grants.test5
-rw-r--r--mysql-test/t/skip_name_resolve.test1
-rw-r--r--mysql-test/t/slowlog_enospace-10508.test24
-rw-r--r--mysql-test/t/sp-destruct.test1
-rw-r--r--mysql-test/t/sp-error.test14
-rw-r--r--mysql-test/t/sp-security.test19
-rw-r--r--mysql-test/t/sp-ucs2.test6
-rw-r--r--mysql-test/t/sp.test309
-rw-r--r--mysql-test/t/sp_notembedded.test2
-rw-r--r--mysql-test/t/sp_trans.test2
-rw-r--r--mysql-test/t/sql_mode.test2
-rw-r--r--mysql-test/t/ssl.test5
-rw-r--r--mysql-test/t/ssl_7937.combinations5
-rw-r--r--mysql-test/t/stack-crash.test4
-rw-r--r--mysql-test/t/stat_tables_par.test2
-rw-r--r--mysql-test/t/stat_tables_rbr.test3
-rw-r--r--mysql-test/t/statistics.test48
-rw-r--r--mysql-test/t/status.test1
-rw-r--r--mysql-test/t/status_user.test109
-rw-r--r--mysql-test/t/strict.test16
-rw-r--r--mysql-test/t/subselect.test47
-rw-r--r--mysql-test/t/subselect4.test10
-rw-r--r--mysql-test/t/subselect_cache.test10
-rw-r--r--mysql-test/t/subselect_innodb.test35
-rw-r--r--mysql-test/t/subselect_mat.test16
-rw-r--r--mysql-test/t/subselect_sj.test2
-rw-r--r--mysql-test/t/subselect_sj2.test19
-rw-r--r--mysql-test/t/subselect_sj_mat.test12
-rw-r--r--mysql-test/t/symlink.test27
-rw-r--r--mysql-test/t/system_mysql_db_fix50117.test13
-rw-r--r--mysql-test/t/table_elim.test4
-rw-r--r--mysql-test/t/temp_table.test19
-rw-r--r--mysql-test/t/temp_table_frm.test16
-rw-r--r--mysql-test/t/timezone_grant.test2
-rw-r--r--mysql-test/t/trigger-compat.test1
-rw-r--r--mysql-test/t/trigger.test51
-rw-r--r--mysql-test/t/trigger_no_defaults-11698.test40
-rw-r--r--mysql-test/t/trigger_notembedded.test2
-rw-r--r--mysql-test/t/trigger_null-8605.test389
-rw-r--r--mysql-test/t/type_bit.test19
-rw-r--r--mysql-test/t/type_date.test175
-rw-r--r--mysql-test/t/type_datetime.test88
-rw-r--r--mysql-test/t/type_enum.test31
-rw-r--r--mysql-test/t/type_float.test73
-rw-r--r--mysql-test/t/type_int.test28
-rw-r--r--mysql-test/t/type_newdecimal.test143
-rw-r--r--mysql-test/t/type_num.test707
-rw-r--r--mysql-test/t/type_ranges.test2
-rw-r--r--mysql-test/t/type_set.test32
-rw-r--r--mysql-test/t/type_temporal_innodb.test60
-rw-r--r--mysql-test/t/type_time.test450
-rw-r--r--mysql-test/t/type_timestamp.test73
-rw-r--r--mysql-test/t/type_timestamp_hires.test2
-rw-r--r--mysql-test/t/type_varchar.test36
-rw-r--r--mysql-test/t/type_year.test22
-rw-r--r--mysql-test/t/union.test164
-rw-r--r--mysql-test/t/update_innodb.test27
-rw-r--r--mysql-test/t/user_limits.test5
-rw-r--r--mysql-test/t/user_var.test10
-rw-r--r--mysql-test/t/userstat.test116
-rw-r--r--mysql-test/t/variables-notembedded.test34
-rw-r--r--mysql-test/t/variables.test6
-rw-r--r--mysql-test/t/view.test116
-rw-r--r--mysql-test/t/view_debug.test36
-rw-r--r--mysql-test/t/view_grant.test34
-rw-r--r--mysql-test/t/warnings_engine_disabled.test2
-rw-r--r--mysql-test/t/xa_sync.test45
-rw-r--r--mysql-test/t/xml.test2
-rw-r--r--mysql-test/unstable-tests457
-rw-r--r--mysql-test/valgrind.supp254
3329 files changed, 207311 insertions, 29952 deletions
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 9e0e49b1294..c03f0c35838 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -75,7 +75,7 @@ ENDIF()
IF(WITH_EMBEDDED_SERVER)
SET(TEST_EMBEDDED ${MTR_FORCE} --comment=embedded --timer --embedded-server
- --skip-rpl --skip-ndbcluster ${EXP})
+ --skip-rpl ${EXP})
ELSE()
SET(TEST_EMBEDDED echo "Can not test embedded, not compiled in")
ENDIF()
@@ -93,8 +93,8 @@ ADD_CUSTOM_TARGET(test-force
ADD_CUSTOM_TARGET(test-bt
${TEST_BT_START}
- COMMAND ${MTR_FORCE} --comment=normal --timer --skip-ndbcluster --report-features ${EXP}
- COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol ${EXP}
+ COMMAND ${MTR_FORCE} --comment=normal --timer --report-features ${EXP}
+ COMMAND ${MTR_FORCE} --comment=ps --timer --ps-protocol ${EXP}
COMMAND ${MTR_FORCE} --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1 ${EXP}
COMMAND ${MTR_FORCE} --comment=funcs2 --suite=funcs_2 ${EXP}
COMMAND ${MTR_FORCE} --comment=partitions --suite=parts ${EXP}
@@ -106,13 +106,13 @@ ADD_CUSTOM_TARGET(test-bt
ADD_CUSTOM_TARGET(test-bt-fast
${TEST_BT_START}
- COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol --report-features ${EXP}
+ COMMAND ${MTR_FORCE} --comment=ps --timer --ps-protocol --report-features ${EXP}
COMMAND ${MTR_FORCE} --comment=stress --suite=stress ${EXP}
)
ADD_CUSTOM_TARGET(test-bt-debug
${TEST_BT_START}
- COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
+ COMMAND ${MTR_FORCE} --comment=debug --timer --skip-rpl --report-features ${EXP}
)
# Process .in files with includes in collections/
@@ -140,3 +140,19 @@ ENDMACRO()
# FILE(APPEND ${colldone} "${collin}\n")
# ENDIF()
#ENDFOREACH()
+
+# With different MAX_INDEXES values, server might behave differently in
+# certain cases. 'max_indexes.inc' file should be updated accordingly to
+# reflect the current MAX_INDEXES value. This file helps MTR to decide on
+# which tests should be skipped.
+# NOTE: While committing a patch please make sure that the file is unmodified
+# and should show the default MAX_INDEXES (i.e. 64U).
+IF (MAX_INDEXES)
+ IF(NOT (${MAX_INDEXES} EQUAL 64U))
+ FILE(WRITE include/max_indexes.inc
+ "# Warning: This is an auto-generated file. Please do not modify it.
+--let $max_indexes = ${MAX_INDEXES}\n")
+ MESSAGE(STATUS "mysql-test/include/max_indexes.inc adjusted")
+ ENDIF()
+ENDIF()
+
diff --git a/mysql-test/collections/buildbot_suites.bat b/mysql-test/collections/buildbot_suites.bat
new file mode 100644
index 00000000000..a62d535d951
--- /dev/null
+++ b/mysql-test/collections/buildbot_suites.bat
@@ -0,0 +1 @@
+perl mysql-test-run.pl --verbose-restart --force --testcase-timeout=45 --suite-timeout=600 --max-test-fail=500 --retry=3 --suite=main,innodb,plugins,mariabackup --parallel=4
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 18cd4748687..cc2e86d6eda 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -1,7 +1,7 @@
# For easier human reading (MTR doesn't care), please keep entries
# in alphabetical order. This also helps with merge conflict resolution.
-binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
+binlog.binlog_multi_engine # joro : tests marked as experimental as agreed with bochklin
funcs_1.charset_collation_1 # depends on compile-time decisions
diff --git a/mysql-test/collections/mysql-trunk.daily b/mysql-test/collections/mysql-trunk.daily
index 47d189a2c65..9654d61be06 100644
--- a/mysql-test/collections/mysql-trunk.daily
+++ b/mysql-test/collections/mysql-trunk.daily
@@ -2,6 +2,5 @@ perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collection
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
-perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_ndb_row --vardir=var-rpl_ndb_row --mysqld=--binlog-format=row --suite=rpl_ndb,ndb
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_checksum --mysqld=--binlog-checksum=CRC32 --vardir=var-rpl_binlog_checksum --suite=binlog,rpl
diff --git a/mysql-test/disabled.def b/mysql-test/disabled.def
index 17bc921ab66..b489139a59f 100644
--- a/mysql-test/disabled.def
+++ b/mysql-test/disabled.def
@@ -17,5 +17,7 @@ mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 chang
ssl_crl_clients_valid : broken upstream
ssl_crl : broken upstream
ssl_crl_clrpath : broken upstream
+innodb-wl5522-debug-zip : broken upstream
+innodb_bug12902967 : broken upstream
file_contents : MDEV-6526 these files are not installed anymore
-lowercase_fs_on : lower_case_table_names=0 is not an error until 10.1
+max_statement_time : cannot possibly work, depends on timing
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index ce5dde97894..831c6c886d5 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -372,7 +372,8 @@ dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
SELECT * FROM t1;
--echo # Their values should be ON
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
+SHOW SESSION VARIABLES LIKE "unique_checks";
--echo
SET @@SESSION.foreign_key_checks= OFF;
@@ -387,7 +388,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
SELECT * FROM t1;
--echo # Their values should be OFF
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
+SHOW SESSION VARIABLES LIKE "unique_checks";
--echo # INSERT INTO t1 VALUES(2)
--echo # foreign_key_checks=1 and unique_checks=1
@@ -401,7 +403,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
SELECT * FROM t1;
--echo # Their values should be OFF
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
+SHOW SESSION VARIABLES LIKE "unique_checks";
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_incident-master.opt b/mysql-test/extra/binlog_tests/binlog_incident-master.opt
index 57ce0081ae5..57ce0081ae5 100644
--- a/mysql-test/suite/binlog/t/binlog_incident-master.opt
+++ b/mysql-test/extra/binlog_tests/binlog_incident-master.opt
diff --git a/mysql-test/extra/binlog_tests/binlog_incident.inc b/mysql-test/extra/binlog_tests/binlog_incident.inc
new file mode 100644
index 00000000000..8ec67746f26
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_incident.inc
@@ -0,0 +1,68 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+#
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --let $binlog_start_pos= <binlog position> # optional
+# --let $binlog_file= <binlog filename> # optional
+#
+# --source extra/binlog_tests/binlog_incident.inc
+#
+# The script uses MYSQLBINLOG to verify certain results.
+# By default, it uses binary logs directly. If it is undesirable,
+# this behavior can be overridden by setting $use_remote_binlog
+# as shown above.
+#
+# All values will be unset after every execution of the script,
+# so if they are needed, they should be set explicitly before each call.
+#
+
+# The purpose of this test is to provide a reference for how the
+# incident log event is represented in the output from the mysqlbinlog
+# program.
+
+source include/have_log_bin.inc;
+source include/have_debug.inc;
+source include/binlog_start_pos.inc;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+RESET MASTER;
+
+CREATE TABLE t1 (a INT);
+
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+
+# This will generate an incident log event and store it in the binary
+# log before the replace statement.
+REPLACE INTO t1 VALUES (4);
+
+DROP TABLE t1;
+FLUSH LOGS;
+
+if ($binlog_start_pos)
+{
+ --let $startpos= --start-position=$binlog_start_pos
+ --let $binlog_start_pos=
+}
+--let $filename= master-bin.000001
+if ($binlog_file)
+{
+ --let $filename= $binlog_file
+ --let $binlog_file=
+}
+--let $mysqlbinlog_args= $MYSQLD_DATADIR/$filename
+if ($use_remote_mysqlbinlog)
+{
+ --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot $filename
+ --let $use_remote_mysqlbinlog= 0
+}
+exec $MYSQL_BINLOG $startpos $mysqlbinlog_args >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
+--disable_query_log
+eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
+--enable_query_log
+
+remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
diff --git a/mysql-test/extra/binlog_tests/binlog_index.inc b/mysql-test/extra/binlog_tests/binlog_index.inc
new file mode 100644
index 00000000000..50215aef9a9
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_index.inc
@@ -0,0 +1,278 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# testing of purging of binary log files bug#18199/Bug#18453
+#
+source include/have_log_bin.inc;
+source include/not_embedded.inc;
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+source include/have_debug.inc;
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
+call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
+call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
+call mtr.add_suppression('Could not open .*');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
+flush tables;
+
+let $old=`select @@debug`;
+
+RESET MASTER;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+let $INDEX=$MYSQLD_DATADIR/master-bin.index;
+
+#
+# testing purge binary logs TO
+#
+
+flush logs;
+flush logs;
+flush logs;
+
+source include/show_binary_logs.inc;
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+flush tables;
+
+# there must be a warning with file names
+replace_regex /\.[\\\/]master/master/;
+--source include/wait_for_binlog_checkpoint.inc
+purge binary logs TO 'master-bin.000004';
+
+--echo *** must show a list starting from the 'TO' argument of PURGE ***
+source include/show_binary_logs.inc;
+
+#
+# testing purge binary logs BEFORE
+#
+
+reset master;
+
+flush logs;
+flush logs;
+flush logs;
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+
+--echo *** must be a warning master-bin.000001 was not found ***
+let $date=`select NOW() + INTERVAL 1 MINUTE`;
+--disable_query_log
+replace_regex /\.[\\\/]master/master/;
+--source include/wait_for_binlog_checkpoint.inc
+eval purge binary logs BEFORE '$date';
+--enable_query_log
+
+--echo *** must show one record, of the active binlog, left in the index file after PURGE ***
+source include/show_binary_logs.inc;
+
+#
+# testing a fatal error
+# Turning a binlog file into a directory must be a portable setup
+#
+
+reset master;
+
+flush logs;
+flush logs;
+flush logs;
+
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+mkdir $MYSQLD_DATADIR/master-bin.000001;
+
+--source include/wait_for_binlog_checkpoint.inc
+--error ER_BINLOG_PURGE_FATAL_ERR
+purge binary logs TO 'master-bin.000002';
+replace_regex /\.[\\\/]master/master/;
+show warnings;
+rmdir $MYSQLD_DATADIR/master-bin.000001;
+--disable_warnings
+reset master;
+--enable_warnings
+
+--echo # crash_purge_before_update_index
+flush logs;
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_purge_before_update_index";
+--source include/wait_for_binlog_checkpoint.inc
+--error 2013
+purge binary logs TO 'master-bin.000002';
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000001;
+file_exists $MYSQLD_DATADIR/master-bin.000002;
+file_exists $MYSQLD_DATADIR/master-bin.000003;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_purge_non_critical_after_update_index
+flush logs;
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
+--source include/wait_for_binlog_checkpoint.inc
+--error 2013
+purge binary logs TO 'master-bin.000004';
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000001;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000002;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000003;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_purge_critical_after_update_index
+flush logs;
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
+--source include/wait_for_binlog_checkpoint.inc
+--error 2013
+purge binary logs TO 'master-bin.000006';
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000004;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000005;
+file_exists $MYSQLD_DATADIR/master-bin.000006;
+file_exists $MYSQLD_DATADIR/master-bin.000007;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000008;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_create_non_critical_before_update_index
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
+--error 2013
+flush logs;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000008;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000009;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_create_critical_before_update_index
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
+--error 2013
+flush logs;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000009;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000010;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000011;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_create_after_update_index
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_create_after_update_index";
+--error 2013
+flush logs;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000010;
+file_exists $MYSQLD_DATADIR/master-bin.000011;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo #
+--echo # This should put the server in unsafe state and stop
+--echo # accepting any command. If we inject a fault at this
+--echo # point and continue the execution the server crashes.
+--echo #
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # fault_injection_registering_index
+SET SESSION debug_dbug="+d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--source include/restart_mysqld.inc
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # fault_injection_updating_index
+SET SESSION debug_dbug="+d,fault_injection_updating_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--source include/restart_mysqld.inc
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+eval SET SESSION debug_dbug="$old";
+
+--echo End of tests
diff --git a/mysql-test/extra/binlog_tests/binlog_ioerr.inc b/mysql-test/extra/binlog_tests/binlog_ioerr.inc
new file mode 100644
index 00000000000..8d1069bacb0
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_ioerr.inc
@@ -0,0 +1,36 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/have_debug.inc;
+source include/have_innodb.inc;
+source include/have_log_bin.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+CALL mtr.add_suppression("Error writing file 'master-bin'");
+
+RESET MASTER;
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES(0);
+SET SESSION debug_dbug='+d,fail_binlog_write_1';
+--error ER_ERROR_ON_WRITE
+INSERT INTO t1 VALUES(1);
+--error ER_ERROR_ON_WRITE
+INSERT INTO t1 VALUES(2);
+SET SESSION debug_dbug='';
+INSERT INTO t1 VALUES(3);
+SELECT * FROM t1;
+
+# Actually the output from this currently shows a bug.
+# The injected IO error leaves partially written transactions in the binlog in
+# the form of stray "BEGIN" events.
+# These should disappear from the output if binlog error handling is improved
+# (see MySQL Bug#37148 and WL#1790).
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
+--replace_column 1 BINLOG 2 POS 5 ENDPOS
+SHOW BINLOG EVENTS;
+
+DROP TABLE t1;
diff --git a/mysql-test/extra/binlog_tests/binlog_mysqlbinlog-cp932.inc b/mysql-test/extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
new file mode 100644
index 00000000000..ac637b2da03
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
@@ -0,0 +1,50 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --source extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
+#
+# By default, the script calls mysqlbinlog to read binary logs directly.
+# If it is undesirable, this behavior can be overridden by setting
+# $use_remote_binlog as shown above.
+# The value will be unset after every execution of the script,
+# so if it is needed, it should be set explicitly before each call.
+
+
+# disabled in embedded until tools running is fixed with embedded
+--source include/not_embedded.inc
+
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/have_cp932.inc
+-- source include/have_log_bin.inc
+
+RESET MASTER;
+
+# Bug#16217 (mysql client did not know how not switch its internal charset)
+create table t3 (f text character set utf8);
+create table t4 (f text character set cp932);
+--exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
+--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');"
+flush logs;
+rename table t3 to t03, t4 to t04;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--let $mysqlbinlog_args= $MYSQLD_DATADIR/master-bin.000001
+if ($use_remote_mysqlbinlog)
+{
+ --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot master-bin.000001
+ --let $use_remote_mysqlbinlog= 0
+}
+
+--exec $MYSQL_BINLOG --short-form $mysqlbinlog_args | $MYSQL --default-character-set=utf8
+# original and recovered data must be equal
+select HEX(f) from t03;
+select HEX(f) from t3;
+select HEX(f) from t04;
+select HEX(f) from t4;
+
+drop table t3, t4, t03, t04;
+--echo End of 5.0 tests
diff --git a/mysql-test/extra/binlog_tests/binlog_row_annotate.inc b/mysql-test/extra/binlog_tests/binlog_row_annotate.inc
new file mode 100644
index 00000000000..97d641fca80
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_row_annotate.inc
@@ -0,0 +1,211 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --source extra/binlog_tests/binlog_row_annotate.inc
+#
+# By default, the script uses mysqlbinlog both with direct access to files
+# and via connection to the server. In some cases, direct access to files
+# might be impossible (e.g. with encryption). If use_remote_mysqlbinlog
+# flag is set, this part of the logic will be omitted.
+#
+
+###############################################################################
+# WL47: Store in binlog text of statements that caused RBR events
+# new event: ANNOTATE_ROWS_EVENT
+# new master option: --binlog-annotate-row-events
+# new mysqlbinlog option: --skip-annotate-row-events
+#
+# Intended to test that:
+# *** If the --binlog-annotate-row-events option is switched on on master
+# then Annotate_rows events:
+# - are generated;
+# - are generated only once for "multi-table-maps" rbr queries;
+# - are not generated when the corresponding queries are filtered away;
+# - are generated when the corresponding queries are filtered away partialy
+# (e.g. in case of multi-delete).
+# *** Annotate_rows events are printed by mysqlbinlog started without
+# --skip-annotate-row-events options both in remote and local cases.
+# *** Annotate_rows events are not printed by mysqlbinlog started with
+# --skip-annotate-row-events options both in remote and local cases.
+###############################################################################
+
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row.inc
+--source include/binlog_start_pos.inc
+
+--disable_query_log
+
+set sql_mode="";
+
+# Fix timestamp to avoid varying results
+SET timestamp=1000000000;
+
+# Delete all existing binary logs
+RESET MASTER;
+
+--disable_warnings
+DROP DATABASE IF EXISTS test1;
+DROP DATABASE IF EXISTS test2;
+DROP DATABASE IF EXISTS test3;
+DROP DATABASE IF EXISTS xtest1;
+DROP DATABASE IF EXISTS xtest2;
+--enable_warnings
+
+CREATE DATABASE test1;
+CREATE TABLE test1.t1(a int);
+
+CREATE DATABASE test2;
+CREATE TABLE test2.t2(a int);
+CREATE VIEW test2.v2 AS SELECT * FROM test2.t2;
+
+CREATE DATABASE test3;
+CREATE TABLE test3.t3(a int);
+
+CREATE DATABASE xtest1;
+CREATE TABLE xtest1.xt1(a int);
+
+CREATE DATABASE xtest2;
+CREATE TABLE xtest2.xt2(a int);
+
+# By default SESSION binlog_annotate_row_events = OFF
+
+INSERT INTO test1.t1 VALUES (1), (2), (3);
+
+SET SESSION binlog_annotate_row_events = ON;
+
+INSERT INTO test2.t2 VALUES (1), (2), (3);
+INSERT INTO test3.t3 VALUES (1), (2), (3);
+
+# This query generates two Table maps but the Annotate
+# event should appear only once before the first Table map
+DELETE test1.t1, test2.t2
+ FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
+ WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
+
+# This event should be filtered out together with Annotate event
+INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
+
+# This event should pass the filter
+INSERT INTO test2.v2 VALUES (1), (2), (3);
+
+# This event should pass the filter only for test2.t2 part
+DELETE xtest1.xt1, test2.t2
+ FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
+ WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
+
+# These events should be filtered out together with Annotate events
+INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
+INSERT INTO xtest2.xt2 VALUES (1), (2), (3);
+DELETE xtest1.xt1, xtest2.xt2
+ FROM xtest1.xt1 INNER JOIN xtest2.xt2 INNER JOIN test3.t3
+ WHERE xtest1.xt1.a=xtest2.xt2.a AND xtest2.xt2.a=test3.t3.a;
+
+FLUSH LOGS;
+--enable_query_log
+
+--echo #####################################################################################
+--echo # The following Annotate_rows events should appear below:
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
+--echo # - DELETE test1.t1, test2.t2 FROM <...>
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - DELETE xtest1.xt1, test2.t2 FROM <...>
+--echo #####################################################################################
+
+let $start_pos= `select @binlog_start_pos`;
+--replace_column 2 # 5 #
+--replace_result $start_pos <start_pos>
+--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
+--eval show binlog events in 'master-bin.000001' from $start_pos
+
+if (!$use_remote_mysqlbinlog)
+{
+ --echo #
+ --echo #####################################################################################
+ --echo # mysqlbinlog
+ --echo # The following Annotates should appear in this output:
+ --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+ --echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
+ --echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
+ --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+ --echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
+ --echo #####################################################################################
+
+ 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 #/
+ --exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
+
+ --echo #
+ --echo #####################################################################################
+ --echo # mysqlbinlog --database=test1
+ --echo # The following Annotate should appear in this output:
+ --echo # - DELETE test1.t1, test2.t2 FROM <...>
+ --echo #####################################################################################
+
+ 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 #/
+ --exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v $MYSQLD_DATADIR/master-bin.000001
+
+ --echo #
+ --echo #####################################################################################
+ --echo # mysqlbinlog --skip-annotate-row-events
+ --echo # No Annotates should appear in this output
+ --echo #####################################################################################
+
+ 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 #/
+ --exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v $MYSQLD_DATADIR/master-bin.000001
+
+ --let $use_remote_mysqlbinlog= 0
+}
+
+--echo #
+--echo #####################################################################################
+--echo # mysqlbinlog --read-from-remote-server
+--echo # The following Annotates should appear in this output:
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
+--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
+--echo #####################################################################################
+
+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 #/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
+
+--echo #
+--echo #####################################################################################
+--echo # mysqlbinlog --read-from-remote-server --database=test1
+--echo # The following Annotate should appear in this output:
+--echo # - DELETE test1.t1, test2.t2 FROM <...>
+--echo #####################################################################################
+
+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 #/
+--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
+
+--echo #
+--echo #####################################################################################
+--echo # mysqlbinlog --read-from-remote-server --skip-annotate-row-events
+--echo # No Annotates should appear in this output
+--echo #####################################################################################
+
+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 #/
+--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
+
+# Clean-up
+
+--disable_query_log
+DROP DATABASE test1;
+DROP DATABASE test2;
+DROP DATABASE test3;
+DROP DATABASE xtest1;
+DROP DATABASE xtest2;
+--enable_query_log
+
diff --git a/mysql-test/extra/binlog_tests/binlog_write_error.inc b/mysql-test/extra/binlog_tests/binlog_write_error.inc
new file mode 100644
index 00000000000..da66dbf5a95
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_write_error.inc
@@ -0,0 +1,108 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# === Name ===
+#
+# binlog_write_error.test
+#
+# === Description ===
+#
+# This test case check if the error of writing binlog file is properly
+# reported and handled when executing statements.
+#
+# === Related Bugs ===
+#
+# BUG#37148
+#
+
+source include/have_log_bin.inc;
+source include/have_debug.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+--echo #
+--echo # Initialization
+--echo #
+
+disable_warnings;
+DROP TABLE IF EXISTS t1, t2;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP TRIGGER IF EXISTS tr1;
+DROP TRIGGER IF EXISTS tr2;
+DROP VIEW IF EXISTS v1, v2;
+enable_warnings;
+
+--echo #
+--echo # Test injecting binlog write error when executing queries
+--echo #
+
+let $query= CREATE TABLE t1 (a INT);
+source include/binlog_inject_error.inc;
+
+INSERT INTO t1 VALUES (1),(2),(3);
+
+let $query= INSERT INTO t1 VALUES (4),(5),(6);
+source include/binlog_inject_error.inc;
+
+let $query= UPDATE t1 set a=a+1;
+source include/binlog_inject_error.inc;
+
+let $query= DELETE FROM t1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
+source include/binlog_inject_error.inc;
+
+let $query= DROP TRIGGER tr1;
+source include/binlog_inject_error.inc;
+
+let $query= ALTER TABLE t1 ADD (b INT);
+source include/binlog_inject_error.inc;
+
+let $query= CREATE VIEW v1 AS SELECT a FROM t1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP VIEW v1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP PROCEDURE p1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP TABLE t1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE FUNCTION f1() RETURNS INT return 1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP FUNCTION f1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE USER user1;
+source include/binlog_inject_error.inc;
+
+let $query= REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP USER user1;
+source include/binlog_inject_error.inc;
+
+--echo #
+--echo # Cleanup
+--echo #
+
+disable_warnings;
+DROP TABLE IF EXISTS t1, t2;
+DROP FUNCTION IF EXISTS f1;
+DROP PROCEDURE IF EXISTS p1;
+DROP TRIGGER IF EXISTS tr1;
+DROP VIEW IF EXISTS v1, v2;
+enable_warnings;
diff --git a/mysql-test/extra/binlog_tests/binlog_xa_recover.inc b/mysql-test/extra/binlog_tests/binlog_xa_recover.inc
new file mode 100644
index 00000000000..de2703377cc
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_xa_recover.inc
@@ -0,0 +1,281 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_binlog_format_row.inc
+# Valgrind does not work well with test that crashes the server
+--source include/not_valgrind.inc
+
+# (We do not need to restore these settings, as we crash the server).
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
+# Insert some data to force a couple binlog rotations (3), so we get some
+# normal binlog checkpoints before starting the test.
+INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
+# Wait for the master-bin.000002 binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002"
+--let $field= Info
+--let $condition= = "master-bin.000002"
+--source include/wait_show_condition.inc
+INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
+--let $field= Info
+--let $condition= = "master-bin.000003"
+--source include/wait_show_condition.inc
+INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
+--let $field= Info
+--let $condition= = "master-bin.000004"
+--source include/wait_show_condition.inc
+
+# Now start a bunch of transactions that span multiple binlog
+# files. Leave then in the state prepared-but-not-committed in the engine
+# and crash the server. Check that crash recovery is able to recover all
+# of them.
+#
+# We use debug_sync to get all the transactions into the prepared state before
+# we commit any of them. This is because the prepare step flushes the InnoDB
+# redo log - including any commits made before, so recovery would become
+# unnecessary, decreasing the value of this test.
+#
+# We arrange to have con1 with a prepared transaction in master-bin.000004,
+# con2 and con3 with a prepared transaction in master-bin.000005, and a new
+# empty master-bin.000006. So the latest binlog checkpoint should be
+# master-bin.000006.
+
+connect(con1,localhost,root,,);
+# First wait after prepare and before write to binlog.
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
+# Then complete InnoDB commit in memory (but not commit checkpoint / write to
+# disk), and hang until crash, leaving a transaction to be XA recovered.
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
+send INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
+
+connect(con2,localhost,root,,);
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
+send INSERT INTO t1 VALUES (2, NULL);
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
+
+connect(con3,localhost,root,,);
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
+send INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
+
+connect(con4,localhost,root,,);
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
+SET SESSION debug_dbug="+d,crash_commit_after_log";
+send INSERT INTO t1 VALUES (4, NULL);
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
+
+SET DEBUG_SYNC= "now SIGNAL con1_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
+SET DEBUG_SYNC= "now SIGNAL con2_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
+SET DEBUG_SYNC= "now SIGNAL con3_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
+
+# Check that everything is committed in binary log.
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000003
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+--let $binlog_file= master-bin.000004
+--source include/show_binlog_events.inc
+--let $binlog_file= master-bin.000005
+--source include/show_binlog_events.inc
+--let $binlog_file= master-bin.000006
+--source include/show_binlog_events.inc
+
+
+# Check that server will not purge too much.
+PURGE BINARY LOGS TO "master-bin.000006";
+--source include/show_binary_logs.inc
+
+# Now crash the server with one more transaction in prepared state.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait-binlog_xa_recover.test
+EOF
+--error 0,2006,2013
+SET DEBUG_SYNC= "now SIGNAL con4_cont";
+connection con4;
+--error 2006,2013
+reap;
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart-group_commit_binlog_pos.test
+EOF
+
+connection default;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Check that all transactions are recovered.
+SELECT a FROM t1 ORDER BY a;
+
+--echo Test that with multiple binlog checkpoints, recovery starts from the last one.
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+
+# Rotate to binlog master-bin.000003 while delaying binlog checkpoints.
+# So we get multiple binlog checkpoints in master-bin.000003.
+# Then complete the checkpoints, crash, and check that we only scan
+# the necessary binlog file (ie. that we use the _last_ checkpoint).
+
+connect(con10,localhost,root,,);
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
+send INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
+
+connect(con11,localhost,root,,);
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
+send INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
+
+connect(con12,localhost,root,,);
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
+send INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
+INSERT INTO t1 VALUES (13, NULL);
+
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000004
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+
+SET DEBUG_SYNC= "now SIGNAL con10_cont";
+connection con10;
+reap;
+connection default;
+
+# We need to sync the test case with the background processing of the
+# commit checkpoint, otherwise we get nondeterministic results.
+SET @old_dbug= @@global.DEBUG_DBUG;
+SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
+
+SET DEBUG_SYNC= "now SIGNAL con12_cont";
+connection con12;
+reap;
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
+SET GLOBAL debug_dbug= @old_dbug;
+
+SET DEBUG_SYNC= "now SIGNAL con11_cont";
+connection con11;
+reap;
+
+connection default;
+# Wait for the last (master-bin.000004) binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
+--let $field= Info
+--let $condition= = "master-bin.000004"
+--source include/wait_show_condition.inc
+
+--echo Checking that master-bin.000004 is the last binlog checkpoint
+--source include/show_binlog_events.inc
+
+--echo Now crash the server
+# It is not too easy to test XA recovery, as it runs early during server
+# startup, before any connections can be made.
+# What we do is set a DBUG error insert which will crash if XA recovery
+# starts from any other binlog than master-bin.000004 (check the file
+# binlog_xa_recover-master.opt). Then we will fail here if XA recovery
+# would start from the wrong place.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait-binlog_xa_recover.test
+EOF
+SET SESSION debug_dbug="+d,crash_commit_after_log";
+--error 2006,2013
+INSERT INTO t1 VALUES (14, NULL);
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart-group_commit_binlog_pos.test
+EOF
+
+connection default;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Check that all transactions are recovered.
+SELECT a FROM t1 ORDER BY a;
+
+
+--echo *** Check that recovery works if we crashed early during rotate, before
+--echo *** binlog checkpoint event could be written.
+
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+
+# We need some initial data to reach binlog master-bin.000004. Otherwise
+# crash recovery fails due to the error insert used for previous test.
+INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
+INSERT INTO t1 VALUES (22, REPEAT("x", 4100));
+# Wait for the master-bin.000003 binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
+--let $field= Info
+--let $condition= = "master-bin.000003"
+--source include/wait_show_condition.inc
+INSERT INTO t1 VALUES (23, REPEAT("x", 4100));
+# Wait for the last (master-bin.000004) binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
+--let $field= Info
+--let $condition= = "master-bin.000004"
+--source include/wait_show_condition.inc
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait-binlog_xa_recover.test
+EOF
+SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event";
+--error 2006,2013
+INSERT INTO t1 VALUES (24, REPEAT("x", 4100));
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart-group_commit_binlog_pos.test
+EOF
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Check that all transactions are recovered.
+SELECT a FROM t1 ORDER BY a;
+
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000004
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+
+# Cleanup
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test
index 17f8e069fa3..097a501cc34 100644
--- a/mysql-test/extra/binlog_tests/database.test
+++ b/mysql-test/extra/binlog_tests/database.test
@@ -84,7 +84,7 @@ CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
engine=innodb;
RESET MASTER;
---error ER_ROW_IS_REFERENCED
+--error ER_ROW_IS_REFERENCED_2
DROP DATABASE db1; # Fails because of the fk
SHOW TABLES FROM db1; # t1 was dropped, t2 remains
--source include/show_binlog_events.inc # Check that the binlog drops t1
diff --git a/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc b/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc
index 95440ab04a0..1cc850091fe 100644
--- a/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc
+++ b/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc
@@ -16,6 +16,7 @@
#
--source include/have_log_bin.inc
+set sql_mode="";
SET NAMES 'utf8';
#SHOW VARIABLES LIKE 'character_set%';
@@ -76,7 +77,7 @@ eval CREATE TABLE t1 (
#
c28 DATE,
c29 DATETIME,
- c30 TIMESTAMP,
+ c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
c31 TIME,
c32 YEAR,
#
diff --git a/mysql-test/extra/rpl_tests/multisource.inc b/mysql-test/extra/rpl_tests/multisource.inc
new file mode 100644
index 00000000000..2842aff4ef1
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/multisource.inc
@@ -0,0 +1,304 @@
+#
+# This include file is used by more than one test suite
+# (currently multisource and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --source extra/rpl_tests/multisource.inc
+#
+# By default, the script expects the length of the 2nd binary log to be
+# $binlog_start_pos + length(Gtid_list event) + 2 x length(Binlog_checkpoint event)
+# Some tests can have specific configuration which would change it,
+
+#
+# Test basic replication functionality
+# in multi-source setup
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/binlog_start_pos.inc
+--let $rpl_server_count= 0
+
+--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 'abc', check we do not free twice.
+--error ER_RELAY_LOG_INIT
+change master 'abc' to relay_log_file='';
+# This fails before adding the new master, check that we do free it.
+--error ER_WRONG_ARGUMENTS
+change master 'abc2' to master_host='';
+
+
+# Start replication from the first master
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master 'master1' to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+
+start slave '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'
+--source include/show_slave_status.inc
+--let $slave_name=
+
+--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 'master1' to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+# 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 'master2' to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+
+
+# 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: 39 (Gtid_list) + 2 x 40 (Binlog_checkpoint) = 119
+let filesize=`select $binlog_start_pos+119`;
+--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 #
+
+--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';
+
+# 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
+
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
index 8cd86de8040..67286c37258 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -1,7 +1,6 @@
#
# Test of auto_increment with offset
#
--- source include/not_ndb_default.inc
-- source include/master-slave.inc
eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2 auto_increment=3;
diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_errors.inc b/mysql-test/extra/rpl_tests/rpl_binlog_errors.inc
new file mode 100644
index 00000000000..c595d70daa1
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_binlog_errors.inc
@@ -0,0 +1,422 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --let $binlog_limit= X[,Y] # optional
+#
+# Semantics of the value is the same as in include/show_binlog_events.inc
+# which the script calls as a part of the test flow.
+# The goal is to print the event demonstrating the triggered error,
+# so normally Y should be 1 (print the exact event only);
+# however, depending on test-specific server options, the offset X
+# can be different.
+#
+
+# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
+# when generating new name.
+#
+# WHY
+# ===
+#
+# We want to check whether error is reported or not when
+# new_file_impl fails (this may happen when rotation is not
+# possible because there is some problem finding an
+# unique filename).
+#
+# HOW
+# ===
+#
+# Test cases are documented inline.
+
+-- source include/have_innodb.inc
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+
+-- echo #######################################################################
+-- echo ####################### PART 1: MASTER TESTS ##########################
+-- echo #######################################################################
+
+
+### ACTION: stopping slave as it is not needed for the first part of
+### the test
+
+-- connection slave
+-- source include/stop_slave.inc
+-- connection master
+
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+
+SET @old_debug= @@global.debug;
+
+### ACTION: create a large file (> 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check binlog errors in its vacinity
+-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
+
+### ACTION: create a small file (< 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check for absence of binlog errors
+### when file loading this file does not force flushing and
+### rotating the binary log
+-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
+
+RESET MASTER;
+
+-- echo ###################### TEST #1
+
+### ASSERTION: no problem flushing logs (should show two binlogs)
+FLUSH LOGS;
+-- echo # assert: must show two binlogs
+-- source include/show_binary_logs.inc
+
+-- echo ###################### TEST #2
+
+### ASSERTION: check that FLUSH LOGS actually fails and reports
+### failure back to the user if find_uniq_filename fails
+### (should show just one binlog)
+
+RESET MASTER;
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+-- error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+-- echo # assert: must show one binlog
+-- source include/show_binary_logs.inc
+
+### ACTION: clean up and move to next test
+SET GLOBAL debug_dbug=@old_debug;
+RESET MASTER;
+
+-- echo ###################### TEST #3
+
+### ACTION: create some tables (t1, t2, t4) and insert some values in
+### table t1
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+
+### ASSERTION: we force rotation of the binary log because it exceeds
+### the max_binlog_size option (should show two binary
+### logs)
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# shows two binary logs
+-- echo # assert: must show two binlog
+-- source include/show_binary_logs.inc
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #4
+
+### ASSERTION: load the big file into a transactional table and check
+### that it reports error. The table will contain the
+### changes performed despite the fact that it reported an
+### error.
+
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #5
+
+### ASSERTION: load the small file into a transactional table and
+### check that it succeeds
+
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #6
+
+### ASSERTION: check that even if one is using a transactional table
+### and explicit transactions (no autocommit) if rotation
+### fails we get the error. Transaction is not rolledback
+### because rotation happens after the commit.
+
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+INSERT INTO t2 VALUES ('muse');
+-- error ER_NO_UNIQUE_LOGFILE
+COMMIT;
+
+### ACTION: Show the contents of the table after the test
+-- echo # assert: must show three entries
+SELECT count(*) FROM t2;
+
+### ACTION: clean up and move to the next test
+SET AUTOCOMMIT= 1;
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #7
+
+### ASSERTION: check that on a non-transactional table, if rotation
+### fails then an error is reported and an incident event
+### is written to the current binary log.
+
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+SELECT count(*) FROM t4;
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+
+-- echo ### check that the incident event is written to the current log
+SET GLOBAL debug_dbug=@old_debug;
+if (!$binlog_limit)
+{
+ -- let $binlog_limit= 4,1
+}
+-- source include/show_binlog_events.inc
+
+# clean up and move to next test
+DELETE FROM t4;
+RESET MASTER;
+
+-- echo ###################### TEST #8
+
+### ASSERTION: check that statements end up in error but they succeed
+### on changing the data.
+
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+-- echo # must show 0 entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+-- error ER_NO_UNIQUE_LOGFILE
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+
+-- echo # INFO: Count(*) Before Offending DELETEs
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+-- echo # assert: must show 4 entries
+SELECT count(*) FROM t2;
+
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t4;
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t2;
+
+-- echo # INFO: Count(*) After Offending DELETEs
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+# remove fault injection
+SET GLOBAL debug_dbug=@old_debug;
+
+-- echo ###################### TEST #9
+
+### ASSERTION: check that if we disable binlogging, then statements
+### succeed.
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+-- echo # assert: must show four entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+DELETE FROM t2;
+DELETE FROM t4;
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+SET SQL_LOG_BIN=1;
+SET GLOBAL debug_dbug=@old_debug;
+
+-- echo ###################### TEST #10
+
+### ASSERTION: check that error is reported if there is a failure
+### while registering the index file and the binary log
+### file or failure to write the rotate event.
+
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not open .*");
+
+RESET MASTER;
+SHOW WARNINGS;
+
+# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
+SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET GLOBAL debug_dbug="-d,fault_injection_registering_index";
+
+-- error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+-- echo ###################### TEST #11
+
+### ASSERTION: check that error is reported if there is a failure
+### while opening the index file and the binary log file or
+### failure to write the rotate event.
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
+SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET GLOBAL debug_dbug="-d,fault_injection_openning_index";
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+-- echo ###################### TEST #12
+
+### ASSERTION: check that error is reported if there is a failure
+### while writing the rotate event when creating a new log
+### file.
+
+# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
+SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
+-- error ER_ERROR_ON_WRITE
+FLUSH LOGS;
+SET GLOBAL debug_dbug="-d,fault_injection_new_file_rotate_event";
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+## clean up
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+
+# restart slave again
+-- connection slave
+-- source include/start_slave.inc
+-- connection master
+
+-- echo #######################################################################
+-- echo ####################### PART 2: SLAVE TESTS ###########################
+-- echo #######################################################################
+
+### setup
+--source include/rpl_reset.inc
+-- connection slave
+
+# slave suppressions
+
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+-- echo ###################### TEST #13
+
+#### ASSERTION: check against unique log filename error
+-- let $io_thd_injection_fault_flag= error_unique_log_filename
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #14
+
+#### ASSERTION: check against rotate failing
+-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #15
+
+#### ASSERTION: check against relay log open failure
+-- let $io_thd_injection_fault_flag= fault_injection_registering_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #16
+
+#### ASSERTION: check against relay log index open failure
+-- let $io_thd_injection_fault_flag= fault_injection_openning_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+### clean up
+-- source include/stop_slave_sql.inc
+RESET SLAVE;
+RESET MASTER;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_cant_read_event_incident.inc b/mysql-test/extra/rpl_tests/rpl_cant_read_event_incident.inc
new file mode 100644
index 00000000000..7dfef023947
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_cant_read_event_incident.inc
@@ -0,0 +1,83 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# Bug#11747416 : 32228 A disk full makes binary log corrupt.
+#
+#
+# The test demonstrates reading from binlog error propagation to slave
+# and reporting there.
+# Conditions for the bug include a crash at time of the last event to
+# the binlog was written partly. With the fixes the event is not sent out
+# any longer, but rather the dump thread sends out a sound error message.
+#
+# Crash is not simulated. A binlog with partly written event in its end is installed
+# and replication is started from it.
+#
+
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--connection slave
+# Make sure the slave is stopped while we are messing with master.
+# Otherwise we get occasional failures as the slave manages to re-connect
+# to the newly started master and we get extra events applied, causing
+# conflicts.
+--source include/stop_slave.inc
+
+--connection master
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+--let $datadir= `SELECT @@datadir`
+
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master-bin.000001
+--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+# evidence of the partial binlog
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+
+--connection slave
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+reset slave;
+start slave;
+
+# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+--let $slave_param=Last_IO_Errno
+--let $slave_param_value=1236
+--source include/wait_for_slave_param.inc
+
+--let $slave_field_result_replace= / at [0-9]*/ at XXX/
+--let $status_items= Last_IO_Errno, Last_IO_Error
+--source include/show_slave_status.inc
+
+#
+# Cleanup
+#
+
+--connection master
+reset master;
+
+--connection slave
+stop slave;
+reset slave;
+# Table was created from binlog, it may not be created if SQL thread is running
+# slowly and IO thread reaches incident before SQL thread applies it.
+--disable_warnings
+drop table if exists t;
+--enable_warnings
+reset master;
+
+--echo End of the tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_checksum.inc b/mysql-test/extra/rpl_tests/rpl_checksum.inc
new file mode 100644
index 00000000000..c77610522a1
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_checksum.inc
@@ -0,0 +1,334 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# WL2540 replication events checksum
+# Testing configuration parameters
+
+--source include/have_debug.inc
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
+call mtr.add_suppression('Replication event checksum verification failed');
+# due to C failure simulation
+call mtr.add_suppression('Relay log write failure: could not queue event from master');
+call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
+
+# A. read/write access to the global vars:
+# binlog_checksum master_verify_checksum slave_sql_verify_checksum
+
+connection master;
+
+set @master_save_binlog_checksum= @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+
+select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.binlog_checksum as 'no session var';
+
+select @@global.master_verify_checksum as 'must be zero because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.master_verify_checksum as 'no session var';
+
+connection slave;
+
+set @slave_save_binlog_checksum= @@global.binlog_checksum;
+set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
+
+select @@global.slave_sql_verify_checksum as 'must be one because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.slave_sql_verify_checksum as 'no session var';
+
+connection master;
+
+source include/show_binary_logs.inc;
+set @@global.binlog_checksum = NONE;
+select @@global.binlog_checksum;
+--echo *** must be rotations seen ***
+source include/show_binary_logs.inc;
+
+set @@global.binlog_checksum = default;
+select @@global.binlog_checksum;
+
+# testing lack of side-effects in non-effective update of binlog_checksum:
+set @@global.binlog_checksum = CRC32;
+select @@global.binlog_checksum;
+set @@global.binlog_checksum = CRC32;
+
+set @@global.master_verify_checksum = 0;
+set @@global.master_verify_checksum = default;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.binlog_checksum = ADLER32;
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.master_verify_checksum = 2; # the var is of bool type
+
+connection slave;
+
+set @@global.slave_sql_verify_checksum = 0;
+set @@global.slave_sql_verify_checksum = default;
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.slave_sql_verify_checksum = 2; # the var is of bool type
+
+#
+# B. Old Slave to New master conditions
+#
+# while master does not send a checksum-ed binlog the Old Slave can
+# work with the New Master
+
+connection master;
+
+set @@global.binlog_checksum = NONE;
+create table t1 (a int);
+
+# testing that binlog rotation preserves opt_binlog_checksum value
+flush logs;
+flush logs;
+-- source include/wait_for_binlog_checkpoint.inc
+flush logs;
+
+sync_slave_with_master;
+#connection slave;
+# checking that rotation on the slave side leaves slave stable
+flush logs;
+flush logs;
+flush logs;
+select count(*) as zero from t1;
+
+source include/stop_slave.inc;
+
+connection master;
+set @@global.binlog_checksum = CRC32;
+-- source include/wait_for_binlog_checkpoint.inc
+insert into t1 values (1) /* will not be applied on slave due to simulation */;
+
+# instruction to the dump thread
+
+connection slave;
+set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
+start slave;
+--let $slave_io_errno= 1236
+--let $show_slave_io_error= 1
+source include/wait_for_slave_io_error.inc;
+
+select count(*) as zero from t1;
+
+###connection master;
+set @@global.debug_dbug='';
+
+connection slave;
+source include/start_slave.inc;
+
+#
+# C. checksum failure simulations
+#
+
+# C1. Failure by a client thread
+connection master;
+set @@global.master_verify_checksum = 1;
+set @@session.debug_dbug='d,simulate_checksum_test_failure';
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+set @@session.debug_dbug='';
+set @@global.master_verify_checksum = default;
+
+#connection master;
+sync_slave_with_master;
+
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+create table t2 (a int);
+let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+
+# C2. Failure by IO thread
+# instruction to io thread
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+start slave io_thread;
+# When the checksum error is detected, the slave sets error code 1913
+# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
+# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
+# So we usually get 1595, but it is occasionally possible to get 1913.
+--let $slave_io_errno= 1595,1913
+--let $show_slave_io_error= 0
+source include/wait_for_slave_io_error.inc;
+set @@global.debug_dbug='';
+
+# to make IO thread re-read it again w/o the failure
+start slave io_thread;
+let $slave_param= Read_Master_Log_Pos;
+let $slave_param_value= $pos_master;
+source include/wait_for_slave_param.inc;
+
+# C3. Failure by SQL thread
+# instruction to sql thread;
+set @@global.slave_sql_verify_checksum = 1;
+
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+
+start slave sql_thread;
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+source include/wait_for_slave_sql_error.inc;
+
+# resuming SQL thread to parse out the event w/o the failure
+
+set @@global.debug_dbug='';
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be zero' from t2;
+
+#
+# D. Reset slave, Change-Master, Binlog & Relay-log rotations with
+# random value on binlog_checksum on both master and slave
+#
+connection slave;
+stop slave;
+reset slave;
+
+# randomize slave server's own checksum policy
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+flush logs;
+
+connection master;
+set @@global.binlog_checksum= CRC32;
+reset master;
+flush logs;
+create table t3 (a int, b char(5));
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be zero' from t3;
+source include/stop_slave.inc;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+
+connection master;
+flush logs;
+reset master;
+insert into t3 value (1, @@global.binlog_checksum);
+
+connection slave;
+source include/start_slave.inc;
+flush logs;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be one' from t3;
+
+connection master;
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+insert into t3 value (1, @@global.binlog_checksum);
+sync_slave_with_master;
+
+#connection slave;
+
+#clean-up
+
+connection master;
+drop table t1, t2, t3;
+set @@global.binlog_checksum = @master_save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+
+#
+# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540
+#
+# Sanity check that verifies that no assertions are triggered because
+# of old FD events (generated by versions prior to server released with
+# checksums feature)
+#
+# There is no need for query log, if something wrong this should trigger
+# an assertion
+
+--disable_query_log
+
+BINLOG '
+MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
+';
+
+--enable_query_log
+
+#connection slave;
+sync_slave_with_master;
+
+
+--echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
+
+--connection master
+
+--source include/wait_for_binlog_checkpoint.inc
+CREATE TABLE t4 (a INT PRIMARY KEY);
+INSERT INTO t4 VALUES (1);
+
+SET sql_log_bin=0;
+CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
+SET sql_log_bin=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET debug_dbug= '+d,binlog_inject_new_name_error';
+--error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+SET debug_dbug= @old_dbug;
+
+INSERT INTO t4 VALUES (2);
+
+--connection slave
+--let $slave_sql_errno= 1590
+--source include/wait_for_slave_sql_error.inc
+
+# Search the error log for the error message.
+# The bug was that 4 garbage bytes were output in the middle of the error
+# message; by searching for a pattern that spans that location, we can
+# catch the error.
+let $log_error_= `SELECT @@GLOBAL.log_error`;
+if(!$log_error_)
+{
+ # MySQL Server on windows is started with --console and thus
+ # does not know the location of its .err log, use default location
+ let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
+}
+--let SEARCH_FILE= $log_error_
+--let SEARCH_RANGE=-50000
+--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
+--source include/search_pattern_in_file.inc
+
+SELECT * FROM t4 ORDER BY a;
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter= 1;
+--source include/start_slave.inc
+
+--connection master
+--save_master_pos
+
+--connection slave
+--sync_with_master
+SELECT * FROM t4 ORDER BY a;
+
+
+--connection slave
+set @@global.binlog_checksum = @slave_save_binlog_checksum;
+set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
+
+--echo End of tests
+
+--connection master
+DROP TABLE t4;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_checksum_cache.inc b/mysql-test/extra/rpl_tests/rpl_checksum_cache.inc
new file mode 100644
index 00000000000..a10c9721f70
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_checksum_cache.inc
@@ -0,0 +1,261 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+
+--disable_warnings
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
+--enable_warnings
+
+connection master;
+set @save_binlog_cache_size = @@global.binlog_cache_size;
+set @save_binlog_checksum = @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+set @@global.binlog_cache_size = 4096;
+set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 1;
+
+# restart slave to force the dump thread to verify events (on master side)
+connection slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+connection master;
+
+#
+# Testing a critical part of checksum handling dealing with transaction cache.
+# The cache's buffer size is set to be less than the transaction's footprint
+# in binlog.
+#
+# To verify combined buffer-by-buffer read out of the file and fixing crc per event
+# there are the following parts:
+#
+# 1. the event size is much less than the cache's buffer
+# 2. the event size is bigger than the cache's buffer
+# 3. the event size if approximately the same as the cache's buffer
+# 4. all in above
+
+#
+# 1. the event size is much less than the cache's buffer
+#
+
+flush status;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# parameter to ensure the test slightly varies binlog content
+# between different invocations
+#
+let $deviation_size=32;
+eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb;
+
+# Now we are going to create transaction which is long enough so its
+# transaction binlog will be flushed to disk...
+
+delimiter |;
+create procedure test.p_init (n int, size int)
+begin
+ while n > 0 do
+ select round(RAND() * size) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t1 values(n, @data );
+ set n= n-1;
+ end while;
+end|
+
+delimiter ;|
+
+let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s
+
+begin;
+--disable_warnings
+# todo: check if it is really so.
+#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
+eval call test.p_init($1, $deviation_size);
+--enable_warnings
+commit;
+
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t1, slave:test.t1;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t1;
+commit;
+
+sync_slave_with_master;
+
+
+#
+# 2. the event size is bigger than the cache's buffer
+#
+connection master;
+
+flush status;
+let $t2_data_size= `select 3 * @@global.binlog_cache_size`;
+let $t2_aver_size= `select 2 * @@global.binlog_cache_size`;
+let $t2_max_rand= `select 1 * @@global.binlog_cache_size`;
+
+eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb;
+let $1=100;
+--disable_query_log
+begin;
+while ($1)
+{
+ eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t2 set data = @data;
+ dec $1;
+}
+commit;
+--enable_query_log
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t2, slave:test.t2;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t2;
+commit;
+
+sync_slave_with_master;
+
+#
+# 3. the event size if approximately the same as the cache's buffer
+#
+
+connection master;
+
+flush status;
+let $t3_data_size= `select 2 * @@global.binlog_cache_size`;
+let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`;
+let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`;
+
+eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb;
+
+let $1= 300;
+--disable_query_log
+begin;
+while ($1)
+{
+ eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
+ insert into t3 set data= repeat('a', @act_size);
+ dec $1;
+}
+commit;
+--enable_query_log
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t3, slave:test.t3;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t3;
+commit;
+
+sync_slave_with_master;
+
+
+#
+# 4. all in above
+#
+
+connection master;
+flush status;
+
+delimiter |;
+eval create procedure test.p1 (n int)
+begin
+ while n > 0 do
+ case (select (round(rand()*100) % 3) + 1)
+ when 1 then
+ select round(RAND() * $deviation_size) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t1 values(n, @data);
+ when 2 then
+ begin
+ select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
+ insert into t2 set data=repeat('a', @act_size);
+ end;
+ when 3 then
+ begin
+ select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
+ insert into t3 set data= repeat('a', @act_size);
+ end;
+ end case;
+ set n= n-1;
+ end while;
+end|
+delimiter ;|
+
+let $1= 1000;
+set autocommit= 0;
+begin;
+--disable_warnings
+eval call test.p1($1);
+--enable_warnings
+commit;
+
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t1, slave:test.t1;
+source include/diff_tables.inc;
+
+let $diff_tables=master:test.t2, slave:test.t2;
+source include/diff_tables.inc;
+
+let $diff_tables=master:test.t3, slave:test.t3;
+source include/diff_tables.inc;
+
+
+connection master;
+
+begin;
+delete from t1;
+delete from t2;
+delete from t3;
+commit;
+
+drop table t1, t2, t3;
+set @@global.binlog_cache_size = @save_binlog_cache_size;
+set @@global.binlog_checksum = @save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+drop procedure test.p_init;
+drop procedure test.p1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_corruption.inc b/mysql-test/extra/rpl_tests/rpl_corruption.inc
new file mode 100644
index 00000000000..048a9d74249
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_corruption.inc
@@ -0,0 +1,176 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+############################################################
+# Purpose: WL#5064 Testing with corrupted events.
+# The test emulates the corruption at the vary stages
+# of replication:
+# - in binlog file
+# - in network
+# - in relay log
+############################################################
+
+#
+# The tests intensively utilize @@global.debug. Note,
+# Bug#11765758 - 58754,
+# @@global.debug is read by the slave threads through dbug-interface.
+# Hence, before a client thread set @@global.debug we have to ensure that:
+# (a) the slave threads are stopped, or (b) the slave threads are in
+# sync and waiting.
+
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+# Block legal errors for MTR
+call mtr.add_suppression('Found invalid event in binary log');
+call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
+call mtr.add_suppression('event read from binlog did not pass crc check');
+call mtr.add_suppression('Replication event checksum verification failed');
+call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
+call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
+
+SET @old_master_verify_checksum = @@master_verify_checksum;
+
+# Creating test table/data and set corruption position for testing
+--echo # 1. Creating test table/data and set corruption position for testing
+--connection master
+--echo * insert/update/delete rows in table t1 *
+# Corruption algorithm modifies only the first event and
+# then will be reset. To avoid checking always the first event
+# from binlog (usually it is FD) we randomly execute different
+# statements and set position for corruption inside events.
+
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
+--disable_query_log
+let $i=`SELECT 3+CEILING(10*RAND())`;
+let $j=1;
+let $pos=0;
+while ($i) {
+ eval INSERT INTO t1 VALUES ($j, 'a', NULL);
+ if (`SELECT RAND() > 0.7`)
+ {
+ eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j;
+ }
+ if (`SELECT RAND() > 0.8`)
+ {
+ eval DELETE FROM t1 WHERE a = $j;
+ }
+ if (!$pos) {
+ let $pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+ --sync_slave_with_master
+ --source include/stop_slave.inc
+ --disable_query_log
+ --connection master
+ }
+ dec $i;
+ inc $j;
+}
+--enable_query_log
+
+
+# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
+--echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
+--echo SHOW BINLOG EVENTS;
+--disable_query_log
+send_eval SHOW BINLOG EVENTS FROM $pos;
+--enable_query_log
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+reap;
+
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
+
+# Emulate corruption on master with crc checking on master
+--echo # 3. Master read a corrupted event from binlog and send the error to slave
+
+# We have a rare but nasty potential race here: if the dump thread on
+# the master for the _old_ slave connection has not yet discovered
+# that the slave has disconnected, we will inject the corrupt event on
+# the wrong connection, and the test will fail
+# (+d,corrupt_read_log_event2 corrupts only one event).
+# So kill any lingering dump thread (we need to kill; otherwise dump thread
+# could manage to send all events down the socket before seeing it close, and
+# hang forever waiting for new binlog events to be created).
+let $id= `select id from information_schema.processlist where command = "Binlog Dump"`;
+if ($id)
+{
+ --disable_query_log
+ --error 0,1094
+ eval kill $id;
+ --enable_query_log
+}
+let $wait_condition=
+ SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
+--source include/wait_condition.inc
+
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
+--connection slave
+START SLAVE IO_THREAD;
+let $slave_io_errno= 1236;
+--let $slave_timeout= 10
+--source include/wait_for_slave_io_error.inc
+--connection master
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
+
+# Emulate corruption on master without crc checking on master
+--echo # 4. Master read a corrupted event from binlog and send it to slave
+--connection master
+SET GLOBAL master_verify_checksum=0;
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
+--connection slave
+START SLAVE IO_THREAD;
+# When the checksum error is detected, the slave sets error code 1913
+# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
+# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
+# So we usually get 1595, but it is occasionally possible to get 1913.
+let $slave_io_errno= 1595,1913;
+--source include/wait_for_slave_io_error.inc
+--connection master
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
+SET GLOBAL debug_dbug= "";
+SET GLOBAL master_verify_checksum=1;
+
+# Emulate corruption in network
+--echo # 5. Slave. Corruption in network
+--connection slave
+SET GLOBAL debug_dbug="+d,corrupt_queue_event";
+START SLAVE IO_THREAD;
+let $slave_io_errno= 1595,1913;
+--source include/wait_for_slave_io_error.inc
+SET GLOBAL debug_dbug="-d,corrupt_queue_event";
+
+# Emulate corruption in relay log
+--echo # 6. Slave. Corruption in relay log
+
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
+
+START SLAVE SQL_THREAD;
+let $slave_sql_errno= 1593;
+--source include/wait_for_slave_sql_error.inc
+
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
+SET GLOBAL debug_dbug= "";
+
+# Start normal replication and compare same table on master
+# and slave
+--echo # 7. Seek diff for tables on master and slave
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+let $diff_tables= master:test.t1, slave:test.t1;
+--source include/diff_tables.inc
+
+# Clean up
+--echo # 8. Clean up
+--connection master
+SET GLOBAL debug_dbug= "";
+SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
+DROP TABLE t1;
+--sync_slave_with_master
+SET GLOBAL debug_dbug= "";
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_ddl.test b/mysql-test/extra/rpl_tests/rpl_ddl.test
index 8c35ff974d8..21778a11df5 100644
--- a/mysql-test/extra/rpl_tests/rpl_ddl.test
+++ b/mysql-test/extra/rpl_tests/rpl_ddl.test
@@ -128,6 +128,8 @@
###############################################################
# Some preparations
###############################################################
+set global sql_mode='';
+set local sql_mode='';
# The sync_slave_with_master is needed to make the xids deterministic.
sync_slave_with_master;
@@ -146,13 +148,10 @@ eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
# Prevent Bug#26687 rpl_ddl test fails if run with --innodb option
# The testscript (suite/rpl/rpl_ddl.test) + the expected result need that the
# slave uses MyISAM for the table mysqltest.t1.
-# This is not valid in case of suite/rpl_ndb/rpl_ndb_ddl.test which sources
-# also this script.
sync_slave_with_master;
connection slave;
if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_SCHEMA = 'mysqltest1' AND TABLE_NAME = 't1'
- AND ENGINE <> 'MyISAM' AND '$engine_type' <> 'NDB'`)
+ WHERE TABLE_SCHEMA = 'mysqltest1' AND TABLE_NAME = 't1' AND ENGINE <> 'MyISAM'`)
{
skip This test needs on slave side: InnoDB disabled, default engine: MyISAM;
}
@@ -612,3 +611,5 @@ DROP TEMPORARY TABLE mysqltest1.t22;
DROP DATABASE mysqltest1;
# mysqltest2 was alreday DROPPED some tests before.
DROP DATABASE mysqltest3;
+
+set global sql_mode=default;
diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test
index 18b6c0532f2..aa360c9c803 100644
--- a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test
+++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test
@@ -155,7 +155,7 @@ connection master;
f6 ENUM('a', 'b', 'c') default 'a',
f7 DECIMAL(17,9) default '1000.00',
f8 MEDIUMBLOB,
- f9 NUMERIC(6,4) default '2000.00',
+ f9 NUMERIC(6,2) default '2000.00',
f10 VARCHAR(1024),
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f12 SET('a', 'b', 'c') default 'b')
@@ -178,7 +178,7 @@ connection master;
f5 DOUBLE DEFAULT '2.00',
f6 DECIMAL(17,9) default '1000.00',
f7 MEDIUMBLOB,
- f8 NUMERIC(6,4) default '2000.00',
+ f8 NUMERIC(6,2) default '2000.00',
f9 VARCHAR(1024),
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f11 CHAR(255))
diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
index 7dcb9e2725c..47d75c0d0b2 100644
--- a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
@@ -395,13 +395,11 @@ sync_slave_with_master;
###############################################################
# Error reaction is up to sql_mode of the slave sql (bug#38173)
#--echo *** Create t9 on slave ***
-# Please, check BUG#47741 to see why you are not testing NDB.
-if (`SELECT UPPER(LEFT($engine_type, 3)) != 'NDB'`)
-{
STOP SLAVE;
RESET SLAVE;
eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
- d TIMESTAMP,
+ d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ ON UPDATE CURRENT_TIMESTAMP,
e INT NOT NULL,
f text not null,
g text,
@@ -446,8 +444,6 @@ if (`SELECT UPPER(LEFT($engine_type, 3)) != 'NDB'`)
DROP TABLE t9;
sync_slave_with_master;
-}
-
############################################
# More columns in slave at middle of table #
# Expect: Proper error message #
diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
index db646a736f9..d10deece1b1 100644
--- a/mysql-test/extra/rpl_tests/rpl_foreign_key.test
+++ b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
@@ -21,9 +21,7 @@ connection master;
SET TIMESTAMP=1000000000;
CREATE TABLE t3 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
-# Had to add 1022 for run with ndb as ndb uses different
-# error and error code for error ER_DUP_ENTRY. Bug 16677
---error 1022, ER_DUP_ENTRY
+--error ER_DUP_ENTRY
INSERT INTO t3 VALUES (1),(1);
sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_gtid_basic.inc b/mysql-test/extra/rpl_tests/rpl_gtid_basic.inc
new file mode 100644
index 00000000000..ab7d23f70ac
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_gtid_basic.inc
@@ -0,0 +1,568 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_innodb.inc
+--let $rpl_topology=1->2->3->4
+--source include/rpl_init.inc
+
+# Set up a 4-deep replication topology, then test various fail-overs
+# using GTID.
+#
+# A -> B -> C -> D
+
+connection server_1;
+--source include/wait_for_binlog_checkpoint.inc
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "m1");
+INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+INSERT INTO t2 VALUES (1, "i1");
+BEGIN;
+INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
+INSERT INTO t2 VALUES (4, "i4");
+COMMIT;
+save_master_pos;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos`
+--echo *** GTID position should be non-empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+
+connection server_2;
+sync_with_master;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be the same as on server_1 ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+save_master_pos;
+
+connection server_3;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+save_master_pos;
+
+connection server_4;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+
+--echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
+connection server_4;
+--source include/stop_slave.inc
+
+connection server_1;
+INSERT INTO t1 VALUES (5, "m1a");
+INSERT INTO t2 VALUES (5, "i1a");
+save_master_pos;
+
+connection server_4;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now move B to D (C is still replicating from B) ***
+connection server_2;
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+
+connection server_4;
+UPDATE t2 SET b="j1a" WHERE a=5;
+save_master_pos;
+
+connection server_2;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now move C to D, after letting it fall a little behind ***
+connection server_3;
+--source include/stop_slave.inc
+
+connection server_1;
+INSERT INTO t2 VALUES (6, "i6b");
+INSERT INTO t2 VALUES (7, "i7b");
+--source include/save_master_gtid.inc
+
+connection server_3;
+--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now change everything back to what it was, to make rpl_end.inc happy
+# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled.
+connection server_2;
+# We need to sync up server_2 before switching. If it happened to have reached
+# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to
+# server_1, which is (deliberately) missing that transaction.
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
+--source include/start_slave.inc
+--source include/wait_for_slave_to_start.inc
+
+connection server_3;
+--source include/stop_slave.inc
+--replace_result $SLAVE_MYPORT SLAVE_MYPORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+connection server_4;
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
+--source include/start_slave.inc
+
+connection server_1;
+DROP TABLE t1,t2;
+--source include/save_master_gtid.inc
+
+--echo *** A few more checks for BINLOG_GTID_POS function ***
+--let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1)
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS();
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a');
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a',1,NULL);
+SELECT BINLOG_GTID_POS(1,'a');
+SELECT BINLOG_GTID_POS(NULL,NULL);
+SELECT BINLOG_GTID_POS('',1);
+SELECT BINLOG_GTID_POS('a',1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
+
+
+--echo *** Some tests of @@GLOBAL.gtid_binlog_state ***
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+
+--connection server_1
+SET @old_state= @@GLOBAL.gtid_binlog_state;
+
+--error ER_BINLOG_MUST_BE_EMPTY
+SET GLOBAL gtid_binlog_state = '';
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = '';
+FLUSH LOGS;
+--source include/show_binary_logs.inc
+SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000001
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+#SELECT @@GLOBAL.gtid_binlog_pos;
+#SELECT @@GLOBAL.gtid_binlog_state;
+--error ER_BINLOG_MUST_BE_EMPTY
+SET GLOBAL gtid_binlog_state = @old_state;
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = @old_state;
+
+# Check that slave can reconnect again, despite the RESET MASTER, as we
+# restored the state.
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SET gtid_seq_no=100;
+INSERT INTO t1 VALUES (1);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+# We cannot just use sync_with_master as we've done RESET MASTER, so
+# slave old-style position is wrong.
+# So sync on gtid position instead.
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1;
+# Check that the IO gtid position in SHOW SLAVE STATUS is also correct.
+--let $status_items= Gtid_IO_Pos
+--source include/show_slave_status.inc
+
+--echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
+
+--connection server_1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+
+--connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SELECT @@last_gtid;
+SET gtid_seq_no=110;
+SELECT @@last_gtid;
+BEGIN;
+SELECT @@last_gtid;
+INSERT INTO t1 VALUES (2);
+SELECT @@last_gtid;
+COMMIT;
+SELECT @@last_gtid;
+--let $pos= `SELECT @@gtid_binlog_pos`
+
+--connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+eval SET @pos= '$pos';
+# Check NULL argument.
+SELECT master_gtid_wait(NULL);
+# Check empty argument returns immediately.
+SELECT master_gtid_wait('', NULL);
+# Check this gets counted
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_time';
+# Let's check that we get a timeout
+SELECT master_gtid_wait(@pos, 0.5);
+SELECT * FROM t1 ORDER BY a;
+# Now actually wait until the slave reaches the position
+send SELECT master_gtid_wait(@pos);
+
+--connection server_2
+--source include/start_slave.inc
+
+--connection s1
+reap;
+SELECT * FROM t1 ORDER BY a;
+
+# Test waiting on a domain that does not exist yet.
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id= 1;
+INSERT INTO t1 VALUES (3);
+--let $pos= `SELECT @@gtid_binlog_pos`
+
+--connection s1
+--replace_result $pos POS
+eval SET @pos= '$pos';
+SELECT master_gtid_wait(@pos, 0);
+SELECT * FROM t1 WHERE a >= 3;
+send SELECT master_gtid_wait(@pos, -1);
+
+--connection server_2
+--source include/start_slave.inc
+
+--connection s1
+reap;
+SELECT * FROM t1 WHERE a >= 3;
+# Waiting for only part of the position.
+SELECT master_gtid_wait('1-1-1', 0);
+
+# Now test a lot of parallel master_gtid_wait() calls, completing in different
+# order, and some of which time out or get killed on the way.
+
+--connection s1
+send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
+
+--connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+# This will time out. No event 0-1-1000 exists
+send SELECT master_gtid_wait('0-1-1000', 0.5);
+
+--connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+# This one we will kill
+--let $kill1_id= `SELECT connection_id()`
+send SELECT master_gtid_wait('0-1-2000');
+
+--connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-10');
+
+--connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-6', 1);
+
+# This one we will kill also.
+--connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+--let $kill2_id= `SELECT connection_id()`
+send SELECT master_gtid_wait('2-1-5');
+
+--connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-10');
+
+--connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
+
+--connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-2');
+
+--connection server_2
+# This one completes immediately.
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SELECT master_gtid_wait('1-1-1');
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
+--replace_result $wait_time MASTER_GTID_WAIT_TIME
+eval SET @a= $wait_time;
+SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
+ AS Master_gtid_wait_time_as_expected;
+
+
+--connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('0-1-109');
+
+--connection server_2
+# This one should time out.
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SELECT master_gtid_wait('2-1-2', 0.5);
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
+--replace_result $wait_time MASTER_GTID_WAIT_TIME
+eval SET @a= $wait_time;
+# We expect a wait time of just a bit over 0.5 seconds. But thread scheduling
+# and timer inaccuracies could introduce significant jitter. So allow a
+# generous interval.
+SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
+
+--replace_result $kill1_id KILL_ID
+eval KILL QUERY $kill1_id;
+--connection s3
+--error ER_QUERY_INTERRUPTED
+reap;
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=2;
+INSERT INTO t1 VALUES (4);
+
+--connection s9
+reap;
+
+--connection server_2
+--replace_result $kill2_id KILL_ID
+eval KILL CONNECTION $kill2_id;
+
+--connection s6
+--error 2013,ER_CONNECTION_KILLED
+reap;
+
+--connection server_1
+SET gtid_domain_id=1;
+SET gtid_seq_no=4;
+INSERT INTO t1 VALUES (5);
+SET gtid_domain_id=2;
+SET gtid_seq_no=5;
+INSERT INTO t1 VALUES (6);
+
+--connection s8
+reap;
+--connection s1
+reap;
+--connection s2
+reap;
+--connection s5
+reap;
+--connection s10
+reap;
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=10;
+INSERT INTO t1 VALUES (7);
+
+--connection s4
+reap;
+--connection s7
+reap;
+
+
+--echo *** Test gtid_slave_pos when used with GTID ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1000;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 1;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1010;
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 2;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1020;
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 3;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1030;
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 5;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=3;
+SET gtid_seq_no=100;
+CREATE TABLE t2 (a INT PRIMARY KEY);
+DROP TABLE t2;
+SET gtid_domain_id=2;
+SET gtid_seq_no=1040;
+INSERT INTO t1 VALUES (20);
+--save_master_pos
+
+--connection server_2
+SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
+SET GLOBAL slave_ddl_exec_mode=STRICT;
+SET sql_slave_skip_counter=1;
+START SLAVE UNTIL master_gtid_pos="3-1-100";
+--let $master_pos=3-1-100
+--source include/sync_with_master_gtid.inc
+--source include/wait_for_slave_to_stop.inc
+--error ER_NO_SUCH_TABLE
+SELECT * FROM t2;
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+# Start the slave again, it should fail on the DROP TABLE as the table is not there.
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
+SET sql_log_bin=1;
+START SLAVE;
+--let $slave_sql_errno=1051
+--source include/wait_for_slave_sql_error.inc
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter=2;
+--source include/start_slave.inc
+--sync_with_master
+
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+SET GLOBAL slave_ddl_exec_mode= @saved_mode;
+
+
+--echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
+
+# Create an out-of-order binlog on server 2.
+# Let server 3 replicate to an out-of-order point, stop it, restart it,
+# and check that it replicates correctly despite the out-of-order.
+
+--connection server_1
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (31);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (32);
+
+--connection server_1
+INSERT INTO t1 VALUES (33);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--sync_with_master
+--source include/stop_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (34);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--save_master_pos
+
+--connection server_4
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+
+# Clean up.
+--connection server_1
+DROP TABLE t1;
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
index 765757c3427..ed758313770 100644
--- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
+++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
@@ -64,22 +64,6 @@ while ($ddl_cases >= 1)
{
let $commit_event_row_number= 4;
}
- #
- # In NDB (RBR and MIXED modes), the commit event is usually the seventh event
- # in the binary log:
- #
- # 1: COMMAND
- # 2: BEGIN
- # 3: TABLE MAP EVENT
- # 4: TABLE MAP EVENT (ndb_apply_status)
- # 5: ROW EVENT
- # 6: ROW EVENT
- # 7: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 7;
- }
let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1);
--enable_query_log
@@ -96,32 +80,10 @@ while ($ddl_cases >= 1)
if ($ddl_cases == 41)
{
let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
- if ($engine == NDB)
- {
- # This seems to be related to epochs.
- # We need to check this against an updated version or avoid it.
- let $ok= no;
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 40)
{
let $cmd= LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 39)
{
@@ -130,21 +92,6 @@ while ($ddl_cases >= 1)
if ($ddl_cases == 38)
{
let $cmd= CHECK TABLE nt_1;
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 37)
{
@@ -157,40 +104,10 @@ while ($ddl_cases >= 1)
if ($ddl_cases == 35)
{
let $cmd= LOCK TABLES tt_1 WRITE;
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 34)
{
let $cmd= UNLOCK TABLES;
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 33)
{
@@ -203,42 +120,6 @@ while ($ddl_cases >= 1)
if ($ddl_cases == 31)
{
let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
- #
- # In NDB (RBR mode), the commit event is the eleventh event
- # in the binary log:
- #
- # 1: DDL EVENT which triggered the previous commmit.
- # 2: BEGIN
- # 3: TABLE MAP EVENT
- # 4: ROW EVENT
- # 5: COMMIT
- # 6: BEGIN
- # 7: TABLE MAP EVENT
- # 8: TABLE MAP EVENT (ndb_apply_status)
- # 9: ROW EVENT
- # 10: ROW EVENT
- # 11: COMMIT
- #
- if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'`)
- {
- let $commit_event_row_number= 11;
- }
- #
- # In NDB (MIXED mode), the commit event is the eighth event
- # in the binary log:
- #
- # 1: DDL EVENT which triggered the previous commmit.
- # 2: BEGIN
- # 3: TABLE MAP EVENT
- # 4: TABLE MAP EVENT (ndb_apply_status)
- # 5: ROW EVENT
- # 6: ROW EVENT
- # 7: COMMIT
- #
- if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'`)
- {
- let $commit_event_row_number= 7;
- }
}
if ($ddl_cases == 30)
{
@@ -281,7 +162,7 @@ while ($ddl_cases >= 1)
# 5: COMMIT
# 6: DDL EVENT which triggered the previous commmit.
#
- if (`select @@binlog_format = 'ROW' && '$engine' != 'NDB'`)
+ if (`select @@binlog_format = 'ROW'`)
{
let $commit_event_row_number= 5;
}
@@ -325,42 +206,10 @@ while ($ddl_cases >= 1)
if ($ddl_cases == 13)
{
let $cmd= CREATE INDEX ix ON tt_1(ddl_case);
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- # 7: DDL EVENT which triggered the previous commmit.
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 12)
{
let $cmd= DROP INDEX ix ON tt_1;
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- # 7: DDL EVENT which triggered the previous commmit.
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 11)
{
@@ -386,39 +235,6 @@ while ($ddl_cases >= 1)
{
let $commit_event_row_number= 4;
}
- #
- # In NDB (RBR mode), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- #
- if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'` )
- {
- let $commit_event_row_number= 6;
- }
- #
- # In NDB (MIXED mode), the commit event is the nineth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: DDL EVENT which triggered the previous commmit.
- # 3: COMMIT
- # 4: BEGIN
- # 5: TABLE MAP EVENT
- # 6: TABLE MAP EVENT (ndb_apply_status)
- # 7: ROW EVENT
- # 8: ROW EVENT
- # 9: COMMIT
- #
- if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` )
- {
- let $commit_event_row_number= 9;
- }
}
if ($ddl_cases == 10)
{
@@ -436,21 +252,6 @@ while ($ddl_cases >= 1)
{
let $commit_event_row_number= 4;
}
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 9)
{
@@ -468,21 +269,6 @@ while ($ddl_cases >= 1)
{
let $commit_event_row_number= 4;
}
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 8)
{
@@ -507,7 +293,7 @@ while ($ddl_cases >= 1)
# 3: ROW EVENT
# 4: COMMIT
#
- if (`select @@binlog_format = 'STATEMENT'`)
+ if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'ROW'`)
{
let $commit_event_row_number= 4;
}
@@ -516,49 +302,13 @@ while ($ddl_cases >= 1)
# 1: BEGIN
# 2: TABLE MAP EVENT
# 3: ROW EVENT
- # 4: DROP TEMPORARY table IF EXISTS
+ # 4: DROP TEMPORARY
# 5: COMMIT
#
- if (`select @@binlog_format = 'MIXED' || @@binlog_format = 'ROW'`)
+ if (`select @@binlog_format = 'MIXED'`)
{
let $commit_event_row_number= 5;
}
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: DROP TEMPORARY table IF EXISTS
- # 3: COMMIT
- # 4: BEGIN
- # 5: TABLE MAP EVENT
- # 6: TABLE MAP EVENT (ndb_apply_status)
- # 7: ROW EVENT
- # 8: ROW EVENT
- # 9: COMMIT
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 9;
- }
- #
- # In NDB (MIXED mode), the commit event is the nineth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: DDL EVENT which triggered the previous commmit.
- # 3: COMMIT
- # 4: BEGIN
- # 5: TABLE MAP EVENT
- # 6: TABLE MAP EVENT (ndb_apply_status)
- # 7: ROW EVENT
- # 8: ROW EVENT
- # 9: COMMIT
- #
- if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` )
- {
- let $commit_event_row_number= 9;
- }
}
if ($ddl_cases == 7)
{
@@ -583,42 +333,10 @@ while ($ddl_cases >= 1)
if ($ddl_cases == 2)
{
let $cmd= CREATE DATABASE db;
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- # 7: DDL EVENT which triggered the previous commmit.
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
if ($ddl_cases == 1)
{
let $cmd= DROP DATABASE IF EXISTS db;
- #
- # In NDB (RBR and MIXED modes), the commit event is the sixth event
- # in the binary log:
- #
- # 1: BEGIN
- # 2: TABLE MAP EVENT
- # 3: TABLE MAP EVENT (ndb_apply_status)
- # 4: ROW EVENT
- # 5: ROW EVENT
- # 6: COMMIT
- # 7: DDL EVENT which triggered the previous commmit.
- #
- if ($engine == NDB)
- {
- let $commit_event_row_number= 6;
- }
}
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--eval $cmd
diff --git a/mysql-test/extra/rpl_tests/rpl_incident.inc b/mysql-test/extra/rpl_tests/rpl_incident.inc
new file mode 100644
index 00000000000..47b145214bc
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_incident.inc
@@ -0,0 +1,54 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+--echo **** On Master ****
+CREATE TABLE t1 (a INT);
+
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+
+let $debug_save= `SELECT @@GLOBAL.debug`;
+SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
+
+# This will generate an incident log event and store it in the binary
+# log before the replace statement.
+REPLACE INTO t1 VALUES (4);
+--save_master_pos
+SELECT * FROM t1;
+
+--disable_query_log
+eval SET GLOBAL debug_dbug= '$debug_save';
+--enable_query_log
+
+connection slave;
+# Wait until SQL thread stops with error LOST_EVENT on master
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
+let $slave_sql_errno= 1590;
+let $show_slave_sql_error= 1;
+source include/wait_for_slave_sql_error.inc;
+
+# The 4 should not be inserted into the table, since the incident log
+# event should have stop the slave.
+--echo **** On Slave ****
+SELECT * FROM t1;
+
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+--sync_with_master
+
+# Now, we should have inserted the row into the table and the slave
+# should be running. We should also have rotated to a new binary log.
+
+SELECT * FROM t1;
+source include/check_slave_is_running.inc;
+
+connection master;
+DROP TABLE t1;
+--sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_init_slave_errors.inc b/mysql-test/extra/rpl_tests/rpl_init_slave_errors.inc
new file mode 100644
index 00000000000..4fdea651edd
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_init_slave_errors.inc
@@ -0,0 +1,95 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+######################################################################
+# Some errors that cause the slave SQL thread to stop are not shown in
+# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
+# is only in the server's error log.
+#
+# Two failures and their respective reporting are verified:
+#
+# 1 - Failures during slave thread initialization
+# 2 - Failures while processing queries passed through the init_slave
+# option.
+#
+# In order to check the first type of failure, we inject a fault in the
+# SQL/IO Threads through SET GLOBAL debug.
+#
+# To check the second type, we set @@global.init_slave to an invalid
+# command thus preventing the initialization of the SQL Thread.
+#
+# Obs:
+# 1 - Note that testing failures while initializing the relay log position
+# is hard as the same function is called before the code reaches the point
+# that we want to test.
+#
+# 2 - This test does not target failures that are reported while applying
+# events such as duplicate keys, errors while reading the relay-log.bin*,
+# etc. Such errors are already checked on other tests.
+######################################################################
+
+######################################################################
+# Configuring the Environment
+######################################################################
+source include/have_debug.inc;
+source include/have_log_bin.inc;
+source include/master-slave.inc;
+
+connection slave;
+
+--disable_warnings
+stop slave;
+--enable_warnings
+reset slave;
+
+######################################################################
+# Injecting faults in the threads' initialization
+######################################################################
+connection slave;
+
+# Set debug flags on slave to force errors to occur
+SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
+
+start slave;
+
+#
+# slave is going to stop because of emulated failures
+# but there won't be any crashes nor asserts hit.
+#
+# 1593 = ER_SLAVE_FATAL_ERROR
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+call mtr.add_suppression("Failed during slave.* thread initialization");
+
+SET GLOBAL debug_dbug= "";
+
+######################################################################
+# Injecting faults in the init_slave option
+######################################################################
+connection slave;
+
+reset slave;
+
+SET GLOBAL init_slave= "garbage";
+
+start slave;
+# 1064 = ER_PARSE_ERROR
+--let $slave_sql_errno= 1064
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+######################################################################
+# Clean up
+######################################################################
+SET GLOBAL init_slave= "";
+
+# Clean up Last_SQL_Error
+--source include/stop_slave_io.inc
+RESET SLAVE;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test
index 865c97cf95d..6b3732439b2 100644
--- a/mysql-test/extra/rpl_tests/rpl_innodb.test
+++ b/mysql-test/extra/rpl_tests/rpl_innodb.test
@@ -48,8 +48,6 @@ connection master;
#
#Note Matthias: to be merged to rpl_ddl.test
---source include/not_ndb_default.inc
-
FLUSH LOGS;
sync_slave_with_master;
FLUSH LOGS;
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata_local.inc b/mysql-test/extra/rpl_tests/rpl_loaddata_local.inc
new file mode 100644
index 00000000000..9604ca83d5e
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata_local.inc
@@ -0,0 +1,246 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# See if "LOAD DATA LOCAL INFILE" is well replicated
+# (LOAD DATA LOCAL INFILE is not written to the binlog
+# the same way as LOAD DATA INFILE : Append_blocks are smaller).
+# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE :
+# - the loaded file was not written entirely to the master's binlog,
+# only the first 4KB, 8KB or 16KB usually.
+# - the loaded file's first line was not written entirely to the
+# master's binlog (1st char was absent)
+source include/master-slave.inc;
+
+create table t1(a int);
+let $1=10000;
+disable_query_log;
+set SQL_LOG_BIN=0;
+while ($1)
+{
+ insert into t1 values(1);
+ dec $1;
+}
+set SQL_LOG_BIN=1;
+enable_query_log;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+#This will generate a 20KB file, now test LOAD DATA LOCAL
+truncate table t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
+sync_slave_with_master;
+select a,count(*) from t1 group by a;
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
+
+#
+# Now let us test how well we replicate LOAD DATA LOCAL in situation when
+# we met duplicates in tables to which we are adding rows.
+# (It supposed that LOAD DATA LOCAL ignores such errors)
+#
+connection master;
+create table t1(a int);
+insert into t1 values (1), (2), (2), (3);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int primary key);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
+SELECT * FROM t1 ORDER BY a;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+
+#
+# Bug22504 load data infile sql statement in replication architecture get error
+#
+--echo ==== Bug22504 Initialize ====
+
+--echo [on master]
+--connection master
+
+SET sql_mode='ignore_space';
+CREATE TABLE t1(a int);
+insert into t1 values (1), (2), (3), (4);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
+SELECT * FROM t1 ORDER BY a;
+
+--echo [on slave]
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+--echo ==== Clean up ====
+
+--echo [on master]
+connection master;
+DROP TABLE t1;
+
+--echo [on slave]
+sync_slave_with_master;
+
+--echo
+--echo Bug #43746:
+--echo "return wrong query string when parse 'load data infile' sql statement"
+--echo
+
+--echo [master]
+connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
+SELECT @@SESSION.sql_mode INTO @old_mode;
+
+SET sql_mode='ignore_space';
+
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug43746.sql' FROM t1;
+TRUNCATE TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD/* look mum, with comments in weird places! */DATA/* oh hai */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/* we are */INTO/* from the internets */TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO */ TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO TABLE */ t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA /*!10000 LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE */ t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!10000 INTO*/TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/* empty */INTO TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD/*!999999 special comments that do not expand */DATA/*!999999 code from the future */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!999999 have flux capacitor */INTO/*!999999 will travel */TABLE t1;
+
+SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+
+--echo [slave]
+sync_slave_with_master;
+
+--echo
+--echo Bug #59267:
+--echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
+--echo
+
+--echo [master]
+connection master;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
+TRUNCATE TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
+
+SELECT 'Master', COUNT(*) FROM t1;
+
+--echo [slave]
+--sync_slave_with_master
+SELECT 'Slave', COUNT(*) FROM t1;
+
+# cleanup
+--echo [master]
+connection master;
+
+--remove_file $MYSQLD_DATADIR/bug43746.sql
+--remove_file $MYSQLD_DATADIR/bug59267.sql
+
+DROP TABLE t1;
+SET SESSION sql_mode=@old_mode;
+
+--echo [slave]
+sync_slave_with_master;
+
+connection master;
+
+--echo
+--echo Bug #60580/#11902767:
+--echo "statement improperly replicated crashes slave sql thread"
+--echo
+
+--echo [master]
+connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
+
+INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
+INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
+INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
+
+CREATE TABLE t3 AS SELECT * FROM t2;
+
+CREATE VIEW v1 AS SELECT * FROM t2
+ WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
+
+SELECT * FROM t1;
+
+sleep 1;
+
+--echo [slave]
+sync_slave_with_master;
+
+SELECT * FROM t1;
+
+--remove_file $MYSQLD_DATADIR/bug60580.csv
+
+--echo [master]
+connection master;
+
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+
+--echo [slave]
+sync_slave_with_master;
+
+connection master;
+--source include/rpl_end.inc
+
+--echo # End of 5.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_loadfile.inc b/mysql-test/extra/rpl_tests/rpl_loadfile.inc
new file mode 100644
index 00000000000..e43c003b29c
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_loadfile.inc
@@ -0,0 +1,120 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the LOAD_FILE() in rbr #
+#############################################################################
+# Change Author: JBM
+# Change Date: 2006-01-16
+##########
+
+# Includes
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/master-slave.inc
+
+-- source extra/rpl_tests/rpl_loadfile.test
+
+# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
+#
+# DESCRIPTION
+#
+# Problem: when using load_file string function and mixed binlogging format
+# there was no switch to row based binlogging format. This leads
+# to scenarios on which the slave replicates the statement and it
+# will try to load the file from local file system, which in most
+# likely it will not exist.
+#
+# Solution:
+# Marking this function as unsafe for statement format, makes the
+# statement using it to be logged in row based format. As such, data
+# replicated from the master, becomes the content of the loaded file.
+# Consequently, the slave receives the necessary data to complete
+# the load_file instruction correctly.
+#
+# IMPLEMENTATION
+#
+# The test is implemented as follows:
+#
+# On Master,
+# i) write to file the desired content.
+# ii) create table and stored procedure with load_file
+# iii) stop slave
+# iii) execute load_file
+# iv) remove file
+#
+# On Slave,
+# v) start slave
+# vi) sync it with master so that it gets the updates from binlog (which
+# should have bin logged in row format).
+#
+# If the the binlog format does not change to row, then the assertion
+# done in the following step fails. This happens because tables differ
+# since the file does not exist anymore, meaning that when slave
+# attempts to execute LOAD_FILE statement it inserts NULL on table
+# instead of the same contents that the master loaded when it executed
+# the procedure (which was executed when file existed).
+#
+# vii) assert that the contents of master and slave
+# table are the same
+
+--source include/rpl_reset.inc
+
+connection master;
+let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT repeat('x',20) INTO OUTFILE '$file'
+
+disable_warnings;
+DROP TABLE IF EXISTS t1;
+enable_warnings;
+
+CREATE TABLE t1 (t text);
+DELIMITER |;
+CREATE PROCEDURE p(file varchar(4096))
+ BEGIN
+ INSERT INTO t1 VALUES (LOAD_FILE(file));
+ END|
+DELIMITER ;|
+
+# stop slave before issuing the load_file on master
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+
+# test: check that logging falls back to rbr.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval CALL p('$file')
+
+# test: remove the file from the filesystem and assert that slave still
+# gets the loaded file
+remove_file $file;
+
+# now that the file is removed it is safe (regarding what we want to test)
+# to start slave
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+# assertion: assert that the slave got the updates even
+# if the file was removed before the slave started,
+# meaning that contents were indeed transfered
+# through binlog (in row format)
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+# CLEAN UP
+--connection master
+DROP TABLE t1;
+DROP PROCEDURE p;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_loadfile.test b/mysql-test/extra/rpl_tests/rpl_loadfile.test
index 85620b58a97..9073e5e3d9f 100644
--- a/mysql-test/extra/rpl_tests/rpl_loadfile.test
+++ b/mysql-test/extra/rpl_tests/rpl_loadfile.test
@@ -23,10 +23,6 @@ SELECT * FROM test.t1 ORDER BY blob_column;
save_master_pos;
sync_slave_with_master;
connection slave;
-# Need to allow some time when NDB engine is used for
-# the injector thread to have time to populate binlog
-let $wait_condition= SELECT INSTR(blob_column,'aberration') > 0 FROM test.t1 WHERE a = 2;
---source include/wait_condition.inc
SELECT * FROM test.t1 ORDER BY blob_column;
# Cleanup
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index 01e8497e4de..934f40306ab 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -65,6 +65,8 @@ flush logs;
# To make it predictable, we do a useless update now, but which has the
# interest of making the slave catch both rotate events.
+let $skip_checkpoint_events=1;
+
eval create table t3 (a int)ENGINE=$engine_type;
# Sync slave and force it to start on another binary log
diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test
index ce6dee7c62e..e4a257371a7 100644
--- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test
+++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test
@@ -12,8 +12,7 @@
# used in the same transaction.
#
# * Statements that do an implicit commit (i.e., most but not all DDL, and
-# some utility commands) are logged specially due to unspecified requirements by
-# NDB.
+# some utility commands) are logged specially
#
# * Statements that update temporary tables need special treatment since they
# are not logged in row format.
@@ -147,9 +146,7 @@
# - Rules for committing statements, except CREATE [TEMPORARY] TABLE...SELECT
#
# * All other statements that have a pre-commit are written directly to the
-# binlog. (Note: this is semantically equivalent to writing it to the SC and
-# flushing the SC. However, due to requirements by NDB (which have not been
-# clarified), we write directly to the binlog.)
+# binlog.
#
# We use the include file rpl_mixing_engines.inc to generate sql commands from a
# format string. The format string consists of a sequence of 'codes' separated
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test
deleted file mode 100644
index 16f8116d92e..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test
+++ /dev/null
@@ -1,119 +0,0 @@
-#######################################
-# Author: Rafal Somla #
-# Date: 2006-08-20 #
-# Purpose: Test replication of basic #
-# table operations in various setups #
-# #
-# Based on rpl_ndb_2multi_eng.test by #
-# JBM #
-#######################################
-
---echo --- Doing pre test cleanup ---
-
-connection master;
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_query_log
-
-#################################################
---echo --- Create Table Section ---
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL,
- b1 INT,
- vc VARCHAR(255),
- bc CHAR(255),
- d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0,
- total BIGINT UNSIGNED,
- y YEAR,
- t DATE,
- PRIMARY KEY(id));
-
---echo --- Show table on master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show table on slave ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---source include/rpl_multi_engine2.inc
-
-#################################################
-# Okay lets see how it holds up to table changes
---echo --- Check that simple Alter statements are replicated correctly --
-
-ALTER TABLE t1 DROP PRIMARY KEY;
-# note: table with no PK can't contain blobs if it is to be replicated.
-ALTER TABLE t1 MODIFY vc char(32);
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---source include/rpl_multi_engine2.inc
-
-#################################################
---echo --- Check that replication works when slave has more columns than master
-connection master;
-ALTER TABLE t1 ADD PRIMARY KEY(id,total);
-ALTER TABLE t1 MODIFY vc TEXT;
-
-INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
- 'Must make it bug free for the customer',
- 654321.4321,15.21,0,1965,"1905-11-14");
-INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
- 'Must make it bug free for the customer',
- 654321.4321,15.21,0,1965,"1965-11-14");
-INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
- 'Must make it bug free for the customer',
- 654321.4321,15.21,0,1965,"1985-11-14");
-
---echo --- Add columns on slave ---
---sync_slave_with_master
-ALTER TABLE t1 ADD (u int, v char(16) default 'default');
-UPDATE t1 SET u=7 WHERE id < 50;
-UPDATE t1 SET v='explicit' WHERE id >10;
-
---echo --- Show changed table on slave ---
-
-SHOW CREATE TABLE t1;
-SELECT *
-FROM t1
-ORDER BY id;
-
---source include/rpl_multi_engine2.inc
-TRUNCATE TABLE t1;
-
-#################################################
---echo --- Check that replication works when master has more columns than slave
-connection master;
-
---echo --- Remove columns on slave ---
---sync_slave_with_master
-ALTER TABLE t1 DROP COLUMN v;
-ALTER TABLE t1 DROP COLUMN u;
-ALTER TABLE t1 DROP COLUMN t;
-ALTER TABLE t1 DROP COLUMN y;
-
---echo --- Show changed table on slave ---
-
-SHOW CREATE TABLE t1;
-
---source include/rpl_multi_engine2.inc
-TRUNCATE TABLE t1;
-
-#################################################
---echo --- Do Cleanup --
-connection master;
-DROP TABLE IF EXISTS t1;
-
-sync_slave_with_master;
-connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test
deleted file mode 100644
index 1677aaf8277..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test
+++ /dev/null
@@ -1,347 +0,0 @@
-#######################################
-# Author: JBM #
-# Date: 2006-02-23 #
-# Purpose: See if replication between #
-# NDB -> MyISAM and InnoDB works. #
-# and if #
-# MyISAM and InnoDB -> NDB works. #
-#######################################
-# By JBM #
-# Date 2006-02-28 #
-# Change: Implemented review comments #
-#######################################
-
---echo --- Doing pre test cleanup ---
-
-connection master;
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_query_log
-
---echo --- Start test 1 Basic testing ---
---echo --- Create Table Section ---
-
-#################################################
-# Requirment: Create basic table, replicate #
-# basice operations such at insert, update #
-# delete between 2 different storage engines #
-# Alter table and ensure table is handled #
-# Correctly on the slave #
-#################################################
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
- bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE,PRIMARY KEY(id));
-
---echo --- Show table on master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show table on slave ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
-# Okay lets see how it holds up to table changes
---echo --- Check that simple Alter statements are replicated correctly --
-
-ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
-ALTER TABLE t1 MODIFY vc TEXT;
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 1 Basic testing ---
---echo --- Do Cleanup --
-
-DROP TABLE IF EXISTS t1;
-
-#################################################################
-
---echo --- Start test 2 partition RANGE testing --
---echo --- Do setup --
-
-
-#################################################
-# Requirment: Create table that is partitioned #
-# by range on year i.e. year(t) and replicate #
-# basice operations such at insert, update #
-# delete between 2 different storage engines #
-# Alter table and ensure table is handled #
-# Correctly on the slave #
-#################################################
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
- bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE)
- PARTITION BY RANGE (YEAR(t))
- (PARTITION p0 VALUES LESS THAN (1901),
- PARTITION p1 VALUES LESS THAN (1946),
- PARTITION p2 VALUES LESS THAN (1966),
- PARTITION p3 VALUES LESS THAN (1986),
- PARTITION p4 VALUES LESS THAN (2005),
- PARTITION p5 VALUES LESS THAN MAXVALUE);
-
---echo --- Show table on master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show table on slave --
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 ADD PRIMARY KEY(t,id);
-ALTER TABLE t1 MODIFY vc TEXT;
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
---enable_query_log
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 2 partition RANGE testing ---
---echo --- Do Cleanup ---
-
-DROP TABLE IF EXISTS t1;
-
-########################################################
-
---echo --- Start test 3 partition LIST testing ---
---echo --- Do setup ---
-#################################################
-# Requirment: Create table that is partitioned #
-# by list on id i.e. (2,4). Pretend that we #
-# missed one and alter to add. Then replicate #
-# basice operations such at insert, update #
-# delete between 2 different storage engines #
-# Alter table and ensure table is handled #
-# Correctly on the slave #
-#################################################
-
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
- bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE)
- PARTITION BY LIST(id)
- (PARTITION p0 VALUES IN (2, 4),
- PARTITION p1 VALUES IN (42, 142));
-
---echo --- Test 3 Alter to add partition ---
-
-ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
-
---echo --- Show table on master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show table on slave ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 ADD PRIMARY KEY(id);
-ALTER TABLE t1 MODIFY vc TEXT;
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 3 partition LIST testing ---
---echo --- Do Cleanup --
-
-DROP TABLE IF EXISTS t1;
-
-########################################################
-
---echo --- Start test 4 partition HASH testing ---
---echo --- Do setup ---
-#################################################
-# Requirment: Create table that is partitioned #
-# by hash on year i.e. YEAR(t). Then replicate #
-# basice operations such at insert, update #
-# delete between 2 different storage engines #
-# Alter table and ensure table is handled #
-# Correctly on the slave #
-#################################################
-
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
- bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE)
- PARTITION BY HASH( YEAR(t) )
- PARTITIONS 4;
-
---echo --- show that tables have been created correctly ---
-
-SHOW CREATE TABLE t1;
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 ADD PRIMARY KEY(t,id);
-ALTER TABLE t1 MODIFY vc TEXT;
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 4 partition HASH testing ---
---echo --- Do Cleanup --
-
-DROP TABLE IF EXISTS t1;
-
-########################################################
-
---echo --- Start test 5 partition by key testing ---
---echo --- Create Table Section ---
-
-#################################################
-# Requirment: Create table that is partitioned #
-# by key on id with 4 parts. Then replicate #
-# basice operations such at insert, update #
-# delete between 2 different storage engines #
-# Alter table and ensure table is handled #
-# Correctly on the slave #
-#################################################
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
- bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE,PRIMARY KEY(id))
- PARTITION BY KEY()
- PARTITIONS 4;
-
---echo --- Show that tables on master are ndbcluster tables ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show that tables on slave ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
-# Okay lets see how it holds up to table changes
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still right type ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 MODIFY vc TEXT;
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 5 key partition testing ---
---echo --- Do Cleanup ---
-
-DROP TABLE IF EXISTS t1;
-sync_slave_with_master;
-
-# End of 5.1 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
deleted file mode 100644
index bba860ab9aa..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
+++ /dev/null
@@ -1,307 +0,0 @@
-#############################################
-#Authors: TU and Jeb
-#Date: 2007/04
-#Purpose: Generic replication to cluster
-# and ensuring that the ndb_apply_status
-# table is updated.
-#############################################
-# Notes:
-# include/select_ndb_apply_status.inc
-# Selects out the log name, start & end pos
-# from the ndb_apply_status table
-#
-# include/show_binlog_using_logname.inc
-# To select out 1 row from offset 1
-# from the start position in the binlog whose
-# name is = log_name
-#
-# include/tpcb.inc
-# Creates DATABASE tpcb, the tables and
-# stored procedures for loading the DB
-# and for running transactions against DB.
-##############################################
-
-
---echo
---echo *** Test 1 ***
---echo
-
-connection master;
-create table t1 (a int key, b int) engine innodb;
-create table t2 (a int key, b int) engine innodb;
-
---echo
-
---sync_slave_with_master
-alter table t1 engine ndb;
-alter table t2 engine ndb;
-
---echo
-
-# check binlog position without begin
-connection master;
-insert into t1 values (1,2);
-
---echo
-
---sync_slave_with_master
---source include/select_ndb_apply_status.inc
-
---echo
-
-connection master;
---echo # Now check that that is in the apply_status table is consistant
---echo # with what is in the binlog
---echo
---echo # since insert is done with transactional engine, expect a BEGIN
---echo # at <start_pos>
---echo
---let $binlog_start= $start_pos
---let $binlog_limit= 1
---source include/show_binlog_events.inc
-
---echo
---echo # Now the insert, one step after
---echo
---let $binlog_start= $start_pos
---let $binlog_limit= 1,1
---source include/show_binlog_events.inc
-
---echo
---echo # and the COMMIT should be at <end_pos>
---echo
---let $binlog_start= $start_pos
---let $binlog_limit= 2,1
---source include/show_binlog_events.inc
-
---echo
-
-# check binlog position with begin
-begin;
-insert into t1 values (2,3);
-insert into t2 values (3,4);
-commit;
-
---echo
-
---sync_slave_with_master
---source include/select_ndb_apply_status.inc
-
-connection master;
---let $binlog_start= $start_pos
---let $binlog_limit= 1
---source include/show_binlog_events.inc
---echo
---let $binlog_start= $start_pos
---let $binlog_limit= 1,2
---source include/show_binlog_events.inc
---echo
---let $binlog_start= $start_pos
---let $binlog_limit= 3,1
---source include/show_binlog_events.inc
-
---echo
-
-connection master;
-DROP TABLE test.t1, test.t2;
---sync_slave_with_master
-SHOW TABLES;
-
-# Run in some transactions using stored procedures
-# and ensure that the ndb_apply_status table is
-# updated to show the transactions
-
-
---echo
---echo *** Test 2 ***
---echo
-
-# Create database/tables and stored procdures
-connection master;
---source include/tpcb.inc
-
-# Switch tables on slave to use NDB
---sync_slave_with_master
-USE tpcb;
-ALTER TABLE account ENGINE NDB;
-ALTER TABLE branch ENGINE NDB;
-ALTER TABLE teller ENGINE NDB;
-ALTER TABLE history ENGINE NDB;
-
---echo
-
-# Load DB tpcb and run some transactions
-connection master;
---disable_query_log
-CALL tpcb.load();
-SET AUTOCOMMIT=0;
-let $run= 5;
-while ($run)
-{
- START TRANSACTION;
- --disable_warnings
- --eval CALL tpcb.trans($rpl_format);
- --enable_warnings
- eval SET @my_errno= $mysql_errno;
- let $run_good= `SELECT @my_errno = 0`;
- let $run_bad= `SELECT @my_errno <> 0`;
- if ($run_good)
- {
- COMMIT;
- }
- if ($run_bad)
- {
- ROLLBACK;
- }
- dec $run;
-}
-
-SET AUTOCOMMIT=1;
---enable_query_log
-
---sync_slave_with_master
---source include/select_ndb_apply_status.inc
-
---echo
-
-connection master;
---source include/show_binlog_using_logname.inc
-
-# Flush the logs on the master moving all
-# Transaction to a new binlog and ensure
-# that the ndb_apply_status table is updated
-# to show the use of the new binlog.
-
---echo
---echo ** Test 3 **
---echo
-
-# Flush logs on master which should force it
-# to switch to binlog #2
-
-FLUSH LOGS;
-
-# Run in some transaction to increase end pos in
-# binlog
-
---disable_query_log
-SET AUTOCOMMIT=0;
-let $run= 5;
-while ($run)
-{
- START TRANSACTION;
- --disable_warnings
- --eval CALL tpcb.trans($rpl_format);
- --enable_warnings
- eval SET @my_errno= $mysql_errno;
- let $run_good= `SELECT @my_errno = 0`;
- let $run_bad= `SELECT @my_errno <> 0`;
- if ($run_good)
- {
- COMMIT;
- }
- if ($run_bad)
- {
- ROLLBACK;
- }
- dec $run;
-}
-SET AUTOCOMMIT=1;
---enable_query_log
-
---echo
-
---sync_slave_with_master
---source include/select_ndb_apply_status.inc
-
---echo
-
-connection master;
---source include/show_binlog_using_logname.inc
-
-# Now we reset both the master and the slave
-# Run some more transaction and ensure
-# that the ndb_apply_status is updated
-# correctly
-
---echo
---echo ** Test 4 **
---echo
-
-# Reset both slave and master
-# This should reset binlog to #1
---source include/rpl_reset.inc
-
---echo
-
-# Run in some transactions and check
-connection master;
---disable_query_log
-SET AUTOCOMMIT=0;
-let $run= 5;
-while ($run)
-{
- START TRANSACTION;
- --disable_warnings
- --eval CALL tpcb.trans($rpl_format);
- --enable_warnings
- eval SET @my_errno= $mysql_errno;
- let $run_good= `SELECT @my_errno = 0`;
- let $run_bad= `SELECT @my_errno <> 0`;
- if ($run_good)
- {
- COMMIT;
- }
- if ($run_bad)
- {
- ROLLBACK;
- }
- dec $run;
-}
-SET AUTOCOMMIT=1;
---enable_query_log
-
---sync_slave_with_master
---source include/select_ndb_apply_status.inc
-
---echo
-
-connection master;
---source include/show_binlog_using_logname.inc
-
-# Since we are doing replication, it is a good
-# idea to check to make sure all data was
-# Replicated correctly
-
---echo
---echo *** DUMP MASTER & SLAVE FOR COMPARE ********
-
---exec $MYSQL_DUMP -n -t --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/master_apply_status.sql
-
---exec $MYSQL_DUMP_SLAVE -n -t --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/slave_apply_status.sql
-
-connection master;
-DROP DATABASE tpcb;
-
---sync_slave_with_master
-
-####### Commenting out until decision on Bug#27960 ###########
-
-#--source include/select_ndb_apply_status.inc
-
-#connection master;
-#--eval SHOW BINLOG EVENTS in '$log_name' from $start_pos
-#--source include/show_binlog_using_logname.inc
-
---echo ****** Do dumps compare ************
-
-
-diff_files $MYSQLTEST_VARDIR/tmp/master_apply_status.sql $MYSQLTEST_VARDIR/tmp/slave_apply_status.sql;
-
-## Note: Ths files should only get removed, if the above diff succeeds.
-
---exec rm $MYSQLTEST_VARDIR/tmp/master_apply_status.sql
---exec rm $MYSQLTEST_VARDIR/tmp/slave_apply_status.sql
-
-
-# End of 5.1 Test
diff --git a/mysql-test/extra/rpl_tests/rpl_packet.inc b/mysql-test/extra/rpl_tests/rpl_packet.inc
new file mode 100644
index 00000000000..cbde486bcbb
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_packet.inc
@@ -0,0 +1,184 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# ==== Purpose ====
+#
+# Check replication protocol packet size handling
+#
+# ==== Related bugs ====
+# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
+# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits
+# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors
+# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
+
+# max-out size db name
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
+call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
+let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+disable_warnings;
+eval drop database if exists $db;
+enable_warnings;
+eval create database $db;
+
+connection master;
+let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
+let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
+let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
+SET @@global.max_allowed_packet=1024;
+SET @@global.net_buffer_length=1024;
+
+sync_slave_with_master;
+# Restart slave for setting to take effect
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+# Reconnect to master for new setting to take effect
+disconnect master;
+
+# alas, can't use eval here; if db name changed apply the change here
+connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
+
+connection master;
+select @@net_buffer_length, @@max_allowed_packet;
+
+create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
+sync_slave_with_master;
+
+eval select count(*) from `$db`.`t1` /* must be 1 */;
+
+SHOW STATUS LIKE 'Slave_running';
+select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
+connection master;
+eval drop database $db;
+sync_slave_with_master;
+
+#
+# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
+#
+# Check that a situation when the size of event on the master is greater than
+# max_allowed_packet on the slave does not lead to infinite re-transmits.
+
+connection master;
+
+# Change the max packet size on master
+
+SET @@global.max_allowed_packet=4096;
+SET @@global.net_buffer_length=4096;
+
+# Restart slave for new setting to take effect
+connection slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+# Reconnect to master for new setting to take effect
+disconnect master;
+connect (master, localhost, root);
+connection master;
+
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+sync_slave_with_master;
+
+connection master;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+
+
+#
+# Bug#42914: The slave I/O thread must stop after trying to read the above
+# event, However there is no Last_IO_Error report.
+#
+
+# The slave I/O thread must stop after trying to read the above event
+connection slave;
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# TODO: this is needed because of BUG#55790. Remove once that is fixed.
+--source include/stop_slave_sql.inc
+
+#
+# Bug#42914: On the master, if a binary log event is larger than
+# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
+# is sent to a slave when it requests a dump from the master, thus leading the
+# I/O thread to stop. However, there is no Last_IO_Error reported.
+#
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
+connection master;
+CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
+sync_slave_with_master;
+
+connection master;
+INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
+
+connection slave;
+# The slave I/O thread must stop after receiving
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# Remove the bad binlog and clear error status on slave.
+STOP SLAVE;
+RESET SLAVE;
+--connection master
+RESET MASTER;
+
+
+#
+# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
+#
+# In BUG#55322, @@session.max_allowed_packet increased each time SHOW
+# BINLOG EVENTS was issued. To verify that this bug is fixed, we
+# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet
+# never changes. We turn off the result log because we don't care
+# about the contents of the binlog.
+
+--disable_result_log
+SET @max_allowed_packet_0= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_1= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_2= @@session.max_allowed_packet;
+--enable_result_log
+if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`)
+{
+ --echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS
+ --source include/show_rpl_debug_info.inc
+ SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2;
+ --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
+}
+
+
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
+eval SET @@global.net_buffer_length= $old_net_buffer_length;
+eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
+# slave is stopped
+connection slave;
+DROP TABLE t1;
+
+# Clear Last_IO_Error
+RESET SLAVE;
+
+--source include/rpl_end.inc
+# End of tests
diff --git a/mysql-test/extra/rpl_tests/rpl_parallel.inc b/mysql-test/extra/rpl_tests/rpl_parallel.inc
new file mode 100644
index 00000000000..8248f03e185
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_parallel.inc
@@ -0,0 +1,2479 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/master-slave.inc
+
+# Test various aspects of parallel replication.
+
+--connection server_2
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--error ER_SLAVE_MUST_STOP
+SET GLOBAL slave_parallel_threads=10;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+
+# Check that we do not spawn any worker threads when no slave is running.
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+# Check that worker threads get spawned when slave starts.
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+# ... and that worker threads get removed when slave stops.
+--source include/stop_slave.inc
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+--source include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+--echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+# Block the table t1 to simulate a replicated query taking a long time.
+--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+LOCK TABLE t1 WRITE;
+
+--connection server_1
+SET gtid_domain_id=1;
+# This query will be blocked on the slave until UNLOCK TABLES.
+INSERT INTO t1 VALUES (2);
+SET gtid_domain_id=0;
+# These t2 queries can be replicated in parallel with the prior t1 query, as
+# they are in a separate replication domain.
+INSERT INTO t2 VALUES (2);
+INSERT INTO t2 VALUES (3);
+BEGIN;
+INSERT INTO t2 VALUES (4);
+INSERT INTO t2 VALUES (5);
+COMMIT;
+INSERT INTO t2 VALUES (6);
+
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 6 FROM t2
+--source include/wait_condition.inc
+
+SELECT * FROM t2 ORDER by a;
+
+--connection con_temp1
+SELECT * FROM t1;
+UNLOCK TABLES;
+
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
+--source include/wait_condition.inc
+
+SELECT * FROM t1 ORDER BY a;
+
+
+--echo *** Test two transactions in different domains committed in opposite order on slave but in a single group commit. ***
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+# Use a stored function to inject a debug_sync into the appropriate THD.
+# The function does nothing on the master, and on the slave it injects the
+# desired debug_sync action(s).
+SET sql_log_bin=0;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format='statement';
+SET gtid_domain_id=1;
+INSERT INTO t2 VALUES (foo(10,
+ 'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1',
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL ready2'));
+
+--connection server_2
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+SET sql_log_bin=0;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+SET @old_format=@@GLOBAL.binlog_format;
+SET GLOBAL binlog_format=statement;
+# We need to restart all parallel threads for the new global setting to
+# be copied to the session-level values.
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+# First make sure the first insert is ready to commit, but not queued yet.
+SET debug_sync='now WAIT_FOR ready1';
+
+--connection server_1
+SET gtid_domain_id=2;
+INSERT INTO t2 VALUES (foo(11,
+ 'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3',
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL ready4 WAIT_FOR cont4'));
+SET gtid_domain_id=0;
+SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
+
+--connection server_2
+# Now wait for the second insert to queue itself as the leader, and then
+# wait for more commits to queue up.
+SET debug_sync='now WAIT_FOR ready3';
+SET debug_sync='now SIGNAL cont3';
+SET debug_sync='now WAIT_FOR ready4';
+# Now allow the first insert to queue up to participate in group commit.
+SET debug_sync='now SIGNAL cont1';
+SET debug_sync='now WAIT_FOR ready2';
+# Finally allow the second insert to proceed and do the group commit.
+SET debug_sync='now SIGNAL cont4';
+
+--let $wait_condition= SELECT COUNT(*) = 2 FROM t2 WHERE a >= 10
+--source include/wait_condition.inc
+SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
+# The two INSERT transactions should have been committed in opposite order,
+# but in the same group commit (seen by precense of cid=# in the SHOW
+# BINLOG output).
+--let $binlog_file= slave-bin.000002
+--source include/show_binlog_events.inc
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+
+# Restart all the slave parallel worker threads, to clear all debug_sync actions.
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET debug_sync='RESET';
+--source include/start_slave.inc
+
+
+--echo *** Test that group-committed transactions on the master can replicate in parallel on the slave. ***
+--connection server_1
+SET debug_sync='RESET';
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+# Create some sentinel rows so that the rows inserted in parallel fall into
+# separate gaps and do not cause gap lock conflicts.
+INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7);
+--save_master_pos
+--connection server_2
+--sync_with_master
+
+# We want to test that the transactions can execute out-of-order on
+# the slave, but still end up committing in-order, and in a single
+# group commit.
+#
+# The idea is to group-commit three transactions together on the master:
+# A, B, and C. On the slave, C will execute the insert first, then A,
+# and then B. But B manages to complete before A has time to commit, so
+# all three end up committing together.
+#
+# So we start by setting up some row locks that will block transactions
+# A and B from executing, allowing C to run first.
+
+--connection con_temp1
+BEGIN;
+INSERT INTO t3 VALUES (2,102);
+--connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+BEGIN;
+INSERT INTO t3 VALUES (4,104);
+
+# On the master, queue three INSERT transactions as a single group commit.
+--connect (con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (2, foo(12,
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connect (con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (4, foo(14,
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connect (con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (6, foo(16,
+ 'group_commit_waiting_for_prior SIGNAL slave_queued3',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+SET debug_sync='RESET';
+
+--connection server_1
+SELECT * FROM t3 ORDER BY a;
+--let $binlog_file= master-bin.000002
+--source include/show_binlog_events.inc
+
+# First, wait until insert 3 is ready to queue up for group commit, but is
+# waiting for insert 2 to commit before it can do so itself.
+--connection server_2
+SET debug_sync='now WAIT_FOR slave_queued3';
+
+# Next, let insert 1 proceed, and allow it to queue up as the group commit
+# leader, but let it wait for insert 2 to also queue up before proceeding.
+--connection con_temp1
+ROLLBACK;
+--connection server_2
+SET debug_sync='now WAIT_FOR slave_queued1';
+
+# Now let insert 2 proceed and queue up.
+--connection con_temp2
+ROLLBACK;
+--connection server_2
+SET debug_sync='now WAIT_FOR slave_queued2';
+# And finally, we can let insert 1 proceed and do the group commit with all
+# three insert transactions together.
+SET debug_sync='now SIGNAL slave_cont1';
+
+# Wait for the commit to complete and check that all three transactions
+# group-committed together (will be seen in the binlog as all three having
+# cid=# on their GTID event).
+--let $wait_condition= SELECT COUNT(*) = 3 FROM t3 WHERE a IN (2,4,6)
+--source include/wait_condition.inc
+SELECT * FROM t3 ORDER BY a;
+--let $binlog_file= slave-bin.000003
+--source include/show_binlog_events.inc
+
+
+--echo *** Test STOP SLAVE in parallel mode ***
+--connection server_2
+--source include/stop_slave.inc
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+
+--connection server_1
+# Set up a couple of transactions. The first will be blocked halfway
+# through on a lock, and while it is blocked we initiate STOP SLAVE.
+# We then test that the halfway-initiated transaction is allowed to
+# complete, but no subsequent ones.
+# We have to use statement-based mode and set
+# binlog_direct_non_transactional_updates=0; otherwise the binlog will
+# be split into two event groups, one for the MyISAM part and one for the
+# InnoDB part.
+SET binlog_direct_non_transactional_updates=0;
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
+SET sql_log_bin=1;
+BEGIN;
+INSERT INTO t2 VALUES (20);
+--disable_warnings
+INSERT INTO t1 VALUES (20);
+--enable_warnings
+INSERT INTO t2 VALUES (21);
+INSERT INTO t3 VALUES (20, 20);
+COMMIT;
+INSERT INTO t3 VALUES(21, 21);
+INSERT INTO t3 VALUES(22, 22);
+SET binlog_format=@old_format;
+--save_master_pos
+
+# Start a connection that will block the replicated transaction halfway.
+--connection con_temp1
+BEGIN;
+INSERT INTO t2 VALUES (21);
+
+--connection server_2
+START SLAVE;
+# Wait for the MyISAM change to be visible, after which replication will wait
+# for con_temp1 to roll back.
+--let $wait_condition= SELECT COUNT(*) = 1 FROM t1 WHERE a=20
+--source include/wait_condition.inc
+
+--connection con_temp2
+# Initiate slave stop. It will have to wait for the current event group
+# to complete.
+# The dbug injection causes debug_sync to signal 'wait_for_done_waiting'
+# when the SQL driver thread is ready.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
+send STOP SLAVE;
+
+--connection con_temp1
+SET debug_sync='now WAIT_FOR wait_for_done_waiting';
+ROLLBACK;
+
+--connection con_temp2
+reap;
+SET GLOBAL debug_dbug=@old_dbug;
+SET debug_sync='RESET';
+
+--connection server_2
+--source include/wait_for_slave_to_stop.inc
+# We should see the first transaction applied, but not the two others.
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
+
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
+
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** Test killing slave threads at various wait points ***
+--echo *** 1. Test killing transaction waiting in commit for previous transaction to commit ***
+
+# Set up three transactions on the master that will be group-committed
+# together so they can be replicated in parallel on the slave.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (31, foo(31,
+ 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+ 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+# This insert is just so we can get T2 to wait while a query is running that we
+# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
+INSERT INTO t3 VALUES (32, foo(32,
+ 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+ ''));
+# This insert sets up debug_sync points so that T2 will tell when it is at its
+# wait point where we want to kill it - and when it has been killed.
+INSERT INTO t3 VALUES (33, foo(33,
+ 'group_commit_waiting_for_prior SIGNAL t2_waiting',
+ 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+send COMMIT;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp5
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (34, foo(34,
+ '',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Query execution was interrupted");
+CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
+CALL mtr.add_suppression("Slave: Connection was killed");
+SET sql_log_bin=1;
+# Wait until T2 is inside executing its insert of 32, then find it in SHOW
+# PROCESSLIST to know its thread id for KILL later.
+SET debug_sync='now WAIT_FOR t2_query';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(32%' AND INFO NOT LIKE '%LIKE%'`
+SET debug_sync='now SIGNAL t2_cont';
+
+# Wait until T2 has entered its wait for T1 to commit, and T1 has
+# progressed into its commit phase.
+SET debug_sync='now WAIT_FOR t1_ready';
+
+# Now kill the transaction T2.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+# Wait until T2 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t2_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+INSERT INTO t3 VALUES (39,0);
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** 2. Same as (1), but without restarting IO thread after kill of SQL threads ***
+
+# Set up three transactions on the master that will be group-committed
+# together so they can be replicated in parallel on the slave.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (41, foo(41,
+ 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+ 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+# This insert is just so we can get T2 to wait while a query is running that we
+# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
+INSERT INTO t3 VALUES (42, foo(42,
+ 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+ ''));
+# This insert sets up debug_sync points so that T2 will tell when it is at its
+# wait point where we want to kill it - and when it has been killed.
+INSERT INTO t3 VALUES (43, foo(43,
+ 'group_commit_waiting_for_prior SIGNAL t2_waiting',
+ 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+send COMMIT;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp5
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (44, foo(44,
+ '',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+# Wait until T2 is inside executing its insert of 42, then find it in SHOW
+# PROCESSLIST to know its thread id for KILL later.
+SET debug_sync='now WAIT_FOR t2_query';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(42%' AND INFO NOT LIKE '%LIKE%'`
+SET debug_sync='now SIGNAL t2_cont';
+
+# Wait until T2 has entered its wait for T1 to commit, and T1 has
+# progressed into its commit phase.
+SET debug_sync='now WAIT_FOR t1_ready';
+
+# Now kill the transaction T2.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+# Wait until T2 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t2_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+INSERT INTO t3 VALUES (49,0);
+--save_master_pos
+
+--connection server_2
+START SLAVE SQL_THREAD;
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** 3. Same as (2), but not using gtid mode ***
+
+--connection server_2
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=no;
+--source include/start_slave.inc
+
+--connection server_1
+# Set up three transactions on the master that will be group-committed
+# together so they can be replicated in parallel on the slave.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (51, foo(51,
+ 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+ 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+# This insert is just so we can get T2 to wait while a query is running that we
+# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
+INSERT INTO t3 VALUES (52, foo(52,
+ 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+ ''));
+# This insert sets up debug_sync points so that T2 will tell when it is at its
+# wait point where we want to kill it - and when it has been killed.
+INSERT INTO t3 VALUES (53, foo(53,
+ 'group_commit_waiting_for_prior SIGNAL t2_waiting',
+ 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+send COMMIT;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp5
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (54, foo(54,
+ '',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+# Wait until T2 is inside executing its insert of 52, then find it in SHOW
+# PROCESSLIST to know its thread id for KILL later.
+SET debug_sync='now WAIT_FOR t2_query';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(52%' AND INFO NOT LIKE '%LIKE%'`
+SET debug_sync='now SIGNAL t2_cont';
+
+# Wait until T2 has entered its wait for T1 to commit, and T1 has
+# progressed into its commit phase.
+SET debug_sync='now WAIT_FOR t1_ready';
+
+# Now kill the transaction T2.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+# Wait until T2 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t2_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+INSERT INTO t3 VALUES (59,0);
+--save_master_pos
+
+--connection server_2
+START SLAVE SQL_THREAD;
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=4;
+--source include/start_slave.inc
+
+
+--echo *** 4. Test killing thread that is waiting to start transaction until previous transaction commits ***
+
+# We set up four transactions T1, T2, T3, and T4 on the master. T2, T3, and T4
+# can run in parallel with each other (same group commit and commit id),
+# but not in parallel with T1.
+#
+# We use four worker threads, each Ti will be queued on each their own
+# worker thread. We will delay T1 commit, T3 will wait for T1 to begin
+# commit before it can start. We will kill T3 during this wait, and
+# check that everything works correctly.
+#
+# It is rather tricky to get the correct thread id of the worker to kill.
+# We start by injecting four dummy transactions in a debug_sync-controlled
+# manner to be able to get known thread ids for the workers in a pool with
+# just 4 worker threads. Then we let in each of the real test transactions
+# T1-T4 one at a time in a way which allows us to know which transaction
+# ends up with which thread id.
+
+--connection server_1
+SET binlog_format=statement;
+SET gtid_domain_id=2;
+BEGIN;
+# This debug_sync will linger on and be used to control T4 later.
+INSERT INTO t3 VALUES (70, foo(70,
+ 'rpl_parallel_start_waiting_for_prior SIGNAL t4_waiting', ''));
+INSERT INTO t3 VALUES (60, foo(60,
+ 'ha_write_row_end SIGNAL d2_query WAIT_FOR d2_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d2_query';
+--let $d2_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(60%' AND INFO NOT LIKE '%LIKE%'`
+
+--connection server_1
+SET gtid_domain_id=1;
+BEGIN;
+# These debug_sync's will linger on and be used to control T3 later.
+INSERT INTO t3 VALUES (61, foo(61,
+ 'rpl_parallel_start_waiting_for_prior SIGNAL t3_waiting',
+ 'rpl_parallel_start_waiting_for_prior_killed SIGNAL t3_killed'));
+INSERT INTO t3 VALUES (62, foo(62,
+ 'ha_write_row_end SIGNAL d1_query WAIT_FOR d1_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d1_query';
+--let $d1_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(62%' AND INFO NOT LIKE '%LIKE%'`
+
+--connection server_1
+SET gtid_domain_id=0;
+INSERT INTO t3 VALUES (63, foo(63,
+ 'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont'));
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d0_query';
+--let $d0_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(63%' AND INFO NOT LIKE '%LIKE%'`
+
+--connection server_1
+SET gtid_domain_id=3;
+BEGIN;
+# These debug_sync's will linger on and be used to control T2 later.
+INSERT INTO t3 VALUES (68, foo(68,
+ 'rpl_parallel_start_waiting_for_prior SIGNAL t2_waiting', ''));
+INSERT INTO t3 VALUES (69, foo(69,
+ 'ha_write_row_end SIGNAL d3_query WAIT_FOR d3_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d3_query';
+--let $d3_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(69%' AND INFO NOT LIKE '%LIKE%'`
+
+SET debug_sync='now SIGNAL d2_cont2';
+SET debug_sync='now WAIT_FOR d2_done';
+SET debug_sync='now SIGNAL d1_cont2';
+SET debug_sync='now WAIT_FOR d1_done';
+SET debug_sync='now SIGNAL d0_cont2';
+SET debug_sync='now WAIT_FOR d0_done';
+SET debug_sync='now SIGNAL d3_cont2';
+SET debug_sync='now WAIT_FOR d3_done';
+
+# Now prepare the real transactions T1, T2, T3, T4 on the master.
+
+--connection con_temp3
+# Create transaction T1.
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (64, foo(64,
+ 'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', ''));
+
+# Create transaction T2, as a group commit leader on the master.
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2';
+send INSERT INTO t3 VALUES (65, foo(65, '', ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp4
+# Create transaction T3, participating in T2's group commit.
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+send INSERT INTO t3 VALUES (66, foo(66, '', ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+
+--connection con_temp5
+# Create transaction T4, participating in group commit with T2 and T3.
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4';
+send INSERT INTO t3 VALUES (67, foo(67, '', ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued4';
+SET debug_sync='now SIGNAL master_cont2';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+# Now we have the four transactions pending for replication on the slave.
+# Let them be queued for our three worker threads in a controlled fashion.
+# We put them at a stage where T1 is delayed and T3 is waiting for T1 to
+# commit before T3 can start. Then we kill T3.
+
+# Make the worker D0 free, and wait for T1 to be queued in it.
+SET debug_sync='now SIGNAL d0_cont';
+SET debug_sync='now WAIT_FOR t1_waiting';
+
+# Make the worker D3 free, and wait for T2 to be queued in it.
+SET debug_sync='now SIGNAL d3_cont';
+SET debug_sync='now WAIT_FOR t2_waiting';
+
+# Now release worker D1, and wait for T3 to be queued in it.
+# T3 will wait for T1 to commit before it can start.
+SET debug_sync='now SIGNAL d1_cont';
+SET debug_sync='now WAIT_FOR t3_waiting';
+
+# Release worker D2. Wait for T4 to be queued, so we are sure it has
+# received the debug_sync signal (else we might overwrite it with the
+# next debug_sync).
+SET debug_sync='now SIGNAL d2_cont';
+SET debug_sync='now WAIT_FOR t4_waiting';
+
+# Now we kill the waiting transaction T3 in worker D1.
+--replace_result $d1_thd_id THD_ID
+eval KILL $d1_thd_id;
+
+# Wait until T3 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t3_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+# Since T2, T3, and T4 run in parallel, we can not be sure if T2 will have time
+# to commit or not before the stop. However, T1 should commit, and T3/T4 may
+# not have committed. (After slave restart we check that all become committed
+# eventually).
+SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a;
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+UPDATE t3 SET b=b+1 WHERE a=60;
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** 5. Test killing thread that is waiting for queue of max length to shorten ***
+
+# Find the thread id of the driver SQL thread that we want to kill.
+--let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'
+--source include/wait_condition.inc
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'`
+SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued;
+SET GLOBAL slave_parallel_max_queued=9000;
+
+--connection server_1
+--let bigstring= `SELECT REPEAT('x', 10000)`
+SET binlog_format=statement;
+# Create an event that will wait to be signalled.
+INSERT INTO t3 VALUES (80, foo(0,
+ 'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', ''));
+
+--connection server_2
+SET debug_sync='now WAIT_FOR query_waiting';
+# Inject that the SQL driver thread will signal `wait_queue_ready' to debug_sync
+# as it goes to wait for the event queue to become smaller than the value of
+# @@slave_parallel_max_queued.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max";
+
+--connection server_1
+--disable_query_log
+# Create an event that will fill up the queue.
+# The Xid event at the end of the event group will have to wait for the Query
+# event with the INSERT to drain so the queue becomes shorter. However that in
+# turn waits for the prior event group to continue.
+eval INSERT INTO t3 VALUES (81, LENGTH('$bigstring'));
+--enable_query_log
+SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR wait_queue_ready';
+
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+SET debug_sync='now WAIT_FOR wait_queue_killed';
+SET debug_sync='now SIGNAL query_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_max_queued= @old_max_queued;
+
+--connection server_1
+INSERT INTO t3 VALUES (82,0);
+SET binlog_format=@old_format;
+--save_master_pos
+
+--connection server_2
+SET debug_sync='RESET';
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
+
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--echo *** MDEV-5788 Incorrect free of rgi->deferred_events in parallel replication ***
+
+--connection server_2
+# Use just two worker threads, so we are sure to get the rpl_group_info added
+# to the free list, which is what triggered the bug.
+--source include/stop_slave.inc
+SET GLOBAL replicate_ignore_table="test.t3";
+SET GLOBAL slave_parallel_threads=2;
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t3 VALUES (100, rand());
+INSERT INTO t3 VALUES (101, rand());
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--connection server_1
+INSERT INTO t3 VALUES (102, rand());
+INSERT INTO t3 VALUES (103, rand());
+INSERT INTO t3 VALUES (104, rand());
+INSERT INTO t3 VALUES (105, rand());
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+SET GLOBAL replicate_ignore_table="";
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t3 VALUES (106, rand());
+INSERT INTO t3 VALUES (107, rand());
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--replace_column 2 #
+SELECT * FROM t3 WHERE a >= 100 ORDER BY a;
+
+
+--echo *** MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t3 VALUES (110, 1);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+# Inject a duplicate key error.
+SET sql_log_bin=0;
+INSERT INTO t3 VALUES (111, 666);
+SET sql_log_bin=1;
+
+--connection server_1
+
+# Create a group commit with two inserts, the first one conflicts with a row on the slave
+--connect (con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send INSERT INTO t3 VALUES (111, 2);
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connect (con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send INSERT INTO t3 VALUES (112, 3);
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET debug_sync='RESET';
+--save_master_pos
+
+--connection server_2
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+--source include/wait_for_slave_sql_to_stop.inc
+# We should not see the row (112,3) here, it should be rolled back due to
+# error signal from the prior transaction.
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+SET sql_log_bin=0;
+DELETE FROM t3 WHERE a=111 AND b=666;
+SET sql_log_bin=1;
+START SLAVE SQL_THREAD;
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+
+
+--echo ***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts ***
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+
+# Create a group commit with UPDATE and DELETE, in that order.
+# The bug was that while the UPDATE's row lock does not block the DELETE, the
+# DELETE's gap lock _does_ block the UPDATE. This could cause a deadlock
+# on the slave.
+--connection con1
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send UPDATE t4 SET b=NULL WHERE a=6;
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 3;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET debug_sync='RESET';
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+--source include/stop_slave.inc
+
+SELECT * FROM t4 ORDER BY a;
+
+
+# Another example, this one with INSERT vs. DELETE
+--connection server_1
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+
+# Create a group commit with INSERT and DELETE, in that order.
+# The bug was that while the INSERT's insert intention lock does not block
+# the DELETE, the DELETE's gap lock _does_ block the INSERT. This could cause
+# a deadlock on the slave.
+--connection con1
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send INSERT INTO t4 VALUES (7, NULL);
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 3;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET debug_sync='RESET';
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+--source include/stop_slave.inc
+
+SELECT * FROM t4 ORDER BY a;
+
+
+# MDEV-6549, failing to update gtid_slave_pos for a transaction that was retried.
+# The problem was that when a transaction updates the mysql.gtid_slave_pos
+# table, it clears the flag that marks that there is a GTID position that
+# needs to be updated. Then, if the transaction got killed after that due
+# to a deadlock, the subsequent retry would fail to notice that the GTID needs
+# to be recorded in gtid_slave_pos.
+#
+# (In the original bug report, the symptom was an assertion; this was however
+# just a side effect of the missing update of gtid_slave_pos, which also
+# happened to cause a missing clear of OPTION_GTID_BEGIN).
+--connection server_1
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+
+# Create two transactions that can run in parallel on the slave but cause
+# a deadlock if the second runs before the first.
+--connection con1
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send UPDATE t4 SET b=NULL WHERE a=6;
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+# Must use statement-based binlogging. Otherwise the transaction will not be
+# binlogged at all, as it modifies no rows.
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format='statement';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 1;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET @old_format=@@GLOBAL.binlog_format;
+SET debug_sync='RESET';
+--save_master_pos
+--let $last_gtid= `SELECT @@last_gtid`
+
+--connection server_2
+# Disable the usual skip of gap locks for transactions that are run in
+# parallel, using DBUG. This allows the deadlock to occur, and this in turn
+# triggers a retry of the second transaction, and the code that was buggy and
+# caused the gtid_slave_pos update to be skipped in the retry.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,disable_thd_need_ordering_with";
+--source include/start_slave.inc
+--sync_with_master
+SET GLOBAL debug_dbug=@old_dbug;
+
+SELECT * FROM t4 ORDER BY a;
+# Check that the GTID of the second transaction was correctly recorded in
+# gtid_slave_pos, in the variable as well as in the table.
+--replace_result $last_gtid GTID
+eval SET @last_gtid= '$last_gtid';
+SELECT IF(@@gtid_slave_pos LIKE CONCAT('%',@last_gtid,'%'), "GTID found ok",
+ CONCAT("GTID ", @last_gtid, " not found in gtid_slave_pos=", @@gtid_slave_pos))
+ AS result;
+SELECT "ROW FOUND" AS `Is the row found?`
+ FROM mysql.gtid_slave_pos
+ WHERE CONCAT(domain_id, "-", server_id, "-", seq_no) = @last_gtid;
+
+
+--echo *** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication ***
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET DEBUG_SYNC= 'RESET';
+--source include/start_slave.inc
+
+--connection server_1
+CREATE TABLE t5 (a INT PRIMARY KEY, b INT);
+INSERT INTO t5 VALUES (1,1);
+INSERT INTO t5 VALUES (2,2), (3,8);
+INSERT INTO t5 VALUES (4,16);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1);
+let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check;
+eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check;
+--enable_query_log
+
+--connection server_1
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1);
+let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check;
+eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check;
+--enable_query_log
+
+
+--echo *** MDEV_6435: Incorrect error handling when query binlogged partially on master with "killed" error ***
+
+--connection server_1
+CREATE TABLE t6 (a INT) ENGINE=MyISAM;
+CREATE TRIGGER tr AFTER INSERT ON t6 FOR EACH ROW SET @a = 1;
+
+--connection con1
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+--let $conid = `SELECT CONNECTION_ID()`
+SET debug_sync='sp_head_execute_before_loop SIGNAL ready WAIT_FOR cont';
+send INSERT INTO t6 VALUES (1), (2), (3);
+
+--connection server_1
+SET debug_sync='now WAIT_FOR ready';
+--replace_result $conid CONID
+eval KILL QUERY $conid;
+SET debug_sync='now SIGNAL cont';
+
+--connection con1
+--error ER_QUERY_INTERRUPTED
+--reap
+SET binlog_format= @old_format;
+SET debug_sync='RESET';
+--let $after_error_gtid_pos= `SELECT @@gtid_binlog_pos`
+
+--connection server_1
+SET debug_sync='RESET';
+
+
+--connection server_2
+--let $slave_sql_errno= 1317
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+--replace_result $after_error_gtid_pos AFTER_ERROR_GTID_POS
+eval SET GLOBAL gtid_slave_pos= '$after_error_gtid_pos';
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t6 VALUES (4);
+SELECT * FROM t6 ORDER BY a;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t6 ORDER BY a;
+
+
+--echo *** MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0 ***
+
+--connection server_1
+INSERT INTO t2 VALUES (31);
+--let $gtid1= `SELECT @@LAST_GTID`
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads= 0;
+--source include/start_slave.inc
+
+# Force a duplicate key error on the slave.
+SET sql_log_bin= 0;
+INSERT INTO t2 VALUES (32);
+SET sql_log_bin= 1;
+
+--connection server_1
+INSERT INTO t2 VALUES (32);
+--let $gtid2= `SELECT @@LAST_GTID`
+# Rotate the binlog; the bug is triggered when the master binlog file changes
+# after the event group that causes the duplicate key error.
+FLUSH LOGS;
+INSERT INTO t2 VALUES (33);
+INSERT INTO t2 VALUES (34);
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+--connection server_2
+--source include/stop_slave_io.inc
+SET GLOBAL slave_parallel_threads=10;
+START SLAVE;
+
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+# Note: IO thread is still running at this point.
+# The bug seems to have been that restarting the SQL thread after an error with
+# the IO thread still running, somehow picks up a later relay log position and
+# thus ends up skipping the failing event, rather than re-executing.
+
+START SLAVE SQL_THREAD;
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+
+# Skip the duplicate error, so we can proceed.
+--error ER_SLAVE_SKIP_NOT_IN_GTID
+SET sql_slave_skip_counter= 1;
+--source include/stop_slave_io.inc
+--disable_query_log
+eval SET GLOBAL gtid_slave_pos = REPLACE(@@gtid_slave_pos, "$gtid1", "$gtid2");
+--enable_query_log
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+
+
+--echo *** MDEV-6775: Wrong binlog order in parallel replication ***
+--connection server_1
+# A bit tricky bug to reproduce. On the master, we binlog in statement-mode
+# two transactions, an UPDATE followed by a DELETE. On the slave, we replicate
+# with binlog-mode set to ROW, which means the DELETE, which modifies no rows,
+# is not binlogged. Then we inject a wait in the group commit code on the
+# slave, shortly before the actual commit of the UPDATE. The bug was that the
+# DELETE could wake up from wait_for_prior_commit() before the commit of the
+# UPDATE. So the test could see the slave position updated to after DELETE,
+# while the UPDATE was still not visible.
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (3,NULL), (4,4), (5, NULL), (6, 6);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,inject_binlog_commit_before_get_LOCK_log";
+SET @old_format=@@GLOBAL.binlog_format;
+SET GLOBAL binlog_format=ROW;
+# Re-spawn the worker threads to be sure they pick up the new binlog format
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+
+--connection con1
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send UPDATE t4 SET b=NULL WHERE a=6;
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 3;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+SET binlog_format= @old_format;
+--connection con2
+REAP;
+SET binlog_format= @old_format;
+SET debug_sync='RESET';
+--save_master_pos
+SELECT * FROM t4 ORDER BY a;
+
+--connection server_2
+--source include/start_slave.inc
+SET debug_sync= 'now WAIT_FOR waiting';
+--sync_with_master
+SELECT * FROM t4 ORDER BY a;
+SET debug_sync= 'now SIGNAL cont';
+
+# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL binlog_format= @old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave ***
+--connection server_1
+INSERT INTO t2 VALUES (40);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=no;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+# This DBUG injection causes a DEBUG_SYNC signal "scheduled_gtid_0_x_100" when
+# GTID 0-1-100 has been scheduled for and fetched by a worker thread.
+SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100";
+# This DBUG injection causes a DEBUG_SYNC signal "wait_for_done_waiting" when
+# STOP SLAVE has signalled all worker threads to stop.
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
+# Reset worker threads to make DBUG setting catch on.
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+
+
+--connection server_1
+# Setup some transaction for the slave to replicate.
+INSERT INTO t2 VALUES (41);
+INSERT INTO t2 VALUES (42);
+# Need to log the DELETE in statement format, so we can see it in processlist.
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+DELETE FROM t2 WHERE a=40;
+SET binlog_format= @old_format;
+INSERT INTO t2 VALUES (43);
+INSERT INTO t2 VALUES (44);
+# Force the slave to switch to a new relay log file.
+FLUSH LOGS;
+INSERT INTO t2 VALUES (45);
+# Inject a GTID 0-1-100, which will trigger a DEBUG_SYNC signal when this
+# transaction has been fetched by a worker thread.
+SET gtid_seq_no=100;
+INSERT INTO t2 VALUES (46);
+--save_master_pos
+
+--connection con_temp2
+# Temporarily block the DELETE on a=40 from completing.
+BEGIN;
+SELECT * FROM t2 WHERE a=40 FOR UPDATE;
+
+
+--connection server_2
+--source include/start_slave.inc
+
+# Wait for a worker thread to start on the DELETE that will be blocked
+# temporarily by the SELECT FOR UPDATE.
+--let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state='updating' and info LIKE '%DELETE FROM t2 WHERE a=40%'
+--source include/wait_condition.inc
+
+# The DBUG injection set above will make the worker thread signal the following
+# debug_sync when the GTID 0-1-100 has been reached by a worker thread.
+# Thus, at this point, the SQL driver thread has reached the next
+# relay log file name, while a worker thread is still processing a
+# transaction in the previous relay log file, blocked on the SELECT FOR
+# UPDATE.
+SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100';
+# At this point, the SQL driver thread is in the new relay log file, while
+# the DELETE from the old relay log file is not yet complete. We will stop
+# the slave at this point. The bug was that the DELETE statement would
+# update the slave position to the _new_ relay log file name instead of
+# its own old file name. Thus, by stoping and restarting the slave at this
+# point, we would get an error at restart due to incorrect position. (If
+# we would let the slave catch up before stopping, the incorrect position
+# would be corrected by a later transaction).
+
+send STOP SLAVE;
+
+--connection con_temp2
+# Wait for STOP SLAVE to have proceeded sufficiently that it has signalled
+# all worker threads to stop; this ensures that we will stop after the DELETE
+# transaction (and not after a later transaction that might have been able
+# to set a fixed position).
+SET debug_sync= 'now WAIT_FOR wait_for_done_waiting';
+# Now release the row lock that was blocking the replication of DELETE.
+ROLLBACK;
+
+--connection server_2
+reap;
+--source include/wait_for_slave_sql_to_stop.inc
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+# Now restart the slave. With the bug present, this would start at an
+# incorrect relay log position, causing relay log read error (or if unlucky,
+# silently skip a number of events).
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET DEBUG_SYNC= 'RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7326 Server deadlock in connection with parallel replication ***
+# We use three transactions, each in a separate group commit.
+# T1 does mark_start_commit(), then gets a deadlock error.
+# T2 wakes up and starts running
+# T1 does unmark_start_commit()
+# T3 goes to wait for T2 to start its commit
+# T2 does mark_start_commit()
+# The bug was that at this point, T3 got deadlocked. Because T1 has unmarked(),
+# T3 did not yet see the count_committing_event_groups reach its target value
+# yet. But when T1 later re-did mark_start_commit(), it failed to send a wakeup
+# to T3.
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=3;
+SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
+--source include/start_slave.inc
+
+--connection server_1
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format= STATEMENT;
+# This debug_sync will linger on and be used to control T3 later.
+INSERT INTO t1 VALUES (foo(50,
+ "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
+ "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+--save_master_pos
+--connection server_2
+# Wait for the debug_sync point for T3 to be set. But let the preparation
+# transaction remain hanging, so that T1 and T2 will be scheduled for the
+# remaining two worker threads.
+SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+
+--connection server_1
+INSERT INTO t2 VALUES (foo(50,
+ "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
+ "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+--save_master_pos
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+# T1 has now done mark_start_commit(). It will later do a rollback and retry.
+
+--connection server_1
+# Use a MyISAM table for T2 and T3, so they do not trigger the
+# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event.
+INSERT INTO t1 VALUES (foo(51,
+ "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
+ "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
+# T2 has now started running, but has not yet done mark_start_commit()
+SET DEBUG_SYNC= "now SIGNAL t1_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+# T1 has now done unmark_start_commit() in preparation for its retry.
+
+--connection server_1
+INSERT INTO t1 VALUES (52);
+SET BINLOG_FORMAT= @old_format;
+SELECT * FROM t2 WHERE a>=50 ORDER BY a;
+SELECT * FROM t1 WHERE a>=50 ORDER BY a;
+
+--connection server_2
+# Let the preparation transaction complete, so that the same worker thread
+# can continue with the transaction T3.
+SET DEBUG_SYNC= "now SIGNAL prep_cont";
+SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
+# T3 has now gone to wait for T2 to start committing
+SET DEBUG_SYNC= "now SIGNAL t2_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
+# T2 has now done mark_start_commit().
+# Let things run, and check that T3 does not get deadlocked.
+SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+--sync_with_master
+
+--connection server_1
+--save_master_pos
+--connection server_2
+--sync_with_master
+SELECT * FROM t2 WHERE a>=50 ORDER BY a;
+SELECT * FROM t1 WHERE a>=50 ORDER BY a;
+SET DEBUG_SYNC="reset";
+
+# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7326 Server deadlock in connection with parallel replication ***
+# Similar to the previous test, but with T2 and T3 in the same GCO.
+# We use three transactions, T1 in one group commit and T2/T3 in another.
+# T1 does mark_start_commit(), then gets a deadlock error.
+# T2 wakes up and starts running
+# T1 does unmark_start_commit()
+# T3 goes to wait for T1 to start its commit
+# T2 does mark_start_commit()
+# The bug was that at this point, T3 got deadlocked. T2 increments the
+# count_committing_event_groups but does not signal T3, as they are in
+# the same GCO. Then later when T1 increments, it would also not signal
+# T3, because now the count_committing_event_groups is not equal to the
+# wait_count of T3 (it is one larger).
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=3;
+SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
+--source include/start_slave.inc
+
+--connection server_1
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format= STATEMENT;
+# This debug_sync will linger on and be used to control T3 later.
+INSERT INTO t1 VALUES (foo(60,
+ "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
+ "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+--save_master_pos
+--connection server_2
+# Wait for the debug_sync point for T3 to be set. But let the preparation
+# transaction remain hanging, so that T1 and T2 will be scheduled for the
+# remaining two worker threads.
+SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+
+--connection server_1
+INSERT INTO t2 VALUES (foo(60,
+ "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
+ "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+--save_master_pos
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+# T1 has now done mark_start_commit(). It will later do a rollback and retry.
+
+# Do T2 and T3 in a single group commit.
+# Use a MyISAM table for T2 and T3, so they do not trigger the
+# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t1 VALUES (foo(61,
+ "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
+ "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send INSERT INTO t6 VALUES (62);
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+
+--connection server_1
+SET debug_sync='RESET';
+SET BINLOG_FORMAT= @old_format;
+SELECT * FROM t2 WHERE a>=60 ORDER BY a;
+SELECT * FROM t1 WHERE a>=60 ORDER BY a;
+SELECT * FROM t6 WHERE a>=60 ORDER BY a;
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
+# T2 has now started running, but has not yet done mark_start_commit()
+SET DEBUG_SYNC= "now SIGNAL t1_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+# T1 has now done unmark_start_commit() in preparation for its retry.
+
+--connection server_2
+# Let the preparation transaction complete, so that the same worker thread
+# can continue with the transaction T3.
+SET DEBUG_SYNC= "now SIGNAL prep_cont";
+SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
+# T3 has now gone to wait for T2 to start committing
+SET DEBUG_SYNC= "now SIGNAL t2_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
+# T2 has now done mark_start_commit().
+# Let things run, and check that T3 does not get deadlocked.
+SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+--sync_with_master
+
+--connection server_1
+--save_master_pos
+--connection server_2
+--sync_with_master
+SELECT * FROM t2 WHERE a>=60 ORDER BY a;
+SELECT * FROM t1 WHERE a>=60 ORDER BY a;
+SELECT * FROM t6 WHERE a>=60 ORDER BY a;
+SET DEBUG_SYNC="reset";
+
+# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
+
+--connection server_1
+INSERT INTO t2 VALUES (101);
+INSERT INTO t2 VALUES (102);
+INSERT INTO t2 VALUES (103);
+INSERT INTO t2 VALUES (104);
+INSERT INTO t2 VALUES (105);
+# Inject a partial event group (missing XID at the end). The bug was that such
+# partial group was not handled appropriately, leading to server deadlock.
+SET gtid_seq_no=1000;
+INSERT INTO t2 VALUES (106);
+INSERT INTO t2 VALUES (107);
+INSERT INTO t2 VALUES (108);
+INSERT INTO t2 VALUES (109);
+INSERT INTO t2 VALUES (110);
+INSERT INTO t2 VALUES (111);
+INSERT INTO t2 VALUES (112);
+INSERT INTO t2 VALUES (113);
+INSERT INTO t2 VALUES (114);
+INSERT INTO t2 VALUES (115);
+INSERT INTO t2 VALUES (116);
+INSERT INTO t2 VALUES (117);
+INSERT INTO t2 VALUES (118);
+INSERT INTO t2 VALUES (119);
+INSERT INTO t2 VALUES (120);
+INSERT INTO t2 VALUES (121);
+INSERT INTO t2 VALUES (122);
+INSERT INTO t2 VALUES (123);
+INSERT INTO t2 VALUES (124);
+INSERT INTO t2 VALUES (125);
+INSERT INTO t2 VALUES (126);
+INSERT INTO t2 VALUES (127);
+INSERT INTO t2 VALUES (128);
+INSERT INTO t2 VALUES (129);
+INSERT INTO t2 VALUES (130);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+# The partial event group (a=106) should be rolled back and thus missing.
+SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--echo *** MDEV-6676 - test syntax of @@slave_parallel_mode ***
+--connection server_2
+
+--let $status_items= Parallel_Mode
+--source include/show_slave_status.inc
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='aggressive';
+--let $status_items= Parallel_Mode
+--source include/show_slave_status.inc
+SET GLOBAL slave_parallel_mode='conservative';
+--let $status_items= Parallel_Mode
+--source include/show_slave_status.inc
+
+
+--echo *** MDEV-6676 - test that empty parallel_mode does not replicate in parallel ***
+--connection server_1
+INSERT INTO t2 VALUES (1040);
+--source include/save_master_gtid.inc
+
+--connection server_2
+SET GLOBAL slave_parallel_mode='none';
+# Test that we do not use parallel apply, by injecting an unconditional
+# crash in the parallel apply code.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply";
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+
+
+--echo *** MDEV-6676 - test disabling domain-based parallel replication ***
+--connection server_1
+# Let's do a bunch of transactions that will conflict if run out-of-order in
+# domain-based parallel replication mode.
+SET gtid_domain_id = 1;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+DELETE FROM t2 WHERE a >= 1041;
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+SET gtid_domain_id = 0;
+--source include/save_master_gtid.inc
+--connection server_2
+SET GLOBAL slave_parallel_mode=minimal;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='conservative';
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging ***
+--echo *** MDEV-7882: Excessive transaction retry in parallel replication ***
+
+--connection server_1
+CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=40;
+SELECT @old_retries:=@@GLOBAL.slave_transaction_retries;
+SET GLOBAL slave_transaction_retries= 5;
+
+
+# Using dbug error injection, we artificially create event groups with a lot of
+# conflicting transactions in each event group. The bugs were originally seen
+# "in the wild" with transactions that did not conflict on the master, and only
+# conflicted very rarely on the slave (maybe some edge case with InnoDB btree
+# page splits or something like that). The event groups here loosely reflect
+# the structure of the original failure's group commits.
+
+
+--connection server_1
+INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
+SET @old_dbug= @@SESSION.debug_dbug;
+SET @commit_id= 42;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+INSERT INTO t8 VALUES (1,1);
+INSERT INTO t8 VALUES (2,2);
+INSERT INTO t8 VALUES (3,3);
+INSERT INTO t8 VALUES (4,4);
+INSERT INTO t8 VALUES (5,5);
+INSERT INTO t8 VALUES (6,6);
+INSERT INTO t8 VALUES (7,7);
+INSERT INTO t8 VALUES (8,8);
+
+UPDATE t7 SET b=9 WHERE a=3;
+UPDATE t7 SET b=10 WHERE a=3;
+UPDATE t7 SET b=11 WHERE a=3;
+
+INSERT INTO t8 VALUES (12,12);
+INSERT INTO t8 VALUES (13,13);
+
+UPDATE t7 SET b=14 WHERE a=3;
+UPDATE t7 SET b=15 WHERE a=3;
+
+INSERT INTO t8 VALUES (16,16);
+
+UPDATE t7 SET b=17 WHERE a=3;
+
+INSERT INTO t8 VALUES (18,18);
+INSERT INTO t8 VALUES (19,19);
+
+UPDATE t7 SET b=20 WHERE a=3;
+
+INSERT INTO t8 VALUES (21,21);
+
+UPDATE t7 SET b=22 WHERE a=3;
+
+INSERT INTO t8 VALUES (23,24);
+INSERT INTO t8 VALUES (24,24);
+
+UPDATE t7 SET b=25 WHERE a=3;
+
+INSERT INTO t8 VALUES (26,26);
+
+UPDATE t7 SET b=27 WHERE a=3;
+
+BEGIN;
+INSERT INTO t8 VALUES (28,28);
+INSERT INTO t8 VALUES (29,28), (30,28);
+INSERT INTO t8 VALUES (31,28);
+INSERT INTO t8 VALUES (32,28);
+INSERT INTO t8 VALUES (33,28);
+INSERT INTO t8 VALUES (34,28);
+INSERT INTO t8 VALUES (35,28);
+INSERT INTO t8 VALUES (36,28);
+INSERT INTO t8 VALUES (37,28);
+INSERT INTO t8 VALUES (38,28);
+INSERT INTO t8 VALUES (39,28);
+INSERT INTO t8 VALUES (40,28);
+INSERT INTO t8 VALUES (41,28);
+INSERT INTO t8 VALUES (42,28);
+COMMIT;
+
+
+SET @commit_id=43;
+INSERT INTO t8 VALUES (43,43);
+INSERT INTO t8 VALUES (44,44);
+
+UPDATE t7 SET b=45 WHERE a=3;
+
+INSERT INTO t8 VALUES (46,46);
+INSERT INTO t8 VALUES (47,47);
+
+UPDATE t7 SET b=48 WHERE a=3;
+
+INSERT INTO t8 VALUES (49,49);
+INSERT INTO t8 VALUES (50,50);
+
+
+SET @commit_id=44;
+INSERT INTO t8 VALUES (51,51);
+INSERT INTO t8 VALUES (52,52);
+
+UPDATE t7 SET b=53 WHERE a=3;
+
+INSERT INTO t8 VALUES (54,54);
+INSERT INTO t8 VALUES (55,55);
+
+UPDATE t7 SET b=56 WHERE a=3;
+
+INSERT INTO t8 VALUES (57,57);
+
+UPDATE t7 SET b=58 WHERE a=3;
+
+INSERT INTO t8 VALUES (58,58);
+INSERT INTO t8 VALUES (59,59);
+INSERT INTO t8 VALUES (60,60);
+INSERT INTO t8 VALUES (61,61);
+
+UPDATE t7 SET b=62 WHERE a=3;
+
+INSERT INTO t8 VALUES (63,63);
+INSERT INTO t8 VALUES (64,64);
+INSERT INTO t8 VALUES (65,65);
+INSERT INTO t8 VALUES (66,66);
+
+UPDATE t7 SET b=67 WHERE a=3;
+
+INSERT INTO t8 VALUES (68,68);
+
+UPDATE t7 SET b=69 WHERE a=3;
+UPDATE t7 SET b=70 WHERE a=3;
+UPDATE t7 SET b=71 WHERE a=3;
+
+INSERT INTO t8 VALUES (72,72);
+
+UPDATE t7 SET b=73 WHERE a=3;
+UPDATE t7 SET b=74 WHERE a=3;
+UPDATE t7 SET b=75 WHERE a=3;
+UPDATE t7 SET b=76 WHERE a=3;
+
+INSERT INTO t8 VALUES (77,77);
+
+UPDATE t7 SET b=78 WHERE a=3;
+
+INSERT INTO t8 VALUES (79,79);
+
+UPDATE t7 SET b=80 WHERE a=3;
+
+INSERT INTO t8 VALUES (81,81);
+
+UPDATE t7 SET b=82 WHERE a=3;
+
+INSERT INTO t8 VALUES (83,83);
+
+UPDATE t7 SET b=84 WHERE a=3;
+
+
+SET @commit_id=45;
+INSERT INTO t8 VALUES (85,85);
+UPDATE t7 SET b=86 WHERE a=3;
+INSERT INTO t8 VALUES (87,87);
+
+
+SET @commit_id=46;
+INSERT INTO t8 VALUES (88,88);
+INSERT INTO t8 VALUES (89,89);
+INSERT INTO t8 VALUES (90,90);
+
+SET SESSION debug_dbug=@old_dbug;
+
+INSERT INTO t8 VALUES (91,91);
+INSERT INTO t8 VALUES (92,92);
+INSERT INTO t8 VALUES (93,93);
+INSERT INTO t8 VALUES (94,94);
+INSERT INTO t8 VALUES (95,95);
+INSERT INTO t8 VALUES (96,96);
+INSERT INTO t8 VALUES (97,97);
+INSERT INTO t8 VALUES (98,98);
+INSERT INTO t8 VALUES (99,99);
+
+
+SELECT * FROM t7 ORDER BY a;
+SELECT * FROM t8 ORDER BY a;
+--source include/save_master_gtid.inc
+
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t7 ORDER BY a;
+SELECT * FROM t8 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL slave_transaction_retries= @old_retries;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+
+--connection server_1
+# Inject two group commits. The bug was that ANALYZE TABLE would call
+# wakeup_subsequent_commits() too early, allowing the following transaction
+# in the same group to run ahead and binlog and free the GCO. Then we get
+# wrong binlog order and later access freed GCO, which causes lost wakeup
+# of following GCO and thus replication hang.
+# We injected a small sleep in ANALYZE to make the race easier to hit (this
+# can only cause false negatives in versions with the bug, not false positives,
+# so sleep is ok here. And it's in general not possible to trigger reliably
+# the race with debug_sync, since the bugfix makes the race impossible).
+
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+# Group commit with cid=10000, two event groups.
+SET @commit_id= 10000;
+ANALYZE TABLE t2;
+INSERT INTO t3 VALUES (120, 0);
+
+# Group commit with cid=10001, one event group.
+SET @commit_id= 10001;
+INSERT INTO t3 VALUES (121, 0);
+
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+
+--connection server_1
+# Inject two group commits. The bug was that record_gtid for a
+# non-transactional event group would commit its own transaction, which would
+# cause ha_commit_trans() to call wakeup_subsequent_commits() too early. This
+# in turn lead to access to freed group_commit_orderer object, losing a wakeup
+# and causing slave threads to hang.
+# We inject a small sleep in the corresponding record_gtid() to make the race
+# easier to hit.
+
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+# Group commit with cid=10010, two event groups.
+SET @old_server_id= @@SESSION.server_id;
+SET SESSION server_id= 100;
+SET @commit_id= 10010;
+ALTER TABLE t1 COMMENT "Hulubulu!";
+SET SESSION server_id= @old_server_id;
+INSERT INTO t3 VALUES (130, 0);
+
+# Group commit with cid=10011, one event group.
+SET @commit_id= 10011;
+INSERT INTO t3 VALUES (131, 0);
+
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) ***
+
+--connection server_1
+INSERT INTO t3 VALUES (201,0), (202,0);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_mdev8031';
+
+--connection server_1
+# We artificially create a situation that hopefully resembles the original
+# bug which was only seen "in the wild", and only once.
+# Setup a fake group commit with lots of conflicts that will lead to deadloc
+# kill. The slave DBUG injection causes the slave to be deadlock killed at
+# a particular point during the retry, and then later do a small sleep at
+# another critical point where the prior transaction then has a chance to
+# complete. Finally an extra KILL check catches an unhandled, lingering
+# deadlock kill. So rather artificial, but at least it exercises the
+# relevant code paths.
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+SET @commit_id= 10200;
+INSERT INTO t3 VALUES (203, 1);
+INSERT INTO t3 VALUES (204, 1);
+INSERT INTO t3 VALUES (205, 1);
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=205;
+UPDATE t3 SET b=b+1 WHERE a=205;
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** Check getting deadlock killed inside open_binlog() during retry. ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
+SET @old_max= @@GLOBAL.max_relay_log_size;
+SET GLOBAL max_relay_log_size= 4096;
+
+--connection server_1
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+--let $large= `SELECT REPEAT("*", 8192)`
+SET @commit_id= 10210;
+--echo Omit long queries that cause relaylog rotations and transaction retries...
+--disable_query_log
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
+--enable_query_log
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debg;
+SET GLOBAL max_relay_log_size= @old_max;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-8302: Duplicate key with parallel replication ***
+
+--connection server_2
+--source include/stop_slave.inc
+/* Inject a small sleep which makes the race easier to hit. */
+SET @old_dbug=@@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,inject_mdev8302";
+
+
+--connection server_1
+INSERT INTO t7 VALUES (100,1), (101,2), (102,3), (103,4), (104,5);
+
+# Artificially create a bunch of group commits with conflicting transactions.
+# The bug happened when T1 and T2 was in one group commit, and T3 was in the
+# following group commit. T2 is a DELETE of a row with same primary key as a
+# row that T3 inserts. T1 and T2 can conflict, causing T2 to be deadlock
+# killed after starting to commit. The bug was that T2 could roll back before
+# doing unmark_start_commit(); this could allow T3 to run before the retry
+# of T2, causing duplicate key violation.
+
+SET @old_dbug= @@SESSION.debug_dbug;
+SET @commit_id= 20000;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+--let $n = 100
+--disable_query_log
+while ($n)
+{
+ eval UPDATE t7 SET b=b+1 WHERE a=100+($n MOD 5);
+ eval DELETE FROM t7 WHERE a=100+($n MOD 5);
+
+ SET @commit_id = @commit_id + 1;
+ eval INSERT INTO t7 VALUES (100+($n MOD 5), $n);
+ SET @commit_id = @commit_id + 1;
+ dec $n;
+}
+--enable_query_log
+SET SESSION debug_dbug=@old_dbug;
+
+
+SELECT * FROM t7 ORDER BY a;
+--source include/save_master_gtid.inc
+
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t7 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+--source include/start_slave.inc
+
+
+
+--echo *** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
+--connection server_1
+# Inject an event group terminated by ROLLBACK, by mixing MyISAM and InnoDB
+# in a transaction. The bug was an assertion on the ROLLBACK due to
+# mark_start_commit() being already called.
+--disable_warnings
+BEGIN;
+INSERT INTO t2 VALUES (2000);
+INSERT INTO t1 VALUES (2000);
+INSERT INTO t2 VALUES (2001);
+ROLLBACK;
+--enable_warnings
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
+
+
+# Clean up.
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+SET DEBUG_SYNC= 'RESET';
+
+--connection server_1
+DROP function foo;
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
+SET DEBUG_SYNC= 'RESET';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc b/mysql-test/extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc
new file mode 100644
index 00000000000..9cbcf01f46b
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc
@@ -0,0 +1,40 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
+#
+# The function mysql_show_binlog_events has a local stack variable
+# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
+# this variable goes out of scope and is destroyed before clean
+# thd->current_linfo.
+#
+# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
+# that with the fix local variable linfo is valid along all
+# mysql_show_binlog_events function scope.
+#
+--source include/have_debug_sync.inc
+--source include/master-slave.inc
+
+--echo [connection slave]
+--connection slave
+SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
+--send SHOW BINLOG EVENTS
+
+--connection slave1
+--echo [connection slave1]
+SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
+FLUSH LOGS;
+SET DEBUG_SYNC= 'now SIGNAL end';
+
+--echo [connection slave]
+--connection slave
+--disable_result_log
+--reap
+--enable_result_log
+SET DEBUG_SYNC= 'RESET';
+
+--connection master
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_partition.test b/mysql-test/extra/rpl_tests/rpl_partition.test
index 8f2956bf1ef..119e3bebc42 100644
--- a/mysql-test/extra/rpl_tests/rpl_partition.test
+++ b/mysql-test/extra/rpl_tests/rpl_partition.test
@@ -201,11 +201,11 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
PARTITION BY KEY()
PARTITIONS 4;
---echo --- Show that tables on master are ndbcluster tables ---
+--echo --- Show tables on master ---
SHOW CREATE TABLE t1;
---echo --- Show that tables on slave ---
+--echo --- Show tables on slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/extra/rpl_tests/rpl_relayrotate.inc b/mysql-test/extra/rpl_tests/rpl_relayrotate.inc
new file mode 100644
index 00000000000..ce638e419ff
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_relayrotate.inc
@@ -0,0 +1,18 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#######################################################
+# Wrapper for rpl_relayrotate.test to allow multi #
+# Engines to reuse test code. By JBM 2006-02-15 #
+#######################################################
+-- source include/have_innodb.inc
+# Slow test, don't run during staging part
+-- source include/not_staging.inc
+-- source include/master-slave.inc
+
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_relayrotate.test
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_blob.test b/mysql-test/extra/rpl_tests/rpl_row_blob.test
index 762daa816c0..5cd7b6b4b29 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_blob.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_blob.test
@@ -36,7 +36,6 @@ SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
save_master_pos;
connection slave;
sync_with_master;
---source include/wait_for_ndb_to_binlog.inc
--echo
--echo **** Data Insert Validation Slave Section test.t1 ****
--echo
@@ -59,7 +58,6 @@ SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
save_master_pos;
connection slave;
sync_with_master;
---source include/wait_for_ndb_to_binlog.inc
--echo
--echo **** Data Update Validation Slave Section test.t1 ****
--echo
@@ -130,7 +128,6 @@ FROM test.t2 WHERE c1=2;
save_master_pos;
connection slave;
sync_with_master;
---source include/wait_for_ndb_to_binlog.inc
--echo
--echo **** Data Insert Validation Slave Section test.t2 ****
--echo
@@ -156,7 +153,6 @@ FROM test.t2 WHERE c1=2;
save_master_pos;
connection slave;
sync_with_master;
---source include/wait_for_ndb_to_binlog.inc
--echo
--echo **** Data Update Validation Slave Section test.t2 ****
--echo
@@ -176,8 +172,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql $MYSQLTEST_VARDIR/tmp/r
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
# ensure cleanup on slave as well:
-# ndb blob tables consist of several tables
-# if cluster is shutdown while not all tables are
-# properly dropped, the table becomes inconsistent
-# and wrecks later test cases
--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_row_func003.test b/mysql-test/extra/rpl_tests/rpl_row_func003.test
index d12b5a3306a..f46f9eddc60 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_func003.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_func003.test
@@ -54,11 +54,8 @@ INSERT INTO test.t1 VALUES (null,test.f1());
ROLLBACK;
SET AUTOCOMMIT=1;
-# Sync master and slave for all engines except NDB
-if (`SELECT UPPER(LEFT('$engine_type', 3)) != 'NDB'`) {
sync_slave_with_master;
connection master;
-}
# Time to dump the databases and so we can see if they match
diff --git a/mysql-test/extra/rpl_tests/rpl_row_img.test b/mysql-test/extra/rpl_tests/rpl_row_img.test
new file mode 100644
index 00000000000..b905b81c4c6
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_img.test
@@ -0,0 +1,241 @@
+# WL#5096
+#
+# Description
+# ===========
+#
+# This test case checks replication between hosts with same index
+# structure but may differ on engines.
+#
+# Usage
+# =====
+#
+# Before including this file the following variables should be set:
+# * $server_1_engine
+# * $server_2_engine
+# * $server_3_engine
+#
+# Example:
+#
+# -- let $server_1_engine= Falcon
+# -- let $server_2_engine= MyISAM
+# -- let $server_3_engine= InnoDB
+#
+# -- source extra/rpl_tests/rpl_row_img.test
+#
+
+-- connection server_1
+
+-- let $diff_table=test.t
+
+let $i= 12;
+while($i)
+{
+ let $step= "";
+
+ -- connection server_1
+ SET SQL_LOG_BIN=0;
+
+ -- connection server_2
+ SET SQL_LOG_BIN=0;
+
+ -- connection server_3
+ SET SQL_LOG_BIN=0;
+
+ if ($i == 1) {
+ let $step= No keys;
+ --echo ******* TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_3_engine;
+
+ }
+ if ($i == 2)
+ {
+ let $step= One key;
+ --echo ******* TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_3_engine;
+
+ }
+ if ($i == 3)
+ {
+ let $step= One Composite key;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_3_engine;
+ }
+ if ($i == 4)
+ {
+ let $step= One Unique key;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_3_engine;
+
+ }
+ if ($i == 5)
+ {
+ let $step= One Composite Unique key;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_3_engine;
+
+ }
+ if ($i == 6)
+ {
+ let $step= One Primary key;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_3_engine;
+ }
+ if ($i == 7)
+ {
+ let $step= One Composite Primary Key;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_3_engine;
+ }
+ if ($i == 8)
+ {
+ let $step= One Composite key with holes;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_3_engine;
+ }
+ if ($i == 9)
+ {
+ let $step= One Composite Unique key with holes;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
+ }
+ if ($i == 10)
+ {
+ let $step= One Composite Primary Key with holes;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_3_engine;
+ }
+ if ($i == 11)
+ {
+ let $step= One Composite NOT NULL Unique key with holes;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
+ }
+ if ($i == 12)
+ {
+ let $step= One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave;
+ --echo ****** TEST: $step
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
+ }
+
+ -- connection server_1
+ SET SQL_LOG_BIN=1;
+
+ -- connection server_2
+ SET SQL_LOG_BIN=1;
+
+ -- connection server_3
+ SET SQL_LOG_BIN=1;
+
+ -- connection server_1
+ INSERT INTO t VALUES (1, '1', '1', '1' );
+ INSERT INTO t VALUES (4, '4', '4', '4' );
+ INSERT INTO t VALUES (7, '7', '7', '7' );
+
+ INSERT INTO t VALUES (9, '9', '9', NULL );
+
+ INSERT INTO t VALUES (2, '1', '2', '2' );
+ INSERT INTO t VALUES (3, '1', '3', '2' );
+
+ -- source include/rpl_sync.inc
+
+ -- connection server_1
+ UPDATE t SET c4 = '7';
+
+ UPDATE t SET c4 = '5' WHERE c1 = 1;
+ UPDATE t SET c2 = '5' WHERE c1 = 1;
+ UPDATE t SET c1 = '5' WHERE c1 = 1;
+
+ UPDATE t SET c4 = '8' WHERE c2 = '4';
+ UPDATE t SET c1 = '8' WHERE c2 = '4';
+ UPDATE t SET c2 = '8' WHERE c2 = '4';
+
+ UPDATE t SET c3 = '0' WHERE c4 = NULL;
+ UPDATE t SET c2 = '0' WHERE c4 = '0';
+
+ UPDATE t SET c2 = '2' WHERE c4 = '2';
+
+ -- source include/rpl_sync.inc
+
+ -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
+ -- source include/diff_tables.inc
+
+
+ -- connection server_1
+
+ DELETE FROM t WHERE c1 = 7;
+ DELETE FROM t WHERE c1 = 8;
+ DELETE FROM t;
+
+ -- source include/rpl_sync.inc
+
+ -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
+ -- source include/diff_tables.inc
+
+ -- connection server_1
+
+ DROP TABLE t;
+
+ -- source include/rpl_sync.inc
+
+ dec $i;
+}
diff --git a/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test b/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test
new file mode 100644
index 00000000000..9d3a0a593e3
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test
@@ -0,0 +1,179 @@
+# WL#5096
+#
+# Description
+# ===========
+#
+# This test case covers Requirements for replication using different
+# combinations of indexes and blob fields.
+#
+# It acts as a complement for rpl_row_img_sanity tests as it checks
+# that in a chained replication scenario, replication does not break.
+#
+# Usage
+# =====
+#
+# Before including this file the following variables should be set:
+# * $server_1_engine
+# * $server_2_engine
+# * $server_3_engine
+#
+# Example:
+#
+# -- let $server_1_engine= Falcon
+# -- let $server_2_engine= MyISAM
+# -- let $server_3_engine= InnoDB
+#
+# -- source extra/rpl_tests/rpl_row_img_blobs.test
+#
+
+-- connection server_1
+
+-- let $diff_table=test.t
+let $i= 7;
+while($i)
+{
+ -- connection server_1
+ SET SQL_LOG_BIN=0;
+
+ -- connection server_2
+ SET SQL_LOG_BIN=0;
+
+ -- connection server_3
+ SET SQL_LOG_BIN=0;
+
+ #
+ # The comments below (on create table) must be read with the SQL
+ # instructions issued later in mind. Declaring a table obviously is
+ # not enough to assert anything.
+ #
+ # Also, the tests in this file make more sense when performed with
+ # binlog_row_image configured as NOBLOB.
+ #
+
+ if ($i == 1) {
+ -- echo ### Asserts that declaring a blob as part of a primary key does not break replication
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_3_engine;
+ }
+ if ($i == 2)
+ {
+ -- echo ### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_3_engine;
+ }
+ if ($i == 3)
+ {
+ -- echo ### Asserts that declaring a blob in a key does not break replication
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_3_engine;
+
+ }
+ if ($i == 4) {
+ -- echo ### Asserts that updates without blobs in the BI (PK exists int the table)
+ -- echo ### will not break replication
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_3_engine;
+
+ }
+ if ($i == 5)
+ {
+ -- echo ### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+ -- echo ### will not break replication
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_3_engine;
+
+ }
+ if ($i == 6)
+ {
+ -- echo ### Asserts that updates without blobs in the AI (they are not updated)
+ -- echo ### will not break replication (check even if there is a key in the table)
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_3_engine;
+
+ }
+ if ($i == 7)
+ {
+ -- echo ### Asserts that updates without blobs in the AI (they are not updated)
+ -- echo ### will not break replication (check when there is no key in the table)
+ -- connection server_1
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_1_engine;
+ -- connection server_2
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_2_engine;
+ -- connection server_3
+ --eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_3_engine;
+ }
+
+ -- connection server_1
+ SET SQL_LOG_BIN=1;
+
+ -- connection server_2
+ SET SQL_LOG_BIN=1;
+
+ -- connection server_3
+ SET SQL_LOG_BIN=1;
+
+ -- connection server_1
+
+ -- let $blob1= "a"
+ -- let $blob2= "b"
+ -- let $blob3= "c"
+
+ -- eval INSERT INTO t VALUES (1, $blob1, 10)
+ -- eval INSERT INTO t VALUES (2, $blob2, 20)
+ -- eval INSERT INTO t VALUES (3, $blob3, 30)
+
+ -- source include/rpl_sync.inc
+
+ -- connection server_1
+ -- eval UPDATE t SET c1=10 WHERE c2=$blob1
+ -- eval UPDATE t SET c1=20 WHERE c1=2
+ -- eval UPDATE t SET c1=30 WHERE c3=30
+ -- eval UPDATE t SET c3=40 WHERE c1=30
+
+ -- source include/rpl_sync.inc
+
+ -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
+ -- source include/diff_tables.inc
+
+ -- connection server_1
+ -- eval DELETE FROM t WHERE c2=$blob1
+ -- eval DELETE FROM t WHERE c1=20
+ -- eval DELETE FROM t
+
+ -- source include/rpl_sync.inc
+
+ -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
+ -- source include/diff_tables.inc
+
+ -- connection server_1
+
+ DROP TABLE t;
+
+ -- source include/rpl_sync.inc
+
+ dec $i;
+}
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
index d2c2ea0caf3..a8f25485f26 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
@@ -53,8 +53,6 @@ SELECT release_lock("test");
connection master;
SELECT * FROM test.t1;
-#show binlog events;
---source include/wait_for_ndb_to_binlog.inc
sync_slave_with_master;
connection slave;
SELECT * FROM test.t1;
diff --git a/mysql-test/extra/rpl_tests/rpl_semi_sync.inc b/mysql-test/extra/rpl_tests/rpl_semi_sync.inc
new file mode 100644
index 00000000000..456a750e89f
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_semi_sync.inc
@@ -0,0 +1,580 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/have_semisync.inc;
+source include/not_embedded.inc;
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+let $engine_type= InnoDB;
+#let $engine_type= MyISAM;
+
+# Suppress warnings that might be generated during the test
+connection master;
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Read semi-sync reply");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+connection slave;
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
+
+# wait for dying connections (if any) to disappear
+let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
+--source include/wait_condition.inc
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master, save the count of connections before start
+# semi-sync slave for comparison below.
+let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+
+--echo #
+--echo # Uninstall semi-sync plugins on master and slave
+--echo #
+connection slave;
+source include/stop_slave.inc;
+reset slave;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+
+connection master;
+reset master;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+
+--echo #
+--echo # Main test of semi-sync replication start here
+--echo #
+
+connection master;
+echo [ on master ];
+
+set global rpl_semi_sync_master_timeout= 60000; # 60s
+
+echo [ default state of semi-sync on master should be OFF ];
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ enable semi-sync on master ];
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+--echo # BUG#45673 Semisynch reports correct operation even if no slave is connected
+--echo #
+
+# BUG#45672 When semi-sync is enabled on master, it would allocate
+# transaction node even without semi-sync slave connected, and would
+# finally result in transaction node allocation error.
+#
+# Semi-sync master will pre-allocate 'max_connections' transaction
+# nodes, so here we do more than that much transactions to check if it
+# will fail or not.
+# select @@global.max_connections + 1;
+let $i= `select @@global.max_connections + 1`;
+disable_query_log;
+eval create table t1 (a int) engine=$engine_type;
+while ($i)
+{
+ eval insert into t1 values ($i);
+ dec $i;
+}
+drop table t1;
+enable_query_log;
+
+# BUG#45673
+echo [ status of semi-sync on master should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# reset master to make sure the following test will start with a clean environment
+reset master;
+
+connection slave;
+echo [ on slave ];
+
+echo [ default state of semi-sync on slave should be OFF ];
+show variables like 'rpl_semi_sync_slave_enabled';
+
+echo [ enable semi-sync on slave ];
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+
+# NOTE: Rpl_semi_sync_master_client will only be updated when
+# semi-sync slave has started binlog dump request
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+echo [ initial master state after the semi-sync slave connected ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1(a int) engine = $engine_type;
+
+echo [ master state after CREATE TABLE statement ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master.
+let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
+eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
+
+echo [ insert records to table ];
+insert t1 values (10);
+insert t1 values (9);
+insert t1 values (8);
+insert t1 values (7);
+insert t1 values (6);
+insert t1 values (5);
+insert t1 values (4);
+insert t1 values (3);
+insert t1 values (2);
+insert t1 values (1);
+
+echo [ master status after inserts ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+sync_slave_with_master;
+echo [ on slave ];
+
+echo [ slave status after replicated inserts ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+--echo
+--echo # BUG#50157
+--echo # semi-sync replication crashes when replicating a transaction which
+--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
+
+connection master;
+echo [ on master ];
+SET SESSION AUTOCOMMIT= 0;
+CREATE TABLE t2(c1 INT) ENGINE=innodb;
+sync_slave_with_master;
+
+connection master;
+BEGIN;
+--echo
+--echo # Even though it is in a transaction, this statement is binlogged into binlog
+--echo # file immediately.
+--disable_warnings
+CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
+--enable_warnings
+--echo
+--echo # These statements will not be binlogged until the transaction is committed
+INSERT INTO t2 VALUES(11);
+INSERT INTO t2 VALUES(22);
+COMMIT;
+
+DROP TABLE t2, t3;
+SET SESSION AUTOCOMMIT= 1;
+sync_slave_with_master;
+
+
+--echo #
+--echo # Test semi-sync master will switch OFF after one transaction
+--echo # timeout waiting for slave reply.
+--echo #
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+echo [ on master ];
+set global rpl_semi_sync_master_timeout= 5000;
+
+# The first semi-sync check should be on because after slave stop,
+# there are no transactions on the master.
+echo [ master status should be ON ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+show status like 'Rpl_semi_sync_master_clients';
+
+echo [ semi-sync replication of these transactions will fail ];
+insert into t1 values (500);
+
+# Wait for the semi-sync replication of this transaction to timeout
+let $status_var= Rpl_semi_sync_master_status;
+let $status_var_value= OFF;
+source include/wait_for_status_var.inc;
+
+# The second semi-sync check should be off because one transaction
+# times out during waiting.
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# Semi-sync status on master is now OFF, so all these transactions
+# will be replicated asynchronously.
+delete from t1 where a=10;
+delete from t1 where a=9;
+delete from t1 where a=8;
+delete from t1 where a=7;
+delete from t1 where a=6;
+delete from t1 where a=5;
+delete from t1 where a=4;
+delete from t1 where a=3;
+delete from t1 where a=2;
+delete from t1 where a=1;
+
+insert into t1 values (100);
+
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync status on master will be ON again when slave catches up
+--echo #
+
+# Save the master position for later use.
+save_master_pos;
+
+connection slave;
+echo [ on slave ];
+
+echo [ slave status should be OFF ];
+show status like 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+sync_with_master;
+
+echo [ slave status should be ON ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+connection master;
+echo [ on master ];
+
+# The master semi-sync status should be on again after slave catches up.
+echo [ master status should be ON again after slave catches up ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo #
+--echo # Test disable/enable master semi-sync on the fly.
+--echo #
+
+drop table t1;
+sync_slave_with_master;
+echo [ on slave ];
+
+source include/stop_slave.inc;
+
+--echo #
+--echo # Flush status
+--echo #
+connection master;
+echo [ Semi-sync master status variables before FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+# Do not write the FLUSH STATUS to binlog, to make sure we'll get a
+# clean status after this.
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+echo [ Semi-sync master status variables after FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+
+connection master;
+echo [ on master ];
+
+source include/show_master_logs.inc;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ disable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+echo [ enable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+--echo #
+--echo # Test RESET MASTER/SLAVE
+--echo #
+
+connection slave;
+echo [ on slave ];
+
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+drop table t1;
+
+##show status like 'Rpl_semi_sync_master_status';
+
+sync_slave_with_master;
+--replace_column 2 #
+show status like 'Rpl_relay%';
+
+echo [ test reset master ];
+connection master;
+echo [ on master];
+
+reset master;
+
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+connection slave;
+echo [ on slave ];
+
+source include/stop_slave.inc;
+reset slave;
+
+# Kill the dump thread on master for previous slave connection and
+# wait for it to exit
+connection master;
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ --replace_result $_tid _tid
+ eval kill query $_tid;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+
+# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
+# 1 after dump thread started.
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+
+sync_slave_with_master;
+echo [ on slave ];
+
+select * from t1;
+
+connection master;
+echo [ on master ];
+
+echo [ master semi-sync status should be ON ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Start semi-sync replication without SUPER privilege
+--echo #
+connection slave;
+source include/stop_slave.inc;
+reset slave;
+connection master;
+echo [ on master ];
+reset master;
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ --replace_result $_tid _tid
+ eval kill query $_tid;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+# Do not binlog the following statement because it will generate
+# different events for ROW and STATEMENT format
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+set sql_log_bin=1;
+connection slave;
+echo [ on slave ];
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+change master to master_user='rpl',master_password='rpl_password';
+source include/start_slave.inc;
+show status like 'Rpl_semi_sync_slave_status';
+connection master;
+echo [ on master ];
+
+# Wait for the semi-sync binlog dump thread to start
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+insert into t1 values (4);
+insert into t1 values (5);
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync slave connect to non-semi-sync master
+--echo #
+
+# Disable semi-sync on master
+connection slave;
+echo [ on slave ];
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+connection master;
+echo [ on master ];
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ --replace_result $_tid _tid
+ eval kill query $_tid;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+echo [ Semi-sync status on master should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+echo [ on slave ];
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+connection master;
+echo [ on master ];
+insert into t1 values (8);
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync clients should be 1, status should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+sync_slave_with_master;
+echo [ on slave ];
+show status like 'Rpl_semi_sync_slave_status';
+
+# Uninstall semi-sync plugin on master
+connection slave;
+source include/stop_slave.inc;
+connection master;
+echo [ on master ];
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+echo [ on slave ];
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+insert into t1 values (10);
+sync_slave_with_master;
+
+--echo #
+--echo # Test non-semi-sync slave connect to semi-sync master
+--echo #
+
+connection master;
+set global rpl_semi_sync_master_timeout= 5000; # 5s
+set global rpl_semi_sync_master_enabled= 1;
+
+connection slave;
+echo [ on slave ];
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+echo [ uninstall semi-sync slave plugin ];
+set global rpl_semi_sync_slave_enabled= 0;
+
+echo [ reinstall semi-sync slave plugin and disable semi-sync ];
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+--echo #
+--echo # Clean up
+--echo #
+
+connection slave;
+source include/stop_slave.inc;
+set global rpl_semi_sync_slave_enabled= 0;
+
+connection master;
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+change master to master_user='root',master_password='';
+source include/start_slave.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+connection master;
+drop user rpl@127.0.0.1;
+flush privileges;
+set global rpl_semi_sync_master_timeout= default;
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_skip_replication.inc b/mysql-test/extra/rpl_tests/rpl_skip_replication.inc
new file mode 100644
index 00000000000..ac0beef414d
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_skip_replication.inc
@@ -0,0 +1,402 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it.
+#
+# Usage:
+#
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --source extra/rpl_tests/rpl_skip_replication.inc
+#
+# The script uses MYSQLBINLOG to verify certain results.
+# By default, it uses binary logs directly. If it is undesirable,
+# this behavior can be overridden by setting $use_remote_binlog
+# as shown above.
+# The value will be unset after every execution of the script,
+# so if it is needed, it should be set explicitly before each call.
+#
+
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+connection slave;
+# Test that SUPER is required to change @@replicate_events_marked_for_skip.
+CREATE USER 'nonsuperuser'@'127.0.0.1';
+GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
+ SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
+connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,);
+connection nonpriv;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+disconnect nonpriv;
+connection slave;
+DROP USER'nonsuperuser'@'127.0.0.1';
+
+SELECT @@global.replicate_events_marked_for_skip;
+--error ER_SLAVE_MUST_STOP
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+SELECT @@global.replicate_events_marked_for_skip;
+STOP SLAVE;
+--error ER_GLOBAL_VARIABLE
+SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
+SELECT @@global.replicate_events_marked_for_skip;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+SELECT @@global.replicate_events_marked_for_skip;
+START SLAVE;
+
+connection master;
+SELECT @@skip_replication;
+--error ER_LOCAL_VARIABLE
+SET GLOBAL skip_replication=1;
+SELECT @@skip_replication;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb;
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t2(a) VALUES (1);
+
+
+# Test that master-side filtering works.
+SET skip_replication=1;
+
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (2);
+INSERT INTO t2(a) VALUES (2);
+
+# Inject a rotate event in the binlog stream sent to slave (otherwise we will
+# fail sync_slave_with_master as the last event on the master is not present
+# on the slave).
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+
+sync_slave_with_master;
+connection slave;
+SHOW TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t3;
+
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+sync_slave_with_master;
+
+
+# Test that slave-side filtering works.
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+
+connection master;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (3);
+INSERT INTO t2(a) VALUES (3);
+
+# Inject a rotate event in the binlog stream sent to slave (otherwise we will
+# fail sync_slave_with_master as the last event on the master is not present
+# on the slave).
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+
+sync_slave_with_master;
+connection slave;
+SHOW TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t3;
+
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+
+
+# Test that events with @@skip_replication=1 are not filtered when filtering is
+# not set on slave.
+connection master;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t3(a) VALUES(2);
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t3;
+connection master;
+DROP TABLE t3;
+
+#
+# Test that the slave will preserve the @@skip_replication flag in its
+# own binlog.
+#
+
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+RESET MASTER;
+
+connection master;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,0);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,0);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,0);
+
+sync_slave_with_master;
+connection slave;
+# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have
+# applied all events.
+SELECT * FROM t1 ORDER by a;
+
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+let $SLAVE_DATADIR= `select @@datadir`;
+
+connection master;
+TRUNCATE t1;
+
+# Now apply the slave binlog to the master, to check that both the slave
+# and mysqlbinlog will preserve the @@skip_replication flag.
+
+--let $mysqlbinlog_args= $SLAVE_DATADIR/slave-bin.000001
+if ($use_remote_mysqlbinlog)
+{
+ --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$SLAVE_MYPORT -uroot slave-bin.000001
+ --let $use_remote_mysqlbinlog= 0
+}
+--exec $MYSQL_BINLOG $mysqlbinlog_args > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
+
+# The master should have all three events.
+SELECT * FROM t1 ORDER by a;
+
+# The slave should be missing event 2, which is marked with the
+# @@skip_replication flag.
+
+connection slave;
+START SLAVE;
+
+connection master;
+sync_slave_with_master;
+
+connection slave;
+SELECT * FROM t1 ORDER by a;
+
+#
+# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication
+# events.
+#
+
+connection master;
+TRUNCATE t1;
+
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+# We will skip two INSERTs (in addition to any skipped due to
+# @@skip_replication). Since from 5.5 every statement is wrapped in
+# BEGIN ... END, we need to skip 6 events for this.
+SET GLOBAL sql_slave_skip_counter=6;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+
+connection master;
+# Need to fix @@binlog_format to get consistent event count.
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= statement;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,5);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,5);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,5);
+INSERT INTO t1 VALUES (4,5);
+SET binlog_format= @old_binlog_format;
+
+sync_slave_with_master;
+connection slave;
+
+# The slave should have skipped the first three inserts (number 1 and 3 due
+# to @@sql_slave_skip_counter=2, number 2 due to
+# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4
+# should be left.
+SELECT * FROM t1;
+
+
+#
+# Check that BINLOG statement preserves the @@skip_replication flag.
+#
+connection slave;
+# Need row @@binlog_format for BINLOG statements containing row events.
+--source include/stop_slave.inc
+SET @old_slave_binlog_format= @@global.binlog_format;
+SET GLOBAL binlog_format= row;
+--source include/start_slave.inc
+
+connection master;
+TRUNCATE t1;
+
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= row;
+# Format description log event.
+BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAA371saA==';
+# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1
+BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA=';
+# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0
+BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
+SET binlog_format= @old_binlog_format;
+
+SELECT * FROM t1 ORDER BY a;
+sync_slave_with_master;
+connection slave;
+# Slave should have only the second insert, the first should be ignored due to
+# the @@skip_replication flag.
+SELECT * FROM t1 ORDER by a;
+
+--source include/stop_slave.inc
+SET GLOBAL binlog_format= @old_slave_binlog_format;
+--source include/start_slave.inc
+
+
+# Test that it is not possible to change @@skip_replication inside a
+# transaction or statement, thereby replicating only parts of statements
+# or transactions.
+connection master;
+SET skip_replication=0;
+
+BEGIN;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=0;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+ROLLBACK;
+SET skip_replication=1;
+BEGIN;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=0;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+COMMIT;
+SET autocommit=0;
+INSERT INTO t2(a) VALUES(100);
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+ROLLBACK;
+SET autocommit=1;
+
+SET skip_replication=1;
+--delimiter |
+CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END|
+CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END|
+CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END|
+--delimiter ;
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SELECT foo(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SELECT baz(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET @a= foo(1);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET @a= baz(1);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+UPDATE t2 SET b=foo(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+UPDATE t2 SET b=baz(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+INSERT INTO t1 VALUES (101, foo(1));
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+INSERT INTO t1 VALUES (101, baz(0));
+SELECT @@skip_replication;
+CALL bar(0);
+SELECT @@skip_replication;
+CALL bar(1);
+SELECT @@skip_replication;
+DROP FUNCTION foo;
+DROP PROCEDURE bar;
+DROP FUNCTION baz;
+
+
+# Test that master-side filtering happens on the master side, and that
+# slave-side filtering happens on the slave.
+
+# First test that events do not reach the slave when master-side filtering
+# is configured. Do this by replicating first with only the IO thread running
+# and master-side filtering; then change to no filtering and start the SQL
+# thread. This should still skip the events, as master-side filtering
+# means the events never reached the slave.
+connection master;
+SET skip_replication= 0;
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+START SLAVE IO_THREAD;
+connection master;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+--source include/save_master_pos.inc
+connection slave;
+--source include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+connection master;
+sync_slave_with_master;
+connection slave;
+# Now only the second insert of (2) should be visible, as the first was
+# filtered on the master, so even though the SQL thread ran without skipping
+# events, it will never see the event in the first place.
+SELECT * FROM t1;
+
+# Now tests that when slave-side filtering is configured, events _do_ reach
+# the slave.
+connection master;
+SET skip_replication= 0;
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE IO_THREAD;
+connection master;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+--source include/save_master_pos.inc
+connection slave;
+--source include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+connection master;
+sync_slave_with_master;
+connection slave;
+# Now both inserts should be visible. Since filtering was configured to be
+# slave-side, the event is in the relay log, and when the SQL thread ran we
+# had disabled filtering again.
+SELECT * FROM t1 ORDER BY a;
+
+
+# Clean up.
+connection master;
+SET skip_replication=0;
+DROP TABLE t1,t2;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_special_charset.inc b/mysql-test/extra/rpl_tests/rpl_special_charset.inc
new file mode 100644
index 00000000000..641aa483d32
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_special_charset.inc
@@ -0,0 +1,32 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+################################################################################
+# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
+# Problem: IO thread fails to connect to master if servers are configured with
+# special character sets like utf16, utf32, ucs2.
+#
+# Analysis: MySQL server does not support few special character sets like
+# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
+# When IO thread is trying to connect to Master, it sets server's character
+# set as client's character set. When Slave server is started with these
+# special character sets, IO thread (a connection to Master) fails because
+# of the above said reason.
+#
+# Fix: If server's character set is not supported as client's character set,
+# then set default's client character set(latin1) as client's character set.
+###############################################################################
+--source include/master-slave.inc
+call mtr.add_suppression("'utf16' can not be used as client character set");
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+--sync_slave_with_master
+--let diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_sporadic_master.inc b/mysql-test/extra/rpl_tests/rpl_sporadic_master.inc
new file mode 100644
index 00000000000..ad4c44cbf74
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_sporadic_master.inc
@@ -0,0 +1,32 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# test to see if replication can continue when master sporadically fails on
+# COM_BINLOG_DUMP and additionally limits the number of events per dump
+
+source include/master-slave.inc;
+
+create table t2(n int);
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (NULL),(NULL);
+truncate table t1;
+# We have to use 4 in the following to make this test work with all table types
+insert into t1 values (4),(NULL);
+sync_slave_with_master;
+--source include/stop_slave.inc
+--source include/start_slave.inc
+connection master;
+insert into t1 values (NULL),(NULL);
+flush logs;
+truncate table t1;
+insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
+sync_slave_with_master;
+select * from t1 ORDER BY n;
+connection master;
+drop table t1,t2;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_ssl.inc b/mysql-test/extra/rpl_tests/rpl_ssl.inc
new file mode 100644
index 00000000000..ad75b54ba6c
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_ssl.inc
@@ -0,0 +1,117 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/have_ssl_communication.inc;
+source include/master-slave.inc;
+
+# create a user for replication that requires ssl encryption
+connection master;
+create user replssl@localhost;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+
+sync_slave_with_master;
+
+# Set slave to use SSL for connection to master
+stop slave;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval change master to
+ master_user='replssl',
+ master_password='',
+ master_ssl=1,
+ master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
+ master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
+ master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
+start slave;
+
+# Switch to master and insert one record, then sync it to slave
+connection master;
+insert into t1 values(1);
+sync_slave_with_master;
+
+# The record should now be on slave
+select * from t1;
+
+# The slave is synced and waiting/reading from master
+# SHOW SLAVE STATUS will show "Waiting for master to send event"
+let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key;
+source include/show_slave_status.inc;
+source include/check_slave_is_running.inc;
+
+# Stop the slave, as reported in bug#21871 it would hang
+STOP SLAVE;
+
+select * from t1;
+
+# Do the same thing a number of times
+disable_query_log;
+disable_result_log;
+# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows
+# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
+# red trees.
+disable_parsing;
+let $i= 100;
+while ($i)
+{
+ start slave;
+ connection master;
+ insert into t1 values (NULL);
+ select * from t1; # Some variance
+ connection slave;
+ select * from t1; # Some variance
+ stop slave;
+ dec $i;
+}
+enable_parsing;
+START SLAVE;
+enable_query_log;
+enable_result_log;
+connection master;
+# INSERT one more record to make sure
+# the sync has something to do
+insert into t1 values (NULL);
+let $master_count= `select count(*) from t1`;
+
+sync_slave_with_master;
+--source include/wait_for_slave_to_start.inc
+source include/show_slave_status.inc;
+source include/check_slave_is_running.inc;
+
+let $slave_count= `select count(*) from t1`;
+
+if ($slave_count != $master_count)
+{
+ echo master and slave differed in number of rows;
+ echo master: $master_count;
+ echo slave: $slave_count;
+
+ connection master;
+ echo === master ===;
+ select count(*) t1;
+ select * from t1;
+ connection slave;
+ echo === slave ===;
+ select count(*) t1;
+ select * from t1;
+ query_vertical show slave status;
+}
+
+connection master;
+drop user replssl@localhost;
+drop table t1;
+sync_slave_with_master;
+
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ master_user = 'root',
+ master_ssl = 0,
+ master_ssl_ca = '',
+ master_ssl_cert = '',
+ master_ssl_key = '';
+
+--echo End of 5.0 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_relay_ign_space.inc b/mysql-test/extra/rpl_tests/rpl_stm_relay_ign_space.inc
new file mode 100644
index 00000000000..41339f539f8
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_stm_relay_ign_space.inc
@@ -0,0 +1,107 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# BUG#12400313 / BUG#64503 test case
+#
+#
+# Description
+# -----------
+#
+# This test case starts the slave server with:
+# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
+#
+# Then it issues some queries that will cause the slave to reach
+# relay-log-space-limit. We lock the table so that the SQL thread is
+# not able to purge the log and then we issue some more statements.
+#
+# The purpose is to show that the IO thread will honor the limits
+# while the SQL thread is not able to purge the relay logs, which did
+# not happen before this patch. In addition we assert that while
+# ignoring the limit (SQL thread needs to rotate before purging), the
+# IO thread does not do it in an uncontrolled manner.
+
+--source include/have_binlog_format_statement.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--disable_query_log
+CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
+
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+
+--sync_slave_with_master
+
+# wait for the SQL thread to sleep
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
+--source include/wait_show_condition.inc
+
+# now the io thread has set rli->ignore_space_limit
+# lets lock the table so that once the SQL thread awakes
+# it blocks there and does not set rli->ignore_space_limit
+# back to zero
+LOCK TABLE t1 WRITE;
+
+# now issue more statements that will overflow the
+# rli->log_space_limit (in this case ~10K)
+--connection master
+
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+
+--connection slave
+
+# ASSERT that the IO thread waits for the SQL thread to release some
+# space before continuing
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= LIKE 'Waiting for %'
+# before the patch (IO would have transfered everything)
+#--let $condition= = 'Waiting for master to send event'
+# after the patch (now it waits for space to be freed)
+#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
+--source include/wait_show_condition.inc
+
+# without the patch we can uncomment the following two lines and
+# watch the IO thread synchronize with the master, thus writing
+# relay logs way over the space limit
+#--connection master
+#--source include/sync_slave_io_with_master.inc
+
+## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
+--let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
+--let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
+--let $assert_text= Assert that relay log space is close to the limit
+--let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
+--source include/assert.inc
+
+# unlock the table and let SQL thread continue applying events
+UNLOCK TABLES;
+
+--connection master
+--sync_slave_with_master
+--let $diff_tables=master:test.t1,slave:test.t1
+--source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+--enable_query_log
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
index 868b8e73d0a..6edbbf68266 100644
--- a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
+++ b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
@@ -8,8 +8,6 @@ SHOW VARIABLES LIKE 'relay_log_space_limit';
# Matz says: I have no idea what this is supposed to test, but it has
# potential for generating different results with some storage engines
# that process rows in an order not dependent on the insertion order.
-# For instance, I would assume that distributed storage engines (like
-# NDB) could process rows based on locality.
eval CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=$engine_type;
INSERT INTO t1 SET name='Andy', age=31;
diff --git a/mysql-test/extra/rpl_tests/rpl_switch_stm_row_mixed.inc b/mysql-test/extra/rpl_tests/rpl_switch_stm_row_mixed.inc
new file mode 100644
index 00000000000..e74fd6828c6
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_switch_stm_row_mixed.inc
@@ -0,0 +1,631 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# rpl_switch_stm_row_mixed tests covers
+#
+# - 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
+# definition of MIXED binlog format
+# - correctness of execution
+
+
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/master-slave.inc
+
+# Since this test generates row-based events in the binary log, the
+# slave SQL thread cannot be in STATEMENT mode to execute this test,
+# so we only execute it for MIXED and ROW as default value of
+# BINLOG_FORMAT.
+
+connection slave;
+
+connection master;
+--disable_warnings
+drop database if exists mysqltest1;
+create database mysqltest1;
+--enable_warnings
+use mysqltest1;
+
+# Save binlog format
+set @my_binlog_format= @@global.binlog_format;
+
+# play with switching
+set session binlog_format=mixed;
+show session variables like "binlog_format%";
+set session binlog_format=statement;
+show session variables like "binlog_format%";
+set session binlog_format=row;
+show session variables like "binlog_format%";
+
+set global binlog_format=DEFAULT;
+show global variables like "binlog_format%";
+set global binlog_format=MIXED;
+show global variables like "binlog_format%";
+set global binlog_format=STATEMENT;
+show global variables like "binlog_format%";
+set global binlog_format=ROW;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+
+CREATE TABLE t1 (a varchar(100));
+
+prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+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_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values(concat("for_4_",UUID()));
+insert into t1 select "yesterday_5_";
+
+# verify that temp tables prevent a switch to SBR
+create temporary table tmp(a char(100));
+insert into tmp values("see_6_");
+--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
+set binlog_format=statement;
+insert into t1 select * from tmp;
+drop temporary table tmp;
+
+# Now we go to SBR
+set binlog_format=statement;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+set global binlog_format=statement;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_7_";
+insert into t1 values("work_8_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_9_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values("for_10_");
+insert into t1 select "yesterday_11_";
+
+# test statement (is not default after wl#3368)
+set binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+set global binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_12_";
+insert into t1 values("work_13_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_14_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values("for_15_");
+insert into t1 select "yesterday_16_";
+
+# and now the mixed mode
+
+set global binlog_format=mixed;
+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(),?)';
+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_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values(concat("for_20_",UUID()));
+insert into t1 select "yesterday_21_";
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_22_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values(concat("for_23_",UUID()));
+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();
+--disable_warnings
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+--enable_warnings
+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:
+--disable_warnings
+insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+--enable_warnings
+
+# inside a stored procedure
+
+delimiter |;
+create procedure foo()
+begin
+insert into t1 values("work_25_");
+insert into t1 values(concat("for_26_",UUID()));
+insert into t1 select "yesterday_27_";
+end|
+create procedure foo2()
+begin
+insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values("work_29_");
+insert into t1 values(concat("for_30_",UUID()));
+set session binlog_format=row; # accepted for stored procs
+insert into t1 values("more work_31_");
+set session binlog_format=mixed;
+end|
+create function foo3() returns bigint unsigned
+begin
+ set session binlog_format=row; # rejected for stored funcs
+ insert into t1 values("alarm");
+ return 100;
+end|
+create procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end|
+delimiter ;|
+call foo();
+call foo2();
+call foo4("hello");
+call foo4(UUID());
+call foo4("world");
+
+# test that can't SET in a stored function
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
+select foo3();
+select * from t1 where a="alarm";
+
+# Tests of stored functions/triggers/views for BUG#20930 "Mixed
+# binlogging mode does not work with stored functions, triggers,
+# views"
+
+# Function which calls procedure
+drop function foo3;
+delimiter |;
+create function foo3() returns bigint unsigned
+begin
+ insert into t1 values("foo3_32_");
+ call foo();
+ return 100;
+end|
+delimiter ;|
+insert into t2 select foo3();
+
+prepare stmt1 from 'insert into t2 select foo3()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# Test if stored function calls stored function which calls procedure
+# which requires row-based.
+
+delimiter |;
+create function foo4() returns bigint unsigned
+begin
+ insert into t2 select foo3();
+ return 100;
+end|
+delimiter ;|
+select foo4();
+
+prepare stmt1 from 'select foo4()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# A simple stored function
+delimiter |;
+create function foo5() returns bigint unsigned
+begin
+ insert into t2 select UUID();
+ return 100;
+end|
+delimiter ;|
+select foo5();
+
+prepare stmt1 from 'select foo5()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# A simple stored function where UUID() is in the argument
+delimiter |;
+create function foo6(x varchar(100)) returns bigint unsigned
+begin
+ insert into t2 select x;
+ return 100;
+end|
+delimiter ;|
+select foo6("foo6_1_");
+select foo6(concat("foo6_2_",UUID()));
+
+prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+
+# Test of views using UUID()
+
+create view v1 as select uuid();
+create table t11 (data varchar(255));
+insert into t11 select * from v1;
+# Test of querying INFORMATION_SCHEMA which parses the view's body,
+# to verify that it binlogs statement-based (is not polluted by
+# the parsing of the view's body).
+insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
+prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# Test of triggers with UUID()
+delimiter |;
+create trigger t11_bi before insert on t11 for each row
+begin
+ set NEW.data = concat(NEW.data,UUID());
+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("delay_6_");
+
+# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
+# replicate fine in statement-based ; we test that in mixed mode it
+# works).
+insert delayed into t2 values(rand());
+set @a=2.345;
+insert delayed into t2 values(@a);
+
+# With INSERT DELAYED, rows are written to the binlog after they are
+# written to the table. Therefore, it is not enough to wait until the
+# rows make it to t2 on the master (the rows may not be in the binlog
+# at that time, and may still not be in the binlog when
+# sync_slave_with_master is later called). Instead, we wait until the
+# rows make it to t2 on the slave. We first call
+# sync_slave_with_master, so that we are sure that t2 has been created
+# on the slave.
+sync_slave_with_master;
+let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2;
+--source include/wait_condition.inc
+connection master;
+
+# If you want to do manual testing of the mixed mode regarding UDFs (not
+# testable automatically as quite platform- and compiler-dependent),
+# you just need to set the variable below to 1, and to
+# "make udf_example.so" in sql/, and to copy sql/udf_example.so to
+# MYSQL_TEST_DIR/lib/mysql.
+let $you_want_to_test_UDF=0;
+if ($you_want_to_test_UDF)
+{
+ CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
+ prepare stmt1 from 'insert into t1 select metaphon(?)';
+ set @string="emergency_133_";
+ insert into t1 values("work_134_");
+ execute stmt1 using @string;
+ deallocate prepare stmt1;
+ prepare stmt1 from 'insert into t1 select ?';
+ insert into t1 values(metaphon("work_135_"));
+ execute stmt1 using @string;
+ deallocate prepare stmt1;
+ insert into t1 values(metaphon("for_136_"));
+ insert into t1 select "yesterday_137_";
+ create table t6 select metaphon("for_138_");
+ create table t7 select 1 union select metaphon("for_139_");
+ create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3);
+ create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
+}
+
+create table t20 select * from t1; # save for comparing later
+create table t21 select * from t2;
+create table t22 select * from t3;
+drop table t1,t2,t3;
+
+# This tests the fix to
+# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog
+# We verify that under the mixed binlog mode, a stored function
+# modifying at least two tables having an auto_increment column,
+# is binlogged row-based. Indeed in statement-based binlogging,
+# only the auto_increment value generated for the first table
+# is recorded in the binlog, the value generated for the 2nd table
+# lacking.
+
+create table t1 (a int primary key auto_increment, b varchar(100));
+create table t2 (a int primary key auto_increment, b varchar(100));
+create table t3 (b varchar(100));
+delimiter |;
+create function f (x varchar(100)) returns int deterministic
+begin
+ insert into t1 values(null,x);
+ insert into t2 values(null,x);
+ return 1;
+end|
+delimiter ;|
+select f("try_41_");
+# Two operations which compensate each other except that their net
+# effect is that they advance the auto_increment counter of t2 on slave:
+sync_slave_with_master;
+use mysqltest1;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+
+connection master;
+# this is the call which didn't replicate well
+select f("try_42_");
+sync_slave_with_master;
+
+# now use prepared statement and test again, just to see that the RBB
+# mode isn't set at PREPARE but at EXECUTE.
+
+insert into t2 values(3,null),(4,null);
+delete from t2 where a>=3;
+
+connection master;
+prepare stmt1 from 'select f(?)';
+set @string="try_43_";
+insert into t1 values(null,"try_44_"); # should be SBB
+execute stmt1 using @string; # should be RBB
+deallocate prepare stmt1;
+sync_slave_with_master;
+
+# verify that if only one table has auto_inc, it does not trigger RBB
+# (we'll check in binlog further below)
+
+connection master;
+create table t12 select * from t1; # save for comparing later
+drop table t1;
+create table t1 (a int, b varchar(100), key(a));
+select f("try_45_");
+
+# restore table's key
+create table t13 select * from t1;
+drop table t1;
+create table t1 (a int primary key auto_increment, b varchar(100));
+
+# now test if it's two functions, each of them inserts in one table
+
+drop function f;
+# we need a unique key to have sorting of rows by mysqldump
+create table t14 (unique (a)) select * from t2;
+truncate table t2;
+delimiter |;
+create function f1 (x varchar(100)) returns int deterministic
+begin
+ insert into t1 values(null,x);
+ return 1;
+end|
+create function f2 (x varchar(100)) returns int deterministic
+begin
+ insert into t2 values(null,x);
+ return 1;
+end|
+delimiter ;|
+select f1("try_46_"),f2("try_47_");
+
+sync_slave_with_master;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+
+connection master;
+# Test with SELECT and INSERT
+select f1("try_48_"),f2("try_49_");
+insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
+sync_slave_with_master;
+
+# verify that if f2 does only read on an auto_inc table, this does not
+# switch to RBB
+connection master;
+drop function f2;
+delimiter |;
+create function f2 (x varchar(100)) returns int deterministic
+begin
+ declare y int;
+ insert into t1 values(null,x);
+ set y = (select count(*) from t2);
+ return y;
+end|
+delimiter ;|
+select f1("try_53_"),f2("try_54_");
+sync_slave_with_master;
+
+# And now, a normal statement with a trigger (no stored functions)
+
+connection master;
+drop function f2;
+delimiter |;
+create trigger t1_bi before insert on t1 for each row
+begin
+ insert into t2 values(null,"try_55_");
+end|
+delimiter ;|
+insert into t1 values(null,"try_56_");
+# and now remove one auto_increment and verify SBB
+alter table t1 modify a int, drop primary key;
+insert into t1 values(null,"try_57_");
+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 table t16 like t15;
+INSERT INTO t16 SELECT * FROM t15;
+# we'll verify that this one is done RBB
+insert into t16 values("try_65_");
+drop table t15;
+# we'll verify that this one is done SBB
+insert into t16 values("try_66_");
+sync_slave_with_master;
+
+# and now compare:
+
+connection master;
+
+# first check that data on master is sensible
+select count(*) from t1;
+select count(*) from t2;
+select count(*) from t3;
+select count(*) from t4;
+select count(*) from t5;
+select count(*) from t11;
+select count(*) from t20;
+select count(*) from t21;
+select count(*) from t22;
+select count(*) from t12;
+select count(*) from t13;
+select count(*) from t14;
+select count(*) from t16;
+if ($you_want_to_test_UDF)
+{
+ select count(*) from t6;
+ select count(*) from t7;
+ select count(*) from t8;
+ select count(*) from t9;
+}
+
+sync_slave_with_master;
+
+#
+# Bug#20863 If binlog format is changed between update and unlock of
+# tables, wrong binlog
+#
+
+connection master;
+DROP TABLE IF EXISTS t11;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+CREATE TABLE t11 (song VARCHAR(255));
+LOCK TABLES t11 WRITE;
+SET SESSION BINLOG_FORMAT=ROW;
+INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
+UNLOCK TABLES;
+
+--query_vertical SELECT * FROM t11
+sync_slave_with_master;
+USE mysqltest1;
+--query_vertical SELECT * FROM t11
+
+connection master;
+DROP TABLE IF EXISTS t12;
+SET SESSION BINLOG_FORMAT=MIXED;
+CREATE TABLE t12 (data LONG);
+LOCK TABLES t12 WRITE;
+INSERT INTO t12 VALUES(UUID());
+UNLOCK TABLES;
+sync_slave_with_master;
+
+#
+# BUG#28086: SBR of USER() becomes corrupted on slave
+#
+
+connection master;
+
+# Just to get something that is non-trivial, albeit still simple, we
+# stuff the result of USER() and CURRENT_USER() into a variable.
+--delimiter $$
+CREATE FUNCTION my_user()
+ RETURNS CHAR(64)
+BEGIN
+ DECLARE user CHAR(64);
+ SELECT USER() INTO user;
+ RETURN user;
+END $$
+--delimiter ;
+
+--delimiter $$
+CREATE FUNCTION my_current_user()
+ RETURNS CHAR(64)
+BEGIN
+ DECLARE user CHAR(64);
+ SELECT CURRENT_USER() INTO user;
+ RETURN user;
+END $$
+--delimiter ;
+
+DROP TABLE IF EXISTS t13;
+CREATE TABLE t13 (data CHAR(64));
+INSERT INTO t13 VALUES (USER());
+INSERT INTO t13 VALUES (my_user());
+INSERT INTO t13 VALUES (CURRENT_USER());
+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
+--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
+
+# Let's compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching
+
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+
+connection master;
+
+# Now test that mysqlbinlog works fine on a binlog generated by the
+# mixed mode
+
+# BUG#11312 "DELIMITER is not written to the binary log that causes
+# syntax error" makes that mysqlbinlog will fail if we pass it the
+# text of queries; this forces us to use --base64-output here.
+
+# BUG#20929 "BINLOG command causes invalid free plus assertion
+# failure" makes mysqld segfault when receiving --base64-output
+
+# So I can't enable this piece of test
+# SIGH
+
+if ($enable_when_11312_or_20929_fixed)
+{
+--exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
+drop database mysqltest1;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
+# the old mysqldump output on slave is the same as what it was on
+# master before restoring on master.
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+}
+
+drop database mysqltest1;
+sync_slave_with_master;
+
+connection master;
+# Restore binlog format setting
+set global binlog_format =@my_binlog_format;
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_sync.inc b/mysql-test/extra/rpl_tests/rpl_sync.inc
new file mode 100644
index 00000000000..1e2ec2ca83b
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_sync.inc
@@ -0,0 +1,159 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+########################################################################################
+# This test verifies the options --sync-relay-log-info and --relay-log-recovery by
+# crashing the slave in two different situations:
+# (case-1) - Corrupt the relay log with changes which were not processed by
+# the SQL Thread and crashes it.
+# (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
+#
+# Case 1:
+# 1 - Stops the SQL Thread
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the relay-log.bin* which most likely has such changes.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+#
+# Case 2:
+# 1 - Stops the SQL/IO Threads
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the master.info with wrong coordinates.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+########################################################################################
+
+########################################################################################
+# Configuring the environment
+########################################################################################
+--echo =====Configuring the enviroment=======;
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/not_crashrep.inc
+--source include/master-slave.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+# Use innodb so we do not get "table should be repaired" issues.
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+flush tables;
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
+
+insert into t1(a) values(1);
+insert into t1(a) values(2);
+insert into t1(a) values(3);
+
+########################################################################################
+# Case 1: Corrupt a relay-log.bin*
+########################################################################################
+--echo =====Inserting data on the master but without the SQL Thread being running=======;
+sync_slave_with_master;
+
+connection slave;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
+--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/stop_slave_sql.inc
+
+connection master;
+insert into t1(a) values(4);
+insert into t1(a) values(5);
+insert into t1(a) values(6);
+
+--echo =====Removing relay log files and crashing/recoverying the slave=======;
+connection slave;
+--source include/stop_slave_io.inc
+
+let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
+
+--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
+perl;
+$file= $ENV{'FILE_TO_CORRUPT'};
+open(FILE, ">$file") || die "Unable to open $file.";
+truncate(FILE,0);
+print FILE "failure";
+close ($file);
+EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
+
+--echo =====Dumping and comparing tables=======;
+--source include/start_slave.inc
+
+connection master;
+sync_slave_with_master;
+
+let $diff_tables=master:t1,slave:t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Case 2: Corrupt a master.info
+########################################################################################
+--echo =====Corrupting the master.info=======;
+connection slave;
+--source include/stop_slave.inc
+
+connection master;
+FLUSH LOGS;
+
+insert into t1(a) values(7);
+insert into t1(a) values(8);
+insert into t1(a) values(9);
+
+connection slave;
+let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
+
+--perl
+use strict;
+use warnings;
+my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
+my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
+open(FILE, "<", $src) or die;
+my @content= <FILE>;
+close FILE;
+open(FILE, ">", $dst) or die;
+binmode FILE;
+print FILE @content;
+close FILE;
+EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
+
+--echo =====Dumping and comparing tables=======;
+--source include/start_slave.inc
+
+connection master;
+sync_slave_with_master;
+
+let $diff_tables=master:t1,slave:t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Clean up
+########################################################################################
+--echo =====Clean up=======;
+connection master;
+drop table t1;
+
+--remove_file $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/rpl_end.inc
+
diff --git a/mysql-test/extra/rpl_tests/rpl_temporal_format_default_to_default.inc b/mysql-test/extra/rpl_tests/rpl_temporal_format_default_to_default.inc
new file mode 100644
index 00000000000..6728ff55d6f
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_temporal_format_default_to_default.inc
@@ -0,0 +1,82 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/master-slave.inc
+
+if ($force_master_mysql56_temporal_format)
+{
+ connection master;
+ eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format;
+}
+
+if ($force_slave_mysql56_temporal_format)
+{
+ connection slave;
+ eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
+}
+
+connection master;
+SELECT @@global.mysql56_temporal_format AS on_master;
+connection slave;
+SELECT @@global.mysql56_temporal_format AS on_slave;
+connection master;
+
+CREATE TABLE t1
+(
+ c0 TIME(0),
+ c1 TIME(1),
+ c2 TIME(2),
+ c3 TIME(3),
+ c4 TIME(4),
+ c5 TIME(5),
+ c6 TIME(6)
+);
+CREATE TABLE t2
+(
+ c0 TIMESTAMP(0),
+ c1 TIMESTAMP(1),
+ c2 TIMESTAMP(2),
+ c3 TIMESTAMP(3),
+ c4 TIMESTAMP(4),
+ c5 TIMESTAMP(5),
+ c6 TIMESTAMP(6)
+);
+
+CREATE TABLE t3
+(
+ c0 DATETIME(0),
+ c1 DATETIME(1),
+ c2 DATETIME(2),
+ c3 DATETIME(3),
+ c4 DATETIME(4),
+ c5 DATETIME(5),
+ c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+sync_slave_with_master;
+
+connection slave;
+--query_vertical SELECT * FROM t1;
+--query_vertical SELECT * FROM t2;
+--query_vertical SELECT * FROM t3;
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+connection slave;
+SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
+SET @@global.mysql56_temporal_format=DEFAULT;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_trig004.test b/mysql-test/extra/rpl_tests/rpl_trig004.test
index 1a738db27fc..4988fe87f8f 100644
--- a/mysql-test/extra/rpl_tests/rpl_trig004.test
+++ b/mysql-test/extra/rpl_tests/rpl_trig004.test
@@ -7,7 +7,6 @@
#############################################################################
# Change Auth: JBM #
# Date: 2006-02-14 #
-# Change: Added error, sleep and comments (ndb) #
####################################################
# Begin clean up test section
@@ -28,15 +27,12 @@ CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO t
delimiter ;//
INSERT INTO test.t2 VALUES (1, 0.0);
-# Expect duplicate error 1022 == ndb
---error 1022, ER_DUP_ENTRY
+--error ER_DUP_ENTRY
INSERT INTO test.t2 VALUES (1, 0.0);
#show binlog events;
select * from test.t1;
select * from test.t2;
-let $wait_time= 10;
---source include/wait_for_ndb_to_binlog.inc
sync_slave_with_master;
connection slave;
select * from test.t1;
diff --git a/mysql-test/extra/rpl_tests/rpl_typeconv.inc b/mysql-test/extra/rpl_tests/rpl_typeconv.inc
new file mode 100644
index 00000000000..0f078854ec2
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_typeconv.inc
@@ -0,0 +1,78 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption suite).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+connection slave;
+set @saved_slave_type_conversions = @@global.slave_type_conversions;
+CREATE TABLE type_conversions (
+ TestNo INT AUTO_INCREMENT PRIMARY KEY,
+ Source TEXT,
+ Target TEXT,
+ Flags TEXT,
+ On_Master TEXT,
+ On_Slave TEXT,
+ Expected TEXT,
+ Compare INT,
+ Error TEXT);
+
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT';
+SELECT @@global.slave_type_conversions;
+
+# Checking strict interpretation of type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+source extra/rpl_tests/type_conversions.test;
+
+# Checking lossy integer type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+source extra/rpl_tests/type_conversions.test;
+
+# Checking non-lossy integer type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+source extra/rpl_tests/type_conversions.test;
+
+# Checking all type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+source extra/rpl_tests/type_conversions.test;
+
+connection slave;
+--echo **** Result of conversions ****
+disable_query_log;
+SELECT RPAD(Source, 15, ' ') AS Source_Type,
+ RPAD(Target, 15, ' ') AS Target_Type,
+ RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
+ IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
+ IF(Compare, '<Correct value>',
+ CONCAT("'", On_Slave, "' != '", Expected, "'")))
+ AS Value_On_Slave
+ FROM type_conversions;
+enable_query_log;
+DROP TABLE type_conversions;
+
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+set global slave_type_conversions = @saved_slave_type_conversions;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/include/analyze-format.inc b/mysql-test/include/analyze-format.inc
new file mode 100644
index 00000000000..65e61b81582
--- /dev/null
+++ b/mysql-test/include/analyze-format.inc
@@ -0,0 +1,3 @@
+# The time on ANALYSE FORMAT=JSON is rather variable
+
+--replace_regex /("(r_total_time_ms|r_buffer_size)": )[^, \n]*/\1"REPLACED"/
diff --git a/mysql-test/include/assert_grep.inc b/mysql-test/include/assert_grep.inc
new file mode 100644
index 00000000000..a980a6d73b1
--- /dev/null
+++ b/mysql-test/include/assert_grep.inc
@@ -0,0 +1,154 @@
+# ==== Purpose ====
+#
+# Grep a file for a pattern, produce a single string out of the
+# matching lines, and assert that the string matches a given regular
+# expression.
+#
+# ==== Usage ====
+#
+# --let $assert_text= TEXT
+# --let $assert_file= FILE
+# --let $assert_select= REGEX
+# [--let $assert_match= REGEX | --let $assert_count= NUMBER]
+# [--let $assert_only_after= REGEX]
+# --source include/assert_grep.inc
+#
+# Parameters:
+#
+# $assert_text
+# Text that describes what is being checked. This text is written to
+# the query log so it should not contain non-deterministic elements.
+#
+# $assert_file
+# File to search.
+#
+# $assert_select
+# All lines matching this text will be checked.
+#
+# $assert_match
+# The script will find all lines that match $assert_select,
+# concatenate them to a long string, and assert that it matches
+# $assert_match.
+#
+# $assert_count
+# Instead of asserting that the selected lines match
+# $assert_match, assert that there were exactly $assert_count
+# matching lines.
+#
+# $assert_only_after
+# Reset all the lines matched and the counter when finding this pattern.
+# It is useful for searching things in the mysqld.err log file just
+# after the last server restart for example (discarding the log content
+# of previous server executions).
+
+
+if (!$assert_text)
+{
+ --die !!!ERROR IN TEST: you must set $assert_text
+}
+if (!$assert_file)
+{
+ --die !!!ERROR IN TEST: you must set $assert_file
+}
+if (!$assert_select)
+{
+ --die !!!ERROR IN TEST: you must set $assert_select
+}
+if ($assert_match == '')
+{
+ if ($assert_count == '')
+ {
+ --die !!!ERROR IN TEST: you must set either $assert_match or $assert_count
+ }
+}
+if ($assert_match != '')
+{
+ if ($assert_count != '')
+ {
+ --echo assert_text='$assert_text' assert_count='$assert_count'
+ --die !!!ERROR IN TEST: you must set only one of $assert_match or $assert_count
+ }
+}
+
+
+--let $include_filename= assert_grep.inc [$assert_text]
+--source include/begin_include_file.inc
+
+
+--let _AG_ASSERT_TEXT= $assert_text
+--let _AG_ASSERT_FILE= $assert_file
+--let _AG_ASSERT_SELECT= $assert_select
+--let _AG_ASSERT_MATCH= $assert_match
+--let _AG_ASSERT_COUNT= $assert_count
+--let _AG_OUT= `SELECT CONCAT('$MYSQLTEST_VARDIR/tmp/_ag_', UUID())`
+--let _AG_ASSERT_ONLY_AFTER= $assert_only_after
+
+
+--perl
+ use strict;
+ use warnings;
+ my $file= $ENV{'_AG_ASSERT_FILE'};
+ my $assert_select= $ENV{'_AG_ASSERT_SELECT'};
+ my $assert_match= $ENV{'_AG_ASSERT_MATCH'};
+ my $assert_count= $ENV{'_AG_ASSERT_COUNT'};
+ my $assert_only_after= $ENV{'_AG_ASSERT_ONLY_AFTER'};
+ my $out= $ENV{'_AG_OUT'};
+
+ my $result= '';
+ my $count= 0;
+ open(FILE, "$file") or die("Error $? opening $file: $!\n");
+ while (<FILE>) {
+ my $line = $_;
+ if ($assert_only_after && $line =~ /$assert_only_after/) {
+ $result = "";
+ $count = 0;
+ }
+ if ($line =~ /$assert_select/) {
+ if ($assert_count ne '') {
+ $count++;
+ }
+ else {
+ $result .= $line;
+ }
+ }
+ }
+ close(FILE) or die("Error $? closing $file: $!");
+ open OUT, "> $out" or die("Error $? opening $out: $!");
+ if ($assert_count ne '' && ($count != $assert_count)) {
+ print OUT ($count) or die("Error $? writing $out: $!");
+ }
+ elsif ($assert_count eq '' && $result !~ /$assert_match/) {
+ print OUT ($result) or die("Error $? writing $out: $!");
+ }
+ else {
+ print OUT ("assert_grep.inc ok");
+ }
+ close OUT or die("Error $? closing $out: $!");
+EOF
+
+
+--let $_ag_outcome= `SELECT LOAD_FILE('$_AG_OUT')`
+if ($_ag_outcome != 'assert_grep.inc ok')
+{
+ --source include/show_rpl_debug_info.inc
+ --echo include/assert_grep.inc failed!
+ --echo assert_text: '$assert_text'
+ --echo assert_file: '$assert_file'
+ --echo assert_select: '$assert_select'
+ --echo assert_match: '$assert_match'
+ --echo assert_count: '$assert_count'
+ --echo assert_only_after: '$assert_only_after'
+ if ($assert_match != '')
+ {
+ --echo matching lines: '$_ag_outcome'
+ }
+ if ($assert_count != '')
+ {
+ --echo number of matching lines: $_ag_outcome
+ }
+ --die assert_grep.inc failed.
+}
+
+
+--let $include_filename= include/assert_grep.inc [$assert_text]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/binlog_parallel_replication_marks.test b/mysql-test/include/binlog_parallel_replication_marks.test
new file mode 100644
index 00000000000..ff35875aece
--- /dev/null
+++ b/mysql-test/include/binlog_parallel_replication_marks.test
@@ -0,0 +1,80 @@
+# Test the markings on GTID events (ddl, waited, trans,
+# @@skip_parallel_replication) that are used to control parallel
+# replication on the slave.
+
+--source include/have_innodb.inc
+
+RESET MASTER;
+--source include/wait_for_binlog_checkpoint.inc
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+--let $binlog_pos1=query_get_value(SHOW MASTER STATUS, Position, 1)
+/* GTID */ INSERT INTO t1 VALUES (1,0);
+/* GTID */ BEGIN;
+/* GTID */ INSERT INTO t1 VALUES (2,0);
+/* GTID */ ALTER TABLE t1 ADD c INT;
+/* GTID */ INSERT INTO t1 VALUES (3,0,0);
+/* GTID */ COMMIT;
+/* GTID */ BEGIN;
+/* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2;
+/* GTID */ CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t2 VALUES (4,10), (5,20);
+/* GTID */ INSERT INTO t1 SELECT a, 2, b FROM t2;
+/* GTID */ DROP TEMPORARY TABLE t2;
+/* GTID */ INSERT INTO t1 VALUES (6, 3, 0);
+/* GTID */ COMMIT;
+/* GTID */ CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ BEGIN;
+/* GTID */ DELETE FROM t1 WHERE a=5;
+/* GTID */ INSERT INTO t3 VALUES (7);
+/* GTID */ INSERT INTO t1 SELECT a, 4, 0 FROM t3;
+/* GTID */ UPDATE t1 SET c=1 WHERE a=7;
+/* GTID */ DROP TEMPORARY TABLE t3;
+/* GTID */ COMMIT;
+/* GTID */ CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ BEGIN;
+/* GTID */ INSERT INTO t1 VALUES (8, 5, 0);
+/* GTID */ ALTER TABLE t4 ADD b INT;
+/* GTID */ INSERT INTO t1 VALUES (9, 5, 1);
+/* GTID */ COMMIT;
+connect (tmp_con,localhost,root,,);
+/* GTID */ INSERT INTO t1 VALUES (10, 6, 0);
+/* GTID */ BEGIN;
+/* GTID */ CREATE TEMPORARY TABLE t5 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t1 VALUES (11, 7, 0);
+/* GTID */ COMMIT;
+--let $before_drop_pos=query_get_value(SHOW MASTER STATUS, Position, 1)
+disconnect tmp_con;
+connection default;
+
+# We need to wait for the implicit DROP TEMPORARY TABLE to be logged after
+# tmp_con disconnect, otherwise we get sporadic test failures.
+--let $wait_condition= SELECT variable_value > $before_drop_pos FROM information_schema.global_status WHERE variable_name = 'binlog_snapshot_position'
+--source include/wait_condition.inc
+
+--let $binlog_pos2=query_get_value(SHOW MASTER STATUS, Position, 1)
+
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+FLUSH LOGS;
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--let $file= $MYSQLTEST_VARDIR/tmp/binlog_parallel_replication_marks.out
+--let OUTPUT_FILE=$file
+exec $MYSQL_BINLOG --start_position=$binlog_pos1 --stop_position=$binlog_pos2 $MYSQLD_DATADIR/$binlog_file > $file;
+
+perl;
+my $file= $ENV{'OUTPUT_FILE'};
+open F, "<", $file
+ or die "Unable to open file '$file': $!\n";
+while (<F>) {
+ s/^#\d+ +\d+:\d+:\d+ /# /;
+ s/GTID \d+-\d+-\d+/GTID #-#-#/;
+ s/end_log_pos \d+/end_log_pos #/;
+ s/table id \d+/table id #/;
+ s/mapped to number \d+/mapped to number #/;
+ print if /GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY/;
+}
+close F;
+EOF
+
+DROP TABLE t1;
diff --git a/mysql-test/include/binlog_start_pos.inc b/mysql-test/include/binlog_start_pos.inc
index 7dac1b376ee..1fe2dd8d171 100644
--- a/mysql-test/include/binlog_start_pos.inc
+++ b/mysql-test/include/binlog_start_pos.inc
@@ -10,19 +10,19 @@
#
# Format_description_log_event length =
# 19 /* event common header */ +
-# 57 /* misc stuff in the Format description header */ +
+# 58 /* misc stuff in the Format description header */ +
# number of events +
# 1 /* Checksum algorithm */ +
# 4 /* CRC32 length */
#
-# With current number of events = 163,
+# With current number of events = 164,
#
-# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 248.
+# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249.
#
##############################################################################
-let $binlog_start_pos=248;
--disable_query_log
-SET @binlog_start_pos=248;
+set @binlog_start_pos=249 + @@encrypt_binlog * 36;
--enable_query_log
+let $binlog_start_pos=`select @binlog_start_pos`;
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 3a9ec419bb1..435de640c9d 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -64,6 +64,9 @@ if ($tmp)
--echo Master_SSL_Crlpath #
--echo Using_Gtid No
--echo Gtid_IO_Pos #
+ --echo Replicate_Do_Domain_Ids
+ --echo Replicate_Ignore_Domain_Ids
+ --echo Parallel_Mode conservative
}
if (!$tmp) {
# Note: after WL#5177, fields 13-18 shall not be filtered-out.
@@ -75,6 +78,7 @@ if (!$tmp) {
call mtr.check_testcase();
let $datadir=`select @@datadir`;
+list_files $datadir mysql_upgrade_info;
list_files $datadir/test #sql*;
list_files $datadir/mysql #sql*;
diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test
index 9ecf7de419a..b2f73c32e35 100644
--- a/mysql-test/include/check-warnings.test
+++ b/mysql-test/include/check-warnings.test
@@ -11,6 +11,10 @@
# Don't write these queries to binlog
set SQL_LOG_BIN=0;
+# Do not replicate updates to other galera nodes
+--error 0,1193
+set WSREP_ON=0;
+
# Turn off any debug crashes, allow the variable to be
# non existent in release builds
--error 0,1193
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 0b7299a3c34..2912287be8e 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -26,6 +26,7 @@
#
connection default;
+SET SQL_MODE="";
#
# Show prerequisites for this test.
#
@@ -670,3 +671,4 @@ connection default;
drop table t1;
drop user mysqltest@localhost;
+SET SQL_MODE=default;
diff --git a/mysql-test/include/crash_mysqld.inc b/mysql-test/include/crash_mysqld.inc
new file mode 100644
index 00000000000..4190d24d801
--- /dev/null
+++ b/mysql-test/include/crash_mysqld.inc
@@ -0,0 +1,18 @@
+# Crash mysqld hard and wait until it's restarted
+
+--source include/have_debug_sync.inc
+--source include/not_embedded.inc
+
+# Write file to make mysql-test-run.pl expect crash and restart
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Setup the mysqld to crash at shutdown
+SET debug_dbug="d,crash_shutdown";
+--error 2013
+shutdown;
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
diff --git a/mysql-test/include/ctype_innodb_like.inc b/mysql-test/include/ctype_innodb_like.inc
index ae43342885a..4f3201f51fb 100644
--- a/mysql-test/include/ctype_innodb_like.inc
+++ b/mysql-test/include/ctype_innodb_like.inc
@@ -2,6 +2,10 @@
# Bug#11650: LIKE pattern matching using prefix index
# doesn't return correct result
#
+--disable_query_log
+set @ctype_save_sql_mode=@@sql_mode;
+set sql_mode="";
+--enable_query_log
--disable_warnings
#
# This query creates a column using
@@ -10,6 +14,9 @@
#
create table t1 engine=innodb select repeat('a',50) as c1;
--enable_warnings
+--disable_query_log
+set sql_mode=@ctype_save_sql_mode;
+--enable_query_log
alter table t1 add index(c1(5));
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
diff --git a/mysql-test/include/ctype_like_cond_propagation.inc b/mysql-test/include/ctype_like_cond_propagation.inc
index 023cf2b1b30..1c6ea04ded2 100644
--- a/mysql-test/include/ctype_like_cond_propagation.inc
+++ b/mysql-test/include/ctype_like_cond_propagation.inc
@@ -37,3 +37,19 @@ SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+--echo #
+
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+DROP TABLE t1;
+
+--echo #
+--echo # End of MDEV-8694
+--echo #
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
index 47b52be9cec..6bda2205c0e 100644
--- a/mysql-test/include/ctype_numconv.inc
+++ b/mysql-test/include/ctype_numconv.inc
@@ -1166,7 +1166,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
drop table t1, t2;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -1478,7 +1478,7 @@ select hex(a) from v1;
drop table t1;
drop view v1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
diff --git a/mysql-test/include/ctype_thai.inc b/mysql-test/include/ctype_thai.inc
new file mode 100644
index 00000000000..f72de9e93b6
--- /dev/null
+++ b/mysql-test/include/ctype_thai.inc
@@ -0,0 +1,156 @@
+--echo #
+--echo # Start of ctype_thai.inc
+--echo #
+
+#
+# Test Unicode Thai collations based on libthai testcases
+#
+
+CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
+
+INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡');
+INSERT INTO t1 VALUES ('à¸à¸');
+INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š');
+INSERT INTO t1 VALUES ('ข่าง');
+INSERT INTO t1 VALUES ('ข้าง');
+INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน');
+INSERT INTO t1 VALUES ('ข้างขึ้น');
+INSERT INTO t1 VALUES ('ข้างควาย');
+INSERT INTO t1 VALUES ('ข้างเงิน');
+INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡');
+INSERT INTO t1 VALUES ('ข้างออà¸');
+INSERT INTO t1 VALUES ('ข้างๆ');
+INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
+INSERT INTO t1 VALUES ('ขาง');
+INSERT INTO t1 VALUES ('à¹à¸‚็ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่งขัน');
+INSERT INTO t1 VALUES ('à¹à¸‚้ง');
+INSERT INTO t1 VALUES ('à¹à¸‚้งขวา');
+INSERT INTO t1 VALUES ('à¹à¸‚็งขัน');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯');
+INSERT INTO t1 VALUES ('บุà¸à¸à¸²');
+INSERT INTO t1 VALUES ('บุà¸-หลง');
+INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡');
+INSERT INTO t1 VALUES ('ป่า');
+INSERT INTO t1 VALUES ('ป่าน');
+INSERT INTO t1 VALUES ('ป้า');
+INSERT INTO t1 VALUES ('ป้าน');
+INSERT INTO t1 VALUES ('ป๊า');
+INSERT INTO t1 VALUES ('ป๊าน');
+INSERT INTO t1 VALUES ('ป๋า');
+INSERT INTO t1 VALUES ('ป๋าน');
+INSERT INTO t1 VALUES ('ปา');
+INSERT INTO t1 VALUES ('ปาน');
+INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡');
+INSERT INTO t1 VALUES ('พณิชย์');
+INSERT INTO t1 VALUES ('ม้า');
+INSERT INTO t1 VALUES ('ฯพณฯ');
+INSERT INTO t1 VALUES ('A');
+INSERT INTO t1 VALUES ('a');
+INSERT INTO t1 VALUES ('a\'');
+INSERT INTO t1 VALUES ('A-');
+INSERT INTO t1 VALUES ('a-');
+INSERT INTO t1 VALUES ('-a');
+INSERT INTO t1 VALUES ('A.');
+INSERT INTO t1 VALUES ('a.');
+INSERT INTO t1 VALUES ('A-1');
+INSERT INTO t1 VALUES ('aa');
+INSERT INTO t1 VALUES ('AA');
+INSERT INTO t1 VALUES ('A.A.');
+INSERT INTO t1 VALUES ('a.a.');
+INSERT INTO t1 VALUES ('AAA');
+INSERT INTO t1 VALUES ('A.A.A.');
+INSERT INTO t1 VALUES ('AAAA');
+INSERT INTO t1 VALUES ('A.A.A.L.');
+INSERT INTO t1 VALUES ('A.A.A.S.');
+INSERT INTO t1 VALUES ('Aachen');
+INSERT INTO t1 VALUES ('A.A.E.');
+INSERT INTO t1 VALUES ('A.Ae.E.');
+INSERT INTO t1 VALUES ('A.A.E.E.');
+INSERT INTO t1 VALUES ('AAES');
+INSERT INTO t1 VALUES ('AAF');
+INSERT INTO t1 VALUES ('A.Agr');
+INSERT INTO t1 VALUES ('aah');
+INSERT INTO t1 VALUES ('@@@@@');
+INSERT INTO t1 VALUES ('0000');
+INSERT INTO t1 VALUES ('9999');
+INSERT INTO t1 VALUES ('Aalborg');
+INSERT INTO t1 VALUES ('aide');
+INSERT INTO t1 VALUES ('air');
+INSERT INTO t1 VALUES ('@@@air');
+INSERT INTO t1 VALUES ('air@@@');
+INSERT INTO t1 VALUES ('C.A.F');
+INSERT INTO t1 VALUES ('Canon');
+INSERT INTO t1 VALUES ('coop');
+INSERT INTO t1 VALUES ('co-op');
+INSERT INTO t1 VALUES ('COOP');
+INSERT INTO t1 VALUES ('CO-OP');
+INSERT INTO t1 VALUES ('Copenhegen');
+INSERT INTO t1 VALUES ('McArthur');
+INSERT INTO t1 VALUES ('Mc Arthur');
+INSERT INTO t1 VALUES ('Mc Mahon');
+INSERT INTO t1 VALUES ('vice-president');
+INSERT INTO t1 VALUES ('vice versa');
+INSERT INTO t1 VALUES ('vice-versa');
+INSERT INTO t1 VALUES ('10 ลิตร');
+INSERT INTO t1 VALUES ('๑๠ลิตร');
+INSERT INTO t1 VALUES ('10 litre');
+INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
+INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)');
+INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]');
+INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}');
+
+# Sort the table according to binary 'a'
+# To avoid problems with unpredictable order or 'AA' and 'aa'
+ALTER TABLE t1 ORDER BY a;
+
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
+ ' CHARACTER SET ', @backup_character_set_connection,
+ ' COLLATE ', @backup_collation_connection,
+ ' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
+ ' , ADD KEY a_id (a, id)');
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+
+SHOW CREATE TABLE t1;
+
+--echo #
+--echo # Ascending sort, using filesort
+--echo #
+EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
+SELECT a FROM t1 ORDER BY a, BINARY a;
+
+--echo #
+--echo # Descending sort, using filesort
+--echo #
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+
+
+--echo #
+--echo # Ascending sort, using index
+--echo #
+EXPLAIN SELECT a FROM t1 ORDER BY a, id;
+SELECT a FROM t1 ORDER BY a, id;
+
+--echo #
+--echo # Descending sort, using index
+--echo #
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
+SELECT a FROM t1 ORDER BY a DESC, id DESC;
+
+DROP TABLE t1;
+
+--echo #
+--echo # End of ctype_thai.inc
+--echo #
diff --git a/mysql-test/include/ctype_uca_w2.inc b/mysql-test/include/ctype_uca_w2.inc
new file mode 100644
index 00000000000..b59f73b8a63
--- /dev/null
+++ b/mysql-test/include/ctype_uca_w2.inc
@@ -0,0 +1,65 @@
+--echo #
+--echo # Start of ctype_uca_w2.inc
+--echo #
+
+SELECT @@collation_connection;
+
+SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE @@collation_connection;
+
+--echo #
+--echo # Testing strnxfrm
+--echo #
+
+CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (_ucs2 0x3400);
+INSERT INTO t1 VALUES (_ucs2 0xF001);
+SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
+ ' CHARACTER SET ', @backup_character_set_connection,
+ ' COLLATE ', @backup_collation_connection);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+
+SHOW CREATE TABLE t1;
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
+INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t1 ORDER BY a DESC;
+DROP TABLE t1;
+
+--echo #
+--echo # End of ctype_uca_w2.inc
+--echo #
diff --git a/mysql-test/include/ctype_utf8_ilseq.inc b/mysql-test/include/ctype_utf8_ilseq.inc
index c400731c07f..1bb009f2a8b 100644
--- a/mysql-test/include/ctype_utf8_ilseq.inc
+++ b/mysql-test/include/ctype_utf8_ilseq.inc
@@ -28,17 +28,35 @@ INSERT INTO t1 (ch) VALUES (_utf8 0x61D680);
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ALTER TABLE t1 DROP KEY ch;
diff --git a/mysql-test/include/ctype_utf8mb4.inc b/mysql-test/include/ctype_utf8mb4.inc
index 9ee2414e142..71993a946b3 100644
--- a/mysql-test/include/ctype_utf8mb4.inc
+++ b/mysql-test/include/ctype_utf8mb4.inc
@@ -191,17 +191,9 @@ drop table t1;
#
if(!$is_heap)
{
-if(!$is_ndb)
-{
--error ER_TOO_LONG_KEY
eval create table t1 (a text character set utf8mb4, primary key(a(371))) engine $engine;
}
-if($is_ndb)
-{
---error ER_BLOB_USED_AS_KEY
-eval create table t1 (a text character set utf8mb4, primary key(a(371))) engine $engine;
-}
-}
#
# Bug 2959
@@ -254,8 +246,6 @@ drop table t2;
# Bug 4521: unique key prefix interacts poorly with utf8mb4
# MYISAM: keys with prefix compression, case insensitive collation.
#
-if (!$is_ndb)
-{
eval create table t1 (c varchar(30) character set utf8mb4, unique(c(10))) engine $engine;
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
@@ -549,7 +539,6 @@ select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
select c as c_a from t1 where c='б';
drop table t1;
-}
# Bug#4594: column index make = failed for gbk, but like works
@@ -593,8 +582,6 @@ drop table t1;
# the same for HEAP+HASH
#
-if (!$is_ndb)
-{
eval create table t1 (
str varchar(255) character set utf8mb4 not null,
key str using hash (str(2))
@@ -618,7 +605,6 @@ INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
drop table t1;
-}
#
# Bug #5397: Crash with varchar binary and LIKE
@@ -651,8 +637,6 @@ DROP TABLE t1;
#
if (!$is_heap)
{
-if (!$is_ndb)
-{
eval CREATE TABLE t1 (
id int unsigned NOT NULL auto_increment,
list_id smallint unsigned NOT NULL,
@@ -689,7 +673,6 @@ SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest");
SELECT id, term FROM t1 where (list_id = 1) AND (term = "testètest");
DROP TABLE t1;
}
-}
#
# Bug #6019 SELECT tries to use too short prefix index on utf8mb4 data
@@ -705,9 +688,16 @@ eval create table t1 (
insert into t1 values(1,'foo'),(2,'foobar');
--sorted_result
select * from t1 where b like 'foob%';
+--disable_query_log
+set @ctype_save_sql_mode=@@sql_mode;
+set sql_mode="";
+--enable_query_log
--disable_warnings
alter table t1 engine=innodb;
--enable_warnings
+--disable_query_log
+set sql_mode=@ctype_save_sql_mode;
+--enable_query_log
--sorted_result
select * from t1 where b like 'foob%';
drop table t1;
@@ -979,14 +969,7 @@ if (!$is_heap)
#
eval CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8mb4) ENGINE $engine;
INSERT INTO t1 VALUES(REPEAT('a', 100));
-if (!$is_ndb)
-{
eval CREATE TEMPORARY TABLE t2 ENGINE $engine SELECT COALESCE(t) AS bug FROM t1;
-}
-if ($is_ndb)
-{
-eval CREATE TABLE t2 ENGINE $engine SELECT COALESCE(t) AS bug FROM t1;
-}
SELECT LENGTH(bug) FROM t2;
DROP TABLE t2;
DROP TABLE t1;
@@ -1202,8 +1185,6 @@ SET NAMES latin2;
if (!$is_heap)
{
-if (!$is_ndb)
-{
eval CREATE TABLE t1 (
id int(11) NOT NULL default '0',
tid int(11) NOT NULL default '0',
@@ -1229,7 +1210,6 @@ SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNÝ ADSL';
DROP TABLE t1;
}
-}
#
# Bug 20709: problem with utf8mb4 fields in temporary tables
@@ -1318,8 +1298,6 @@ drop table t1;
#
# Check that do_varstring2_mb produces a warning
#
-if (!$is_ndb)
-{
eval create table t1 (
a varchar(4000) not null
) default character set utf8mb4 engine $engine;
@@ -1327,7 +1305,6 @@ insert into t1 values (repeat('a',4000));
alter table t1 change a a varchar(3000) character set utf8mb4 not null;
select length(a) from t1;
drop table t1;
-}
#
# Bug#10504: Character set does not support traditional mode
@@ -1614,8 +1591,6 @@ set max_sort_length=default;
--echo #
if (!$is_heap)
{
-if (!$is_ndb)
-{
eval CREATE TABLE t1 (
clipid INT NOT NULL,
Tape TINYTEXT,
@@ -1626,7 +1601,6 @@ ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
SHOW CREATE TABLE t1;
DROP TABLE t1;
}
-}
#--echo #
#--echo # Check that supplementary characters are not allowed in identifiers
@@ -1807,12 +1781,9 @@ INSERT INTO t2 VALUES (x'ea9da8');
SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
SELECT CHARSET(CONCAT(utf8mb4, utf8mb3)) FROM t1, t2 LIMIT 1;
-if (!$is_ndb)
-{
eval CREATE TEMPORARY TABLE t3 ENGINE $engine AS SELECT *, concat(utf8mb4,utf8mb3) FROM t1, t2;
SHOW CREATE TABLE t3;
DROP TEMPORARY TABLE t3;
-}
SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
SELECT * FROM t1, t2 WHERE t1.utf8mb4 = t2.utf8mb3;
@@ -1838,5 +1809,33 @@ DROP TABLE t1;
--echo #
--echo #
---echo # End of tests
+--echo # ctype_utf8mb4.inc: Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+--echo #
+CREATE TABLE t1 (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (0x61);
+INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF);
+INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF);
+INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # ctype_utf8mb4.inc: End of 10.1 tests
+--echo #
+
+--echo #
+--echo # End of ctype_utf8mb4.inc
--echo #
diff --git a/mysql-test/include/default_client.cnf b/mysql-test/include/default_client.cnf
index bcd6a4849d2..e326b308f5f 100644
--- a/mysql-test/include/default_client.cnf
+++ b/mysql-test/include/default_client.cnf
@@ -20,3 +20,9 @@ default-character-set=latin1
[mysql_upgrade]
default-character-set=latin1
+
+[mysqltest]
+loose-ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
+loose-ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem
+loose-ssl-key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem
+loose-skip-ssl
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 7b84117639c..44a7fd12d27 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -16,6 +16,8 @@
# Default values that applies to all MySQL Servers
[mysqld]
+disable-getopt-prefix-matching
+
open-files-limit= 1024
local-infile
character-set-server= latin1
@@ -43,6 +45,8 @@ loose-feedback-debug-startup-interval=20
loose-feedback-debug-first-interval=60
loose-feedback-debug-interval=60
+loose-pam-debug
+
loose-innodb_data_file_path= ibdata1:12M:autoextend
loose-innodb_buffer_pool_size= 8M
loose-innodb_lru_scan_depth= 100
@@ -104,6 +108,10 @@ binlog-direct-non-transactional-updates
default-storage-engine=myisam
+loose-ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
+loose-ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem
+loose-ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem
+
# here, at the end of [mysqld] group mtr will automatically disable
# all optional plugins.
diff --git a/mysql-test/include/default_ndbd.cnf b/mysql-test/include/default_ndbd.cnf
deleted file mode 100644
index 9a88a5936aa..00000000000
--- a/mysql-test/include/default_ndbd.cnf
+++ /dev/null
@@ -1,27 +0,0 @@
-
-[cluster_config]
-MaxNoOfSavedMessages= 1000
-MaxNoOfConcurrentTransactions= 128
-MaxNoOfConcurrentOperations= 10000
-DataMemory= 20M
-IndexMemory= 1M
-Diskless= 0
-TimeBetweenWatchDogCheck= 30000
-MaxNoOfOrderedIndexes= 32
-MaxNoOfAttributes= 2048
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 4
-FragmentLogFileSize= 12M
-DiskPageBufferMemory= 4M
-
-# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
-#ODirect= 1
-# the following parametes just function as a small regression
-# test that the parameter exists
-InitialNoOfOpenFiles= 27
-
-# Increase timeouts for slow test-machines
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-
-#TransactionDeadlockDetectionTimeout= 7500
diff --git a/mysql-test/include/diff_servers.inc b/mysql-test/include/diff_servers.inc
new file mode 100644
index 00000000000..5ec7efc38b9
--- /dev/null
+++ b/mysql-test/include/diff_servers.inc
@@ -0,0 +1,67 @@
+# ==== Purpose ====
+#
+# Check that two or more servers have identical databases; fail if not.
+#
+# ==== Usage ====
+#
+# --let $diff_servers= 1 2
+# [--let $databases= db1 db2 ...]
+# [--let $rpl_debug= 1]
+# --source include/diff_servers.inc
+
+# pretty-print header
+--let $_ds_info= servers=$diff_servers
+if ($databases != '')
+{
+ --let $_ds_info= $_ds_info databases=$databases
+}
+--let $include_filename= diff_servers.inc [$_ds_info]
+--source include/begin_include_file.inc
+
+# get databases
+--let $_ds_databases= $diff_database
+if ($_ds_databases == '')
+{
+ --let $_ds_databases= `SELECT GROUP_CONCAT(SCHEMA_NAME SEPARATOR ' ') FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('information_schema', 'mtr', 'mysql', 'performance_schema')`
+}
+
+# generate command line
+--let $_ds_arg= --defaults-group-suffix=.
+--let $_ds_number_pos= `SELECT LOCATE('$_ds_arg', '$MYSQL_DUMP') + LENGTH('$_ds_arg')`
+--let $_ds_pre_command= `SELECT SUBSTR('$MYSQL_DUMP', 1, $_ds_number_pos - 1)`
+--let $_ds_post_command= `SELECT SUBSTR('$MYSQL_DUMP', $_ds_number_pos + 1)`
+--let $_ds_post_command= $_ds_post_command --compact --order-by-primary --skip-extended-insert --no-create-info --databases $_ds_databases
+--let $_ds_prev_outfile=
+
+# iterate over servers
+--let $_ds_servers= $diff_servers
+while ($_ds_servers != '')
+{
+ --let $_ds_server_number= `SELECT SUBSTRING_INDEX('$_ds_servers', ' ', 1)`
+ --let $_ds_servers= `SELECT TRIM(SUBSTRING('$_ds_servers', 1 + LENGTH('_$ds_server_number')))`
+ --let $_ds_outfile= $MYSQLTEST_VARDIR/tmp/diff_servers_$_ds_server_number
+
+ if ($rpl_debug)
+ {
+ --echo generating dump from server '$_ds_server_number' using command '$_ds_pre_command$_ds_server_number $_ds_post_command > $_ds_outfile'
+ --echo remaining servers: '$_ds_servers'
+ }
+ --exec $_ds_pre_command$_ds_server_number $_ds_post_command > $_ds_outfile
+
+ if ($_ds_prev_outfile != '')
+ {
+ if ($rpl_debug)
+ {
+ --echo diffing files '$_ds_prev_outfile' and '$_ds_outfile'
+ }
+ --diff_files $_ds_prev_outfile $_ds_outfile
+
+ --remove_file $_ds_prev_outfile
+ }
+ --let $_ds_prev_outfile= $_ds_outfile
+}
+
+--remove_file $_ds_prev_outfile
+
+--let $include_filename= diff_servers.inc [servers=$_ds_info]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/equal_fields_propagation_datetime.inc b/mysql-test/include/equal_fields_propagation_datetime.inc
new file mode 100644
index 00000000000..97a30a83df6
--- /dev/null
+++ b/mysql-test/include/equal_fields_propagation_datetime.inc
@@ -0,0 +1,64 @@
+
+# Trailing garbage in string literals
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a='2001-01-01 00:00:00x';
+SELECT * FROM t1 WHERE LENGTH(a) != 20;
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
+DROP TABLE t1;
+
+# Leading spaces in string literals
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
+# This should not propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
+DROP TABLE t1;
+
+# Trailing fractional digits in temporal literals
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+DROP TABLE t1;
+
+# Trailing fractional digits in temporal literals, the same precision
+--eval CREATE TABLE t1 (a $TYPE(6));
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+SELECT * FROM t1 WHERE LENGTH(a)=26;
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+DROP TABLE t1;
+
+# DATETIME/TIMESTAMP column vs TIME literal
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIME'00:00:00';
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
+DROP TABLE t1;
+
diff --git a/mysql-test/include/explain_non_select.inc b/mysql-test/include/explain_non_select.inc
index a0f86e744b0..57b96994d20 100644
--- a/mysql-test/include/explain_non_select.inc
+++ b/mysql-test/include/explain_non_select.inc
@@ -771,7 +771,7 @@ DROP TABLE t1,t2;
--echo #74
-CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1(a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
--echo # used key is modified & Using temporary
diff --git a/mysql-test/include/filter_file.inc b/mysql-test/include/filter_file.inc
index 17c7c1985d7..bfe53896710 100644
--- a/mysql-test/include/filter_file.inc
+++ b/mysql-test/include/filter_file.inc
@@ -53,6 +53,9 @@
#
# $rpl_debug
# If set, verbose debug info is printed.
+#
+# $filter_script
+# If set, rows matching this regexp will be filtered out
--let $include_filename= filter_file.inc
--source include/begin_include_file.inc
@@ -67,10 +70,12 @@ if ($rpl_debug)
--let _FF_PRE_SCRIPT= $pre_script
--let _FF_SCRIPT= $script
+--let _FF_FILTER_SCRIPT= $filter_script
--let _FF_INPUT_FILE= $input_file
--let _FF_OUTPUT_FILE= $output_file
--let _FF_SELECT_COLUMNS= $select_columns
--let _FF_DEBUG= $rpl_debug
+
if (!$output_file)
{
--let _FF_OUTPUT_FILE= $input_file
@@ -79,6 +84,7 @@ perl;
my $pre_script = $ENV{'_FF_PRE_SCRIPT'};
$pre_script =~ s/DOLLAR/\$/g;
my $script = $ENV{'_FF_SCRIPT'};
+ my $filter_script = $ENV{'_FF_FILTER_SCRIPT'};
$script =~ s/DOLLAR/\$/g;
my $input_file = $ENV{'_FF_INPUT_FILE'};
my $output_file = $ENV{'_FF_OUTPUT_FILE'};
@@ -123,7 +129,10 @@ perl;
{
' . $script . '
}
- $filtered_contents .= $_."\n";
+ if (!$filter_script || ! m/$filter_script/)
+ {
+ $filtered_contents .= $_."\n";
+ }
}
close FILE or die "Error closing $input_file: $!";
open FILE, "> $output_file" or die "Error opening $output_file: $!";
diff --git a/mysql-test/include/func_hybrid_type.inc b/mysql-test/include/func_hybrid_type.inc
new file mode 100644
index 00000000000..854c7ebd34e
--- /dev/null
+++ b/mysql-test/include/func_hybrid_type.inc
@@ -0,0 +1,81 @@
+# "mtr --ps" returns different values in "Max length"
+--disable_ps_protocol
+--enable_metadata
+--vertical_results
+SELECT
+ a AS ___________a,
+ CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+ CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+ COALESCE(a) AS coalesce___a,
+ COALESCE(a, a) AS coalesce_a_a,
+ IF(a IS NULL, a, a) AS if_______a_a,
+ IFNULL(a, a) AS ifnull___a_a,
+ LEAST(a, a) AS least____a_a,
+ GREATEST(a, a) AS greatest_a_a,
+ b AS ___________b,
+ CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+ CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+ COALESCE(b) AS coalesce___b,
+ COALESCE(b, b) AS coalesce_b_b,
+ IF(a IS NULL, b, b) AS if_______b_b,
+ IFNULL(b, b) AS ifnull___b_b,
+ LEAST(b, b) AS least____b_b,
+ GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SELECT
+ CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+ CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+ COALESCE(a, b) AS coalesce_a_b,
+ COALESCE(b, a) AS coalesce_b_a,
+ IF(a IS NULL, a, b) AS if_______a_b,
+ IF(a IS NULL, b, a) AS if_______b_a,
+ IFNULL(a, b) AS ifnull___a_b,
+ IFNULL(b, a) AS ifnull___b_a,
+ LEAST(a, b) AS least____a_b,
+ LEAST(b, a) AS least____b_a,
+ GREATEST(a, b) AS greatest_a_b,
+ GREATEST(b, a) AS greatest_b_a
+FROM t1;
+--horizontal_results
+--disable_metadata
+--enable_ps_protocol
+CREATE TABLE t2 AS
+SELECT
+ a AS ___________a,
+ CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+ CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+ COALESCE(a) AS coalesce___a,
+ COALESCE(a, a) AS coalesce_a_a,
+ IF(a IS NULL, a, a) AS if_______a_a,
+ IFNULL(a, a) AS ifnull___a_a,
+ LEAST(a, a) AS least____a_a,
+ GREATEST(a, a) AS greatest_a_a,
+ b AS ___________b,
+ CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+ CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+ COALESCE(b) AS coalesce___b,
+ COALESCE(b, b) AS coalesce_b_b,
+ IF(a IS NULL, b, b) AS if_______b_b,
+ IFNULL(b, b) AS ifnull___b_b,
+ LEAST(b, b) AS least____b_b,
+ GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+ CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+ CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+ COALESCE(a, b) AS coalesce_a_b,
+ COALESCE(b, a) AS coalesce_b_a,
+ IF(a IS NULL, a, b) AS if_______a_b,
+ IF(a IS NULL, b, a) AS if_______b_a,
+ IFNULL(a, b) AS ifnull___a_b,
+ IFNULL(b, a) AS ifnull___b_a,
+ LEAST(a, b) AS least____a_b,
+ LEAST(b, a) AS least____b_a,
+ GREATEST(a, b) AS greatest_a_b,
+ GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
diff --git a/mysql-test/include/func_str_ascii_checksum.inc b/mysql-test/include/func_str_ascii_checksum.inc
new file mode 100644
index 00000000000..8e51c92c1ac
--- /dev/null
+++ b/mysql-test/include/func_str_ascii_checksum.inc
@@ -0,0 +1,24 @@
+--echo # Start of func_str_ascii_checksum.inc
+
+--echo #
+--echo # MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
+--echo #
+
+--eval CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2))
+--eval INSERT INTO t1 VALUES ('test',$func('test')), ('TEST', $func('TEST'))
+--eval SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST"))
+--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST"))
+--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("TEST") OR f2= $func("test"))
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
+--echo #
+
+--eval PREPARE stmt FROM "SELECT $func(CONVERT('foo' USING latin1))"
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+--echo # End of func_str_ascii_checksum.inc
diff --git a/mysql-test/include/galera_clear_sync_point.inc b/mysql-test/include/galera_clear_sync_point.inc
new file mode 100644
index 00000000000..589522a55b0
--- /dev/null
+++ b/mysql-test/include/galera_clear_sync_point.inc
@@ -0,0 +1 @@
+SET GLOBAL wsrep_provider_options = 'dbug=';
diff --git a/mysql-test/include/galera_cluster.inc b/mysql-test/include/galera_cluster.inc
new file mode 100644
index 00000000000..c1834c3c26f
--- /dev/null
+++ b/mysql-test/include/galera_cluster.inc
@@ -0,0 +1,12 @@
+# galera_cluster.inc
+# ==================
+#
+# Description
+# -----------
+# Configure galera cluster with 2 nodes.
+#
+
+--let $galera_cluster_size = 2
+--source include/galera_init.inc
+
+--source include/have_innodb.inc
diff --git a/mysql-test/include/galera_connect.inc b/mysql-test/include/galera_connect.inc
new file mode 100644
index 00000000000..9d458c5e063
--- /dev/null
+++ b/mysql-test/include/galera_connect.inc
@@ -0,0 +1,48 @@
+# galera_connect.inc
+# ==================
+#
+# Description
+# -----------
+# Open a connection to the specified server number ($galera_server_number).
+# The connection itself would be identified by $galera_connection_name.
+#
+# Parameters
+# ----------
+# $galera_connection_name
+# Name of the resulting connection.
+#
+# $galera_server_number
+# Sequence number of the node in the galera cluster.
+#
+# $galera_debug
+# Print debug information.
+#
+
+if (!$galera_connection_name)
+{
+ --die ERROR IN TEST: $galera_connection_name must be set before sourcing include/galera_connect.inc
+}
+
+if (!$galera_server_number)
+{
+ --die ERROR IN TEST: $galera_server_number must be set before sourcing include/galera_connect.inc
+}
+
+--let $_galera_port= \$NODE_MYPORT_$galera_server_number
+if (!$_galera_port)
+{
+ --echo Bug in test case: '\$NODE_MYPORT_$galera_server_number' not initialized. Check the test's .cfg file.
+ --die Not all NODE_MYPORT_* environment variables are setup correctly.
+}
+
+if ($galera_debug)
+{
+ --echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
+}
+
+# Temporal solution to avoid concurrent IST MDEV-7178
+--sleep 1
+
+# Open a connection
+--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
+
diff --git a/mysql-test/include/galera_diff.inc b/mysql-test/include/galera_diff.inc
new file mode 100644
index 00000000000..6043b582647
--- /dev/null
+++ b/mysql-test/include/galera_diff.inc
@@ -0,0 +1,100 @@
+# galera_diff.inc
+# ===============
+#
+# Description
+# -----------
+# Compare the output of the given statement on all the nodes of the cluster.
+#
+# Parameters
+# ----------
+# $galera_diff_statement
+# Statement for which the output would be compared.
+#
+# $galera_diff_database
+# Database against which the above statement would be executed.
+# (Default : test)
+#
+# $galera_diff_servers
+# Comma separated list of servers to executed the diff statement on. If not
+# set, a list of servers will be generated based on $galera_cluster_size.
+#
+# $galerra_debug
+# Print debug information.
+#
+
+if (!$galera_diff_statement)
+{
+ --die ERROR IN TEST: $galera_diff_statement must be set before sourcing include/galera_diff.inc
+}
+
+--let $_galera_diff_database = $galera_diff_database
+if (!$_galera_diff_database)
+{
+ --let $_galera_diff_database = test
+}
+
+--let $_galera_diff_servers= $galera_diff_servers
+if (!$_galera_diff_servers)
+{
+ --let $_i= $galera_cluster_size
+ --let $_galera_diff_servers=
+ while ($_i)
+ {
+ --let $_galera_diff_servers= $_i,$_galera_diff_servers
+ --dec $_i
+ }
+}
+if ($galera_debug)
+{
+ --echo \$galera_diff_servers= '$_galera_diff_servers'
+}
+
+if (!$galera_debug)
+{
+ --disable_query_log
+}
+
+# Generate file containing $galera_diff_statement. We don't pass the
+# statement on the command line, because it would be subject to shell
+# substitutions.
+--let $write_to_file= GENERATE
+--let $write_var= $galera_diff_statement
+--source include/write_var_to_file.inc
+--let $_galera_diff_statement_file= $write_to_file
+
+if (!$galera_debug)
+{
+ --enable_query_log
+}
+
+# Compare all servers.
+--let $_galera_diff_first= 1
+while ($_galera_diff_servers)
+{
+ # Set $_galera_diff_server_i to the first number in the list
+ --let $_galera_diff_server_i= `SELECT SUBSTRING_INDEX('$_galera_diff_servers', ',', 1)`
+ # Remove $_galera_diff_server_i from the list
+ --let $_galera_diff_servers= `SELECT SUBSTRING('$_galera_diff_servers', LENGTH('$_galera_diff_server_i') + 2)`
+
+ # Execute statement
+ --let $_galera_diff_file= $MYSQLTEST_VARDIR/tmp/_galera_diff_server-$_galera_diff_server_i.tmp
+ --exec $MYSQL --defaults-group-suffix=.$_galera_diff_server_i $_galera_diff_database < $_galera_diff_statement_file > $_galera_diff_file
+
+ # Compare
+ if (!$_galera_diff_first)
+ {
+ if ($galera_debug)
+ {
+ --echo diffing $_galera_diff_file and $_galera_diff_prev_file
+ }
+ --diff_files $_galera_diff_file $_galera_diff_prev_file
+ --remove_file $_galera_diff_prev_file
+ }
+ --let $_galera_diff_prev_file= $_galera_diff_file
+ --let $_galera_diff_first= 0
+}
+
+# Cleanup
+--remove_file $_galera_diff_prev_file
+--remove_file $_galera_diff_statement_file
+
diff --git a/mysql-test/include/galera_end.inc b/mysql-test/include/galera_end.inc
new file mode 100644
index 00000000000..0fb5479844e
--- /dev/null
+++ b/mysql-test/include/galera_end.inc
@@ -0,0 +1,25 @@
+# galera_end.inc
+# ==============
+#
+# Description
+# -----------
+# Closes the connections opened via include/galera_init.inc
+#
+# Parameters
+# ----------
+# $galera_cluster_size
+# Number of nodes in the cluster.
+#
+
+--let $_galera_node= $galera_cluster_size
+
+while ($_galera_node)
+{
+ if ($galera_debug)
+ {
+ --echo Disconnecting node_$_galera_node
+ }
+ --disconnect node_$_galera_node
+ --dec $_galera_node
+}
+
diff --git a/mysql-test/include/galera_init.inc b/mysql-test/include/galera_init.inc
new file mode 100644
index 00000000000..79591973862
--- /dev/null
+++ b/mysql-test/include/galera_init.inc
@@ -0,0 +1,26 @@
+# galera_init.inc
+# ===============
+#
+# Description
+# -----------
+# Set up a Galera cluster with $wsrep_cluster_size nodes.
+#
+# Parameters
+# ----------
+# $galera_cluster_size
+# Number of nodes in the cluster.
+#
+
+--source include/have_wsrep_enabled.inc
+
+--let $_galera_node= $galera_cluster_size
+
+while ($_galera_node)
+{
+ --let $galera_connection_name= node_$_galera_node
+ --let $galera_server_number= $_galera_node
+ --source include/galera_connect.inc
+
+ --dec $_galera_node
+}
+
diff --git a/mysql-test/include/galera_set_sync_point.inc b/mysql-test/include/galera_set_sync_point.inc
new file mode 100644
index 00000000000..5fe4e8c38c0
--- /dev/null
+++ b/mysql-test/include/galera_set_sync_point.inc
@@ -0,0 +1 @@
+--eval SET GLOBAL wsrep_provider_options = 'dbug=d,$galera_sync_point'
diff --git a/mysql-test/include/galera_signal_sync_point.inc b/mysql-test/include/galera_signal_sync_point.inc
new file mode 100644
index 00000000000..eaa5cdd43f5
--- /dev/null
+++ b/mysql-test/include/galera_signal_sync_point.inc
@@ -0,0 +1 @@
+--eval SET GLOBAL wsrep_provider_options = 'signal=$galera_sync_point'
diff --git a/mysql-test/include/galera_wait_ready.inc b/mysql-test/include/galera_wait_ready.inc
new file mode 100644
index 00000000000..e20f01fad90
--- /dev/null
+++ b/mysql-test/include/galera_wait_ready.inc
@@ -0,0 +1,2 @@
+let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'ON';
+--source include/wait_condition.inc
diff --git a/mysql-test/include/galera_wait_sync_point.inc b/mysql-test/include/galera_wait_sync_point.inc
new file mode 100644
index 00000000000..cf3a4980186
--- /dev/null
+++ b/mysql-test/include/galera_wait_sync_point.inc
@@ -0,0 +1,6 @@
+--let $wait_timeout = 10
+--let $wsrep_on_orig = `SELECT @@wsrep_on`
+SET SESSION wsrep_on = 0;
+--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point'
+--source include/wait_condition.inc
+--eval SET SESSION wsrep_on = $wsrep_on_orig
diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc
index 47eef1cdb67..111b35d6940 100644
--- a/mysql-test/include/grant_cache.inc
+++ b/mysql-test/include/grant_cache.inc
@@ -37,12 +37,16 @@
--source include/add_anonymous_users.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
#
--disable_warnings
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
--enable_warnings
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
reset query cache;
@@ -214,5 +218,9 @@ drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;
set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
--source include/delete_anonymous_users.inc
+set GLOBAL sql_mode=default;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/include/have_aria.inc b/mysql-test/include/have_aria.inc
new file mode 100644
index 00000000000..18f2b4b0063
--- /dev/null
+++ b/mysql-test/include/have_aria.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'aria' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires Aria
+}
diff --git a/mysql-test/include/have_innodb.combinations b/mysql-test/include/have_innodb.combinations
index 5b8d376d1b9..49ae741b269 100644
--- a/mysql-test/include/have_innodb.combinations
+++ b/mysql-test/include/have_innodb.combinations
@@ -3,12 +3,14 @@ ignore-builtin-innodb
plugin-load-add=$HA_INNODB_SO
innodb
innodb-cmpmem
+innodb-cmp-per-index
innodb-trx
+innodb-locks
innodb-buffer-pool-stats
innodb-buffer-page
innodb-buffer-page-lru
innodb-sys-foreign
-innodb-sys-foreign-col
+innodb-sys-foreign-cols
innodb-sys-tables
innodb-metrics
@@ -17,24 +19,27 @@ ignore-builtin-innodb
plugin-load-add=$HA_XTRADB_SO
innodb
innodb-cmpmem
+innodb-cmp-per-index
innodb-trx
+innodb-locks
innodb-buffer-pool-stats
innodb-buffer-page
innodb-buffer-page-lru
innodb-sys-foreign
-innodb-sys-foreign-col
+innodb-sys-foreign-cols
innodb-sys-tables
innodb-metrics
[xtradb]
innodb
innodb-cmpmem
+innodb-cmp-per-index
innodb-trx
+innodb-locks
innodb-metrics
innodb-buffer-pool-stats
innodb-buffer-page
innodb-buffer-page-lru
innodb-sys-foreign
-innodb-sys-foreign-col
+innodb-sys-foreign-cols
innodb-sys-tables
-innodb-metrics
diff --git a/mysql-test/include/have_innodb_32k.inc b/mysql-test/include/have_innodb_32k.inc
new file mode 100644
index 00000000000..76a8d2d59a3
--- /dev/null
+++ b/mysql-test/include/have_innodb_32k.inc
@@ -0,0 +1,6 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 32768`)
+{
+
+ --skip Test requires InnoDB with 32k Page size.
+
+} \ No newline at end of file
diff --git a/mysql-test/include/have_innodb_64k.inc b/mysql-test/include/have_innodb_64k.inc
new file mode 100644
index 00000000000..bcb76c4f54e
--- /dev/null
+++ b/mysql-test/include/have_innodb_64k.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 65536`)
+{
+ --skip Test requires InnoDB with 64k Page size.
+}
diff --git a/mysql-test/include/have_innodb_bzip2.inc b/mysql-test/include/have_innodb_bzip2.inc
new file mode 100644
index 00000000000..afbe78f0cf9
--- /dev/null
+++ b/mysql-test/include/have_innodb_bzip2.inc
@@ -0,0 +1,4 @@
+if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_bzip2' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with libbz2
+}
diff --git a/mysql-test/include/have_innodb_disallow_writes.inc b/mysql-test/include/have_innodb_disallow_writes.inc
new file mode 100644
index 00000000000..83b516b7a34
--- /dev/null
+++ b/mysql-test/include/have_innodb_disallow_writes.inc
@@ -0,0 +1,6 @@
+--source include/have_innodb.inc
+
+if (`SELECT COUNT(*) = 0 from INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME = 'INNODB_DISALLOW_WRITES'`) {
+ --skip Test requires 'innodb_disallow_writes'
+}
diff --git a/mysql-test/include/have_innodb_lz4.inc b/mysql-test/include/have_innodb_lz4.inc
new file mode 100644
index 00000000000..bda3ffa8623
--- /dev/null
+++ b/mysql-test/include/have_innodb_lz4.inc
@@ -0,0 +1,4 @@
+if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lz4' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with liblz4
+}
diff --git a/mysql-test/include/have_innodb_lzma.inc b/mysql-test/include/have_innodb_lzma.inc
new file mode 100644
index 00000000000..86eda33f194
--- /dev/null
+++ b/mysql-test/include/have_innodb_lzma.inc
@@ -0,0 +1,4 @@
+if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzma' AND variable_value = 'ON' `)
+{
+ --skip Test requires InnoDB compiled with liblzma
+}
diff --git a/mysql-test/include/have_innodb_lzo.inc b/mysql-test/include/have_innodb_lzo.inc
new file mode 100644
index 00000000000..f40418b00fb
--- /dev/null
+++ b/mysql-test/include/have_innodb_lzo.inc
@@ -0,0 +1,4 @@
+if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzo' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with liblzo
+}
diff --git a/mysql-test/include/have_innodb_snappy.inc b/mysql-test/include/have_innodb_snappy.inc
new file mode 100644
index 00000000000..c4dca4c19ee
--- /dev/null
+++ b/mysql-test/include/have_innodb_snappy.inc
@@ -0,0 +1,4 @@
+if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_snappy' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with libsnappy
+}
diff --git a/mysql-test/include/have_max_indexes_128.inc b/mysql-test/include/have_max_indexes_128.inc
new file mode 100644
index 00000000000..0cb58afc61a
--- /dev/null
+++ b/mysql-test/include/have_max_indexes_128.inc
@@ -0,0 +1,5 @@
+--source include/max_indexes.inc
+
+if (`SELECT "$max_indexes" NOT REGEXP "^128U?\$"`) {
+ --skip Test needs mysqld built with --with-max-indexes=128
+}
diff --git a/mysql-test/include/have_max_indexes_64.inc b/mysql-test/include/have_max_indexes_64.inc
new file mode 100644
index 00000000000..dda2c263616
--- /dev/null
+++ b/mysql-test/include/have_max_indexes_64.inc
@@ -0,0 +1,5 @@
+--source include/max_indexes.inc
+
+if (`SELECT "$max_indexes" NOT REGEXP "^64U?\$"`) {
+ --skip Test needs mysqld built with --with-max-indexes=64U
+}
diff --git a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc
deleted file mode 100644
index 8dbfa2aa034..00000000000
--- a/mysql-test/include/have_multi_ndb.inc
+++ /dev/null
@@ -1,52 +0,0 @@
-# Setup connections to both MySQL Servers connected to the cluster
-connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
-
-# Check that server1 has NDB support
-connection server1;
-let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
-disable_query_log;
-if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
-{
---require r/true.require
-SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
---source include/ndb_not_readonly.inc
-}
-enable_query_log;
-
-# Check that server2 has NDB support
-connection server2;
-let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
-disable_query_log;
-if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
-{
---require r/true.require
-SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
---source include/ndb_not_readonly.inc
-}
-enable_query_log;
-
-# cleanup
-
-connection server1;
-disable_query_log;
-disable_warnings;
---error 0,1051
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-flush tables;
-flush status;
-enable_warnings;
-enable_query_log;
-
-connection server2;
-disable_query_log;
-disable_warnings;
---error 0,1051
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-flush tables;
-flush status;
-enable_warnings;
-enable_query_log;
-
-# Set the default connection
-connection server1;
diff --git a/mysql-test/include/have_mutex_deadlock_detector.inc b/mysql-test/include/have_mutex_deadlock_detector.inc
index 3672f3eccef..88a7484a3e8 100644
--- a/mysql-test/include/have_mutex_deadlock_detector.inc
+++ b/mysql-test/include/have_mutex_deadlock_detector.inc
@@ -1,4 +1,3 @@
---require r/have_mutex_deadlock_detector.require
-disable_query_log;
-select 1 from information_schema.global_variables where variable_name = "mutex_deadlock_detector";
-enable_query_log;
+if (`select count(*)=0 from information_schema.global_variables where variable_name = "debug_mutex_deadlock_detector"`) {
+ skip needs safemutex deadlock detector;
+}
diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc
deleted file mode 100644
index 1266f80c8cd..00000000000
--- a/mysql-test/include/have_ndb.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-# Check that server is compiled and started with support for NDB
---source include/have_multi_ndb.inc
diff --git a/mysql-test/include/have_ndb_extra.inc b/mysql-test/include/have_ndb_extra.inc
deleted file mode 100644
index 4837a7ad4ea..00000000000
--- a/mysql-test/include/have_ndb_extra.inc
+++ /dev/null
@@ -1,2 +0,0 @@
--- require r/have_ndb_extra.require
-eval select $NDB_EXTRA_TEST;
diff --git a/mysql-test/include/have_ndbapi_examples.inc b/mysql-test/include/have_ndbapi_examples.inc
deleted file mode 100644
index 88499d555c0..00000000000
--- a/mysql-test/include/have_ndbapi_examples.inc
+++ /dev/null
@@ -1,4 +0,0 @@
---require r/have_ndbapi_examples.require
-disable_query_log;
-eval select LENGTH('$NDB_EXAMPLES_BINARY') > 0 as 'have_ndb_example';
-enable_query_log;
diff --git a/mysql-test/include/have_sequence.inc b/mysql-test/include/have_sequence.inc
new file mode 100644
index 00000000000..b509d605177
--- /dev/null
+++ b/mysql-test/include/have_sequence.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'sequence' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires Sequence engine
+}
diff --git a/mysql-test/include/have_sequence.opt b/mysql-test/include/have_sequence.opt
new file mode 100644
index 00000000000..d08d8f112cd
--- /dev/null
+++ b/mysql-test/include/have_sequence.opt
@@ -0,0 +1 @@
+--loose-sequence
diff --git a/mysql-test/include/have_wsrep.inc b/mysql-test/include/have_wsrep.inc
new file mode 100644
index 00000000000..52220edf481
--- /dev/null
+++ b/mysql-test/include/have_wsrep.inc
@@ -0,0 +1,8 @@
+# To be used in a test which requires server to be compiled with wsrep support
+# (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE.
+
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`)
+{
+ --skip Test requires wsrep plugin.
+}
+
diff --git a/mysql-test/include/have_wsrep_enabled.inc b/mysql-test/include/have_wsrep_enabled.inc
new file mode 100644
index 00000000000..94eccadec3b
--- /dev/null
+++ b/mysql-test/include/have_wsrep_enabled.inc
@@ -0,0 +1,11 @@
+# To be used in a test which requires wsrep plugin to be ACTIVE and enabled
+# (i.e. wsrep_on=ON). It includes have_wsrep.inc.
+
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_on' AND VARIABLE_VALUE='ON'`)
+{
+ --skip Test requires wsrep_on=ON
+}
+
diff --git a/mysql-test/include/have_wsrep_provider.inc b/mysql-test/include/have_wsrep_provider.inc
new file mode 100644
index 00000000000..818abdd43b0
--- /dev/null
+++ b/mysql-test/include/have_wsrep_provider.inc
@@ -0,0 +1,6 @@
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE
+ VARIABLE_NAME LIKE 'wsrep_provider' AND VARIABLE_VALUE NOT LIKE 'none'`)
+{
+ --skip Test requires wsrep provider library (libgalera_smm.so)
+}
+
diff --git a/mysql-test/include/have_xtradb.combinations b/mysql-test/include/have_xtradb.combinations
index 20e07c62635..0419dc91171 100644
--- a/mysql-test/include/have_xtradb.combinations
+++ b/mysql-test/include/have_xtradb.combinations
@@ -4,10 +4,10 @@ plugin-load-add=$HA_XTRADB_SO
innodb
innodb-cmpmem
innodb-trx
-innodb-sys-index
+innodb-sys-indexes
[xtradb]
innodb
innodb-cmpmem
innodb-trx
-innodb-sys-index
+innodb-sys-indexes
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc
index 7c9feea55c2..88d6923d8f9 100644
--- a/mysql-test/include/icp_tests.inc
+++ b/mysql-test/include/icp_tests.inc
@@ -443,13 +443,13 @@ DROP TABLE t1;
--echo # when ICP is on"
--echo #
-CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t1 VALUES (11,0);
INSERT INTO t1 VALUES (12,5);
INSERT INTO t1 VALUES (15,0);
-CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t2 VALUES (11,1);
INSERT INTO t2 VALUES (12,2);
@@ -639,6 +639,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
+# MDEV-8189 field<>const and const<>field are not symmetric
+# Do the same EXPLAIN and SELECT
+# with "t1.d1 <> t2.pk" instead of "t2.pk <> t1.d1"
+
+EXPLAIN
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+ WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+ WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+
DROP TABLE t1, t2;
--echo #
diff --git a/mysql-test/include/innodb_encrypt_log.combinations b/mysql-test/include/innodb_encrypt_log.combinations
new file mode 100644
index 00000000000..fd21a57c3c2
--- /dev/null
+++ b/mysql-test/include/innodb_encrypt_log.combinations
@@ -0,0 +1,7 @@
+[crypt]
+innodb_encrypt_log=ON
+innodb_encryption_rotate_key_age=1
+plugin_load_add=$DEBUG_KEY_MANAGEMENT_SO
+
+[clear]
+skip_innodb_encrypt_log
diff --git a/mysql-test/include/innodb_encrypt_log.inc b/mysql-test/include/innodb_encrypt_log.inc
new file mode 100644
index 00000000000..5beebeae81f
--- /dev/null
+++ b/mysql-test/include/innodb_encrypt_log.inc
@@ -0,0 +1,4 @@
+# The goal of including this file is to enable innodb_encrypt_log combinations
+# (see include/innodb_encrypt_log.combinations)
+
+--source include/have_innodb.inc
diff --git a/mysql-test/include/innodb_page_size.combinations b/mysql-test/include/innodb_page_size.combinations
index a9b7c7ce14d..b9b1e1b106f 100644
--- a/mysql-test/include/innodb_page_size.combinations
+++ b/mysql-test/include/innodb_page_size.combinations
@@ -1,3 +1,11 @@
+[64k]
+innodb-page-size=64K
+innodb-buffer-pool-size=24M
+
+[32k]
+innodb-page-size=32K
+innodb-buffer-pool-size=24M
+
[16k]
innodb-page-size=16K
diff --git a/mysql-test/include/innodb_undo_tablespaces.combinations b/mysql-test/include/innodb_undo_tablespaces.combinations
new file mode 100644
index 00000000000..0ac7a6e2d05
--- /dev/null
+++ b/mysql-test/include/innodb_undo_tablespaces.combinations
@@ -0,0 +1,5 @@
+[undo0]
+innodb-undo-tablespaces=0
+
+[undo3]
+innodb-undo-tablespaces=3
diff --git a/mysql-test/include/innodb_undo_tablespaces.inc b/mysql-test/include/innodb_undo_tablespaces.inc
new file mode 100644
index 00000000000..b109fcc4f0e
--- /dev/null
+++ b/mysql-test/include/innodb_undo_tablespaces.inc
@@ -0,0 +1,3 @@
+# The goal of including this file is to enable innodb_undo_tablespaces combinations
+# (see include/innodb_undo_tablespaces.combinations)
+
diff --git a/mysql-test/include/loaddata_autocom.inc b/mysql-test/include/loaddata_autocom.inc
index bb286fb4169..3bf88fefa6d 100644
--- a/mysql-test/include/loaddata_autocom.inc
+++ b/mysql-test/include/loaddata_autocom.inc
@@ -1,5 +1,4 @@
# Test if the engine does autocommit in LOAD DATA INFILE, or not
-# (NDB wants to do, others don't).
eval SET SESSION STORAGE_ENGINE = $engine_type;
@@ -9,8 +8,6 @@ drop table if exists t1;
let $load_file= $MYSQLTEST_VARDIR/std_data/loaddata2.dat;
-# NDB does not support the create option 'Binlog of table with BLOB attribute and no PK'
-# So use a dummy PK here.
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
start transaction;
--replace_result $load_file LOAD_FILE
diff --git a/mysql-test/include/maria_verify_recovery.inc b/mysql-test/include/maria_verify_recovery.inc
index 9b56061b2b4..b0f95d2a94b 100644
--- a/mysql-test/include/maria_verify_recovery.inc
+++ b/mysql-test/include/maria_verify_recovery.inc
@@ -78,6 +78,8 @@ let $mms_purpose=comparison;
let $mms_compare_physically=$mms_compare_physically_save;
while ($mms_table_to_use)
{
+ # the size of the index file is different for with/without encryption
+ --replace_result 372 <SIZE> 394 <SIZE>
eval check table $mms_tname$mms_table_to_use extended;
--echo * testing that checksum after recovery is as expected
let $new_checksum=`CHECKSUM TABLE $mms_tname$mms_table_to_use`;
diff --git a/mysql-test/include/max_indexes.inc b/mysql-test/include/max_indexes.inc
new file mode 100644
index 00000000000..ce233b9fb67
--- /dev/null
+++ b/mysql-test/include/max_indexes.inc
@@ -0,0 +1,2 @@
+# Warning: This is an auto-generated file. Please do not modify it.
+--let $max_indexes = 64U
diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc
index d6becb2e37e..cdc39f8407f 100644
--- a/mysql-test/include/mix2.inc
+++ b/mysql-test/include/mix2.inc
@@ -500,7 +500,7 @@ drop table t1;
# Test of opening table twice and timestamps
#
set @a:=now();
-eval CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=$engine_type;
+eval CREATE TABLE t1 (a int not null, b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key (a)) engine=$engine_type;
insert into t1 (a) values(1),(2),(3);
select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
select a from t1 natural join t1 as t2 where b >= @a order by a;
@@ -727,9 +727,9 @@ eval CREATE TABLE t1 (
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
- last_mod_date timestamp NOT NULL,
+ last_mod_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
last_mod_id smallint(6) NOT NULL default '0',
- last_app_date timestamp NOT NULL,
+ last_app_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
@@ -746,9 +746,9 @@ eval CREATE TABLE t2 (
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
- last_mod_date timestamp NOT NULL,
+ last_mod_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
last_mod_id smallint(6) NOT NULL default '0',
- last_app_date timestamp NOT NULL,
+ last_app_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index e34e32ad1a6..6b25c75276c 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -40,6 +40,11 @@ BEGIN
-- except those that was created during bootstrap
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
+ -- and the mtr_wsrep_notify schema which is populated by the std_data/wsrep_notify.sh script
+ -- and the suite/galera/t/galera_var_notify_cmd.test
+ -- and the wsrep_schema schema that may be created by Galera
+ SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema');
+
-- The test database should not contain any tables
SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema='test';
@@ -47,7 +52,7 @@ BEGIN
-- Show "mysql" database, tables and columns
SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql
FROM INFORMATION_SCHEMA.TABLES
- WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
+ 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,
@@ -55,7 +60,7 @@ BEGIN
numeric_precision, numeric_scale, character_set_name,
collation_name, column_type, column_key, extra, column_comment
FROM INFORMATION_SCHEMA.COLUMNS
- WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
+ WHERE table_schema='mysql'
ORDER BY columns_in_mysql;
-- Dump all events, there should be none
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 0382edf8097..535090b75dd 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -115,9 +115,6 @@ INSERT INTO global_suppressions VALUES
("unknown variable 'loose-"),
("You have forced lower_case_table_names to 0 through a command-line option"),
("Setting lower_case_table_names=2"),
- ("NDB Binlog:"),
- ("NDB: failed to setup table"),
- ("NDB: only row based binary logging"),
("Neither --relay-log nor --relay-log-index were used"),
("Query partially completed"),
("Slave I.O thread aborted while waiting for relay log"),
@@ -139,7 +136,6 @@ INSERT INTO global_suppressions VALUES
("Slave: The incident LOST_EVENTS occurred on the master"),
("Slave: Unknown error.* 1105"),
("Slave: Can't drop database.* database doesn't exist"),
- ("Time-out in NDB"),
("Warning:\s+One can only use the --user.*root"),
("Warning:\s+Table:.* on (delete|rename)"),
("You have an error in your SQL syntax"),
@@ -169,6 +165,9 @@ INSERT INTO global_suppressions VALUES
("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
+ /*It will print a warning if server is run without --explicit_defaults_for_timestamp.*/
+ ("TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details)*"),
+
/* Added 2009-08-XX after fixing Bug #42408 */
("Although a path was specified for the .* option, log tables are used"),
diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc
index f775d782b28..2fc14d599d9 100644
--- a/mysql-test/include/mysqlhotcopy.inc
+++ b/mysql-test/include/mysqlhotcopy.inc
@@ -109,7 +109,7 @@ DROP DATABASE hotcopy_save;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
---error 1
+--error 1,9,11,110,2304,255
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
diff --git a/mysql-test/include/ndb_backup.inc b/mysql-test/include/ndb_backup.inc
deleted file mode 100644
index eef3bf2bd1e..00000000000
--- a/mysql-test/include/ndb_backup.inc
+++ /dev/null
@@ -1,48 +0,0 @@
-######################################################
-# By JBM 2006-02-16 So that the code is not repeated #
-# in test cases and can be reused. #
-######################################################
-
---exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
-
-# To find the backupid, we must dump this data to a table, and SELECT
-# what we want into an outfile. This could be accomplished with grep, but
-# grep isn't Windows-portable
-
---disable_query_log
-# create a table to help us out
---disable_warnings # leave this on until done with the entire process
-# cleanup
-DROP TABLE IF EXISTS helper1;
-CREATE TABLE helper1(c1 VARCHAR(20));
-# dump raw data to file
-let $ndb_backup_file1= $MYSQLTEST_VARDIR/ndb_backup_tmp.dat;
-let $ndb_backup_file2= $MYSQLTEST_VARDIR/tmp.dat;
---disable_warnings
---error 0,1
---remove_file $ndb_backup_file1
---enable_warnings
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 > $ndb_backup_file1
-# load the table from the raw data file
-eval LOAD DATA INFILE '$ndb_backup_file1' INTO TABLE helper1;
---remove_file $ndb_backup_file1
-# output what we need
-eval SELECT * FROM helper1 WHERE c1 LIKE '%520093696%'
-INTO OUTFILE '$ndb_backup_file2';
-# cleanup
-DROP TABLE helper1;
---enable_warnings
---enable_query_log
-
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval LOAD DATA INFILE '$ndb_backup_file2' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
---remove_file $ndb_backup_file2
-
-# Load backup id into environment variable
-let the_backup_id=`SELECT backup_id from test.backup_info`;
-
-DROP TABLE test.backup_info;
-
diff --git a/mysql-test/include/ndb_backup_print.inc b/mysql-test/include/ndb_backup_print.inc
deleted file mode 100644
index 69faa8f421b..00000000000
--- a/mysql-test/include/ndb_backup_print.inc
+++ /dev/null
@@ -1,9 +0,0 @@
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat
---exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat
---disable_warnings
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/tmp.dat
---enable_warnings
---let ndb_restore_opts=
---let ndb_restore_filter=
diff --git a/mysql-test/include/ndb_default_cluster.inc b/mysql-test/include/ndb_default_cluster.inc
deleted file mode 100644
index de7eda3c596..00000000000
--- a/mysql-test/include/ndb_default_cluster.inc
+++ /dev/null
@@ -1,4 +0,0 @@
--- require r/ndb_default_cluster.require
-disable_query_log;
-show status like "Ndb_config_from_host";
-enable_query_log;
diff --git a/mysql-test/include/ndb_master-slave.inc b/mysql-test/include/ndb_master-slave.inc
deleted file mode 100644
index 8305a310953..00000000000
--- a/mysql-test/include/ndb_master-slave.inc
+++ /dev/null
@@ -1,12 +0,0 @@
---source include/master-slave.inc
-
-connection slave;
-# Check that server is compiled and started with support for NDB
-disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
---source include/ndb_not_readonly.inc
-enable_query_log;
-
-# Set the default connection to 'master'
-connection master;
diff --git a/mysql-test/include/ndb_master-slave_2ch.inc b/mysql-test/include/ndb_master-slave_2ch.inc
deleted file mode 100644
index 17017d2b801..00000000000
--- a/mysql-test/include/ndb_master-slave_2ch.inc
+++ /dev/null
@@ -1,67 +0,0 @@
-# ==== Purpose ====
-#
-# Set up circular cluster replication where each
-# cluster has two mysqlds and replication directions are
-# following:
-# master ---> slave
-# / \
-# cluster A cluster B
-# \ /
-# master1 <--- slave1
-#
-# ==== Usage ====
-#
-# [--let $rpl_server_count= N]
-# [--let $rpl_skip_check_server_ids= 1]
-# [--let $rpl_skip_reset_master_and_slave= 1]
-# [--let $rpl_skip_change_master= 1]
-# [--let $rpl_skip_start_slave= 1]
-# [--let $rpl_debug= 1]
-# [--let $slave_timeout= NUMBER]
-# --source include/ndb_master-slave_2ch.inc
-#
-# Parameters:
-# $rpl_server_count, $rpl_skip_check_server_ids,
-# $rpl_skip_reset_master_and_slave, $rpl_skip_change_master,
-# $rpl_skip_start_slave, $rpl_debug, $slave_timeout
-# See include/master-slave.inc
-
---let $rpl_topology= 1->2,4->3
---let $rpl_skip_check_server_ids= 1
---source include/rpl_init.inc
-
-# Make connections to mysqlds
-
---let $rpl_connection_name= master
---let $rpl_server_number= 1
---source include/rpl_connect.inc
-
---let $rpl_connection_name= master1
---let $rpl_server_number= 1
---source include/rpl_connect.inc
-
---let $rpl_connection_name= slave
---let $rpl_server_number= 2
---source include/rpl_connect.inc
-
---let $rpl_connection_name= slave1
---let $rpl_server_number= 2
---source include/rpl_connect.inc
-
-
-# Check that all mysqld are compiled with ndb support
---let $_rpl_server= 4
-while ($_rpl_server)
-{
- --connection server_$_rpl_server
- if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'ndbcluster' AND (support = 'YES' OR support = 'DEFAULT')`)
- {
- --skip Test requires NDB.
- }
- --source include/ndb_not_readonly.inc
- --dec $_rpl_server
-}
-
-
-# Set the default connection to 'master' (cluster A)
-connection master;
diff --git a/mysql-test/include/ndb_not_readonly.inc b/mysql-test/include/ndb_not_readonly.inc
deleted file mode 100644
index ebb343bb18d..00000000000
--- a/mysql-test/include/ndb_not_readonly.inc
+++ /dev/null
@@ -1,36 +0,0 @@
-# Check that server has come out ot readonly mode
-#
-# wait for server to connect properly to cluster
-#
-
---disable_query_log
-
-set @saved_log = @@sql_log_bin;
-set sql_log_bin = 0;
---error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_KEY_NOT_FOUND
-delete from mysql.ndb_apply_status where server_id=0;
-let $mysql_errno= 1;
-let $counter= 600;
-while ($mysql_errno)
-{
- # Table is readonly until the mysqld has connected properly
- --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG
- replace into mysql.ndb_apply_status values(0,0,"",0,0);
- if ($mysql_errno)
- {
- if (!$counter)
- {
- die Failed while waiting for mysqld to come out of readonly mode;
- }
- dec $counter;
- --sleep 0.1
- }
-}
-delete from mysql.ndb_apply_status where server_id=0;
-set sql_log_bin = @saved_log;
-
---enable_query_log
-
-#
-# connected
-#
diff --git a/mysql-test/include/ndb_restore_master.inc b/mysql-test/include/ndb_restore_master.inc
deleted file mode 100644
index ae5f055b442..00000000000
--- a/mysql-test/include/ndb_restore_master.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-######################################################
-# By JBM 2006-02-16 So that the code is not repeated #
-# in test cases and can be reused. #
-######################################################
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/include/ndb_restore_slave_eoption.inc b/mysql-test/include/ndb_restore_slave_eoption.inc
deleted file mode 100644
index a8657f68c8d..00000000000
--- a/mysql-test/include/ndb_restore_slave_eoption.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-######################################################
-# By JBM 2006-03-08 So that the code is not repeated #
-# in test cases and can be reused. #
-######################################################
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-
-
diff --git a/mysql-test/include/ndb_setup_slave.inc b/mysql-test/include/ndb_setup_slave.inc
deleted file mode 100644
index 5ee55150550..00000000000
--- a/mysql-test/include/ndb_setup_slave.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# now setup replication to continue from last epoch
-# 1. get ndb_apply_status epoch from slave
-# 2. get corresponding _next_ binlog postition from master
-# 3. change master on slave
-
-# 1.
---connection slave
---replace_column 1 <the_epoch>
-SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
---let $the_epoch= `select @the_epoch`
-
-# 2.
---connection master
---replace_result $the_epoch <the_epoch>
---replace_column 1 <the_pos>
-eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
- FROM mysql.ndb_binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1;
---let $the_pos= `SELECT @the_pos`
---let $the_file= `SELECT @the_file`
-
-# 3.
---connection slave
---replace_result $the_pos <the_pos>
-eval CHANGE MASTER TO
- master_log_file = '$the_file',
- master_log_pos = $the_pos ;
diff --git a/mysql-test/include/ndb_wait_connected.inc b/mysql-test/include/ndb_wait_connected.inc
deleted file mode 100644
index cfea94db1f1..00000000000
--- a/mysql-test/include/ndb_wait_connected.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-# Check that mysqld has reconnected to ndbd after
-# restart of ndbd
-#
---disable_query_log
---disable_result_log
-let $mysql_errno= 1;
-let $counter= 600;
-while ($mysql_errno)
-{
- --error 0,157
- CREATE TABLE ndb_wait_connected (a int primary key);
- if ($mysql_errno)
- {
- if (!$counter)
- {
- die Failed waiting for mysqld to reconnect to ndbd;
- }
- dec $counter;
- --sleep 0.1
- }
-}
-DROP TABLE ndb_wait_connected;
---enable_query_log
---enable_result_log
-
-
diff --git a/mysql-test/include/not_encrypted.inc b/mysql-test/include/not_encrypted.inc
new file mode 100644
index 00000000000..2702fb3d8f0
--- /dev/null
+++ b/mysql-test/include/not_encrypted.inc
@@ -0,0 +1,4 @@
+if (`select @@innodb_encrypt_tables = 1`)
+{
+ skip only without encryption;
+}
diff --git a/mysql-test/include/not_ndb.inc b/mysql-test/include/not_ndb.inc
deleted file mode 100644
index 965538c20a7..00000000000
--- a/mysql-test/include/not_ndb.inc
+++ /dev/null
@@ -1,7 +0,0 @@
--- require r/not_ndb.require
-disable_query_log;
-# so that both DISABLED and NO is output as NO
--- replace_result DISABLED NO
-show variables like "have_ndbcluster";
-enable_query_log;
-
diff --git a/mysql-test/include/not_ndb_default.inc b/mysql-test/include/not_ndb_default.inc
deleted file mode 100644
index 682a2944171..00000000000
--- a/mysql-test/include/not_ndb_default.inc
+++ /dev/null
@@ -1,4 +0,0 @@
---require r/not_ndb_default.require
-disable_query_log;
-select convert(@@storage_engine using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
-enable_query_log;
diff --git a/mysql-test/include/ps_create.inc b/mysql-test/include/ps_create.inc
index b2a6fc4b920..91528e2a9a1 100644
--- a/mysql-test/include/ps_create.inc
+++ b/mysql-test/include/ps_create.inc
@@ -33,7 +33,8 @@ eval create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
- c13 date, c14 datetime, c15 timestamp, c16 time,
+ c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc
index 8148935cbe1..bae83c72c73 100644
--- a/mysql-test/include/ps_query.inc
+++ b/mysql-test/include/ps_query.inc
@@ -428,7 +428,6 @@ execute stmt1 using @arg01, @arg02;
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
# also Bug#4000 (only BDB tables)
-# Bug#4106 : ndb table, query with correlated subquery, wrong result
execute stmt1 ;
# test case derived from client_test.c: test_subqueries_ref
let $1= 3 ;
@@ -768,6 +767,7 @@ select '------ explain select tests ------' as test_sequence ;
# table with many column types
prepare stmt1 from ' explain select * from t9 ' ;
--enable_metadata
+--replace_result 4096 4_OR_8_K 8192 4_OR_8_K
execute stmt1;
--disable_metadata
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index 29a82f112c3..56dae83db2f 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -15,6 +15,8 @@
# main code went into include/query_cache.inc
#
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise
@@ -193,3 +195,5 @@ disconnect connection1;
connection default;
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
+
+SET global query_cache_type=default;
diff --git a/mysql-test/include/query_cache_partitions.inc b/mysql-test/include/query_cache_partitions.inc
index e5bb7406c10..c69356f907d 100644
--- a/mysql-test/include/query_cache_partitions.inc
+++ b/mysql-test/include/query_cache_partitions.inc
@@ -4,6 +4,8 @@
# $engine_type -- storage engine to be tested
# have to be set before sourcing this script.
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise
@@ -124,3 +126,4 @@ show status like "Qcache_hits";
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;
+SET global query_cache_type=default;
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
index 769cd535f37..41276ed5a79 100644
--- a/mysql-test/include/query_cache_sql_prepare.inc
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -20,6 +20,8 @@
--source include/have_query_cache.inc
# embedded can't make more than one connection, which this test needs
-- source include/not_embedded.inc
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
--echo ---- establish connection con1 (root) ----
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
@@ -528,3 +530,4 @@ drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status; # reset Qcache status variables for next tests
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/suite/multi_source/reset_master_slave.inc b/mysql-test/include/reset_master_slave.inc
index af66da2bb8b..af66da2bb8b 100644
--- a/mysql-test/suite/multi_source/reset_master_slave.inc
+++ b/mysql-test/include/reset_master_slave.inc
diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc
index 940e081c431..a0447280ff5 100644
--- a/mysql-test/include/restart_mysqld.inc
+++ b/mysql-test/include/restart_mysqld.inc
@@ -50,6 +50,9 @@ if (!$restart_parameters)
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
+# Wait for wsrep
+--source include/wait_wsrep_ready.inc
+
# Turn off reconnect again
--disable_reconnect
diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc
index 09569fc2b57..4ee4cccdc20 100644
--- a/mysql-test/include/rpl_init.inc
+++ b/mysql-test/include/rpl_init.inc
@@ -35,9 +35,7 @@
# (It is allowed, but not required, to configure SERVER_MYPORT_1
# and SERVER_MYPORT_2 too. If these variables are not set, the
# variables MASTER_MYPORT and SLAVE_MYPORT, configured in the
-# default my.cnf used by the rpl and rpl_ndb suites, are used
-# instead. In addition, in the rpl_ndb suite, SERVER_MYPORT_3 is
-# not needed since MASTER_MYPORT1 can be used instead.)
+# default my.cnf used by the rpl suite, are used instead.)
#
# 2. Execute the following near the top of the test:
#
@@ -124,18 +122,6 @@ if (!$SERVER_MYPORT_2)
{
--let SERVER_MYPORT_2= $SLAVE_MYPORT
}
-# Allow $MASTER_MYPORT1 as alias for $SERVER_MYPORT_3
-# (this alias is used by rpl_ndb tests)
-if (!$SERVER_MYPORT_3)
-{
- --let SERVER_MYPORT_3= $MASTER_MYPORT1
-}
-# Allow $SLAVE_MYPORT1 as alias for $SERVER_MYPORT_4
-# (this alias is used by rpl_ndb tests)
-if (!$SERVER_MYPORT_4)
-{
- --let SERVER_MYPORT_4= $SLAVE_MYPORT1
-}
# Check that $rpl_server_count is set
if (!$rpl_server_count)
{
diff --git a/mysql-test/include/rpl_multi_engine2.inc b/mysql-test/include/rpl_multi_engine2.inc
index e683a1d5838..24154220cb0 100644
--- a/mysql-test/include/rpl_multi_engine2.inc
+++ b/mysql-test/include/rpl_multi_engine2.inc
@@ -72,10 +72,6 @@ ORDER BY id;
connection master;
--echo --- Remove a record from t1 on master ---
-# Note: there is an error in replication of Delete_row
-# from NDB to MyISAM (BUG#28538). However, if there is
-# only one row in Delete_row event then it works fine,
-# as this test demonstrates.
DELETE FROM t1 WHERE id = 412;
--echo --- Show current count on master for t1 ---
diff --git a/mysql-test/include/rpl_row_img_general_loop.inc b/mysql-test/include/rpl_row_img_general_loop.inc
new file mode 100644
index 00000000000..3c7749e5135
--- /dev/null
+++ b/mysql-test/include/rpl_row_img_general_loop.inc
@@ -0,0 +1,42 @@
+#
+# This is a helper script for rpl_row_img.test. It creates
+# all combinations MyISAM / InnoDB in a three server replication
+# chain. Each engine combination is tested against the current
+# seetings for binlog_row_image (on each server).
+#
+# The test script that is executed on every combination is the
+# only argument to this wrapper script. See below.
+#
+# This script takes one parameter:
+# - $row_img_test_script
+# the name of the test script to include in every combination
+#
+# Sample usage:
+# -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
+# -- source include/rpl_row_img_general_loop.test
+
+
+-- let $engine_type_a= 2
+-- let $server_1_engine= MyISAM
+while($engine_type_a)
+{
+ -- let $engine_type_b= 2
+ -- let $server_2_engine= MyISAM
+ while($engine_type_b)
+ {
+ -- let $engine_type_c= 2
+ -- let $server_3_engine= MyISAM
+ while($engine_type_c)
+ {
+ -- echo ### engines: $server_1_engine, $server_2_engine, $server_3_engine
+ -- source $row_img_test_script
+
+ -- let $server_3_engine= InnoDB
+ -- dec $engine_type_c
+ }
+ -- let $server_2_engine= InnoDB
+ -- dec $engine_type_b
+ }
+ -- let $server_1_engine= InnoDB
+ -- dec $engine_type_a
+}
diff --git a/mysql-test/include/rpl_row_img_set.inc b/mysql-test/include/rpl_row_img_set.inc
new file mode 100644
index 00000000000..d998c3f1d6c
--- /dev/null
+++ b/mysql-test/include/rpl_row_img_set.inc
@@ -0,0 +1,55 @@
+#
+# This is an auxiliar script that sets the binlog-row-image
+# on a set of connections. These connections are passed as
+# a parameter to this script. Its format is the following:
+#
+# <conid,value,Y_or_N>:[<conid,value,Y_or_N>:...]
+#
+# In detail:
+#
+# conid -- connection id (eg, master)
+# value -- binlog_row_image value to set (eg, FULL)
+# Y_or_N -- Issue stop and start slave (eg, Y)
+#
+# Sample usage:
+#
+# -- let $row_img_set=master:FULL:N,slave:MINIMAL:Y
+# -- source include/rpl_row_img_set.inc
+#
+# Notes:
+#
+# 1. This script saves and restores the original connection that was
+# in use at the time it was included.
+
+-- let $old_conn= $CURRENT_CONNECTION
+
+while (`SELECT HEX('$row_img_set') != HEX('')`)
+{
+
+ -- let $tuple= `SELECT SUBSTRING_INDEX('$row_img_set', ',', 1)`
+
+ -- let $conn= `SELECT SUBSTRING_INDEX('$tuple', ':', 1)`
+ -- let $rimg= `SELECT SUBSTRING_INDEX(LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + 2)), ':', 1)`
+
+ -- let $is_slave_restart= `SELECT LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + LENGTH('$rimg')+ 3))`
+
+ -- echo CON: '$conn', IMG: '$rimg', RESTART SLAVE: '$is_slave_restart'
+
+ -- connection $conn
+ -- eval SET SESSION binlog_row_image= '$rimg'
+ -- eval SET GLOBAL binlog_row_image= '$rimg'
+
+ if ($is_slave_restart == Y)
+ {
+ -- source include/stop_slave.inc
+ -- source include/start_slave.inc
+ }
+
+ FLUSH TABLES;
+ SHOW VARIABLES LIKE 'binlog_row_image';
+
+ -- let $row_img_set= `SELECT LTRIM(SUBSTRING('$row_img_set', LENGTH('$tuple') + 2 ))`
+
+}
+
+-- connection $old_conn
diff --git a/mysql-test/include/safe_set_to_maybe_ro_var.inc b/mysql-test/include/safe_set_to_maybe_ro_var.inc
deleted file mode 100644
index add7f2091b3..00000000000
--- a/mysql-test/include/safe_set_to_maybe_ro_var.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-# to mask out the error - never abort neither log in result file - in setting
-# to read-only variable.
-# It is assumed that the new value is equal to one the var was set to.
-# Such situation happens particularily with binlog_format that becomes read-only
-# with ndb default storage.
-#
-# when generate results always watch the file to find what is expected,
-# the SET query may fail
-
-# script accepts $maybe_ro_var the var name and $val4var the value
-
-### USAGE:
-### let $maybe_ro_var= ...
-### let $val4var= ...
-### include/safe_set_to_maybe_ro_var.inc
-
---disable_result_log
---disable_abort_on_error
-eval SET $maybe_ro_var = $val4var;
---enable_abort_on_error
---enable_result_log
-
-eval SELECT $maybe_ro_var;
diff --git a/mysql-test/include/select_ndb_apply_status.inc b/mysql-test/include/select_ndb_apply_status.inc
deleted file mode 100644
index a676b7cfb06..00000000000
--- a/mysql-test/include/select_ndb_apply_status.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-##################################################
-# Author: Jeb
-# Date: 2007/04
-# Purpose: To select out log name, start and end
-# positions from ndb_apply_status table
-##################################################
---replace_column 1 <log_name> 2 <start_pos> 3 <end_pos>
-select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
- from mysql.ndb_apply_status;
---let $start_pos = `select @start_pos`
---let $end_pos = `select @end_pos`
---let $log_name = `select @log_name`
-
diff --git a/mysql-test/include/show_all_slaves_status.inc b/mysql-test/include/show_all_slaves_status.inc
new file mode 100644
index 00000000000..4c96c31ce50
--- /dev/null
+++ b/mysql-test/include/show_all_slaves_status.inc
@@ -0,0 +1,65 @@
+# ==== Usage ====
+#
+# --let $status_items= Column_Name[, Column_Name[, ...]]
+# --source include/show_all_slaves_status.inc
+#
+# Parameters:
+# $status_items
+# Set to the name of the column in the output of SHOW SLAVE STATUS
+# that you want to display. Example:
+#
+# --let $status_items= Master_SSL_Allowed
+#
+# You can show multiple columns by setting $status_items to a
+# comma-separated list. Example:
+#
+# --let $status_items= Master_Log_File, Relay_Master_Log_File
+#
+# $slave_field_result_replace
+# If set, one or more regex patterns for replacing variable
+# text in the error message. Syntax as --replace-regex
+#
+# $slave_sql_mode
+# If set, change the slave sql mode during this macro, reverting
+# to the previous on exit. Default sql_mode is NO_BACKSLASH_ESCAPES
+# to allow replace '\' by '/' making paths OS independent. Example:
+#
+# --let $slave_sql_mode= NO_BACKSLASH_ESCAPES
+#
+
+
+--let $_show_slave_status_items=$status_items
+if (!$status_items)
+{
+ --die Bug in test case: The mysqltest variable $status_items is not set.
+}
+
+
+--let $_slave_sql_mode= NO_BACKSLASH_ESCAPES
+if ($slave_sql_mode)
+{
+ --let $_slave_sql_mode= $slave_sql_mode
+}
+--let $_previous_slave_sql_mode = `SELECT @@sql_mode`
+--disable_query_log
+eval SET sql_mode= '$_slave_sql_mode';
+--enable_query_log
+
+
+while ($_show_slave_status_items)
+{
+ --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)`
+ --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))`
+
+ --replace_regex /\.[\\\/]master/master/
+ --let $_show_slave_status_value= query_get_value(SHOW ALL SLAVES STATUS, $_show_slave_status_name, 1)
+ --let $_slave_field_result_replace= /[\\\\]/\// $slave_field_result_replace
+ --replace_regex $_slave_field_result_replace
+ --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`
+ --echo $_show_slave_status_name = '$_show_slave_status_value'
+}
+
+
+--disable_query_log
+eval SET sql_mode= '$_previous_slave_sql_mode';
+--enable_query_log
diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc
index b2462e0d1b1..57fe1ffe0e3 100644
--- a/mysql-test/include/show_binlog_events.inc
+++ b/mysql-test/include/show_binlog_events.inc
@@ -7,7 +7,7 @@
# [--let $binlog_file= [<FILENAME> | LAST]]
# [--let $binlog_start= <POSITION> ]
# [--let $binlog_limit= 1, 3 ]
-# [--let $keep_gtid_events= 1]
+# [--let $skip_checkpoint_events= 1]
# --source include/show_binlog_events.inc
#
# Parameters:
@@ -26,12 +26,6 @@
# Limit for the 'LIMIT' clause of SHOW BINLOG EVENTS, i.e.:
# $binlog_limit= 3 -- print three events
# $binlog_limit= 4, 3 -- skip four events, print the three next events
-#
-# $keep_gtid_events
-# By default, Gtid_log_event and Previous_gtid_log_event are
-# filtered out, so that the output is independent of whether GTIDs
-# are enabled or not. If this flag is set, events are kept but
-# the actual GTID values are masked out.
--let $include_filename= show_binlog_events.inc
--source include/begin_include_file.inc
diff --git a/mysql-test/include/show_binlog_events2.inc b/mysql-test/include/show_binlog_events2.inc
index b036709b81d..eefefe4bfbe 100644
--- a/mysql-test/include/show_binlog_events2.inc
+++ b/mysql-test/include/show_binlog_events2.inc
@@ -4,7 +4,7 @@ if ($binlog_start)
}
if (!$binlog_start)
{
- --let $_binlog_start=248
+ --let $_binlog_start=249
}
if ($binlog_file)
{
diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc
index 7917b6740cf..9ee01f73999 100644
--- a/mysql-test/include/show_events.inc
+++ b/mysql-test/include/show_events.inc
@@ -15,7 +15,19 @@
--let $statement=show BINLOG events
if ($is_relay_log)
{
- --let $statement=show relaylog events
+ if ($master_name)
+ {
+ let _master_name='$master_name';
+ }
+ if (!$master_name)
+ {
+ let _master_name=`select @@default_master_connection`;
+ if ($_master_name)
+ {
+ let _master_name='$_master_name';
+ }
+ }
+ --let $statement=show relaylog $_master_name events
}
if ($binlog_file)
@@ -25,7 +37,7 @@ if ($binlog_file)
{
if ($is_relay_log)
{
- --let $_binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+ --let $_binlog_file= query_get_value(SHOW SLAVE $_master_name STATUS, Relay_Log_File, 1)
}
if (!$is_relay_log)
{
@@ -92,8 +104,15 @@ let $script=
s{DOLLARmysqltest_vardir}{MYSQLTEST_VARDIR}g;
||
--let $pre_script= my DOLLARmysqltest_vardir = DOLLARENV{'MYSQLTEST_VARDIR'};
+
--delimiter ;
+if ($skip_checkpoint_events)
+{
+ let $filter_script=Binlog_checkpoint;
+}
+
+
#--let $select_columns= 1 3 6
--let $input_file= $output_file
--source include/filter_file.inc
diff --git a/mysql-test/include/show_gtid_list.inc b/mysql-test/include/show_gtid_list.inc
new file mode 100644
index 00000000000..96f813f180c
--- /dev/null
+++ b/mysql-test/include/show_gtid_list.inc
@@ -0,0 +1,15 @@
+# ==== Purpose ====
+#
+# Extract Gtid_list info from SHOW BINLOG EVENTS output masking
+# non-deterministic fields.
+#
+# ==== Usage ====
+#
+# [--let $binlog_file=filename
+#
+if ($binlog_file)
+{
+ --let $_in_binlog_file=in '$binlog_file'
+}
+--replace_column 2 # 5 #
+--eval show binlog events $_in_binlog_file limit 1,1
diff --git a/mysql-test/include/show_relaylog_events.inc b/mysql-test/include/show_relaylog_events.inc
index d1bd11f1642..c98e961da76 100644
--- a/mysql-test/include/show_relaylog_events.inc
+++ b/mysql-test/include/show_relaylog_events.inc
@@ -1,10 +1,11 @@
##############################################################################
# Show relay log events
#
-# Useage:
+# Usage:
# let $binlog_file= slave-relay-bin.000002;
# let $binlog_start= 106;
# let $binlog_limit= 1, 3;
+# let $master_name= master1;
# source include/show_relaylog_events.inc;
#
# It shows the first relay log file if $binlog_file is not given.
diff --git a/mysql-test/include/start_mysqld.inc b/mysql-test/include/start_mysqld.inc
index e31f26aad8c..04dff714d49 100644
--- a/mysql-test/include/start_mysqld.inc
+++ b/mysql-test/include/start_mysqld.inc
@@ -16,6 +16,9 @@ if (!$restart_parameters)
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
+# Wait for wsrep
+--source include/wait_wsrep_ready.inc
+
# Turn off reconnect again
--disable_reconnect
diff --git a/mysql-test/include/sync_slave_sql_with_master.inc b/mysql-test/include/sync_slave_sql_with_master.inc
new file mode 100644
index 00000000000..609c7f1b827
--- /dev/null
+++ b/mysql-test/include/sync_slave_sql_with_master.inc
@@ -0,0 +1,53 @@
+# ==== Purpose ====
+#
+# Waits until the slave SQL thread has been synced, i.e., all events
+# have been copied over to slave. This is like mtr's built-in command
+# sync_slave_with_master, but more flexible (e.g., you can set a
+# custom timeout and you can force it to use GTIDs instead of filename
+# and offset).
+#
+#
+# ==== Usage ====
+#
+# [--let $sync_slave_connection= <connection_name>]
+# [--let $use_gtids= 1]
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/sync_slave_io_with_master.inc
+#
+# Must be called on the master. Will change connection to the slave.
+#
+# Parameters:
+#
+# $use_gtids
+# If set, uses GTIDs instead of filename and offset for positions.
+#
+# $sync_slave_connection
+# By default, this script switches connection to 'slave'. If
+# $sync_slave_connection is set, then '$sync_slave_connection' is
+# used instead of 'slave'.
+#
+# $slave_timeout
+# See include/wait_for_slave_param.inc.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= sync_slave_sql_with_master.inc
+--source include/begin_include_file.inc
+
+save_master_pos;
+
+--let $rpl_connection_name= slave
+if ($sync_slave_connection)
+{
+ --let $rpl_connection_name= $sync_slave_connection
+}
+--source include/rpl_connection.inc
+
+sync_with_master;
+
+--let $include_filename= sync_slave_sql_with_master.inc
+--let $skip_restore_connection= 1
+--source include/end_include_file.inc
diff --git a/mysql-test/include/type_hrtime.inc b/mysql-test/include/type_hrtime.inc
index 5d847d72195..071dc7b161d 100644
--- a/mysql-test/include/type_hrtime.inc
+++ b/mysql-test/include/type_hrtime.inc
@@ -25,7 +25,12 @@ alter table t1 engine=innodb;
select * from t1 order by a;
select * from t1 order by a+0;
drop table t1;
-eval create table t1 (a $type(4)) engine=innodb;
+let attr=;
+if ($type == timestamp)
+{
+ let attr=NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4);
+}
+eval create table t1 (a $type(4)$attr) engine=innodb;
insert t1 values ('2010-12-11 01:02:03.456789');
select * from t1;
select extract(microsecond from a + interval 100 microsecond) from t1 where a>'2010-11-12 01:02:03.456';
@@ -93,7 +98,12 @@ drop table t1, t2;
#
# SP
#
-eval create table t1 (a $type(6), b $type(6));
+let attr=;
+if ($type == timestamp)
+{
+ let attr=NOT NULL DEFAULT '0000-00-00 00:00:00.000000';
+}
+eval create table t1 (a $type(6)$attr, b $type(6)$attr);
eval create procedure foo(x $type, y $type(4)) insert into t1 values (x, y);
call foo('2010-02-03 4:5:6.789123', '2010-02-03 4:5:6.789123');
select * from t1;
diff --git a/mysql-test/include/type_temporal_zero_default.inc b/mysql-test/include/type_temporal_zero_default.inc
new file mode 100644
index 00000000000..500d25ea18f
--- /dev/null
+++ b/mysql-test/include/type_temporal_zero_default.inc
@@ -0,0 +1,75 @@
+--echo #
+--echo # MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+--echo #
+
+# Testing direct INSERT
+
+SET sql_mode=DEFAULT;
+eval CREATE TABLE t1 (a $type DEFAULT $defval);
+SET sql_mode=TRADITIONAL;
+--error ER_TRUNCATED_WRONG_VALUE
+eval INSERT INTO t1 VALUES ($defval);
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ();
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (DEFAULT);
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+
+# Testing INSERT .. SELECT
+
+eval CREATE TABLE t1 (a $type NOT NULL DEFAULT $defval, b $type NOT NULL DEFAULT $defval);
+eval CREATE TABLE t2 (a $type NOT NULL DEFAULT $defval);
+eval INSERT INTO t2 VALUES ($defval);
+SET sql_mode=TRADITIONAL;
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+INSERT INTO t1 (a) SELECT a FROM t2;
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+
+
+# Testing LOAD
+
+--eval CREATE TABLE t1 (a $type DEFAULT $defval, b $type DEFAULT $defval)
+--eval INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1
+DELETE FROM t1;
+SET sql_mode=TRADITIONAL;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' INTO TABLE t1 (a)
+--remove_file $MYSQLTEST_VARDIR/tmp/mdev-7824.txt
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+# Testing ALTER when an old field default becomes invalid
+# Return an error, even if there is no STRICT_XXX_TABLES set
+--eval CREATE TABLE t1 (a $type DEFAULT $defval);
+SET sql_mode='NO_ZERO_DATE';
+--error ER_INVALID_DEFAULT
+ALTER TABLE t1 ADD b INT NOT NULL;
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+
+--echo #
+--echo # End of MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+--echo #
+
+--echo #
+--echo # MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+--echo #
+
+SET sql_mode=DEFAULT;
+--eval CREATE TABLE t1 (a $type);
+INSERT INTO t1 VALUES (0);
+SET sql_mode='TRADITIONAL';
+--error ER_TRUNCATED_WRONG_VALUE
+CREATE TABLE t2 AS SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+--echo #
diff --git a/mysql-test/include/wait_condition.inc b/mysql-test/include/wait_condition.inc
index ac61b76db32..5fbde6950c8 100644
--- a/mysql-test/include/wait_condition.inc
+++ b/mysql-test/include/wait_condition.inc
@@ -39,6 +39,7 @@ let $wait_timeout= 0;
let $wait_condition_reps= 0;
while ($wait_counter)
{
+ --error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
diff --git a/mysql-test/include/wait_for_ndb_to_binlog.inc b/mysql-test/include/wait_for_ndb_to_binlog.inc
deleted file mode 100644
index c1f94802724..00000000000
--- a/mysql-test/include/wait_for_ndb_to_binlog.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-# ==== Purpose ====
-#
-# Several test primitives from mysql-test/extra/rpl_tests
-# are shared for test cases for MyISAM, InnoDB, NDB and
-# other engines.
-# For NDB engine all events will be added by NDB injector
-# so tests only can continue after injector is ready,
-# this test waits for proper injector thread state.
-#
-# ==== Usage ====
-#
-# let $engine_type= NDB;
-# --source include/wait_for_ndb_to_binlog.inc
-#
-# ==== Parameters =====
-#
-# $engine_type
-# Type of engine. If type is NDB then it waits for injector
-# thread proper state.
-
-if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
- let $show_statement= SHOW PROCESSLIST;
- let $field= State;
- let $condition= = 'Waiting for event from ndbcluster';
- source include/wait_show_condition.inc;
-}
diff --git a/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc b/mysql-test/include/wait_for_sql_thread_read_all.inc
index ec5ecd0cb17..ec5ecd0cb17 100644
--- a/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc
+++ b/mysql-test/include/wait_for_sql_thread_read_all.inc
diff --git a/mysql-test/include/wait_until_ready.inc b/mysql-test/include/wait_until_ready.inc
new file mode 100644
index 00000000000..e7a6940975a
--- /dev/null
+++ b/mysql-test/include/wait_until_ready.inc
@@ -0,0 +1,34 @@
+# If wsrep patch is enabled, wait for a minute until node is ready.
+# Note: include/wait_for_status_var.inc cannot be used here, as server rejects
+# all commands except SHOW & SET until its ready. (see wsrep_ready status
+# variable)
+
+--disable_result_log
+--disable_query_log
+--enable_reconnect
+
+let $counter= 600;
+
+# Check if wsrep_ready status variable exists.
+if (`SHOW STATUS LIKE 'wsrep_ready'`)
+{
+ let $wsrep_ready= query_get_value("SHOW STATUS LIKE 'wsrep_ready'", Value, 1);
+
+ while ($wsrep_ready == 'OFF')
+ {
+ if (!$counter)
+ {
+ echo ===============================================;
+ echo Node still not ready after a minute, giving up!;
+ echo ===============================================;
+ die;
+ }
+ dec $counter;
+ sleep 0.1;
+ let $wsrep_ready= query_get_value("SHOW STATUS LIKE 'wsrep_ready'", Value, 1);
+ }
+}
+
+--disable_reconnect
+--enable_query_log
+--enable_result_log
diff --git a/mysql-test/include/wait_wsrep_ready.inc b/mysql-test/include/wait_wsrep_ready.inc
new file mode 100644
index 00000000000..2dd1ef7f1ab
--- /dev/null
+++ b/mysql-test/include/wait_wsrep_ready.inc
@@ -0,0 +1,18 @@
+#
+# If the wsrep plugin is loaded, wait until the wsrep provider becomes
+# ready for use.
+#
+
+--disable_query_log
+--disable_result_log
+
+if (`SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`)
+{
+ if (`SELECT @@GLOBAL.WSREP_ON`)
+ {
+ --source include/galera_wait_ready.inc
+ }
+}
+
+--enable_query_log
+--enable_result_log
diff --git a/mysql-test/include/word_size.combinations b/mysql-test/include/word_size.combinations
new file mode 100644
index 00000000000..9b58a0c85c6
--- /dev/null
+++ b/mysql-test/include/word_size.combinations
@@ -0,0 +1,3 @@
+[32bit]
+
+[64bit]
diff --git a/mysql-test/include/word_size.inc b/mysql-test/include/word_size.inc
new file mode 100644
index 00000000000..fb796c251fc
--- /dev/null
+++ b/mysql-test/include/word_size.inc
@@ -0,0 +1,4 @@
+#
+# tests that include this file will be run for an appropriate combination.
+# See word_size.combinations for the list of combinations.
+#
diff --git a/mysql-test/include/write_var_to_file.inc b/mysql-test/include/write_var_to_file.inc
index 08de195ccbb..7982c6fab31 100644
--- a/mysql-test/include/write_var_to_file.inc
+++ b/mysql-test/include/write_var_to_file.inc
@@ -43,9 +43,8 @@ if ($write_to_file == 'GENERATE')
if (`SELECT LENGTH(@@secure_file_priv) > 0`)
{
- --let $_wvtf_secure_file_priv= `SELECT @@secure_file_priv`
--let $_wvtf_suffix= `SELECT UUID()`
- --let $_wvtf_tmp_file= $_wvtf_secure_file_priv/_wvtf_$_wvtf_suffix
+ --let $_wvtf_tmp_file= $MYSQLTEST_VARDIR/_wvtf_$_wvtf_suffix
--eval SELECT '$write_var' INTO DUMPFILE '$_wvtf_tmp_file'
--copy_file $_wvtf_tmp_file $write_to_file
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index b8ce038f23e..7584a99c093 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -182,55 +182,6 @@ sub fix_log_slow_queries {
return "$dir/mysqld-slow.log";
}
-sub fix_std_data {
- my ($self, $config, $group_name, $group)= @_;
- my $testdir= $self->get_testdir($group);
- return "$testdir/std_data";
-}
-
-sub ssl_supported {
- my ($self)= @_;
- return $self->{ARGS}->{ssl};
-}
-
-sub fix_skip_ssl {
- return if !ssl_supported(@_);
- # Add skip-ssl if ssl is supported to avoid
- # that mysqltest connects with SSL by default
- return 1;
-}
-
-sub fix_ssl_ca {
- return if !ssl_supported(@_);
- my $std_data= fix_std_data(@_);
- return "$std_data/cacert.pem"
-}
-
-sub fix_ssl_server_cert {
- return if !ssl_supported(@_);
- my $std_data= fix_std_data(@_);
- return "$std_data/server-cert.pem"
-}
-
-sub fix_ssl_client_cert {
- return if !ssl_supported(@_);
- my $std_data= fix_std_data(@_);
- return "$std_data/client-cert.pem"
-}
-
-sub fix_ssl_server_key {
- return if !ssl_supported(@_);
- my $std_data= fix_std_data(@_);
- return "$std_data/server-key.pem"
-}
-
-sub fix_ssl_client_key {
- return if !ssl_supported(@_);
- my $std_data= fix_std_data(@_);
- return "$std_data/client-key.pem"
-}
-
-
#
# Rules to run for each mysqld in the config
# - will be run in order listed here
@@ -255,9 +206,6 @@ my @mysqld_rules=
{ '#user' => sub { return shift->{ARGS}->{user} || ""; } },
{ '#password' => sub { return shift->{ARGS}->{password} || ""; } },
{ 'server-id' => \&fix_server_id, },
- { 'ssl-ca' => \&fix_ssl_ca },
- { 'ssl-cert' => \&fix_ssl_server_cert },
- { 'ssl-key' => \&fix_ssl_server_key },
{ 'bind-address' => \&fix_bind_address },
);
@@ -268,65 +216,6 @@ if (IS_WINDOWS)
push(@mysqld_rules, {'shared-memory-base-name' => \&fix_socket});
}
-sub fix_ndb_mgmd_port {
- my ($self, $config, $group_name, $group)= @_;
- my $hostname= $group->value('HostName');
- return $self->{PORT}++;
-}
-
-
-sub fix_cluster_dir {
- my ($self, $config, $group_name, $group)= @_;
- my $vardir= $self->{ARGS}->{vardir};
- my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name);
- return "$vardir/mysql_cluster.$suffix/$process_type.$idx";
-}
-
-
-sub fix_cluster_backup_dir {
- my ($self, $config, $group_name, $group)= @_;
- my $vardir= $self->{ARGS}->{vardir};
- my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name);
- return "$vardir/mysql_cluster.$suffix/";
-}
-
-
-#
-# Rules to run for each ndb_mgmd in the config
-# - will be run in order listed here
-#
-my @ndb_mgmd_rules=
-(
- { 'PortNumber' => \&fix_ndb_mgmd_port },
- { 'DataDir' => \&fix_cluster_dir },
-);
-
-
-#
-# Rules to run for each ndbd in the config
-# - will be run in order listed here
-#
-my @ndbd_rules=
-(
- { 'HostName' => \&fix_host },
- { 'DataDir' => \&fix_cluster_dir },
- { 'BackupDataDir' => \&fix_cluster_backup_dir },
-);
-
-
-#
-# Rules to run for each cluster_config section
-# - will be run in order listed here
-#
-my @cluster_config_rules=
-(
- { 'ndb_mgmd' => \&fix_host },
- { 'ndbd' => \&fix_host },
- { 'mysqld' => \&fix_host },
- { 'ndbapi' => \&fix_host },
-);
-
-
#
# Rules to run for [client] section
# - will be run in order listed here
@@ -343,10 +232,6 @@ my @client_rules=
#
my @mysqltest_rules=
(
- { 'ssl-ca' => \&fix_ssl_ca },
- { 'ssl-cert' => \&fix_ssl_client_cert },
- { 'ssl-key' => \&fix_ssl_client_key },
- { 'skip-ssl' => \&fix_skip_ssl },
);
@@ -504,49 +389,12 @@ sub post_fix_resolve_at_variables {
}
}
-sub post_fix_mysql_cluster_section {
- my ($self, $config)= @_;
-
- # Add a [mysl_cluster.<suffix>] section for each
- # defined [cluster_config.<suffix>] section
- foreach my $group ( $config->like('cluster_config\.\w*$') )
- {
- my @urls;
- # Generate ndb_connectstring for this cluster
- foreach my $ndb_mgmd ( $config->like('cluster_config.ndb_mgmd.')) {
- if ($ndb_mgmd->suffix() eq $group->suffix()) {
- my $host= $ndb_mgmd->value('HostName');
- my $port= $ndb_mgmd->value('PortNumber');
- push(@urls, "$host:$port");
- }
- }
- croak "Could not generate valid ndb_connectstring for '$group'"
- unless @urls > 0;
- my $ndb_connectstring= join(";", @urls);
-
- # Add ndb_connectstring to [mysql_cluster.<suffix>]
- $config->insert('mysql_cluster'.$group->suffix(),
- 'ndb_connectstring', $ndb_connectstring);
-
- # Add ndb_connectstring to each mysqld connected to this
- # cluster
- foreach my $mysqld ( $config->like('cluster_config.mysqld.')) {
- if ($mysqld->suffix() eq $group->suffix()) {
- my $after= $mysqld->after('cluster_config.mysqld');
- $config->insert("mysqld$after",
- 'ndb_connectstring', $ndb_connectstring);
- }
- }
- }
-}
-
#
# Rules to run last of all
#
my @post_rules=
(
\&post_check_client_groups,
- \&post_fix_mysql_cluster_section,
\&post_fix_resolve_at_variables,
\&post_check_embedded_group,
);
@@ -584,54 +432,6 @@ sub run_section_rules {
}
-sub run_generate_sections_from_cluster_config {
- my ($self, $config)= @_;
-
- my @options= ('ndb_mgmd', 'ndbd',
- 'mysqld', 'ndbapi');
-
- foreach my $group ( $config->like('cluster_config\.\w*$') ) {
-
- # Keep track of current index per process type
- my %idxes;
- map { $idxes{$_}= 1; } @options;
-
- foreach my $option_name ( @options ) {
- my $value= $group->value($option_name);
- my @hosts= split(/,/, $value, -1); # -1 => return also empty strings
-
- # Add at least one host
- push(@hosts, undef) unless scalar(@hosts);
-
- # Assign hosts unless already fixed
- @hosts= map { $self->fix_host() unless $_; } @hosts;
-
- # Write the hosts value back
- $group->insert($option_name, join(",", @hosts));
-
- # Generate sections for each host
- foreach my $host ( @hosts ){
- my $idx= $idxes{$option_name}++;
-
- my $suffix= $group->suffix();
- # Generate a section for ndb_mgmd to read
- $config->insert("cluster_config.$option_name.$idx$suffix",
- "HostName", $host);
-
- if ($option_name eq 'mysqld'){
- my $datadir=
- $self->fix_cluster_dir($config,
- "cluster_config.mysqld.$idx$suffix",
- $group);
- $config->insert("mysqld.$idx$suffix",
- 'datadir', "$datadir/data");
- }
- }
- }
- }
-}
-
-
sub new_config {
my ($class, $args)= @_;
@@ -657,18 +457,6 @@ sub new_config {
}
$self->run_section_rules($config,
- 'cluster_config\.\w*$',
- @cluster_config_rules);
- $self->run_generate_sections_from_cluster_config($config);
-
- $self->run_section_rules($config,
- 'cluster_config.ndb_mgmd.',
- @ndb_mgmd_rules);
- $self->run_section_rules($config,
- 'cluster_config.ndbd',
- @ndbd_rules);
-
- $self->run_section_rules($config,
'mysqld.',
@mysqld_rules);
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index feb3eb4df66..8f18b137b87 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -148,6 +148,14 @@ extern "C" void handle_signal(int sig)
}
+void setlimit(int what, uint soft, uint hard)
+{
+ struct rlimit lim = { soft, hard };
+ if (setrlimit (what, &lim) < 0)
+ message("setrlimit failed, errno=%d", errno);
+}
+
+
int main(int argc, char* const argv[] )
{
char* const* child_argv= 0;
@@ -249,13 +257,13 @@ int main(int argc, char* const argv[] )
signal(SIGCHLD, SIG_DFL);
if (nocore)
- {
- struct rlimit corelim = { 0, 0 };
- if (setrlimit (RLIMIT_CORE, &corelim) < 0)
- {
- message("setrlimit failed, errno=%d", errno);
- }
- }
+ setlimit(RLIMIT_CORE, 0, 0);
+
+ /*
+ mysqld defaults depend on that. make test results stable and independent
+ from the environment
+ */
+ setlimit(RLIMIT_NOFILE, 1024, 1024);
// Signal that child is ready
buf= 37;
diff --git a/mysql-test/lib/generate-ssl-certs.sh b/mysql-test/lib/generate-ssl-certs.sh
index 5dca21a755d..8f15ba9d521 100755
--- a/mysql-test/lib/generate-ssl-certs.sh
+++ b/mysql-test/lib/generate-ssl-certs.sh
@@ -1,30 +1,39 @@
-#/bin/sh -xe
+#!/bin/sh
+
+set -xe
# simply run me from mysql-test/
cd std_data/
# boilerplace for "openssl ca" and /etc/ssl/openssl.cnf
rm -rf demoCA
-mkdir demoCA demoCA/private demoCA/newcerts
+mkdir demoCA demoCA/newcerts
touch demoCA/index.txt
echo 01 > demoCA/serial
# CA certificate, self-signed
-openssl req -x509 -newkey rsa:2048 -keyout demoCA/private/cakey.pem -out cacert.pem -days 7300 -nodes -subj '/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' -text
+openssl req -x509 -newkey rsa:2048 -keyout cakey.pem -out cacert.pem -days 7300 -nodes -subj '/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' -text
# server certificate signing request and private key. Note the very long subject (for MDEV-7859)
openssl req -newkey rsa:1024 -keyout server-key.pem -out demoCA/server-req.pem -days 7300 -nodes -subj '/CN=localhost/C=FI/ST=state or province within country, in other certificates in this file it is the same as L/L=location, usually an address but often ambiguously used/OU=organizational unit name, a division name within an organization/O=organization name, typically a company name'
# convert the key to yassl compatible format
openssl rsa -in server-key.pem -out server-key.pem
# sign the server certificate with CA certificate
-openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out server-cert.pem -infiles demoCA/server-req.pem
+openssl ca -keyfile cakey.pem -days 7300 -batch -cert cacert.pem -policy policy_anything -out server-cert.pem -infiles demoCA/server-req.pem
openssl req -newkey rsa:8192 -keyout server8k-key.pem -out demoCA/server8k-req.pem -days 7300 -nodes -subj '/CN=server8k/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB'
openssl rsa -in server8k-key.pem -out server8k-key.pem
-openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out server8k-cert.pem -infiles demoCA/server8k-req.pem
+openssl ca -keyfile cakey.pem -days 7300 -batch -cert cacert.pem -policy policy_anything -out server8k-cert.pem -infiles demoCA/server8k-req.pem
openssl req -newkey rsa:1024 -keyout client-key.pem -out demoCA/client-req.pem -days 7300 -nodes -subj '/CN=client/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB'
openssl rsa -in client-key.pem -out client-key.pem
-openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out client-cert.pem -infiles demoCA/client-req.pem
+openssl ca -keyfile cakey.pem -days 7300 -batch -cert cacert.pem -policy policy_anything -out client-cert.pem -infiles demoCA/client-req.pem
+
+# with SubjectAltName, only for OpenSSL 1.0.2+
+cat > demoCA/sanext.conf <<EOF
+subjectAltName=DNS:localhost
+EOF
+openssl req -newkey rsa:1024 -keyout serversan-key.pem -out demoCA/serversan-req.pem -days 7300 -nodes -subj '/CN=server/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB'
+openssl ca -keyfile cakey.pem -extfile demoCA/sanext.conf -days 7300 -batch -cert cacert.pem -policy policy_anything -out serversan-cert.pem -infiles demoCA/serversan-req.pem
rm -rf demoCA
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 38c52b705f6..d758b81c1c7 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -36,8 +36,6 @@ our $do_test;
our $skip_test;
our $binlog_format;
our $enable_disabled;
-our $default_storage_engine;
-our $opt_with_ndbcluster_only;
sub collect_option {
my ($opt, $value)= @_;
@@ -320,7 +318,7 @@ sub parse_disabled {
chomp;
next if /^\s*#/ or /^\s*$/;
mtr_error("Syntax error in $filename line $.")
- unless /^\s*(?:([-0-9A-Za-z_\/]+)\.)?([-0-9A-Za-z_\*]+)\s*:\s*(.*?)\s*$/;
+ unless /^\s*(?:([-0-9A-Za-z_\/]+)\.)?([-0-9A-Za-z_#\*]+)\s*:\s*(.*?)\s*$/;
mtr_error("Wrong suite name in $filename line $.: suitename = $suitename but the file says $1")
if defined $1 and defined $suitename and $1 ne $suitename;
my ($sname, $casename, $text)= (($1 || $suitename || ''), $2, $3);
@@ -628,7 +626,7 @@ sub make_combinations($$@)
if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
- delete $test_combs->{$comb->{name}};
+ $test_combs->{$comb->{name}} = 2;
# Add combination name short name
push @{$test->{combinations}}, $comb->{name};
@@ -637,8 +635,9 @@ sub make_combinations($$@)
}
# Skip all other combinations, if this combination is forced
- if (delete $test_combs->{$comb->{name}}) {
+ if ($test_combs->{$comb->{name}}) {
@combinations = ($comb); # run the loop below only for this combination
+ $test_combs->{$comb->{name}} = 2;
last;
}
}
@@ -834,29 +833,6 @@ sub collect_one_test_case {
return $tinfo
}
- if ( $tinfo->{'ndb_test'} )
- {
- # This is a NDB test
- if ( $::ndbcluster_enabled == 0)
- {
- # ndbcluster is disabled
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "ndbcluster disabled";
- return $tinfo;
- }
- }
- else
- {
- # This is not a ndb test
- if ( $opt_with_ndbcluster_only )
- {
- # Only the ndb test should be run, all other should be skipped
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "Only ndbcluster tests";
- return $tinfo;
- }
- }
-
if ( $tinfo->{'rpl_test'} )
{
if ( $skip_rpl )
@@ -899,9 +875,10 @@ sub collect_one_test_case {
{
@cases = map make_combinations($_, \%test_combs, @{$comb}), @cases;
}
- if (keys %test_combs) {
+ my @no_combs = grep { $test_combs{$_} == 1 } keys %test_combs;
+ if (@no_combs) {
mtr_error("Could not run $name with '".(
- join(',', sort keys %test_combs))."' combination(s)");
+ join(',', sort @no_combs))."' combination(s)");
}
for $tinfo (@cases) {
@@ -993,10 +970,7 @@ sub collect_one_test_case {
my $tags_map= {'big_test' => ['big_test', 1],
- 'have_ndb' => ['ndb_test', 1],
- 'have_multi_ndb' => ['ndb_test', 1],
'master-slave' => ['rpl_test', 1],
- 'ndb_master-slave' => ['rpl_test', 1, 'ndb_test', 1],
'long_test' => ['long_test', 1],
};
my $tags_regex_string= join('|', keys %$tags_map);
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm
index 97ace54f0fb..d93d8adf34c 100644
--- a/mysql-test/lib/mtr_report.pm
+++ b/mysql-test/lib/mtr_report.pm
@@ -208,6 +208,10 @@ sub mtr_report_test ($) {
{
mtr_report("[ skipped ]");
}
+ if ( $tinfo->{'warnings'} )
+ {
+ mtr_report($tinfo->{'warnings'});
+ }
}
elsif ($result eq 'MTR_RES_PASSED')
{
diff --git a/mysql-test/lib/v1/mtr_cases.pl b/mysql-test/lib/v1/mtr_cases.pl
index baeab24f519..067e7e5e4d1 100644
--- a/mysql-test/lib/v1/mtr_cases.pl
+++ b/mysql-test/lib/v1/mtr_cases.pl
@@ -154,7 +154,6 @@ sub collect_test_cases ($) {
#
# Append the criteria for sorting, in order of importance.
#
- push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
# Group test with equal options together.
# Ending with "~" makes empty sort later than filled
push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
@@ -788,8 +787,6 @@ sub collect_one_test_case($$$$$$$$$) {
{
# Different default engine is used
# tag test to require that engine
- $tinfo->{'ndb_test'}= 1
- if ( $::used_default_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
if ( $::used_default_engine =~ /^innodb/i );
@@ -809,20 +806,6 @@ sub collect_one_test_case($$$$$$$$$) {
return;
}
- if ( $tinfo->{'ndb_extra'} and ! $::opt_ndb_extra_test )
- {
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "Test need 'ndb_extra' option";
- return;
- }
-
- if ( $tinfo->{'require_manager'} )
- {
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "Test need the _old_ manager(to be removed)";
- return;
- }
-
if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
{
$tinfo->{'skip'}= 1;
@@ -830,38 +813,6 @@ sub collect_one_test_case($$$$$$$$$) {
return;
}
- if ( $tinfo->{'ndb_test'} )
- {
- # This is a NDB test
- if ( ! $::glob_ndbcluster_supported )
- {
- # Ndb is not supported, skip it
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "No ndbcluster support";
- return;
- }
- elsif ( $::opt_skip_ndbcluster )
- {
- # All ndb test's should be skipped
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
- return;
- }
- # Ndb tests run with two mysqld masters
- $tinfo->{'master_num'}= 2;
- }
- else
- {
- # This is not a ndb test
- if ( $::opt_with_ndbcluster_only )
- {
- # Only the ndb test should be run, all other should be skipped
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "Only ndbcluster tests(--with-ndbcluster-only)";
- return;
- }
- }
-
if ( $tinfo->{'innodb_test'} )
{
# This is a test that need innodb
@@ -916,10 +867,6 @@ our @tags=
["include/have_log_bin.inc", "need_binlog", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
- ["include/have_ndb.inc", "ndb_test", 1],
- ["include/have_multi_ndb.inc", "ndb_test", 1],
- ["include/have_ndb_extra.inc", "ndb_extra", 1],
- ["include/ndb_master-slave.inc", "ndb_test", 1],
["require_manager", "require_manager", 1],
["include/federated.inc", "federated_test", 1],
["include/have_federated_db.inc", "federated_test", 1],
diff --git a/mysql-test/lib/v1/mtr_process.pl b/mysql-test/lib/v1/mtr_process.pl
index f86f9e5dec0..3518b33839e 100644
--- a/mysql-test/lib/v1/mtr_process.pl
+++ b/mysql-test/lib/v1/mtr_process.pl
@@ -31,7 +31,6 @@ sub mtr_check_stop_servers ($);
sub mtr_kill_leftovers ();
sub mtr_wait_blocking ($);
sub mtr_record_dead_children ();
-sub mtr_ndbmgm_start($$);
sub mtr_mysqladmin_start($$$);
sub mtr_exit ($);
sub sleep_until_file_created ($$$);
@@ -342,10 +341,8 @@ sub mtr_process_exit_status {
##############################################################################
-# Kill all processes(mysqld, ndbd, ndb_mgmd and im) that would conflict with
-# this run
+# Kill all processes that would conflict with this run
# Make sure to remove the PID file, if any.
-# kill IM manager first, else it will restart the servers
sub mtr_kill_leftovers () {
mtr_report("Killing Possible Leftover Processes");
@@ -376,46 +373,6 @@ sub mtr_kill_leftovers () {
$srv->{'pid'}= 0; # Assume we are done with it
}
- if ( ! $::opt_skip_ndbcluster )
- {
-
- foreach my $cluster (@{$::clusters})
- {
-
- # Don't shut down a "running" cluster
- next if $cluster->{'use_running'};
-
- mtr_debug(" - cluster " .
- "(pid: $cluster->{pid}; " .
- "pid file: '$cluster->{path_pid})");
-
- my $pid= mtr_ndbmgm_start($cluster, "shutdown");
-
- # Save the pid of the ndb_mgm process
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
-
- $cluster->{'pid'}= 0; # Assume we are done with it
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- mtr_debug(" - ndbd " .
- "(pid: $ndbd->{pid}; " .
- "pid file: '$ndbd->{path_pid})");
-
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0; # Assume we are done with it
- }
- }
- }
-
# Wait for all the admin processes to complete
mtr_wait_blocking(\%admin_pids);
@@ -747,32 +704,6 @@ sub mtr_mysqladmin_start($$$) {
}
-# Start "ndb_mgm shutdown" for a specific cluster, it will
-# shutdown all data nodes and leave the ndb_mgmd running
-sub mtr_ndbmgm_start($$) {
- my $cluster= shift;
- my $command= shift;
-
- my $args;
-
- mtr_init_args(\$args);
-
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
- mtr_add_arg($args, "--try-reconnect=1");
- mtr_add_arg($args, "--ndb_connectstring=%s", $cluster->{'connect_string'});
- mtr_add_arg($args, "-e");
- mtr_add_arg($args, "$command");
-
- my $pid= mtr_spawn($::exe_ndb_mgm, $args,
- "", "/dev/null", "/dev/null", "",
- {});
- mtr_verbose("mtr_ndbmgm_start, pid: $pid");
- return $pid;
-
-}
-
-
# Ping all servers in list, exit when none of them answers
# or when timeout has passed
sub mtr_ping_with_timeout($) {
@@ -843,25 +774,6 @@ sub mark_process_dead($)
}
}
- foreach my $cluster (@{$::clusters})
- {
- if ( $cluster->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndb_mgmd exited, pid: $ret_pid");
- $cluster->{'pid'}= 0;
- return;
- }
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- if ( $ndbd->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndbd exited, pid: $ret_pid");
- $ndbd->{'pid'}= 0;
- return;
- }
- }
- }
mtr_warning("mark_process_dead couldn't find an entry for pid: $ret_pid");
}
@@ -915,52 +827,6 @@ sub check_expected_crash_and_restart($)
}
}
- foreach my $cluster (@{$::clusters})
- {
- if ( $cluster->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndb_mgmd exited, pid: $ret_pid");
- $cluster->{'pid'}= 0;
-
- # Check if crash expected and restart if it was
- my $expect_file= "$::opt_vardir/tmp/ndb_mgmd_" . "$cluster->{'type'}" .
- ".expect";
- if ( -f $expect_file )
- {
- mtr_verbose("Crash was expected, file $expect_file exists");
- unlink($expect_file);
- ndbmgmd_start($cluster);
- }
- return;
- }
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- if ( $ndbd->{'pid'} eq $ret_pid )
- {
- mtr_verbose("$cluster->{'name'} cluster ndbd exited, pid: $ret_pid");
- $ndbd->{'pid'}= 0;
-
- # Check if crash expected and restart if it was
- my $expect_file= "$::opt_vardir/tmp/ndbd_" . "$cluster->{'type'}" .
- "$ndbd->{'idx'}" . ".expect";
- if ( -f $expect_file )
- {
- mtr_verbose("Crash was expected, file $expect_file exists");
- unlink($expect_file);
- ndbd_start($cluster, $ndbd->{'idx'},
- $ndbd->{'start_extra_args'});
- }
- return;
- }
- }
- }
-
- if ($::instance_manager->{'spawner_pid'} eq $ret_pid)
- {
- return;
- }
-
mtr_warning("check_expected_crash_and_restart couldn't find an entry for pid: $ret_pid");
}
diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl
index 9c957ea29c3..738236a731e 100644
--- a/mysql-test/lib/v1/mtr_report.pl
+++ b/mysql-test/lib/v1/mtr_report.pl
@@ -287,9 +287,6 @@ sub mtr_report_stats ($) {
/unknown variable 'loose-/ or
/You have forced lower_case_table_names to 0 through a command-line option/ or
/Setting lower_case_table_names=2/ or
- /NDB Binlog:/ or
- /NDB: failed to setup table/ or
- /NDB: only row based binary logging/ or
/Neither --relay-log nor --relay-log-index were used/ or
/Query partially completed/ or
/Slave I.O thread aborted while waiting for relay log/ or
@@ -314,7 +311,6 @@ sub mtr_report_stats ($) {
/Slave: Can't drop database.* database doesn't exist/ or
/Slave SQL:.*(?:error.* \d+|Query:.*)/ or
/Sort aborted/ or
- /Time-out in NDB/ or
/One can only use the --user.*root/ or
/Table:.* on (delete|rename)/ or
/You have an error in your SQL syntax/ or
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index baeb141f18c..79489d92742 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -92,7 +92,6 @@ our $glob_cygwin_perl= ($^O eq "cygwin"); # Cygwin Perl
our $glob_win32= ($glob_win32_perl or $glob_cygwin_perl);
require "lib/v1/mtr_cases.pl";
-require "lib/v1/mtr_im.pl";
require "lib/v1/mtr_process.pl";
require "lib/v1/mtr_timer.pl";
require "lib/v1/mtr_io.pl";
@@ -168,8 +167,6 @@ our $exe_mysqlimport;
our $exe_mysqlshow;
our $file_mysql_fix_privilege_tables;
our $exe_mysqltest;
-our $exe_ndbd;
-our $exe_ndb_mgmd;
our $exe_slave_mysqld;
our $exe_my_print_defaults;
our $exe_perror;
@@ -233,19 +230,9 @@ our $opt_gprof_slave;
our $master;
our $slave;
-our $clusters;
-
-our $instance_manager;
our $opt_master_myport;
our $opt_slave_myport;
-our $im_port;
-our $im_mysqld1_port;
-our $im_mysqld2_port;
-our $opt_ndbcluster_port;
-our $opt_ndbconnectstring;
-our $opt_ndbcluster_port_slave;
-our $opt_ndbconnectstring_slave;
our $opt_record;
my $opt_report_features;
@@ -257,7 +244,6 @@ our $max_slave_num= 0;
our $max_master_num= 1;
our $use_innodb;
our $opt_skip_test;
-our $opt_skip_im;
our $opt_sleep;
@@ -296,22 +282,9 @@ our $opt_stress_test_file= "";
our $opt_warnings;
-our $opt_skip_ndbcluster= 0;
-our $opt_skip_ndbcluster_slave= 0;
-our $opt_with_ndbcluster= 0;
-our $opt_with_ndbcluster_only= 0;
-our $glob_ndbcluster_supported= 0;
-our $opt_ndb_extra_test= 0;
our $opt_skip_master_binlog= 0;
our $opt_skip_slave_binlog= 0;
-our $exe_ndb_mgm;
-our $exe_ndb_waiter;
-our $path_ndb_tools_dir;
-our $path_ndb_examples_dir;
-our $exe_ndb_example;
-our $path_ndb_testrun_log;
-
our $path_sql_dir;
our @data_dir_lst;
@@ -345,11 +318,6 @@ sub remove_stale_vardir ();
sub setup_vardir ();
sub check_ssl_support ($);
sub check_running_as_root();
-sub check_ndbcluster_support ($);
-sub rm_ndbcluster_tables ($);
-sub ndbcluster_start_install ($);
-sub ndbcluster_start ($$);
-sub ndbcluster_wait_started ($$);
sub mysqld_wait_started($);
sub run_benchmarks ($);
sub initialize_servers ();
@@ -363,8 +331,6 @@ sub run_testcase_check_skip_test($);
sub report_failure_and_restart ($);
sub do_before_start_master ($);
sub do_before_start_slave ($);
-sub ndbd_start ($$$);
-sub ndb_mgmd_start ($);
sub mysqld_start ($$$);
sub mysqld_arguments ($$$$);
sub stop_all_servers ();
@@ -384,7 +350,6 @@ sub main () {
command_line_setup();
- check_ndbcluster_support(\%mysqld_variables);
check_ssl_support(\%mysqld_variables);
check_debug_support(\%mysqld_variables);
@@ -419,42 +384,18 @@ sub main () {
if (!$opt_suites)
{
$opt_suites= $opt_suites_default;
-
- # Check for any extra suites to enable based on the path name
- my %extra_suites=
- (
- "mysql-5.1-new-ndb" => "ndb_team",
- "mysql-5.1-new-ndb-merge" => "ndb_team",
- "mysql-5.1-telco-6.2" => "ndb_team",
- "mysql-5.1-telco-6.2-merge" => "ndb_team",
- "mysql-5.1-telco-6.3" => "ndb_team",
- "mysql-6.0-ndb" => "ndb_team",
- );
-
- foreach my $dir ( reverse splitdir($glob_basedir) )
- {
- my $extra_suite= $extra_suites{$dir};
- if (defined $extra_suite){
- mtr_report("Found extra suite: $extra_suite");
- $opt_suites= "$extra_suite,$opt_suites";
- last;
- }
- }
}
my $tests= collect_test_cases($opt_suites);
- # Turn off NDB and other similar options if no tests use it
- my ($need_ndbcluster,$need_im, $need_debug);
+ my ($need_debug);
foreach my $test (@$tests)
{
next if $test->{skip};
if (!$opt_extern)
{
- $need_ndbcluster||= $test->{ndb_test};
$need_debug||=$test->{need_debug};
- $need_im||= $test->{component_id} eq 'im';
# Count max number of slaves used by a test case
if ( $test->{slave_num} > $max_slave_num) {
@@ -472,30 +413,11 @@ sub main () {
$use_innodb||= $test->{'innodb_test'};
}
- # Check if cluster can be skipped
- if ( !$need_ndbcluster )
- {
- $opt_skip_ndbcluster= 1;
- $opt_skip_ndbcluster_slave= 1;
- }
-
if ( !$need_debug && !$opt_debug)
{
$opt_debug=0;
}
- # Check if slave cluster can be skipped
- if ($max_slave_num == 0)
- {
- $opt_skip_ndbcluster_slave= 1;
- }
-
- # Check if im can be skipped
- if ( ! $need_im )
- {
- $opt_skip_im= 1;
- }
-
initialize_servers();
if ( $opt_report_features ) {
@@ -580,23 +502,16 @@ sub command_line_setup () {
'compress' => \$opt_compress,
'bench' => \$opt_bench,
'small-bench' => \$opt_small_bench,
- 'with-ndbcluster|ndb' => \$opt_with_ndbcluster,
'vs-config' => \$opt_vs_config,
# Control what test suites or cases to run
'force' => \$opt_force,
- 'with-ndbcluster-only' => \$opt_with_ndbcluster_only,
- 'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
- 'skip-ndbcluster-slave|skip-ndb-slave'
- => \$opt_skip_ndbcluster_slave,
- 'ndb-extra-test' => \$opt_ndb_extra_test,
'skip-master-binlog' => \$opt_skip_master_binlog,
'skip-slave-binlog' => \$opt_skip_slave_binlog,
'do-test=s' => \$opt_do_test,
'start-from=s' => \$opt_start_from,
'suite|suites=s' => \$opt_suites,
'skip-rpl' => \$opt_skip_rpl,
- 'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test,
'big-test' => \$opt_big_test,
'combination=s' => \@opt_combinations,
@@ -605,11 +520,6 @@ sub command_line_setup () {
# Specify ports
'master_port=i' => \$opt_master_myport,
'slave_port=i' => \$opt_slave_myport,
- 'ndbcluster-port|ndbcluster_port=i' => \$opt_ndbcluster_port,
- 'ndbcluster-port-slave=i' => \$opt_ndbcluster_port_slave,
- 'im-port=i' => \$im_port, # Instance Manager port.
- 'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM
- 'im-mysqld2-port=i' => \$im_mysqld2_port, # Port of mysqld, controlled by IM
'mtr-build-thread=i' => \$opt_mtr_build_thread,
# Test case authoring
@@ -625,8 +535,6 @@ sub command_line_setup () {
# Run test on running server
'extern' => \$opt_extern,
- 'ndb-connectstring=s' => \$opt_ndbconnectstring,
- 'ndb-connectstring-slave=s' => \$opt_ndbconnectstring_slave,
# Debugging
'gdb' => \$opt_gdb,
@@ -800,7 +708,6 @@ sub command_line_setup () {
push(@glob_test_mode, "embedded");
$opt_skip_rpl= 1; # We never run replication with embedded
- $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
$opt_skip_ssl= 1; # Turn off use of SSL
# Turn off use of bin log
@@ -922,12 +829,6 @@ sub command_line_setup () {
# --------------------------------------------------------------------------
# Find out default storage engine being used(if any)
# --------------------------------------------------------------------------
- if ( $opt_with_ndbcluster )
- {
- # --ndb or --with-ndbcluster turns on --default-storage-engine=ndbcluster
- push(@opt_extra_mysqld_opt, "--default-storage-engine=ndbcluster");
- }
-
foreach my $arg ( @opt_extra_mysqld_opt )
{
if ( $arg =~ /default-storage-engine=(\S+)/ )
@@ -1012,25 +913,6 @@ sub command_line_setup () {
$opt_tmpdir =~ s,/+$,,; # Remove ending slash if any
# --------------------------------------------------------------------------
- # Check im suport
- # --------------------------------------------------------------------------
- if ($opt_extern)
- {
- # mtr_report("Disable instance manager when running with extern mysqld");
- $opt_skip_im= 1;
- }
- elsif ( $mysql_version_id < 50000 )
- {
- # Instance manager is not supported until 5.0
- $opt_skip_im= 1;
- }
- elsif ( $glob_win32 )
- {
- mtr_report("Disable Instance manager - testing not supported on Windows");
- $opt_skip_im= 1;
- }
-
- # --------------------------------------------------------------------------
# Record flag
# --------------------------------------------------------------------------
if ( $opt_record and ! @opt_cases )
@@ -1188,7 +1070,6 @@ sub command_line_setup () {
path_sock => "$sockdir/master.sock",
port => $opt_master_myport,
start_timeout => 400, # enough time create innodb tables
- cluster => 0, # index in clusters list
start_opts => [],
};
@@ -1203,7 +1084,6 @@ sub command_line_setup () {
path_sock => "$sockdir/master1.sock",
port => $opt_master_myport + 1,
start_timeout => 400, # enough time create innodb tables
- cluster => 0, # index in clusters list
start_opts => [],
};
@@ -1219,7 +1099,6 @@ sub command_line_setup () {
port => $opt_slave_myport,
start_timeout => 400,
- cluster => 1, # index in clusters list
start_opts => [],
};
@@ -1234,7 +1113,6 @@ sub command_line_setup () {
path_sock => "$sockdir/slave1.sock",
port => $opt_slave_myport + 1,
start_timeout => 300,
- cluster => -1, # index in clusters list
start_opts => [],
};
@@ -1249,91 +1127,9 @@ sub command_line_setup () {
path_sock => "$sockdir/slave2.sock",
port => $opt_slave_myport + 2,
start_timeout => 300,
- cluster => -1, # index in clusters list
start_opts => [],
};
- $instance_manager=
- {
- path_err => "$opt_vardir/log/im.err",
- path_log => "$opt_vardir/log/im.log",
- path_pid => "$opt_vardir/run/im.pid",
- path_angel_pid => "$opt_vardir/run/im.angel.pid",
- path_sock => "$sockdir/im.sock",
- port => $im_port,
- start_timeout => $master->[0]->{'start_timeout'},
- admin_login => 'im_admin',
- admin_password => 'im_admin_secret',
- admin_sha1 => '*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295',
- password_file => "$opt_vardir/im.passwd",
- defaults_file => "$opt_vardir/im.cnf",
- };
-
- $instance_manager->{'instances'}->[0]=
- {
- server_id => 1,
- port => $im_mysqld1_port,
- path_datadir => "$opt_vardir/im_mysqld_1.data",
- path_sock => "$sockdir/mysqld_1.sock",
- path_pid => "$opt_vardir/run/mysqld_1.pid",
- start_timeout => 400, # enough time create innodb tables
- old_log_format => 1
- };
-
- $instance_manager->{'instances'}->[1]=
- {
- server_id => 2,
- port => $im_mysqld2_port,
- path_datadir => "$opt_vardir/im_mysqld_2.data",
- path_sock => "$sockdir/mysqld_2.sock",
- path_pid => "$opt_vardir/run/mysqld_2.pid",
- nonguarded => 1,
- start_timeout => 400, # enough time create innodb tables
- old_log_format => 1
- };
-
- my $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port";
- $clusters->[0]=
- {
- name => "Master",
- nodes => 2,
- port => "$opt_ndbcluster_port",
- data_dir => "$data_dir",
- connect_string => "host=localhost:$opt_ndbcluster_port",
- path_pid => "$data_dir/ndb_3.pid", # Nodes + 1
- pid => 0, # pid of ndb_mgmd
- installed_ok => 0,
- };
-
- $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port_slave";
- $clusters->[1]=
- {
- name => "Slave",
- nodes => 1,
- port => "$opt_ndbcluster_port_slave",
- data_dir => "$data_dir",
- connect_string => "host=localhost:$opt_ndbcluster_port_slave",
- path_pid => "$data_dir/ndb_2.pid", # Nodes + 1
- pid => 0, # pid of ndb_mgmd
- installed_ok => 0,
- };
-
- # Init pids of ndbd's
- foreach my $cluster ( @{$clusters} )
- {
- for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
- {
- my $nodeid= $idx+1;
- $cluster->{'ndbds'}->[$idx]=
- {
- pid => 0,
- nodeid => $nodeid,
- path_pid => "$cluster->{'data_dir'}/ndb_${nodeid}.pid",
- path_fs => "$cluster->{'data_dir'}/ndb_${nodeid}_fs",
- };
- }
- }
-
# --------------------------------------------------------------------------
# extern
# --------------------------------------------------------------------------
@@ -1341,7 +1137,6 @@ sub command_line_setup () {
{
# Turn off features not supported when running with extern server
$opt_skip_rpl= 1;
- $opt_skip_ndbcluster= 1;
# Setup master->[0] with the settings for the extern server
$master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock";
@@ -1354,41 +1149,10 @@ sub command_line_setup () {
}
- # --------------------------------------------------------------------------
- # ndbconnectstring and ndbconnectstring_slave
- # --------------------------------------------------------------------------
- if ( $opt_ndbconnectstring )
- {
- # ndbconnectstring was supplied by user, the tests shoudl be run
- # against an already started cluster, change settings
- my $cluster= $clusters->[0]; # Master cluster
- $cluster->{'connect_string'}= $opt_ndbconnectstring;
- $cluster->{'use_running'}= 1;
-
- mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
- if $opt_skip_ndbcluster;
- }
- $ENV{'NDB_CONNECTSTRING'}= $clusters->[0]->{'connect_string'};
-
-
- if ( $opt_ndbconnectstring_slave )
- {
- # ndbconnectstring-slave was supplied by user, the tests should be run
- # agains an already started slave cluster, change settings
- my $cluster= $clusters->[1]; # Slave cluster
- $cluster->{'connect_string'}= $opt_ndbconnectstring_slave;
- $cluster->{'use_running'}= 1;
-
- mtr_error("Can't specify ndb-connectstring_slave and " .
- "--skip-ndbcluster-slave")
- if $opt_skip_ndbcluster_slave;
- }
-
$path_timefile= "$opt_vardir/log/mysqltest-time";
$path_mysqltest_log= "$opt_vardir/log/mysqltest.log";
$path_current_test_log= "$opt_vardir/log/current_test";
- $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
}
@@ -1422,11 +1186,6 @@ sub set_mtr_build_thread_ports($) {
# A magic value in command_line_setup depends on these equations.
$opt_master_myport= $mtr_build_thread * 10 + 10000; # and 1
$opt_slave_myport= $opt_master_myport + 2; # and 3 4
- $opt_ndbcluster_port= $opt_master_myport + 5;
- $opt_ndbcluster_port_slave= $opt_master_myport + 6;
- $im_port= $opt_master_myport + 7;
- $im_mysqld1_port= $opt_master_myport + 8;
- $im_mysqld2_port= $opt_master_myport + 9;
if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
{
@@ -1449,14 +1208,6 @@ sub datadir_list_setup () {
{
push(@data_dir_lst, $slave->[$idx]->{'path_myddir'});
}
-
- unless ($opt_skip_im)
- {
- foreach my $instance (@{$instance_manager->{'instances'}})
- {
- push(@data_dir_lst, $instance->{'path_datadir'});
- }
- }
}
@@ -1584,45 +1335,6 @@ sub collect_mysqld_features_from_running_server ()
}
}
-sub executable_setup_ndb () {
-
- # Look for ndb tols and binaries
- my $ndb_path= mtr_file_exists("$glob_bindir/ndb",
- "$glob_bindir/storage/ndb",
- "$glob_bindir/bin");
-
- $exe_ndbd=
- mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd",
- "$ndb_path/ndbd",
- "$glob_bindir/libexec/ndbd");
- $exe_ndb_mgm=
- mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm",
- "$ndb_path/ndb_mgm");
- $exe_ndb_mgmd=
- mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
- "$ndb_path/ndb_mgmd",
- "$glob_bindir/libexec/ndb_mgmd");
- $exe_ndb_waiter=
- mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter",
- "$ndb_path/ndb_waiter");
-
- # May not exist
- $path_ndb_tools_dir= mtr_file_exists("$ndb_path/tools",
- "$ndb_path");
- # May not exist
- $path_ndb_examples_dir=
- mtr_file_exists("$ndb_path/ndbapi-examples",
- "$ndb_path/examples");
- # May not exist
- $exe_ndb_example=
- mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple");
-
- return ( $exe_ndbd eq "" or
- $exe_ndb_mgm eq "" or
- $exe_ndb_mgmd eq "" or
- $exe_ndb_waiter eq "");
-}
-
sub executable_setup () {
#
@@ -1693,18 +1405,6 @@ sub executable_setup () {
"$glob_basedir/share/mysql_fix_privilege_tables.sql",
"$glob_basedir/share/mysql/mysql_fix_privilege_tables.sql");
- if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
- {
- mtr_warning("Could not find all required ndb binaries, " .
- "all ndb tests will fail, use --skip-ndbcluster to " .
- "skip testing it.");
-
- foreach my $cluster (@{$clusters})
- {
- $cluster->{"executable_setup_failed"}= 1;
- }
- }
-
# Look for the udf_example library
$lib_udf_example=
mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
@@ -1870,14 +1570,6 @@ sub environment_setup () {
}
}
- # --------------------------------------------------------------------------
- # Add the path where libndbclient can be found
- # --------------------------------------------------------------------------
- if ( $glob_ndbcluster_supported )
- {
- push(@ld_library_paths, "$glob_bindir/storage/ndb/src/.libs");
- }
-
# --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug"
@@ -1955,64 +1647,10 @@ sub environment_setup () {
$ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'};
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'};
- $ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
- $ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
- $ENV{'IM_PASSWORD'}= $instance_manager->{admin_password};
$ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
$ENV{'EXE_MYSQL'}= $exe_mysql;
-
- # ----------------------------------------------------
- # Setup env for NDB
- # ----------------------------------------------------
- if ( ! $opt_skip_ndbcluster )
- {
- $ENV{'NDB_MGM'}= $exe_ndb_mgm;
-
- $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
- $ENV{'NDBCLUSTER_PORT_SLAVE'}= $opt_ndbcluster_port_slave;
-
- $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
-
- $ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
- $ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
- $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
- $ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
-
- if ( $mysql_version_id >= 50000 )
- {
- $ENV{'NDB_EXAMPLES_DIR'}= $path_ndb_examples_dir;
- $ENV{'MY_NDB_EXAMPLES_BINARY'}= $exe_ndb_example;
- }
- $ENV{'NDB_EXAMPLES_OUTPUT'}= $path_ndb_testrun_log;
- }
-
- # ----------------------------------------------------
- # Setup env for IM
- # ----------------------------------------------------
- if ( ! $opt_skip_im )
- {
- $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid};
- $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid};
- $ENV{'IM_PORT'}= $instance_manager->{port};
- $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file};
- $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file};
-
- $ENV{'IM_MYSQLD1_SOCK'}=
- $instance_manager->{instances}->[0]->{path_sock};
- $ENV{'IM_MYSQLD1_PORT'}=
- $instance_manager->{instances}->[0]->{port};
- $ENV{'IM_MYSQLD1_PATH_PID'}=
- $instance_manager->{instances}->[0]->{path_pid};
- $ENV{'IM_MYSQLD2_SOCK'}=
- $instance_manager->{instances}->[1]->{path_sock};
- $ENV{'IM_MYSQLD2_PORT'}=
- $instance_manager->{instances}->[1]->{port};
- $ENV{'IM_MYSQLD2_PATH_PID'}=
- $instance_manager->{instances}->[1]->{path_pid};
- }
-
# ----------------------------------------------------
# Setup env so childs can execute mysqlcheck
# ----------------------------------------------------
@@ -2228,20 +1866,6 @@ sub environment_setup () {
print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n";
print "Using SLAVE_MYPORT1 = $ENV{SLAVE_MYPORT1}\n";
print "Using SLAVE_MYPORT2 = $ENV{SLAVE_MYPORT2}\n";
- if ( ! $opt_skip_ndbcluster )
- {
- print "Using NDBCLUSTER_PORT = $ENV{NDBCLUSTER_PORT}\n";
- if ( ! $opt_skip_ndbcluster_slave )
- {
- print "Using NDBCLUSTER_PORT_SLAVE = $ENV{NDBCLUSTER_PORT_SLAVE}\n";
- }
- }
- if ( ! $opt_skip_im )
- {
- print "Using IM_PORT = $ENV{IM_PORT}\n";
- print "Using IM_MYSQLD1_PORT = $ENV{IM_MYSQLD1_PORT}\n";
- print "Using IM_MYSQLD2_PORT = $ENV{IM_MYSQLD2_PORT}\n";
- }
}
# Create an environment variable to make it possible
@@ -2599,155 +2223,6 @@ sub vs_config_dirs ($$) {
"$glob_bindir/$path_part/debug/$exe");
}
-##############################################################################
-#
-# Start the ndb cluster
-#
-##############################################################################
-
-sub check_ndbcluster_support ($) {
- my $mysqld_variables= shift;
-
- if ($opt_skip_ndbcluster || $opt_extern)
- {
- if (!$opt_extern)
- {
- mtr_report("Skipping ndbcluster");
- }
- $opt_skip_ndbcluster_slave= 1;
- return;
- }
-
- if ( ! $mysqld_variables->{'ndb-connectstring'} )
- {
- mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
- $opt_skip_ndbcluster= 1;
- $opt_skip_ndbcluster_slave= 1;
- return;
- }
- $glob_ndbcluster_supported= 1;
- mtr_report("Using ndbcluster when necessary, mysqld supports it");
-
- if ( $mysql_version_id < 50100 )
- {
- # Slave cluster is not supported until 5.1
- $opt_skip_ndbcluster_slave= 1;
-
- }
-
- return;
-}
-
-
-sub ndbcluster_start_install ($) {
- my $cluster= shift;
-
- mtr_report("Installing $cluster->{'name'} Cluster");
-
- mkdir($cluster->{'data_dir'});
-
- # Create a config file from template
- my $ndb_no_ord=512;
- my $ndb_no_attr=2048;
- my $ndb_con_op=105000;
- my $ndb_dmem="80M";
- my $ndb_imem="24M";
- my $ndb_pbmem="32M";
- my $nodes= $cluster->{'nodes'};
- my $ndb_host= "localhost";
- my $ndb_diskless= 0;
-
- if (!$opt_bench)
- {
- # Use a smaller configuration
- if ( $mysql_version_id < 50100 )
- {
- # 4.1 and 5.0 is using a "larger" --small configuration
- $ndb_no_ord=128;
- $ndb_con_op=10000;
- $ndb_dmem="40M";
- $ndb_imem="12M";
- }
- else
- {
- $ndb_no_ord=32;
- $ndb_con_op=10000;
- $ndb_dmem="20M";
- $ndb_imem="1M";
- $ndb_pbmem="4M";
- }
- }
-
- my $config_file_template= "lib/v1/ndb_config_${nodes}_node.ini";
- my $config_file= "$cluster->{'data_dir'}/config.ini";
-
- open(IN, $config_file_template)
- or mtr_error("Can't open $config_file_template: $!");
- open(OUT, ">", $config_file)
- or mtr_error("Can't write to $config_file: $!");
- while (<IN>)
- {
- chomp;
-
- s/CHOOSE_MaxNoOfAttributes/$ndb_no_attr/;
- s/CHOOSE_MaxNoOfOrderedIndexes/$ndb_no_ord/;
- s/CHOOSE_MaxNoOfConcurrentOperations/$ndb_con_op/;
- s/CHOOSE_DataMemory/$ndb_dmem/;
- s/CHOOSE_IndexMemory/$ndb_imem/;
- s/CHOOSE_Diskless/$ndb_diskless/;
- s/CHOOSE_HOSTNAME_.*/$ndb_host/;
- s/CHOOSE_FILESYSTEM/$cluster->{'data_dir'}/;
- s/CHOOSE_PORT_MGM/$cluster->{'port'}/;
- if ( $mysql_version_id < 50000 )
- {
- my $base_port= $cluster->{'port'} + 1;
- s/CHOOSE_PORT_TRANSPORTER/$base_port/;
- }
- s/CHOOSE_DiskPageBufferMemory/$ndb_pbmem/;
-
- print OUT "$_ \n";
- }
- close OUT;
- close IN;
-
-
- # Start cluster with "--initial"
-
- ndbcluster_start($cluster, "--initial");
-
- return 0;
-}
-
-
-sub ndbcluster_wait_started($$){
- my $cluster= shift;
- my $ndb_waiter_extra_opt= shift;
- my $path_waiter_log= "$cluster->{'data_dir'}/ndb_waiter.log";
- my $args;
-
- mtr_init_args(\$args);
-
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
- mtr_add_arg($args, "--ndb-connectstring=%s", $cluster->{'connect_string'});
- mtr_add_arg($args, "--timeout=60");
-
- if ($ndb_waiter_extra_opt)
- {
- mtr_add_arg($args, "$ndb_waiter_extra_opt");
- }
-
- # Start the ndb_waiter which will connect to the ndb_mgmd
- # and poll it for state of the ndbd's, will return when
- # all nodes in the cluster is started
- my $res= mtr_run($exe_ndb_waiter, $args,
- "", $path_waiter_log, $path_waiter_log, "");
- mtr_verbose("ndbcluster_wait_started, returns: $res") if $res;
- return $res;
-}
-
-
-
sub mysqld_wait_started($){
my $mysqld= shift;
@@ -2767,137 +2242,6 @@ sub mysqld_wait_started($){
}
-sub ndb_mgmd_wait_started($) {
- my ($cluster)= @_;
-
- my $retries= 100;
- while (ndbcluster_wait_started($cluster, "--no-contact") and
- $retries)
- {
- # Millisceond sleep emulated with select
- select(undef, undef, undef, (0.1));
-
- $retries--;
- }
-
- return $retries == 0;
-
-}
-
-sub ndb_mgmd_start ($) {
- my $cluster= shift;
-
- my $args; # Arg vector
- my $pid= -1;
-
- mtr_init_args(\$args);
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
- mtr_add_arg($args, "--nodaemon");
- mtr_add_arg($args, "--config-file=%s", "$cluster->{'data_dir'}/config.ini");
-
-
- my $path_ndb_mgmd_log= "$cluster->{'data_dir'}/\l$cluster->{'name'}_ndb_mgmd.log";
- $pid= mtr_spawn($exe_ndb_mgmd, $args, "",
- $path_ndb_mgmd_log,
- $path_ndb_mgmd_log,
- "",
- { append_log_file => 1 });
-
- # FIXME Should not be needed
- # Unfortunately the cluster nodes will fail to start
- # if ndb_mgmd has not started properly
- if (ndb_mgmd_wait_started($cluster))
- {
- mtr_error("Failed to wait for start of ndb_mgmd");
- }
-
- # Remember pid of ndb_mgmd
- $cluster->{'pid'}= $pid;
-
- mtr_verbose("ndb_mgmd_start, pid: $pid");
-
- return $pid;
-}
-
-
-sub ndbd_start ($$$) {
- my $cluster= shift;
- my $idx= shift;
- my $extra_args= shift;
-
- my $args; # Arg vector
- my $pid= -1;
-
- mtr_init_args(\$args);
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--core");
- mtr_add_arg($args, "--ndb-connectstring=%s", "$cluster->{'connect_string'}");
- if ( $mysql_version_id >= 50000)
- {
- mtr_add_arg($args, "--character-sets-dir=%s", "$path_charsetsdir");
- }
- mtr_add_arg($args, "--nodaemon");
- mtr_add_arg($args, "$extra_args");
-
- my $nodeid= $cluster->{'ndbds'}->[$idx]->{'nodeid'};
- my $path_ndbd_log= "$cluster->{'data_dir'}/ndb_${nodeid}.log";
- $pid= mtr_spawn($exe_ndbd, $args, "",
- $path_ndbd_log,
- $path_ndbd_log,
- "",
- { append_log_file => 1 });
-
- # Add pid to list of pids for this cluster
- $cluster->{'ndbds'}->[$idx]->{'pid'}= $pid;
-
- # Rememeber options used when starting
- $cluster->{'ndbds'}->[$idx]->{'start_extra_args'}= $extra_args;
- $cluster->{'ndbds'}->[$idx]->{'idx'}= $idx;
-
- mtr_verbose("ndbd_start, pid: $pid");
-
- return $pid;
-}
-
-
-sub ndbcluster_start ($$) {
- my $cluster= shift;
- my $extra_args= shift;
-
- mtr_verbose("ndbcluster_start '$cluster->{'name'}'");
-
- if ( $cluster->{'use_running'} )
- {
- return 0;
- }
-
- if ( $cluster->{'pid'} )
- {
- mtr_error("Cluster '$cluster->{'name'}' already started");
- }
-
- ndb_mgmd_start($cluster);
-
- for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
- {
- ndbd_start($cluster, $idx, $extra_args);
- }
-
- return 0;
-}
-
-
-sub rm_ndbcluster_tables ($) {
- my $dir= shift;
- foreach my $bin ( glob("$dir/mysql/ndb_apply_status*"),
- glob("$dir/mysql/ndb_schema*"))
- {
- unlink($bin);
- }
-}
-
-
##############################################################################
#
# Run the benchmark suite
@@ -2929,11 +2273,6 @@ sub run_benchmarks ($) {
mtr_add_arg($args, "--small-tables");
}
- if ( $opt_with_ndbcluster )
- {
- mtr_add_arg($args, "--create-options=TYPE=ndb");
- }
-
chdir($glob_mysql_bench_dir)
or mtr_error("Couldn't chdir to '$glob_mysql_bench_dir': $!");
@@ -3078,69 +2417,6 @@ sub mysql_install_db () {
copy_install_db("slave".($idx+1), $slave->[$idx]->{'path_myddir'});
}
- if ( ! $opt_skip_im )
- {
- im_prepare_env($instance_manager);
- }
-
- my $cluster_started_ok= 1; # Assume it can be started
-
- my $cluster= $clusters->[0]; # Master cluster
- if ($opt_skip_ndbcluster ||
- $cluster->{'use_running'} ||
- $cluster->{executable_setup_failed})
- {
- # Don't install master cluster
- }
- elsif (ndbcluster_start_install($cluster))
- {
- mtr_warning("Failed to start install of $cluster->{name}");
- $cluster_started_ok= 0;
- }
-
- $cluster= $clusters->[1]; # Slave cluster
- if ($max_slave_num == 0 ||
- $opt_skip_ndbcluster_slave ||
- $cluster->{'use_running'} ||
- $cluster->{executable_setup_failed})
- {
- # Don't install slave cluster
- }
- elsif (ndbcluster_start_install($cluster))
- {
- mtr_warning("Failed to start install of $cluster->{name}");
- $cluster_started_ok= 0;
- }
-
- foreach $cluster (@{$clusters})
- {
-
- next if !$cluster->{'pid'};
-
- $cluster->{'installed_ok'}= 1; # Assume install suceeds
-
- if (ndbcluster_wait_started($cluster, ""))
- {
- # failed to install, disable usage and flag that its no ok
- mtr_report("ndbcluster_install of $cluster->{'name'} failed");
- $cluster->{"installed_ok"}= 0;
-
- $cluster_started_ok= 0;
- }
- }
-
- if ( ! $cluster_started_ok )
- {
- if ( $opt_force)
- {
- # Continue without cluster
- }
- else
- {
- mtr_error("To continue, re-run with '--force'.");
- }
- }
-
return 0;
}
@@ -3170,7 +2446,6 @@ sub install_db ($$) {
mtr_add_arg($args, "--bootstrap");
mtr_add_arg($args, "--basedir=%s", $glob_basedir);
mtr_add_arg($args, "--datadir=%s", $data_dir);
- mtr_add_arg($args, "--loose-skip-ndbcluster");
mtr_add_arg($args, "--loose-skip-aria");
mtr_add_arg($args, "--disable-sync-frm");
mtr_add_arg($args, "--loose-disable-debug");
@@ -3268,105 +2543,6 @@ sub install_db ($$) {
}
-sub im_prepare_env($) {
- my $instance_manager = shift;
-
- im_create_passwd_file($instance_manager);
- im_prepare_data_dir($instance_manager);
-}
-
-
-sub im_create_passwd_file($) {
- my $instance_manager = shift;
-
- my $pwd_file_path = $instance_manager->{'password_file'};
-
- mtr_report("Creating IM password file ($pwd_file_path)");
-
- open(OUT, ">", $pwd_file_path)
- or mtr_error("Can't write to $pwd_file_path: $!");
-
- print OUT $instance_manager->{'admin_login'}, ":",
- $instance_manager->{'admin_sha1'}, "\n";
-
- close(OUT);
-}
-
-
-sub im_create_defaults_file($) {
- my $instance_manager = shift;
-
- my $defaults_file = $instance_manager->{'defaults_file'};
-
- open(OUT, ">", $defaults_file)
- or mtr_error("Can't write to $defaults_file: $!");
-
- print OUT <<EOF
-[mysql]
-
-[manager]
-pid-file = $instance_manager->{path_pid}
-angel-pid-file = $instance_manager->{path_angel_pid}
-socket = $instance_manager->{path_sock}
-port = $instance_manager->{port}
-password-file = $instance_manager->{password_file}
-default-mysqld-path = $exe_mysqld
-
-EOF
-;
-
- foreach my $instance (@{$instance_manager->{'instances'}})
- {
- my $server_id = $instance->{'server_id'};
-
- print OUT <<EOF
-[mysqld$server_id]
-socket = $instance->{path_sock}
-pid-file = $instance->{path_pid}
-port = $instance->{port}
-datadir = $instance->{path_datadir}
-lc-messages-dir = $path_language
-log = $instance->{path_datadir}/mysqld$server_id.log
-log-error = $instance->{path_datadir}/mysqld$server_id.err.log
-log-slow-queries = $instance->{path_datadir}/mysqld$server_id.slow.log
-character-sets-dir = $path_charsetsdir
-basedir = $glob_basedir
-server_id = $server_id
-shutdown-delay = 10
-skip-stack-trace
-loose-skip-innodb
-loose-skip-ndbcluster
-EOF
-;
- if ( $mysql_version_id < 50100 )
- {
- print OUT "skip-bdb\n";
- }
- print OUT "nonguarded\n" if $instance->{'nonguarded'};
- if ( $mysql_version_id >= 50100 )
- {
- print OUT "log-output=FILE\n" if $instance->{'old_log_format'};
- }
- print OUT "\n";
- }
-
- close(OUT);
-}
-
-
-sub im_prepare_data_dir($) {
- my $instance_manager = shift;
-
- foreach my $instance (@{$instance_manager->{'instances'}})
- {
- copy_install_db(
- 'im_mysqld_' . $instance->{'server_id'},
- $instance->{'path_datadir'});
- }
-}
-
-
-
#
# Restore snapshot of the installed slave databases
# if the snapshot exists
@@ -3423,56 +2599,6 @@ sub run_testcase_check_skip_test($)
return 1;
}
- if ($tinfo->{'ndb_test'})
- {
- foreach my $cluster (@{$clusters})
- {
- # Slave cluster is skipped and thus not
- # installed, no need to perform checks
- last if ($opt_skip_ndbcluster_slave and
- $cluster->{'name'} eq 'Slave');
-
- # Using running cluster - no need
- # to check if test should be skipped
- # will be done by test itself
- last if ($cluster->{'use_running'});
-
- # If test needs this cluster, check binaries was found ok
- if ( $cluster->{'executable_setup_failed'} )
- {
- mtr_report_test_name($tinfo);
- $tinfo->{comment}=
- "Failed to find cluster binaries";
- mtr_report_test_failed($tinfo);
- return 1;
- }
-
- # If test needs this cluster, check it was installed ok
- if ( !$cluster->{'installed_ok'} )
- {
- mtr_report_test_name($tinfo);
- $tinfo->{comment}=
- "Cluster $cluster->{'name'} was not installed ok";
- mtr_report_test_failed($tinfo);
- return 1;
- }
-
- }
- }
-
- if ( $tinfo->{'component_id'} eq 'im' )
- {
- # If test needs im, check binaries was found ok
- if ( $instance_manager->{'executable_setup_failed'} )
- {
- mtr_report_test_name($tinfo);
- $tinfo->{comment}=
- "Failed to find MySQL manager binaries";
- mtr_report_test_failed($tinfo);
- return 1;
- }
- }
-
return 0;
}
@@ -3492,15 +2618,6 @@ sub do_before_run_mysqltest($)
if (!$opt_extern)
{
- if ( $mysql_version_id < 50000 ) {
- # Set environment variable NDB_STATUS_OK to 1
- # if script decided to run mysqltest cluster _is_ installed ok
- $ENV{'NDB_STATUS_OK'} = "1";
- } elsif ( $mysql_version_id < 50100 ) {
- # Set environment variable NDB_STATUS_OK to YES
- # if script decided to run mysqltest cluster _is_ installed ok
- $ENV{'NDB_STATUS_OK'} = "YES";
- }
if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 )
{
# Dynamically switch binlog format of
@@ -3552,16 +2669,6 @@ sub run_testcase_mark_logs($$)
{
mtr_tofile($mysqld->{path_myerr}, $log_msg);
}
-
- if ( $tinfo->{'component_id'} eq 'im')
- {
- mtr_tofile($instance_manager->{path_err}, $log_msg);
- mtr_tofile($instance_manager->{path_log}, $log_msg);
- }
-
- # ndbcluster log file
- mtr_tofile($path_ndb_testrun_log, $log_msg);
-
}
sub find_testcase_skipped_reason($)
@@ -3716,15 +2823,6 @@ sub run_testcase ($) {
# Remove the file that mysqltest writes info to
unlink($path_timefile);
-
- # ----------------------------------------------------------------------
- # Stop Instance Manager if we are processing an IM-test case.
- # ----------------------------------------------------------------------
- if ( $tinfo->{'component_id'} eq 'im' and
- !mtr_im_stop($instance_manager, $tinfo->{'name'}))
- {
- mtr_error("Failed to stop Instance Manager.")
- }
}
@@ -3785,16 +2883,6 @@ sub restore_installed_db ($) {
mtr_rmtree("$data_dir");
mtr_copy_dir("$path_snapshot/$name", "$data_dir");
}
-
- # Remove the ndb_*_fs dirs for all ndbd nodes
- # forcing a clean start of ndb
- foreach my $cluster (@{$clusters})
- {
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- mtr_rmtree("$ndbd->{'path_fs'}" );
- }
- }
}
else
{
@@ -4025,23 +3113,6 @@ sub mysqld_arguments ($$$$) {
$prefix);
mtr_add_arg($args, "%s--local-infile", $prefix);
-
- my $cluster= $clusters->[$mysqld->{'cluster'}];
- if ( $cluster->{'pid'} || # Cluster is started
- $cluster->{'use_running'} ) # Using running cluster
- {
- mtr_add_arg($args, "%s--ndbcluster", $prefix);
- mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
- $cluster->{'connect_string'});
- if ( $mysql_version_id >= 50100 )
- {
- mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
- }
- }
- else
- {
- mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
- }
}
else
{
@@ -4109,25 +3180,6 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
}
-
- my $cluster= $clusters->[$mysqld->{'cluster'}];
- if ( $cluster->{'pid'} || # Slave cluster is started
- $cluster->{'use_running'} ) # Using running slave cluster
- {
- mtr_add_arg($args, "%s--ndbcluster", $prefix);
- mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
- $cluster->{'connect_string'});
-
- if ( $mysql_version_id >= 50100 )
- {
- mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
- }
- }
- else
- {
- mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
- }
-
} # end slave
if ( $debug_compiled_binaries && defined $opt_debug )
@@ -4315,15 +3367,6 @@ sub stop_all_servers () {
mtr_report("Stopping All Servers");
- if ( ! $opt_skip_im )
- {
- mtr_report("Shutting-down Instance Manager");
- unless (mtr_im_stop($instance_manager, "stop_all_servers"))
- {
- mtr_error("Failed to stop Instance Manager.")
- }
- }
-
my %admin_pids; # hash of admin processes that requests shutdown
my @kill_pids; # list of processes to shutdown/kill
my $pid;
@@ -4349,45 +3392,11 @@ sub stop_all_servers () {
}
}
- # Start shutdown of clusters
- foreach my $cluster (@{$clusters})
- {
- if ( $cluster->{'pid'} )
- {
- $pid= mtr_ndbmgm_start($cluster, "shutdown");
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
-
- $cluster->{'pid'}= 0; # Assume we are done with it
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- if ( $ndbd->{'pid'} )
- {
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0;
- }
- }
- }
- }
-
# Wait blocking until all shutdown processes has completed
mtr_wait_blocking(\%admin_pids);
# Make sure that process has shutdown else try to kill them
mtr_check_stop_servers(\@kill_pids);
-
- foreach my $mysqld (@{$master}, @{$slave})
- {
- rm_ndbcluster_tables($mysqld->{'path_myddir'});
- }
}
@@ -4413,25 +3422,6 @@ sub run_testcase_need_master_restart($)
$do_restart= 1; # Always restart if --force-restart in -opt file
mtr_verbose("Restart master: Restart forced with --force-restart");
}
- elsif ( ! $opt_skip_ndbcluster and
- !$tinfo->{'ndb_test'} and
- $clusters->[0]->{'pid'} != 0 )
- {
- $do_restart= 1; # Restart without cluster
- mtr_verbose("Restart master: Test does not need cluster");
- }
- elsif ( ! $opt_skip_ndbcluster and
- $tinfo->{'ndb_test'} and
- $clusters->[0]->{'pid'} == 0 )
- {
- $do_restart= 1; # Restart with cluster
- mtr_verbose("Restart master: Test need cluster");
- }
- elsif( $tinfo->{'component_id'} eq 'im' )
- {
- $do_restart= 1;
- mtr_verbose("Restart master: Always restart for im tests");
- }
elsif ( $master->[0]->{'running_master_options'} and
$master->[0]->{'running_master_options'}->{'timezone'} ne
$tinfo->{'timezone'})
@@ -4556,30 +3546,6 @@ sub run_testcase_stop_servers($$$) {
$mysqld->{'pid'}= 0; # Assume we are done with it
}
}
-
- # Start shutdown of master cluster
- my $cluster= $clusters->[0];
- if ( $cluster->{'pid'} )
- {
- $pid= mtr_ndbmgm_start($cluster, "shutdown");
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
-
- $cluster->{'pid'}= 0; # Assume we are done with it
-
- foreach my $ndbd (@{$cluster->{'ndbds'}})
- {
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0; # Assume we are done with it
- }
- }
}
if ( $do_restart || $do_slave_restart )
@@ -4609,31 +3575,6 @@ sub run_testcase_stop_servers($$$) {
$mysqld->{'pid'}= 0; # Assume we are done with it
}
}
-
- # Start shutdown of slave cluster
- my $cluster= $clusters->[1];
- if ( $cluster->{'pid'} )
- {
- $pid= mtr_ndbmgm_start($cluster, "shutdown");
-
- $admin_pids{$pid}= 1;
-
- push(@kill_pids,{
- pid => $cluster->{'pid'},
- pidfile => $cluster->{'path_pid'}
- });
-
- $cluster->{'pid'}= 0; # Assume we are done with it
-
- foreach my $ndbd (@{$cluster->{'ndbds'}} )
- {
- push(@kill_pids,{
- pid => $ndbd->{'pid'},
- pidfile => $ndbd->{'path_pid'},
- });
- $ndbd->{'pid'}= 0; # Assume we are done with it
- }
- }
}
# ----------------------------------------------------------------------
@@ -4647,15 +3588,6 @@ sub run_testcase_stop_servers($$$) {
# Make sure that process has shutdown else try to kill them
mtr_check_stop_servers(\@kill_pids);
-
- foreach my $mysqld (@{$master}, @{$slave})
- {
- if ( ! $mysqld->{'pid'} )
- {
- # Remove ndbcluster tables if server is stopped
- rm_ndbcluster_tables($mysqld->{'path_myddir'});
- }
- }
}
@@ -4675,14 +3607,6 @@ sub run_testcase_start_servers($) {
if ( $tinfo->{'component_id'} eq 'mysqld' )
{
- if ( ! $opt_skip_ndbcluster and
- !$clusters->[0]->{'pid'} and
- $tinfo->{'ndb_test'} )
- {
- # Test need cluster, cluster is not started, start it
- ndbcluster_start($clusters->[0], "");
- }
-
if ( !$master->[0]->{'pid'} )
{
# Master mysqld is not started
@@ -4692,48 +3616,9 @@ sub run_testcase_start_servers($) {
}
- if ( $clusters->[0]->{'pid'} || $clusters->[0]->{'use_running'}
- and ! $master->[1]->{'pid'} and
- $tinfo->{'master_num'} > 1 )
- {
- # Test needs cluster, start an extra mysqld connected to cluster
-
- if ( $mysql_version_id >= 50100 )
- {
- # First wait for first mysql server to have created ndb system
- # tables ok FIXME This is a workaround so that only one mysqld
- # create the tables
- if ( ! sleep_until_file_created(
- "$master->[0]->{'path_myddir'}/mysql/ndb_apply_status.ndb",
- $master->[0]->{'start_timeout'},
- $master->[0]->{'pid'}))
- {
-
- $tinfo->{'comment'}= "Failed to create 'mysql/ndb_apply_status' table";
- return 1;
- }
- }
- mysqld_start($master->[1],$tinfo->{'master_opt'},[]);
- }
-
# Save this test case information, so next can examine it
$master->[0]->{'running_master_options'}= $tinfo;
}
- elsif ( ! $opt_skip_im and $tinfo->{'component_id'} eq 'im' )
- {
- # We have to create defaults file every time, in order to ensure that it
- # will be the same for each test. The problem is that test can change the
- # file (by SET/UNSET commands), so w/o recreating the file, execution of
- # one test can affect the other.
-
- im_create_defaults_file($instance_manager);
-
- if ( ! mtr_im_start($instance_manager, $tinfo->{im_opts}) )
- {
- $tinfo->{'comment'}= "Failed to start Instance Manager. ";
- return 1;
- }
- }
# ----------------------------------------------------------------------
# Start slaves - if needed
@@ -4744,14 +3629,6 @@ sub run_testcase_start_servers($) {
do_before_start_slave($tinfo);
- if ( ! $opt_skip_ndbcluster_slave and
- !$clusters->[1]->{'pid'} and
- $tinfo->{'ndb_test'} )
- {
- # Test need slave cluster, cluster is not started, start it
- ndbcluster_start($clusters->[1], "");
- }
-
for ( my $idx= 0; $idx < $tinfo->{'slave_num'}; $idx++ )
{
if ( ! $slave->[$idx]->{'pid'} )
@@ -4766,20 +3643,6 @@ sub run_testcase_start_servers($) {
$slave->[0]->{'running_slave_options'}= $tinfo;
}
- # Wait for clusters to start
- foreach my $cluster (@{$clusters})
- {
-
- next if !$cluster->{'pid'};
-
- if (ndbcluster_wait_started($cluster, ""))
- {
- # failed to start
- $tinfo->{'comment'}= "Start of $cluster->{'name'} cluster failed";
- return 1;
- }
- }
-
# Wait for mysqld's to start
foreach my $mysqld (@{$master},@{$slave})
{
@@ -4908,14 +3771,7 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--mark-progress")
if $opt_mark_progress;
- if ($tinfo->{'component_id'} eq 'im')
- {
- mtr_add_arg($args, "--socket=%s", $instance_manager->{'path_sock'});
- mtr_add_arg($args, "--port=%d", $instance_manager->{'port'});
- mtr_add_arg($args, "--user=%s", $instance_manager->{'admin_login'});
- mtr_add_arg($args, "--password=%s", $instance_manager->{'admin_password'});
- }
- else # component_id == mysqld
+ # component_id == mysqld
{
mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
mtr_add_arg($args, "--port=%d", $master->[0]->{'port'});
@@ -5325,7 +4181,6 @@ Options to control what engine/variation to run
skip-ssl Dont start server with support for ssl connections
bench Run the benchmark suite
small-bench Run the benchmarks with --small-tests --small-tables
- ndb|with-ndbcluster Use cluster as default table type
vs-config Visual Studio configuration used to create executables
(default: MTR_VS_CONFIG environment variable)
@@ -5347,10 +4202,6 @@ Options to control directories to use
Options to control what test suites or cases to run
force Continue to run the suite after failure
- with-ndbcluster-only Run only tests that include "ndb" in the filename
- skip-ndb[cluster] Skip all tests that need cluster
- skip-ndb[cluster]-slave Skip all tests that need a slave cluster
- ndb-extra Run extra tests from ndb directory
do-test=PREFIX or REGEX
Run test cases which name are prefixed with PREFIX
or fulfills REGEX
@@ -5362,7 +4213,6 @@ Options to control what test suites or cases to run
list of suite names.
The default is: "$opt_suites_default"
skip-rpl Skip the replication test cases.
- skip-im Don't start IM, and skip the IM test cases
big-test Set the environment variable BIG_TEST, which can be
checked from test cases.
combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
@@ -5373,8 +4223,6 @@ Options that specify ports
master_port=PORT Specify the port number used by the first master
slave_port=PORT Specify the port number used by the first slave
- ndbcluster-port=PORT Specify the port number used by cluster
- ndbcluster-port-slave=PORT Specify the port number used by slave cluster
mtr-build-thread=# Specify unique collection of ports. Can also be set by
setting the environment variable MTR_BUILD_THREAD.
@@ -5391,8 +4239,6 @@ Options that pass on options
Options to run test on running server
extern Use running server for tests
- ndb-connectstring=STR Use running cluster, and connect using STR
- ndb-connectstring-slave=STR Use running slave cluster, and connect using STR
user=USER User for connection to extern server
socket=PATH Socket for connection to extern server
diff --git a/mysql-test/lib/v1/ndb_config_1_node.ini b/mysql-test/lib/v1/ndb_config_1_node.ini
deleted file mode 100644
index 4e0be7796dc..00000000000
--- a/mysql-test/lib/v1/ndb_config_1_node.ini
+++ /dev/null
@@ -1,47 +0,0 @@
-[ndbd default]
-NoOfReplicas= 1
-MaxNoOfConcurrentTransactions= 64
-MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
-DataMemory= CHOOSE_DataMemory
-IndexMemory= CHOOSE_IndexMemory
-Diskless= CHOOSE_Diskless
-TimeBetweenWatchDogCheck= 30000
-DataDir= CHOOSE_FILESYSTEM
-MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
-MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 8
-FragmentLogFileSize= 6M
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
-
-#
-# Increase timeouts to cater for slow test-machines
-# (possibly running several tests in parallell)
-#
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-#TransactionDeadlockDetectionTimeout= 7500
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-
-[ndb_mgmd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-DataDir= CHOOSE_FILESYSTEM #
-PortNumber= CHOOSE_PORT_MGM
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
diff --git a/mysql-test/lib/v1/ndb_config_2_node.ini b/mysql-test/lib/v1/ndb_config_2_node.ini
deleted file mode 100644
index 57e4d049ad6..00000000000
--- a/mysql-test/lib/v1/ndb_config_2_node.ini
+++ /dev/null
@@ -1,55 +0,0 @@
-[ndbd default]
-NoOfReplicas= 2
-MaxNoOfConcurrentTransactions= 64
-MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
-DataMemory= CHOOSE_DataMemory
-IndexMemory= CHOOSE_IndexMemory
-Diskless= CHOOSE_Diskless
-TimeBetweenWatchDogCheck= 30000
-DataDir= CHOOSE_FILESYSTEM
-MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
-MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 4
-FragmentLogFileSize=12M
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
-# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
-#ODirect= 1
-# the following parametes just function as a small regression
-# test that the parameter exists
-InitialNoOfOpenFiles= 27
-
-#
-# Increase timeouts to cater for slow test-machines
-# (possibly running several tests in parallell)
-#
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-#TransactionDeadlockDetectionTimeout= 7500
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress
-
-[ndb_mgmd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-DataDir= CHOOSE_FILESYSTEM #
-PortNumber= CHOOSE_PORT_MGM
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index befa6f00b9a..eaec51b82b4 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -136,6 +136,9 @@ my $opt_start;
my $opt_start_dirty;
my $opt_start_exit;
my $start_only;
+my $file_wsrep_provider;
+
+our @global_suppressions;
END {
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
@@ -167,7 +170,9 @@ my @DEFAULT_SUITES= qw(
main-
archive-
binlog-
+ binlog_encryption-
csv-
+ encryption-
federated-
funcs_1-
funcs_2-
@@ -177,6 +182,7 @@ my @DEFAULT_SUITES= qw(
innodb_fts-
innodb_zip-
maria-
+ mariabackup-
multi_source-
optimizer_unfixed_bugs-
parts-
@@ -188,6 +194,8 @@ my @DEFAULT_SUITES= qw(
sys_vars-
unit-
vcol-
+ wsrep-
+ galera-
);
my $opt_suites;
@@ -311,7 +319,6 @@ our $opt_user = "root";
our $opt_valgrind= 0;
my $opt_valgrind_mysqld= 0;
my $opt_valgrind_mysqltest= 0;
-my @default_valgrind_args= ("--show-reachable=yes");
my @valgrind_args;
my $opt_strace= 0;
my $opt_strace_client;
@@ -338,16 +345,6 @@ sub check_timeout ($) { return testcase_timeout($_[0]); }
our $opt_warnings= 1;
-our $ndbcluster_enabled= 0;
-my $opt_include_ndbcluster= 0;
-my $opt_skip_ndbcluster= 0;
-
-my $exe_ndbd;
-my $exe_ndbmtd;
-my $exe_ndb_mgmd;
-my $exe_ndb_waiter;
-my $exe_ndb_mgm;
-
our %mysqld_variables;
our @optional_plugins;
@@ -359,6 +356,7 @@ my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
my $opt_core_on_failure= 0;
my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
+my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 20;
# lock file to stop tests
my $opt_stop_file= $ENV{MTR_STOP_FILE};
@@ -411,7 +409,6 @@ sub main {
# Run the mysqld to find out what features are available
collect_mysqld_features();
}
- check_ndbcluster_support();
check_ssl_support();
check_debug_support();
@@ -588,12 +585,6 @@ sub run_test_server ($$$) {
my $test_failure= 0; # Set true if test suite failed
my $extra_warnings= []; # Warnings found during server shutdowns
- # Scheduler variables
- my $max_ndb= $ENV{MTR_MAX_NDB} || $childs / 2;
- $max_ndb = $childs if $max_ndb > $childs;
- $max_ndb = 1 if $max_ndb < 1;
- my $num_ndb_tests= 0;
-
my $completed= [];
my %running;
my $result;
@@ -766,9 +757,6 @@ sub run_test_server ($$$) {
mtr_error("'", $result->{name},"' is not known to be running")
unless delete $running{$result->key()};
- # Update scheduler variables
- $num_ndb_tests-- if ($result->{ndb_test});
-
# Save result in completed list
push(@$completed, $result);
@@ -801,7 +789,6 @@ sub run_test_server ($$$) {
# Find next test to schedule
# - Try to use same configuration as worker used last time
- # - Limit number of parallel ndb tests
my $next;
my $second_best;
@@ -821,12 +808,6 @@ sub run_test_server ($$$) {
redo;
}
- # Limit number of parallel NDB tests
- if ($t->{ndb_test} and $num_ndb_tests >= $max_ndb){
- #mtr_report("Skipping, num ndb is already at max, $num_ndb_tests");
- next;
- }
-
# From secondary choices, we prefer to pick a 'long-running' test if
# possible; this helps avoid getting stuck with a few of those at the
# end of high --parallel runs, with most workers being idle.
@@ -879,7 +860,6 @@ sub run_test_server ($$$) {
delete $next->{criteria};
$next->write_test($sock, 'TESTCASE');
$running{$next->key()}= $next;
- $num_ndb_tests++ if ($next->{ndb_test});
}
else {
# No more test, tell child to exit
@@ -1108,9 +1088,6 @@ sub command_line_setup {
# Control what test suites or cases to run
'force+' => \$opt_force,
- 'with-ndbcluster-only' => \&collect_option,
- 'ndb|include-ndbcluster' => \$opt_include_ndbcluster,
- 'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
'suite|suites=s' => \$opt_suites,
'skip-rpl' => \&collect_option,
'skip-test=s' => \&collect_option,
@@ -1126,6 +1103,7 @@ sub command_line_setup {
# Specify ports
'build-thread|mtr-build-thread=i' => \$opt_build_thread,
'port-base|mtr-port-base=i' => \$opt_port_base,
+ 'port-group-size=s' => \$opt_port_group_size,
# Test case authoring
'record' => \$opt_record,
@@ -1729,17 +1707,27 @@ sub command_line_setup {
# Set special valgrind options unless options passed on command line
push(@valgrind_args, "--trace-children=yes")
unless @valgrind_args;
+ unshift(@valgrind_args, "--tool=callgrind");
}
- if ( $opt_valgrind )
+ # default to --tool=memcheck
+ if ($opt_valgrind && ! grep(/^--tool=/i, @valgrind_args))
{
- # Set valgrind_options to default unless already defined
- push(@valgrind_args, @default_valgrind_args)
+ # Set valgrind_option unless already defined
+ push(@valgrind_args, ("--show-reachable=yes", "--leak-check=yes",
+ "--num-callers=16"))
unless @valgrind_args;
+ unshift(@valgrind_args, "--tool=memcheck");
+ }
+ if ( $opt_valgrind )
+ {
# Make valgrind run in quiet mode so it only print errors
push(@valgrind_args, "--quiet" );
+ push(@valgrind_args, "--suppressions=${glob_mysql_test_dir}/valgrind.supp")
+ if -f "$glob_mysql_test_dir/valgrind.supp";
+
mtr_report("Running valgrind with options \"",
join(" ", @valgrind_args), "\"");
}
@@ -1818,16 +1806,16 @@ sub set_build_thread_ports($) {
$ENV{MTR_BUILD_THREAD}= $build_thread;
# Calculate baseport
- $baseport= $build_thread * 20 + 10000;
- if ( $baseport < 5001 or $baseport + 19 >= 32767 )
+ $baseport= $build_thread * $opt_port_group_size + 10000;
+ if ( $baseport < 5001 or $baseport + $opt_port_group_size >= 32767 )
{
mtr_error("MTR_BUILD_THREAD number results in a port",
"outside 5001 - 32767",
- "($baseport - $baseport + 19)");
+ "($baseport - $baseport + $opt_port_group_size)");
}
mtr_report("Using MTR_BUILD_THREAD $build_thread,",
- "with reserved ports $baseport..".($baseport+19));
+ "with reserved ports $baseport..".($baseport+($opt_port_group_size-1)));
}
@@ -1878,7 +1866,7 @@ sub collect_mysqld_features {
# they are listed in the --help output as
# --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load).
push @optional_plugins, $1
- if /^ --([-a-z0-9]+)\[=name\] +Enable or disable \w+ plugin. Possible values are ON, OFF, FORCE/;
+ if /^ --([-a-z0-9]+)\[=name\] +Enable or disable \w+ plugin. One of: ON, OFF, FORCE/;
next;
}
@@ -1985,51 +1973,6 @@ sub executable_setup () {
$exe_mysql_embedded= mtr_exe_maybe_exists("$basedir/libmysqld/examples/mysql_embedded");
- if ( $ndbcluster_enabled )
- {
- # Look for single threaded NDB
- $exe_ndbd=
- my_find_bin($bindir,
- ["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
- "ndbd");
-
- # Look for multi threaded NDB
- $exe_ndbmtd=
- my_find_bin($bindir,
- ["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
- "ndbmtd", NOT_REQUIRED);
- if ($exe_ndbmtd)
- {
- my $mtr_ndbmtd = $ENV{MTR_NDBMTD};
- if ($mtr_ndbmtd)
- {
- mtr_report(" - multi threaded ndbd found, will be used always");
- $exe_ndbd = $exe_ndbmtd;
- }
- else
- {
- mtr_report(" - multi threaded ndbd found, will be ".
- "used \"round robin\"");
- }
- }
-
- $exe_ndb_mgmd=
- my_find_bin($bindir,
- ["storage/ndb/src/mgmsrv", "libexec", "sbin", "bin"],
- "ndb_mgmd");
-
- $exe_ndb_mgm=
- my_find_bin($bindir,
- ["storage/ndb/src/mgmclient", "bin"],
- "ndb_mgm");
-
- $exe_ndb_waiter=
- my_find_bin($bindir,
- ["storage/ndb/tools/", "bin"],
- "ndb_waiter");
-
- }
-
# Look for mysqltest executable
if ( $opt_embedded_server )
{
@@ -2255,14 +2198,6 @@ sub environment_setup {
}
# --------------------------------------------------------------------------
- # Add the path where libndbclient can be found
- # --------------------------------------------------------------------------
- if ( $ndbcluster_enabled )
- {
- push(@ld_library_paths, "$basedir/storage/ndb/src/.libs");
- }
-
- # --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug"
# is available, it should be added to
@@ -2348,34 +2283,6 @@ sub environment_setup {
$ENV{HAVE_BROKEN_DNS}= defined(gethostbyname('invalid_hostname'));
# ----------------------------------------------------
- # Setup env for NDB
- # ----------------------------------------------------
- if ( $ndbcluster_enabled )
- {
- $ENV{'NDB_MGM'}=
- my_find_bin($bindir,
- ["storage/ndb/src/mgmclient", "bin"],
- "ndb_mgm");
-
- $ENV{'NDB_TOOLS_DIR'}=
- my_find_dir($bindir,
- ["storage/ndb/tools", "bin"]);
-
- $ENV{'NDB_EXAMPLES_DIR'}=
- my_find_dir($basedir,
- ["storage/ndb/ndbapi-examples", "bin"]);
-
- $ENV{'NDB_EXAMPLES_BINARY'}=
- my_find_bin($bindir,
- ["storage/ndb/ndbapi-examples/ndbapi_simple", "bin"],
- "ndbapi_simple", NOT_REQUIRED);
-
- my $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
- $ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
- $ENV{'NDB_EXAMPLES_OUTPUT'}= $path_ndb_testrun_log;
- }
-
- # ----------------------------------------------------
# mysql clients
# ----------------------------------------------------
$ENV{'MYSQL_CHECK'}= client_arguments("mysqlcheck");
@@ -2865,317 +2772,6 @@ sub vs_config_dirs ($$) {
"$basedir/$path_part/debug/$exe");
}
-
-sub check_ndbcluster_support {
-
- my $ndbcluster_supported = 0;
- if ($mysqld_variables{'ndb-connectstring'})
- {
- $ndbcluster_supported = 1;
- }
-
- if ($opt_skip_ndbcluster && $opt_include_ndbcluster)
- {
- # User is ambivalent. Theoretically the arg which was
- # given last on command line should win, but that order is
- # unknown at this time.
- mtr_error("Ambigous command, both --include-ndbcluster " .
- " and --skip-ndbcluster was specified");
- }
-
- # Check if this is MySQL Cluster, ie. mysql version string ends
- # with -ndb-Y.Y.Y[-status]
- if ( defined $mysql_version_extra &&
- $mysql_version_extra =~ /-ndb-([0-9]*)\.([0-9]*)\.([0-9]*)/ )
- {
- # MySQL Cluster tree
- mtr_report(" - MySQL Cluster detected");
-
- if ($opt_skip_ndbcluster)
- {
- mtr_report(" - skipping ndbcluster(--skip-ndbcluster)");
- return;
- }
-
- if (!$ndbcluster_supported)
- {
- # MySQL Cluster tree, but mysqld was not compiled with
- # ndbcluster -> fail unless --skip-ndbcluster was used
- mtr_error("This is MySQL Cluster but mysqld does not " .
- "support ndbcluster. Use --skip-ndbcluster to " .
- "force mtr to run without it.");
- }
-
- # mysqld was compiled with ndbcluster -> auto enable
- }
- else
- {
- # Not a MySQL Cluster tree
- if (!$ndbcluster_supported)
- {
- if ($opt_include_ndbcluster)
- {
- mtr_error("Could not detect ndbcluster support ".
- "requested with --include-ndbcluster");
- }
-
- # Silently skip, mysqld was compiled without ndbcluster
- # which is the default case
- return;
- }
-
- if ($opt_skip_ndbcluster)
- {
- # Compiled with ndbcluster but ndbcluster skipped
- mtr_report(" - skipping ndbcluster(--skip-ndbcluster)");
- return;
- }
-
-
- # Not a MySQL Cluster tree, enable ndbcluster
- # if --include-ndbcluster was used
- if ($opt_include_ndbcluster)
- {
- # enable ndbcluster
- }
- else
- {
- mtr_report(" - skipping ndbcluster(disabled by default)");
- return;
- }
- }
-
- mtr_report(" - enabling ndbcluster");
- $ndbcluster_enabled= 1;
- # Add MySQL Cluster test suites
- push @DEFAULT_SUITES, qw(ndb ndb_binlog rpl_ndb ndb_rpl ndb_memcache);
- return;
-}
-
-
-sub ndbcluster_wait_started {
- my $cluster= shift;
- my $ndb_waiter_extra_opt= shift;
- my $path_waitlog= join('/', $opt_vardir, $cluster->name(), "ndb_waiter.log");
-
- my $args;
- mtr_init_args(\$args);
- mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
- mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
- mtr_add_arg($args, "--timeout=%d", $opt_start_timeout);
-
- if ($ndb_waiter_extra_opt)
- {
- mtr_add_arg($args, "$ndb_waiter_extra_opt");
- }
-
- # Start the ndb_waiter which will connect to the ndb_mgmd
- # and poll it for state of the ndbd's, will return when
- # all nodes in the cluster is started
-
- my $res= My::SafeProcess->run
- (
- name => "ndb_waiter ".$cluster->name(),
- path => $exe_ndb_waiter,
- args => \$args,
- output => $path_waitlog,
- error => $path_waitlog,
- append => 1,
- );
-
- # Check that ndb_mgmd(s) are still alive
- foreach my $ndb_mgmd ( in_cluster($cluster, ndb_mgmds()) )
- {
- my $proc= $ndb_mgmd->{proc};
- if ( ! $proc->wait_one(0) )
- {
- mtr_warning("$proc died");
- return 2;
- }
- }
-
- # Check that all started ndbd(s) are still alive
- foreach my $ndbd ( in_cluster($cluster, ndbds()) )
- {
- my $proc= $ndbd->{proc};
- next unless defined $proc;
- if ( ! $proc->wait_one(0) )
- {
- mtr_warning("$proc died");
- return 3;
- }
- }
-
- if ($res)
- {
- mtr_verbose("ndbcluster_wait_started failed");
- return 1;
- }
- return 0;
-}
-
-
-sub ndb_mgmd_wait_started($) {
- my ($cluster)= @_;
-
- my $retries= 100;
- while ($retries)
- {
- my $result= ndbcluster_wait_started($cluster, "--no-contact");
- if ($result == 0)
- {
- # ndb_mgmd is started
- mtr_verbose("ndb_mgmd is started");
- return 0;
- }
- elsif ($result > 1)
- {
- mtr_warning("Cluster process failed while waiting for start");
- return $result;
- }
-
- mtr_milli_sleep(100);
- $retries--;
- }
-
- return 1;
-}
-
-sub ndb_mgmd_stop{
- my $ndb_mgmd= shift or die "usage: ndb_mgmd_stop(<ndb_mgmd>)";
-
- my $host=$ndb_mgmd->value('HostName');
- my $port=$ndb_mgmd->value('PortNumber');
- mtr_verbose("Stopping cluster '$host:$port'");
-
- my $args;
- mtr_init_args(\$args);
- mtr_add_arg($args, "--ndb-connectstring=%s:%s", $host,$port);
- mtr_add_arg($args, "-e");
- mtr_add_arg($args, "shutdown");
-
- My::SafeProcess->run
- (
- name => "ndb_mgm shutdown $host:$port",
- path => $exe_ndb_mgm,
- args => \$args,
- output => "/dev/null",
- );
-}
-
-sub ndb_mgmd_start ($$) {
- my ($cluster, $ndb_mgmd)= @_;
-
- mtr_verbose("ndb_mgmd_start");
-
- my $dir= $ndb_mgmd->value("DataDir");
- mkpath($dir) unless -d $dir;
-
- my $args;
- mtr_init_args(\$args);
- mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
- mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
- mtr_add_arg($args, "--mycnf");
- mtr_add_arg($args, "--nodaemon");
-
- my $path_ndb_mgmd_log= "$dir/ndb_mgmd.log";
-
- $ndb_mgmd->{'proc'}= My::SafeProcess->new
- (
- name => $ndb_mgmd->after('cluster_config.'),
- path => $exe_ndb_mgmd,
- args => \$args,
- output => $path_ndb_mgmd_log,
- error => $path_ndb_mgmd_log,
- append => 1,
- verbose => $opt_verbose,
- shutdown => sub { ndb_mgmd_stop($ndb_mgmd) },
- );
- mtr_verbose("Started $ndb_mgmd->{proc}");
-
- # FIXME Should not be needed
- # Unfortunately the cluster nodes will fail to start
- # if ndb_mgmd has not started properly
- if (ndb_mgmd_wait_started($cluster))
- {
- mtr_warning("Failed to wait for start of ndb_mgmd");
- return 1;
- }
-
- return 0;
-}
-
-sub ndbd_stop {
- # Intentionally left empty, ndbd nodes will be shutdown
- # by sending "shutdown" to ndb_mgmd
-}
-
-our $exe_ndbmtd_counter= 0;
-
-sub ndbd_start {
- my ($cluster, $ndbd)= @_;
-
- mtr_verbose("ndbd_start");
-
- my $dir= $ndbd->value("DataDir");
- mkpath($dir) unless -d $dir;
-
- my $args;
- mtr_init_args(\$args);
- mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
- mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
- mtr_add_arg($args, "--nodaemon");
-
-# > 5.0 { 'character-sets-dir' => \&fix_charset_dir },
-
- my $exe= $exe_ndbd;
- if ($exe_ndbmtd and ($exe_ndbmtd_counter++ % 2) == 0)
- {
- # Use ndbmtd every other time
- $exe= $exe_ndbmtd;
- }
-
- my $path_ndbd_log= "$dir/ndbd.log";
- my $proc= My::SafeProcess->new
- (
- name => $ndbd->after('cluster_config.'),
- path => $exe,
- args => \$args,
- output => $path_ndbd_log,
- error => $path_ndbd_log,
- append => 1,
- verbose => $opt_verbose,
- shutdown => sub { ndbd_stop($ndbd) },
- );
- mtr_verbose("Started $proc");
-
- $ndbd->{proc}= $proc;
-
- return;
-}
-
-
-sub ndbcluster_start ($) {
- my ($cluster) = @_;
-
- mtr_verbose("ndbcluster_start '".$cluster->name()."'");
-
- foreach my $ndb_mgmd ( in_cluster($cluster, ndb_mgmds()) )
- {
- next if started($ndb_mgmd);
- ndb_mgmd_start($cluster, $ndb_mgmd);
- }
-
- foreach my $ndbd ( in_cluster($cluster, ndbds()) )
- {
- next if started($ndbd);
- ndbd_start($cluster, $ndbd);
- }
-
- return 0;
-}
-
-
sub mysql_server_start($) {
my ($mysqld, $tinfo) = @_;
@@ -3222,7 +2818,7 @@ sub mysql_server_start($) {
# Some InnoDB options are incompatible with the default bootstrap.
# If they are used, re-bootstrap
if ( $extra_opts and
- "@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)/ )
+ "@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)|data[-_]file[-_]path/ )
{
mysql_install_db($mysqld, undef, $extra_opts);
}
@@ -3380,8 +2976,8 @@ sub kill_leftovers ($) {
sub check_ports_free ($)
{
my $bthread= shift;
- my $portbase = $bthread * 10 + 10000;
- for ($portbase..$portbase+9){
+ my $portbase = $bthread * $opt_port_group_size + 10000;
+ for ($portbase..$portbase+($opt_port_group_size-1)){
if (mtr_ping_port($_)){
mtr_report(" - 'localhost:$_' was not free");
return 0; # One port was not free
@@ -3506,6 +3102,7 @@ sub mysql_install_db {
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--disable-getopt-prefix-matching");
mtr_add_arg($args, "--bootstrap");
mtr_add_arg($args, "--basedir=%s", $install_basedir);
mtr_add_arg($args, "--datadir=%s", $install_datadir);
@@ -3602,6 +3199,9 @@ sub mysql_install_db {
mtr_appendfile_to_file("$sql_dir/mysql_performance_tables.sql",
$bootstrap_sql_file);
+ # Don't install anonymous users
+ mtr_tofile($bootstrap_sql_file, "set \@skip_auth_anonymous=1;\n");
+
# Add the mysql system tables initial data
# for a production system
mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql",
@@ -3636,10 +3236,6 @@ sub mysql_install_db {
sql_to_bootstrap($text));
}
- # Remove anonymous users
- mtr_tofile($bootstrap_sql_file,
- "DELETE FROM mysql.user where user= '';\n");
-
# Create mtr database
mtr_tofile($bootstrap_sql_file,
"CREATE DATABASE mtr CHARSET=latin1;\n");
@@ -3762,7 +3358,7 @@ sub do_before_run_mysqltest($)
my $resdir= dirname($resfile);
# we'll use a separate extension for generated result files
# to be able to distinguish them from manually created
- # version-controlled results, and to ignore them in bzr.
+ # version-controlled results, and to ignore them in git.
my $dest = "$base_file$suites.result~";
my @cmd = ($exe_patch, qw/--binary -r - -f -s -o/,
$dest, $base_result, $resfile);
@@ -4129,8 +3725,6 @@ sub config_files($) {
sub _like { return $config ? $config->like($_[0]) : (); }
sub mysqlds { return _like('mysqld\.'); }
-sub ndbds { return _like('cluster_config\.ndbd\.');}
-sub ndb_mgmds { return _like('cluster_config\.ndb_mgmd\.'); }
sub fix_servers($) {
my ($tinfo) = @_;
@@ -4141,19 +3735,6 @@ sub fix_servers($) {
START => \&mysql_server_start,
WAIT => \&mysql_server_wait,
},
- qr/mysql_cluster\./ => {
- SORT => 200,
- START => \&ndbcluster_start,
- WAIT => \&ndbcluster_wait_started,
- },
- qr/cluster_config\.ndb_mgmd\./ => {
- SORT => 210,
- START => undef,
- },
- qr/cluster_config\.ndbd\./ => {
- SORT => 220,
- START => undef,
- },
$tinfo->{suite}->servers()
);
for ($config->groups()) {
@@ -4197,6 +3778,7 @@ sub run_testcase ($$) {
my $print_freq=20;
mtr_verbose("Running test:", $tinfo->{name});
+ $ENV{'MTR_TEST_NAME'} = $tinfo->{name};
resfile_report_test($tinfo) if $opt_resfile;
# Allow only alpanumerics pluss _ - + . in combination names,
@@ -4445,12 +4027,13 @@ sub run_testcase ($$) {
{
my $res= $test->exit_status();
- if ($res == 0 and $opt_warnings and check_warnings($tinfo) )
+ if (($res == 0 or $res == 62) and $opt_warnings and check_warnings($tinfo) )
{
- # Test case suceeded, but it has produced unexpected
- # warnings, continue in $res == 1
- $res= 1;
- resfile_output($tinfo->{'warnings'}) if $opt_resfile;
+ # If test case suceeded, but it has produced unexpected
+ # warnings, continue with $res == 1;
+ # but if the test was skipped, it should remain skipped
+ $res= 1 if $res == 0;
+ resfile_output($tinfo->{'warnings'}) if $opt_resfile;
}
if ( $res == 0 )
@@ -4803,12 +4386,14 @@ sub extract_warning_lines ($$) {
# Perl code.
my @antipatterns =
(
+ @global_suppressions,
qr/error .*connecting to master/,
- qr/Plugin 'ndbcluster' will be forced to shutdown/,
qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/,
qr/InnoDB: Error: table `test`.`t[12]` .*does not exist in the InnoDB internal/,
qr/InnoDB: Warning: Setting innodb_use_sys_malloc/,
qr/InnoDB: Warning: a long semaphore wait:/,
+ qr/InnoDB: Dumping buffer pool.*/,
+ qr/InnoDB: Buffer pool.*/,
qr/InnoDB: Warning: Writer thread is waiting this semaphore:/,
qr/Slave: Unknown table 't1' .* 1051/,
qr/Slave SQL:.*(Internal MariaDB error code: [[:digit:]]+|Query:.*)/,
@@ -4819,7 +4404,6 @@ sub extract_warning_lines ($$) {
qr/Now setting lower_case_table_names to [02]/,
qr/Setting lower_case_table_names=2/,
qr/You have forced lower_case_table_names to 0/,
- qr/Plugin 'ndbcluster' will be forced to shutdow/,
qr/deprecated/,
qr/Slave SQL thread retried transaction/,
qr/Slave \(additional info\)/,
@@ -4867,6 +4451,21 @@ sub extract_warning_lines ($$) {
qr|Failed to setup SSL|,
qr|SSL error: Failed to set ciphers to use|,
qr/Plugin 'InnoDB' will be forced to shutdown/,
+ qr|Could not increase number of max_open_files to more than|,
+ qr/InnoDB: Error table encrypted but encryption service not available.*/,
+ qr/InnoDB: Could not find a valid tablespace file for*/,
+ qr/InnoDB: Tablespace open failed for*/,
+ qr/InnoDB: Failed to find tablespace for table*/,
+ qr/InnoDB: Space */,
+ qr|InnoDB: You may have to recover from a backup|,
+ qr|InnoDB: It is also possible that your operatingsystem has corrupted its own file cache|,
+ qr|InnoDB: and rebooting your computer removes the error|,
+ qr|InnoDB: If the corrupt page is an index page you can also try to|,
+ qr|nnoDB: fix the corruption by dumping, dropping, and reimporting|,
+ qr|InnoDB: the corrupt table. You can use CHECK|,
+ qr|InnoDB: TABLE to scan your table for corruption|,
+ qr/InnoDB: See also */
+
);
my $matched_lines= [];
@@ -5710,18 +5309,6 @@ sub servers_need_restart($) {
############################################
#
-# Filter a list of servers and return only those that are part
-# of the specified cluster
-#
-sub in_cluster {
- my ($cluster)= shift;
- # Return only processes for a specific cluster
- return grep { $_->suffix() eq $cluster->suffix() } @_;
-}
-
-
-
-#
# Filter a list of servers and return the SafeProcess
# for only those that are started or stopped
#
@@ -5918,11 +5505,11 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--sleep=%d", $opt_sleep);
}
- if ( $opt_valgrind_mysqld )
+ if ( $opt_valgrind )
{
# We are running server under valgrind, which causes some replication
# test to be much slower, notable rpl_mdev6020. Increase timeout.
- mtr_add_arg($args, "--wait-for-pos-timeout=0");
+ mtr_add_arg($args, "--wait-for-pos-timeout=1500");
}
if ( $opt_ssl )
@@ -6263,29 +5850,15 @@ sub valgrind_arguments {
my $args= shift;
my $exe= shift;
- if ( $opt_callgrind)
- {
- mtr_add_arg($args, "--tool=callgrind");
- mtr_add_arg($args, "--base=$opt_vardir/log");
- }
- else
+ # Ensure the jemalloc works with mysqld
+ if ($$exe =~ /mysqld/)
{
- mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
- mtr_add_arg($args, "--leak-check=yes");
- mtr_add_arg($args, "--num-callers=16");
- mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
- if -f "$glob_mysql_test_dir/valgrind.supp";
-
- # Ensure the jemalloc works with mysqld
- if ($$exe =~ /mysqld/)
- {
- my %somalloc=(
- 'system jemalloc' => 'libjemalloc*',
- 'bundled jemalloc' => 'NONE'
- );
- my ($syn) = $somalloc{$mysqld_variables{'version-malloc-library'}};
- mtr_add_arg($args, '--soname-synonyms=somalloc=%s', $syn) if $syn;
- }
+ my %somalloc=(
+ 'system jemalloc' => 'libjemalloc*',
+ 'bundled jemalloc' => 'NONE'
+ );
+ my ($syn) = $somalloc{$mysqld_variables{'version-malloc-library'}};
+ mtr_add_arg($args, '--soname-synonyms=somalloc=%s', $syn) if $syn;
}
# Add valgrind options, can be overriden by user
@@ -6478,9 +6051,6 @@ Options to control what test suites or cases to run
the execution will continue from the next test file.
When specified twice, execution will continue executing
the failed test file from the next command.
- with-ndbcluster-only Run only tests that include "ndb" in the filename
- skip-ndb[cluster] Skip all tests that need cluster. Default.
- include-ndb[cluster] Enable all tests that need cluster
do-test=PREFIX or REGEX
Run test cases which name are prefixed with PREFIX
or fulfills REGEX
@@ -6504,6 +6074,8 @@ Options to control what test suites or cases to run
skip-test-list=FILE Skip the tests listed in FILE. Each line in the file
is an entry and should be formatted as:
<TESTNAME> : <COMMENT>
+ force-restart Always restart servers between tests. This makes it
+ easier to see from which test warnings may come from.
Options that specify ports
@@ -6516,6 +6088,8 @@ Options that specify ports
build-thread=# Can be set in environment variable MTR_BUILD_THREAD.
Set MTR_BUILD_THREAD="auto" to automatically aquire
a build thread id that is unique to current host
+ port-group-size=N Reserve groups of TCP ports of size N for each MTR thread
+
Options for test case authoring
@@ -6622,7 +6196,6 @@ Misc options
servers to exit before finishing the process
fast Run as fast as possible, don't wait for servers
to shutdown etc.
- force-restart Always restart servers between tests
parallel=N Run tests in N parallel threads (default 1)
Use parallel=auto for auto-setting of N
repeat=N Run each test N number of times
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index e32037c4be9..17e2dc9b009 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -293,6 +293,15 @@ t2 CREATE TABLE `t2` (
drop table if exists t1, t2;
create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert into t1 (a) values(1);
+Warnings:
+Warning 1364 Field 'b' doesn't have a default value
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
+Warning 1364 Field 'e' doesn't have a default value
+Warning 1364 Field 'f' doesn't have a default value
+Warning 1364 Field 'g' doesn't have a default value
+Warning 1364 Field 'h' doesn't have a default value
+Warning 1364 Field 'i' doesn't have a default value
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
@@ -2164,3 +2173,30 @@ t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE t1;
+#
+# End of 10.0 tests
+#
+#
+# MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
+#
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
+ALTER TABLE t1 MODIFY i FLOAT;
+DROP TABLE t1;
+#
+# MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment
+#
+CREATE TABLE t1(a INT);
+CREATE INDEX i1 ON t1(a) COMMENT 'comment1';
+ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ KEY `i1` (`a`) COMMENT 'comment2'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result
index d1fc4a3bd93..4c338a1ebe6 100644
--- a/mysql-test/r/alter_table_online.result
+++ b/mysql-test/r/alter_table_online.result
@@ -184,3 +184,35 @@ CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
+select @@global.delay_key_write;
+@@global.delay_key_write
+ON
+create table t1 (a int, b int, key(b));
+flush tables;
+flush status;
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 0
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 0
+alter online table t1 delay_key_write=1;
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 1
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 2
+alter online table t1 delay_key_write=0;
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 2
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 2
+drop table t1;
diff --git a/mysql-test/r/analyze_format_json.result b/mysql-test/r/analyze_format_json.result
new file mode 100644
index 00000000000..ea9afd9215f
--- /dev/null
+++ b/mysql-test/r/analyze_format_json.result
@@ -0,0 +1,749 @@
+drop table if exists t0,t1,t2,t3;
+create table t0 (a int);
+INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+# r_filtered=30%, because 3 rows match: 0,1,2
+analyze format=json select * from t0 where a<3;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 30,
+ "attached_condition": "(t0.a < 3)"
+ }
+ }
+}
+create table t1 (a int, b int, c int, key(a));
+insert into t1 select A.a*10 + B.a, A.a*10 + B.a, A.a*10 + B.a from t0 A, t0 B;
+analyze
+select * from t0, t1 where t1.a=t0.a and t0.a > 9;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 10.00 100.00 0.00 Using where
+1 SIMPLE t1 ref a a 5 test.t0.a 1 NULL 100.00 NULL
+analyze format=json
+select * from t0, t1 where t1.a=t0.a and t0.a > 9;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 0,
+ "attached_condition": "((t0.a > 9) and (t0.a is not null))"
+ },
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "r_loops": 0,
+ "rows": 1,
+ "r_rows": null,
+ "filtered": 100,
+ "r_filtered": null
+ }
+ }
+}
+analyze
+select * from t0, t1 where t1.a=t0.a and t1.b<4;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using where
+1 SIMPLE t1 ref a a 5 test.t0.a 1 1.00 100.00 40.00 Using where
+analyze format=json
+select * from t0, t1 where t1.a=t0.a and t1.b<4;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "(t0.a is not null)"
+ },
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "r_loops": 10,
+ "rows": 1,
+ "r_rows": 1,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 40,
+ "attached_condition": "(t1.b < 4)"
+ }
+ }
+}
+analyze
+select * from t1 tbl1, t1 tbl2 where tbl1.b<2 and tbl2.b>5;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE tbl1 ALL NULL NULL NULL NULL 100 100.00 100.00 2.00 Using where
+1 SIMPLE tbl2 ALL NULL NULL NULL NULL 100 100.00 100.00 94.00 Using where; Using join buffer (flat, BNL join)
+analyze format=json
+select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "tbl1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 100,
+ "r_rows": 100,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 20,
+ "attached_condition": "(tbl1.b < 20)"
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "tbl2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 100,
+ "r_rows": 100,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 60,
+ "attached_condition": "(tbl2.b < 60)"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "r_filtered": 100
+ }
+ }
+}
+analyze format=json
+select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60 and tbl1.c > tbl2.c;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "tbl1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 100,
+ "r_rows": 100,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 20,
+ "attached_condition": "(tbl1.b < 20)"
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "tbl2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 100,
+ "r_rows": 100,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 60,
+ "attached_condition": "(tbl2.b < 60)"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(tbl1.c > tbl2.c)",
+ "r_filtered": 15.833
+ }
+ }
+}
+drop table t1;
+drop table t0;
+#
+# MDEV-7674: ANALYZE shows r_rows=0
+#
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, key(a));
+insert into t2 values (0),(1);
+analyze format=json select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "(t1.a is not null)"
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t1.a"],
+ "r_loops": 10,
+ "rows": 2,
+ "r_rows": 0.2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "using_index": true
+ }
+ }
+}
+drop table t1,t2;
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+#
+# MDEV-7679: ANALYZE crashes when printing WHERE when no default db
+#
+select database();
+database()
+test
+select database();
+database()
+NULL
+analyze format=json select * from test.t1 where t1.a<5;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 50,
+ "attached_condition": "(test.t1.a < 5)"
+ }
+ }
+}
+drop table t1;
+#
+# MDEV-7812: ANALYZE FORMAT=JSON UPDATE/DELETE doesnt print
+# the r_total_time_ms
+#
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t3(a int);
+insert into t3 select A.a + B.a* 10 + C.a * 100 from t2 A, t2 B, t2 C;
+create table t1 (pk int primary key);
+insert into t1 select a from t3;
+alter table t1 add b int;
+analyze format=json
+update t1 set b=pk;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "update": 1,
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 1000,
+ "r_rows": 1000,
+ "r_filtered": 100,
+ "r_total_time_ms": "REPLACED"
+ }
+ }
+}
+analyze format=json
+select * from t1 where pk < 10 and b > 4;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk"],
+ "r_loops": 1,
+ "rows": 11,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 50,
+ "index_condition": "(t1.pk < 10)",
+ "attached_condition": "(t1.b > 4)"
+ }
+ }
+}
+analyze format=json
+delete from t1 where pk < 10 and b > 4;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "delete": 1,
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk"],
+ "rows": 11,
+ "r_rows": 10,
+ "r_filtered": 50,
+ "r_total_time_ms": "REPLACED",
+ "attached_condition": "((t1.pk < 10) and (t1.b > 4))"
+ }
+ }
+}
+drop table t1, t3, t2;
+#
+# MDEV-7833:ANALYZE FORMAT=JSON and Range checked for each record
+#
+create table t3(a int);
+insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t4(a int);
+insert into t4 select A.a + B.a* 10 + C.a * 100 from t3 A, t3 B, t3 C;
+create table t1 (lb1 int, rb1 int, lb2 int, rb2 int, c1 int, c2 int);
+insert into t1 values (1,2,10,20,15,15);
+insert into t1 values (3,5,10,20,15,15);
+insert into t1 values (10,20,10,20,15,15);
+insert into t1 values (10,20,1,2,15,15);
+insert into t1 values (10,20,10,20,1,3);
+create table t2 (key1 int, key2 int, key3 int, key4 int, col1 int,
+key(key1), key(key2), key(key3), key(key4));
+insert into t2 select a,a,a,a,a from t3;
+insert into t2 select 15,15,15,15,15 from t4;
+analyze format=json
+select * from t1, t2 where (t2.key1 between t1.lb1 and t1.rb1) and
+(t2.key2 between t1.lb2 and t1.rb2) and
+(t2.key3=t1.c1 OR t2.key4=t1.c2);
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 5,
+ "r_rows": 5,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "range-checked-for-each-record": {
+ "keys": ["key1", "key2", "key3", "key4"],
+ "r_keys": {
+ "full_scan": 1,
+ "index_merge": 1,
+ "range": {
+ "key1": 2,
+ "key2": 1,
+ "key3": 0,
+ "key4": 0
+ }
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "possible_keys": ["key1", "key2", "key3", "key4"],
+ "r_loops": 5,
+ "rows": 1010,
+ "r_rows": 203.8,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 98.135
+ }
+ }
+ }
+}
+drop table t1,t2,t3,t4;
+#
+# MDEV-7904: ANALYZE FORMAT=JSON SELECT .. UNION SELECT doesn't print r_rows for union output
+#
+create table t0 (a int);
+INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int);
+INSERT INTO t1 select * from t0;
+analyze format=json (select * from t1 tbl1 where a<5) union (select * from t1 tbl2 where a in (2,3));
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "r_rows": 5,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "tbl1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 50,
+ "attached_condition": "(tbl1.a < 5)"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "tbl2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 20,
+ "attached_condition": "(tbl2.a in (2,3))"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+drop table t0, t1;
+#
+# MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+create table t2 (
+a int,
+b int,
+key (a)
+);
+insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
+# normal HAVING
+analyze format=json select a, max(b) as TOP from t2 group by a having TOP > a;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "having_condition": "(TOP > a)",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 0,
+ "r_buffer_size": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 256,
+ "r_rows": 256,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ }
+}
+# HAVING is always TRUE (not printed)
+analyze format=json select a, max(b) as TOP from t2 group by a having 1<>2;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 256,
+ "r_buffer_size": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 256,
+ "r_rows": 256,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ }
+}
+# HAVING is always FALSE (intercepted by message)
+analyze format=json select a, max(b) as TOP from t2 group by a having 1=2;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "Impossible HAVING"
+ }
+ }
+}
+# HAVING is absent
+analyze format=json select a, max(b) as TOP from t2 group by a;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 256,
+ "r_buffer_size": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 256,
+ "r_rows": 256,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ }
+}
+drop table t0, t1, t2;
+#
+# MDEV-7267: Server crashes in Item_field::print on ANALYZE FORMAT=JSON
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+ANALYZE FORMAT=JSON SELECT STRAIGHT_JOIN * FROM t1, t2 WHERE b IN ( SELECT a FROM t1 );
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 0,
+ "attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "r_filtered": null
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ ]
+ }
+}
+drop table t1,t2;
+#
+# MDEV-8864: Server crash #2 in Item_field::print on ANALYZE FORMAT=JSON
+#
+CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (2),(3);
+CREATE TABLE t3 (f3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (3),(4);
+ANALYZE FORMAT=JSON
+SELECT GROUP_CONCAT(f3) AS gc, ( SELECT MAX(f1) FROM t1, t2 WHERE f2 = f3 ) sq
+FROM t2, t3
+WHERE f3 IN ( 1, 2 )
+GROUP BY sq ORDER BY gc;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 0,
+ "r_buffer_size": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 0,
+ "r_buffer_size": "REPLACED",
+ "temporary_table": {
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 0,
+ "attached_condition": "(t3.f3 in (1,2))"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "r_filtered": null
+ },
+ "subqueries": [
+ {
+ "expression_cache": {
+ "state": "uninitialized",
+ "r_loops": 0,
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 0,
+ "rows": 2,
+ "r_rows": null,
+ "filtered": 100,
+ "r_filtered": null
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 0,
+ "rows": 2,
+ "r_rows": null,
+ "filtered": 100,
+ "r_filtered": null
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(t2.f2 = t3.f3)",
+ "r_filtered": null
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+}
+drop table t1,t2,t3;
diff --git a/mysql-test/r/analyze_stmt.result b/mysql-test/r/analyze_stmt.result
new file mode 100644
index 00000000000..c3c98593210
--- /dev/null
+++ b/mysql-test/r/analyze_stmt.result
@@ -0,0 +1,336 @@
+drop table if exists t0,t1,t2,t3;
+create table t0 (a int) engine=myisam;
+INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int) engine=myisam;
+INSERT INTO t1 select * from t0;
+# Try a few basic selects to see that r_rows and r_filtered columns work
+analyze select * from t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00
+analyze select * from t1 where a<5;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 50.00 Using where
+analyze select * from t1 where a>100;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 0.00 Using where
+# ANALYZE DELETE will delete rows:
+analyze delete from t1 where a in (2,3,4);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 30.00 Using where
+select * from t1;
+a
+0
+1
+5
+6
+7
+8
+9
+drop table t1;
+# ANALYZE UPDATE will make updates:
+create table t1(a int, b int);
+insert into t1 select a,a from t0;
+analyze update t1 set b=100+b where a in (6,7,8);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 30.00 Using where
+select * from t1;
+a b
+0 0
+1 1
+2 2
+3 3
+4 4
+5 5
+6 106
+7 107
+8 108
+9 9
+drop table t1;
+# Check that UNION works
+create table t1(a int, b int);
+insert into t1 select a,a from t0;
+analyze (select * from t1 A where a<5) union (select * from t1 B where a in (5,6));
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY A ALL NULL NULL NULL NULL 10 10.00 100.00 50.00 Using where
+2 UNION B ALL NULL NULL NULL NULL 10 10.00 100.00 20.00 Using where
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL 7.00 NULL NULL
+analyze (select * from t1 A where a<5) union (select * from t1 B where a in (1,2));
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY A ALL NULL NULL NULL NULL 10 10.00 100.00 50.00 Using where
+2 UNION B ALL NULL NULL NULL NULL 10 10.00 100.00 20.00 Using where
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL 5.00 NULL NULL
+drop table t1;
+drop table t0;
+#
+# Try a subquery.
+#
+create table t0 (a int, b int);
+insert into t0 values
+(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+create table t1 (a int, b int);
+insert into t1 values (1,1),(2,2),(3,3);
+# See .test file for the right values of r_rows and r_filtered.
+analyze select a, a in (select t0.b from t0 where t0.b+1=t1.b+1) from t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 3.00 100.00 33.33 Using where
+# Try a subquery that is never executed
+analyze select a, a in (select t0.b from t0 where t0.b+1=t1.b+1) from t1 where t1.a > 5;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 3.00 100.00 0.00 Using where
+2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 NULL 100.00 NULL Using where
+drop table t0, t1;
+#
+# Tests for join buffering
+#
+create table t0 (a int, b int);
+insert into t0 values
+(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+create table t1 like t0;
+insert into t1 select * from t0;
+explain select * from t0, t1 where t0.a<5 and t1.a<5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+# These should have filtered=50
+analyze select * from t0, t1 where t0.a<5 and t1.a<5;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 10.00 100.00 50.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 50.00 Using where; Using join buffer (flat, BNL join)
+explain select * from t0, t1 where t0.a<5 and t1.b=t0.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+# Now, t1 should have filtered=10
+analyze select * from t0, t1 where t0.a<5 and t1.b=t0.b;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 10.00 100.00 50.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 10.00 Using where; Using join buffer (flat, BNL join)
+explain select * from t0, t1 where t0.a<5 and t1.a<5 and t1.b=t0.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+# Now, t1 should have filtered=10
+analyze select * from t0, t1 where t0.a<5 and t1.a<5 and t1.b=t0.b;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 10.00 100.00 50.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 10.00 Using where; Using join buffer (flat, BNL join)
+# TODO: Check what is counted for "range checked for each record".
+#
+# Test for joins
+#
+create table t2 (key1 int, key2x int, col1 int, key(key1), key(key2x));
+insert into t2 select A.a + 10 *B.a +100 * C.a,
+(A.a + 10 *B.a +100 * C.a)*2,
+A.a + 10 *B.a +100 * C.a
+from t0 A, t0 B, t0 C;
+# This always has matches, filtered=100%.
+analyze select * from t1,t2 where t2.key1=t1.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using where
+1 SIMPLE t2 ref key1 key1 5 test.t1.a 1 1.00 100.00 100.00
+# This shows r_rows=0. It is actually 0.5 (should r_rows be changed to double?)
+analyze select * from t1,t2 where t2.key2x=t1.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using where
+1 SIMPLE t2 ref key2x key2x 5 test.t1.a 1 0.50 100.00 100.00
+select * from t1,t2 where t2.key2x=t1.a;
+a b key1 key2x col1
+0 0 0 0 0
+2 2 1 2 1
+4 4 2 4 2
+6 6 3 6 3
+8 8 4 8 4
+# This has t2.filtered=40% (there are 5 values: {0,1,2,3,4}. two of them have mod=0)
+analyze select * from t1,t2 where t2.key2x=t1.a and mod(t2.col1,4)=0;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using where
+1 SIMPLE t2 ref key2x key2x 5 test.t1.a 1 0.50 100.00 40.00 Using where
+drop table t0,t1,t2;
+#
+# Check non-merged derived tables
+#
+create table t0 (a int, b int);
+insert into t0 values
+(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+update t0 set b=b/3;
+analyze select * from (select count(*),max(a),b from t0 group by b) T;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 10 4.00 100.00 100.00
+2 DERIVED t0 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using temporary; Using filesort
+drop table t0;
+#
+# Check ORDER/GROUP BY
+#
+create table t0 (a int, b int);
+insert into t0 values
+(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+analyze select count(*),max(a),b from t0 where a<7 group by b;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 10.00 100.00 70.00 Using where; Using temporary; Using filesort
+drop table t0;
+#
+# Check multi-table UPDATE/DELETE.
+#
+create table t0 (a int, b int);
+create table t1 (a int, b int);
+insert into t0 values (0,0),(2,2),(4,4), (8,8);
+insert into t1 values (0,0),(2,2), (6,6);
+analyze select * from t0,t1 where t0.a=t1.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t0 ALL NULL NULL NULL NULL 4 4.00 100.00 16.67 Using where; Using join buffer (flat, BNL join)
+analyze update t0,t1 set t1.b=5555 where t0.a=t1.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t0 ALL NULL NULL NULL NULL 4 4.00 100.00 16.67 Using where
+select * from t1;
+a b
+0 5555
+2 5555
+6 6
+analyze delete t1 from t1, t0 where t0.a=t1.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t0 ALL NULL NULL NULL NULL 4 4.00 100.00 16.67 Using where
+select * from t1;
+a b
+6 6
+drop table t0, t1;
+#
+# MDEV-6393: ANALYZE SELECT crashes in Explain_query::print_explain with a non-existing column
+#
+create table t1 (i int);
+insert into t1 values (1),(2);
+analyze select a from t1;
+ERROR 42S22: Unknown column 'a' in 'field list'
+analyze delete from t1 where a=2;
+ERROR 42S22: Unknown column 'a' in 'where clause'
+analyze update t1 set a=2;
+ERROR 42S22: Unknown column 'a' in 'field list'
+create table t2 like t1;
+insert into t2 select * from t1;
+analyze update t2,t1 set t2.i=5 where t2.a=t1.a;
+ERROR 42S22: Unknown column 't2.a' in 'where clause'
+analyze delete t1 from t2,t1 where t2.a=t1.a;
+ERROR 42S22: Unknown column 't2.a' in 'where clause'
+drop table t1, t2;
+#
+# MDEV-6395: ANALYZE UPDATE/DELETE with impossible where does not produce any output
+#
+create table t1 (a int, b int, key(a));
+insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5);
+analyze delete from t1 where 1 > 2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+analyze delete from t1 where a > 30 and a < 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+analyze update t1 set b=12345 where 1 > 2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+analyze update t1 set b=12345 where a > 30 and a < 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+drop table t1;
+#
+# MDEV-6398: ANALYZE UPDATE does not populate r_rows
+#
+create table t1 (i int);
+insert into t1 values (1),(2),(3),(4);
+analyze update t1 set i=8;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 100.00
+drop table t1;
+#
+# Check ANALYZE SELECT INTO
+#
+create table t1 (i int);
+insert into t1 values (1);
+analyze select * from t1 into @var;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 NULL 100.00 NULL
+drop table t1;
+#
+# MDEV-6394: ANALYZE DELETE .. RETURNING fails with ERROR 2027 Malformed packet
+#
+create table t1 (i int);
+analyze delete from t1 returning *;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 0.00 100.00 100.00
+drop table t1;
+#
+# MDEV-6396: ANALYZE INSERT/REPLACE is accepted, but does not produce a plan
+#
+create table t1 (a int primary key, b int);
+analyze insert into t1 values (1,1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+select * from t1;
+a b
+1 1
+analyze replace t1 values (1,2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+select * from t1;
+a b
+1 2
+drop table t1;
+#
+# MDEV-6400 "ANALYZE SELECT ... INTO @var" doesn't set @var
+#
+create table t1(a int);
+insert into t1 values (1),(2);
+analyze select a from t1 where a <2 into @var;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 100.00 50.00 Using where
+analyze select a from t1 into @var;
+ERROR 42000: Result consisted of more than one row
+analyze insert into t1 select * from t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 100.00 100.00 Using temporary
+analyze select * into outfile '../../tmp/data1.tmp' from t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 100.00
+drop table t1;
+#
+# MDEV-7024: Assertion `! is_set()' failed in
+# Diagnostics_area::set_eof_status on executing ANALYZE SELECT via PS
+#
+create table t1(a int);
+prepare stmt from "analyze select * from t1";
+execute stmt;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+drop table t1;
+#
+# MDEV-7674: ANALYZE shows r_rows=0
+#
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, key(a));
+insert into t2 values (0),(1);
+analyze select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using where
+1 SIMPLE t2 ref a a 5 test.t1.a 2 0.20 100.00 100.00 Using index
+drop table t1,t2;
+#
+# MDEV-8063: Unconditional ANALYZE DELETE does not delete rows
+#
+create table t1 (i int);
+insert into t1 values (1),(2);
+analyze delete from t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 2 NULL NULL NULL Deleting all rows
+select * from t1;
+i
+insert into t1 values (1),(2);
+explain delete from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 2 Deleting all rows
+select * from t1;
+i
+1
+2
+drop table t1;
diff --git a/mysql-test/r/analyze_stmt_orderby.result b/mysql-test/r/analyze_stmt_orderby.result
new file mode 100644
index 00000000000..be1f01a2a52
--- /dev/null
+++ b/mysql-test/r/analyze_stmt_orderby.result
@@ -0,0 +1,586 @@
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+create table t2 (
+a int,
+b int,
+key (a)
+);
+insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
+#
+# Try an UPDATE that uses filesort:
+#
+explain
+update t2 set b=b+1 order by b limit 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 10000 Using filesort
+explain format=json
+update t2 set b=b+1 order by b limit 5;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "filesort": {
+ "table": {
+ "update": 1,
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10000
+ }
+ }
+ }
+}
+analyze format=json
+update t2 set b=b+1 order by b limit 5;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_limit": 5,
+ "r_used_priority_queue": true,
+ "r_output_rows": 6,
+ "table": {
+ "update": 1,
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10000,
+ "r_rows": 10000,
+ "r_filtered": 100,
+ "r_total_time_ms": "REPLACED"
+ }
+ }
+ }
+}
+#
+# Try an UPDATE that uses buffering:
+#
+explain
+update t2 set a=a+1 where a<10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range a a 5 NULL 8 Using where; Using buffer
+explain format=json
+update t2 set a=a+1 where a<10;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "buffer": {
+ "table": {
+ "update": 1,
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "rows": 8,
+ "attached_condition": "(t2.a < 10)"
+ }
+ }
+ }
+}
+analyze format=json
+update t2 set a=a+1 where a<10;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_total_time_ms": "REPLACED",
+ "buffer": {
+ "table": {
+ "update": 1,
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "rows": 8,
+ "r_rows": 10,
+ "r_filtered": 100,
+ "r_total_time_ms": "REPLACED",
+ "attached_condition": "(t2.a < 10)"
+ }
+ }
+ }
+}
+#
+# Try a DELETE that uses filesort:
+#
+explain
+delete from t2 order by b limit 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 10000 Using filesort
+explain format=json
+delete from t2 order by b limit 5;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "filesort": {
+ "table": {
+ "delete": 1,
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10000
+ }
+ }
+ }
+}
+analyze format=json
+delete from t2 order by b limit 5;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 10000,
+ "r_buffer_size": "REPLACED",
+ "table": {
+ "delete": 1,
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10000,
+ "r_rows": 10000,
+ "r_filtered": 100,
+ "r_total_time_ms": "REPLACED"
+ }
+ }
+ }
+}
+#
+# Try a SELECT with QEP in form: filesort { tmp_table { join } }
+#
+explain
+select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where; Using temporary; Using filesort
+1 SIMPLE t2 ref a a 5 test.t0.a 1
+explain format=json
+select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "filesort": {
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t0.a is not null)"
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+analyze format=json
+select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_limit": 4,
+ "r_used_priority_queue": true,
+ "r_output_rows": 4,
+ "temporary_table": {
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "(t0.a is not null)"
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "r_loops": 10,
+ "rows": 1,
+ "r_rows": 0.4,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ }
+}
+#
+# Try a SELECT with QEP in form: join { filesort { table0 }, table2 }
+#
+explain
+select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where; Using filesort
+1 SIMPLE t2 ref a a 5 test.t0.a 1
+explain format=json
+select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "read_sorted_file": {
+ "filesort": {
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t0.a is not null)"
+ }
+ }
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+}
+analyze format=json
+select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "read_sorted_file": {
+ "r_rows": 10,
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 10,
+ "r_buffer_size": "REPLACED",
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 1,
+ "attached_condition": "(t0.a is not null)"
+ }
+ }
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "r_loops": 10,
+ "rows": 1,
+ "r_rows": 0.4,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+}
+drop table t2;
+create table t2 (
+a int,
+b int,
+c int
+);
+insert into t2
+select
+a.a+10*b.a+100*c.a,
+b.a+10*c.a,
+c.a
+from t0 a, t0 b, t0 c;
+analyze format=json
+select MAX(b) from t2 where mod(a,2)=0 group by c;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 10,
+ "r_buffer_size": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 1000,
+ "r_rows": 1000,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 50,
+ "attached_condition": "((t2.a % 2) = 0)"
+ }
+ }
+ }
+ }
+}
+drop table t2;
+#
+# MDEV-8282: crash in filesort() with simple ordered delete
+#
+create table t3(a int) engine=innodb;
+delete from t3 order by a;
+# EXPLAIN thinks it will use delete_all_rows():
+explain
+delete from t3 order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 1 Deleting all rows
+# ANALYZE shows that delete_all_rows() didn't work and we deleted rows
+# one-by-one:
+analyze
+delete from t3 order by a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t3 ALL NULL NULL NULL NULL 1 0.00 100.00 100.00 Using filesort
+drop table t3;
+#
+# A test for duplicate_removal()
+#
+create table t3 (a int, b int);
+insert into t3 select a, 123 from t0;
+analyze format=json
+select distinct max(t3.b) Q from t0, t3 where t0.a=t3.a group by t0.a order by null;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "duplicate_removal": {
+ "temporary_table": {
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(t3.a = t0.a)",
+ "r_filtered": 10
+ }
+ }
+ }
+ }
+}
+#
+# A query with two filesort calls:
+# - first is needed to do group-by-group grouping to calculate COUNT(DISTINCT)
+# - the second is need to produce ORDER BY.
+# (see MDEV-7836 for description of the query plan)
+create table t5 (a int , b int) ;
+create table t6 like t5 ;
+create table t7 like t5 ;
+insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
+(2, -1), (3, 10);
+insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1);
+insert into t7 values (3, 3), (2, 2), (1, 1);
+# TODO: This ANALYZE output doesn't make it clear what is used for what.
+analyze format=json
+select count(distinct t5.b) as sum from t5, t6
+where t5.a=t6.a and t6.b > 0 and t5.a <= 5
+group by t5.a order by sum limit 1;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_limit": 1,
+ "r_used_priority_queue": true,
+ "r_output_rows": 2,
+ "filesort": {
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 6,
+ "r_buffer_size": "REPLACED",
+ "temporary_table": {
+ "temporary_table": {
+ "table": {
+ "table_name": "t6",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 5,
+ "r_rows": 5,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 80,
+ "attached_condition": "((t6.b > 0) and (t6.a <= 5))"
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t5",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 7,
+ "r_rows": 7,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(t5.a = t6.a)",
+ "r_filtered": 21.429
+ }
+ }
+ }
+ }
+ }
+ }
+}
+explain format=json
+select count(distinct t5.b) as sum from t5, t6
+where t5.a=t6.a and t6.b > 0 and t5.a <= 5
+group by t5.a order by sum limit 1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "filesort": {
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t6",
+ "access_type": "ALL",
+ "rows": 5,
+ "filtered": 100,
+ "attached_condition": "((t6.b > 0) and (t6.a <= 5))"
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t5",
+ "access_type": "ALL",
+ "rows": 7,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(t5.a = t6.a)"
+ }
+ }
+ }
+ }
+}
+drop table t5,t6,t7;
+drop table t3;
+#
+# Tabular ANALYZE must get its data from execution tracker (and not from
+# the query plan)
+#
+CREATE TABLE t2(
+col1 int,
+col2 int,
+UNIQUE INDEX idx (col1, col2)) engine=myisam;
+INSERT INTO t2(col1, col2) VALUES
+(1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11),
+(11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1);
+flush status;
+explain
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL idx 5 NULL 7 Using index for group-by
+analyze
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 range NULL idx 5 NULL 7 20.00 100.00 100.00 Using index for group-by
+analyze format=json
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "key": "idx",
+ "key_length": "5",
+ "used_key_parts": ["col1"],
+ "r_loops": 1,
+ "rows": 7,
+ "r_rows": 20,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "using_index_for_group_by": true
+ }
+ }
+}
+drop table t2;
+drop table t0,t1;
diff --git a/mysql-test/r/analyze_stmt_privileges.result b/mysql-test/r/analyze_stmt_privileges.result
new file mode 100644
index 00000000000..d54b5b37863
--- /dev/null
+++ b/mysql-test/r/analyze_stmt_privileges.result
@@ -0,0 +1,41 @@
+#
+# MDEV-7025 and MDEV-7027 ANALYZE SELECT/INSERT/UPDATE/DELETE from a
+# view does not check access permissions on the underlying table
+#
+create database db;
+use db;
+create table t1 (i int, c varchar(8));
+insert into t1 values (1,'foo'),(2,'bar'),(3,'baz'),(4,'qux');
+create view v1 as select * from t1 where i > 1;
+CREATE USER u1@localhost;
+grant ALL on db.v1 to u1@localhost;
+connect con1,localhost,u1,,;
+select * from db.t1;
+ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
+explain select * from db.t1;
+ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
+analyze select * from db.t1;
+ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
+select * from db.v1;
+i c
+2 bar
+3 baz
+4 qux
+explain select * from db.v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+analyze select * from db.v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE db.v1 SET i = 5;
+explain UPDATE db.v1 SET i = 5;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+analyze UPDATE db.v1 SET i = 5;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM db.v1 WHERE i = 5;
+explain DELETE FROM db.v1 WHERE i = 5;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+analyze DELETE FROM db.v1 WHERE i = 5;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect con1;
+connection default;
+drop user u1@localhost;
+drop database db;
diff --git a/mysql-test/r/analyze_stmt_privileges2.result b/mysql-test/r/analyze_stmt_privileges2.result
new file mode 100644
index 00000000000..892791dd8f8
--- /dev/null
+++ b/mysql-test/r/analyze_stmt_privileges2.result
@@ -0,0 +1,5237 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
+CREATE DATABASE privtest_db;
+CREATE TABLE privtest_db.t1 (a INT, b VARCHAR(3)) ENGINE=MyISAM;
+CREATE TABLE privtest_db.t2 (a INT, b VARCHAR(3)) ENGINE=MyISAM;
+CREATE VIEW privtest_db.v1 AS SELECT a, b FROM privtest_db.t1 WHERE b IS NOT NULL;
+CREATE VIEW privtest_db.v2 AS SELECT * FROM privtest_db.v1 WHERE a > 0;
+INSERT INTO privtest_db.t2 VALUES (1,'foo'), (2,'bar'), (3,'qux');
+GRANT SELECT ON privtest_db.t2 TO 'privtest'@'localhost';
+connect con1,localhost,privtest,,privtest_db;
+
+#########################################################################
+# Underlying table permission tests
+# (we modify permissions on the base table, keeping ALL on views)
+#########################################################################
+
+connection default;
+GRANT ALL ON privtest_db.v1 TO 'privtest'@'localhost';
+GRANT ALL ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+#========================================================================
+# Test: No permissions on the table
+#========================================================================
+
+#------------------------------------------------------------------------
+# I/R/U/D/S on the table
+# Expectation: Cannot run query, EXPLAIN, ANALYZE on the table
+# because the query itself cannot be executed
+#------------------------------------------------------------------------
+INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SELECT on the table
+#========================================================================
+
+connection default;
+GRANT SELECT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the table
+# Expectation: Can only run SELECT, EXPLAIN SELECT, ANALYZE SELECT
+#------------------------------------------------------------------------
+INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1;
+a b
+10 NULL
+10 NULL
+10 NULL
+10 NULL
+EXPLAIN SELECT * FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4
+ANALYZE SELECT * FROM t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 100.00
+SELECT * FROM t1 WHERE a = 10;
+a b
+10 NULL
+10 NULL
+10 NULL
+10 NULL
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 100.00 Using where
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 60.00 Using where
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 60.00 Using where
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 0.00 Using where
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 Using where
+ANALYZE UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 24.00 100.00 50.00 Using where
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 Using where
+ANALYZE UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 24.00 100.00 50.00 Using where
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 Using where
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 24.00 100.00 0.00 Using where
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where
+ANALYZE DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where
+ANALYZE DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where
+ANALYZE SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+
+#========================================================================
+# Test: Grant INSERT on the table
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT INSERT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the table
+# Expectation: Can only run INSERT, EXPLAIN INSERT, ANALYZE INSERT
+#------------------------------------------------------------------------
+INSERT INTO t1 (a) VALUES (10);
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO t1 SELECT * FROM t2;
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant UPDATE on the table
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT UPDATE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the table
+# Expectation: Can only run UPDATE, EXPLAIN UPDATE, ANALYZE UPDATE
+# when the UPDATE does not read any columns. UPDATEs which
+# read columns fail with ER_COLUMNACCESS_DENIED_ERROR
+#------------------------------------------------------------------------
+INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = 10;
+EXPLAIN UPDATE t1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18
+ANALYZE UPDATE t1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 18.00 100.00 100.00
+UPDATE t1 SET a = a + 1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+EXPLAIN UPDATE t1 SET a = a + 1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+ANALYZE UPDATE t1 SET a = a + 1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant DELETE on the table
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the table
+# Expectation: Can only run DELETE, EXPLAIN DELETE, ANALYZE DELETE
+# when the DELETE does not read any columns. DELETEs which
+# read columns fail with ER_COLUMNACCESS_DENIED_ERROR
+#------------------------------------------------------------------------
+# Note: ANALYZE DELETE FROM t1 USING t1, t2 ... fails due to MDEV-7043
+INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1;
+EXPLAIN DELETE FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 0 Deleting all rows
+ANALYZE DELETE FROM t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 0 NULL NULL NULL Deleting all rows
+DELETE FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+ANALYZE DELETE FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it would have revealed the structure of the table)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant DELETE, SELECT(a) on the table
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT SELECT(a), DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the table
+# Expectation: Can run DELETE, EXPLAIN DELETE, ANALYZE DELETE
+#------------------------------------------------------------------------
+INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+DELETE FROM t1;
+EXPLAIN DELETE FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 0 Deleting all rows
+ANALYZE DELETE FROM t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 0 NULL NULL NULL Deleting all rows
+DELETE FROM t1 WHERE a = 10;
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+ANALYZE DELETE FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 0.00 100.00 100.00 Using where
+DELETE FROM t1 USING t1, t2;
+EXPLAIN DELETE FROM t1 USING t1, t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE DELETE FROM t1 USING t1, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run everything: SELECT access to the column `a`
+# in the underlying table is enough to show EXPLAIN
+# (that's how it works now)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 Using where
+ANALYZE UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 16.00 100.00 75.00 Using where
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 Using where
+ANALYZE UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 16.00 100.00 75.00 Using where
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 Using where
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 16.00 100.00 0.00 Using where
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run everything: SELECT access to the column `a`
+# in the underlying table is enough to show EXPLAIN
+# (that's how it works now)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 60.00 Using where
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 60.00 Using where
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 0.00 Using where
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v2 USING v2, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+
+#========================================================================
+# Test: Grant SELECT, INSERT, UPDATE, DELETE on the table
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT SELECT, INSERT, UPDATE, DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the table
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO t1 (a) VALUES (10);
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO t1 SELECT * FROM t2;
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO t1 (a) VALUES (10);
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO t1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE t1 SET a = 10;
+EXPLAIN UPDATE t1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24
+ANALYZE UPDATE t1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 24.00 100.00 100.00
+UPDATE t1 SET a = a + 1;
+EXPLAIN UPDATE t1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24
+ANALYZE UPDATE t1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 24.00 100.00 100.00
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 Using where
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 24 24.00 100.00 0.00 Using where
+DELETE FROM t1;
+EXPLAIN DELETE FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 0 Deleting all rows
+ANALYZE DELETE FROM t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 0 NULL NULL NULL Deleting all rows
+DELETE FROM t1 WHERE a = 10;
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+ANALYZE DELETE FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 0.00 100.00 100.00 Using where
+DELETE FROM t1 USING t1, t2;
+EXPLAIN DELETE FROM t1 USING t1, t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE DELETE FROM t1 USING t1, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+SELECT * FROM t1;
+a b
+EXPLAIN SELECT * FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+ANALYZE SELECT * FROM t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+SELECT * FROM t1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 Using where
+ANALYZE UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 16.00 100.00 75.00 Using where
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 Using where
+ANALYZE UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 16.00 100.00 75.00 Using where
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 Using where
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 16.00 100.00 0.00 Using where
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+# Note: some queries are commented due to MDEV-7034
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 60.00 Using where
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 60.00 Using where
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using where
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 20 20.00 100.00 0.00 Using where
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+
+#########################################################################
+# Inner view permission tests
+# (we modify permissions on the inner view, keeping ALL the rest)
+#########################################################################
+
+
+#========================================================================
+# Test: No permissions on the inner view
+#========================================================================
+
+connection default;
+GRANT ALL ON privtest_db.t1 TO 'privtest'@'localhost';
+GRANT ALL ON privtest_db.v2 TO 'privtest'@'localhost';
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Cannot run anything
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the inner view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SHOW VIEW on the inner view
+#========================================================================
+
+connection default;
+GRANT SHOW VIEW ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Cannot run anything
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (that's how it works now)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SELECT on the inner view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run SELECT, but not EXPLAIN SELECT or ANALYZE SELECT
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the inner view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SELECT, SHOW VIEW on the inner view
+#========================================================================
+
+
+#------------------------------------------------------------------------
+# Test: SELECT + SHOW VIEW privileges allow ANALYZE SELECT for the inner
+# view, and ANALYZE <anything> for the outer view
+#------------------------------------------------------------------------
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT, SHOW VIEW ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run SELECT, EXPLAIN SELECT, ANALYZE SELECT
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 14 Using where
+ANALYZE SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 14 14.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 14 Using where
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 14 14.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 14 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 14 14.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 30 Using where
+ANALYZE UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 30 30.00 100.00 40.00 Using where
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 30 Using where
+ANALYZE UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 30 30.00 100.00 40.00 Using where
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 30 Using where
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 30 30.00 100.00 0.00 Using where
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where
+ANALYZE DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where
+ANALYZE DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where
+ANALYZE SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+
+#========================================================================
+# Test: Grant INSERT on the inner view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT INSERT ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run INSERT, but not EXPLAIN INSERT or ANALYZE INSERT
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the inner view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant UPDATE on the inner view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT UPDATE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run UPDATE which does not read any columns, but not
+# but not EXPLAIN UPDATE or ANALYZE UPDATE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view).
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the inner view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant UPDATE, SELECT(a) on the inner view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT(a), UPDATE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run UPDATE, but not EXPLAIN or ANALYZE for it
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the inner view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SELECT, UPDATE on the inner view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT, UPDATE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run the UPDATE and SELECT queries, but not EXPLAIN
+# or ANALYZE because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the inner view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant DELETE on the inner view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT DELETE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run DELETE which does not read any columns,
+# but not EXPLAIN DELETE or ANALYZE DELETE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the inner view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant DELETE, SHOW VIEW on the inner view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SHOW VIEW, DELETE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run DELETE, EXPLAIN DELETE, UPDATE DELETE
+# which don't read any columns
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v1'
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 29 Using where
+ANALYZE DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 29 29.00 100.00 0.00 Using where
+DELETE FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v1'
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v1'
+ANALYZE DELETE FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v1'
+DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v1'
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+# because the query plan cannot be shown
+# (that's how it works now)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SELECT, INSERT, UPDATE, DELETE, SHOW VIEW
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT, INSERT, UPDATE, DELETE, SHOW VIEW ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 47 Using where
+ANALYZE UPDATE v1 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 47 47.00 100.00 25.53 Using where
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 47 Using where
+ANALYZE UPDATE v1 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 47 47.00 100.00 25.53 Using where
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 47 Using where
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 47 47.00 100.00 0.00 Using where
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 Using where
+ANALYZE DELETE FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 Using where
+ANALYZE DELETE FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 Using where
+ANALYZE DELETE FROM v1 USING v1, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 Using where
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where
+SELECT * FROM v1;
+a b
+EXPLAIN SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 Using where
+ANALYZE SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 Using where
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 35 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 51 Using where
+ANALYZE UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 51 51.00 100.00 23.53 Using where
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 51 Using where
+ANALYZE UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 51 51.00 100.00 23.53 Using where
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 51 Using where
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 51 51.00 100.00 0.00 Using where
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 39 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+
+#########################################################################
+# Outer view permission tests
+# (we modify permissions on the outer view, keeping ALL the rest)
+#########################################################################
+
+
+#========================================================================
+# Test: No permissions on the outer view
+#========================================================================
+
+connection default;
+GRANT ALL ON privtest_db.t1 TO 'privtest'@'localhost';
+GRANT ALL ON privtest_db.v1 TO 'privtest'@'localhost';
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Cannot run anything
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+
+#========================================================================
+# Test: Grant SHOW VIEW on the outer view
+#========================================================================
+
+connection default;
+GRANT SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Cannot run anything
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+
+#========================================================================
+# Test: Grant SHOW VIEW, SELECT(a) on the outer view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT(a), SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run SELECT, EXPLAIN SELECT and ANALYZE SELECT
+# when only `a` column is involved
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT a FROM v2;
+a
+EXPLAIN SELECT a FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE SELECT a FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT a FROM v2 WHERE a = 10;
+a
+EXPLAIN SELECT a FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE SELECT a FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+
+#========================================================================
+# Test: Grant SELECT on the outer view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run SELECT, but not EXPLAIN SELECT or ANALYZE SELECT
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SHOW VIEW, SELECT on the outer view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT, SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run SELECT, EXPLAIN SELECT, ANALYZE SELECT
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 Using where
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 39 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+
+#========================================================================
+# Test: Grant INSERT on the outer view
+#========================================================================
+
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT INSERT ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run INSERT, but not EXPLAIN INSERT or ANALYZE INSERT
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+
+#========================================================================
+# Test: Grant UPDATE on the outer view
+#========================================================================
+
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT UPDATE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run UPDATE which does not read any columns,
+# but not EXPLAIN UPDATE or ANALYZE UPDATE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+
+#========================================================================
+# Test: Grant UPDATE, SHOW VIEW on the outer view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SHOW VIEW, UPDATE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the inner view
+# Expectation: Can run UPDATE, EXPLAIN UPDATE, ANALYZE UPDATE
+# which do not read any columns
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 43 Using where
+ANALYZE UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 43 43.00 100.00 6.98 Using where
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 43 Using where
+ANALYZE UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 43 43.00 100.00 6.98 Using where
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
+DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+
+#========================================================================
+# Test: Grant DELETE on the outer view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT DELETE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run DELETE which does not read any columns,
+# but not EXPLAIN DELETE or ANALYZE DELETE
+# because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 'v2'
+
+#========================================================================
+# Test: Grant DELETE, SELECT on the outer view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT, DELETE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run DELETE and SELECT, but not EXPLAIN or ANALYZE
+# for them because the query plan cannot be shown
+# (it could have revealed the structure of the view)
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = 10;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+ANALYZE UPDATE v2 SET a = a + 1;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 'v2'
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+
+#========================================================================
+# Test: Grant SELECT, INSERT, UPDATE, DELETE, SHOW VIEW on the outer view
+#========================================================================
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT, INSERT, UPDATE, DELETE, SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+#------------------------------------------------------------------------
+# I/R/U/D/S on the outer view
+# Expectation: Can run everything
+#------------------------------------------------------------------------
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 56 Using where
+ANALYZE UPDATE v2 SET a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 56 56.00 100.00 21.43 Using where
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 56 Using where
+ANALYZE UPDATE v2 SET a = a + 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 56 56.00 100.00 21.43 Using where
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 56 Using where
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 56 56.00 100.00 0.00 Using where
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 Using where
+ANALYZE DELETE FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 Using where
+ANALYZE DELETE FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where
+SELECT * FROM v2;
+a b
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 Using where
+ANALYZE SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a = 10;
+a b
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 Using where
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+a b
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
+1 PRIMARY t1 ALL NULL NULL NULL NULL 44 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 Using where
+disconnect con1;
+connection default;
+DROP USER 'privtest'@localhost;
+USE test;
+DROP DATABASE privtest_db;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/analyze_stmt_slow_query_log.result b/mysql-test/r/analyze_stmt_slow_query_log.result
new file mode 100644
index 00000000000..a0c4b45dee0
--- /dev/null
+++ b/mysql-test/r/analyze_stmt_slow_query_log.result
@@ -0,0 +1,18 @@
+drop table if exists t1;
+SET @@global.slow_query_log = OFF;
+FLUSH SLOW LOGS;
+SET @@global.slow_query_log = ON;
+create table t1 (a int);
+INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+select * from t1 where a<3;
+a
+0
+1
+2
+drop table t1;
+# explain: id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+# explain: 1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
+# explain: id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+# explain: 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 30.00 Using where
+# explain: id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+# explain: 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
diff --git a/mysql-test/r/auth_named_pipe.result b/mysql-test/r/auth_named_pipe.result
new file mode 100644
index 00000000000..3268b760a22
--- /dev/null
+++ b/mysql-test/r/auth_named_pipe.result
@@ -0,0 +1,10 @@
+INSTALL SONAME 'auth_named_pipe';
+CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+USERNAME@localhost USERNAME@%
+DROP USER 'USERNAME';
+CREATE USER nosuchuser IDENTIFIED WITH named_pipe;
+ERROR 28000: Access denied for user 'nosuchuser'@'localhost'
+DROP USER nosuchuser;
+UNINSTALL SONAME 'auth_named_pipe';
diff --git a/mysql-test/r/bench_count_distinct.result b/mysql-test/r/bench_count_distinct.result
index 8b67e4be38a..79e12afd237 100644
--- a/mysql-test/r/bench_count_distinct.result
+++ b/mysql-test/r/bench_count_distinct.result
@@ -5,7 +5,7 @@ count(distinct n)
100
explain extended select count(distinct n) from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 range NULL n 4 NULL 10 100.00 Using index for group-by
+1 SIMPLE t1 index NULL n 4 NULL 200 100.00 Using index
Warnings:
Note 1003 select count(distinct `test`.`t1`.`n`) AS `count(distinct n)` from `test`.`t1`
drop table t1;
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index b06ec5805a0..f21a1a763a3 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -180,14 +180,14 @@ create table t1 select 1 as 'a';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(1) NOT NULL DEFAULT '0'
+ `a` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select 9223372036854775809 as 'a';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(19) unsigned NOT NULL DEFAULT '0'
+ `a` bigint(19) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a
@@ -397,12 +397,12 @@ select -(-9223372036854775808), -(-(-9223372036854775808));
create table t1 select -9223372036854775808 bi;
describe t1;
Field Type Null Key Default Extra
-bi bigint(20) NO 0
+bi bigint(20) NO NULL
drop table t1;
create table t1 select -9223372036854775809 bi;
describe t1;
Field Type Null Key Default Extra
-bi decimal(19,0) NO 0
+bi decimal(19,0) NO NULL
drop table t1;
#
# Bug #45360: wrong results
diff --git a/mysql-test/r/blackhole_plugin.result b/mysql-test/r/blackhole_plugin.result
index dd1b95ab0d9..2884441056a 100644
--- a/mysql-test/r/blackhole_plugin.result
+++ b/mysql-test/r/blackhole_plugin.result
@@ -1,7 +1,9 @@
+set sql_mode="";
CREATE TABLE t1(a int) ENGINE=BLACKHOLE;
Warnings:
Warning 1286 Unknown storage engine 'BLACKHOLE'
Warning 1266 Using storage engine MyISAM for table 't1'
+set sql_mode=default;
DROP TABLE t1;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
INSTALL PLUGIN BLACKHOLE SONAME 'ha_blackhole.so';
diff --git a/mysql-test/r/bug13633383.result b/mysql-test/r/bug13633383.result
index 3b533f89df2..a6f5bab5260 100644
--- a/mysql-test/r/bug13633383.result
+++ b/mysql-test/r/bug13633383.result
@@ -49,5 +49,66 @@ col435
0.00000000000000000
0.00000000000000000
0.00000000000000000
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
set session sort_buffer_size= default;
DROP TABLE t1, t2, t3;
diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result
index 85eef0b3418..971750e3da2 100644
--- a/mysql-test/r/cache_innodb.result
+++ b/mysql-test/r/cache_innodb.result
@@ -1,3 +1,5 @@
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t2,t3;
set @save_query_cache_size = @@global.query_cache_size;
@@ -221,6 +223,7 @@ Variable_name Value
Qcache_hits 1
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
+SET global query_cache_type=default;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES(1);
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index bf7ec11c6a0..6fc1c9628b3 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -99,18 +99,18 @@ CASE WHEN 1 THEN 0.1e1 else '1' END AS c12
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
- `c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
- `c3` varchar(1) NOT NULL DEFAULT '',
- `c4` varchar(1) NOT NULL DEFAULT '',
- `c5` varchar(4) NOT NULL DEFAULT '',
- `c6` varchar(4) NOT NULL DEFAULT '',
- `c7` decimal(2,1) NOT NULL DEFAULT '0.0',
- `c8` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL,
+ `c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL,
+ `c3` varchar(1) NOT NULL,
+ `c4` varchar(1) NOT NULL,
+ `c5` varchar(4) NOT NULL,
+ `c6` varchar(4) NOT NULL,
+ `c7` decimal(2,1) NOT NULL,
+ `c8` decimal(2,1) NOT NULL,
`c9` decimal(2,1) DEFAULT NULL,
- `c10` double NOT NULL DEFAULT '0',
- `c11` double NOT NULL DEFAULT '0',
- `c12` varchar(5) NOT NULL DEFAULT ''
+ `c10` double NOT NULL,
+ `c11` double NOT NULL,
+ `c12` varchar(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT CASE
@@ -151,13 +151,13 @@ Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,c
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `COALESCE(1)` int(1) NOT NULL DEFAULT '0',
- `COALESCE(1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
- `COALESCE('a')` varchar(1) NOT NULL DEFAULT '',
- `COALESCE(1,1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
- `COALESCE(1,'1')` varchar(1) NOT NULL DEFAULT '',
- `COALESCE(1.1,'1')` varchar(4) NOT NULL DEFAULT '',
- `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
+ `COALESCE(1)` int(1) NOT NULL,
+ `COALESCE(1.0)` decimal(2,1) NOT NULL,
+ `COALESCE('a')` varchar(1) NOT NULL,
+ `COALESCE(1,1.0)` decimal(2,1) NOT NULL,
+ `COALESCE(1,'1')` varchar(1) NOT NULL,
+ `COALESCE(1.1,'1')` varchar(4) NOT NULL,
+ `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 SELECT IFNULL('a' COLLATE latin1_swedish_ci, 'b' COLLATE latin1_bin);
@@ -260,3 +260,138 @@ DESCRIBE t1;
Field Type Null Key Default Extra
a decimal(2,0) YES NULL
DROP TABLE t1;
+#
+# Start of 10.1 test
+#
+#
+# MDEV-8752 Wrong result for SELECT..WHERE CASE enum_field WHEN 1 THEN 1 ELSE 0 END AND a='5'
+#
+CREATE TABLE t1 (a ENUM('5','6') CHARACTER SET BINARY);
+INSERT INTO t1 VALUES ('5'),('6');
+SELECT * FROM t1 WHERE a='5';
+a
+5
+SELECT * FROM t1 WHERE a=1;
+a
+5
+SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END;
+a
+5
+SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END AND a='5';
+a
+5
+# Multiple comparison types in CASE, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END AND a='5';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '5') and (case `test`.`t1`.`a` when 1 then 1 else 0 end))
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('a','b','100'));
+INSERT INTO t1 VALUES ('a'),('b'),('100');
+SELECT * FROM t1 WHERE a='a';
+a
+a
+SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END;
+a
+a
+SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END AND a='a';
+a
+a
+# String comparison in CASE and in the equality, ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+SELECT * FROM t1 WHERE a=3;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a=3;
+a
+100
+# Integer comparison in CASE and in the equality, not ok to propagate
+# ENUM does not support this type of propagation yet.
+# This can change in the future. See MDEV-8748.
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a=3;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when 3 then 1 else 0 end) and (`test`.`t1`.`a` = 3))
+SELECT * FROM t1 WHERE a=3;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END AND a=3;
+a
+100
+# String comparison in CASE, integer comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END AND a=3;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when '100' then 1 else 0 end) and (`test`.`t1`.`a` = 3))
+SELECT * FROM t1 WHERE a='100';
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a='100';
+a
+100
+# Integer comparison in CASE, string comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a='100';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '100') and (case `test`.`t1`.`a` when 3 then 1 else 0 end))
+SELECT * FROM t1 WHERE a='100';
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a='100';
+a
+100
+# Multiple type comparison in CASE, string comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a='100';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '100') and (case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end))
+SELECT * FROM t1 WHERE a=3;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END;
+a
+100
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=3;
+a
+100
+# Multiple type comparison in CASE, integer comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=3;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end) and (`test`.`t1`.`a` = 3))
+DROP TABLE t1;
+#
+# End of MDEV-8752
+#
+#
+# End of 10.1 test
+#
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index c81af134add..ab784b5afc2 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -13,7 +13,7 @@ select CAST('10 ' as unsigned integer);
CAST('10 ' as unsigned integer)
10
Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '10 '
+Note 1292 Truncated incorrect INTEGER value: '10 '
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1
18446744073709551611 18446744073709551611
@@ -404,7 +404,7 @@ create table t1 select cast(_koi8r'ÔÅÓÔ' as char character set cp1251) as t;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `t` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `t` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
@@ -438,11 +438,11 @@ ab a ab a 6100
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT '',
- `c2` varbinary(2) NOT NULL DEFAULT '',
- `c3` varbinary(2) NOT NULL DEFAULT '',
- `c4` varbinary(2) NOT NULL DEFAULT '',
- `c5` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL,
+ `c2` varbinary(2) NOT NULL,
+ `c3` varbinary(2) NOT NULL,
+ `c4` varbinary(2) NOT NULL,
+ `c5` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
@@ -454,8 +454,8 @@ cast(_koi8r'Æ' AS nchar(2)) as c5;
c1 c2 c3 c4 c5
фг ф фг ф ф
Warnings:
-Warning 1292 Truncated incorrect CHAR(4) value: 'фгх'
-Warning 1292 Truncated incorrect CHAR(3) value: 'Ñ„ '
+Warning 1292 Truncated incorrect CHAR(2) value: 'фгх'
+Warning 1292 Truncated incorrect CHAR(2) value: 'Ñ„ '
create table t1 select
cast(_koi8r'ÆÇ' AS nchar) as c1,
cast(_koi8r'Æ ' AS nchar) as c2,
@@ -463,19 +463,19 @@ cast(_koi8r'ÆÇÈ' AS nchar(2)) as c3,
cast(_koi8r'Æ ' AS nchar(2)) as c4,
cast(_koi8r'Æ' AS nchar(2)) as c5;
Warnings:
-Warning 1292 Truncated incorrect CHAR(4) value: 'фгх'
-Warning 1292 Truncated incorrect CHAR(3) value: 'Ñ„ '
+Warning 1292 Truncated incorrect CHAR(2) value: 'фгх'
+Warning 1292 Truncated incorrect CHAR(2) value: 'Ñ„ '
select * from t1;
c1 c2 c3 c4 c5
фг ф фг ф ф
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c2` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c3` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c4` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c5` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL,
+ `c2` varchar(2) CHARACTER SET utf8 NOT NULL,
+ `c3` varchar(2) CHARACTER SET utf8 NOT NULL,
+ `c4` varchar(2) CHARACTER SET utf8 NOT NULL,
+ `c5` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a binary(4), b char(4) character set koi8r);
@@ -582,12 +582,12 @@ create table t1 select cast(1 as unsigned), cast(1 as signed), cast(1 as double
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `cast(1 as unsigned)` int(1) unsigned NOT NULL DEFAULT '0',
- `cast(1 as signed)` int(1) NOT NULL DEFAULT '0',
+ `cast(1 as unsigned)` int(1) unsigned NOT NULL,
+ `cast(1 as signed)` int(2) NOT NULL,
`cast(1 as double(5,2))` double(5,2) DEFAULT NULL,
- `cast(1 as decimal(5,3))` decimal(5,3) NOT NULL DEFAULT '0.000',
- `cast("A" as binary)` varbinary(1) NOT NULL DEFAULT '',
- `cast("A" as char(100))` varbinary(100) NOT NULL DEFAULT '',
+ `cast(1 as decimal(5,3))` decimal(5,3) NOT NULL,
+ `cast("A" as binary)` varbinary(1) NOT NULL,
+ `cast("A" as char(100))` varbinary(100) NOT NULL,
`cast("2001-1-1" as DATE)` date DEFAULT NULL,
`cast("2001-1-1" as DATETIME)` datetime DEFAULT NULL,
`cast("1:2:3" as TIME)` time DEFAULT NULL
@@ -751,8 +751,8 @@ Warning 1292 Truncated incorrect INTEGER value: '9999999999999999999999999999999
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL DEFAULT '',
- `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL DEFAULT ''
+ `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL,
+ `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
# End of test for Bug#13581962, Bug#14096619
@@ -796,3 +796,97 @@ DATE("foo")
NULL
Warnings:
Warning 1292 Incorrect datetime value: 'foo'
+create table t1 (a int, b char(5) as (cast("a" as char(10) binary) + a) );
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(5) AS (cast("a" as char(10) binary) + a) VIRTUAL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select collation(cast("a" as char(10) binary));
+collation(cast("a" as char(10) binary))
+latin1_bin
+select collation(cast("a" as char(10) charset utf8 binary));
+collation(cast("a" as char(10) charset utf8 binary))
+utf8_bin
+select collation(cast("a" as char(10) ascii binary));
+collation(cast("a" as char(10) ascii binary))
+latin1_bin
+select collation(cast("a" as char(10) binary charset utf8));
+collation(cast("a" as char(10) binary charset utf8))
+utf8_bin
+select collation(cast("a" as char(10) binary ascii));
+collation(cast("a" as char(10) binary ascii))
+latin1_bin
+#
+# MDEV-11030 Assertion `precision > 0' failed in decimal_bin_size
+#
+SELECT * FROM (SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL)) sq;
+IFNULL(CONVERT(NULL, UNSIGNED), NULL)
+NULL
+CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `IFNULL(CONVERT(NULL, UNSIGNED), NULL)` decimal(1,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT COALESCE(CONVERT(NULL, UNSIGNED), NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `COALESCE(CONVERT(NULL, UNSIGNED), NULL)` decimal(1,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT CASE WHEN TRUE THEN CONVERT(NULL, UNSIGNED) ELSE NULL END;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CASE WHEN TRUE THEN CONVERT(NULL, UNSIGNED) ELSE NULL END` decimal(1,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL,SIGNED),CONVERT(NULL,UNSIGNED)) AS a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(1,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+-1,
+CONVERT(NULL,SIGNED),
+CONCAT(CONVERT(NULL,SIGNED)),
+1,
+CONVERT(NULL,UNSIGNED),
+CONCAT(CONVERT(NULL,UNSIGNED));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `-1` int(2) NOT NULL,
+ `CONVERT(NULL,SIGNED)` int(2) DEFAULT NULL,
+ `CONCAT(CONVERT(NULL,SIGNED))` varchar(2) DEFAULT NULL,
+ `1` int(1) NOT NULL,
+ `CONVERT(NULL,UNSIGNED)` int(1) unsigned DEFAULT NULL,
+ `CONCAT(CONVERT(NULL,UNSIGNED))` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+CONVERT('',SIGNED),
+CONCAT(CONVERT('',SIGNED)),
+CONVERT('',UNSIGNED),
+CONCAT(CONVERT('',UNSIGNED));
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CONVERT('',SIGNED)` int(2) NOT NULL,
+ `CONCAT(CONVERT('',SIGNED))` varchar(2) NOT NULL,
+ `CONVERT('',UNSIGNED)` int(1) unsigned NOT NULL,
+ `CONCAT(CONVERT('',UNSIGNED))` varchar(1) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result
index 18c53a5e22b..1de97ed02e6 100644
--- a/mysql-test/r/change_user.result
+++ b/mysql-test/r/change_user.result
@@ -1,6 +1,10 @@
+set global secure_auth=0;
+create user test_nopw;
grant select on test.* to test_nopw;
-grant select on test.* to test_oldpw identified by password "09301740536db389";
-grant select on test.* to test_newpw identified by "newpw";
+create user test_oldpw identified by password "09301740536db389";
+grant select on test.* to test_oldpw;
+create user test_newpw identified by "newpw";
+grant select on test.* to test_newpw;
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
concat('<', user(), '>') concat('<', current_user(), '>') database()
<root@localhost> <root@localhost> test
@@ -85,3 +89,4 @@ IS_USED_LOCK('bug31418')
NULL
FLUSH STATUS;
Value of com_select did not change
+set global secure_auth=default;
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index cdd234f1478..a5654fb3160 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -64,7 +64,7 @@ EXPLAIN EXTENDED SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 1) and (concat('01',`test`.`t1`.`c`) = '0101'))
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 1) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = '0101'))
SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
b c
01 01
diff --git a/mysql-test/r/compound.result b/mysql-test/r/compound.result
new file mode 100644
index 00000000000..1d412e671a4
--- /dev/null
+++ b/mysql-test/r/compound.result
@@ -0,0 +1,171 @@
+CREATE TABLE t1 (a INT PRIMARY KEY)|
+BEGIN NOT ATOMIC
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+END|
+SELECT * FROM t1|
+a
+1
+2
+3
+PREPARE stmt FROM "BEGIN NOT ATOMIC
+ INSERT INTO t1 VALUES (4);
+ INSERT INTO t1 VALUES (5);
+ INSERT INTO t1 VALUES (?);
+END";
+SET @val = 6|
+reset master|
+EXECUTE stmt USING @val|
+SELECT * FROM t1|
+a
+1
+2
+3
+4
+5
+6
+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 `test`; INSERT INTO t1 VALUES (4)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+master-bin.000001 # Query # # COMMIT
+DROP TABLE t1|
+CREATE DATABASE mysqltest1|
+CREATE PROCEDURE mysqltest1.sp1()
+BEGIN
+PREPARE stmt FROM "BEGIN NOT ATOMIC CREATE TABLE t1 AS SELECT DATABASE(); END";
+EXECUTE stmt;
+END|
+CALL mysqltest1.sp1()|
+SELECT * FROM mysqltest1.t1|
+DATABASE()
+mysqltest1
+USE mysqltest1|
+DROP DATABASE mysqltest1|
+BEGIN NOT ATOMIC CREATE TABLE t1(a int); END|
+ERROR 3D000: No database selected
+BEGIN NOT ATOMIC SET @a=1; CREATE TABLE test.t1(a int); END|
+USE test|
+show tables|
+Tables_in_test
+t1
+drop table t1|
+/**/ if (select count(*) from information_schema.tables
+where table_schema='test' and table_name='t1') = 0
+then
+create table t1 (a int);
+end if|
+show tables|
+Tables_in_test
+t1
+/**/ if (select count(*) from information_schema.tables
+where table_schema='test' and table_name='t1') = 0
+then
+create table t1 (a int);
+end if|
+show tables|
+Tables_in_test
+t1
+case (select table_name from information_schema.tables where table_schema='test')
+when 't1' then create table t2 (b int);
+when 't2' then create table t3 (b int);
+else signal sqlstate '42S02';
+end case|
+show tables|
+Tables_in_test
+t1
+t2
+case
+when database() = 'test' then create table t3 (test text);
+when now() < date'2001-02-03' then create table oops (machine time);
+end case|
+show tables|
+Tables_in_test
+t1
+t2
+t3
+loop
+create table t4 (a int);
+end loop|
+ERROR 42S01: Table 't4' already exists
+show tables|
+Tables_in_test
+t1
+t2
+t3
+t4
+set @a=0;
+repeat
+set @a = @a + 1;
+until @a > 5
+end repeat|
+select @a|
+@a
+6
+/**/ while (select count(*) from information_schema.tables where table_schema='test')
+do
+select concat('drop table ', table_name) into @a
+from information_schema.tables where table_schema='test' limit 1;
+select @a as 'executing:';
+prepare dt from @a;
+execute dt;
+end while|
+executing: drop table t1
+executing: drop table t2
+executing: drop table t3
+executing: drop table t4
+create table t1 (x int)|
+create function fn(a int) returns int
+begin
+insert t1 values (a+7);
+return a+8;
+end|
+reset master|
+/**/ if fn(9) > 5 then
+select 1;
+end if|
+1
+1
+prepare stmt from "if fn(?) > 6 then
+ begin
+ declare a int;
+ set a=?*2;
+ insert t1 values(a+?);
+ end;
+end if"|
+set @a=1, @b=2, @c=3|
+execute stmt using @a, @b, @c|
+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`; SELECT `test`.`fn`(9)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; SELECT `test`.`fn`(1)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; insert t1 values( NAME_CONST('a',4)+3)
+master-bin.000001 # Query # # COMMIT
+drop function fn|
+drop table t1|
+begin not atomic select @@sql_mode; end|
+@@sql_mode
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+create table t1 (a int)|
+select a from t1 having a > 1|
+a
+begin not atomic select a from t1 having a > 1; end|
+a
+drop table t1|
+#
+# MDEV-8615: Assertion `m_cpp_buf <= begin_ptr &&
+# begin_ptr <= m_cpp_buf + m_buf_length' failed in
+# Lex_input_stream::body_utf8_start
+#
+b'|
+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 'b'' at line 1
diff --git a/mysql-test/r/concurrent_innodb_safelog.result b/mysql-test/r/concurrent_innodb_safelog.result
index 24a84afb9ce..03d20f40be3 100644
--- a/mysql-test/r/concurrent_innodb_safelog.result
+++ b/mysql-test/r/concurrent_innodb_safelog.result
@@ -1,4 +1,5 @@
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+SET SQL_MODE="";
SELECT @@global.tx_isolation;
@@global.tx_isolation
REPEATABLE-READ
@@ -790,3 +791,4 @@ eta tipo c
** connection default
drop table t1;
drop user mysqltest@localhost;
+SET SQL_MODE=default;
diff --git a/mysql-test/r/concurrent_innodb_unsafelog.result b/mysql-test/r/concurrent_innodb_unsafelog.result
index 35fc2d89cfe..4a140d9e610 100644
--- a/mysql-test/r/concurrent_innodb_unsafelog.result
+++ b/mysql-test/r/concurrent_innodb_unsafelog.result
@@ -1,4 +1,5 @@
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+SET SQL_MODE="";
SELECT @@global.tx_isolation;
@@global.tx_isolation
REPEATABLE-READ
@@ -786,3 +787,4 @@ eta tipo c
** connection default
drop table t1;
drop user mysqltest@localhost;
+SET SQL_MODE=default;
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 32c7bdfcf12..315aea0ef46 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -1,3 +1,4 @@
+SET global secure_auth=0;
drop table if exists t1,t2;
show tables;
Tables_in_mysql
@@ -143,6 +144,7 @@ drop table t1;
# -- Bug#33507: Event scheduler creates more threads than max_connections
# -- which results in user lockout.
+CREATE USER mysqltest_u1@localhost;
GRANT USAGE ON *.* TO mysqltest_u1@localhost;
SET GLOBAL max_connections = 3;
@@ -273,8 +275,8 @@ connect(localhost,mysqltest_nouser,newpw,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: YES)
connect(localhost,mysqltest_nouser,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: NO)
-update mysql.user set password=authentication_string, authentication_string=''
- where user like 'mysqltest_up_';
+update mysql.user set plugin='mysql_native_password' where user = 'mysqltest_up1';
+update mysql.user set plugin='mysql_old_password' where user = 'mysqltest_up2';
select user, password, plugin, authentication_string from mysql.user
where user like 'mysqltest_up_';
user password plugin authentication_string
@@ -313,3 +315,4 @@ test
test
test
drop procedure p1;
+SET global secure_auth=default;
diff --git a/mysql-test/r/create-big.result b/mysql-test/r/create-big.result
index 5aa44c2941d..bb8c62bb25c 100644
--- a/mysql-test/r/create-big.result
+++ b/mysql-test/r/create-big.result
@@ -9,7 +9,7 @@ ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` int(1) NOT NULL DEFAULT '0'
+ `i` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
@@ -21,7 +21,7 @@ ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` int(1) NOT NULL DEFAULT '0'
+ `i` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t3 (j char(5));
@@ -34,7 +34,7 @@ ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` int(1) NOT NULL DEFAULT '0'
+ `i` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
@@ -46,7 +46,7 @@ ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` int(1) NOT NULL DEFAULT '0'
+ `i` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
@@ -58,7 +58,7 @@ ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` int(1) NOT NULL DEFAULT '0'
+ `i` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
@@ -70,7 +70,7 @@ ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` int(1) NOT NULL DEFAULT '0'
+ `i` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t3;
set debug_sync='create_table_select_before_open SIGNAL parked WAIT_FOR go';
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 89d11c3ff9d..4ac8a0e249f 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -131,12 +131,12 @@ drop table t2;
create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
describe t2;
Field Type Null Key Default Extra
-a datetime NO 0000-00-00 00:00:00
-b time NO 00:00:00
-c date NO 0000-00-00
-d int(3) NO 0
-e decimal(3,1) NO 0.0
-f bigint(19) NO 0
+a datetime NO NULL
+b time NO NULL
+c date NO NULL
+d int(3) NO NULL
+e decimal(3,1) NO NULL
+f bigint(19) NO NULL
drop table t2;
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
describe t2;
@@ -481,10 +481,10 @@ from t1;
explain t2;
Field Type Null Key Default Extra
a int(11) YES NULL
-b bigint(11) NO 0
-c bigint(10) unsigned NO 0
+b bigint(11) NO NULL
+c bigint(10) unsigned NO NULL
d date YES NULL
-e varchar(1) NO
+e varchar(1) NO NULL
f datetime YES NULL
g time YES NULL
h longblob NO NULL
@@ -494,7 +494,7 @@ a b c d e f g h dd
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
drop table t1, t2;
-create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
+create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, l datetime, m enum('a','b'), n set('a','b'), o char(10));
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(i,i), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(n,n), ifnull(o,o) from t1;
show create table t2;
Table Create Table
@@ -727,7 +727,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `c` int(1) NOT NULL DEFAULT '0',
+ `c` int(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
@@ -740,7 +740,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `c` int(1) NOT NULL DEFAULT '0',
+ `c` int(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
@@ -763,7 +763,7 @@ b int not null, primary key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`b` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -912,788 +912,6 @@ unlock tables;
drop table t1, t2;
create table t1 (upgrade int);
drop table t1;
-create table t1 (
-c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
-c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
-key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
-);
-Warnings:
-Note 1831 Duplicate index `a002_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a003_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a004_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a005_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a006_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a007_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a008_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a009_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a010_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a011_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a012_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a013_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a014_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a015_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a016_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a017_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a018_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a019_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a020_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a021_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a022_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a023_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a024_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a025_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a026_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a027_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a028_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a029_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a030_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a031_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a032_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a033_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a034_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a035_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a036_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a037_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a038_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a039_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a040_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a041_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a042_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a043_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a044_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a045_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a046_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a047_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a048_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a049_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a050_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a051_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a052_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a053_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a054_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a055_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a056_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a057_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a058_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a059_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a060_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a061_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a062_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a063_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a064_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) DEFAULT NULL,
- `c2` int(11) DEFAULT NULL,
- `c3` int(11) DEFAULT NULL,
- `c4` int(11) DEFAULT NULL,
- `c5` int(11) DEFAULT NULL,
- `c6` int(11) DEFAULT NULL,
- `c7` int(11) DEFAULT NULL,
- `c8` int(11) DEFAULT NULL,
- `c9` int(11) DEFAULT NULL,
- `c10` int(11) DEFAULT NULL,
- `c11` int(11) DEFAULT NULL,
- `c12` int(11) DEFAULT NULL,
- `c13` int(11) DEFAULT NULL,
- `c14` int(11) DEFAULT NULL,
- `c15` int(11) DEFAULT NULL,
- `c16` int(11) DEFAULT NULL,
- KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-flush tables;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) DEFAULT NULL,
- `c2` int(11) DEFAULT NULL,
- `c3` int(11) DEFAULT NULL,
- `c4` int(11) DEFAULT NULL,
- `c5` int(11) DEFAULT NULL,
- `c6` int(11) DEFAULT NULL,
- `c7` int(11) DEFAULT NULL,
- `c8` int(11) DEFAULT NULL,
- `c9` int(11) DEFAULT NULL,
- `c10` int(11) DEFAULT NULL,
- `c11` int(11) DEFAULT NULL,
- `c12` int(11) DEFAULT NULL,
- `c13` int(11) DEFAULT NULL,
- `c14` int(11) DEFAULT NULL,
- `c15` int(11) DEFAULT NULL,
- `c16` int(11) DEFAULT NULL,
- KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
-create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
-c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
-alter table t1
-add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
-Warnings:
-Note 1831 Duplicate index `a002_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a003_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a004_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a005_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a006_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a007_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a008_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a009_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a010_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a011_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a012_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a013_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a014_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a015_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a016_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a017_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a018_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a019_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a020_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a021_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a022_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a023_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a024_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a025_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a026_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a027_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a028_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a029_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a030_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a031_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a032_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a033_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a034_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a035_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a036_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a037_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a038_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a039_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a040_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a041_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a042_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a043_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a044_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a045_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a046_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a047_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a048_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a049_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a050_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a051_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a052_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a053_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a054_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a055_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a056_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a057_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a058_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a059_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a060_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a061_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a062_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a063_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index `a064_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) DEFAULT NULL,
- `c2` int(11) DEFAULT NULL,
- `c3` int(11) DEFAULT NULL,
- `c4` int(11) DEFAULT NULL,
- `c5` int(11) DEFAULT NULL,
- `c6` int(11) DEFAULT NULL,
- `c7` int(11) DEFAULT NULL,
- `c8` int(11) DEFAULT NULL,
- `c9` int(11) DEFAULT NULL,
- `c10` int(11) DEFAULT NULL,
- `c11` int(11) DEFAULT NULL,
- `c12` int(11) DEFAULT NULL,
- `c13` int(11) DEFAULT NULL,
- `c14` int(11) DEFAULT NULL,
- `c15` int(11) DEFAULT NULL,
- `c16` int(11) DEFAULT NULL,
- KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-flush tables;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) DEFAULT NULL,
- `c2` int(11) DEFAULT NULL,
- `c3` int(11) DEFAULT NULL,
- `c4` int(11) DEFAULT NULL,
- `c5` int(11) DEFAULT NULL,
- `c6` int(11) DEFAULT NULL,
- `c7` int(11) DEFAULT NULL,
- `c8` int(11) DEFAULT NULL,
- `c9` int(11) DEFAULT NULL,
- `c10` int(11) DEFAULT NULL,
- `c11` int(11) DEFAULT NULL,
- `c12` int(11) DEFAULT NULL,
- `c13` int(11) DEFAULT NULL,
- `c14` int(11) DEFAULT NULL,
- `c15` int(11) DEFAULT NULL,
- `c16` int(11) DEFAULT NULL,
- KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
- KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-alter table t1 add key
-a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
-ERROR 42000: Too many keys specified; max 64 keys allowed
-drop table t1;
-create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
-c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int,
-c16 int, c17 int, c18 int,c19 int,c20 int,c21 int,c22 int,c23 int,c24 int,c25 int,c26 int,c27 int,c28 int,c29 int,c30 int,c31 int,c32 int, c33 int);
-alter table t1 add key i1 (
-c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16, c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31,c32,c33);
-ERROR 42000: Too many key parts specified; max 32 parts allowed
-alter table t1 add key
-a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
-ERROR 42000: Identifier name 'a001_long_123456789_123456789_123456789_123456789_123456789_12345' is too long
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) DEFAULT NULL,
- `c2` int(11) DEFAULT NULL,
- `c3` int(11) DEFAULT NULL,
- `c4` int(11) DEFAULT NULL,
- `c5` int(11) DEFAULT NULL,
- `c6` int(11) DEFAULT NULL,
- `c7` int(11) DEFAULT NULL,
- `c8` int(11) DEFAULT NULL,
- `c9` int(11) DEFAULT NULL,
- `c10` int(11) DEFAULT NULL,
- `c11` int(11) DEFAULT NULL,
- `c12` int(11) DEFAULT NULL,
- `c13` int(11) DEFAULT NULL,
- `c14` int(11) DEFAULT NULL,
- `c15` int(11) DEFAULT NULL,
- `c16` int(11) DEFAULT NULL,
- `c17` int(11) DEFAULT NULL,
- `c18` int(11) DEFAULT NULL,
- `c19` int(11) DEFAULT NULL,
- `c20` int(11) DEFAULT NULL,
- `c21` int(11) DEFAULT NULL,
- `c22` int(11) DEFAULT NULL,
- `c23` int(11) DEFAULT NULL,
- `c24` int(11) DEFAULT NULL,
- `c25` int(11) DEFAULT NULL,
- `c26` int(11) DEFAULT NULL,
- `c27` int(11) DEFAULT NULL,
- `c28` int(11) DEFAULT NULL,
- `c29` int(11) DEFAULT NULL,
- `c30` int(11) DEFAULT NULL,
- `c31` int(11) DEFAULT NULL,
- `c32` int(11) DEFAULT NULL,
- `c33` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
Bug #26104 Bug on foreign key class constructor
@@ -1926,7 +1144,9 @@ t1 CREATE TABLE `t1` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
drop table t1;
create temporary table t1 like information_schema.processlist;
@@ -1947,7 +1167,9 @@ t1 CREATE TEMPORARY TABLE `t1` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
drop table t1;
create table t1 like information_schema.character_sets;
@@ -1969,14 +1191,14 @@ DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
-CREATE TABLE t1(c1 TIMESTAMP, c2 TIMESTAMP);
+CREATE TABLE t1(c1 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c2 TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
SET sql_mode = NO_ZERO_DATE;
CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP DEFAULT 0);
ERROR 42000: Invalid default value for 'c2'
-CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP);
+CREATE TABLE t2(c1 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c2 TIMESTAMP NOT NULL);
ERROR 42000: Invalid default value for 'c2'
# -- Check that NULL column still can be created.
@@ -2121,6 +1343,11 @@ CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
BEGIN
UPDATE A SET `pk`=1 WHERE `pk`=0 ;
END ;|
+ERROR HY000: Trigger already exists
+CREATE TRIGGER f1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+UPDATE A SET `pk`=1 WHERE `pk`=0 ;
+END ;|
ERROR 42000: This version of MariaDB doesn't yet support 'multiple triggers with the same action time and event for one table'
DROP TABLE t1;
DROP TABLE B;
diff --git a/mysql-test/r/create_drop_binlog.result b/mysql-test/r/create_drop_binlog.result
new file mode 100644
index 00000000000..537a1bd4605
--- /dev/null
+++ b/mysql-test/r/create_drop_binlog.result
@@ -0,0 +1,392 @@
+CREATE OR REPLACE DATABASE d1;
+CREATE OR REPLACE DATABASE d1;
+DROP DATABASE d1;
+CREATE DATABASE IF NOT EXISTS d1;
+CREATE DATABASE IF NOT EXISTS d1;
+Warnings:
+Note 1007 Can't create database 'd1'; database exists
+DROP DATABASE IF EXISTS d1;
+DROP DATABASE IF EXISTS d1;
+Warnings:
+Note 1008 Can't drop database 'd1'; database doesn't exist
+"Runnig SHOW BINLOG EVENTS"
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # CREATE OR REPLACE DATABASE d1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # CREATE OR REPLACE DATABASE d1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # DROP DATABASE d1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # CREATE DATABASE IF NOT EXISTS d1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # CREATE DATABASE IF NOT EXISTS d1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # DROP DATABASE IF EXISTS d1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # DROP DATABASE IF EXISTS d1
+RESET MASTER;
+USE test;
+CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 1;
+DROP FUNCTION f1;
+CREATE FUNCTION IF NOT EXISTS f1() RETURNS INT RETURN 1;
+CREATE FUNCTION IF NOT EXISTS f1() RETURNS INT RETURN 1;
+Warnings:
+Note 1304 FUNCTION f1 already exists
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f1;
+Warnings:
+Note 1305 FUNCTION test.f1 does not exist
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP FUNCTION f1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION IF NOT EXISTS `f1`() RETURNS int(11)
+RETURN 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION IF NOT EXISTS `f1`() RETURNS int(11)
+RETURN 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP FUNCTION IF EXISTS f1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP FUNCTION IF EXISTS f1
+RESET MASTER;
+CREATE TABLE t1 (a DATETIME);
+CREATE OR REPLACE PROCEDURE p1() DELETE FROM t1;
+CREATE OR REPLACE PROCEDURE p1() DELETE FROM t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE IF NOT EXISTS p1() DELETE FROM t1;
+CREATE PROCEDURE IF NOT EXISTS p1() DELETE FROM t1;
+Warnings:
+Note 1304 PROCEDURE p1 already exists
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p1;
+Warnings:
+Note 1305 PROCEDURE test.p1 does not exist
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE t1 (a DATETIME)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+DELETE FROM t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+DELETE FROM t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP PROCEDURE p1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE IF NOT EXISTS `p1`()
+DELETE FROM t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE IF NOT EXISTS `p1`()
+DELETE FROM t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP PROCEDURE IF EXISTS p1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP PROCEDURE IF EXISTS p1
+DROP TABLE t1;
+RESET MASTER;
+CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME 'UDF_EXAMPLE_LIB';
+CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME 'UDF_EXAMPLE_LIB';
+DROP FUNCTION metaphon;
+CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME 'UDF_EXAMPLE_LIB';
+CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME 'UDF_EXAMPLE_LIB';
+Warnings:
+Note 1125 Function 'metaphon' already exists
+DROP FUNCTION IF EXISTS metaphon;
+DROP FUNCTION IF EXISTS metaphon;
+Warnings:
+Note 1305 FUNCTION test.metaphon does not exist
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME 'UDM_EXAMPLE_LIB'
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME 'UDM_EXAMPLE_LIB'
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP FUNCTION metaphon
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME 'UDM_EXAMPLE_LIB'
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME 'UDM_EXAMPLE_LIB'
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP FUNCTION IF EXISTS metaphon
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP FUNCTION IF EXISTS metaphon
+RESET MASTER;
+#
+# CREATE SERVER is not logged
+#
+CREATE OR REPLACE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+CREATE OR REPLACE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+DROP SERVER s1;
+CREATE SERVER IF NOT EXISTS s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+CREATE SERVER IF NOT EXISTS s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+Warnings:
+Note 1476 The foreign server, s1, you are trying to create already exists.
+DROP SERVER IF EXISTS s1;
+DROP SERVER IF EXISTS s1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+RESET MASTER;
+CREATE OR REPLACE VIEW v1 AS SELECT 1;
+CREATE OR REPLACE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+CREATE VIEW IF NOT EXISTS v1 AS SELECT 1;
+CREATE VIEW IF NOT EXISTS v1 AS SELECT 1;
+Warnings:
+Note 1050 Table 'v1' already exists
+DROP VIEW IF EXISTS v1;
+DROP VIEW IF EXISTS v1;
+Warnings:
+Note 1051 Unknown table 'test.v1'
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP VIEW v1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW IF NOT EXISTS `v1` AS SELECT 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW IF NOT EXISTS `v1` AS SELECT 1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP VIEW IF EXISTS v1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP VIEW IF EXISTS v1
+RESET MASTER;
+CREATE OR REPLACE ROLE r1;
+CREATE OR REPLACE ROLE r1;
+DROP ROLE r1;
+CREATE ROLE IF NOT EXISTS r1;
+CREATE ROLE IF NOT EXISTS r1;
+Warnings:
+Note 1975 Can't create role 'r1'; it already exists
+DROP ROLE IF EXISTS r1;
+DROP ROLE IF EXISTS r1;
+Warnings:
+Note 1976 Can't drop role 'r1'; it doesn't exist
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE ROLE r1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE ROLE r1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP ROLE r1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE ROLE IF NOT EXISTS r1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE ROLE IF NOT EXISTS r1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP ROLE IF EXISTS r1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP ROLE IF EXISTS r1
+RESET MASTER;
+CREATE OR REPLACE USER u1@localhost;
+CREATE OR REPLACE USER u1@localhost;
+DROP USER u1@localhost;
+CREATE USER IF NOT EXISTS u1@localhost;
+CREATE USER IF NOT EXISTS u1@localhost;
+Warnings:
+Note 1973 Can't create user 'u1'@'localhost'; it already exists
+DROP USER IF EXISTS u1@localhost;
+DROP USER IF EXISTS u1@localhost;
+Warnings:
+Note 1974 Can't drop user 'u1'@'localhost'; it doesn't exist
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE USER u1@localhost
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE USER u1@localhost
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP USER u1@localhost
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE USER IF NOT EXISTS u1@localhost
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE USER IF NOT EXISTS u1@localhost
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP USER IF EXISTS u1@localhost
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP USER IF EXISTS u1@localhost
+RESET MASTER;
+SET timestamp=UNIX_TIMESTAMP('2014-11-01 10:20:30');
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t1;
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t2;
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME EVENT_DEFINITION
+ev1 DROP TABLE IF EXISTS t2
+DROP EVENT ev1;
+DROP EVENT IF EXISTS ev1;
+Warnings:
+Note 1305 Event ev1 does not exist
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t2
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP EVENT ev1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP EVENT IF EXISTS ev1
+RESET MASTER;
+CREATE TABLE t1 (a INT);
+CREATE OR REPLACE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=10;
+CREATE OR REPLACE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=11;
+DROP TRIGGER tr1;
+CREATE TRIGGER IF NOT EXISTS tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=20;
+CREATE TRIGGER IF NOT EXISTS tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=21;
+Warnings:
+Note 1359 Trigger already exists
+DROP TRIGGER IF EXISTS tr1;
+DROP TRIGGER IF EXISTS tr1;
+Warnings:
+Note 1360 Trigger does not exist
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE t1 (a INT)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=10
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=11
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TRIGGER tr1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER IF NOT EXISTS tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=20
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER IF NOT EXISTS tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=21
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TRIGGER IF EXISTS tr1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TRIGGER IF EXISTS tr1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TABLE `t1` /* generated by server */
+RESET MASTER;
+CREATE TABLE t1(a INT, b INT);
+CREATE TABLE IF NOT EXISTS t1(a INT, b INT);
+Warnings:
+Note 1050 Table 't1' already exists
+CREATE OR REPLACE INDEX i1 ON t1(a);
+CREATE OR REPLACE INDEX i1 ON t1(a);
+CREATE OR REPLACE INDEX i1 ON t1(a,b);
+CREATE OR REPLACE INDEX i1 ON t1(a,b);
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE t1(a INT, b INT)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS t1(a INT, b INT)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE INDEX i1 ON t1(a)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE INDEX i1 ON t1(a)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE INDEX i1 ON t1(a,b)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE OR REPLACE INDEX i1 ON t1(a,b)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TABLE `t1` /* generated by server */
+RESET MASTER;
+RESET MASTER;
+SHOW MASTER STATUS;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 <pos>
+RESET MASTER TO 100;
+SHOW MASTER STATUS;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000100 <pos>
+RESET MASTER;
+SHOW MASTER STATUS;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 <pos>
+CREATE TABLE t1(a INT, b INT);
+CREATE TABLE IF NOT EXISTS t1(a INT, b INT);
+Warnings:
+Note 1050 Table 't1' already exists
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+Warnings:
+Note 1061 Duplicate key name 'i1'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `i1` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP INDEX IF EXISTS i1 ON t1;
+DROP INDEX IF EXISTS i1 ON t1;
+Warnings:
+Note 1091 Can't DROP 'i1'; check that column/key exists
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# # Format_desc 1 # VER
+# # Gtid_list 1 # []
+# # Binlog_checkpoint 1 # master-bin.000001
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE t1(a INT, b INT)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS t1(a INT, b INT)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE INDEX IF NOT EXISTS i1 ON t1(a)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; CREATE INDEX IF NOT EXISTS i1 ON t1(a)
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP INDEX IF EXISTS i1 ON t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP INDEX IF EXISTS i1 ON t1
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TABLE `t1` /* generated by server */
+# # Gtid 1 # GTID #-#-#
+# # Query 1 # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+RESET MASTER;
diff --git a/mysql-test/r/create_drop_db.result b/mysql-test/r/create_drop_db.result
new file mode 100644
index 00000000000..aee88703c9b
--- /dev/null
+++ b/mysql-test/r/create_drop_db.result
@@ -0,0 +1,40 @@
+CREATE DATABASE IF NOT EXISTS db1;
+affected rows: 1
+CREATE DATABASE IF NOT EXISTS db1;
+affected rows: 0
+Warnings:
+Note 1007 Can't create database 'db1'; database exists
+CREATE TABLE db1.t1 (a INT);
+affected rows: 0
+SHOW TABLES IN db1;
+Tables_in_db1
+t1
+affected rows: 1
+CREATE OR REPLACE DATABASE db1;
+affected rows: 2
+SHOW TABLES IN db1;
+Tables_in_db1
+affected rows: 0
+CREATE OR REPLACE DATABASE IF NOT EXISTS db2;
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+DROP DATABASE db1;
+affected rows: 0
+DROP DATABASE IF EXISTS db1;
+affected rows: 0
+Warnings:
+Note 1008 Can't drop database 'db1'; database doesn't exist
+DROP DATABASE db1;
+ERROR HY000: Can't drop database 'db1'; database doesn't exist
+CREATE OR REPLACE DATABASE db1;
+affected rows: 1
+SHOW TABLES IN db1;
+Tables_in_db1
+affected rows: 0
+CREATE DATABASE db1;
+ERROR HY000: Can't create database 'db1'; database exists
+DROP DATABASE IF EXISTS db1;
+affected rows: 0
+DROP DATABASE IF EXISTS db1;
+affected rows: 0
+Warnings:
+Note 1008 Can't drop database 'db1'; database doesn't exist
diff --git a/mysql-test/r/create_drop_event.result b/mysql-test/r/create_drop_event.result
new file mode 100644
index 00000000000..0d69e85dfd6
--- /dev/null
+++ b/mysql-test/r/create_drop_event.result
@@ -0,0 +1,48 @@
+SET timestamp=UNIX_TIMESTAMP('2014-11-01 10:20:30');
+SET GLOBAL event_scheduler=off;
+CREATE TABLE t1 (a INT);
+CREATE OR REPLACE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db1;
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME EVENT_DEFINITION
+ev1 INSERT INTO t1 VALUES (10)
+SET GLOBAL event_scheduler=on;
+SELECT DISTINCT a FROM t1;
+a
+10
+SET GLOBAL event_scheduler=off;
+DELETE FROM t1;
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
+ERROR HY000: Event 'ev1' already exists
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME EVENT_DEFINITION
+ev1 INSERT INTO t1 VALUES (10)
+CREATE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (12);
+Warnings:
+Note 1537 Event 'ev1' already exists
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME EVENT_DEFINITION
+ev1 INSERT INTO t1 VALUES (10)
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (13);
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME EVENT_DEFINITION
+ev1 INSERT INTO t1 VALUES (13)
+SET GLOBAL event_scheduler=on;
+SELECT DISTINCT a FROM t1;
+a
+13
+SET GLOBAL event_scheduler=off;
+DELETE FROM t1;
+DROP EVENT IF EXISTS ev1;
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME EVENT_DEFINITION
+DROP EVENT IF EXISTS ev1;
+Warnings:
+Note 1305 Event ev1 does not exist
+DROP EVENT ev1;
+ERROR HY000: Unknown event 'ev1'
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME EVENT_DEFINITION
+DROP TABLE t1;
+SET timestamp=DEFAULT;
diff --git a/mysql-test/r/create_drop_function.result b/mysql-test/r/create_drop_function.result
new file mode 100644
index 00000000000..e9db636ab87
--- /dev/null
+++ b/mysql-test/r/create_drop_function.result
@@ -0,0 +1,54 @@
+SET timestamp=UNIX_TIMESTAMP('2014-09-30 08:00:00');
+CREATE FUNCTION f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello, ', str, '!');
+SELECT * FROM mysql.proc WHERE name like 'f1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+test f1 FUNCTION f1 SQL CONTAINS_SQL NO DEFINER str char(20) char(100) CHARSET latin1 RETURN CONCAT('Hello, ', str, '!') root@localhost 2014-09-30 08:00:00 2014-09-30 08:00:00 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci RETURN CONCAT('Hello, ', str, '!')
+SELECT f1('world');
+f1('world')
+Hello, world!
+CREATE FUNCTION f1(str char(20))
+RETURNS TEXT
+RETURN CONCAT('Hello2, ', str, '!');
+ERROR 42000: FUNCTION f1 already exists
+SELECT body FROM mysql.proc WHERE name like 'f1';
+body
+RETURN CONCAT('Hello, ', str, '!')
+CREATE FUNCTION IF NOT EXISTS f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello3, ', str, '!');
+Warnings:
+Note 1304 FUNCTION f1 already exists
+SELECT body FROM mysql.proc WHERE name like 'f1';
+body
+RETURN CONCAT('Hello, ', str, '!')
+CREATE OR REPLACE FUNCTION IF NOT EXISTS f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello4, ', str, '!');
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+SELECT body FROM mysql.proc WHERE name like 'f1';
+body
+RETURN CONCAT('Hello, ', str, '!')
+CREATE OR REPLACE FUNCTION f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello5, ', str, '!');
+SELECT body FROM mysql.proc WHERE name like 'f1';
+body
+RETURN CONCAT('Hello5, ', str, '!')
+DROP FUNCTION f1;
+CREATE FUNCTION IF NOT EXISTS f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello6, ', str, '!');
+SELECT body FROM mysql.proc WHERE name like 'f1';
+body
+RETURN CONCAT('Hello6, ', str, '!')
+SELECT f1('world');
+f1('world')
+Hello6, world!
+DROP FUNCTION IF EXISTS f1;
+SELECT body FROM mysql.proc WHERE name like 'f1';
+body
+DROP FUNCTION IF EXISTS f1;
+Warnings:
+Note 1305 FUNCTION test.f1 does not exist
diff --git a/mysql-test/r/create_drop_index.result b/mysql-test/r/create_drop_index.result
new file mode 100644
index 00000000000..113c32aca4d
--- /dev/null
+++ b/mysql-test/r/create_drop_index.result
@@ -0,0 +1,44 @@
+CREATE TABLE t1(a INT, b INT);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `i1` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP INDEX IF EXISTS i1 ON t1;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP INDEX IF EXISTS i1 ON t1;
+Warnings:
+Note 1091 Can't DROP 'i1'; check that column/key exists
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE OR REPLACE INDEX i1 ON t1(a);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `i1` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE OR REPLACE INDEX i1 ON t1(a,b);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `i1` (`a`,`b`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE OR REPLACE INDEX IF NOT EXISTS i1 ON t1(b,a);
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
diff --git a/mysql-test/r/create_drop_procedure.result b/mysql-test/r/create_drop_procedure.result
new file mode 100644
index 00000000000..02c71ab6446
--- /dev/null
+++ b/mysql-test/r/create_drop_procedure.result
@@ -0,0 +1,47 @@
+CREATE TABLE t1 (id INT);
+CREATE PROCEDURE proc1 (OUT cnt INT) COMMENT 'comment1' BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+0
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+3
+CREATE PROCEDURE proc1 (OUT cnt INT) COMMENT 'comment2'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+ERROR 42000: PROCEDURE proc1 already exists
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+comment
+comment1
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) COMMENT 'comment3'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+Warnings:
+Note 1304 PROCEDURE proc1 already exists
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+comment
+comment1
+CREATE OR REPLACE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) COMMENT 'comment4'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+comment
+comment1
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) COMMENT 'comment5'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+comment
+comment5
+DROP PROCEDURE proc1;
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+6
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS proc1;
+DROP PROCEDURE IF EXISTS proc1;
+Warnings:
+Note 1305 PROCEDURE test.proc1 does not exist
diff --git a/mysql-test/r/create_drop_role.result b/mysql-test/r/create_drop_role.result
new file mode 100644
index 00000000000..6e05900264d
--- /dev/null
+++ b/mysql-test/r/create_drop_role.result
@@ -0,0 +1,75 @@
+CREATE ROLE IF NOT EXISTS role1 WITH ADMIN user1;
+Warnings:
+Note 1449 The user specified as a definer ('user1'@'%') does not exist
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+% user1 role1 Y
+DROP ROLE role1;
+CREATE OR REPLACE ROLE role1 WITH ADMIN user2;
+Warnings:
+Note 1449 The user specified as a definer ('user2'@'%') does not exist
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+Host User Role Admin_option
+% user2 role1 Y
+CREATE OR REPLACE ROLE role1 WITH ADMIN user3;
+Warnings:
+Note 1449 The user specified as a definer ('user3'@'%') does not exist
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+Host User Role Admin_option
+% user3 role1 Y
+CREATE ROLE IF NOT EXISTS role1 WITH ADMIN user4;
+Warnings:
+Note 1449 The user specified as a definer ('user4'@'%') does not exist
+Note 1975 Can't create role 'role1'; it already exists
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+Host User Role Admin_option
+% user3 role1 Y
+DROP ROLE IF EXISTS role1;
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+Host User Role Admin_option
+DROP ROLE IF EXISTS role1;
+Warnings:
+Note 1976 Can't drop role 'role1'; it doesn't exist
+CREATE ROLE role_1;
+CREATE ROLE IF NOT EXISTS role_1;
+Warnings:
+Note 1975 Can't create role 'role_1'; it already exists
+CREATE OR REPLACE ROLE role_1;
+CREATE OR REPLACE ROLE IF NOT EXISTS role_1;
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+CREATE ROLE role_1;
+ERROR HY000: Operation CREATE ROLE failed for 'role_1'
+CREATE USER u1@localhost;
+REVOKE SHOW DATABASES ON *.* FROM 'u1'@'localhost';
+GRANT SHOW DATABASES ON *.* TO role_1;
+GRANT role_1 TO u1@localhost;
+SELECT CURRENT_USER;
+CURRENT_USER
+u1@localhost
+SHOW DATABASES;
+Database
+information_schema
+test
+SELECT CURRENT_ROLE;
+CURRENT_ROLE
+NULL
+SET ROLE role_1;
+SELECT CURRENT_ROLE;
+CURRENT_ROLE
+role_1
+SHOW DATABASES;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+SET ROLE NONE;
+# Clearing up
+DROP ROLE role_1;
+DROP ROLE IF EXISTS role_1;
+Warnings:
+Note 1976 Can't drop role 'role_1'; it doesn't exist
+DROP ROLE role_1;
+ERROR HY000: Operation DROP ROLE failed for 'role_1'
+DROP USER u1@localhost;
diff --git a/mysql-test/r/create_drop_server.result b/mysql-test/r/create_drop_server.result
new file mode 100644
index 00000000000..5c3c15ff477
--- /dev/null
+++ b/mysql-test/r/create_drop_server.result
@@ -0,0 +1,37 @@
+#
+# MDEV-7285 SERVER: CREATE OR REPLACE and CREATE IF NOT EXISTS
+#
+CREATE SERVER IF NOT EXISTS server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user1', HOST 'localhost', DATABASE 'test0');
+SELECT server_name, username, db FROM mysql.servers;
+server_name username db
+server1 user1 test0
+CREATE SERVER IF NOT EXISTS server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user2', HOST 'localhost', DATABASE 'test1');
+Warnings:
+Note 1476 The foreign server, server1, you are trying to create already exists.
+SELECT server_name, username, db FROM mysql.servers;
+server_name username db
+server1 user1 test0
+CREATE OR REPLACE SERVER server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user3', HOST 'localhost', DATABASE 'test2');
+SELECT server_name, username, db FROM mysql.servers;
+server_name username db
+server1 user3 test2
+DROP SERVER IF EXISTS server1;
+SELECT server_name, username, db FROM mysql.servers;
+server_name username db
+DROP SERVER IF EXISTS server1;
+CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test0');
+CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test1');
+ERROR HY000: The foreign server, server_1, you are trying to create already exists.
+CREATE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
+Warnings:
+Note 1476 The foreign server, server_1, you are trying to create already exists.
+SELECT server_name, username, db FROM mysql.servers;
+server_name username db
+server_1 mysqltest_1 test0
+CREATE OR REPLACE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test3');
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+CREATE OR REPLACE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test4');
+SELECT server_name, username, db FROM mysql.servers;
+server_name username db
+server_1 mysqltest_1 test4
+DROP SERVER server_1;
diff --git a/mysql-test/r/create_drop_trigger.result b/mysql-test/r/create_drop_trigger.result
new file mode 100644
index 00000000000..a215838b0fd
--- /dev/null
+++ b/mysql-test/r/create_drop_trigger.result
@@ -0,0 +1,37 @@
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE t1 (val INT);
+CREATE TRIGGER IF NOT EXISTS val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val;
+SET @sum=0;
+INSERT INTO t1 VALUES (10), (20), (30);
+SELECT @sum;
+@sum
+60
+CREATE TRIGGER IF NOT EXISTS val_sum_new BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val;
+ERROR 42000: This version of MariaDB doesn't yet support 'multiple triggers with the same action time and event for one table'
+CREATE TRIGGER IF NOT EXISTS val_sum AFTER INSERT ON t1 FOR EACH ROW SET @sum = @sum + 1 + NEW.val;
+Warnings:
+Note 1359 Trigger already exists
+CREATE OR REPLACE TRIGGER IF NOT EXISTS val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + 2 + NEW.val;
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT
+SET @sum = @sum + NEW.val
+CREATE OR REPLACE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + 3 + NEW.val;
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT
+SET @sum = @sum + 3 + NEW.val
+CREATE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + 4 + NEW.val;
+ERROR HY000: Trigger already exists
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT
+SET @sum = @sum + 3 + NEW.val
+# Clearing up
+DROP TRIGGER IF EXISTS val_sum;
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT
+DROP TRIGGER IF EXISTS val_sum;
+Warnings:
+Note 1360 Trigger does not exist
+DROP TABLE t1;
+DROP DATABASE db1;
diff --git a/mysql-test/r/create_drop_udf.result b/mysql-test/r/create_drop_udf.result
new file mode 100644
index 00000000000..40da0b62a3a
--- /dev/null
+++ b/mysql-test/r/create_drop_udf.result
@@ -0,0 +1,38 @@
+CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+ret
+0
+CREATE FUNCTION metaphon RETURNS INT SONAME "$UDF_EXAMPLE_SO";
+ERROR HY000: Function 'metaphon' already exists
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+ret
+0
+CREATE FUNCTION IF NOT EXISTS metaphon RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
+Warnings:
+Note 1125 Function 'metaphon' already exists
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+ret
+0
+DROP FUNCTION IF EXISTS metaphon;
+CREATE FUNCTION IF NOT EXISTS metaphon RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+ret
+1
+CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+ret
+1
+CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+ret
+0
+CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+ERROR HY000: Function 'metaphon' already exists
+SELECT metaphon('mariadb');
+metaphon('mariadb')
+MRTB
+DROP FUNCTION metaphon;
+DROP FUNCTION IF EXISTS metaphon;
+Warnings:
+Note 1305 FUNCTION test.metaphon does not exist
diff --git a/mysql-test/r/create_drop_user.result b/mysql-test/r/create_drop_user.result
new file mode 100644
index 00000000000..dd75d1c257a
--- /dev/null
+++ b/mysql-test/r/create_drop_user.result
@@ -0,0 +1,43 @@
+CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw1';
+SELECT password FROM mysql.user WHERE user='u1';
+password
+*2B602296A79E0A8784ACC5C88D92E46588CCA3C3
+CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw2';
+Warnings:
+Note 1973 Can't create user 'u1'@'localhost'; it already exists
+SELECT password FROM mysql.user WHERE user='u1';
+password
+*2B602296A79E0A8784ACC5C88D92E46588CCA3C3
+CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'pw3';
+SELECT password FROM mysql.user WHERE user='u1';
+password
+*77B4A70CEFD76DB9415F36D291E74C110D2738E0
+CREATE OR REPLACE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw4';
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+SELECT password FROM mysql.user WHERE user='u1';
+password
+*77B4A70CEFD76DB9415F36D291E74C110D2738E0
+DROP USER IF EXISTS u1@localhost;
+DROP USER IF EXISTS u1@localhost;
+Warnings:
+Note 1974 Can't drop user 'u1'@'localhost'; it doesn't exist
+DROP USER u1@localhost;
+ERROR HY000: Operation DROP USER failed for 'u1'@'localhost'
+CREATE OR REPLACE USER u1@localhost;
+CREATE USER u1@localhost;
+ERROR HY000: Operation CREATE USER failed for 'u1'@'localhost'
+DROP USER u1@localhost;
+CREATE USER u1;
+CREATE USER u1, u2;
+ERROR HY000: Operation CREATE USER failed for 'u1'@'%'
+CREATE USER u2;
+ERROR HY000: Operation CREATE USER failed for 'u2'@'%'
+CREATE OR REPLACE USER u1 IDENTIFIED BY PASSWORD 'password', u2;
+ERROR HY000: Password hash should be a 41-digit hexadecimal number
+CREATE OR REPLACE USER u1 IDENTIFIED BY PASSWORD 'abcdefghijklmnop', u2;
+DROP USER u1;
+DROP USER IF EXISTS u1, u2;
+Warnings:
+Note 1974 Can't drop user 'u1'@'%'; it doesn't exist
+DROP USER u2;
+ERROR HY000: Operation DROP USER failed for 'u2'@'%'
diff --git a/mysql-test/r/create_drop_view.result b/mysql-test/r/create_drop_view.result
new file mode 100644
index 00000000000..a822c16ae3c
--- /dev/null
+++ b/mysql-test/r/create_drop_view.result
@@ -0,0 +1,59 @@
+CREATE TABLE t1(id INT);
+CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
+INSERT INTO t1 VALUES (5), (8), (10), (20), (30);
+SELECT * FROM t1;
+id
+5
+8
+10
+20
+30
+SELECT * FROM v1;
+id
+20
+30
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>11;
+ERROR 42S01: Table 'v1' already exists
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+VIEW_DEFINITION
+select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10)
+CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>12;
+Warnings:
+Note 1050 Table 'v1' already exists
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+VIEW_DEFINITION
+select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10)
+CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>13;
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+VIEW_DEFINITION
+select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10)
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE id>14;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+VIEW_DEFINITION
+select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 14)
+INSERT INTO t1 VALUES (50), (80), (3), (2), (40);
+SELECT * FROM t1;
+id
+5
+8
+10
+20
+30
+50
+80
+3
+2
+40
+SELECT * FROM v1;
+id
+20
+30
+50
+80
+40
+DROP VIEW IF EXISTS v1;
+DROP VIEW IF EXISTS v1;
+Warnings:
+Note 1051 Unknown table 'test.v1'
+DROP TABLE t1;
diff --git a/mysql-test/r/create_or_replace.result b/mysql-test/r/create_or_replace.result
index a43dc2eaca4..70b4b98b89c 100644
--- a/mysql-test/r/create_or_replace.result
+++ b/mysql-test/r/create_or_replace.result
@@ -6,8 +6,6 @@ INSERT INTO t2 VALUES(1),(2),(3);
#
CREATE OR REPLACE TABLE IF NOT EXISTS t1 (a int);
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
-create or replace trigger trg before insert on t1 for each row set @a:=1;
-ERROR HY000: Incorrect usage of OR REPLACE and TRIGGERS / SP / EVENT
create or replace table mysql.general_log (a int);
ERROR HY000: You cannot 'CREATE OR REPLACE' a log table if logging is enabled
create or replace table mysql.slow_log (a int);
@@ -103,7 +101,7 @@ CREATE OR REPLACE TABLE t1 AS SELECT 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `1` int(1) NOT NULL DEFAULT '0'
+ `1` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
create table t1 (a int);
@@ -144,7 +142,7 @@ CREATE OR REPLACE TABLE t1 AS SELECT 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `1` int(1) NOT NULL DEFAULT '0'
+ `1` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE OR REPLACE TABLE t1 (a int);
diff --git a/mysql-test/r/create_or_replace_permission.result b/mysql-test/r/create_or_replace_permission.result
new file mode 100644
index 00000000000..f662bf1bfd8
--- /dev/null
+++ b/mysql-test/r/create_or_replace_permission.result
@@ -0,0 +1,53 @@
+set local sql_mode="";
+set global sql_mode="";
+#
+# Tests for checking permission denied on CREATE OR REPLACE if DROP
+# access is revoked
+#
+# These statements do not need special tests for CREATE OR REPLACE,
+# because they do not have separate permissions for create and drop:
+# CREATE OR REPLACE EVENT (uses EVENT_ACL for both CREATE and DROP)
+# CREATE OR DROP SERVER (uses SUPER_ALC for both CREATE and DROP)
+# CREATE OR DROP TRIGGER (uses TRIGGER_ACL for both CREATE and DROP)
+SELECT CURRENT_USER;
+CURRENT_USER
+root@localhost
+CREATE DATABASE db1;
+GRANT ALL ON db1.* TO mysqltest_1@localhost;
+REVOKE DROP ON db1.* FROM mysqltest_1@localhost;
+REVOKE ALTER ROUTINE ON db1.* FROM mysqltest_1@localhost;
+GRANT DELETE ON mysql.* TO mysqltest_1@localhost;
+REVOKE DELETE ON mysql.* FROM mysqltest_1@localhost;
+FLUSH PRIVILEGES;
+SELECT CURRENT_USER;
+CURRENT_USER
+mysqltest_1@localhost
+CREATE DATABASE db1;
+ERROR HY000: Can't create database 'db1'; database exists
+CREATE OR REPLACE DATABASE db1;
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'db1'
+CREATE OR REPLACE DATABASE db2;
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'db2'
+USE db1;
+CREATE OR REPLACE TABLE t1(id INT);
+ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN END;
+ERROR 42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.proc1'
+CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
+CREATE OR REPLACE FUNCTION hello(str char(20)) RETURNS TEXT RETURN CONCAT('Hello, ', str, '!');
+ERROR 42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.hello'
+CREATE OR REPLACE USER u1@localhost;
+ERROR 42000: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
+CREATE OR REPLACE ROLE developer;
+ERROR 42000: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
+SELECT CURRENT_USER;
+CURRENT_USER
+root@localhost
+REVOKE ALL ON db1.* FROM mysqltest_1@localhost;
+DROP DATABASE IF EXISTS db2;
+Warnings:
+Note 1008 Can't drop database 'db2'; database doesn't exist
+DROP DATABASE db1;
+DROP USER mysqltest_1@localhost;
+set global sql_mode=default;
diff --git a/mysql-test/r/create_w_max_indexes_128.result b/mysql-test/r/create_w_max_indexes_128.result
new file mode 100644
index 00000000000..d11ed47c2f4
--- /dev/null
+++ b/mysql-test/r/create_w_max_indexes_128.result
@@ -0,0 +1,1250 @@
+create table t1 (
+c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
+c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
+key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a066_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a067_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a068_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a069_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a070_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a071_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a072_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a073_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a074_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a075_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a076_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a077_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a078_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a079_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a080_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a081_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a082_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a083_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a084_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a085_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a086_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a087_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a088_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a089_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a090_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a091_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a092_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a093_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a094_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a095_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a096_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a097_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a098_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a099_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a100_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a101_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a102_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a103_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a104_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a105_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a106_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a107_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a108_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a109_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a110_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a111_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a112_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a113_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a114_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a115_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a116_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a117_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a118_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a119_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a120_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a121_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a122_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a123_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a124_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a125_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a126_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a127_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a128_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
+);
+Warnings:
+Note 1831 Duplicate index 'a002_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a003_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a004_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a005_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a006_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a007_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a008_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a009_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a010_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a011_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a012_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a013_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a014_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a015_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a016_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a017_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a018_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a019_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a020_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a021_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a022_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a023_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a024_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a025_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a026_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a027_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a028_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a029_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a030_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a031_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a032_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a033_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a034_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a035_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a036_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a037_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a038_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a039_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a040_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a041_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a042_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a043_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a044_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a045_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a046_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a047_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a048_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a049_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a050_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a051_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a052_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a053_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a054_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a055_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a056_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a057_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a058_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a059_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a060_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a061_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a062_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a063_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a064_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a065_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a065_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a066_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a067_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a068_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a069_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a070_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a071_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a072_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a073_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a074_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a075_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a076_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a077_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a078_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a079_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a080_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a081_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a082_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a083_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a084_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a085_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a086_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a087_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a088_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a089_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a090_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a091_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a092_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a093_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a094_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a095_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a096_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a097_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a098_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a099_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a100_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a101_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a102_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a103_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a104_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a105_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a106_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a107_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a108_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a109_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a110_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a111_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a112_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a113_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a114_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a115_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a116_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a117_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a118_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a119_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a120_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a121_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a122_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a123_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a124_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a125_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a065_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a066_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a067_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a068_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a069_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a070_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a071_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a072_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a073_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a074_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a075_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a076_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a077_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a078_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a079_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a080_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a081_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a082_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a083_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a084_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a085_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a086_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a087_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a088_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a089_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a090_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a091_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a092_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a093_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a094_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a095_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a096_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a097_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a098_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a099_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a100_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a101_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a102_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a103_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a104_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a105_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a106_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a107_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a108_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a109_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a110_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a111_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a112_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a113_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a114_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a115_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a116_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a117_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a118_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a119_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a120_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a121_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a122_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a123_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a124_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a125_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
+alter table t1
+add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a066_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a067_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a068_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a069_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a070_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a071_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a072_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a073_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a074_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a075_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a076_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a077_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a078_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a079_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a080_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a081_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a082_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a083_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a084_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a085_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a086_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a087_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a088_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a089_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a090_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a091_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a092_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a093_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a094_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a095_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a096_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a097_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a098_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a099_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a100_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a101_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a102_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a103_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a104_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a105_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a106_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a107_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a108_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a109_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a110_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a111_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a112_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a113_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a114_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a115_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a116_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a117_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a118_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a119_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a120_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a121_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a122_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a123_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a124_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a125_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a126_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a127_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a128_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+Warnings:
+Note 1831 Duplicate index 'a002_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a003_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a004_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a005_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a006_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a007_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a008_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a009_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a010_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a011_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a012_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a013_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a014_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a015_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a016_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a017_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a018_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a019_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a020_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a021_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a022_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a023_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a024_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a025_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a026_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a027_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a028_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a029_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a030_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a031_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a032_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a033_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a034_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a035_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a036_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a037_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a038_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a039_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a040_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a041_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a042_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a043_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a044_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a045_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a046_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a047_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a048_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a049_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a050_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a051_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a052_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a053_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a054_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a055_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a056_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a057_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a058_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a059_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a060_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a061_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a062_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a063_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a064_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index 'a065_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a065_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a066_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a067_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a068_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a069_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a070_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a071_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a072_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a073_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a074_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a075_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a076_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a077_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a078_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a079_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a080_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a081_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a082_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a083_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a084_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a085_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a086_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a087_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a088_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a089_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a090_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a091_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a092_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a093_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a094_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a095_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a096_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a097_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a098_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a099_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a100_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a101_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a102_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a103_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a104_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a105_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a106_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a107_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a108_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a109_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a110_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a111_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a112_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a113_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a114_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a115_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a116_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a117_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a118_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a119_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a120_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a121_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a122_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a123_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a124_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a125_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a065_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a066_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a067_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a068_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a069_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a070_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a071_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a072_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a073_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a074_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a075_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a076_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a077_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a078_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a079_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a080_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a081_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a082_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a083_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a084_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a085_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a086_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a087_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a088_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a089_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a090_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a091_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a092_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a093_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a094_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a095_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a096_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a097_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a098_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a099_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a100_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a101_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a102_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a103_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a104_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a105_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a106_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a107_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a108_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a109_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a110_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a111_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a112_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a113_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a114_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a115_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a116_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a117_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a118_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a119_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a120_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a121_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a122_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a123_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a124_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a125_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t1 add key
+a129_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+ERROR 42000: Too many keys specified; max 128 keys allowed
+drop table t1;
+"End of tests"
diff --git a/mysql-test/r/create_w_max_indexes_64.result b/mysql-test/r/create_w_max_indexes_64.result
new file mode 100644
index 00000000000..0762db3d0b1
--- /dev/null
+++ b/mysql-test/r/create_w_max_indexes_64.result
@@ -0,0 +1,783 @@
+create table t1 (
+c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
+c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
+key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
+);
+Warnings:
+Note 1831 Duplicate index `a002_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a003_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a004_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a005_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a006_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a007_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a008_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a009_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a010_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a011_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a012_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a013_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a014_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a015_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a016_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a017_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a018_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a019_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a020_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a021_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a022_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a023_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a024_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a025_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a026_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a027_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a028_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a029_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a030_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a031_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a032_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a033_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a034_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a035_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a036_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a037_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a038_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a039_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a040_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a041_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a042_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a043_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a044_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a045_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a046_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a047_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a048_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a049_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a050_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a051_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a052_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a053_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a054_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a055_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a056_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a057_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a058_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a059_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a060_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a061_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a062_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a063_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a064_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
+alter table t1
+add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+Warnings:
+Note 1831 Duplicate index `a002_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a003_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a004_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a005_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a006_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a007_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a008_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a009_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a010_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a011_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a012_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a013_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a014_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a015_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a016_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a017_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a018_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a019_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a020_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a021_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a022_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a023_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a024_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a025_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a026_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a027_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a028_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a029_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a030_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a031_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a032_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a033_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a034_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a035_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a036_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a037_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a038_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a039_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a040_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a041_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a042_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a043_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a044_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a045_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a046_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a047_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a048_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a049_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a050_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a051_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a052_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a053_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a054_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a055_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a056_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a057_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a058_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a059_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a060_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a061_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a062_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a063_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a064_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release.
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t1 add key
+a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+ERROR 42000: Too many keys specified; max 64 keys allowed
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int,
+c16 int, c17 int, c18 int,c19 int,c20 int,c21 int,c22 int,c23 int,c24 int,c25 int,c26 int,c27 int,c28 int,c29 int,c30 int,c31 int,c32 int, c33 int);
+alter table t1 add key i1 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16, c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31,c32,c33);
+ERROR 42000: Too many key parts specified; max 32 parts allowed
+alter table t1 add key
+a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
+ERROR 42000: Identifier name 'a001_long_123456789_123456789_123456789_123456789_123456789_12345' is too long
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ `c17` int(11) DEFAULT NULL,
+ `c18` int(11) DEFAULT NULL,
+ `c19` int(11) DEFAULT NULL,
+ `c20` int(11) DEFAULT NULL,
+ `c21` int(11) DEFAULT NULL,
+ `c22` int(11) DEFAULT NULL,
+ `c23` int(11) DEFAULT NULL,
+ `c24` int(11) DEFAULT NULL,
+ `c25` int(11) DEFAULT NULL,
+ `c26` int(11) DEFAULT NULL,
+ `c27` int(11) DEFAULT NULL,
+ `c28` int(11) DEFAULT NULL,
+ `c29` int(11) DEFAULT NULL,
+ `c30` int(11) DEFAULT NULL,
+ `c31` int(11) DEFAULT NULL,
+ `c32` int(11) DEFAULT NULL,
+ `c33` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+"End of tests"
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 175bbf0f09f..f97d060d26a 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -224,9 +224,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -439,9 +451,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -487,6 +511,8 @@ drop table t1;
select hex(convert(_big5 0xC84041 using ucs2));
hex(convert(_big5 0xC84041 using ucs2))
003F0041
+Warnings:
+Warning 1977 Cannot convert 'big5' character 0xC840 to 'ucs2'
End of 4.1 tests
set names big5;
create table t1 (a blob);
@@ -526,7 +552,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`code` varchar(8) DEFAULT NULL,
- `a` varchar(1) CHARACTER SET big5 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET big5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -597,7 +623,7 @@ Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
COUNT(*)
13973
SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
@@ -762,6 +788,71 @@ A2BF â…¦
A2C0 â…§
A2C1 â…¨
A2C2 â…©
+Warnings:
+Warning 1977 Cannot convert 'big5' character 0xA3C0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CF to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CF to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DF to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DF to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
@@ -776,6 +867,71 @@ C7D8 п
C7D9 р
C7DA Ñ
C7DB Ñ‚
+Warnings:
+Warning 1977 Cannot convert 'big5' character 0xA3C0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3C9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CF to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3CF to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D0 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D1 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D2 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D3 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D4 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D5 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D6 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D7 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D8 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3D9 to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DA to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DB to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DC to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DD to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DE to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DF to 'utf8'
+Warning 1977 Cannot convert 'big5' character 0xA3DF to 'utf8'
DROP TABLE t1;
#
# End of 5.5 tests
@@ -794,7 +950,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET big5 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET big5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -814,7 +970,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET big5 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET big5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1053,7 +1209,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET big5 COLLATE big5_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET big5 COLLATE big5_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1073,7 +1229,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET big5 COLLATE big5_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET big5 COLLATE big5_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4416,7 +4572,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET big5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\'),('à\t');
INSERT INTO t1 VALUES ('\\à\'),('\\à\t'),('\\à\t\t');
@@ -4455,7 +4611,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET big5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('à\')),(BINARY('à\t'));
INSERT INTO t1 VALUES (BINARY('\\à\')),(BINARY('\\à\t')),(BINARY('\\à\t\t'));
@@ -4494,7 +4650,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET big5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'à\'),(_BINARY'à\t');
INSERT INTO t1 VALUES (_BINARY'\\à\'),(_BINARY'\\à\t'),(_BINARY'\\à\t\t');
@@ -4540,7 +4696,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET big5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
@@ -4560,7 +4716,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varbinary(10) NOT NULL DEFAULT ''
+ `a` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result
index 48b481883ca..512368a2d26 100644
--- a/mysql-test/r/ctype_binary.result
+++ b/mysql-test/r/ctype_binary.result
@@ -13,7 +13,7 @@ create table t1 as select concat(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -26,7 +26,7 @@ create table t1 as select concat(18446744073709551615) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(20) NOT NULL DEFAULT ''
+ `c1` varbinary(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -39,7 +39,7 @@ create table t1 as select concat(1.1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) NOT NULL DEFAULT ''
+ `c1` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -52,7 +52,7 @@ create table t1 as select concat(1+2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1-2));
@@ -62,7 +62,7 @@ create table t1 as select concat(1-2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1*2));
@@ -72,7 +72,7 @@ create table t1 as select concat(1*2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1/2));
@@ -112,7 +112,7 @@ create table t1 as select concat(-1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(-(1+2)));
@@ -122,7 +122,7 @@ create table t1 as select concat(-(1+2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) NOT NULL DEFAULT ''
+ `c1` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1|2));
@@ -132,7 +132,7 @@ create table t1 as select concat(1|2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1&2));
@@ -142,7 +142,7 @@ create table t1 as select concat(1&2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_count(12)));
@@ -152,7 +152,7 @@ create table t1 as select concat(bit_count(12)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2<<1));
@@ -162,7 +162,7 @@ create table t1 as select concat(2<<1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2>>1));
@@ -172,7 +172,7 @@ create table t1 as select concat(2>>1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(~0));
@@ -182,7 +182,7 @@ create table t1 as select concat(~0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(3^2));
@@ -192,7 +192,7 @@ create table t1 as select concat(3^2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(abs(-2)));
@@ -202,7 +202,7 @@ create table t1 as select concat(abs(-2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(concat(exp(2)),1));
@@ -332,7 +332,7 @@ create table t1 as select concat(degrees(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(23) NOT NULL DEFAULT ''
+ `c1` varbinary(23) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(radians(0)));
@@ -342,7 +342,7 @@ create table t1 as select concat(radians(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(23) NOT NULL DEFAULT ''
+ `c1` varbinary(23) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ceiling(0.5)));
@@ -352,7 +352,7 @@ create table t1 as select concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) NOT NULL DEFAULT ''
+ `c1` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
@@ -362,7 +362,7 @@ create table t1 as select concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) NOT NULL DEFAULT ''
+ `c1` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
@@ -372,7 +372,7 @@ create table t1 as select concat(round(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sign(0.5)));
@@ -382,14 +382,14 @@ create table t1 as select concat(sign(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(rand()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(23) NOT NULL DEFAULT ''
+ `c1` varbinary(23) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(length('a')));
@@ -399,7 +399,7 @@ create table t1 as select concat(length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(char_length('a')));
@@ -409,7 +409,7 @@ create table t1 as select concat(char_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_length('a')));
@@ -419,7 +419,7 @@ create table t1 as select concat(bit_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coercibility('a')));
@@ -429,7 +429,7 @@ create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(locate('a','a')));
@@ -439,7 +439,7 @@ create table t1 as select concat(locate('a','a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(11) NOT NULL DEFAULT ''
+ `c1` varbinary(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(field('c','a','b','c')));
@@ -449,7 +449,7 @@ create table t1 as select concat(field('c','a','b','c')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ascii(61)));
@@ -459,7 +459,7 @@ create table t1 as select concat(ascii(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ord(61)));
@@ -469,7 +469,7 @@ create table t1 as select concat(ord(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(find_in_set('b','a,b,c,d')));
@@ -479,7 +479,7 @@ create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select md5('a'), hex(md5('a'));
@@ -489,7 +489,7 @@ create table t1 as select md5('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(32) NOT NULL DEFAULT ''
+ `c1` varbinary(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select old_password('a'), hex(old_password('a'));
@@ -499,7 +499,7 @@ create table t1 as select old_password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(16) NOT NULL DEFAULT ''
+ `c1` varbinary(16) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select password('a'), hex(password('a'));
@@ -509,7 +509,7 @@ create table t1 as select password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(41) NOT NULL DEFAULT ''
+ `c1` varbinary(41) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha('a'), hex(sha('a'));
@@ -519,7 +519,7 @@ create table t1 as select sha('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(40) NOT NULL DEFAULT ''
+ `c1` varbinary(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha1('a'), hex(sha1('a'));
@@ -529,7 +529,7 @@ create table t1 as select sha1('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(40) NOT NULL DEFAULT ''
+ `c1` varbinary(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('-1' as signed)));
@@ -539,7 +539,7 @@ create table t1 as select concat(cast('-1' as signed)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('1' as unsigned)));
@@ -549,7 +549,7 @@ create table t1 as select concat(cast('1' as unsigned)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast(1/2 as decimal(5,5))));
@@ -608,7 +608,7 @@ create table t1 as select concat(least(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(greatest(1,2)));
@@ -618,7 +618,7 @@ create table t1 as select concat(greatest(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(case when 11 then 22 else 33 end));
@@ -628,7 +628,7 @@ create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coalesce(1,2)));
@@ -638,7 +638,7 @@ create table t1 as select concat(coalesce(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat_ws(1,2,3));
@@ -648,7 +648,7 @@ create table t1 as select concat_ws(1,2,3) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(group_concat(1,2,3));
@@ -676,7 +676,7 @@ create table t1 as select concat(last_insert_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(benchmark(0,0)));
@@ -686,7 +686,7 @@ create table t1 as select concat(benchmark(0,0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sleep(0)));
@@ -696,7 +696,7 @@ create table t1 as select concat(sleep(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(is_free_lock('xxxx')));
@@ -730,7 +730,7 @@ create table t1 as select concat(crc32('')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(uncompressed_length('')));
@@ -747,7 +747,7 @@ create table t1 as select concat(connection_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(inet_aton('127.1.1.1')));
@@ -783,7 +783,7 @@ create table t1 as select concat(row_count()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(found_rows()));
@@ -793,21 +793,21 @@ create table t1 as select concat(found_rows()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid_short()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) NOT NULL DEFAULT ''
+ `c1` varbinary(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
@@ -820,7 +820,7 @@ create table t1 as select concat(uuid(), cast('a' as char character set latin1))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(37) NOT NULL DEFAULT ''
+ `c1` varchar(37) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
@@ -840,8 +840,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT '',
- `c2` int(1) NOT NULL DEFAULT '0'
+ `c1` varbinary(1) NOT NULL,
+ `c2` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1;
@@ -898,8 +898,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) NOT NULL DEFAULT '',
- `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `c1` varbinary(4) NOT NULL,
+ `c2` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1.1;
@@ -937,7 +937,7 @@ create table t1 as select concat('a'='a' IS TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a'='a' IS NOT TRUE));
@@ -947,7 +947,7 @@ create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(NOT 'a'='a'));
@@ -957,7 +957,7 @@ create table t1 as select concat(NOT 'a'='a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NULL));
@@ -967,7 +967,7 @@ create table t1 as select concat('a' IS NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NOT NULL));
@@ -977,7 +977,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' rlike 'a'));
@@ -987,7 +987,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(strcmp('a','b')));
@@ -997,7 +997,7 @@ create table t1 as select concat(strcmp('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' like 'a'));
@@ -1007,7 +1007,7 @@ create table t1 as select concat('a' like 'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' between 'b' and 'c'));
@@ -1017,7 +1017,7 @@ create table t1 as select concat('a' between 'b' and 'c') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' in ('a','b')));
@@ -1027,7 +1027,7 @@ create table t1 as select concat('a' in ('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
@@ -1037,7 +1037,7 @@ create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(10), fulltext key(a));
@@ -1059,7 +1059,7 @@ create table t1 as select ifnull(1,'a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1,1)));
@@ -1069,7 +1069,7 @@ create table t1 as select concat(ifnull(1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1.1,1.1)));
@@ -1079,7 +1079,7 @@ create table t1 as select concat(ifnull(1.1,1.1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) NOT NULL DEFAULT ''
+ `c1` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,'b',1));
@@ -1089,7 +1089,7 @@ create table t1 as select if(1,'b',1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,1,'b'));
@@ -1099,7 +1099,7 @@ create table t1 as select if(1,1,'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(if(1,1,1)));
@@ -1109,7 +1109,7 @@ create table t1 as select concat(if(1,1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(nullif(1,2)));
@@ -1189,7 +1189,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) DEFAULT NULL
+ `c1` varbinary(2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -1199,7 +1199,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(21) DEFAULT NULL
+ `c1` varbinary(2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
@@ -1274,7 +1274,7 @@ create table t1 as select concat(period_add(200902, 2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(6) NOT NULL DEFAULT ''
+ `c1` varbinary(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(period_diff(200902, 200802)));
@@ -1286,7 +1286,7 @@ Warning 1265 Data truncated for column 'c1' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(6) NOT NULL DEFAULT ''
+ `c1` varbinary(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(to_days(20090224)));
@@ -1483,21 +1483,21 @@ create table t1 as select concat(curdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_date()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(curtime()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat('a',20) as c1 limit 0;
@@ -1513,7 +1513,7 @@ create table t1 as select concat(utc_time()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sec_to_time(2378)));
@@ -1606,21 +1606,21 @@ create table t1 as select concat(now()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(19) NOT NULL DEFAULT ''
+ `c1` varbinary(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_timestamp()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(19) NOT NULL DEFAULT ''
+ `c1` varbinary(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(sysdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(19) NOT NULL DEFAULT ''
+ `c1` varbinary(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(addtime('00:00:00','11:22:33')));
@@ -1660,7 +1660,7 @@ create table t1 as select export_set(1,2,3,4,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(127) NOT NULL DEFAULT ''
+ `c1` varbinary(127) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(insert(1133,3,0,22));
@@ -1670,7 +1670,7 @@ create table t1 as select insert(1133,3,0,22) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(6) NOT NULL DEFAULT ''
+ `c1` varbinary(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lcase(123));
@@ -1680,7 +1680,7 @@ create table t1 as select lcase(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(123,1));
@@ -1690,7 +1690,7 @@ create table t1 as select left(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lower(123));
@@ -1700,7 +1700,7 @@ create table t1 as select lower(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(3) NOT NULL DEFAULT ''
+ `c1` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lpad(1,2,0));
@@ -1710,7 +1710,7 @@ create table t1 as select lpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ltrim(1));
@@ -1720,7 +1720,7 @@ create table t1 as select ltrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(mid(1,1,1));
@@ -1730,7 +1730,7 @@ create table t1 as select mid(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(repeat(1,2));
@@ -1740,7 +1740,7 @@ create table t1 as select repeat(1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(replace(1,1,2));
@@ -1750,7 +1750,7 @@ create table t1 as select replace(1,1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(reverse(12));
@@ -1760,7 +1760,7 @@ create table t1 as select reverse(12) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(right(123,1));
@@ -1770,7 +1770,7 @@ create table t1 as select right(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rpad(1,2,0));
@@ -1780,7 +1780,7 @@ create table t1 as select rpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(2) NOT NULL DEFAULT ''
+ `c1` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rtrim(1));
@@ -1790,7 +1790,7 @@ create table t1 as select rtrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(soundex(1));
@@ -1800,7 +1800,7 @@ create table t1 as select soundex(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) NOT NULL DEFAULT ''
+ `c1` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(substring(1,1,1));
@@ -1810,7 +1810,7 @@ create table t1 as select substring(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(trim(1));
@@ -1820,7 +1820,7 @@ create table t1 as select trim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ucase(1));
@@ -1830,7 +1830,7 @@ create table t1 as select ucase(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(upper(1));
@@ -1840,14 +1840,14 @@ create table t1 as select upper(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(1) NOT NULL DEFAULT ''
+ `c1` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat(' ', 64) as a limit 0;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varbinary(64) NOT NULL DEFAULT ''
+ `a` varbinary(64) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ("1.1"), ("2.1");
select a, hex(a) from t1;
@@ -2076,7 +2076,7 @@ t2 CREATE TABLE `t2` (
`concat(a)` varbinary(64) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -2097,7 +2097,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varbinary(19) NOT NULL DEFAULT ''
+ `concat(a)` varbinary(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a date);
@@ -2388,7 +2388,7 @@ hex(a)
0000000000000001
drop table t1;
drop view v1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -2637,7 +2637,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`CONCAT(a)` varbinary(9) DEFAULT NULL,
- `IFNULL(a,'')` varbinary(9) NOT NULL DEFAULT '',
+ `IFNULL(a,'')` varbinary(9) NOT NULL,
`IF(a,a,'')` varbinary(9) DEFAULT NULL,
`CASE WHEN a THEN a ELSE '' END` varbinary(9) DEFAULT NULL,
`COALESCE(a,'')` varbinary(9) DEFAULT NULL
@@ -2647,14 +2647,14 @@ CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `CONCAT_WS(1,2,3)` varbinary(3) NOT NULL DEFAULT ''
+ `CONCAT_WS(1,2,3)` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `INSERT(1133,3,0,22)` varbinary(6) NOT NULL DEFAULT ''
+ `INSERT(1133,3,0,22)` varbinary(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LCASE(a) FROM t1;
@@ -2675,35 +2675,35 @@ CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPEAT(1,2)` varbinary(2) NOT NULL DEFAULT ''
+ `REPEAT(1,2)` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LEFT(123,2)` varbinary(2) NOT NULL DEFAULT ''
+ `LEFT(123,2)` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RIGHT(123,2)` varbinary(2) NOT NULL DEFAULT ''
+ `RIGHT(123,2)` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LTRIM(123)` varbinary(3) NOT NULL DEFAULT ''
+ `LTRIM(123)` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RTRIM(123)` varbinary(3) NOT NULL DEFAULT ''
+ `RTRIM(123)` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1;
@@ -2717,35 +2717,35 @@ CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPLACE(111,2,3)` varbinary(3) NOT NULL DEFAULT ''
+ `REPLACE(111,2,3)` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SUBSTRING_INDEX(111,111,1)` varbinary(3) NOT NULL DEFAULT ''
+ `SUBSTRING_INDEX(111,111,1)` varbinary(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `MAKE_SET(111,222,3)` varbinary(5) NOT NULL DEFAULT ''
+ `MAKE_SET(111,222,3)` varbinary(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SOUNDEX(1)` varbinary(4) NOT NULL DEFAULT ''
+ `SOUNDEX(1)` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8);
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `EXPORT_SET(1,'Y','N','',8)` varbinary(64) NOT NULL DEFAULT ''
+ `EXPORT_SET(1,'Y','N','',8)` varbinary(64) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
@@ -2769,7 +2769,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
+1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
@@ -2909,7 +2909,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`d` date DEFAULT NULL,
- `bad` varbinary(10) DEFAULT NULL
+ `bad` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET NAMES latin1;
@@ -2935,7 +2935,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -2956,7 +2956,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -2977,7 +2977,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -2998,7 +2998,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -3017,6 +3017,31 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ('%' = concat(`test`.`t1`.`c1`))
DROP TABLE t1;
#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varbinary(10) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
+#
# MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
#
SELECT _binary 0x7E, _binary X'7E', _binary B'01111110';
@@ -3025,3 +3050,103 @@ _binary 0x7E _binary X'7E' _binary B'01111110'
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
+#
+CREATE TABLE t1 (a VARBINARY(10));
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE CRC32(a)=3904355907;
+a LENGTH(a) CRC32(a)
+a 1 3904355907
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+a LENGTH(a) CRC32(a)
+a 1 3904355907
+# Okey to propagate 'a' into CRC32(a)
+EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61';
+a HEX(a)
+a 61
+SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+a HEX(a)
+a 61
+# Okey to propagate 'a' into HEX(a)
+EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+SELECT * FROM t1 WHERE a='a';
+a
+a
+SELECT * FROM t1 WHERE LENGTH(a)=2;
+a
+a
+SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+a
+# Okey to propagate 'a' into LENGTH(a)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+SELECT * FROM t1 WHERE a='a ';
+a
+a
+SELECT * FROM t1 WHERE a='a ' AND LENGTH(a)=2;
+a
+a
+# Okey to propagate 'a ' into LENGTH(a)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a ' AND LENGTH(a)=2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a ')
+DROP TABLE t1;
+#
+# MDEV-8723 Wrong result for SELECT..WHERE COLLATION(a)='binary' AND a='a'
+#
+CREATE TABLE t1 (a VARBINARY(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE COLLATION(a)='binary' AND a='a';
+a
+a
+SELECT * FROM t1 WHERE CHARSET(a)='binary' AND a='a';
+a
+a
+SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
+a
+a
+SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
+a
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COLLATION(a)='binary' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE CHARSET(a)='binary' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (weight_string(`test`.`t1`.`a`) = 'a'))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index 6cb1876c3ad..f84613e086f 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -649,7 +649,7 @@ select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f1` varchar(1) CHARACTER SET latin5 NOT NULL DEFAULT ''
+ `f1` varchar(1) CHARACTER SET latin5 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result
index 063cec289ab..f2eeb4dda79 100644
--- a/mysql-test/r/ctype_cp1250_ch.result
+++ b/mysql-test/r/ctype_cp1250_ch.result
@@ -105,6 +105,126 @@ SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
SET character_set_client= @safe_character_set_client;
SET character_set_results= @safe_character_set_results;
+#
+# MDEV-7149 Constant condition propagation erroneously applied for LIKE
+#
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE CONCAT(c1)='a';
+c1
+a
+a
+SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
+c1
+a
+SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a '))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
+c1
+a
+a
+SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
+c1
+a
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '% '=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '%'=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a'))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
SET @test_character_set= 'cp1250';
SET @test_collation= 'cp1250_czech_cs';
SET @safe_character_set_server= @@character_set_server;
@@ -351,7 +471,7 @@ a
DROP TABLE t1;
set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators)
using cp1250);
-ERROR HY000: Unknown locale: '1'
+ERROR HY000: Unknown locale: 'ON'
#
# Start of 5.6 tests
#
@@ -370,7 +490,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -390,7 +510,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result
index 9d5dea2f286..09344a50ee9 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -385,6 +385,8 @@ FC FC FC D18C FC
FD FD FD D18D FD
FE FE FE D18E FE
FF FF FF D18F FF
+Warnings:
+Warning 1977 Cannot convert 'cp1251' character 0x98 to 'utf8'
DROP TABLE t1;
set global LC_TIME_NAMES=convert((-8388608) using cp1251);
ERROR HY000: Unknown locale: '-8388608'
@@ -405,7 +407,7 @@ create table t1 as select concat(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -418,7 +420,7 @@ create table t1 as select concat(18446744073709551615) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(20) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(20) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -431,7 +433,7 @@ create table t1 as select concat(1.1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -444,7 +446,7 @@ create table t1 as select concat(1+2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1-2));
@@ -454,7 +456,7 @@ create table t1 as select concat(1-2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1*2));
@@ -464,7 +466,7 @@ create table t1 as select concat(1*2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1/2));
@@ -504,7 +506,7 @@ create table t1 as select concat(-1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(-(1+2)));
@@ -514,7 +516,7 @@ create table t1 as select concat(-(1+2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1|2));
@@ -524,7 +526,7 @@ create table t1 as select concat(1|2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1&2));
@@ -534,7 +536,7 @@ create table t1 as select concat(1&2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_count(12)));
@@ -544,7 +546,7 @@ create table t1 as select concat(bit_count(12)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2<<1));
@@ -554,7 +556,7 @@ create table t1 as select concat(2<<1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2>>1));
@@ -564,7 +566,7 @@ create table t1 as select concat(2>>1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(~0));
@@ -574,7 +576,7 @@ create table t1 as select concat(~0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(3^2));
@@ -584,7 +586,7 @@ create table t1 as select concat(3^2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(abs(-2)));
@@ -594,7 +596,7 @@ create table t1 as select concat(abs(-2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(concat(exp(2)),1));
@@ -724,7 +726,7 @@ create table t1 as select concat(degrees(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(radians(0)));
@@ -734,7 +736,7 @@ create table t1 as select concat(radians(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ceiling(0.5)));
@@ -744,7 +746,7 @@ create table t1 as select concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
@@ -754,7 +756,7 @@ create table t1 as select concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
@@ -764,7 +766,7 @@ create table t1 as select concat(round(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sign(0.5)));
@@ -774,14 +776,14 @@ create table t1 as select concat(sign(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(rand()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(length('a')));
@@ -791,7 +793,7 @@ create table t1 as select concat(length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(char_length('a')));
@@ -801,7 +803,7 @@ create table t1 as select concat(char_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_length('a')));
@@ -811,7 +813,7 @@ create table t1 as select concat(bit_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coercibility('a')));
@@ -821,7 +823,7 @@ create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(locate('a','a')));
@@ -831,7 +833,7 @@ create table t1 as select concat(locate('a','a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(11) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(11) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(field('c','a','b','c')));
@@ -841,7 +843,7 @@ create table t1 as select concat(field('c','a','b','c')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ascii(61)));
@@ -851,7 +853,7 @@ create table t1 as select concat(ascii(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ord(61)));
@@ -861,7 +863,7 @@ create table t1 as select concat(ord(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(find_in_set('b','a,b,c,d')));
@@ -871,7 +873,7 @@ create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select md5('a'), hex(md5('a'));
@@ -881,7 +883,7 @@ create table t1 as select md5('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(32) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(32) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select old_password('a'), hex(old_password('a'));
@@ -891,7 +893,7 @@ create table t1 as select old_password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(16) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(16) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select password('a'), hex(password('a'));
@@ -901,7 +903,7 @@ create table t1 as select password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(41) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(41) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha('a'), hex(sha('a'));
@@ -911,7 +913,7 @@ create table t1 as select sha('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(40) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha1('a'), hex(sha1('a'));
@@ -921,7 +923,7 @@ create table t1 as select sha1('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(40) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('-1' as signed)));
@@ -931,7 +933,7 @@ create table t1 as select concat(cast('-1' as signed)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('1' as unsigned)));
@@ -941,7 +943,7 @@ create table t1 as select concat(cast('1' as unsigned)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast(1/2 as decimal(5,5))));
@@ -1000,7 +1002,7 @@ create table t1 as select concat(least(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(greatest(1,2)));
@@ -1010,7 +1012,7 @@ create table t1 as select concat(greatest(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(case when 11 then 22 else 33 end));
@@ -1020,7 +1022,7 @@ create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coalesce(1,2)));
@@ -1030,7 +1032,7 @@ create table t1 as select concat(coalesce(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat_ws(1,2,3));
@@ -1040,7 +1042,7 @@ create table t1 as select concat_ws(1,2,3) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(group_concat(1,2,3));
@@ -1068,7 +1070,7 @@ create table t1 as select concat(last_insert_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(benchmark(0,0)));
@@ -1078,7 +1080,7 @@ create table t1 as select concat(benchmark(0,0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sleep(0)));
@@ -1088,7 +1090,7 @@ create table t1 as select concat(sleep(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(is_free_lock('xxxx')));
@@ -1122,7 +1124,7 @@ create table t1 as select concat(crc32('')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(uncompressed_length('')));
@@ -1139,7 +1141,7 @@ create table t1 as select concat(connection_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(inet_aton('127.1.1.1')));
@@ -1175,7 +1177,7 @@ create table t1 as select concat(row_count()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(found_rows()));
@@ -1185,21 +1187,21 @@ create table t1 as select concat(found_rows()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid_short()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
@@ -1212,7 +1214,7 @@ create table t1 as select concat(uuid(), cast('a' as char character set latin1))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(37) NOT NULL DEFAULT ''
+ `c1` varchar(37) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
@@ -1232,8 +1234,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '',
- `c2` int(1) NOT NULL DEFAULT '0'
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL,
+ `c2` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1;
@@ -1290,8 +1292,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '',
- `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL,
+ `c2` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1.1;
@@ -1329,7 +1331,7 @@ create table t1 as select concat('a'='a' IS TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a'='a' IS NOT TRUE));
@@ -1339,7 +1341,7 @@ create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(NOT 'a'='a'));
@@ -1349,7 +1351,7 @@ create table t1 as select concat(NOT 'a'='a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NULL));
@@ -1359,7 +1361,7 @@ create table t1 as select concat('a' IS NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NOT NULL));
@@ -1369,7 +1371,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' rlike 'a'));
@@ -1379,7 +1381,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(strcmp('a','b')));
@@ -1389,7 +1391,7 @@ create table t1 as select concat(strcmp('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' like 'a'));
@@ -1399,7 +1401,7 @@ create table t1 as select concat('a' like 'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' between 'b' and 'c'));
@@ -1409,7 +1411,7 @@ create table t1 as select concat('a' between 'b' and 'c') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' in ('a','b')));
@@ -1419,7 +1421,7 @@ create table t1 as select concat('a' in ('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
@@ -1429,7 +1431,7 @@ create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(10), fulltext key(a));
@@ -1451,7 +1453,7 @@ create table t1 as select ifnull(1,'a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1,1)));
@@ -1461,7 +1463,7 @@ create table t1 as select concat(ifnull(1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1.1,1.1)));
@@ -1471,7 +1473,7 @@ create table t1 as select concat(ifnull(1.1,1.1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,'b',1));
@@ -1481,7 +1483,7 @@ create table t1 as select if(1,'b',1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,1,'b'));
@@ -1491,7 +1493,7 @@ create table t1 as select if(1,1,'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(if(1,1,1)));
@@ -1501,7 +1503,7 @@ create table t1 as select concat(if(1,1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(nullif(1,2)));
@@ -1581,7 +1583,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -1591,7 +1593,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
+ `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
@@ -1666,7 +1668,7 @@ create table t1 as select concat(period_add(200902, 2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(period_diff(200902, 200802)));
@@ -1678,7 +1680,7 @@ Warning 1265 Data truncated for column 'c1' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(to_days(20090224)));
@@ -1875,21 +1877,21 @@ create table t1 as select concat(curdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_date()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(curtime()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat('a',20) as c1 limit 0;
@@ -1905,7 +1907,7 @@ create table t1 as select concat(utc_time()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sec_to_time(2378)));
@@ -1998,21 +2000,21 @@ create table t1 as select concat(now()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_timestamp()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(sysdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(addtime('00:00:00','11:22:33')));
@@ -2052,7 +2054,7 @@ create table t1 as select export_set(1,2,3,4,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(127) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(127) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(insert(1133,3,0,22));
@@ -2062,7 +2064,7 @@ create table t1 as select insert(1133,3,0,22) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lcase(123));
@@ -2072,7 +2074,7 @@ create table t1 as select lcase(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(123,1));
@@ -2082,7 +2084,7 @@ create table t1 as select left(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lower(123));
@@ -2092,7 +2094,7 @@ create table t1 as select lower(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lpad(1,2,0));
@@ -2102,7 +2104,7 @@ create table t1 as select lpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ltrim(1));
@@ -2112,7 +2114,7 @@ create table t1 as select ltrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(mid(1,1,1));
@@ -2122,7 +2124,7 @@ create table t1 as select mid(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(repeat(1,2));
@@ -2132,7 +2134,7 @@ create table t1 as select repeat(1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(replace(1,1,2));
@@ -2142,7 +2144,7 @@ create table t1 as select replace(1,1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(reverse(12));
@@ -2152,7 +2154,7 @@ create table t1 as select reverse(12) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(right(123,1));
@@ -2162,7 +2164,7 @@ create table t1 as select right(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rpad(1,2,0));
@@ -2172,7 +2174,7 @@ create table t1 as select rpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rtrim(1));
@@ -2182,7 +2184,7 @@ create table t1 as select rtrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(soundex(1));
@@ -2192,7 +2194,7 @@ create table t1 as select soundex(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(substring(1,1,1));
@@ -2202,7 +2204,7 @@ create table t1 as select substring(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(trim(1));
@@ -2212,7 +2214,7 @@ create table t1 as select trim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ucase(1));
@@ -2222,7 +2224,7 @@ create table t1 as select ucase(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(upper(1));
@@ -2232,14 +2234,14 @@ create table t1 as select upper(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat(' ', 64) as a limit 0;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ("1.1"), ("2.1");
select a, hex(a) from t1;
@@ -2468,7 +2470,7 @@ t2 CREATE TABLE `t2` (
`concat(a)` varbinary(64) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -2489,7 +2491,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `concat(a)` varchar(19) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a date);
@@ -2780,7 +2782,7 @@ hex(a)
0000000000000001
drop table t1;
drop view v1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -3029,7 +3031,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`CONCAT(a)` varchar(9) CHARACTER SET cp1251 DEFAULT NULL,
- `IFNULL(a,'')` varchar(9) CHARACTER SET cp1251 NOT NULL DEFAULT '',
+ `IFNULL(a,'')` varchar(9) CHARACTER SET cp1251 NOT NULL,
`IF(a,a,'')` varchar(9) CHARACTER SET cp1251 DEFAULT NULL,
`CASE WHEN a THEN a ELSE '' END` varchar(9) CHARACTER SET cp1251 DEFAULT NULL,
`COALESCE(a,'')` varchar(9) CHARACTER SET cp1251 DEFAULT NULL
@@ -3039,14 +3041,14 @@ CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LCASE(a) FROM t1;
@@ -3067,35 +3069,35 @@ CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPEAT(1,2)` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `REPEAT(1,2)` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LEFT(123,2)` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `LEFT(123,2)` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RIGHT(123,2)` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `RIGHT(123,2)` varchar(2) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LTRIM(123)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `LTRIM(123)` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RTRIM(123)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `RTRIM(123)` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1;
@@ -3109,35 +3111,35 @@ CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPLACE(111,2,3)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `REPLACE(111,2,3)` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SOUNDEX(1)` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `SOUNDEX(1)` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8);
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
@@ -3161,7 +3163,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
+1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
@@ -3301,7 +3303,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`d` date DEFAULT NULL,
- `bad` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
+ `bad` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET NAMES latin1;
@@ -3341,3 +3343,66 @@ DROP TABLE t1;
#
# End of 5.5 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8688 Wrong result for SELECT..WHERE varchar_column IN (1,2,3) AND varchar_column=' 1';
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
+INSERT INTO t1 VALUES (' 1'),('`1');
+SELECT * FROM t1 WHERE a IN (1,2,3);
+a
+ 1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '`1'
+SELECT * FROM t1 WHERE a IN (1,2,3) AND a=' 1';
+a
+ 1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '`1'
+SELECT * FROM t1 WHERE a IN (1,2,3,'4') AND a=' 1';
+a
+ 1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '`1'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,3) AND a=' 1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 1') and (`test`.`t1`.`a` in (1,2,3)))
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,3,'x') AND a=' 1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 1') and (`test`.`t1`.`a` in (1,2,3,'x')))
+DROP TABLE t1;
+#
+# MDEV-8671 Wrong result for SELECT..WHERE varchar_column=' 1' AND (varchar_column XOR '1')
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
+INSERT INTO t1 VALUES (' 1'),('`1');
+SELECT * FROM t1 WHERE a=' 1';
+a
+ 1
+`1
+SELECT * FROM t1 WHERE (a XOR '0');
+a
+ 1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '`1'
+SELECT * FROM t1 WHERE a=' 1' AND (a XOR '0');
+a
+ 1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '`1'
+# ' 1' should not be propagated into (a XIR '0')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=' 1' AND (a XOR '0');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 1') and (`test`.`t1`.`a` xor '0'))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index 0e6ae25a395..75d05aa9f0a 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -94,7 +94,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`code` varchar(8) DEFAULT NULL,
- `a` varchar(1) CHARACTER SET cp932 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET cp932 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
UPDATE t1 SET a=unhex(code) ORDER BY code;
Warnings:
@@ -165,7 +165,7 @@ Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
SELECT COUNT(*) FROM t1;
COUNT(*)
14623
-SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=1;
+SELECT COUNT(*) FROM t1 WHERE a<>'?' AND OCTET_LENGTH(a)=1;
COUNT(*)
63
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
@@ -386,10 +386,140 @@ WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
81F0 â„«
+Warnings:
+Warning 1977 Cannot convert 'cp932' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EA to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EA to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
+Warnings:
+Warning 1977 Cannot convert 'cp932' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EA to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EA to 'utf8'
#
# WL#3090 Japanese Character Set adjustments
# Test cp932->Unicode conversion
@@ -10064,6 +10194,71 @@ FC48 E9B5AB
FC49 EFA8AD
FC4A E9B899
FC4B E9BB91
+Warnings:
+Warning 1977 Cannot convert 'cp932' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EA to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EB to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EC to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81ED to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EE to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81EF to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81F8 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81F9 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81FA to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x81FB to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8240 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8241 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8242 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8243 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8244 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8245 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8246 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8247 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8248 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8249 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x824A to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x824B to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x824C to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x824D to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x824E to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x8259 to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x825A to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x825B to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x825C to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x825D to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x825E to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x825F to 'utf8'
+Warning 1977 Cannot convert 'cp932' character 0x827A to 'utf8'
DROP TABLE t1;
#
# WL#3090 Japanese Character Set adjustments
@@ -19547,7 +19742,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET cp932 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET cp932 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -19567,7 +19762,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET cp932 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET cp932 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -19806,7 +20001,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET cp932 COLLATE cp932_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET cp932 COLLATE cp932_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -19826,7 +20021,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET cp932 COLLATE cp932_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET cp932 COLLATE cp932_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -20105,7 +20300,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET cp932 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\'),('à\t');
INSERT INTO t1 VALUES ('\\à\'),('\\à\t'),('\\à\t\t');
@@ -20144,7 +20339,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET cp932 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('à\')),(BINARY('à\t'));
INSERT INTO t1 VALUES (BINARY('\\à\')),(BINARY('\\à\t')),(BINARY('\\à\t\t'));
@@ -20183,7 +20378,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET cp932 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'à\'),(_BINARY'à\t');
INSERT INTO t1 VALUES (_BINARY'\\à\'),(_BINARY'\\à\t'),(_BINARY'\\à\t\t');
@@ -20229,7 +20424,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET cp932 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
@@ -20249,7 +20444,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varbinary(10) NOT NULL DEFAULT ''
+ `a` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
diff --git a/mysql-test/r/ctype_eucjpms.result b/mysql-test/r/ctype_eucjpms.result
index a1232c115e9..f9cb4f1eecc 100644
--- a/mysql-test/r/ctype_eucjpms.result
+++ b/mysql-test/r/ctype_eucjpms.result
@@ -9881,9 +9881,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -9976,9 +9988,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -9992,9 +10016,13 @@ DROP TABLE t1;
select hex(convert(_eucjpms 0xA5FE41 using ucs2));
hex(convert(_eucjpms 0xA5FE41 using ucs2))
003F0041
+Warnings:
+Warning 1977 Cannot convert 'eucjpms' character 0xA5FE to 'ucs2'
select hex(convert(_eucjpms 0x8FABF841 using ucs2));
hex(convert(_eucjpms 0x8FABF841 using ucs2))
003F0041
+Warnings:
+Warning 1977 Cannot convert 'eucjpms' character 0x8FABF8 to 'ucs2'
set global LC_TIME_NAMES=convert((convert((0x63) using eucjpms)) using utf8);
ERROR HY000: Unknown locale: 'c'
#
@@ -10014,21 +10042,27 @@ DROP TABLE t1;
CREATE TABLE t1 AS SELECT 'XXXXXX' AS code, ' ' AS a LIMIT 0;
INSERT INTO t1 (code) SELECT concat('8E', head) FROM head
WHERE (head BETWEEN 'A1' AND 'DF') ORDER BY head;
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
INSERT INTO t1 (code) SELECT concat(head, tail)
FROM head, tail
WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN '8E' AND '8F')
AND (tail BETWEEN '20' AND 'FF')
ORDER BY head, tail;
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
INSERT INTO t1 (code) SELECT concat('8F', head, tail)
FROM head, tail
WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '20' AND 'FF')
ORDER BY head, tail;
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `code` varchar(6) CHARACTER SET eucjpms NOT NULL DEFAULT '',
- `a` varchar(1) CHARACTER SET eucjpms NOT NULL DEFAULT ''
+ `code` varchar(6) CHARACTER SET eucjpms NOT NULL,
+ `a` varchar(1) CHARACTER SET eucjpms NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
UPDATE t1 SET a=unhex(code) ORDER BY code;
Warnings:
@@ -10101,6 +10135,9 @@ COUNT(*)
56959
SELECT COUNT(*) FROM t1 WHERE a<>'';
COUNT(*)
+56959
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND a<>'?';
+COUNT(*)
17735
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
COUNT(*)
@@ -10551,12 +10588,142 @@ WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
8FAABC Ģ
+Warnings:
+Warning 1977 Cannot convert 'eucjpms' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EC to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
8FA9C3 ð
8FABB9 ǵ
+Warnings:
+Warning 1977 Cannot convert 'eucjpms' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EC to 'utf8'
#
# WL#3090 Japanese Character Set adjustments
# Test sjis->Unicode conversion
@@ -25642,6 +25809,71 @@ FEFB EE8EA8
FEFC EE8EA9
FEFD EE8EAA
FEFE EE8EAB
+Warnings:
+Warning 1977 Cannot convert 'eucjpms' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2ED to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EE to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2F1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2FA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2FB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2FC to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A1 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A2 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A3 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A4 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A5 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A6 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A7 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A8 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3A9 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3AA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3AB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3AC to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3AD to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3AE to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3AF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3BA to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3BB to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3BC to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3BD to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3BE to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3BF to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3C0 to 'utf8'
+Warning 1977 Cannot convert 'eucjpms' character 0xA3DB to 'utf8'
DROP TABLE t1;
#
# WL#3090 Japanese Character Set adjustments
@@ -32761,7 +32993,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET eucjpms NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET eucjpms NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -32781,7 +33013,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET eucjpms NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET eucjpms NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -33194,7 +33426,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -33214,7 +33446,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -33632,10 +33864,52 @@ CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET eucjpms);
INSERT INTO t1 VALUES (0x8EA0);
SELECT HEX(a), CHAR_LENGTH(a) FROM t1;
HEX(a) CHAR_LENGTH(a)
- 0
+3F3F 2
DROP TABLE t1;
SELECT _eucjpms 0x8EA0;
ERROR HY000: Invalid eucjpms character string: '8EA0'
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET eucjpms, KEY(a));
+INSERT INTO t1 VALUES ('a'),(0x7F);
+INSERT INTO t1 VALUES (0x8EA1),(0x8EDF);
+INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE);
+INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE);
+SELECT HEX(a) FROM t1 ORDER BY a;
+HEX(a)
+61
+7F
+8EA1
+8EDF
+8FA1A1
+8FFEFE
+A1A1
+DEDE
+DFDF
+E0E0
+FEFE
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET eucjpms COLLATE eucjpms_bin;
+SELECT HEX(a) FROM t1 ORDER BY a;
+HEX(a)
+61
+7F
+8EA1
+8EDF
+8FA1A1
+8FFEFE
+A1A1
+DEDE
+DFDF
+E0E0
+FEFE
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result
index dcb68cfe60b..90353c6af2a 100644
--- a/mysql-test/r/ctype_euckr.result
+++ b/mysql-test/r/ctype_euckr.result
@@ -224,9 +224,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -359,9 +371,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -407,12 +431,12 @@ Warnings:
Warning 1366 Incorrect string value: '\xA1\xFF' for column 's1' at row 1
select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1;
hex(s1) hex(convert(s1 using utf8))
-
-
-
-
-
-
+3F3F 3F3F
+3F3F 3F3F
+3F40 3F40
+3F5B 3F5B
+3F60 3F60
+3F7B 3F7B
A141 ECA2A5
A15A ECA381
A161 ECA382
@@ -445,7 +469,7 @@ FROM t1 t11, t1 t12
WHERE t11.a >= 0x81 AND t11.a <= 0xFE
AND t12.a >= 0x41 AND t12.a <= 0xFE
ORDER BY t11.a, t12.a;
-SELECT s as bad_code FROM t2 WHERE a='' ORDER BY s;
+SELECT s as bad_code FROM t2 WHERE a='?' ORDER BY s;
bad_code
815B
815C
@@ -1959,7 +1983,7 @@ FE7D
FE7E
FE7F
FE80
-DELETE FROM t2 WHERE a='';
+DELETE FROM t2 WHERE a='?';
ALTER TABLE t2 ADD u VARCHAR(1) CHARACTER SET utf8, ADD a2 VARCHAR(1) CHARACTER SET euckr;
UPDATE t2 SET u=a, a2=u;
SELECT s as unassigned_code FROM t2 WHERE u='?';
@@ -24424,7 +24448,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`code` varchar(8) DEFAULT NULL,
- `a` varchar(1) CHARACTER SET euckr NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET euckr NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
UPDATE t1 SET a=unhex(code) ORDER BY code;
Warnings:
@@ -24492,7 +24516,7 @@ Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
COUNT(*)
22428
SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
@@ -24712,6 +24736,71 @@ WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
A1CA â„«
+Warnings:
+Warning 1977 Cannot convert 'euckr' character 0xA2E8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2E8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2E9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2E9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2ED to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2ED to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F1 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F1 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F2 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F2 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F3 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F3 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F4 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F4 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F5 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F5 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F6 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F6 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F7 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F7 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BD to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
@@ -24743,6 +24832,71 @@ A8E4 ⓧ
A8E5 ⓨ
A8E6 â“©
A9A2 Ä‘
+Warnings:
+Warning 1977 Cannot convert 'euckr' character 0xA2E8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2E8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2E9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2E9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2ED to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2ED to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F1 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F1 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F2 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F2 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F3 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F3 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F4 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F4 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F5 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F5 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F6 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F6 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F7 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F7 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F8 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2F9 to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AE to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5AF to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BA to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BB to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BC to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BD to 'utf8'
+Warning 1977 Cannot convert 'euckr' character 0xA5BD to 'utf8'
DROP TABLE t1;
#
# End of 5.5 tests
@@ -24761,7 +24915,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET euckr NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET euckr NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -24781,7 +24935,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET euckr NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET euckr NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -25020,7 +25174,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET euckr COLLATE euckr_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET euckr COLLATE euckr_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -25040,7 +25194,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET euckr COLLATE euckr_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET euckr COLLATE euckr_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/r/ctype_filename.result b/mysql-test/r/ctype_filename.result
index ac8df476137..c6d7d1e39b9 100644
--- a/mysql-test/r/ctype_filename.result
+++ b/mysql-test/r/ctype_filename.result
@@ -14,3 +14,10 @@ drop table `clock$`;
select convert(convert(',' using filename) using binary);
convert(convert(',' using filename) using binary)
@002c
+#
+# MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member
+#
+SET NAMES utf8;
+SELECT @a:=CONVERT('aÑ' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a), HEX(REVERSE(@a));
+@a BINARY @a REVERSE(@a) HEX(@a) HEX(REVERSE(@a))
+aÑ a@r1 Ña 61407231 40723161
diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result
index 5db6e2d3035..f9f37c00a79 100644
--- a/mysql-test/r/ctype_gb2312.result
+++ b/mysql-test/r/ctype_gb2312.result
@@ -224,9 +224,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -440,9 +452,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -485,7 +509,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`code` varchar(8) DEFAULT NULL,
- `a` varchar(1) CHARACTER SET gb2312 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET gb2312 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
UPDATE t1 SET a=unhex(code) ORDER BY code;
Warnings:
@@ -553,7 +577,7 @@ Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
COUNT(*)
8178
SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
@@ -740,6 +764,71 @@ A2F9 â…¨
A2FA â…©
A2FB â…ª
A2FC â…«
+Warnings:
+Warning 1977 Cannot convert 'gb2312' character 0xA2A1 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A1 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A2 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A2 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FD to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
@@ -770,6 +859,71 @@ A8B7 Çš
A8B8 ǜ
A8B9 ü
A8BA ê
+Warnings:
+Warning 1977 Cannot convert 'gb2312' character 0xA2A1 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A1 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A2 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A2 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2A9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E3 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2E4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA2FE to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F4 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F5 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F6 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F7 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F8 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4F9 to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FA to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FB to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FC to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FD to 'utf8'
+Warning 1977 Cannot convert 'gb2312' character 0xA4FD to 'utf8'
DROP TABLE t1;
#
# End of 5.5 tests
@@ -788,7 +942,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET gb2312 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET gb2312 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -808,7 +962,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET gb2312 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET gb2312 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1047,7 +1201,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET gb2312 COLLATE gb2312_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET gb2312 COLLATE gb2312_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1067,7 +1221,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET gb2312 COLLATE gb2312_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET gb2312 COLLATE gb2312_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result
index 2d31a15bb62..d10d5f4bf75 100644
--- a/mysql-test/r/ctype_gbk.result
+++ b/mysql-test/r/ctype_gbk.result
@@ -224,9 +224,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -440,9 +452,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -464,6 +488,8 @@ DROP TABLE t1;
select hex(convert(_gbk 0xA14041 using ucs2));
hex(convert(_gbk 0xA14041 using ucs2))
003F0041
+Warnings:
+Warning 1977 Cannot convert 'gbk' character 0xA140 to 'ucs2'
create table t1 (c1 text not null, c2 text not null) character set gbk;
alter table t1 change c1 c1 mediumtext character set gbk not null;
show create table t1;
@@ -505,7 +531,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`code` varchar(8) DEFAULT NULL,
- `a` varchar(1) CHARACTER SET gbk NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET gbk NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
UPDATE t1 SET a=unhex(code) ORDER BY code;
Warnings:
@@ -573,7 +599,7 @@ Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
COUNT(*)
23940
SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
@@ -770,6 +796,71 @@ HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
A2FB â…ª
A2FC â…«
+Warnings:
+Warning 1977 Cannot convert 'gbk' character 0xA140 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA140 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA141 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA141 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA142 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA142 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA143 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA143 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA144 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA144 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA145 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA145 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA146 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA146 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA147 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA147 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA148 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA148 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA149 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA149 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14F to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14F to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA150 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA150 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA151 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA151 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA152 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA152 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA153 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA153 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA154 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA154 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA155 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA155 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA156 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA156 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA157 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA157 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA158 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA158 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA159 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA159 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15F to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15F to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
@@ -802,6 +893,71 @@ A8B9 ü
A8BA ê
A8BD Å„
A8BE ň
+Warnings:
+Warning 1977 Cannot convert 'gbk' character 0xA140 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA140 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA141 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA141 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA142 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA142 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA143 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA143 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA144 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA144 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA145 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA145 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA146 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA146 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA147 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA147 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA148 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA148 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA149 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA149 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14F to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA14F to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA150 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA150 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA151 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA151 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA152 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA152 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA153 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA153 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA154 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA154 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA155 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA155 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA156 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA156 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA157 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA157 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA158 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA158 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA159 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA159 to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15A to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15B to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15C to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15D to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15E to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15F to 'utf8'
+Warning 1977 Cannot convert 'gbk' character 0xA15F to 'utf8'
DROP TABLE t1;
#
# End of 5.5 tests
@@ -820,7 +976,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET gbk NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET gbk NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -840,7 +996,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET gbk NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET gbk NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1253,7 +1409,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET gbk COLLATE gbk_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET gbk COLLATE gbk_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1273,7 +1429,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET gbk COLLATE gbk_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET gbk COLLATE gbk_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4790,7 +4946,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET gbk NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\'),('à\t');
INSERT INTO t1 VALUES ('\\à\'),('\\à\t'),('\\à\t\t');
@@ -4829,7 +4985,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET gbk NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('à\')),(BINARY('à\t'));
INSERT INTO t1 VALUES (BINARY('\\à\')),(BINARY('\\à\t')),(BINARY('\\à\t\t'));
@@ -4868,7 +5024,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET gbk NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'à\'),(_BINARY'à\t');
INSERT INTO t1 VALUES (_BINARY'\\à\'),(_BINARY'\\à\t'),(_BINARY'\\à\t\t');
@@ -4914,7 +5070,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET gbk NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
@@ -4934,7 +5090,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varbinary(10) NOT NULL DEFAULT ''
+ `a` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
@@ -4964,3 +5120,827 @@ DROP TABLE t1;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+b VARBINARY(16),
+type SET('ascii','bad','head','tail','mb2','unassigned')
+);
+INSERT INTO t1 (b, type) VALUES (0x40, 'ascii,tail');
+INSERT INTO t1 (b, type) VALUES (0x80, 'tail');
+INSERT INTO t1 (b, type) VALUES (0x81, 'head,tail');
+INSERT INTO t1 (b, type) VALUES (0xFF, 'bad');
+INSERT INTO t1 (b, type) VALUES (0xA140, 'mb2,unassigned');
+INSERT INTO t1 (b, type) VALUES (0xA1A3, 'mb2');
+INSERT INTO t1 (b, type) VALUES (0xFE40, 'mb2');
+CREATE TABLE t2 AS SELECT
+CONCAT(t1.b,t2.b) AS b,
+t1.type AS type1,
+t2.type AS type2,
+CONCAT('[',t1.type,'][',t2.type,']') AS comment
+FROM t1, t1 t2;
+CREATE TABLE t3
+(
+b VARBINARY(16),
+c VARCHAR(16) CHARACTER SET gbk,
+comment VARCHAR(128)
+);
+#
+# A combination of two valid characters, should give no warnings
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE
+(FIND_IN_SET('ascii',type1) OR FIND_IN_SET('mb2',type1)) AND
+(FIND_IN_SET('ascii',type2) OR FIND_IN_SET('mb2',type2))
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+16
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+4040 [ascii,tail][ascii,tail]
+40A140 [ascii,tail][mb2,unassigned]
+40A1A3 [ascii,tail][mb2]
+40FE40 [ascii,tail][mb2]
+A14040 [mb2,unassigned][ascii,tail]
+A140A140 [mb2,unassigned][mb2,unassigned]
+A140A1A3 [mb2,unassigned][mb2]
+A140FE40 [mb2,unassigned][mb2]
+A1A340 [mb2][ascii,tail]
+A1A3A140 [mb2][mb2,unassigned]
+A1A3A1A3 [mb2][mb2]
+A1A3FE40 [mb2][mb2]
+FE4040 [mb2][ascii,tail]
+FE40A140 [mb2][mb2,unassigned]
+FE40A1A3 [mb2][mb2]
+FE40FE40 [mb2][mb2]
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that start with a tail or a bad byte,
+# or end with a bad byte, all should be fixed.
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE type1='tail' OR type1='bad' OR type2='bad'
+ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 1
+Warning 1366 Incorrect string value: '\x80@' for column 'c' at row 2
+Warning 1366 Incorrect string value: '\x80\x80' for column 'c' at row 3
+Warning 1366 Incorrect string value: '\x80\x81' for column 'c' at row 4
+Warning 1366 Incorrect string value: '\x80\xA1@' for column 'c' at row 5
+Warning 1366 Incorrect string value: '\x80\xA1\xA3' for column 'c' at row 6
+Warning 1366 Incorrect string value: '\x80\xFE@' for column 'c' at row 7
+Warning 1366 Incorrect string value: '\x80\xFF' for column 'c' at row 8
+Warning 1366 Incorrect string value: '\x81\xFF' for column 'c' at row 9
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 10
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 11
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 12
+Warning 1366 Incorrect string value: '\xFF@' for column 'c' at row 13
+Warning 1366 Incorrect string value: '\xFF\x80' for column 'c' at row 14
+Warning 1366 Incorrect string value: '\xFF\x81' for column 'c' at row 15
+Warning 1366 Incorrect string value: '\xFF\xA1@' for column 'c' at row 16
+Warning 1366 Incorrect string value: '\xFF\xA1\xA3' for column 'c' at row 17
+Warning 1366 Incorrect string value: '\xFF\xFE@' for column 'c' at row 18
+Warning 1366 Incorrect string value: '\xFF\xFF' for column 'c' at row 19
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+19
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+403F 40FF [ascii,tail][bad]
+3F40 8040 [tail][ascii,tail]
+3F3F 8080 [tail][tail]
+3F3F 8081 [tail][head,tail]
+3FA140 80A140 [tail][mb2,unassigned]
+3FA1A3 80A1A3 [tail][mb2]
+3FFE40 80FE40 [tail][mb2]
+3F3F 80FF [tail][bad]
+3F3F 81FF [head,tail][bad]
+A1403F A140FF [mb2,unassigned][bad]
+A1A33F A1A3FF [mb2][bad]
+FE403F FE40FF [mb2][bad]
+3F40 FF40 [bad][ascii,tail]
+3F3F FF80 [bad][tail]
+3F3F FF81 [bad][head,tail]
+3FA140 FFA140 [bad][mb2,unassigned]
+3FA1A3 FFA1A3 [bad][mb2]
+3FFE40 FFFE40 [bad][mb2]
+3F3F FFFF [bad][bad]
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that start with an ASCII or an MB2 character,
+# followed by a non-ASCII tail, all should be fixed.
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('mb2',type1) OR FIND_IN_SET('ascii',type1))
+AND (FIND_IN_SET('tail',type2) AND NOT FIND_IN_SET('ascii',type2))
+ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 1
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 2
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 3
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 4
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 5
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 6
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 7
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 8
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+8
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+403F 4080 [ascii,tail][tail]
+403F 4081 [ascii,tail][head,tail]
+A1403F A14080 [mb2,unassigned][tail]
+A1403F A14081 [mb2,unassigned][head,tail]
+A1A33F A1A380 [mb2][tail]
+A1A33F A1A381 [mb2][head,tail]
+FE403F FE4080 [mb2][tail]
+FE403F FE4081 [mb2][head,tail]
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Other sequences
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2 ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\xA3' for column 'c' at row 5
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+6
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+8140 [head,tail][ascii,tail]
+8180 [head,tail][tail]
+8181 [head,tail][head,tail]
+81A140 [head,tail][mb2,unassigned]
+81FE40 [head,tail][mb2]
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+81A13F 81A1A3 [head,tail][mb2]
+DELETE FROM t3;
+DROP TABLE t3;
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+CONCAT(t1.b,t2.b,t3.b) AS b,
+t1.type AS type1,
+t2.type AS type2,
+t3.type AS type3,
+CONCAT('[',t1.type,'][',t2.type,'][',t3.type,']') AS comment
+FROM t1, t1 t2,t1 t3;
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+343
+CREATE TABLE t3
+(
+b VARBINARY(16),
+c VARCHAR(16) CHARACTER SET gbk,
+comment VARCHAR(128)
+);
+#
+# A combination of three valid characters, should give no warnings
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE
+(FIND_IN_SET('ascii',type1) OR FIND_IN_SET('mb2',type1)) AND
+(FIND_IN_SET('ascii',type2) OR FIND_IN_SET('mb2',type2)) AND
+(FIND_IN_SET('ascii',type3) OR FIND_IN_SET('mb2',type3))
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+64
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+404040 [ascii,tail][ascii,tail][ascii,tail]
+4040A140 [ascii,tail][ascii,tail][mb2,unassigned]
+4040A1A3 [ascii,tail][ascii,tail][mb2]
+4040FE40 [ascii,tail][ascii,tail][mb2]
+40A14040 [ascii,tail][mb2,unassigned][ascii,tail]
+40A140A140 [ascii,tail][mb2,unassigned][mb2,unassigned]
+40A140A1A3 [ascii,tail][mb2,unassigned][mb2]
+40A140FE40 [ascii,tail][mb2,unassigned][mb2]
+40A1A340 [ascii,tail][mb2][ascii,tail]
+40A1A3A140 [ascii,tail][mb2][mb2,unassigned]
+40A1A3A1A3 [ascii,tail][mb2][mb2]
+40A1A3FE40 [ascii,tail][mb2][mb2]
+40FE4040 [ascii,tail][mb2][ascii,tail]
+40FE40A140 [ascii,tail][mb2][mb2,unassigned]
+40FE40A1A3 [ascii,tail][mb2][mb2]
+40FE40FE40 [ascii,tail][mb2][mb2]
+A1404040 [mb2,unassigned][ascii,tail][ascii,tail]
+A14040A140 [mb2,unassigned][ascii,tail][mb2,unassigned]
+A14040A1A3 [mb2,unassigned][ascii,tail][mb2]
+A14040FE40 [mb2,unassigned][ascii,tail][mb2]
+A140A14040 [mb2,unassigned][mb2,unassigned][ascii,tail]
+A140A140A140 [mb2,unassigned][mb2,unassigned][mb2,unassigned]
+A140A140A1A3 [mb2,unassigned][mb2,unassigned][mb2]
+A140A140FE40 [mb2,unassigned][mb2,unassigned][mb2]
+A140A1A340 [mb2,unassigned][mb2][ascii,tail]
+A140A1A3A140 [mb2,unassigned][mb2][mb2,unassigned]
+A140A1A3A1A3 [mb2,unassigned][mb2][mb2]
+A140A1A3FE40 [mb2,unassigned][mb2][mb2]
+A140FE4040 [mb2,unassigned][mb2][ascii,tail]
+A140FE40A140 [mb2,unassigned][mb2][mb2,unassigned]
+A140FE40A1A3 [mb2,unassigned][mb2][mb2]
+A140FE40FE40 [mb2,unassigned][mb2][mb2]
+A1A34040 [mb2][ascii,tail][ascii,tail]
+A1A340A140 [mb2][ascii,tail][mb2,unassigned]
+A1A340A1A3 [mb2][ascii,tail][mb2]
+A1A340FE40 [mb2][ascii,tail][mb2]
+A1A3A14040 [mb2][mb2,unassigned][ascii,tail]
+A1A3A140A140 [mb2][mb2,unassigned][mb2,unassigned]
+A1A3A140A1A3 [mb2][mb2,unassigned][mb2]
+A1A3A140FE40 [mb2][mb2,unassigned][mb2]
+A1A3A1A340 [mb2][mb2][ascii,tail]
+A1A3A1A3A140 [mb2][mb2][mb2,unassigned]
+A1A3A1A3A1A3 [mb2][mb2][mb2]
+A1A3A1A3FE40 [mb2][mb2][mb2]
+A1A3FE4040 [mb2][mb2][ascii,tail]
+A1A3FE40A140 [mb2][mb2][mb2,unassigned]
+A1A3FE40A1A3 [mb2][mb2][mb2]
+A1A3FE40FE40 [mb2][mb2][mb2]
+FE404040 [mb2][ascii,tail][ascii,tail]
+FE4040A140 [mb2][ascii,tail][mb2,unassigned]
+FE4040A1A3 [mb2][ascii,tail][mb2]
+FE4040FE40 [mb2][ascii,tail][mb2]
+FE40A14040 [mb2][mb2,unassigned][ascii,tail]
+FE40A140A140 [mb2][mb2,unassigned][mb2,unassigned]
+FE40A140A1A3 [mb2][mb2,unassigned][mb2]
+FE40A140FE40 [mb2][mb2,unassigned][mb2]
+FE40A1A340 [mb2][mb2][ascii,tail]
+FE40A1A3A140 [mb2][mb2][mb2,unassigned]
+FE40A1A3A1A3 [mb2][mb2][mb2]
+FE40A1A3FE40 [mb2][mb2][mb2]
+FE40FE4040 [mb2][mb2][ascii,tail]
+FE40FE40A140 [mb2][mb2][mb2,unassigned]
+FE40FE40A1A3 [mb2][mb2][mb2]
+FE40FE40FE40 [mb2][mb2][mb2]
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that start with a tail or a bad byte,
+# or have a bad byte, all should be fixed.
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE type1='tail' OR type1='bad' OR type2='bad' OR type3='bad'
+ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 1
+Warning 1366 Incorrect string value: '\x80\xFF' for column 'c' at row 2
+Warning 1366 Incorrect string value: '\x81\xFF' for column 'c' at row 3
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 4
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 5
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 6
+Warning 1366 Incorrect string value: '\xFF@' for column 'c' at row 7
+Warning 1366 Incorrect string value: '\xFF\x80' for column 'c' at row 8
+Warning 1366 Incorrect string value: '\xFF\x81' for column 'c' at row 9
+Warning 1366 Incorrect string value: '\xFF\xA1@' for column 'c' at row 10
+Warning 1366 Incorrect string value: '\xFF\xA1\xA3' for column 'c' at row 11
+Warning 1366 Incorrect string value: '\xFF\xFE@' for column 'c' at row 12
+Warning 1366 Incorrect string value: '\xFF\xFF' for column 'c' at row 13
+Warning 1366 Incorrect string value: '\x80@@' for column 'c' at row 14
+Warning 1366 Incorrect string value: '\x80@\x80' for column 'c' at row 15
+Warning 1366 Incorrect string value: '\x80@\x81' for column 'c' at row 16
+Warning 1366 Incorrect string value: '\x80@\xA1@' for column 'c' at row 17
+Warning 1366 Incorrect string value: '\x80@\xA1\xA3' for column 'c' at row 18
+Warning 1366 Incorrect string value: '\x80@\xFE@' for column 'c' at row 19
+Warning 1366 Incorrect string value: '\x80@\xFF' for column 'c' at row 20
+Warning 1366 Incorrect string value: '\x80\x80@' for column 'c' at row 21
+Warning 1366 Incorrect string value: '\x80\x80\x80' for column 'c' at row 22
+Warning 1366 Incorrect string value: '\x80\x80\x81' for column 'c' at row 23
+Warning 1366 Incorrect string value: '\x80\x80\xA1@' for column 'c' at row 24
+Warning 1366 Incorrect string value: '\x80\x80\xA1\xA3' for column 'c' at row 25
+Warning 1366 Incorrect string value: '\x80\x80\xFE@' for column 'c' at row 26
+Warning 1366 Incorrect string value: '\x80\x80\xFF' for column 'c' at row 27
+Warning 1366 Incorrect string value: '\x80\x81@' for column 'c' at row 28
+Warning 1366 Incorrect string value: '\x80\x81\x80' for column 'c' at row 29
+Warning 1366 Incorrect string value: '\x80\x81\x81' for column 'c' at row 30
+Warning 1366 Incorrect string value: '\x80\x81\xA1@' for column 'c' at row 31
+Warning 1366 Incorrect string value: '\x80\x81\xA1\xA3' for column 'c' at row 32
+Warning 1366 Incorrect string value: '\x80\x81\xFE@' for column 'c' at row 33
+Warning 1366 Incorrect string value: '\x80\x81\xFF' for column 'c' at row 34
+Warning 1366 Incorrect string value: '\x80\xA1@@' for column 'c' at row 35
+Warning 1366 Incorrect string value: '\x80\xA1@\x80' for column 'c' at row 36
+Warning 1366 Incorrect string value: '\x80\xA1@\x81' for column 'c' at row 37
+Warning 1366 Incorrect string value: '\x80\xA1@\xA1@' for column 'c' at row 38
+Warning 1366 Incorrect string value: '\x80\xA1@\xA1\xA3' for column 'c' at row 39
+Warning 1366 Incorrect string value: '\x80\xA1@\xFE@' for column 'c' at row 40
+Warning 1366 Incorrect string value: '\x80\xA1@\xFF' for column 'c' at row 41
+Warning 1366 Incorrect string value: '\x80\xA1\xA3@' for column 'c' at row 42
+Warning 1366 Incorrect string value: '\x80\xA1\xA3\x80' for column 'c' at row 43
+Warning 1366 Incorrect string value: '\x80\xA1\xA3\x81' for column 'c' at row 44
+Warning 1366 Incorrect string value: '\x80\xA1\xA3\xA1@' for column 'c' at row 45
+Warning 1366 Incorrect string value: '\x80\xA1\xA3\xA1\xA3' for column 'c' at row 46
+Warning 1366 Incorrect string value: '\x80\xA1\xA3\xFE@' for column 'c' at row 47
+Warning 1366 Incorrect string value: '\x80\xA1\xA3\xFF' for column 'c' at row 48
+Warning 1366 Incorrect string value: '\x80\xFE@@' for column 'c' at row 49
+Warning 1366 Incorrect string value: '\x80\xFE@\x80' for column 'c' at row 50
+Warning 1366 Incorrect string value: '\x80\xFE@\x81' for column 'c' at row 51
+Warning 1366 Incorrect string value: '\x80\xFE@\xA1@' for column 'c' at row 52
+Warning 1366 Incorrect string value: '\x80\xFE@\xA1\xA3' for column 'c' at row 53
+Warning 1366 Incorrect string value: '\x80\xFE@\xFE@' for column 'c' at row 54
+Warning 1366 Incorrect string value: '\x80\xFE@\xFF' for column 'c' at row 55
+Warning 1366 Incorrect string value: '\x80\xFF@' for column 'c' at row 56
+Warning 1366 Incorrect string value: '\x80\xFF\x80' for column 'c' at row 57
+Warning 1366 Incorrect string value: '\x80\xFF\x81' for column 'c' at row 58
+Warning 1366 Incorrect string value: '\x80\xFF\xA1@' for column 'c' at row 59
+Warning 1366 Incorrect string value: '\x80\xFF\xA1\xA3' for column 'c' at row 60
+Warning 1366 Incorrect string value: '\x80\xFF\xFE@' for column 'c' at row 61
+Warning 1366 Incorrect string value: '\x80\xFF\xFF' for column 'c' at row 62
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 63
+Warning 1366 Incorrect string value: '\xFF' for column 'c' at row 64
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+163
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+40403F 4040FF [ascii,tail][ascii,tail][bad]
+403F3F 4080FF [ascii,tail][tail][bad]
+403F3F 4081FF [ascii,tail][head,tail][bad]
+40A1403F 40A140FF [ascii,tail][mb2,unassigned][bad]
+40A1A33F 40A1A3FF [ascii,tail][mb2][bad]
+40FE403F 40FE40FF [ascii,tail][mb2][bad]
+403F40 40FF40 [ascii,tail][bad][ascii,tail]
+403F3F 40FF80 [ascii,tail][bad][tail]
+403F3F 40FF81 [ascii,tail][bad][head,tail]
+403FA140 40FFA140 [ascii,tail][bad][mb2,unassigned]
+403FA1A3 40FFA1A3 [ascii,tail][bad][mb2]
+403FFE40 40FFFE40 [ascii,tail][bad][mb2]
+403F3F 40FFFF [ascii,tail][bad][bad]
+3F4040 804040 [tail][ascii,tail][ascii,tail]
+3F403F 804080 [tail][ascii,tail][tail]
+3F403F 804081 [tail][ascii,tail][head,tail]
+3F40A140 8040A140 [tail][ascii,tail][mb2,unassigned]
+3F40A1A3 8040A1A3 [tail][ascii,tail][mb2]
+3F40FE40 8040FE40 [tail][ascii,tail][mb2]
+3F403F 8040FF [tail][ascii,tail][bad]
+3F3F40 808040 [tail][tail][ascii,tail]
+3F3F3F 808080 [tail][tail][tail]
+3F3F3F 808081 [tail][tail][head,tail]
+3F3FA140 8080A140 [tail][tail][mb2,unassigned]
+3F3FA1A3 8080A1A3 [tail][tail][mb2]
+3F3FFE40 8080FE40 [tail][tail][mb2]
+3F3F3F 8080FF [tail][tail][bad]
+3F8140 808140 [tail][head,tail][ascii,tail]
+3F8180 808180 [tail][head,tail][tail]
+3F8181 808181 [tail][head,tail][head,tail]
+3F81A140 8081A140 [tail][head,tail][mb2,unassigned]
+3F81A13F 8081A1A3 [tail][head,tail][mb2]
+3F81FE40 8081FE40 [tail][head,tail][mb2]
+3F3F3F 8081FF [tail][head,tail][bad]
+3FA14040 80A14040 [tail][mb2,unassigned][ascii,tail]
+3FA1403F 80A14080 [tail][mb2,unassigned][tail]
+3FA1403F 80A14081 [tail][mb2,unassigned][head,tail]
+3FA140A140 80A140A140 [tail][mb2,unassigned][mb2,unassigned]
+3FA140A1A3 80A140A1A3 [tail][mb2,unassigned][mb2]
+3FA140FE40 80A140FE40 [tail][mb2,unassigned][mb2]
+3FA1403F 80A140FF [tail][mb2,unassigned][bad]
+3FA1A340 80A1A340 [tail][mb2][ascii,tail]
+3FA1A33F 80A1A380 [tail][mb2][tail]
+3FA1A33F 80A1A381 [tail][mb2][head,tail]
+3FA1A3A140 80A1A3A140 [tail][mb2][mb2,unassigned]
+3FA1A3A1A3 80A1A3A1A3 [tail][mb2][mb2]
+3FA1A3FE40 80A1A3FE40 [tail][mb2][mb2]
+3FA1A33F 80A1A3FF [tail][mb2][bad]
+3FFE4040 80FE4040 [tail][mb2][ascii,tail]
+3FFE403F 80FE4080 [tail][mb2][tail]
+3FFE403F 80FE4081 [tail][mb2][head,tail]
+3FFE40A140 80FE40A140 [tail][mb2][mb2,unassigned]
+3FFE40A1A3 80FE40A1A3 [tail][mb2][mb2]
+3FFE40FE40 80FE40FE40 [tail][mb2][mb2]
+3FFE403F 80FE40FF [tail][mb2][bad]
+3F3F40 80FF40 [tail][bad][ascii,tail]
+3F3F3F 80FF80 [tail][bad][tail]
+3F3F3F 80FF81 [tail][bad][head,tail]
+3F3FA140 80FFA140 [tail][bad][mb2,unassigned]
+3F3FA1A3 80FFA1A3 [tail][bad][mb2]
+3F3FFE40 80FFFE40 [tail][bad][mb2]
+3F3F3F 80FFFF [tail][bad][bad]
+81403F 8140FF [head,tail][ascii,tail][bad]
+81803F 8180FF [head,tail][tail][bad]
+81813F 8181FF [head,tail][head,tail][bad]
+81A1403F 81A140FF [head,tail][mb2,unassigned][bad]
+81A13F3F 81A1A3FF [head,tail][mb2][bad]
+81FE403F 81FE40FF [head,tail][mb2][bad]
+3F3F40 81FF40 [head,tail][bad][ascii,tail]
+3F3F3F 81FF80 [head,tail][bad][tail]
+3F3F3F 81FF81 [head,tail][bad][head,tail]
+3F3FA140 81FFA140 [head,tail][bad][mb2,unassigned]
+3F3FA1A3 81FFA1A3 [head,tail][bad][mb2]
+3F3FFE40 81FFFE40 [head,tail][bad][mb2]
+3F3F3F 81FFFF [head,tail][bad][bad]
+A140403F A14040FF [mb2,unassigned][ascii,tail][bad]
+A1403F3F A14080FF [mb2,unassigned][tail][bad]
+A1403F3F A14081FF [mb2,unassigned][head,tail][bad]
+A140A1403F A140A140FF [mb2,unassigned][mb2,unassigned][bad]
+A140A1A33F A140A1A3FF [mb2,unassigned][mb2][bad]
+A140FE403F A140FE40FF [mb2,unassigned][mb2][bad]
+A1403F40 A140FF40 [mb2,unassigned][bad][ascii,tail]
+A1403F3F A140FF80 [mb2,unassigned][bad][tail]
+A1403F3F A140FF81 [mb2,unassigned][bad][head,tail]
+A1403FA140 A140FFA140 [mb2,unassigned][bad][mb2,unassigned]
+A1403FA1A3 A140FFA1A3 [mb2,unassigned][bad][mb2]
+A1403FFE40 A140FFFE40 [mb2,unassigned][bad][mb2]
+A1403F3F A140FFFF [mb2,unassigned][bad][bad]
+A1A3403F A1A340FF [mb2][ascii,tail][bad]
+A1A33F3F A1A380FF [mb2][tail][bad]
+A1A33F3F A1A381FF [mb2][head,tail][bad]
+A1A3A1403F A1A3A140FF [mb2][mb2,unassigned][bad]
+A1A3A1A33F A1A3A1A3FF [mb2][mb2][bad]
+A1A3FE403F A1A3FE40FF [mb2][mb2][bad]
+A1A33F40 A1A3FF40 [mb2][bad][ascii,tail]
+A1A33F3F A1A3FF80 [mb2][bad][tail]
+A1A33F3F A1A3FF81 [mb2][bad][head,tail]
+A1A33FA140 A1A3FFA140 [mb2][bad][mb2,unassigned]
+A1A33FA1A3 A1A3FFA1A3 [mb2][bad][mb2]
+A1A33FFE40 A1A3FFFE40 [mb2][bad][mb2]
+A1A33F3F A1A3FFFF [mb2][bad][bad]
+FE40403F FE4040FF [mb2][ascii,tail][bad]
+FE403F3F FE4080FF [mb2][tail][bad]
+FE403F3F FE4081FF [mb2][head,tail][bad]
+FE40A1403F FE40A140FF [mb2][mb2,unassigned][bad]
+FE40A1A33F FE40A1A3FF [mb2][mb2][bad]
+FE40FE403F FE40FE40FF [mb2][mb2][bad]
+FE403F40 FE40FF40 [mb2][bad][ascii,tail]
+FE403F3F FE40FF80 [mb2][bad][tail]
+FE403F3F FE40FF81 [mb2][bad][head,tail]
+FE403FA140 FE40FFA140 [mb2][bad][mb2,unassigned]
+FE403FA1A3 FE40FFA1A3 [mb2][bad][mb2]
+FE403FFE40 FE40FFFE40 [mb2][bad][mb2]
+FE403F3F FE40FFFF [mb2][bad][bad]
+3F4040 FF4040 [bad][ascii,tail][ascii,tail]
+3F403F FF4080 [bad][ascii,tail][tail]
+3F403F FF4081 [bad][ascii,tail][head,tail]
+3F40A140 FF40A140 [bad][ascii,tail][mb2,unassigned]
+3F40A1A3 FF40A1A3 [bad][ascii,tail][mb2]
+3F40FE40 FF40FE40 [bad][ascii,tail][mb2]
+3F403F FF40FF [bad][ascii,tail][bad]
+3F3F40 FF8040 [bad][tail][ascii,tail]
+3F3F3F FF8080 [bad][tail][tail]
+3F3F3F FF8081 [bad][tail][head,tail]
+3F3FA140 FF80A140 [bad][tail][mb2,unassigned]
+3F3FA1A3 FF80A1A3 [bad][tail][mb2]
+3F3FFE40 FF80FE40 [bad][tail][mb2]
+3F3F3F FF80FF [bad][tail][bad]
+3F8140 FF8140 [bad][head,tail][ascii,tail]
+3F8180 FF8180 [bad][head,tail][tail]
+3F8181 FF8181 [bad][head,tail][head,tail]
+3F81A140 FF81A140 [bad][head,tail][mb2,unassigned]
+3F81A13F FF81A1A3 [bad][head,tail][mb2]
+3F81FE40 FF81FE40 [bad][head,tail][mb2]
+3F3F3F FF81FF [bad][head,tail][bad]
+3FA14040 FFA14040 [bad][mb2,unassigned][ascii,tail]
+3FA1403F FFA14080 [bad][mb2,unassigned][tail]
+3FA1403F FFA14081 [bad][mb2,unassigned][head,tail]
+3FA140A140 FFA140A140 [bad][mb2,unassigned][mb2,unassigned]
+3FA140A1A3 FFA140A1A3 [bad][mb2,unassigned][mb2]
+3FA140FE40 FFA140FE40 [bad][mb2,unassigned][mb2]
+3FA1403F FFA140FF [bad][mb2,unassigned][bad]
+3FA1A340 FFA1A340 [bad][mb2][ascii,tail]
+3FA1A33F FFA1A380 [bad][mb2][tail]
+3FA1A33F FFA1A381 [bad][mb2][head,tail]
+3FA1A3A140 FFA1A3A140 [bad][mb2][mb2,unassigned]
+3FA1A3A1A3 FFA1A3A1A3 [bad][mb2][mb2]
+3FA1A3FE40 FFA1A3FE40 [bad][mb2][mb2]
+3FA1A33F FFA1A3FF [bad][mb2][bad]
+3FFE4040 FFFE4040 [bad][mb2][ascii,tail]
+3FFE403F FFFE4080 [bad][mb2][tail]
+3FFE403F FFFE4081 [bad][mb2][head,tail]
+3FFE40A140 FFFE40A140 [bad][mb2][mb2,unassigned]
+3FFE40A1A3 FFFE40A1A3 [bad][mb2][mb2]
+3FFE40FE40 FFFE40FE40 [bad][mb2][mb2]
+3FFE403F FFFE40FF [bad][mb2][bad]
+3F3F40 FFFF40 [bad][bad][ascii,tail]
+3F3F3F FFFF80 [bad][bad][tail]
+3F3F3F FFFF81 [bad][bad][head,tail]
+3F3FA140 FFFFA140 [bad][bad][mb2,unassigned]
+3F3FA1A3 FFFFA1A3 [bad][bad][mb2]
+3F3FFE40 FFFFFE40 [bad][bad][mb2]
+3F3F3F FFFFFF [bad][bad][bad]
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that start with an ASCII or an MB2 character,
+# followed by a pure non-ASCII tail, all should be fixed.
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('mb2',type1) OR FIND_IN_SET('ascii',type1))
+AND type2='tail'
+ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\x80@' for column 'c' at row 1
+Warning 1366 Incorrect string value: '\x80\x80' for column 'c' at row 2
+Warning 1366 Incorrect string value: '\x80\x81' for column 'c' at row 3
+Warning 1366 Incorrect string value: '\x80\xA1@' for column 'c' at row 4
+Warning 1366 Incorrect string value: '\x80\xA1\xA3' for column 'c' at row 5
+Warning 1366 Incorrect string value: '\x80\xFE@' for column 'c' at row 6
+Warning 1366 Incorrect string value: '\x80@' for column 'c' at row 7
+Warning 1366 Incorrect string value: '\x80\x80' for column 'c' at row 8
+Warning 1366 Incorrect string value: '\x80\x81' for column 'c' at row 9
+Warning 1366 Incorrect string value: '\x80\xA1@' for column 'c' at row 10
+Warning 1366 Incorrect string value: '\x80\xA1\xA3' for column 'c' at row 11
+Warning 1366 Incorrect string value: '\x80\xFE@' for column 'c' at row 12
+Warning 1366 Incorrect string value: '\x80@' for column 'c' at row 13
+Warning 1366 Incorrect string value: '\x80\x80' for column 'c' at row 14
+Warning 1366 Incorrect string value: '\x80\x81' for column 'c' at row 15
+Warning 1366 Incorrect string value: '\x80\xA1@' for column 'c' at row 16
+Warning 1366 Incorrect string value: '\x80\xA1\xA3' for column 'c' at row 17
+Warning 1366 Incorrect string value: '\x80\xFE@' for column 'c' at row 18
+Warning 1366 Incorrect string value: '\x80@' for column 'c' at row 19
+Warning 1366 Incorrect string value: '\x80\x80' for column 'c' at row 20
+Warning 1366 Incorrect string value: '\x80\x81' for column 'c' at row 21
+Warning 1366 Incorrect string value: '\x80\xA1@' for column 'c' at row 22
+Warning 1366 Incorrect string value: '\x80\xA1\xA3' for column 'c' at row 23
+Warning 1366 Incorrect string value: '\x80\xFE@' for column 'c' at row 24
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+24
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+403F40 408040 [ascii,tail][tail][ascii,tail]
+403F3F 408080 [ascii,tail][tail][tail]
+403F3F 408081 [ascii,tail][tail][head,tail]
+403FA140 4080A140 [ascii,tail][tail][mb2,unassigned]
+403FA1A3 4080A1A3 [ascii,tail][tail][mb2]
+403FFE40 4080FE40 [ascii,tail][tail][mb2]
+A1403F40 A1408040 [mb2,unassigned][tail][ascii,tail]
+A1403F3F A1408080 [mb2,unassigned][tail][tail]
+A1403F3F A1408081 [mb2,unassigned][tail][head,tail]
+A1403FA140 A14080A140 [mb2,unassigned][tail][mb2,unassigned]
+A1403FA1A3 A14080A1A3 [mb2,unassigned][tail][mb2]
+A1403FFE40 A14080FE40 [mb2,unassigned][tail][mb2]
+A1A33F40 A1A38040 [mb2][tail][ascii,tail]
+A1A33F3F A1A38080 [mb2][tail][tail]
+A1A33F3F A1A38081 [mb2][tail][head,tail]
+A1A33FA140 A1A380A140 [mb2][tail][mb2,unassigned]
+A1A33FA1A3 A1A380A1A3 [mb2][tail][mb2]
+A1A33FFE40 A1A380FE40 [mb2][tail][mb2]
+FE403F40 FE408040 [mb2][tail][ascii,tail]
+FE403F3F FE408080 [mb2][tail][tail]
+FE403F3F FE408081 [mb2][tail][head,tail]
+FE403FA140 FE4080A140 [mb2][tail][mb2,unassigned]
+FE403FA1A3 FE4080A1A3 [mb2][tail][mb2]
+FE403FFE40 FE4080FE40 [mb2][tail][mb2]
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that consist of two ASCII or MB2 characters,
+# followed by a pure non-ASCII tail, all should be fixed.
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('mb2',type1) OR FIND_IN_SET('ascii',type1)) AND
+(FIND_IN_SET('mb2',type2) OR FIND_IN_SET('ascii',type2)) AND
+type3='tail'
+ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 1
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 2
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 3
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 4
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 5
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 6
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 7
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 8
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 9
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 10
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 11
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 12
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 13
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 14
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 15
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 16
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+16
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+40403F 404080 [ascii,tail][ascii,tail][tail]
+40A1403F 40A14080 [ascii,tail][mb2,unassigned][tail]
+40A1A33F 40A1A380 [ascii,tail][mb2][tail]
+40FE403F 40FE4080 [ascii,tail][mb2][tail]
+A140403F A1404080 [mb2,unassigned][ascii,tail][tail]
+A140A1403F A140A14080 [mb2,unassigned][mb2,unassigned][tail]
+A140A1A33F A140A1A380 [mb2,unassigned][mb2][tail]
+A140FE403F A140FE4080 [mb2,unassigned][mb2][tail]
+A1A3403F A1A34080 [mb2][ascii,tail][tail]
+A1A3A1403F A1A3A14080 [mb2][mb2,unassigned][tail]
+A1A3A1A33F A1A3A1A380 [mb2][mb2][tail]
+A1A3FE403F A1A3FE4080 [mb2][mb2][tail]
+FE40403F FE404080 [mb2][ascii,tail][tail]
+FE40A1403F FE40A14080 [mb2][mb2,unassigned][tail]
+FE40A1A33F FE40A1A380 [mb2][mb2][tail]
+FE40FE403F FE40FE4080 [mb2][mb2][tail]
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that consist of two MB2 characters,
+# followed by a non-ASCII head or tail, all should be fixed.
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE FIND_IN_SET('mb2',type1) AND FIND_IN_SET('mb2',type2)
+AND NOT FIND_IN_SET('ascii',type3)
+AND NOT FIND_IN_SET('mb2',type3)
+ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 1
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 2
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 3
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 4
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 5
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 6
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 7
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 8
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 9
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+9
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+A140A1403F A140A14081 [mb2,unassigned][mb2,unassigned][head,tail]
+A140A1A33F A140A1A381 [mb2,unassigned][mb2][head,tail]
+A140FE403F A140FE4081 [mb2,unassigned][mb2][head,tail]
+A1A3A1403F A1A3A14081 [mb2][mb2,unassigned][head,tail]
+A1A3A1A33F A1A3A1A381 [mb2][mb2][head,tail]
+A1A3FE403F A1A3FE4081 [mb2][mb2][head,tail]
+FE40A1403F FE40A14081 [mb2][mb2,unassigned][head,tail]
+FE40A1A33F FE40A1A381 [mb2][mb2][head,tail]
+FE40FE403F FE40FE4081 [mb2][mb2][head,tail]
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that consist of head + tail + MB2 should go without warnings
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE FIND_IN_SET('head',type1)
+AND FIND_IN_SET('tail',type2)
+AND FIND_IN_SET('mb2',type3)
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+9
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+8140A140 [head,tail][ascii,tail][mb2,unassigned]
+8140A1A3 [head,tail][ascii,tail][mb2]
+8140FE40 [head,tail][ascii,tail][mb2]
+8180A140 [head,tail][tail][mb2,unassigned]
+8180A1A3 [head,tail][tail][mb2]
+8180FE40 [head,tail][tail][mb2]
+8181A140 [head,tail][head,tail][mb2,unassigned]
+8181A1A3 [head,tail][head,tail][mb2]
+8181FE40 [head,tail][head,tail][mb2]
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+#
+# Sequences that consist of (ascii or mb2) + head + tail should go without warnings
+#
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('ascii',type1) OR FIND_IN_SET('mb2',type1))
+AND FIND_IN_SET('head',type2)
+AND FIND_IN_SET('tail',type3)
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+12
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+408140 [ascii,tail][head,tail][ascii,tail]
+408180 [ascii,tail][head,tail][tail]
+408181 [ascii,tail][head,tail][head,tail]
+A1408140 [mb2,unassigned][head,tail][ascii,tail]
+A1408180 [mb2,unassigned][head,tail][tail]
+A1408181 [mb2,unassigned][head,tail][head,tail]
+A1A38140 [mb2][head,tail][ascii,tail]
+A1A38180 [mb2][head,tail][tail]
+A1A38181 [mb2][head,tail][head,tail]
+FE408140 [mb2][head,tail][ascii,tail]
+FE408180 [mb2][head,tail][tail]
+FE408181 [mb2][head,tail][head,tail]
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2 ORDER BY b;
+Warnings:
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 1
+Warning 1366 Incorrect string value: '\xA3' for column 'c' at row 3
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 5
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 6
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 7
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 9
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 10
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 12
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 13
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 15
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 16
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 18
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 19
+Warning 1366 Incorrect string value: '\xA3' for column 'c' at row 27
+Warning 1366 Incorrect string value: '\x80' for column 'c' at row 30
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 31
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 35
+Warning 1366 Incorrect string value: '\xA3' for column 'c' at row 37
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 39
+Warning 1366 Incorrect string value: '\xA3' for column 'c' at row 41
+Warning 1366 Incorrect string value: '\x81' for column 'c' at row 43
+Warning 1366 Incorrect string value: '\xA3' for column 'c' at row 45
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+46
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+HEX(c) comment
+4081A140 [ascii,tail][head,tail][mb2,unassigned]
+4081FE40 [ascii,tail][head,tail][mb2]
+814040 [head,tail][ascii,tail][ascii,tail]
+818040 [head,tail][tail][ascii,tail]
+818140 [head,tail][head,tail][ascii,tail]
+81A14040 [head,tail][mb2,unassigned][ascii,tail]
+81A140A140 [head,tail][mb2,unassigned][mb2,unassigned]
+81A140A1A3 [head,tail][mb2,unassigned][mb2]
+81A140FE40 [head,tail][mb2,unassigned][mb2]
+81A1A340 [head,tail][mb2][ascii,tail]
+81A1A380 [head,tail][mb2][tail]
+81A1A381 [head,tail][mb2][head,tail]
+81A1A3A140 [head,tail][mb2][mb2,unassigned]
+81A1A3FE40 [head,tail][mb2][mb2]
+81FE4040 [head,tail][mb2][ascii,tail]
+81FE40A140 [head,tail][mb2][mb2,unassigned]
+81FE40A1A3 [head,tail][mb2][mb2]
+81FE40FE40 [head,tail][mb2][mb2]
+A14081A140 [mb2,unassigned][head,tail][mb2,unassigned]
+A14081FE40 [mb2,unassigned][head,tail][mb2]
+A1A381A140 [mb2][head,tail][mb2,unassigned]
+A1A381FE40 [mb2][head,tail][mb2]
+FE4081A140 [mb2][head,tail][mb2,unassigned]
+FE4081FE40 [mb2][head,tail][mb2]
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+HEX(c) HEX(b) comment
+40403F 404081 [ascii,tail][ascii,tail][head,tail]
+4081A13F 4081A1A3 [ascii,tail][head,tail][mb2]
+40A1403F 40A14081 [ascii,tail][mb2,unassigned][head,tail]
+40A1A33F 40A1A381 [ascii,tail][mb2][head,tail]
+40FE403F 40FE4081 [ascii,tail][mb2][head,tail]
+81403F 814080 [head,tail][ascii,tail][tail]
+81403F 814081 [head,tail][ascii,tail][head,tail]
+81803F 818080 [head,tail][tail][tail]
+81803F 818081 [head,tail][tail][head,tail]
+81813F 818180 [head,tail][head,tail][tail]
+81813F 818181 [head,tail][head,tail][head,tail]
+81A1403F 81A14080 [head,tail][mb2,unassigned][tail]
+81A1403F 81A14081 [head,tail][mb2,unassigned][head,tail]
+81A1A3A13F 81A1A3A1A3 [head,tail][mb2][mb2]
+81FE403F 81FE4080 [head,tail][mb2][tail]
+81FE403F 81FE4081 [head,tail][mb2][head,tail]
+A140403F A1404081 [mb2,unassigned][ascii,tail][head,tail]
+A14081A13F A14081A1A3 [mb2,unassigned][head,tail][mb2]
+A1A3403F A1A34081 [mb2][ascii,tail][head,tail]
+A1A381A13F A1A381A1A3 [mb2][head,tail][mb2]
+FE40403F FE404081 [mb2][ascii,tail][head,tail]
+FE4081A13F FE4081A1A3 [mb2][head,tail][mb2]
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# END OF MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion
+#
+#
+# MDEV-7661 Unexpected result for: CAST(0xHHHH AS CHAR CHARACTER SET xxx) for incorrect byte sequences
+#
+SELECT HEX(CAST(0xA341 AS CHAR CHARACTER SET gb2312));
+HEX(CAST(0xA341 AS CHAR CHARACTER SET gb2312))
+3F41
+Warnings:
+Warning 1300 Invalid gb2312 character string: '\xA3A'
+SELECT HEX(CONVERT(CAST(0xA341 AS CHAR CHARACTER SET gb2312) USING utf8));
+HEX(CONVERT(CAST(0xA341 AS CHAR CHARACTER SET gb2312) USING utf8))
+3F41
+Warnings:
+Warning 1300 Invalid gb2312 character string: '\xA3A'
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index cf48aaab09b..85035982cf9 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -518,8 +518,8 @@ STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
SHOW COLUMNS FROM t1;
Field Type Null Key Default Extra
-subject varchar(64) NO
-pattern varchar(64) NO
+subject varchar(64) NO NULL
+pattern varchar(64) NO NULL
INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
@@ -689,7 +689,7 @@ create table t1 as select concat(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -702,7 +702,7 @@ create table t1 as select concat(18446744073709551615) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(20) NOT NULL DEFAULT ''
+ `c1` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -715,7 +715,7 @@ create table t1 as select concat(1.1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) NOT NULL DEFAULT ''
+ `c1` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -728,7 +728,7 @@ create table t1 as select concat(1+2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1-2));
@@ -738,7 +738,7 @@ create table t1 as select concat(1-2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1*2));
@@ -748,7 +748,7 @@ create table t1 as select concat(1*2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1/2));
@@ -788,7 +788,7 @@ create table t1 as select concat(-1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(-(1+2)));
@@ -798,7 +798,7 @@ create table t1 as select concat(-(1+2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) NOT NULL DEFAULT ''
+ `c1` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1|2));
@@ -808,7 +808,7 @@ create table t1 as select concat(1|2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1&2));
@@ -818,7 +818,7 @@ create table t1 as select concat(1&2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_count(12)));
@@ -828,7 +828,7 @@ create table t1 as select concat(bit_count(12)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2<<1));
@@ -838,7 +838,7 @@ create table t1 as select concat(2<<1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2>>1));
@@ -848,7 +848,7 @@ create table t1 as select concat(2>>1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(~0));
@@ -858,7 +858,7 @@ create table t1 as select concat(~0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(3^2));
@@ -868,7 +868,7 @@ create table t1 as select concat(3^2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(abs(-2)));
@@ -878,7 +878,7 @@ create table t1 as select concat(abs(-2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(concat(exp(2)),1));
@@ -1008,7 +1008,7 @@ create table t1 as select concat(degrees(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) NOT NULL DEFAULT ''
+ `c1` varchar(23) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(radians(0)));
@@ -1018,7 +1018,7 @@ create table t1 as select concat(radians(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) NOT NULL DEFAULT ''
+ `c1` varchar(23) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ceiling(0.5)));
@@ -1028,7 +1028,7 @@ create table t1 as select concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) NOT NULL DEFAULT ''
+ `c1` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
@@ -1038,7 +1038,7 @@ create table t1 as select concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) NOT NULL DEFAULT ''
+ `c1` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
@@ -1048,7 +1048,7 @@ create table t1 as select concat(round(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sign(0.5)));
@@ -1058,14 +1058,14 @@ create table t1 as select concat(sign(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(rand()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) NOT NULL DEFAULT ''
+ `c1` varchar(23) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(length('a')));
@@ -1075,7 +1075,7 @@ create table t1 as select concat(length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(char_length('a')));
@@ -1085,7 +1085,7 @@ create table t1 as select concat(char_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_length('a')));
@@ -1095,7 +1095,7 @@ create table t1 as select concat(bit_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coercibility('a')));
@@ -1105,7 +1105,7 @@ create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(locate('a','a')));
@@ -1115,7 +1115,7 @@ create table t1 as select concat(locate('a','a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(11) NOT NULL DEFAULT ''
+ `c1` varchar(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(field('c','a','b','c')));
@@ -1125,7 +1125,7 @@ create table t1 as select concat(field('c','a','b','c')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ascii(61)));
@@ -1135,7 +1135,7 @@ create table t1 as select concat(ascii(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ord(61)));
@@ -1145,7 +1145,7 @@ create table t1 as select concat(ord(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(find_in_set('b','a,b,c,d')));
@@ -1155,7 +1155,7 @@ create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select md5('a'), hex(md5('a'));
@@ -1165,7 +1165,7 @@ create table t1 as select md5('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(32) NOT NULL DEFAULT ''
+ `c1` varchar(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select old_password('a'), hex(old_password('a'));
@@ -1175,7 +1175,7 @@ create table t1 as select old_password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(16) NOT NULL DEFAULT ''
+ `c1` varchar(16) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select password('a'), hex(password('a'));
@@ -1185,7 +1185,7 @@ create table t1 as select password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(41) NOT NULL DEFAULT ''
+ `c1` varchar(41) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha('a'), hex(sha('a'));
@@ -1195,7 +1195,7 @@ create table t1 as select sha('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) NOT NULL DEFAULT ''
+ `c1` varchar(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha1('a'), hex(sha1('a'));
@@ -1205,7 +1205,7 @@ create table t1 as select sha1('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) NOT NULL DEFAULT ''
+ `c1` varchar(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('-1' as signed)));
@@ -1215,7 +1215,7 @@ create table t1 as select concat(cast('-1' as signed)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('1' as unsigned)));
@@ -1225,7 +1225,7 @@ create table t1 as select concat(cast('1' as unsigned)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast(1/2 as decimal(5,5))));
@@ -1284,7 +1284,7 @@ create table t1 as select concat(least(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(greatest(1,2)));
@@ -1294,7 +1294,7 @@ create table t1 as select concat(greatest(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(case when 11 then 22 else 33 end));
@@ -1304,7 +1304,7 @@ create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coalesce(1,2)));
@@ -1314,7 +1314,7 @@ create table t1 as select concat(coalesce(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat_ws(1,2,3));
@@ -1324,7 +1324,7 @@ create table t1 as select concat_ws(1,2,3) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(group_concat(1,2,3));
@@ -1352,7 +1352,7 @@ create table t1 as select concat(last_insert_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(benchmark(0,0)));
@@ -1362,7 +1362,7 @@ create table t1 as select concat(benchmark(0,0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sleep(0)));
@@ -1372,7 +1372,7 @@ create table t1 as select concat(sleep(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(is_free_lock('xxxx')));
@@ -1406,7 +1406,7 @@ create table t1 as select concat(crc32('')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(uncompressed_length('')));
@@ -1423,7 +1423,7 @@ create table t1 as select concat(connection_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(inet_aton('127.1.1.1')));
@@ -1459,7 +1459,7 @@ create table t1 as select concat(row_count()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(found_rows()));
@@ -1469,21 +1469,21 @@ create table t1 as select concat(found_rows()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid_short()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) NOT NULL DEFAULT ''
+ `c1` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
@@ -1496,7 +1496,7 @@ create table t1 as select concat(uuid(), cast('a' as char character set latin1))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(37) NOT NULL DEFAULT ''
+ `c1` varchar(37) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
@@ -1516,8 +1516,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT '',
- `c2` int(1) NOT NULL DEFAULT '0'
+ `c1` varchar(1) NOT NULL,
+ `c2` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1;
@@ -1574,8 +1574,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) NOT NULL DEFAULT '',
- `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `c1` varchar(4) NOT NULL,
+ `c2` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1.1;
@@ -1613,7 +1613,7 @@ create table t1 as select concat('a'='a' IS TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a'='a' IS NOT TRUE));
@@ -1623,7 +1623,7 @@ create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(NOT 'a'='a'));
@@ -1633,7 +1633,7 @@ create table t1 as select concat(NOT 'a'='a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NULL));
@@ -1643,7 +1643,7 @@ create table t1 as select concat('a' IS NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NOT NULL));
@@ -1653,7 +1653,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' rlike 'a'));
@@ -1663,7 +1663,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(strcmp('a','b')));
@@ -1673,7 +1673,7 @@ create table t1 as select concat(strcmp('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' like 'a'));
@@ -1683,7 +1683,7 @@ create table t1 as select concat('a' like 'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' between 'b' and 'c'));
@@ -1693,7 +1693,7 @@ create table t1 as select concat('a' between 'b' and 'c') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' in ('a','b')));
@@ -1703,7 +1703,7 @@ create table t1 as select concat('a' in ('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
@@ -1713,7 +1713,7 @@ create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(10), fulltext key(a));
@@ -1735,7 +1735,7 @@ create table t1 as select ifnull(1,'a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1,1)));
@@ -1745,7 +1745,7 @@ create table t1 as select concat(ifnull(1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1.1,1.1)));
@@ -1755,7 +1755,7 @@ create table t1 as select concat(ifnull(1.1,1.1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) NOT NULL DEFAULT ''
+ `c1` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,'b',1));
@@ -1765,7 +1765,7 @@ create table t1 as select if(1,'b',1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,1,'b'));
@@ -1775,7 +1775,7 @@ create table t1 as select if(1,1,'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(if(1,1,1)));
@@ -1785,7 +1785,7 @@ create table t1 as select concat(if(1,1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(nullif(1,2)));
@@ -1865,7 +1865,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -1875,7 +1875,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
@@ -1950,7 +1950,7 @@ create table t1 as select concat(period_add(200902, 2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) NOT NULL DEFAULT ''
+ `c1` varchar(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(period_diff(200902, 200802)));
@@ -1962,7 +1962,7 @@ Warning 1265 Data truncated for column 'c1' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) NOT NULL DEFAULT ''
+ `c1` varchar(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(to_days(20090224)));
@@ -2159,21 +2159,21 @@ create table t1 as select concat(curdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_date()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(curtime()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat('a',20) as c1 limit 0;
@@ -2189,7 +2189,7 @@ create table t1 as select concat(utc_time()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sec_to_time(2378)));
@@ -2282,21 +2282,21 @@ create table t1 as select concat(now()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) NOT NULL DEFAULT ''
+ `c1` varchar(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_timestamp()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) NOT NULL DEFAULT ''
+ `c1` varchar(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(sysdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) NOT NULL DEFAULT ''
+ `c1` varchar(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(addtime('00:00:00','11:22:33')));
@@ -2336,7 +2336,7 @@ create table t1 as select export_set(1,2,3,4,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(127) NOT NULL DEFAULT ''
+ `c1` varchar(127) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(insert(1133,3,0,22));
@@ -2346,7 +2346,7 @@ create table t1 as select insert(1133,3,0,22) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) NOT NULL DEFAULT ''
+ `c1` varchar(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lcase(123));
@@ -2356,7 +2356,7 @@ create table t1 as select lcase(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(123,1));
@@ -2366,7 +2366,7 @@ create table t1 as select left(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lower(123));
@@ -2376,7 +2376,7 @@ create table t1 as select lower(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) NOT NULL DEFAULT ''
+ `c1` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lpad(1,2,0));
@@ -2386,7 +2386,7 @@ create table t1 as select lpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ltrim(1));
@@ -2396,7 +2396,7 @@ create table t1 as select ltrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(mid(1,1,1));
@@ -2406,7 +2406,7 @@ create table t1 as select mid(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(repeat(1,2));
@@ -2416,7 +2416,7 @@ create table t1 as select repeat(1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(replace(1,1,2));
@@ -2426,7 +2426,7 @@ create table t1 as select replace(1,1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(reverse(12));
@@ -2436,7 +2436,7 @@ create table t1 as select reverse(12) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(right(123,1));
@@ -2446,7 +2446,7 @@ create table t1 as select right(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rpad(1,2,0));
@@ -2456,7 +2456,7 @@ create table t1 as select rpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) NOT NULL DEFAULT ''
+ `c1` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rtrim(1));
@@ -2466,7 +2466,7 @@ create table t1 as select rtrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(soundex(1));
@@ -2476,7 +2476,7 @@ create table t1 as select soundex(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) NOT NULL DEFAULT ''
+ `c1` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(substring(1,1,1));
@@ -2486,7 +2486,7 @@ create table t1 as select substring(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(trim(1));
@@ -2496,7 +2496,7 @@ create table t1 as select trim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ucase(1));
@@ -2506,7 +2506,7 @@ create table t1 as select ucase(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(upper(1));
@@ -2516,14 +2516,14 @@ create table t1 as select upper(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) NOT NULL DEFAULT ''
+ `c1` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat(' ', 64) as a limit 0;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) NOT NULL DEFAULT ''
+ `a` varchar(64) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ("1.1"), ("2.1");
select a, hex(a) from t1;
@@ -2752,7 +2752,7 @@ t2 CREATE TABLE `t2` (
`concat(a)` varbinary(64) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -2773,7 +2773,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(19) NOT NULL DEFAULT ''
+ `concat(a)` varchar(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a date);
@@ -3064,7 +3064,7 @@ hex(a)
0000000000000001
drop table t1;
drop view v1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -3313,7 +3313,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`CONCAT(a)` varchar(9) DEFAULT NULL,
- `IFNULL(a,'')` varchar(9) NOT NULL DEFAULT '',
+ `IFNULL(a,'')` varchar(9) NOT NULL,
`IF(a,a,'')` varchar(9) DEFAULT NULL,
`CASE WHEN a THEN a ELSE '' END` varchar(9) DEFAULT NULL,
`COALESCE(a,'')` varchar(9) DEFAULT NULL
@@ -3323,14 +3323,14 @@ CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `CONCAT_WS(1,2,3)` varchar(3) NOT NULL DEFAULT ''
+ `CONCAT_WS(1,2,3)` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `INSERT(1133,3,0,22)` varchar(6) NOT NULL DEFAULT ''
+ `INSERT(1133,3,0,22)` varchar(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LCASE(a) FROM t1;
@@ -3351,35 +3351,35 @@ CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPEAT(1,2)` varchar(2) NOT NULL DEFAULT ''
+ `REPEAT(1,2)` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LEFT(123,2)` varchar(2) NOT NULL DEFAULT ''
+ `LEFT(123,2)` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RIGHT(123,2)` varchar(2) NOT NULL DEFAULT ''
+ `RIGHT(123,2)` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LTRIM(123)` varchar(3) NOT NULL DEFAULT ''
+ `LTRIM(123)` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RTRIM(123)` varchar(3) NOT NULL DEFAULT ''
+ `RTRIM(123)` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1;
@@ -3393,35 +3393,35 @@ CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPLACE(111,2,3)` varchar(3) NOT NULL DEFAULT ''
+ `REPLACE(111,2,3)` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SUBSTRING_INDEX(111,111,1)` varchar(3) NOT NULL DEFAULT ''
+ `SUBSTRING_INDEX(111,111,1)` varchar(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `MAKE_SET(111,222,3)` varchar(5) NOT NULL DEFAULT ''
+ `MAKE_SET(111,222,3)` varchar(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SOUNDEX(1)` varchar(4) NOT NULL DEFAULT ''
+ `SOUNDEX(1)` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8);
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `EXPORT_SET(1,'Y','N','',8)` varchar(64) NOT NULL DEFAULT ''
+ `EXPORT_SET(1,'Y','N','',8)` varchar(64) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
@@ -3445,7 +3445,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
+1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
@@ -3585,7 +3585,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`d` date DEFAULT NULL,
- `bad` varchar(10) DEFAULT NULL
+ `bad` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET NAMES latin1;
@@ -3629,7 +3629,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) NOT NULL DEFAULT ''
+ `a` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3649,7 +3649,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) NOT NULL DEFAULT ''
+ `a` varchar(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3873,7 +3873,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3893,7 +3893,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4117,7 +4117,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4137,7 +4137,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4361,7 +4361,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varbinary(1) NOT NULL DEFAULT ''
+ `a` varbinary(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4381,7 +4381,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varbinary(5) NOT NULL DEFAULT ''
+ `a` varbinary(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -7676,7 +7676,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -7699,7 +7699,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -7722,7 +7722,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -7745,7 +7745,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -7764,6 +7764,31 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
SET NAMES latin1 COLLATE latin1_bin;
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
@@ -7772,7 +7797,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -7795,7 +7820,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -7818,7 +7843,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -7841,7 +7866,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -7861,6 +7886,31 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
+#
# MDEV-6752 Trailing incomplete characters are not replaced to question marks on conversion
#
SET NAMES utf8, character_set_connection=latin1;
@@ -7942,3 +7992,221 @@ DROP TABLE t1;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8661 Wrong result for SELECT..WHERE a='a' AND a='a' COLLATE latin1_bin
+#
+SET NAMES latin1;
+CREATE TABLE t1 (a CHAR(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a' AND a='a' COLLATE latin1_bin;
+a
+a
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a' COLLATE latin1_bin AND a='A' COLLATE latin1_swedish_ci;
+a
+a
+DROP TABLE t1;
+#
+# MDEV-8679 Equal field propagation is not used for VARCHAR when it safely could
+#
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('10'),('11'),('12');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='10' AND IF(a='10',1,0)=1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '10')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='10' AND CASE WHEN a='10' THEN 1 ELSE 0 END;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '10')
+DROP TABLE t1;
+#
+# MDEV-8680 Wrong result for SELECT..WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='a'
+#
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b');
+a
+a
+SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='a';
+a
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`a` in (<cache>(('a' collate latin1_bin)),'b')))
+DROP TABLE t1;
+#
+# MDEV-8698 Wrong result for SELECT..WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin;
+#
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a'),('A'),('b'),('B'),('c'),('C');
+SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin;
+a
+a
+b
+c
+SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin AND a='a';
+a
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`a` between 'a' and <cache>(('c' collate latin1_bin))))
+DROP TABLE t1;
+#
+# MDEV-8707 Wrong result for SELECT..WHERE varchar_column=DATE'2001-01-01' AND varchar_column='2001-01-01'
+#
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(40));
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01x');
+SELECT * FROM t1 WHERE a=DATE'2001-01-01' AND a='2001-01-01';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a='2001-01-01' AND a=DATE'2001-01-01';
+a
+2001-01-01
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01x',DATE'2001-01-01');
+a
+2001-01-01x
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01x');
+a
+2001-01-01x
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01',DATE'2001-01-01');
+a
+2001-01-01
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01');
+a
+2001-01-01
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('2001-01-01','2001-01-01x'));
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01x');
+SELECT * FROM t1 WHERE a=DATE'2001-01-01' AND a='2001-01-01';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a='2001-01-01' AND a=DATE'2001-01-01';
+a
+2001-01-01
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01x',DATE'2001-01-01');
+a
+2001-01-01x
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01x');
+a
+2001-01-01x
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01',DATE'2001-01-01');
+a
+2001-01-01
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01');
+a
+2001-01-01
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(40),b VARCHAR(40));
+INSERT INTO t1 VALUES ('2001-01-01','2001-01-01x');
+SELECT * FROM t1 WHERE a=b AND a=DATE'2001-01-01';
+a b
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('2001-01-01','2001-01-01x'),b ENUM('2001-01-01','2001-01-01x'));
+INSERT INTO t1 VALUES ('2001-01-01','2001-01-01x');
+SELECT * FROM t1 WHERE a=b AND a=DATE'2001-01-01';
+a b
+DROP TABLE t1;
+#
+# MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
+#
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE CRC32(a)=3904355907;
+a LENGTH(a) CRC32(a)
+a 1 3904355907
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+a LENGTH(a) CRC32(a)
+a 1 3904355907
+# 'a' should not be propagated into CRC32(a)
+EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (crc32(`test`.`t1`.`a`) = 3904355907))
+SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61';
+a HEX(a)
+a 61
+SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+a HEX(a)
+a 61
+# 'a' should not be propagated into HEX(a)
+EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (hex(`test`.`t1`.`a`) = '61'))
+SELECT * FROM t1 WHERE a='a';
+a
+a
+a
+SELECT * FROM t1 WHERE LENGTH(a)=2;
+a
+a
+SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+a
+a
+# 'a' should not be propagated into LENGTH(a)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (length(`test`.`t1`.`a`) = 2))
+DROP TABLE t1;
+#
+# MDEV-8712 Wrong result for SELECT..WHERE latin1_bin_column=_latin1'a' AND latin1_bin_column='A'
+#
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(20) COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT * FROM t1 WHERE a='A';
+a
+SELECT * FROM t1 WHERE a='A' AND a=_latin1'a';
+a
+SELECT * FROM t1 WHERE a=_latin1'a' AND a='A';
+a
+SELECT * FROM t1 WHERE a=_latin1'A';
+a
+SELECT * FROM t1 WHERE a=_latin1'A' AND a=_latin1'a';
+a
+SELECT * FROM t1 WHERE a=_latin1'a' AND a=_latin1'A';
+a
+DROP TABLE t1;
+#
+# MDEV-8253 EXPLAIN SELECT prints unexpected characters
+#
+SET NAMES latin1;
+CREATE TABLE t1 (a DECIMAL(10,1),b DECIMAL(10,1),c VARCHAR(10),d VARCHAR(10));
+INSERT INTO t1 VALUES (1.5,1.5,'1','1'),(3.5,3.5,'3','3');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(c,0)='3 ' AND COALESCE(d,0)=COALESCE(c,0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '3 '))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result
index d20a9c89349..d34d132e3a9 100644
--- a/mysql-test/r/ctype_latin1_de.result
+++ b/mysql-test/r/ctype_latin1_de.result
@@ -490,8 +490,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) COLLATE latin1_german2_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -545,7 +545,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) COLLATE latin1_german2_ci NOT NULL DEFAULT ''
+ `a` varchar(1) COLLATE latin1_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -565,7 +565,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) COLLATE latin1_german2_ci NOT NULL DEFAULT ''
+ `a` varchar(5) COLLATE latin1_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/r/ctype_latin2.result b/mysql-test/r/ctype_latin2.result
index 65aa2368ce4..634640cab1d 100644
--- a/mysql-test/r/ctype_latin2.result
+++ b/mysql-test/r/ctype_latin2.result
@@ -396,7 +396,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET latin2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -416,7 +416,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET latin2 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET latin2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -626,7 +626,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 64) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET latin2 NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET latin2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('');
SELECT CHARSET(CONCAT(a,'2001-01-08 00:00:00' - INTERVAL 7 DAY)) FROM t1;
@@ -677,7 +677,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET latin2 COLLATE latin2_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET latin2 COLLATE latin2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -697,7 +697,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET latin2 COLLATE latin2_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET latin2 COLLATE latin2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/r/ctype_latin2_ch.result b/mysql-test/r/ctype_latin2_ch.result
index e54522eec9f..da5c8076fca 100644
--- a/mysql-test/r/ctype_latin2_ch.result
+++ b/mysql-test/r/ctype_latin2_ch.result
@@ -45,6 +45,126 @@ strcmp('a\t','a' )
SELECT strcmp('a\t','a ');
strcmp('a\t','a ')
0
+#
+# MDEV-7149 Constant condition propagation erroneously applied for LIKE
+#
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE CONCAT(c1)='a';
+c1
+a
+a
+SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
+c1
+a
+SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a '))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
+c1
+a
+a
+SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
+c1
+a
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '% '=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '%'=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
create table t1 (
a varchar(2) character set latin2 collate latin2_czech_cs,
primary key(a)
@@ -213,6 +333,7 @@ Y
z
Z
DROP TABLE t1;
+set sql_mode="";
CREATE TABLE t1 ENGINE=INNODB AS SELECT repeat('a', 5) AS s1 LIMIT 0;
INSERT INTO t1 VALUES ('x'),('y'),('z'),('X'),('Y'),('Z');
SELECT * FROM t1 GROUP BY s1;
@@ -389,7 +510,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -409,7 +530,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
index acb92a8363b..d333c03143b 100644
--- a/mysql-test/r/ctype_ldml.result
+++ b/mysql-test/r/ctype_ldml.result
@@ -460,6 +460,7 @@ utf8mb4_test_400_ci utf8mb4 328 8
latin1_test2 latin1 332 1
utf8_bengali_standard_ci utf8 336 8
utf8_bengali_traditional_ci utf8 337 8
+utf8_implicit_weights_ci utf8 338 8
utf8_phone_ci utf8 352 8
utf8_test_ci utf8 353 8
utf8_5624_1 utf8 354 8
@@ -1156,3 +1157,25 @@ Warning 1273 Expansion too long: 'a\u002Daaaaaa10'
#
# Search for occurrences of [ERROR] Syntax error at '[strength tertiary]'
Occurances : 2
+#
+# MDEV-8686 A user defined collation utf8_confusables doesn't work
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_implicit_weights_ci);
+INSERT INTO t1 VALUES ('a'),('b'),('c');
+INSERT INTO t1 VALUES (_ucs2 0x1500),(_ucs2 0x1501);
+INSERT INTO t1 VALUES (_ucs2 0x3400),(_ucs2 0x3560),(_ucs2 0x3561),(_ucs2 0x3600);
+INSERT INTO t1 VALUES (_ucs2 0x3700),(_ucs2 0x3701);
+SELECT HEX(CONVERT(a USING ucs2)) AS ch, HEX(WEIGHT_STRING(a)) AS w, HEX(WEIGHT_STRING(a COLLATE utf8_unicode_ci)) AS ducet FROM t1 ORDER BY a,ch;
+ch w ducet
+0061 0E33 0E33
+3561 0E33 FB80B561
+0063 0E60 0E60
+1500 0E60 1BAD
+0062 FB80B400 0E4A
+3400 FB80B400 FB80B400
+3560 FB80B560 FB80B560
+1501 FB80B600 1BAE
+3600 FB80B600 FB80B600
+3700 FB80B700 FB80B700
+3701 FB80B700 FB80B701
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_like_range.result b/mysql-test/r/ctype_like_range.result
index 41080147908..be66c680e3a 100644
--- a/mysql-test/r/ctype_like_range.result
+++ b/mysql-test/r/ctype_like_range.result
@@ -1,3 +1,4 @@
+SET NAMES utf8;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARBINARY(32));
@@ -284,6 +285,8 @@ id name val
32 mx 63616161616161616161616161616161
32 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
+INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F);
+INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F);
SELECT * FROM v1;
id name val
1 a
@@ -414,6 +417,22 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SELECT * FROM v1;
id name val
@@ -545,6 +564,22 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_czech_ci;
SELECT * FROM v1;
id name val
@@ -676,6 +711,22 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci;
SELECT * FROM v1;
id name val
@@ -807,6 +858,169 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_thai_520_w2;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 09
+2 mx EFBFBF
+2 sp --------------------------------
+3 a %
+3 mn 09090909090909090909090909090909
+3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 6109
+9 mx 61EFBFBF
+9 sp --------------------------------
+10 a c_
+10 mn 6309
+10 mx 63EFBFBF
+10 sp --------------------------------
+11 a a%
+11 mn 61090909090909090909090909090909
+11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+11 sp --------------------------------
+12 a c%
+12 mn 63090909090909090909090909090909
+12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 616109
+16 mx 6161EFBFBF
+16 sp --------------------------------
+17 a cc_
+17 mn 636309
+17 mx 6363EFBFBF
+17 sp --------------------------------
+18 a ch_
+18 mn 636809
+18 mx 6368EFBFBF
+18 sp --------------------------------
+19 a aa%
+19 mn 61610909090909090909090909090909
+19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+19 sp --------------------------------
+20 a cc%
+20 mn 63630909090909090909090909090909
+20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+20 sp --------------------------------
+21 a ch%
+21 mn 63680909090909090909090909090909
+21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61616109
+25 mx 616161EFBFBF
+25 sp --------------------------------
+26 a ccc_
+26 mn 63636309
+26 mx 636363EFBFBF
+26 sp --------------------------------
+27 a cch_
+27 mn 63636809
+27 mx 636368EFBFBF
+27 sp --------------------------------
+28 a aaa%
+28 mn 61616109090909090909090909090909
+28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+28 sp --------------------------------
+29 a ccc%
+29 mn 63636309090909090909090909090909
+29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+29 sp --------------------------------
+30 a cch%
+30 mn 63636809090909090909090909090909
+30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 6161616161
+31 mx 6161616161
+31 sp --------------------------------
+32 a caaaaaaaaaaaaaaaaaaa
+32 mn 6361616161
+32 mx 6361616161
+32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4;
SELECT * FROM v1;
id name val
@@ -938,6 +1152,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SELECT * FROM v1;
id name val
@@ -1069,6 +1299,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_czech_ci;
SELECT * FROM v1;
id name val
@@ -1200,6 +1446,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci;
SELECT * FROM v1;
id name val
@@ -1331,6 +1593,169 @@ id name val
32 mn 63616109090909090909090909090909
32 mx 636161EFBFBFEFBFBFEFBFBFEFBFBF20
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 09
+2 mx EFBFBF
+2 sp --------------------------------
+3 a %
+3 mn 09090909090909090909090909090909
+3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 6109
+9 mx 61EFBFBF
+9 sp --------------------------------
+10 a c_
+10 mn 6309
+10 mx 63EFBFBF
+10 sp --------------------------------
+11 a a%
+11 mn 61090909090909090909090909090909
+11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+11 sp --------------------------------
+12 a c%
+12 mn 63090909090909090909090909090909
+12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 616109
+16 mx 6161EFBFBF
+16 sp --------------------------------
+17 a cc_
+17 mn 636309
+17 mx 6363EFBFBF
+17 sp --------------------------------
+18 a ch_
+18 mn 636809
+18 mx 6368EFBFBF
+18 sp --------------------------------
+19 a aa%
+19 mn 61610909090909090909090909090909
+19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+19 sp --------------------------------
+20 a cc%
+20 mn 63630909090909090909090909090909
+20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+20 sp --------------------------------
+21 a ch%
+21 mn 63680909090909090909090909090909
+21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61616109
+25 mx 616161EFBFBF
+25 sp --------------------------------
+26 a ccc_
+26 mn 63636309
+26 mx 636363EFBFBF
+26 sp --------------------------------
+27 a cch_
+27 mn 63636809
+27 mx 636368EFBFBF
+27 sp --------------------------------
+28 a aaa%
+28 mn 61616109090909090909090909090909
+28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+28 sp --------------------------------
+29 a ccc%
+29 mn 63636309090909090909090909090909
+29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+29 sp --------------------------------
+30 a cch%
+30 mn 63636809090909090909090909090909
+30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 61616161
+31 mx 61616161
+31 sp --------------------------------
+32 a caaaaaaaaaaaaaaaaaaa
+32 mn 63616161
+32 mx 63616161
+32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
SELECT * FROM v1;
id name val
@@ -1462,6 +1887,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
+33 a Х
+33 mn D0A5
+33 mx D0A5
+33 sp --------------------------------
+34 a ÑŸ
+34 mn D19F
+34 mx D19F
+34 sp --------------------------------
+35 a ┥
+35 mn E294A5
+35 mx E294A5
+35 sp --------------------------------
+36 a 彟
+36 mn E5BD9F
+36 mx E5BD9F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2;
SELECT * FROM v1;
id name val
@@ -1593,6 +2034,22 @@ id name val
32 mn 00630061006100610061006100610061
32 mx 00630061006100610061006100610061
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
SELECT * FROM v1;
id name val
@@ -1724,6 +2181,22 @@ id name val
32 mn 00630061006100610061006100610061
32 mx 00630061006100610061006100610061
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
SELECT * FROM v1;
id name val
@@ -1855,6 +2328,22 @@ id name val
32 mn 00630061006100610061006100610061
32 mx 00630061006100610061006100610061
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
SELECT * FROM v1;
id name val
@@ -1986,6 +2475,169 @@ id name val
32 mn 00630061006100610061006100610009
32 mx 0063006100610061006100610061FFFF
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610009
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630009
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610009000900090009000900090009
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630009000900090009000900090009
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630009
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000900090009000900090009
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610009
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630009
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100090009000900090009
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300090009000900090009
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00610061006100610061006100610061
+31 mx 00610061006100610061006100610061
+31 sp --------------------------------
+32 a caaaaaaaaaaaaaaaaaaa
+32 mn 00630061006100610061006100610061
+32 mx 00630061006100610061006100610061
+32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
SELECT * FROM v1;
id name val
@@ -2117,6 +2769,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci;
SELECT * FROM v1;
id name val
@@ -2248,6 +2916,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_czech_ci;
SELECT * FROM v1;
id name val
@@ -2379,6 +3063,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci;
SELECT * FROM v1;
id name val
@@ -2510,6 +3210,169 @@ id name val
32 mn 00630061006100090009000900090009
32 mx 006300610061FFFFFFFFFFFFFFFFFFFF
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_thai_520_w2;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610009
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630009
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610009000900090009000900090009
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630009000900090009000900090009
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630009
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000900090009000900090009
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610009
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630009
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100090009000900090009
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300090009000900090009
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 0061006100610061
+31 mx 0061006100610061
+31 sp --------------------------------
+32 a caaaaaaaaaaaaaaaaaaa
+32 mn 0063006100610061
+32 mx 0063006100610061
+32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci;
SELECT * FROM v1;
id name val
@@ -2641,6 +3504,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
+33 a Х
+33 mn 0425
+33 mx 0425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 045F
+34 mx 045F
+34 sp --------------------------------
+35 a ┥
+35 mn 2525
+35 mx 2525
+35 sp --------------------------------
+36 a 彟
+36 mn 5F5F
+36 mx 5F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32;
SELECT * FROM v1;
id name val
@@ -2772,6 +3651,22 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
+33 a Х
+33 mn 00000425
+33 mx 00000425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 0000045F
+34 mx 0000045F
+34 sp --------------------------------
+35 a ┥
+35 mn 00002525
+35 mx 00002525
+35 sp --------------------------------
+36 a 彟
+36 mn 00005F5F
+36 mx 00005F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci;
SELECT * FROM v1;
id name val
@@ -2903,6 +3798,22 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
+33 a Х
+33 mn 00000425
+33 mx 00000425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 0000045F
+34 mx 0000045F
+34 sp --------------------------------
+35 a ┥
+35 mn 00002525
+35 mx 00002525
+35 sp --------------------------------
+36 a 彟
+36 mn 00005F5F
+36 mx 00005F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_czech_ci;
SELECT * FROM v1;
id name val
@@ -3034,6 +3945,22 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
+33 a Х
+33 mn 00000425
+33 mx 00000425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 0000045F
+34 mx 0000045F
+34 sp --------------------------------
+35 a ┥
+35 mn 00002525
+35 mx 00002525
+35 sp --------------------------------
+36 a 彟
+36 mn 00005F5F
+36 mx 00005F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci;
SELECT * FROM v1;
id name val
@@ -3165,6 +4092,169 @@ id name val
32 mn 00000063000000610000006100000009
32 mx 0000006300000061000000610000FFFF
32 sp --------------------------------
+33 a Х
+33 mn 00000425
+33 mx 00000425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 0000045F
+34 mx 0000045F
+34 sp --------------------------------
+35 a ┥
+35 mn 00002525
+35 mx 00002525
+35 sp --------------------------------
+36 a 彟
+36 mn 00005F5F
+36 mx 00005F5F
+36 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_thai_520_w2;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00000009
+2 mx 0000FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00000009000000090000000900000009
+3 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+3 sp --------------------------------
+4 a \_
+4 mn 0000005F
+4 mx 0000005F
+4 sp --------------------------------
+5 a \%
+5 mn 00000025
+5 mx 00000025
+5 sp --------------------------------
+6 a \
+6 mn 0000005C
+6 mx 0000005C
+6 sp --------------------------------
+7 a a
+7 mn 00000061
+7 mx 00000061
+7 sp --------------------------------
+8 a c
+8 mn 00000063
+8 mx 00000063
+8 sp --------------------------------
+9 a a_
+9 mn 0000006100000009
+9 mx 000000610000FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 0000006300000009
+10 mx 000000630000FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00000061000000090000000900000009
+11 mx 000000610000FFFF0000FFFF0000FFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00000063000000090000000900000009
+12 mx 000000630000FFFF0000FFFF0000FFFF
+12 sp --------------------------------
+13 a aa
+13 mn 0000006100000061
+13 mx 0000006100000061
+13 sp --------------------------------
+14 a cc
+14 mn 0000006300000063
+14 mx 0000006300000063
+14 sp --------------------------------
+15 a ch
+15 mn 0000006300000068
+15 mx 0000006300000068
+15 sp --------------------------------
+16 a aa_
+16 mn 000000610000006100000009
+16 mx 00000061000000610000FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 000000630000006300000009
+17 mx 00000063000000630000FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 000000630000006800000009
+18 mx 00000063000000680000FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00000061000000610000000900000009
+19 mx 00000061000000610000FFFF0000FFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00000063000000630000000900000009
+20 mx 00000063000000630000FFFF0000FFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00000063000000680000000900000009
+21 mx 00000063000000680000FFFF0000FFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 000000610000006100000061
+22 mx 000000610000006100000061
+22 sp --------------------------------
+23 a ccc
+23 mn 000000630000006300000063
+23 mx 000000630000006300000063
+23 sp --------------------------------
+24 a cch
+24 mn 000000630000006300000068
+24 mx 000000630000006300000068
+24 sp --------------------------------
+25 a aaa_
+25 mn 00000061000000610000006100000009
+25 mx 0000006100000061000000610000FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 00000063000000630000006300000009
+26 mx 0000006300000063000000630000FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 00000063000000630000006800000009
+27 mx 0000006300000063000000680000FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00000061000000610000006100000009
+28 mx 0000006100000061000000610000FFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00000063000000630000006300000009
+29 mx 0000006300000063000000630000FFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00000063000000630000006800000009
+30 mx 0000006300000063000000680000FFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00000061000000610000006100000061
+31 mx 00000061000000610000006100000061
+31 sp --------------------------------
+32 a caaaaaaaaaaaaaaaaaaa
+32 mn 00000063000000610000006100000061
+32 mx 00000063000000610000006100000061
+32 sp --------------------------------
+33 a Х
+33 mn 00000425
+33 mx 00000425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 0000045F
+34 mx 0000045F
+34 sp --------------------------------
+35 a ┥
+35 mn 00002525
+35 mx 00002525
+35 sp --------------------------------
+36 a 彟
+36 mn 00005F5F
+36 mx 00005F5F
+36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci;
SELECT * FROM v1;
id name val
@@ -3296,5 +4386,21 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
+33 a Х
+33 mn 00000425
+33 mx 00000425
+33 sp --------------------------------
+34 a ÑŸ
+34 mn 0000045F
+34 mx 0000045F
+34 sp --------------------------------
+35 a ┥
+35 mn 00002525
+35 mx 00002525
+35 sp --------------------------------
+36 a 彟
+36 mn 00005F5F
+36 mx 00005F5F
+36 sp --------------------------------
DROP VIEW v1;
DROP TABLE t1;
diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result
index 3c1c96fc47c..59443a3a2d5 100644
--- a/mysql-test/r/ctype_many.result
+++ b/mysql-test/r/ctype_many.result
@@ -1694,6 +1694,7 @@ DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
AS BINARY(0)) USING utf8);
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'Zpq'
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect BINARY(0) value: '1.'
#
# End of 5.1 tests
@@ -1787,3 +1788,24 @@ SELECT * FROM t2 WHERE a=(SELECT a FROM t1) AND a=_LATIN1'x';
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t2;
DROP TABLE t1;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8362 dash '-' is not recognized in charset armscii8 on select where query
+#
+CREATE TABLE t1 (a VARCHAR(64) CHARACTER SET armscii8);
+INSERT INTO t1 VALUES ('abc-def');
+SELECT * FROM t1 WHERE a='abc-def';
+a
+abc-def
+SELECT * FROM t1 WHERE a LIKE 'abc%';
+a
+abc-def
+DROP TABLE t1;
+SELECT HEX(CONVERT(_utf8 0x2728292C2D2E USING armscii8));
+HEX(CONVERT(_utf8 0x2728292C2D2E USING armscii8))
+2728292C2D2E
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result
index 5c578e3356c..b6e93bae65a 100644
--- a/mysql-test/r/ctype_mb.result
+++ b/mysql-test/r/ctype_mb.result
@@ -3,16 +3,16 @@ CREATE TABLE t1 SELECT _utf8'test' as c1, _utf8'теÑÑ‚' as c2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c2` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL,
+ `c2` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DELETE FROM t1;
ALTER TABLE t1 ADD c3 CHAR(4) CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c2` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '',
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL,
+ `c2` varchar(4) CHARACTER SET utf8 NOT NULL,
`c3` char(4) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd');
diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result
index 48456c16705..46686933298 100644
--- a/mysql-test/r/ctype_sjis.result
+++ b/mysql-test/r/ctype_sjis.result
@@ -193,9 +193,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -218,8 +230,8 @@ STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
SHOW COLUMNS FROM t1;
Field Type Null Key Default Extra
-subject varchar(64) NO
-pattern varchar(64) NO
+subject varchar(64) NO NULL
+pattern varchar(64) NO NULL
INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
@@ -347,9 +359,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -401,12 +425,14 @@ WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN 'A1' AND 'DF')
AND (tail BETWEEN '20' AND 'FF')
ORDER BY head, tail;
INSERT t1 (code) SELECT head FROM head WHERE (head BETWEEN 'A1' AND 'DF');
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`code` varchar(8) DEFAULT NULL,
- `a` varchar(1) CHARACTER SET sjis NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET sjis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
UPDATE t1 SET a=unhex(code) ORDER BY code;
Warnings:
@@ -477,7 +503,7 @@ Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
SELECT COUNT(*) FROM t1;
COUNT(*)
14623
-SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=1;
+SELECT COUNT(*) FROM t1 WHERE a<>'?' AND OCTET_LENGTH(a)=1;
COUNT(*)
63
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
@@ -659,10 +685,140 @@ WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
81F0 â„«
+Warnings:
+Warning 1977 Cannot convert 'sjis' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EA to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EA to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
+Warnings:
+Warning 1977 Cannot convert 'sjis' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EA to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EA to 'utf8'
#
# WL#3090 Japanese Character Set adjustments
# Test sjis->Unicode conversion
@@ -7612,6 +7768,71 @@ EAA1 E98199
EAA2 E791A4
EAA3 E5879C
EAA4 E78699
+Warnings:
+Warning 1977 Cannot convert 'sjis' character 0x81AD to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AE to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81AF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81B7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81C7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81CF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D0 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D1 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D2 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D3 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D4 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D5 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D6 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D7 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D8 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81D9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81E9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EA to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EB to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EC to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81ED to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EE to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81EF to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81F8 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81F9 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81FA to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x81FB to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8240 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8241 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8242 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8243 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8244 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8245 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8246 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8247 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8248 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8249 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x824A to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x824B to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x824C to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x824D to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x824E to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x8259 to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x825A to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x825B to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x825C to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x825D to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x825E to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x825F to 'utf8'
+Warning 1977 Cannot convert 'sjis' character 0x827A to 'utf8'
DROP TABLE t1;
#
# WL#3090 Japanese Character Set adjustments
@@ -14731,7 +14952,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET sjis NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET sjis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -14751,7 +14972,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET sjis NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET sjis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -14990,7 +15211,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET sjis COLLATE sjis_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET sjis COLLATE sjis_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -15010,7 +15231,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET sjis COLLATE sjis_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET sjis COLLATE sjis_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -18353,7 +18574,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET sjis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\'),('à\t');
INSERT INTO t1 VALUES ('\\à\'),('\\à\t'),('\\à\t\t');
@@ -18392,7 +18613,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET sjis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('à\')),(BINARY('à\t'));
INSERT INTO t1 VALUES (BINARY('\\à\')),(BINARY('\\à\t')),(BINARY('\\à\t\t'));
@@ -18431,7 +18652,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET sjis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'à\'),(_BINARY'à\t');
INSERT INTO t1 VALUES (_BINARY'\\à\'),(_BINARY'\\à\t'),(_BINARY'\\à\t\t');
@@ -18477,7 +18698,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
+ `a` varchar(10) CHARACTER SET sjis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
@@ -18497,7 +18718,7 @@ CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varbinary(10) NOT NULL DEFAULT ''
+ `a` varbinary(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result
index 08cf9f1a753..947aeb5ff5b 100644
--- a/mysql-test/r/ctype_tis620.result
+++ b/mysql-test/r/ctype_tis620.result
@@ -3115,6 +3115,126 @@ Zz 5A,7A
~ 7E
 7F
drop table t1;
+#
+# MDEV-7149 Constant condition propagation erroneously applied for LIKE
+#
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE CONCAT(c1)='a';
+c1
+a
+a
+SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
+c1
+a
+SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a '))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
+c1
+a
+a
+SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
+c1
+a
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '% '=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '%'=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET tis620 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
SET collation_connection='tis620_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
@@ -3212,6 +3332,126 @@ c2h
ab_def
drop table t1;
#
+# MDEV-7149 Constant condition propagation erroneously applied for LIKE
+#
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE CONCAT(c1)='a';
+c1
+a
+a
+SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
+c1
+a
+SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a '))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
+c1
+a
+a
+SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
+c1
+a
+SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+c1
+a
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '% '=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('%'),('% ');
+SELECT * FROM t1 WHERE '%'=CONCAT(c1);
+c1
+%
+%
+SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
+c1
+%
+SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+c1
+%
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
+DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
+#
# Start of 5.6 tests
#
#
@@ -3226,7 +3466,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET tis620 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET tis620 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3246,7 +3486,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET tis620 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET tis620 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3404,7 +3644,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3424,7 +3664,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 02809f3be22..d9cba536814 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -2706,6 +2706,261 @@ Z,z,Ź,ź,Ż,ż,Ž,ž
Ç
Ç‚
ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_thai_520_w2;
+group_concat(c1 order by c1)
+÷
+×
+A,a
+Ã,á
+À,à
+Ă,ă
+Ắ,ắ
+Ằ,ằ
+Ẵ,ẵ
+Ẳ,ẳ
+Â,â
+Ấ,ấ
+Ầ,ầ
+Ẫ,ẫ
+Ẩ,ẩ
+Ç,ÇŽ
+Ã…,Ã¥
+Ǻ,ǻ
+Ä,ä
+Çž,ÇŸ
+Ã,ã
+Ç ,Ç¡
+Ä„,Ä…
+Ä€,Ä
+Ả,ả
+Ạ,ạ
+Ặ,ặ
+Ậ,ậ
+AA,Aa,aA,aa
+AE,Ae,aE,ae
+Æ,æ
+Ǽ,ǽ
+Ç¢,Ç£
+B,b
+Æ€
+Ƃ,ƃ
+C,c
+Ć,ć
+Ĉ,ĉ
+ÄŒ,Ä
+ÄŠ,Ä‹
+Ç,ç
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d
+ÄŽ,Ä
+Ä,Ä‘
+Ã,ð
+DZ,Dz,dZ,dz,DZ,Dz,dz
+DŽ,Dž,dŽ,dž,DŽ,Dž,dž
+Ɖ
+ÆŠ
+Ƌ,ƌ
+E,e
+É,é
+È,è
+Ä”,Ä•
+Ê,ê
+Ế,ế
+Ề,á»
+Ễ,ễ
+Ể,ể
+Äš,Ä›
+Ë,ë
+Ẽ,ẽ
+Ä–,Ä—
+Ę,ę
+Ä’,Ä“
+Ẻ,ẻ
+Ẹ,ẹ
+Ệ,ệ
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g
+Ǵ,ǵ
+Äž,ÄŸ
+Äœ,Ä
+Ǧ,ǧ
+Ä ,Ä¡
+Ä¢,Ä£
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h
+Ĥ,ĥ
+Ħ,ħ
+ƕ,Ƕ
+I,i
+Ã,í
+Ì,ì
+Ĭ,ĭ
+Î,î
+Ç,Ç
+Ã,ï
+Ĩ,ĩ
+Ä°
+Į,į
+Ī,ī
+Ỉ,ỉ
+Ị,ị
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j
+Ĵ,ĵ
+Ç°
+K,k
+Ǩ,ǩ
+Ķ,ķ
+Ƙ,ƙ
+L,l
+Ĺ,ĺ
+Ľ,ľ
+Ļ,ļ
+Å,Å‚
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Æš
+Æ›
+M,m
+N,n
+Ń,ń
+Ǹ,ǹ
+Ň,ň
+Ñ,ñ
+Ņ,ņ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o
+Ó,ó
+Ò,ò
+ÅŽ,Å
+Ô,ô
+á»,ố
+Ồ,ồ
+á»–,á»—
+Ổ,ổ
+Ç‘,Ç’
+Ö,ö
+Å,Å‘
+Õ,õ
+Ø,ø
+Ǿ,ǿ
+Ǫ,ǫ
+Ǭ,ǭ
+ÅŒ,Å
+Ỏ,á»
+Æ ,Æ¡
+Ớ,ớ
+Ờ,á»
+Ỡ,ỡ
+Ở,ở
+Ợ,ợ
+Ọ,á»
+Ộ,ộ
+OE,Oe,oE,oe
+Å’,Å“
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r
+Å”,Å•
+Ř,ř
+Å–,Å—
+RR,Rr,rR,rr
+Ʀ
+S,s
+Åš,Å›
+Åœ,Å
+Å ,Å¡
+Åž,ÅŸ
+Å¿
+SS,Ss,sS,ss
+ß
+Æ©
+ƪ
+T,t
+Ť,ť
+Å¢,Å£
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u
+Ú,ú
+Ù,ù
+Ŭ,ŭ
+Û,û
+Ç“,Ç”
+Ů,ů
+Ü,ü
+Ǘ,ǘ
+Ǜ,ǜ
+Ç™,Çš
+Ç•,Ç–
+Ű,ű
+Ũ,ũ
+Ų,ų
+Ū,ū
+Ủ,ủ
+Ư,ư
+Ứ,ứ
+Ừ,ừ
+Ữ,ữ
+Ử,ử
+á»°,á»±
+Ụ,ụ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w
+Ŵ,ŵ
+X,x
+Y,y
+Ã,ý
+Ŷ,ŷ
+ÿ,Ÿ
+Ƴ,ƴ
+Z,z
+Ź,ź
+Ž,ž
+Ż,ż
+Ƶ,ƶ
+Æ·
+Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
ALTER TABLE t1 CONVERT TO CHARACTER SET ucs2 COLLATE ucs2_bin;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_unicode_ci;
GROUP_CONCAT(c1 ORDER BY c1)
@@ -6071,8 +6326,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -6265,9 +6520,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F20025
@@ -6479,7 +6746,7 @@ ADD KEY(ch);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
+ `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `ch` (`ch`)
@@ -6506,10 +6773,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
Warnings:
@@ -6552,6 +6831,12 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
ch
a
@@ -6573,6 +6858,12 @@ aЀ
aÖ€
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
ch
a
@@ -6600,11 +6891,23 @@ z
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
ch
z
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
@@ -6687,7 +6990,7 @@ ADD KEY(ch);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
+ `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `ch` (`ch`)
@@ -6714,10 +7017,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
Warnings:
@@ -6760,6 +7075,10 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
ch
a
@@ -6779,6 +7098,10 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
ch
a
@@ -6804,9 +7127,17 @@ z
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
@@ -6894,7 +7225,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -6914,7 +7245,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -7138,7 +7469,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -7158,7 +7489,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -7786,8 +8117,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -7816,7 +8147,7 @@ CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ''
+ `c` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A);
INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C);
@@ -8120,7 +8451,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -8143,7 +8474,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -8166,7 +8497,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -8189,7 +8520,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -8209,13 +8540,38 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a'))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
+#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
#
CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('ae'),('ä');
SELECT * FROM t1 WHERE c1='ä';
@@ -8253,7 +8609,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -8276,7 +8632,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -8299,7 +8655,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -8322,7 +8678,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -8342,13 +8698,38 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a'))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
+#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
#
CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('ae'),('ä');
SELECT * FROM t1 WHERE c1='ä';
@@ -8401,7 +8782,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `s1` varchar(64) CHARACTER SET utf8 COLLATE utf8_myanmar_ci NOT NULL DEFAULT '',
+ `s1` varchar(64) CHARACTER SET utf8 COLLATE utf8_myanmar_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (s1) VALUES
@@ -10977,7 +11358,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `s1` varchar(64) CHARACTER SET ucs2 COLLATE ucs2_myanmar_ci NOT NULL DEFAULT '',
+ `s1` varchar(64) CHARACTER SET ucs2 COLLATE ucs2_myanmar_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (s1) VALUES
@@ -13573,3 +13954,1418 @@ DROP TABLE t1;
#
# End of MariaDB-10.0 tests
#
+#
+# Start of MariaDB-10.1 tests
+#
+#
+# MDEV-6973 XOR aggregates argument collations
+#
+SELECT '10' COLLATE utf8_general_ci XOR '20' COLLATE utf8_unicode_ci;
+'10' COLLATE utf8_general_ci XOR '20' COLLATE utf8_unicode_ci
+0
+#
+# MDEV-8705 Wrong result for SELECT..WHERE latin1_bin_column='a' AND latin1_bin_column='A'
+#
+SET NAMES utf8 COLLATE utf8_german2_ci;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a';
+a
+a
+SELECT * FROM t1 WHERE a=_utf8'a';
+a
+a
+SELECT * FROM t1 WHERE a='a' AND a=_utf8'a';
+a
+a
+DROP TABLE t1;
+SET NAMES utf8 COLLATE utf8_thai_520_w2;
+#
+# Start of ctype_uca_w2.inc
+#
+SELECT @@collation_connection;
+@@collation_connection
+utf8_thai_520_w2
+SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE @@collation_connection;
+ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME
+578 4 utf8_thai_520_w2 utf8
+#
+# Testing strnxfrm
+#
+CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(3) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8)))
+ 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+20 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+2020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4)))
+ 020A020A020A020A0020002000200020
+20 020A020A020A020A0020002000200020
+2020 020A020A020A020A0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1))
+ 020A020A020A020A
+20 020A020A020A020A
+2020 020A020A020A020A
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2))
+ 0020002000200020
+20 0020002000200020
+2020 0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3))
+ 0020002000200020
+20 0020002000200020
+2020 0020002000200020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (_ucs2 0x3400);
+INSERT INTO t1 VALUES (_ucs2 0xF001);
+SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1;
+ucs2 HEX(a) HEX(WEIGHT_STRING(a))
+3400 E39080 FB80B4000020
+F001 EF8081 FBC1F0010020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
+INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
+SELECT * FROM t1 ORDER BY a;
+a
+cota
+cote
+coté
+cotë
+côte
+côté
+côtë
+cotz
+SELECT * FROM t1 ORDER BY a DESC;
+a
+cotz
+côtë
+côté
+côte
+cotë
+coté
+cote
+cota
+DROP TABLE t1;
+#
+# End of ctype_uca_w2.inc
+#
+#
+# Start of ctype_thai.inc
+#
+CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
+INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡');
+INSERT INTO t1 VALUES ('à¸à¸');
+INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š');
+INSERT INTO t1 VALUES ('ข่าง');
+INSERT INTO t1 VALUES ('ข้าง');
+INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน');
+INSERT INTO t1 VALUES ('ข้างขึ้น');
+INSERT INTO t1 VALUES ('ข้างควาย');
+INSERT INTO t1 VALUES ('ข้างเงิน');
+INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡');
+INSERT INTO t1 VALUES ('ข้างออà¸');
+INSERT INTO t1 VALUES ('ข้างๆ');
+INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
+INSERT INTO t1 VALUES ('ขาง');
+INSERT INTO t1 VALUES ('à¹à¸‚็ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่งขัน');
+INSERT INTO t1 VALUES ('à¹à¸‚้ง');
+INSERT INTO t1 VALUES ('à¹à¸‚้งขวา');
+INSERT INTO t1 VALUES ('à¹à¸‚็งขัน');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯');
+INSERT INTO t1 VALUES ('บุà¸à¸à¸²');
+INSERT INTO t1 VALUES ('บุà¸-หลง');
+INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡');
+INSERT INTO t1 VALUES ('ป่า');
+INSERT INTO t1 VALUES ('ป่าน');
+INSERT INTO t1 VALUES ('ป้า');
+INSERT INTO t1 VALUES ('ป้าน');
+INSERT INTO t1 VALUES ('ป๊า');
+INSERT INTO t1 VALUES ('ป๊าน');
+INSERT INTO t1 VALUES ('ป๋า');
+INSERT INTO t1 VALUES ('ป๋าน');
+INSERT INTO t1 VALUES ('ปา');
+INSERT INTO t1 VALUES ('ปาน');
+INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡');
+INSERT INTO t1 VALUES ('พณิชย์');
+INSERT INTO t1 VALUES ('ม้า');
+INSERT INTO t1 VALUES ('ฯพณฯ');
+INSERT INTO t1 VALUES ('A');
+INSERT INTO t1 VALUES ('a');
+INSERT INTO t1 VALUES ('a\'');
+INSERT INTO t1 VALUES ('A-');
+INSERT INTO t1 VALUES ('a-');
+INSERT INTO t1 VALUES ('-a');
+INSERT INTO t1 VALUES ('A.');
+INSERT INTO t1 VALUES ('a.');
+INSERT INTO t1 VALUES ('A-1');
+INSERT INTO t1 VALUES ('aa');
+INSERT INTO t1 VALUES ('AA');
+INSERT INTO t1 VALUES ('A.A.');
+INSERT INTO t1 VALUES ('a.a.');
+INSERT INTO t1 VALUES ('AAA');
+INSERT INTO t1 VALUES ('A.A.A.');
+INSERT INTO t1 VALUES ('AAAA');
+INSERT INTO t1 VALUES ('A.A.A.L.');
+INSERT INTO t1 VALUES ('A.A.A.S.');
+INSERT INTO t1 VALUES ('Aachen');
+INSERT INTO t1 VALUES ('A.A.E.');
+INSERT INTO t1 VALUES ('A.Ae.E.');
+INSERT INTO t1 VALUES ('A.A.E.E.');
+INSERT INTO t1 VALUES ('AAES');
+INSERT INTO t1 VALUES ('AAF');
+INSERT INTO t1 VALUES ('A.Agr');
+INSERT INTO t1 VALUES ('aah');
+INSERT INTO t1 VALUES ('@@@@@');
+INSERT INTO t1 VALUES ('0000');
+INSERT INTO t1 VALUES ('9999');
+INSERT INTO t1 VALUES ('Aalborg');
+INSERT INTO t1 VALUES ('aide');
+INSERT INTO t1 VALUES ('air');
+INSERT INTO t1 VALUES ('@@@air');
+INSERT INTO t1 VALUES ('air@@@');
+INSERT INTO t1 VALUES ('C.A.F');
+INSERT INTO t1 VALUES ('Canon');
+INSERT INTO t1 VALUES ('coop');
+INSERT INTO t1 VALUES ('co-op');
+INSERT INTO t1 VALUES ('COOP');
+INSERT INTO t1 VALUES ('CO-OP');
+INSERT INTO t1 VALUES ('Copenhegen');
+INSERT INTO t1 VALUES ('McArthur');
+INSERT INTO t1 VALUES ('Mc Arthur');
+INSERT INTO t1 VALUES ('Mc Mahon');
+INSERT INTO t1 VALUES ('vice-president');
+INSERT INTO t1 VALUES ('vice versa');
+INSERT INTO t1 VALUES ('vice-versa');
+INSERT INTO t1 VALUES ('10 ลิตร');
+INSERT INTO t1 VALUES ('๑๠ลิตร');
+INSERT INTO t1 VALUES ('10 litre');
+INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
+INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)');
+INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]');
+INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}');
+ALTER TABLE t1 ORDER BY a;
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection,
+' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
+ ' , ADD KEY a_id (a, id)');
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(30) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`),
+ KEY `a_id` (`a`,`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1
+#
+# Ascending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a, BINARY a;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+#
+# Ascending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a, id;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a DESC, id DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+DROP TABLE t1;
+#
+# End of ctype_thai.inc
+#
+SET NAMES utf8;
+SET collation_connection=ucs2_thai_520_w2;
+#
+# Start of ctype_uca_w2.inc
+#
+SELECT @@collation_connection;
+@@collation_connection
+ucs2_thai_520_w2
+SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE @@collation_connection;
+ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME
+642 4 ucs2_thai_520_w2 ucs2
+#
+# Testing strnxfrm
+#
+CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(3) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8)))
+ 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+0020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+00200020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4)))
+ 020A020A020A020A0020002000200020
+0020 020A020A020A020A0020002000200020
+00200020 020A020A020A020A0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1))
+ 020A020A020A020A
+0020 020A020A020A020A
+00200020 020A020A020A020A
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2))
+ 0020002000200020
+0020 0020002000200020
+00200020 0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3))
+ 0020002000200020
+0020 0020002000200020
+00200020 0020002000200020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (_ucs2 0x3400);
+INSERT INTO t1 VALUES (_ucs2 0xF001);
+SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1;
+ucs2 HEX(a) HEX(WEIGHT_STRING(a))
+3400 3400 FB80B4000020
+F001 F001 FBC1F0010020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
+INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
+SELECT * FROM t1 ORDER BY a;
+a
+cota
+cote
+coté
+cotë
+côte
+côté
+côtë
+cotz
+SELECT * FROM t1 ORDER BY a DESC;
+a
+cotz
+côtë
+côté
+côte
+cotë
+coté
+cote
+cota
+DROP TABLE t1;
+#
+# End of ctype_uca_w2.inc
+#
+#
+# Start of ctype_thai.inc
+#
+CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
+INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡');
+INSERT INTO t1 VALUES ('à¸à¸');
+INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š');
+INSERT INTO t1 VALUES ('ข่าง');
+INSERT INTO t1 VALUES ('ข้าง');
+INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน');
+INSERT INTO t1 VALUES ('ข้างขึ้น');
+INSERT INTO t1 VALUES ('ข้างควาย');
+INSERT INTO t1 VALUES ('ข้างเงิน');
+INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡');
+INSERT INTO t1 VALUES ('ข้างออà¸');
+INSERT INTO t1 VALUES ('ข้างๆ');
+INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
+INSERT INTO t1 VALUES ('ขาง');
+INSERT INTO t1 VALUES ('à¹à¸‚็ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่งขัน');
+INSERT INTO t1 VALUES ('à¹à¸‚้ง');
+INSERT INTO t1 VALUES ('à¹à¸‚้งขวา');
+INSERT INTO t1 VALUES ('à¹à¸‚็งขัน');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯');
+INSERT INTO t1 VALUES ('บุà¸à¸à¸²');
+INSERT INTO t1 VALUES ('บุà¸-หลง');
+INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡');
+INSERT INTO t1 VALUES ('ป่า');
+INSERT INTO t1 VALUES ('ป่าน');
+INSERT INTO t1 VALUES ('ป้า');
+INSERT INTO t1 VALUES ('ป้าน');
+INSERT INTO t1 VALUES ('ป๊า');
+INSERT INTO t1 VALUES ('ป๊าน');
+INSERT INTO t1 VALUES ('ป๋า');
+INSERT INTO t1 VALUES ('ป๋าน');
+INSERT INTO t1 VALUES ('ปา');
+INSERT INTO t1 VALUES ('ปาน');
+INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡');
+INSERT INTO t1 VALUES ('พณิชย์');
+INSERT INTO t1 VALUES ('ม้า');
+INSERT INTO t1 VALUES ('ฯพณฯ');
+INSERT INTO t1 VALUES ('A');
+INSERT INTO t1 VALUES ('a');
+INSERT INTO t1 VALUES ('a\'');
+INSERT INTO t1 VALUES ('A-');
+INSERT INTO t1 VALUES ('a-');
+INSERT INTO t1 VALUES ('-a');
+INSERT INTO t1 VALUES ('A.');
+INSERT INTO t1 VALUES ('a.');
+INSERT INTO t1 VALUES ('A-1');
+INSERT INTO t1 VALUES ('aa');
+INSERT INTO t1 VALUES ('AA');
+INSERT INTO t1 VALUES ('A.A.');
+INSERT INTO t1 VALUES ('a.a.');
+INSERT INTO t1 VALUES ('AAA');
+INSERT INTO t1 VALUES ('A.A.A.');
+INSERT INTO t1 VALUES ('AAAA');
+INSERT INTO t1 VALUES ('A.A.A.L.');
+INSERT INTO t1 VALUES ('A.A.A.S.');
+INSERT INTO t1 VALUES ('Aachen');
+INSERT INTO t1 VALUES ('A.A.E.');
+INSERT INTO t1 VALUES ('A.Ae.E.');
+INSERT INTO t1 VALUES ('A.A.E.E.');
+INSERT INTO t1 VALUES ('AAES');
+INSERT INTO t1 VALUES ('AAF');
+INSERT INTO t1 VALUES ('A.Agr');
+INSERT INTO t1 VALUES ('aah');
+INSERT INTO t1 VALUES ('@@@@@');
+INSERT INTO t1 VALUES ('0000');
+INSERT INTO t1 VALUES ('9999');
+INSERT INTO t1 VALUES ('Aalborg');
+INSERT INTO t1 VALUES ('aide');
+INSERT INTO t1 VALUES ('air');
+INSERT INTO t1 VALUES ('@@@air');
+INSERT INTO t1 VALUES ('air@@@');
+INSERT INTO t1 VALUES ('C.A.F');
+INSERT INTO t1 VALUES ('Canon');
+INSERT INTO t1 VALUES ('coop');
+INSERT INTO t1 VALUES ('co-op');
+INSERT INTO t1 VALUES ('COOP');
+INSERT INTO t1 VALUES ('CO-OP');
+INSERT INTO t1 VALUES ('Copenhegen');
+INSERT INTO t1 VALUES ('McArthur');
+INSERT INTO t1 VALUES ('Mc Arthur');
+INSERT INTO t1 VALUES ('Mc Mahon');
+INSERT INTO t1 VALUES ('vice-president');
+INSERT INTO t1 VALUES ('vice versa');
+INSERT INTO t1 VALUES ('vice-versa');
+INSERT INTO t1 VALUES ('10 ลิตร');
+INSERT INTO t1 VALUES ('๑๠ลิตร');
+INSERT INTO t1 VALUES ('10 litre');
+INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
+INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)');
+INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]');
+INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}');
+ALTER TABLE t1 ORDER BY a;
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection,
+' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
+ ' , ADD KEY a_id (a, id)');
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(30) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`),
+ KEY `a_id` (`a`,`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1
+#
+# Ascending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a, BINARY a;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+#
+# Ascending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a, id;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a DESC, id DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+DROP TABLE t1;
+#
+# End of ctype_thai.inc
+#
+#
+# End of MariaDB-10.1 tests
+#
diff --git a/mysql-test/r/ctype_uca_innodb.result b/mysql-test/r/ctype_uca_innodb.result
index a4e1ae09130..f189e698da1 100644
--- a/mysql-test/r/ctype_uca_innodb.result
+++ b/mysql-test/r/ctype_uca_innodb.result
@@ -15,7 +15,7 @@ ADD KEY(ch);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
+ `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `ch` (`ch`)
@@ -42,10 +42,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
Warnings:
@@ -88,6 +100,12 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
ch
a
@@ -109,6 +127,12 @@ aЀ
aÖ€
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
ch
a
@@ -136,11 +160,23 @@ z
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
ch
z
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
diff --git a/mysql-test/r/ctype_uca_partitions.result b/mysql-test/r/ctype_uca_partitions.result
new file mode 100644
index 00000000000..11d4e82e27b
--- /dev/null
+++ b/mysql-test/r/ctype_uca_partitions.result
@@ -0,0 +1,86 @@
+SET NAMES utf8;
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2)
+PARTITION BY KEY(c1) PARTITIONS 3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 3 */
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+INSERT INTO t1 VALUES ('B');
+INSERT INTO t1 VALUES ('C');
+INSERT INTO t1 VALUES ('D');
+INSERT INTO t1 VALUES ('E');
+INSERT INTO t1 VALUES ('F');
+INSERT INTO t1 VALUES ('G');
+INSERT INTO t1 VALUES ('H');
+INSERT INTO t1 VALUES ('I');
+INSERT INTO t1 VALUES ('J');
+INSERT INTO t1 VALUES ('K');
+INSERT INTO t1 VALUES ('L'),('Ĺ'),('Ä»'),('Ľ'),('Ä¿'),('Å');
+INSERT INTO t1 VALUES ('M');
+INSERT INTO t1 VALUES ('N');
+INSERT INTO t1 VALUES ('O'),('Ò'),('Ó'),('Ô'),('Õ'),('Ö'),('Ø');
+INSERT INTO t1 VALUES ('P');
+INSERT INTO t1 VALUES ('Q');
+INSERT INTO t1 VALUES ('R');
+INSERT INTO t1 VALUES ('S');
+INSERT INTO t1 VALUES ('T');
+INSERT INTO t1 VALUES ('U');
+INSERT INTO t1 VALUES ('V');
+INSERT INTO t1 VALUES ('W');
+INSERT INTO t1 VALUES ('X');
+INSERT INTO t1 VALUES ('Y');
+INSERT INTO t1 VALUES ('Z');
+SELECT * FROM t1 PARTITION (p0) ORDER BY c1;
+c1
+J
+K
+L
+Ĺ
+Ľ
+Ä»
+Ä¿
+M
+Q
+R
+T
+V
+X
+SELECT * FROM t1 PARTITION (p1) ORDER BY c1;
+c1
+A
+À
+Â
+Ã…
+Ä
+Ã
+D
+E
+F
+G
+I
+N
+S
+U
+W
+Z
+SELECT * FROM t1 PARTITION (p2) ORDER BY c1;
+c1
+B
+C
+H
+O
+Ó
+Ã’
+Ô
+Ö
+Õ
+Ø
+P
+Y
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 6520694a804..f9f0acf726f 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -196,8 +196,8 @@ RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `l` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '',
- `r` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `l` varchar(10) CHARACTER SET ucs2 NOT NULL,
+ `r` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
@@ -933,8 +933,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET ucs2 NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -959,9 +959,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F20025
@@ -984,8 +996,8 @@ STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
SHOW COLUMNS FROM t1;
Field Type Null Key Default Extra
-subject varchar(64) NO
-pattern varchar(64) NO
+subject varchar(64) NO NULL
+pattern varchar(64) NO NULL
INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
@@ -1092,9 +1104,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F20025
@@ -1160,7 +1184,9 @@ hex(a)
005B
803D
drop table t1;
+set sql_mode="";
create table t1(f1 varchar(5) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL) engine=InnoDB;
+set sql_mode=default;
insert into t1 values('a');
create index t1f1 on t1(f1);
select f1 from t1 where f1 like 'a%';
@@ -1596,7 +1622,7 @@ create table t1 as select concat(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -1609,7 +1635,7 @@ create table t1 as select concat(18446744073709551615) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(20) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(20) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -1622,7 +1648,7 @@ create table t1 as select concat(1.1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -1635,7 +1661,7 @@ create table t1 as select concat(1+2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1-2));
@@ -1645,7 +1671,7 @@ create table t1 as select concat(1-2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1*2));
@@ -1655,7 +1681,7 @@ create table t1 as select concat(1*2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1/2));
@@ -1695,7 +1721,7 @@ create table t1 as select concat(-1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(-(1+2)));
@@ -1705,7 +1731,7 @@ create table t1 as select concat(-(1+2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1|2));
@@ -1715,7 +1741,7 @@ create table t1 as select concat(1|2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1&2));
@@ -1725,7 +1751,7 @@ create table t1 as select concat(1&2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_count(12)));
@@ -1735,7 +1761,7 @@ create table t1 as select concat(bit_count(12)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2<<1));
@@ -1745,7 +1771,7 @@ create table t1 as select concat(2<<1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2>>1));
@@ -1755,7 +1781,7 @@ create table t1 as select concat(2>>1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(~0));
@@ -1765,7 +1791,7 @@ create table t1 as select concat(~0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(3^2));
@@ -1775,7 +1801,7 @@ create table t1 as select concat(3^2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(abs(-2)));
@@ -1785,7 +1811,7 @@ create table t1 as select concat(abs(-2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(concat(exp(2)),1));
@@ -1915,7 +1941,7 @@ create table t1 as select concat(degrees(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(radians(0)));
@@ -1925,7 +1951,7 @@ create table t1 as select concat(radians(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ceiling(0.5)));
@@ -1935,7 +1961,7 @@ create table t1 as select concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
@@ -1945,7 +1971,7 @@ create table t1 as select concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
@@ -1955,7 +1981,7 @@ create table t1 as select concat(round(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sign(0.5)));
@@ -1965,14 +1991,14 @@ create table t1 as select concat(sign(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(rand()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(length('a')));
@@ -1982,7 +2008,7 @@ create table t1 as select concat(length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(char_length('a')));
@@ -1992,7 +2018,7 @@ create table t1 as select concat(char_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_length('a')));
@@ -2002,7 +2028,7 @@ create table t1 as select concat(bit_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coercibility('a')));
@@ -2012,7 +2038,7 @@ create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(locate('a','a')));
@@ -2022,7 +2048,7 @@ create table t1 as select concat(locate('a','a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(11) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(11) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(field('c','a','b','c')));
@@ -2032,7 +2058,7 @@ create table t1 as select concat(field('c','a','b','c')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ascii(61)));
@@ -2042,7 +2068,7 @@ create table t1 as select concat(ascii(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ord(61)));
@@ -2052,7 +2078,7 @@ create table t1 as select concat(ord(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(find_in_set('b','a,b,c,d')));
@@ -2062,7 +2088,7 @@ create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select md5('a'), hex(md5('a'));
@@ -2072,7 +2098,7 @@ create table t1 as select md5('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(32) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(32) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select old_password('a'), hex(old_password('a'));
@@ -2082,7 +2108,7 @@ create table t1 as select old_password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(16) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(16) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select password('a'), hex(password('a'));
@@ -2092,7 +2118,7 @@ create table t1 as select password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(41) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(41) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha('a'), hex(sha('a'));
@@ -2102,7 +2128,7 @@ create table t1 as select sha('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(40) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha1('a'), hex(sha1('a'));
@@ -2112,7 +2138,7 @@ create table t1 as select sha1('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(40) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('-1' as signed)));
@@ -2122,7 +2148,7 @@ create table t1 as select concat(cast('-1' as signed)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('1' as unsigned)));
@@ -2132,7 +2158,7 @@ create table t1 as select concat(cast('1' as unsigned)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast(1/2 as decimal(5,5))));
@@ -2191,7 +2217,7 @@ create table t1 as select concat(least(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(greatest(1,2)));
@@ -2201,7 +2227,7 @@ create table t1 as select concat(greatest(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(case when 11 then 22 else 33 end));
@@ -2211,7 +2237,7 @@ create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coalesce(1,2)));
@@ -2221,7 +2247,7 @@ create table t1 as select concat(coalesce(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat_ws(1,2,3));
@@ -2231,7 +2257,7 @@ create table t1 as select concat_ws(1,2,3) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(group_concat(1,2,3));
@@ -2259,7 +2285,7 @@ create table t1 as select concat(last_insert_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(benchmark(0,0)));
@@ -2269,7 +2295,7 @@ create table t1 as select concat(benchmark(0,0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sleep(0)));
@@ -2279,7 +2305,7 @@ create table t1 as select concat(sleep(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(is_free_lock('xxxx')));
@@ -2313,7 +2339,7 @@ create table t1 as select concat(crc32('')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(uncompressed_length('')));
@@ -2330,7 +2356,7 @@ create table t1 as select concat(connection_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(inet_aton('127.1.1.1')));
@@ -2366,7 +2392,7 @@ create table t1 as select concat(row_count()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(found_rows()));
@@ -2376,21 +2402,21 @@ create table t1 as select concat(found_rows()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid_short()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
@@ -2403,7 +2429,7 @@ create table t1 as select concat(uuid(), cast('a' as char character set latin1))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(37) NOT NULL DEFAULT ''
+ `c1` varchar(37) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
@@ -2423,8 +2449,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '',
- `c2` int(1) NOT NULL DEFAULT '0'
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL,
+ `c2` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1;
@@ -2481,8 +2507,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '',
- `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL,
+ `c2` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1.1;
@@ -2520,7 +2546,7 @@ create table t1 as select concat('a'='a' IS TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a'='a' IS NOT TRUE));
@@ -2530,7 +2556,7 @@ create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(NOT 'a'='a'));
@@ -2540,7 +2566,7 @@ create table t1 as select concat(NOT 'a'='a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NULL));
@@ -2550,7 +2576,7 @@ create table t1 as select concat('a' IS NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NOT NULL));
@@ -2560,7 +2586,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' rlike 'a'));
@@ -2570,7 +2596,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(strcmp('a','b')));
@@ -2580,7 +2606,7 @@ create table t1 as select concat(strcmp('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' like 'a'));
@@ -2590,7 +2616,7 @@ create table t1 as select concat('a' like 'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' between 'b' and 'c'));
@@ -2600,7 +2626,7 @@ create table t1 as select concat('a' between 'b' and 'c') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' in ('a','b')));
@@ -2610,7 +2636,7 @@ create table t1 as select concat('a' in ('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
@@ -2620,7 +2646,7 @@ create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(10), fulltext key(a));
@@ -2642,7 +2668,7 @@ create table t1 as select ifnull(1,'a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1,1)));
@@ -2652,7 +2678,7 @@ create table t1 as select concat(ifnull(1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1.1,1.1)));
@@ -2662,7 +2688,7 @@ create table t1 as select concat(ifnull(1.1,1.1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,'b',1));
@@ -2672,7 +2698,7 @@ create table t1 as select if(1,'b',1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,1,'b'));
@@ -2682,7 +2708,7 @@ create table t1 as select if(1,1,'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(if(1,1,1)));
@@ -2692,7 +2718,7 @@ create table t1 as select concat(if(1,1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(nullif(1,2)));
@@ -2772,7 +2798,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -2782,7 +2808,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
+ `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
@@ -2857,7 +2883,7 @@ create table t1 as select concat(period_add(200902, 2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(period_diff(200902, 200802)));
@@ -2869,7 +2895,7 @@ Warning 1265 Data truncated for column 'c1' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(to_days(20090224)));
@@ -3066,21 +3092,21 @@ create table t1 as select concat(curdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_date()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(curtime()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat('a',20) as c1 limit 0;
@@ -3096,7 +3122,7 @@ create table t1 as select concat(utc_time()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sec_to_time(2378)));
@@ -3189,21 +3215,21 @@ create table t1 as select concat(now()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_timestamp()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(sysdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(addtime('00:00:00','11:22:33')));
@@ -3243,7 +3269,7 @@ create table t1 as select export_set(1,2,3,4,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(127) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(127) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(insert(1133,3,0,22));
@@ -3253,7 +3279,7 @@ create table t1 as select insert(1133,3,0,22) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lcase(123));
@@ -3263,7 +3289,7 @@ create table t1 as select lcase(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(123,1));
@@ -3273,7 +3299,7 @@ create table t1 as select left(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lower(123));
@@ -3283,7 +3309,7 @@ create table t1 as select lower(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lpad(1,2,0));
@@ -3293,7 +3319,7 @@ create table t1 as select lpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ltrim(1));
@@ -3303,7 +3329,7 @@ create table t1 as select ltrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(mid(1,1,1));
@@ -3313,7 +3339,7 @@ create table t1 as select mid(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(repeat(1,2));
@@ -3323,7 +3349,7 @@ create table t1 as select repeat(1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(replace(1,1,2));
@@ -3333,7 +3359,7 @@ create table t1 as select replace(1,1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(reverse(12));
@@ -3343,7 +3369,7 @@ create table t1 as select reverse(12) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(right(123,1));
@@ -3353,7 +3379,7 @@ create table t1 as select right(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rpad(1,2,0));
@@ -3363,7 +3389,7 @@ create table t1 as select rpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rtrim(1));
@@ -3373,7 +3399,7 @@ create table t1 as select rtrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(soundex(1));
@@ -3383,7 +3409,7 @@ create table t1 as select soundex(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(substring(1,1,1));
@@ -3393,7 +3419,7 @@ create table t1 as select substring(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(trim(1));
@@ -3403,7 +3429,7 @@ create table t1 as select trim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ucase(1));
@@ -3413,7 +3439,7 @@ create table t1 as select ucase(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(upper(1));
@@ -3423,14 +3449,14 @@ create table t1 as select upper(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat(' ', 64) as a limit 0;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ("1.1"), ("2.1");
select a, hex(a) from t1;
@@ -3659,7 +3685,7 @@ t2 CREATE TABLE `t2` (
`concat(a)` varbinary(64) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -3680,7 +3706,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `concat(a)` varchar(19) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a date);
@@ -3971,7 +3997,7 @@ hex(a)
0000000000000001
drop table t1;
drop view v1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -4220,7 +4246,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`CONCAT(a)` varchar(9) CHARACTER SET ucs2 DEFAULT NULL,
- `IFNULL(a,'')` varchar(9) CHARACTER SET ucs2 NOT NULL DEFAULT '',
+ `IFNULL(a,'')` varchar(9) CHARACTER SET ucs2 NOT NULL,
`IF(a,a,'')` varchar(9) CHARACTER SET ucs2 DEFAULT NULL,
`CASE WHEN a THEN a ELSE '' END` varchar(9) CHARACTER SET ucs2 DEFAULT NULL,
`COALESCE(a,'')` varchar(9) CHARACTER SET ucs2 DEFAULT NULL
@@ -4230,14 +4256,14 @@ CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LCASE(a) FROM t1;
@@ -4258,35 +4284,35 @@ CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPEAT(1,2)` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `REPEAT(1,2)` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LEFT(123,2)` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `LEFT(123,2)` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RIGHT(123,2)` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `RIGHT(123,2)` varchar(2) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LTRIM(123)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `LTRIM(123)` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RTRIM(123)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `RTRIM(123)` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1;
@@ -4300,35 +4326,35 @@ CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPLACE(111,2,3)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `REPLACE(111,2,3)` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SOUNDEX(1)` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `SOUNDEX(1)` varchar(4) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8);
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
@@ -4352,7 +4378,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
+1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
@@ -4492,7 +4518,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`d` date DEFAULT NULL,
- `bad` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
+ `bad` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET NAMES latin1;
@@ -4606,7 +4632,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4626,7 +4652,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4850,7 +4876,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -4870,7 +4896,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -5179,7 +5205,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 64) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('');
SELECT CHARSET(CONCAT(a,'2001-01-08 00:00:00' - INTERVAL 7 DAY)) FROM t1;
@@ -5322,8 +5348,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET ucs2 COLLATE ucs2_german2_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET ucs2 COLLATE ucs2_german2_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -5363,7 +5389,7 @@ Warning 1292 Truncated incorrect INTEGER value: ''
CREATE TABLE t1 (a DECIMAL(2,0));
SET sql_mode='strict_all_tables';
INSERT INTO t1 VALUES (CONVERT('9e99999999' USING ucs2));
-ERROR 22007: Incorrect decimal value: '9e99999999' for column 'a' at row 1
+ERROR 22003: Out of range value for column 'a' at row 1
SET sql_mode=DEFAULT;
INSERT INTO t1 VALUES (CONVERT('aaa' USING ucs2));
Warnings:
@@ -5383,7 +5409,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -5406,7 +5432,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -5429,7 +5455,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -5452,7 +5478,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -5471,6 +5497,31 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 2
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 2
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
SET NAMES latin1, collation_connection=ucs2_general_ci;
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
@@ -5479,7 +5530,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -5502,7 +5553,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -5525,7 +5576,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -5548,7 +5599,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -5567,6 +5618,31 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET ucs2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 2
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 2
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
SET NAMES latin1;
#
# MDEV-6661 PI() does not work well in UCS2/UTF16/UTF32 context
@@ -5601,3 +5677,43 @@ SET optimizer_switch=@save_optimizer_switch;
#
# End of 10.0 tests
#
+select collation(cast("a" as char(10) unicode binary));
+collation(cast("a" as char(10) unicode binary))
+ucs2_bin
+select collation(cast("a" as char(10) binary unicode));
+collation(cast("a" as char(10) binary unicode))
+ucs2_bin
+#
+# MDEV-8222 "string_field LIKE int_const" returns a wrong result in case of UCS2
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARSET ucs2);
+INSERT INTO t1 VALUES ('1');
+SELECT * FROM t1 WHERE a LIKE 1;
+a
+1
+DROP TABLE t1;
+#
+# MDEV-8253 EXPLAIN SELECT prints unexpected characters
+#
+SET NAMES latin1, character_set_connection=ucs2;
+CREATE TABLE t1 (a DECIMAL(10,1),b DECIMAL(10,1),c VARCHAR(10),d VARCHAR(10));
+INSERT INTO t1 VALUES (1.5,1.5,'1','1'),(3.5,3.5,'3','3');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(c,0)='3 ' AND COALESCE(d,0)=COALESCE(c,0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '3 '))
+DROP TABLE t1;
+#
+# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
+#
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED);
+CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result
index 413ab4efe31..61541ec7678 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -126,6 +126,7 @@ Field Type Null Key Default Extra
a char(1) NO
b enum('¤¢','¤¤') YES NULL
DROP TABLE t1;
+set sql_mode="";
CREATE TABLE t1
(
a INTEGER NOT NULL,
@@ -133,6 +134,7 @@ b VARCHAR(50) NOT NULL DEFAULT '',
PRIMARY KEY (a),
KEY b (b(10))
) ENGINE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
+set sql_mode=default;
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
@@ -2329,9 +2331,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -2464,9 +2478,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -2480,9 +2506,13 @@ DROP TABLE t1;
select hex(convert(_ujis 0xA5FE41 using ucs2));
hex(convert(_ujis 0xA5FE41 using ucs2))
003F0041
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0xA5FE to 'ucs2'
select hex(convert(_ujis 0x8FABF841 using ucs2));
hex(convert(_ujis 0x8FABF841 using ucs2))
003F0041
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0x8FABF8 to 'ucs2'
DROP TABLE IF EXISTS t1, t2;
DROP PROCEDURE IF EXISTS sp1;
set names ujis;
@@ -2541,21 +2571,27 @@ DROP TABLE t1;
CREATE TABLE t1 AS SELECT 'XXXXXX' AS code, ' ' AS a LIMIT 0;
INSERT INTO t1 (code) SELECT concat('8E', head) FROM head
WHERE (head BETWEEN 'A1' AND 'DF') ORDER BY head;
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
INSERT INTO t1 (code) SELECT concat(head, tail)
FROM head, tail
WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN '8E' AND '8F')
AND (tail BETWEEN '20' AND 'FF')
ORDER BY head, tail;
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
INSERT INTO t1 (code) SELECT concat('8F', head, tail)
FROM head, tail
WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '80' AND 'FF')
ORDER BY head, tail;
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `code` varchar(6) CHARACTER SET ujis NOT NULL DEFAULT '',
- `a` varchar(1) CHARACTER SET ujis NOT NULL DEFAULT ''
+ `code` varchar(6) CHARACTER SET ujis NOT NULL,
+ `a` varchar(1) CHARACTER SET ujis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
UPDATE t1 SET a=unhex(code) ORDER BY code;
Warnings:
@@ -2626,7 +2662,7 @@ Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
SELECT COUNT(*) FROM t1;
COUNT(*)
44671
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
COUNT(*)
17735
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
@@ -3046,12 +3082,142 @@ WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
8FAABC Ģ
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EC to 'utf8'
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
code a
8FA9C3 ð
8FABB9 ǵ
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EC to 'utf8'
#
# WL#3090 Japanese Character Set adjustments
# Test sjis->Unicode conversion
@@ -17948,6 +18114,71 @@ FEFB EE8EA8
FEFC EE8EA9
FEFD EE8EAA
FEFE EE8EAB
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0xA2AF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B0 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2B9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2C9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2D9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2DB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EC to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2ED to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EE to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2EF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2F0 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2F1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2FA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2FB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2FC to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA2FD to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A1 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A2 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A3 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A4 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A5 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A6 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A7 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A8 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3A9 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3AA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3AB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3AC to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3AD to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3AE to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3AF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3BA to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3BB to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3BC to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3BD to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3BE to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3BF to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3C0 to 'utf8'
+Warning 1977 Cannot convert 'ujis' character 0xA3DB to 'utf8'
DROP TABLE t1;
#
# WL#3090 Japanese Character Set adjustments
@@ -25067,7 +25298,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET ujis NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET ujis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -25087,7 +25318,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET ujis NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET ujis NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -25500,7 +25731,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET ujis COLLATE ujis_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET ujis COLLATE ujis_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -25520,7 +25751,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET ujis COLLATE ujis_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET ujis COLLATE ujis_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -25938,10 +26169,52 @@ CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ujis);
INSERT INTO t1 VALUES (0x8EA0);
SELECT HEX(a), CHAR_LENGTH(a) FROM t1;
HEX(a) CHAR_LENGTH(a)
- 0
+3F3F 2
DROP TABLE t1;
SELECT _ujis 0x8EA0;
ERROR HY000: Invalid ujis character string: '8EA0'
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ujis, KEY(a));
+INSERT INTO t1 VALUES ('a'),(0x7F);
+INSERT INTO t1 VALUES (0x8EA1),(0x8EDF);
+INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE);
+INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE);
+SELECT HEX(a) FROM t1 ORDER BY a;
+HEX(a)
+61
+7F
+8EA1
+8EDF
+8FA1A1
+8FFEFE
+A1A1
+DEDE
+DFDF
+E0E0
+FEFE
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ujis COLLATE ujis_bin;
+SELECT HEX(a) FROM t1 ORDER BY a;
+HEX(a)
+61
+7F
+8EA1
+8EDF
+8FA1A1
+8FFEFE
+A1A1
+DEDE
+DFDF
+E0E0
+FEFE
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_upgrade.result b/mysql-test/r/ctype_upgrade.result
index 6bef89f6cd6..53cb858035b 100644
--- a/mysql-test/r/ctype_upgrade.result
+++ b/mysql-test/r/ctype_upgrade.result
@@ -6,7 +6,7 @@ call mtr.add_suppression("Table rebuild required");
# Copying maria050313_utf8_croatian_ci.* to MYSQLD_DATADIR
CHECK TABLE maria050313_utf8_croatian_ci FOR UPGRADE;
Table Op Msg_type Msg_text
-test.maria050313_utf8_croatian_ci check error Table upgrade required. Please do "REPAIR TABLE `maria050313_utf8_croatian_ci`" or dump/reload to fix it!
+test.maria050313_utf8_croatian_ci check error Upgrade required. Please do "REPAIR TABLE `maria050313_utf8_croatian_ci`" or dump/reload to fix it!
SHOW CREATE TABLE maria050313_utf8_croatian_ci;
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.maria050313_utf8_croatian_c` FORCE" or dump/reload to fix it!
REPAIR TABLE maria050313_utf8_croatian_ci;
@@ -43,7 +43,7 @@ DROP TABLE maria050313_utf8_croatian_ci;
# Copying maria050313_ucs2_croatian_ci.* to MYSQLD_DATADIR
CHECK TABLE maria050313_ucs2_croatian_ci_def FOR UPGRADE;
Table Op Msg_type Msg_text
-test.maria050313_ucs2_croatian_ci_def check error Table upgrade required. Please do "REPAIR TABLE `maria050313_ucs2_croatian_ci_def`" or dump/reload to fix it!
+test.maria050313_ucs2_croatian_ci_def check error Upgrade required. Please do "REPAIR TABLE `maria050313_ucs2_croatian_ci_def`" or dump/reload to fix it!
SELECT count(*) FROM maria050313_ucs2_croatian_ci_def;
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.maria050313_ucs2_croatian_c` FORCE" or dump/reload to fix it!
REPAIR TABLE maria050313_ucs2_croatian_ci_def;
@@ -58,7 +58,7 @@ DROP TABLE maria050313_ucs2_croatian_ci_def;
# Copying maria050313_ucs2_croatian_ci.* to MYSQLD_DATADIR
CHECK TABLE maria050313_ucs2_croatian_ci_def;
Table Op Msg_type Msg_text
-test.maria050313_ucs2_croatian_ci_def check error Table upgrade required. Please do "REPAIR TABLE `maria050313_ucs2_croatian_ci_def`" or dump/reload to fix it!
+test.maria050313_ucs2_croatian_ci_def check error Upgrade required. Please do "REPAIR TABLE `maria050313_ucs2_croatian_ci_def`" or dump/reload to fix it!
REPAIR TABLE maria050313_ucs2_croatian_ci_def;
Table Op Msg_type Msg_text
test.maria050313_ucs2_croatian_ci_def repair status OK
@@ -84,7 +84,7 @@ DROP TABLE maria050313_ucs2_croatian_ci_def;
# Copying maria050533_xxx_croatian_ci.* to MYSQLD_DATADIR
CHECK TABLE maria050533_xxx_croatian_ci FOR UPGRADE;
Table Op Msg_type Msg_text
-test.maria050533_xxx_croatian_ci check error Table upgrade required. Please do "REPAIR TABLE `maria050533_xxx_croatian_ci`" or dump/reload to fix it!
+test.maria050533_xxx_croatian_ci check error Upgrade required. Please do "REPAIR TABLE `maria050533_xxx_croatian_ci`" or dump/reload to fix it!
REPAIR TABLE maria050533_xxx_croatian_ci;
Table Op Msg_type Msg_text
test.maria050533_xxx_croatian_ci repair status OK
@@ -141,7 +141,7 @@ DROP TABLE maria050533_xxx_croatian_ci;
# Copying maria100004_xxx_croatian_ci.* to MYSQLD_DATADIR
CHECK TABLE maria100004_xxx_croatian_ci FOR UPGRADE;
Table Op Msg_type Msg_text
-test.maria100004_xxx_croatian_ci check error Table upgrade required. Please do "REPAIR TABLE `maria100004_xxx_croatian_ci`" or dump/reload to fix it!
+test.maria100004_xxx_croatian_ci check error Upgrade required. Please do "REPAIR TABLE `maria100004_xxx_croatian_ci`" or dump/reload to fix it!
SELECT count(*) FROM maria100004_xxx_croatian_ci;
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.maria100004_xxx_croatian_ci` FORCE" or dump/reload to fix it!
REPAIR TABLE maria100004_xxx_croatian_ci;
@@ -227,7 +227,7 @@ DROP TABLE mysql050614_xxx_croatian_ci;
# Checking mysql_upgrade
#
# Running mysql_upgrade
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -258,10 +258,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -280,11 +281,11 @@ test.maria050313_ucs2_croatian_ci_def OK
test.maria050313_utf8_croatian_ci OK
test.maria050533_xxx_croatian_ci OK
test.maria100004_xxx_croatian_ci OK
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
# Running mysql_upgrade for the second time
# This should report OK for all tables
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -315,10 +316,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -331,7 +333,7 @@ test.maria050313_utf8_croatian_ci OK
test.maria050533_xxx_croatian_ci OK
test.maria100004_xxx_croatian_ci OK
test.mysql050614_xxx_croatian_ci OK
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def;
Table Create Table
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
index 958ade902df..c8ba1fedab8 100644
--- a/mysql-test/r/ctype_utf16.result
+++ b/mysql-test/r/ctype_utf16.result
@@ -101,8 +101,8 @@ RPAD(_utf16 X'0420',10,_utf16 X'0421') r;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `l` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT '',
- `r` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT ''
+ `l` varchar(10) CHARACTER SET utf16 NOT NULL,
+ `r` varchar(10) CHARACTER SET utf16 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(l), hex(r) from t1;
hex(l) hex(r)
@@ -755,7 +755,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84);
INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080);
@@ -1254,6 +1254,8 @@ insert into t1 values ('-1234.1e2xxxx');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert into t1 values ('-1234.1e2 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
select * from t1;
a
-123410
@@ -1262,6 +1264,8 @@ a
drop table t1;
create table t1 (a int);
insert into t1 values ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
insert into t1 values ('1 x');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
@@ -1415,7 +1419,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 64) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET utf16 NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET utf16 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('');
SELECT CHARSET(CONCAT(a,'2001-01-08 00:00:00' - INTERVAL 7 DAY)) FROM t1;
@@ -1464,7 +1468,7 @@ CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `s1` varchar(2) CHARACTER SET utf16 NOT NULL DEFAULT ''
+ `s1` varchar(2) CHARACTER SET utf16 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE');
SELECT * FROM t1 ORDER BY s1;
@@ -1549,7 +1553,7 @@ SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second));
space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second))
NULL
Warnings:
-Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
+Warning 1301 Result of space() was larger than max_allowed_packet (4194304) - truncated
#
# Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
#
@@ -1606,7 +1610,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf16 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1626,7 +1630,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf16 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf16 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1856,7 +1860,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1876,7 +1880,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -2137,3 +2141,73 @@ DEALLOCATE PREPARE stmt;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a VARCHAR(10) CHARACTER SET utf16, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0x61);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+id HEX(a)
+1 0061
+2 0080
+3 07FF
+4 0800
+6 D800DC00
+7 DBFFDFFF
+5 FFFF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+5 FFFF
+7 DBFFDFFF
+6 D800DC00
+4 0800
+3 07FF
+2 0080
+1 0061
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+6
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16 COLLATE utf16_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+id HEX(a)
+1 0061
+2 0080
+3 07FF
+4 0800
+5 FFFF
+6 D800DC00
+7 DBFFDFFF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+7 DBFFDFFF
+6 D800DC00
+5 FFFF
+4 0800
+3 07FF
+2 0080
+1 0061
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+7
+DROP TABLE t1;
+#
+# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING utf16) AS SIGNED)
+#
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING utf16) AS SIGNED);
+CAST(CONVERT('1IJ3' USING utf16) AS SIGNED)
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result
index e3ba73a9047..1e4c77ea83d 100644
--- a/mysql-test/r/ctype_utf16_uca.result
+++ b/mysql-test/r/ctype_utf16_uca.result
@@ -3045,8 +3045,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -3208,7 +3208,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3228,7 +3228,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3695,8 +3695,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_german2_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_german2_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -3726,7 +3726,7 @@ CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c` varchar(10) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci NOT NULL DEFAULT ''
+ `c` varchar(10) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A);
INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C);
@@ -4042,7 +4042,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `s1` varchar(64) CHARACTER SET utf16 COLLATE utf16_myanmar_ci NOT NULL DEFAULT '',
+ `s1` varchar(64) CHARACTER SET utf16 COLLATE utf16_myanmar_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (s1) VALUES
@@ -6605,3 +6605,703 @@ DROP TABLE t1;
#
# End of MariaDB-10.0 tests
#
+#
+# Start of 10.1 tests
+#
+SET NAMES utf8;
+SET collation_connection=utf16_thai_520_w2;
+#
+# Start of ctype_uca_w2.inc
+#
+SELECT @@collation_connection;
+@@collation_connection
+utf16_thai_520_w2
+SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE @@collation_connection;
+ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME
+674 4 utf16_thai_520_w2 utf16
+#
+# Testing strnxfrm
+#
+CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(3) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8)))
+ 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+0020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+00200020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4)))
+ 020A020A020A020A0020002000200020
+0020 020A020A020A020A0020002000200020
+00200020 020A020A020A020A0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1))
+ 020A020A020A020A
+0020 020A020A020A020A
+00200020 020A020A020A020A
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2))
+ 0020002000200020
+0020 0020002000200020
+00200020 0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3))
+ 0020002000200020
+0020 0020002000200020
+00200020 0020002000200020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (_ucs2 0x3400);
+INSERT INTO t1 VALUES (_ucs2 0xF001);
+SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1;
+ucs2 HEX(a) HEX(WEIGHT_STRING(a))
+3400 3400 FB80B4000020
+F001 F001 FBC1F0010020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
+INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
+SELECT * FROM t1 ORDER BY a;
+a
+cota
+cote
+coté
+cotë
+côte
+côté
+côtë
+cotz
+SELECT * FROM t1 ORDER BY a DESC;
+a
+cotz
+côtë
+côté
+côte
+cotë
+coté
+cote
+cota
+DROP TABLE t1;
+#
+# End of ctype_uca_w2.inc
+#
+#
+# Start of ctype_thai.inc
+#
+CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
+INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡');
+INSERT INTO t1 VALUES ('à¸à¸');
+INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š');
+INSERT INTO t1 VALUES ('ข่าง');
+INSERT INTO t1 VALUES ('ข้าง');
+INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน');
+INSERT INTO t1 VALUES ('ข้างขึ้น');
+INSERT INTO t1 VALUES ('ข้างควาย');
+INSERT INTO t1 VALUES ('ข้างเงิน');
+INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡');
+INSERT INTO t1 VALUES ('ข้างออà¸');
+INSERT INTO t1 VALUES ('ข้างๆ');
+INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
+INSERT INTO t1 VALUES ('ขาง');
+INSERT INTO t1 VALUES ('à¹à¸‚็ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่งขัน');
+INSERT INTO t1 VALUES ('à¹à¸‚้ง');
+INSERT INTO t1 VALUES ('à¹à¸‚้งขวา');
+INSERT INTO t1 VALUES ('à¹à¸‚็งขัน');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯');
+INSERT INTO t1 VALUES ('บุà¸à¸à¸²');
+INSERT INTO t1 VALUES ('บุà¸-หลง');
+INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡');
+INSERT INTO t1 VALUES ('ป่า');
+INSERT INTO t1 VALUES ('ป่าน');
+INSERT INTO t1 VALUES ('ป้า');
+INSERT INTO t1 VALUES ('ป้าน');
+INSERT INTO t1 VALUES ('ป๊า');
+INSERT INTO t1 VALUES ('ป๊าน');
+INSERT INTO t1 VALUES ('ป๋า');
+INSERT INTO t1 VALUES ('ป๋าน');
+INSERT INTO t1 VALUES ('ปา');
+INSERT INTO t1 VALUES ('ปาน');
+INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡');
+INSERT INTO t1 VALUES ('พณิชย์');
+INSERT INTO t1 VALUES ('ม้า');
+INSERT INTO t1 VALUES ('ฯพณฯ');
+INSERT INTO t1 VALUES ('A');
+INSERT INTO t1 VALUES ('a');
+INSERT INTO t1 VALUES ('a\'');
+INSERT INTO t1 VALUES ('A-');
+INSERT INTO t1 VALUES ('a-');
+INSERT INTO t1 VALUES ('-a');
+INSERT INTO t1 VALUES ('A.');
+INSERT INTO t1 VALUES ('a.');
+INSERT INTO t1 VALUES ('A-1');
+INSERT INTO t1 VALUES ('aa');
+INSERT INTO t1 VALUES ('AA');
+INSERT INTO t1 VALUES ('A.A.');
+INSERT INTO t1 VALUES ('a.a.');
+INSERT INTO t1 VALUES ('AAA');
+INSERT INTO t1 VALUES ('A.A.A.');
+INSERT INTO t1 VALUES ('AAAA');
+INSERT INTO t1 VALUES ('A.A.A.L.');
+INSERT INTO t1 VALUES ('A.A.A.S.');
+INSERT INTO t1 VALUES ('Aachen');
+INSERT INTO t1 VALUES ('A.A.E.');
+INSERT INTO t1 VALUES ('A.Ae.E.');
+INSERT INTO t1 VALUES ('A.A.E.E.');
+INSERT INTO t1 VALUES ('AAES');
+INSERT INTO t1 VALUES ('AAF');
+INSERT INTO t1 VALUES ('A.Agr');
+INSERT INTO t1 VALUES ('aah');
+INSERT INTO t1 VALUES ('@@@@@');
+INSERT INTO t1 VALUES ('0000');
+INSERT INTO t1 VALUES ('9999');
+INSERT INTO t1 VALUES ('Aalborg');
+INSERT INTO t1 VALUES ('aide');
+INSERT INTO t1 VALUES ('air');
+INSERT INTO t1 VALUES ('@@@air');
+INSERT INTO t1 VALUES ('air@@@');
+INSERT INTO t1 VALUES ('C.A.F');
+INSERT INTO t1 VALUES ('Canon');
+INSERT INTO t1 VALUES ('coop');
+INSERT INTO t1 VALUES ('co-op');
+INSERT INTO t1 VALUES ('COOP');
+INSERT INTO t1 VALUES ('CO-OP');
+INSERT INTO t1 VALUES ('Copenhegen');
+INSERT INTO t1 VALUES ('McArthur');
+INSERT INTO t1 VALUES ('Mc Arthur');
+INSERT INTO t1 VALUES ('Mc Mahon');
+INSERT INTO t1 VALUES ('vice-president');
+INSERT INTO t1 VALUES ('vice versa');
+INSERT INTO t1 VALUES ('vice-versa');
+INSERT INTO t1 VALUES ('10 ลิตร');
+INSERT INTO t1 VALUES ('๑๠ลิตร');
+INSERT INTO t1 VALUES ('10 litre');
+INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
+INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)');
+INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]');
+INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}');
+ALTER TABLE t1 ORDER BY a;
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection,
+' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
+ ' , ADD KEY a_id (a, id)');
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(30) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`),
+ KEY `a_id` (`a`,`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1
+#
+# Ascending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a, BINARY a;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+#
+# Ascending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a, id;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a DESC, id DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+DROP TABLE t1;
+#
+# End of ctype_thai.inc
+#
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_utf16le.result b/mysql-test/r/ctype_utf16le.result
index 8098b0d1666..93fce843dc8 100644
--- a/mysql-test/r/ctype_utf16le.result
+++ b/mysql-test/r/ctype_utf16le.result
@@ -102,8 +102,8 @@ RPAD(_utf16le X'2004',10,_utf16le X'2104') r;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `l` varchar(10) CHARACTER SET utf16le NOT NULL DEFAULT '',
- `r` varchar(10) CHARACTER SET utf16le NOT NULL DEFAULT ''
+ `l` varchar(10) CHARACTER SET utf16le NOT NULL,
+ `r` varchar(10) CHARACTER SET utf16le NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT HEX(l), HEX(r) FROM t1;
HEX(l) HEX(r)
@@ -798,7 +798,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84);
INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080);
@@ -1474,6 +1474,8 @@ INSERT INTO t1 VALUES ('-1234.1e2xxxx');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
INSERT INTO t1 VALUES ('-1234.1e2 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
INSERT INTO t1 VALUES ('123');
INSERT INTO t1 VALUES ('-124');
INSERT INTO t1 VALUES ('+125');
@@ -1520,6 +1522,8 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
INSERT INTO t1 VALUES ('1 x');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
@@ -1686,7 +1690,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 64) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET utf16le NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET utf16le NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('');
SELECT CHARSET(CONCAT(a,'2001-01-08 00:00:00' - INTERVAL 7 DAY)) FROM t1;
@@ -1737,7 +1741,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',2) as s1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `s1` varchar(2) CHARACTER SET utf16le NOT NULL DEFAULT ''
+ `s1` varchar(2) CHARACTER SET utf16le NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE');
SELECT * FROM t1 ORDER BY s1;
@@ -1809,7 +1813,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(c);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c` varchar(10) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL DEFAULT '',
+ `c` varchar(10) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL,
PRIMARY KEY (`c`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('abc'),('zyx'),('acb');
@@ -1830,7 +1834,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16le NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf16le NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1850,7 +1854,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf16le NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf16le NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -2080,7 +2084,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -2100,7 +2104,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -2319,3 +2323,73 @@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
#
# End of 5.6 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a VARCHAR(10) CHARACTER SET utf16le, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0x61);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+id HEX(a)
+1 6100
+2 8000
+3 FF07
+4 0008
+6 00D800DC
+7 FFDBFFDF
+5 FFFF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+5 FFFF
+7 FFDBFFDF
+6 00D800DC
+4 0008
+3 FF07
+2 8000
+1 6100
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+6
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16le COLLATE utf16le_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+id HEX(a)
+1 6100
+2 8000
+3 FF07
+4 0008
+5 FFFF
+6 00D800DC
+7 FFDBFFDF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+7 FFDBFFDF
+6 00D800DC
+5 FFFF
+4 0008
+3 FF07
+2 8000
+1 6100
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+7
+DROP TABLE t1;
+#
+# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
+#
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED);
+CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED)
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result
index 1f3e519a525..22b0e9c0fc0 100644
--- a/mysql-test/r/ctype_utf32.result
+++ b/mysql-test/r/ctype_utf32.result
@@ -100,8 +100,8 @@ RPAD(_utf32 X'0420',10,_utf32 X'0421') r;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `l` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT '',
- `r` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT ''
+ `l` varchar(10) CHARACTER SET utf32 NOT NULL,
+ `r` varchar(10) CHARACTER SET utf32 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(l), hex(r) from t1;
hex(l) hex(r)
@@ -754,7 +754,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84);
INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080);
@@ -1252,6 +1252,8 @@ insert into t1 values ('-1234.1e2xxxx');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert into t1 values ('-1234.1e2 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
select * from t1;
a
-123410
@@ -1260,6 +1262,8 @@ a
drop table t1;
create table t1 (a int);
insert into t1 values ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
insert into t1 values ('1 x');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
@@ -1363,7 +1367,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 64) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET utf32 NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET utf32 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('');
SELECT CHARSET(CONCAT(a,'2001-01-08 00:00:00' - INTERVAL 7 DAY)) FROM t1;
@@ -1478,7 +1482,7 @@ CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `s1` varchar(2) CHARACTER SET utf32 NOT NULL DEFAULT ''
+ `s1` varchar(2) CHARACTER SET utf32 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE');
SELECT * FROM t1 ORDER BY s1;
@@ -1571,7 +1575,7 @@ CREATE TABLE t1 AS SELECT format(123,2,'no_NO');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `format(123,2,'no_NO')` varchar(37) CHARACTER SET utf32 NOT NULL DEFAULT ''
+ `format(123,2,'no_NO')` varchar(37) CHARACTER SET utf32 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t1;
format(123,2,'no_NO')
@@ -1660,7 +1664,9 @@ CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061))
1
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
c
-FFFF0000
+0000003F0000003F0000003F0000003F
+Warnings:
+Warning 1300 Invalid utf32 character string: '\xFF\xFF\x00\x00'
#
# MDEV-11685: sql_mode can't be set with non-ascii connection charset
#
@@ -1703,7 +1709,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf32 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf32 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1723,7 +1729,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf32 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf32 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1953,7 +1959,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -1973,7 +1979,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -2234,3 +2240,30 @@ DEALLOCATE PREPARE stmt;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32, KEY(a));
+INSERT INTO t1 VALUES (0x10000),(0x10001),(0x10002);
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+1
+DROP TABLE t1;
+SELECT _utf32 0x10001=_utf32 0x10002;
+_utf32 0x10001=_utf32 0x10002
+1
+#
+# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
+#
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING utf32) AS SIGNED);
+CAST(CONVERT('1IJ3' USING utf32) AS SIGNED)
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result
index d2032d401df..234a01bb108 100644
--- a/mysql-test/r/ctype_utf32_uca.result
+++ b/mysql-test/r/ctype_utf32_uca.result
@@ -3045,8 +3045,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -3228,7 +3228,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3248,7 +3248,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3715,8 +3715,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_german2_ci NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_german2_ci NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -3746,7 +3746,7 @@ CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c` varchar(10) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci NOT NULL DEFAULT ''
+ `c` varchar(10) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A);
INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C);
@@ -4062,7 +4062,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `s1` varchar(64) CHARACTER SET utf32 COLLATE utf32_myanmar_ci NOT NULL DEFAULT '',
+ `s1` varchar(64) CHARACTER SET utf32 COLLATE utf32_myanmar_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (s1) VALUES
@@ -6625,3 +6625,703 @@ DROP TABLE t1;
#
# End of MariaDB-10.0 tests
#
+#
+# Start of 10.1 tests
+#
+SET NAMES utf8;
+SET collation_connection=utf32_thai_520_w2;
+#
+# Start of ctype_uca_w2.inc
+#
+SELECT @@collation_connection;
+@@collation_connection
+utf32_thai_520_w2
+SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE @@collation_connection;
+ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME
+738 4 utf32_thai_520_w2 utf32
+#
+# Testing strnxfrm
+#
+CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(3) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8)))
+ 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+00000020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+0000002000000020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4)))
+ 020A020A020A020A0020002000200020
+00000020 020A020A020A020A0020002000200020
+0000002000000020 020A020A020A020A0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1))
+ 020A020A020A020A
+00000020 020A020A020A020A
+0000002000000020 020A020A020A020A
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2))
+ 0020002000200020
+00000020 0020002000200020
+0000002000000020 0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3))
+ 0020002000200020
+00000020 0020002000200020
+0000002000000020 0020002000200020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (_ucs2 0x3400);
+INSERT INTO t1 VALUES (_ucs2 0xF001);
+SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1;
+ucs2 HEX(a) HEX(WEIGHT_STRING(a))
+3400 00003400 FB80B4000020
+F001 0000F001 FBC1F0010020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
+INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
+SELECT * FROM t1 ORDER BY a;
+a
+cota
+cote
+coté
+cotë
+côte
+côté
+côtë
+cotz
+SELECT * FROM t1 ORDER BY a DESC;
+a
+cotz
+côtë
+côté
+côte
+cotë
+coté
+cote
+cota
+DROP TABLE t1;
+#
+# End of ctype_uca_w2.inc
+#
+#
+# Start of ctype_thai.inc
+#
+CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
+INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡');
+INSERT INTO t1 VALUES ('à¸à¸');
+INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š');
+INSERT INTO t1 VALUES ('ข่าง');
+INSERT INTO t1 VALUES ('ข้าง');
+INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน');
+INSERT INTO t1 VALUES ('ข้างขึ้น');
+INSERT INTO t1 VALUES ('ข้างควาย');
+INSERT INTO t1 VALUES ('ข้างเงิน');
+INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡');
+INSERT INTO t1 VALUES ('ข้างออà¸');
+INSERT INTO t1 VALUES ('ข้างๆ');
+INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
+INSERT INTO t1 VALUES ('ขาง');
+INSERT INTO t1 VALUES ('à¹à¸‚็ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่งขัน');
+INSERT INTO t1 VALUES ('à¹à¸‚้ง');
+INSERT INTO t1 VALUES ('à¹à¸‚้งขวา');
+INSERT INTO t1 VALUES ('à¹à¸‚็งขัน');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯');
+INSERT INTO t1 VALUES ('บุà¸à¸à¸²');
+INSERT INTO t1 VALUES ('บุà¸-หลง');
+INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡');
+INSERT INTO t1 VALUES ('ป่า');
+INSERT INTO t1 VALUES ('ป่าน');
+INSERT INTO t1 VALUES ('ป้า');
+INSERT INTO t1 VALUES ('ป้าน');
+INSERT INTO t1 VALUES ('ป๊า');
+INSERT INTO t1 VALUES ('ป๊าน');
+INSERT INTO t1 VALUES ('ป๋า');
+INSERT INTO t1 VALUES ('ป๋าน');
+INSERT INTO t1 VALUES ('ปา');
+INSERT INTO t1 VALUES ('ปาน');
+INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡');
+INSERT INTO t1 VALUES ('พณิชย์');
+INSERT INTO t1 VALUES ('ม้า');
+INSERT INTO t1 VALUES ('ฯพณฯ');
+INSERT INTO t1 VALUES ('A');
+INSERT INTO t1 VALUES ('a');
+INSERT INTO t1 VALUES ('a\'');
+INSERT INTO t1 VALUES ('A-');
+INSERT INTO t1 VALUES ('a-');
+INSERT INTO t1 VALUES ('-a');
+INSERT INTO t1 VALUES ('A.');
+INSERT INTO t1 VALUES ('a.');
+INSERT INTO t1 VALUES ('A-1');
+INSERT INTO t1 VALUES ('aa');
+INSERT INTO t1 VALUES ('AA');
+INSERT INTO t1 VALUES ('A.A.');
+INSERT INTO t1 VALUES ('a.a.');
+INSERT INTO t1 VALUES ('AAA');
+INSERT INTO t1 VALUES ('A.A.A.');
+INSERT INTO t1 VALUES ('AAAA');
+INSERT INTO t1 VALUES ('A.A.A.L.');
+INSERT INTO t1 VALUES ('A.A.A.S.');
+INSERT INTO t1 VALUES ('Aachen');
+INSERT INTO t1 VALUES ('A.A.E.');
+INSERT INTO t1 VALUES ('A.Ae.E.');
+INSERT INTO t1 VALUES ('A.A.E.E.');
+INSERT INTO t1 VALUES ('AAES');
+INSERT INTO t1 VALUES ('AAF');
+INSERT INTO t1 VALUES ('A.Agr');
+INSERT INTO t1 VALUES ('aah');
+INSERT INTO t1 VALUES ('@@@@@');
+INSERT INTO t1 VALUES ('0000');
+INSERT INTO t1 VALUES ('9999');
+INSERT INTO t1 VALUES ('Aalborg');
+INSERT INTO t1 VALUES ('aide');
+INSERT INTO t1 VALUES ('air');
+INSERT INTO t1 VALUES ('@@@air');
+INSERT INTO t1 VALUES ('air@@@');
+INSERT INTO t1 VALUES ('C.A.F');
+INSERT INTO t1 VALUES ('Canon');
+INSERT INTO t1 VALUES ('coop');
+INSERT INTO t1 VALUES ('co-op');
+INSERT INTO t1 VALUES ('COOP');
+INSERT INTO t1 VALUES ('CO-OP');
+INSERT INTO t1 VALUES ('Copenhegen');
+INSERT INTO t1 VALUES ('McArthur');
+INSERT INTO t1 VALUES ('Mc Arthur');
+INSERT INTO t1 VALUES ('Mc Mahon');
+INSERT INTO t1 VALUES ('vice-president');
+INSERT INTO t1 VALUES ('vice versa');
+INSERT INTO t1 VALUES ('vice-versa');
+INSERT INTO t1 VALUES ('10 ลิตร');
+INSERT INTO t1 VALUES ('๑๠ลิตร');
+INSERT INTO t1 VALUES ('10 litre');
+INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
+INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)');
+INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]');
+INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}');
+ALTER TABLE t1 ORDER BY a;
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection,
+' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
+ ' , ADD KEY a_id (a, id)');
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(30) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`),
+ KEY `a_id` (`a`,`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1
+#
+# Ascending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a, BINARY a;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+#
+# Ascending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a, id;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a DESC, id DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+DROP TABLE t1;
+#
+# End of ctype_thai.inc
+#
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 7a3ff3732c3..5a77ea3aea5 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -225,7 +225,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 varchar(10) character set utf8);
insert into t1 values (0x41FF);
@@ -233,7 +233,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 text character set utf8);
insert into t1 values (0x41FF);
@@ -241,7 +241,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (a text character set utf8, primary key(a(371)));
ERROR 42000: Specified key was too long; max key length is 1000 bytes
@@ -901,8 +901,8 @@ create table t2 select concat(a,_utf8'') as a, concat(b,_utf8'')as b from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` varchar(5) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `b` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8 NOT NULL,
+ `b` varchar(15) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
drop table t1;
@@ -1126,8 +1126,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf8 NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -1160,8 +1160,8 @@ STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
SHOW COLUMNS FROM t1;
Field Type Null Key Default Extra
-subject varchar(64) NO
-pattern varchar(64) NO
+subject varchar(64) NO NULL
+pattern varchar(64) NO NULL
INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
@@ -1919,9 +1919,9 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
-
+??
Warnings:
-Warning 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: '\xFF\x8F'
set sql_mode=traditional;
select char(0xff,0x8f using utf8);
char(0xff,0x8f using utf8)
@@ -1945,9 +1945,9 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FD'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
-NULL
+??
Warnings:
-Warning 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8));
hex(convert(char(2557 using latin1) using utf8))
09C3BD
@@ -2114,9 +2114,9 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FF'
select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
-NULL
+3F
Warnings:
-Warning 1300 Invalid utf8 character string: 'FF'
+Warning 1300 Invalid utf8 character string: '\xFF'
select hex(_utf8 0x616263FF);
ERROR HY000: Invalid utf8 character string: 'FF'
select hex(_utf8 X'616263FF');
@@ -2133,9 +2133,9 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FF'
select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
-
+3F
Warnings:
-Warning 1300 Invalid utf8 character string: 'FF'
+Warning 1300 Invalid utf8 character string: '\xFF'
select hex(_utf8 0x616263FF);
ERROR HY000: Invalid utf8 character string: 'FF'
select hex(_utf8 X'616263FF');
@@ -2464,7 +2464,7 @@ create table t1 as select concat(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -2477,7 +2477,7 @@ create table t1 as select concat(18446744073709551615) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(20) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -2490,7 +2490,7 @@ create table t1 as select concat(1.1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select hex(c1) from t1;
hex(c1)
@@ -2503,7 +2503,7 @@ create table t1 as select concat(1+2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1-2));
@@ -2513,7 +2513,7 @@ create table t1 as select concat(1-2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1*2));
@@ -2523,7 +2523,7 @@ create table t1 as select concat(1*2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1/2));
@@ -2563,7 +2563,7 @@ create table t1 as select concat(-1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(-(1+2)));
@@ -2573,7 +2573,7 @@ create table t1 as select concat(-(1+2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1|2));
@@ -2583,7 +2583,7 @@ create table t1 as select concat(1|2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(1&2));
@@ -2593,7 +2593,7 @@ create table t1 as select concat(1&2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_count(12)));
@@ -2603,7 +2603,7 @@ create table t1 as select concat(bit_count(12)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2<<1));
@@ -2613,7 +2613,7 @@ create table t1 as select concat(2<<1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(2>>1));
@@ -2623,7 +2623,7 @@ create table t1 as select concat(2>>1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(~0));
@@ -2633,7 +2633,7 @@ create table t1 as select concat(~0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(3^2));
@@ -2643,7 +2643,7 @@ create table t1 as select concat(3^2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(abs(-2)));
@@ -2653,7 +2653,7 @@ create table t1 as select concat(abs(-2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(concat(exp(2)),1));
@@ -2783,7 +2783,7 @@ create table t1 as select concat(degrees(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(radians(0)));
@@ -2793,7 +2793,7 @@ create table t1 as select concat(radians(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ceiling(0.5)));
@@ -2803,7 +2803,7 @@ create table t1 as select concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
@@ -2813,7 +2813,7 @@ create table t1 as select concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
@@ -2823,7 +2823,7 @@ create table t1 as select concat(round(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sign(0.5)));
@@ -2833,14 +2833,14 @@ create table t1 as select concat(sign(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(rand()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(23) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(23) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(length('a')));
@@ -2850,7 +2850,7 @@ create table t1 as select concat(length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(char_length('a')));
@@ -2860,7 +2860,7 @@ create table t1 as select concat(char_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(bit_length('a')));
@@ -2870,7 +2870,7 @@ create table t1 as select concat(bit_length('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coercibility('a')));
@@ -2880,7 +2880,7 @@ create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(locate('a','a')));
@@ -2890,7 +2890,7 @@ create table t1 as select concat(locate('a','a')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(11) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(11) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(field('c','a','b','c')));
@@ -2900,7 +2900,7 @@ create table t1 as select concat(field('c','a','b','c')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ascii(61)));
@@ -2910,7 +2910,7 @@ create table t1 as select concat(ascii(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ord(61)));
@@ -2920,7 +2920,7 @@ create table t1 as select concat(ord(61)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(find_in_set('b','a,b,c,d')));
@@ -2930,7 +2930,7 @@ create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select md5('a'), hex(md5('a'));
@@ -2940,7 +2940,7 @@ create table t1 as select md5('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(32) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(32) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select old_password('a'), hex(old_password('a'));
@@ -2950,7 +2950,7 @@ create table t1 as select old_password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(16) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(16) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select password('a'), hex(password('a'));
@@ -2960,7 +2960,7 @@ create table t1 as select password('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(41) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(41) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha('a'), hex(sha('a'));
@@ -2970,7 +2970,7 @@ create table t1 as select sha('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(40) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select sha1('a'), hex(sha1('a'));
@@ -2980,7 +2980,7 @@ create table t1 as select sha1('a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(40) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('-1' as signed)));
@@ -2990,7 +2990,7 @@ create table t1 as select concat(cast('-1' as signed)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast('1' as unsigned)));
@@ -3000,7 +3000,7 @@ create table t1 as select concat(cast('1' as unsigned)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(cast(1/2 as decimal(5,5))));
@@ -3059,7 +3059,7 @@ create table t1 as select concat(least(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(greatest(1,2)));
@@ -3069,7 +3069,7 @@ create table t1 as select concat(greatest(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(case when 11 then 22 else 33 end));
@@ -3079,7 +3079,7 @@ create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(coalesce(1,2)));
@@ -3089,7 +3089,7 @@ create table t1 as select concat(coalesce(1,2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat_ws(1,2,3));
@@ -3099,7 +3099,7 @@ create table t1 as select concat_ws(1,2,3) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(group_concat(1,2,3));
@@ -3127,7 +3127,7 @@ create table t1 as select concat(last_insert_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(benchmark(0,0)));
@@ -3137,7 +3137,7 @@ create table t1 as select concat(benchmark(0,0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sleep(0)));
@@ -3147,7 +3147,7 @@ create table t1 as select concat(sleep(0)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(is_free_lock('xxxx')));
@@ -3181,7 +3181,7 @@ create table t1 as select concat(crc32('')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(uncompressed_length('')));
@@ -3198,7 +3198,7 @@ create table t1 as select concat(connection_id()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(inet_aton('127.1.1.1')));
@@ -3234,7 +3234,7 @@ create table t1 as select concat(row_count()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(found_rows()));
@@ -3244,21 +3244,21 @@ create table t1 as select concat(found_rows()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid_short()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(21) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(uuid()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(36) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
@@ -3271,7 +3271,7 @@ create table t1 as select concat(uuid(), cast('a' as char character set latin1))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(37) NOT NULL DEFAULT ''
+ `c1` varchar(37) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
@@ -3291,8 +3291,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c2` int(1) NOT NULL DEFAULT '0'
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL,
+ `c2` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1;
@@ -3349,8 +3349,8 @@ hex(c1)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c2` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL,
+ `c2` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @a2=1.1;
@@ -3388,7 +3388,7 @@ create table t1 as select concat('a'='a' IS TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a'='a' IS NOT TRUE));
@@ -3398,7 +3398,7 @@ create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(NOT 'a'='a'));
@@ -3408,7 +3408,7 @@ create table t1 as select concat(NOT 'a'='a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NULL));
@@ -3418,7 +3418,7 @@ create table t1 as select concat('a' IS NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' IS NOT NULL));
@@ -3428,7 +3428,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' rlike 'a'));
@@ -3438,7 +3438,7 @@ create table t1 as select concat('a' IS NOT NULL) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(strcmp('a','b')));
@@ -3448,7 +3448,7 @@ create table t1 as select concat(strcmp('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' like 'a'));
@@ -3458,7 +3458,7 @@ create table t1 as select concat('a' like 'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' between 'b' and 'c'));
@@ -3468,7 +3468,7 @@ create table t1 as select concat('a' between 'b' and 'c') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat('a' in ('a','b')));
@@ -3478,7 +3478,7 @@ create table t1 as select concat('a' in ('a','b')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
@@ -3488,7 +3488,7 @@ create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(10), fulltext key(a));
@@ -3510,7 +3510,7 @@ create table t1 as select ifnull(1,'a') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1,1)));
@@ -3520,7 +3520,7 @@ create table t1 as select concat(ifnull(1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(ifnull(1.1,1.1)));
@@ -3530,7 +3530,7 @@ create table t1 as select concat(ifnull(1.1,1.1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,'b',1));
@@ -3540,7 +3540,7 @@ create table t1 as select if(1,'b',1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(if(1,1,'b'));
@@ -3550,7 +3550,7 @@ create table t1 as select if(1,1,'b') as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(if(1,1,1)));
@@ -3560,7 +3560,7 @@ create table t1 as select concat(if(1,1,1)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(nullif(1,2)));
@@ -3640,7 +3640,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL
+ `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -3650,7 +3650,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL
+ `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
@@ -3725,7 +3725,7 @@ create table t1 as select concat(period_add(200902, 2)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(period_diff(200902, 200802)));
@@ -3737,7 +3737,7 @@ Warning 1265 Data truncated for column 'c1' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(to_days(20090224)));
@@ -3934,21 +3934,21 @@ create table t1 as select concat(curdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_date()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(curtime()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat('a',20) as c1 limit 0;
@@ -3964,7 +3964,7 @@ create table t1 as select concat(utc_time()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(sec_to_time(2378)));
@@ -4057,21 +4057,21 @@ create table t1 as select concat(now()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(utc_timestamp()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select concat(sysdate()) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(19) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(addtime('00:00:00','11:22:33')));
@@ -4111,7 +4111,7 @@ create table t1 as select export_set(1,2,3,4,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(127) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(127) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(insert(1133,3,0,22));
@@ -4121,7 +4121,7 @@ create table t1 as select insert(1133,3,0,22) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(6) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lcase(123));
@@ -4131,7 +4131,7 @@ create table t1 as select lcase(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(left(123,1));
@@ -4141,7 +4141,7 @@ create table t1 as select left(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lower(123));
@@ -4151,7 +4151,7 @@ create table t1 as select lower(123) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(lpad(1,2,0));
@@ -4161,7 +4161,7 @@ create table t1 as select lpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ltrim(1));
@@ -4171,7 +4171,7 @@ create table t1 as select ltrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(mid(1,1,1));
@@ -4181,7 +4181,7 @@ create table t1 as select mid(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(repeat(1,2));
@@ -4191,7 +4191,7 @@ create table t1 as select repeat(1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(replace(1,1,2));
@@ -4201,7 +4201,7 @@ create table t1 as select replace(1,1,2) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(reverse(12));
@@ -4211,7 +4211,7 @@ create table t1 as select reverse(12) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(right(123,1));
@@ -4221,7 +4221,7 @@ create table t1 as select right(123,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rpad(1,2,0));
@@ -4231,7 +4231,7 @@ create table t1 as select rpad(1,2,0) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(rtrim(1));
@@ -4241,7 +4241,7 @@ create table t1 as select rtrim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(soundex(1));
@@ -4251,7 +4251,7 @@ create table t1 as select soundex(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(substring(1,1,1));
@@ -4261,7 +4261,7 @@ create table t1 as select substring(1,1,1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(trim(1));
@@ -4271,7 +4271,7 @@ create table t1 as select trim(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(ucase(1));
@@ -4281,7 +4281,7 @@ create table t1 as select ucase(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(upper(1));
@@ -4291,14 +4291,14 @@ create table t1 as select upper(1) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 as select repeat(' ', 64) as a limit 0;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `a` varchar(64) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ("1.1"), ("2.1");
select a, hex(a) from t1;
@@ -4527,7 +4527,7 @@ t2 CREATE TABLE `t2` (
`concat(a)` varbinary(64) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -4548,7 +4548,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `concat(a)` varchar(19) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a date);
@@ -4839,7 +4839,7 @@ hex(a)
0000000000000001
drop table t1;
drop view v1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -5088,7 +5088,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`CONCAT(a)` varchar(9) CHARACTER SET utf8 DEFAULT NULL,
- `IFNULL(a,'')` varchar(9) CHARACTER SET utf8 NOT NULL DEFAULT '',
+ `IFNULL(a,'')` varchar(9) CHARACTER SET utf8 NOT NULL,
`IF(a,a,'')` varchar(9) CHARACTER SET utf8 DEFAULT NULL,
`CASE WHEN a THEN a ELSE '' END` varchar(9) CHARACTER SET utf8 DEFAULT NULL,
`COALESCE(a,'')` varchar(9) CHARACTER SET utf8 DEFAULT NULL
@@ -5098,14 +5098,14 @@ CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LCASE(a) FROM t1;
@@ -5126,35 +5126,35 @@ CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPEAT(1,2)` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `REPEAT(1,2)` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LEFT(123,2)` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `LEFT(123,2)` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RIGHT(123,2)` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `RIGHT(123,2)` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `LTRIM(123)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `LTRIM(123)` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `RTRIM(123)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `RTRIM(123)` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1;
@@ -5168,35 +5168,35 @@ CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `REPLACE(111,2,3)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `REPLACE(111,2,3)` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `SOUNDEX(1)` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `SOUNDEX(1)` varchar(4) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8);
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
@@ -5220,7 +5220,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
+1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
@@ -5360,7 +5360,7 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`d` date DEFAULT NULL,
- `bad` varchar(10) CHARACTER SET utf8 DEFAULT NULL
+ `bad` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET NAMES latin1;
@@ -5374,7 +5374,8 @@ DROP TABLE t1;
SET sql_mode=default;
#
# Bug#57687 crash when reporting duplicate group_key error and utf8
-# Make sure to modify this when Bug#58081 is fixed.
+# Bug#58081 Duplicate entry error when doing GROUP BY
+# MDEV-9332 Bug after upgrade to 10.1.10
#
SET NAMES utf8;
CREATE TABLE t1 (a INT);
@@ -5443,7 +5444,7 @@ ADD KEY(ch);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '',
+ `ch` varchar(60) CHARACTER SET utf8 NOT NULL,
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `ch` (`ch`)
@@ -5470,10 +5471,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
Warnings:
@@ -5516,6 +5529,12 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
ch
a
@@ -5537,6 +5556,12 @@ aЀ
aÖ€
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
ch
a
@@ -5564,11 +5589,23 @@ z
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
ch
z
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
@@ -5604,11 +5641,11 @@ a?z
ab
az
aЀ
+aÖ€
SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch');
PREPARE stmt FROM @query;
EXECUTE stmt;
ch
-aÖ€
z
# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence
SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch');
@@ -5651,7 +5688,7 @@ ADD KEY(ch);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '',
+ `ch` varchar(60) CHARACTER SET utf8 NOT NULL,
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `ch` (`ch`)
@@ -5678,10 +5715,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
Warnings:
@@ -5724,6 +5773,12 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
ch
a
@@ -5745,6 +5800,12 @@ aЀ
aÖ€
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
ch
a
@@ -5772,11 +5833,23 @@ z
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
ch
z
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ch ch 182 NULL # Using where; Using index
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
@@ -5812,11 +5885,11 @@ a?z
ab
az
aЀ
+aÖ€
SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch');
PREPARE stmt FROM @query;
EXECUTE stmt;
ch
-aÖ€
z
# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence
SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch');
@@ -5859,7 +5932,7 @@ ADD KEY(ch);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '',
+ `ch` varchar(60) CHARACTER SET utf8 NOT NULL,
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `ch` (`ch`)
@@ -5886,10 +5959,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
ch
Warnings:
Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
ch
Warnings:
@@ -5932,6 +6017,10 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
ch
a
@@ -5951,6 +6040,10 @@ ab
az
aЀ
aÖ€
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
ch
a
@@ -5976,9 +6069,17 @@ z
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
ch
z
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL ch NULL NULL NULL # Using where; Using filesort
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ch
z
@@ -6012,11 +6113,11 @@ a?z
ab
az
aЀ
+aÖ€
SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch');
PREPARE stmt FROM @query;
EXECUTE stmt;
ch
-aÖ€
z
# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence
SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch');
@@ -6080,11 +6181,11 @@ FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c0` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c1` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c2` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c3` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `c4` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c0` varchar(19) CHARACTER SET utf8 NOT NULL,
+ `c1` varchar(19) CHARACTER SET utf8 NOT NULL,
+ `c2` varchar(19) CHARACTER SET utf8 NOT NULL,
+ `c3` varchar(19) CHARACTER SET utf8 NOT NULL,
+ `c4` varchar(19) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
c0 c1 c2 c3 c4
@@ -6211,7 +6312,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -6231,7 +6332,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -6455,7 +6556,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -6475,7 +6576,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -6727,7 +6828,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -6750,7 +6851,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -6773,7 +6874,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -6796,7 +6897,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -6815,6 +6916,31 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
+#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a '))))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
SET NAMES utf8;
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
@@ -6823,7 +6949,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
@@ -6846,7 +6972,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
@@ -6869,7 +6995,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
@@ -6892,7 +7018,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
@@ -6912,13 +7038,38 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`)))
DROP TABLE t1;
#
+# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+#
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+a LENGTH(a)
+a 1
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+a LENGTH(a)
+a 1
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a'))
+DROP TABLE t1;
+#
+# End of MDEV-8694
+#
+#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
#
CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('ae'),('ä');
SELECT * FROM t1 WHERE c1='ä';
@@ -10130,3 +10281,259 @@ DROP VIEW v1;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database
+#
+SET NAMES utf8;
+SELECT * FROM `testðŸ˜ðŸ˜test`;
+ERROR HY000: Invalid utf8 character string: 'test\xF0\x9F\x98\x81\xF0\x9F\x98\x81test'
+#
+#MDEV-8256 A part of a ROW comparison is erroneously optimized away
+#
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
+INSERT INTO t1 VALUES ('1e1'),('1é1');
+SELECT * FROM t1 WHERE a=10;
+a
+1e1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1é1'
+SELECT * FROM t1 WHERE a='1e1';
+a
+1e1
+1é1
+SELECT * FROM t1 WHERE a=10 AND a='1e1';
+a
+1e1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1é1'
+SELECT * FROM t1 WHERE (a,a)=(10,'1e1');
+a
+1e1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1é1'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,a)=(10,'1e1');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`a` = '1e1'))
+DROP TABLE t1;
+#
+# MDEV-8688 Wrong result for SELECT..WHERE varchar_column IN (1,2,3) AND varchar_column=' 1';
+#
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('1e1'),('1ë1');
+SELECT * FROM t1 WHERE a IN (1,2);
+a
+1ë1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1ë1'
+SELECT * FROM t1 WHERE a IN (1,2) AND a='1ë1';
+a
+1ë1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1ë1'
+SELECT * FROM t1 WHERE a IN (1,2,'x') AND a='1ë1';
+a
+1ë1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1ë1'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2) AND a='1ë1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '1ë1') and (`test`.`t1`.`a` in (1,2)))
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,'x') AND a='1ë1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '1ë1') and (`test`.`t1`.`a` in (1,2,'x')))
+DROP TABLE IF EXISTS t1;
+#
+# MDEV-8816 Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_swedish_ci AND varbinary_column='A';
+#
+CREATE TABLE t1 (c VARBINARY(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE c>=_utf8'a' COLLATE utf8_general_ci AND c='A';
+c
+A
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE c>=_utf8'a' COLLATE utf8_general_ci AND c='A';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`c` = 'A')
+DROP TABLE t1;
+#
+# MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+#
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '\'', "\"";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""", N'\'', N"\"";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+ROUTINE_DEFINITION
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '''', """";
+SELECT '<tab>\t<tab>\t<tab>';
+SELECT '<nl>\n<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""", N'''', N"""";
+SELECT N'<tab>\t<tab>\t<tab>';
+SELECT N'<nl>\n<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+body_utf8
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '''', """";
+SELECT '<tab>\t<tab>\t<tab>';
+SELECT '<nl>\n<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""", N'''', N"""";
+SELECT N'<tab>\t<tab>\t<tab>';
+SELECT N'<nl>\n<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+DROP PROCEDURE p1;
+SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+ROUTINE_DEFINITION
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+body_utf8
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+DROP PROCEDURE p1;
+SET @@SQL_MODE=default;
+#
+# MDEV-10191 non convertible chars convert() resulted in Null instead "?" on Windows
+#
+SET sql_mode='STRICT_TRANS_TABLES';
+SELECT CONVERT(_utf8 0xC499 USING latin1);
+CONVERT(_utf8 0xC499 USING latin1)
+?
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
+SELECT CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1);
+CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1)
+?
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
+SET sql_mode=default;
+SELECT CONVERT(_utf8 0xC499 USING latin1);
+CONVERT(_utf8 0xC499 USING latin1)
+?
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
+SELECT CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1);
+CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1)
+?
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
index ff9c155e445..d45b6b23263 100644
--- a/mysql-test/r/ctype_utf8mb4.result
+++ b/mysql-test/r/ctype_utf8mb4.result
@@ -225,7 +225,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 varchar(10) character set utf8mb4);
insert into t1 values (0x41FF);
@@ -233,7 +233,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 text character set utf8mb4);
insert into t1 values (0x41FF);
@@ -241,7 +241,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (a text character set utf8mb4, primary key(a(371)));
ERROR 42000: Specified key was too long; max key length is 1000 bytes
@@ -901,8 +901,8 @@ create table t2 select concat(a,_utf8mb4'') as a, concat(b,_utf8mb4'')as b from
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL,
+ `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
drop table t1;
@@ -1126,8 +1126,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -1233,7 +1233,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84);
INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080);
@@ -1944,9 +1944,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
select char(0xff,0x8f using utf8mb4);
char(0xff,0x8f using utf8mb4)
@@ -1970,9 +1970,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-NULL
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
hex(convert(char(2557 using latin1) using utf8mb4))
09C3BD
@@ -2139,9 +2139,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-NULL
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -2158,9 +2158,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -2327,7 +2327,7 @@ select hex(utf8mb4) from t1;
hex(utf8mb4)
F0908080
F0BFBFBF
-
+3F
delete from t1;
Testing [F2..F3][80..BF][80..BF][80..BF]
insert into t1 values (0xF2808080);
@@ -2347,7 +2347,7 @@ select hex(utf8mb4) from t1;
hex(utf8mb4)
F4808080
F48F8080
-
+3F
drop table t1;
#
# Check strnxfrm() with odd length
@@ -2472,45 +2472,45 @@ F3A087AFEA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
-EA9DA8
+3F3F3F3FEA9DA8
SELECT HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding)) FROM t1,t2;
HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding))
F09D8480EA9DA8
F09D8480EFB9AB
-F09D8480
+F09D84803F3F3F3F
F09D849EEA9DA8
F09D849EEFB9AB
-F09D849E
+F09D849E3F3F3F3F
F09D859EEA9DA8
F09D859EEFB9AB
-F09D859E
+F09D859E3F3F3F3F
F09D878FEA9DA8
F09D878FEFB9AB
-F09D878F
+F09D878F3F3F3F3F
F09D9C9FEA9DA8
F09D9C9FEFB9AB
-F09D9C9F
+F09D9C9F3F3F3F3F
F09D9E9FEA9DA8
F09D9E9FEFB9AB
-F09D9E9F
+F09D9E9F3F3F3F3F
F48FBFBFEA9DA8
F48FBFBFEFB9AB
-F48FBFBF
+F48FBFBF3F3F3F3F
F3A087AFEA9DA8
F3A087AFEFB9AB
-F3A087AF
+F3A087AF3F3F3F3F
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEFB9AB
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB
+EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB3F3F3F3F
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-EA9DA8
-EFB9AB
-
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
+3F3F3F3FEA9DA8
+3F3F3F3FEFB9AB
+3F3F3F3F3F3F3F3F
SELECT count(*) FROM t1, t2
WHERE t1.utf8mb4_encoding > t2.utf8mb3_encoding;
count(*)
@@ -2547,7 +2547,7 @@ u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
119070 3F3F3F3F3F3F3F3F3F3F ??????????
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB ﹫?????﹫﹫?﹫
119070 3F3F3F3F3F3F3F3F3F3F ??????????
-1114111
+1114111 3F3F3F3F ????
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4;
SHOW CREATE TABLE t2;
Table Create Table
@@ -2559,7 +2559,7 @@ SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
42856 EA9DA8
65131 EFB9AB
-1114111
+1114111 3F3F3F3F
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
SHOW CREATE TABLE t2;
Table Create Table
@@ -2571,7 +2571,7 @@ SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
42856 EA9DA8
65131 EFB9AB
-1114111
+1114111 3F3F3F3F
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3;
SHOW CREATE TABLE t1;
Table Create Table
@@ -2592,7 +2592,7 @@ u_decimal hex(utf8mb4_encoding)
119070 3F3F3F3F3F3F3F3F3F3F
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
119070 3F3F3F3F3F3F3F3F3F3F
-1114111
+1114111 3F3F3F3F
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb4;
SHOW CREATE TABLE t1;
Table Create Table
@@ -2613,7 +2613,7 @@ u_decimal hex(utf8mb4_encoding)
119070 3F3F3F3F3F3F3F3F3F3F
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
119070 3F3F3F3F3F3F3F3F3F3F
-1114111
+1114111 3F3F3F3F
ALTER TABLE t2 MODIFY utf8mb3_encoding VARCHAR(10) CHARACTER SET utf8mb4;
SHOW CREATE TABLE t2;
Table Create Table
@@ -2625,7 +2625,7 @@ SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
42856 EA9DA8
65131 EFB9AB
-1114111
+1114111 3F3F3F3F
DROP TABLE IF EXISTS t3;
CREATE TABLE t3 (
u_decimal int NOT NULL,
@@ -2667,7 +2667,7 @@ Table Create Table
t3 CREATE TEMPORARY TABLE `t3` (
`utf8mb4` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
`utf8mb3` varchar(10) CHARACTER SET utf8 NOT NULL,
- `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TEMPORARY TABLE t3;
SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
@@ -2872,7 +2872,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -2892,7 +2892,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3116,7 +3116,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''
+ `a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3136,7 +3136,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
SHOW CREATE TABLE t2;
@@ -3379,6 +3379,48 @@ F09F988E78
78F09F988E78
DROP TABLE t1;
#
+# MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion
+#
+#
+# This test sets session character set to 3-byte utf8,
+# but then sends a 4-byte sequence (which is wrong for 3-byte utf8).
+# It should be replaced to four question marks: '????' in both columns
+# (i.e. four unknown bytes are replaced to four question marks),
+# then the rest of the string should be stored, so we get 'a ???? b'.
+#
+SET NAMES utf8;
+CREATE TABLE t1 (
+a VARCHAR(32) CHARACTER SET utf8mb4,
+b VARCHAR(32) CHARACTER SET utf8
+);
+INSERT INTO t1 SELECT 'a 😠b', 'a 😠b';
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81 b' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81 b' for column 'b' at row 1
+SELECT * FROM t1;
+a b
+a ???? b a ???? b
+DROP TABLE t1;
+#
+# This test sets session character set to 4-byte utf8,
+# then normally sends a 4-byte sequence.
+# It should be stored AS IS into the utf8mb4 column (a),
+# and should be replaced to a single question mark in the utf8 column (b)
+# (i.e. one character that cannot be converted is replaced to one question mark).
+#
+SET NAMES utf8mb4;
+CREATE TABLE t1 (
+a VARCHAR(32) CHARACTER SET utf8mb4,
+b VARCHAR(32) CHARACTER SET utf8
+);
+INSERT INTO t1 SELECT 'a 😠b', 'a 😠b';
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81 b' for column 'b' at row 1
+SELECT * FROM t1;
+a b
+a 😠b a ? b
+DROP TABLE t1;
+#
# MDEV-8949: COLUMN_CREATE unicode name breakage
#
SET NAMES utf8mb4;
@@ -3404,7 +3446,32 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET NAMES default;
+#
# End of 10.0 tests
#
-# End of tests
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database
+#
+SET NAMES utf8mb4;
+SELECT * FROM `testðŸ˜ðŸ˜test`;
+ERROR HY000: Invalid utf8mb4 character string: 'test\xF0\x9F\x98\x81\xF0\x9F\x98\x81test'
+#
+# MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+#
+SET NAMES utf8mb4;
+CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8mb4
+RETURN CONCAT('😎','x😎','😎y','x😎y');
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1';
+ROUTINE_DEFINITION
+RETURN CONCAT('?','x?','?y','x?y')
+SELECT body_utf8 FROM mysql.proc WHERE name='f1';
+body_utf8
+RETURN CONCAT('?','x?','?y','x?y')
+DROP FUNCTION f1;
+#
+# End of 10.1 tests
#
diff --git a/mysql-test/r/ctype_utf8mb4_heap.result b/mysql-test/r/ctype_utf8mb4_heap.result
index 3f543ce73e1..46b0cc3789f 100644
--- a/mysql-test/r/ctype_utf8mb4_heap.result
+++ b/mysql-test/r/ctype_utf8mb4_heap.result
@@ -225,7 +225,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 varchar(10) character set utf8mb4) engine heap;
insert into t1 values (0x41FF);
@@ -233,7 +233,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8mb4 ENGINE heap;
INSERT INTO t1 VALUES ( 'test' );
@@ -840,8 +840,8 @@ create table t2 engine heap select concat(a,_utf8mb4'') as a, concat(b,_utf8mb4'
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL,
+ `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1
drop table t2;
drop table t1;
@@ -1065,8 +1065,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -1776,9 +1776,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
select char(0xff,0x8f using utf8mb4);
char(0xff,0x8f using utf8mb4)
@@ -1802,9 +1802,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-NULL
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
hex(convert(char(2557 using latin1) using utf8mb4))
09C3BD
@@ -1971,9 +1971,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-NULL
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -1990,9 +1990,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -2157,7 +2157,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xF0\x8F\x80\x80' for column 'utf8mb4' at row 1
select hex(utf8mb4) from t1;
hex(utf8mb4)
-
+3F
F0908080
F0BFBFBF
delete from t1;
@@ -2177,7 +2177,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xF4\x90\x80\x80' for column 'utf8mb4' at row 1
select hex(utf8mb4) from t1;
hex(utf8mb4)
-
+3F
F4808080
F48F8080
drop table t1;
@@ -2274,7 +2274,7 @@ Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBD' for column 'utf8mb3_enco
UPDATE t2 SET utf8mb3_encoding= _utf8mb4 x'ea9da8' where u_decimal= 42856;
SELECT HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8')) FROM t1;
HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8'))
-EA9DA8
+3F3F3F3FEA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
F09D8480EA9DA8
F09D849EEA9DA8
@@ -2288,40 +2288,40 @@ F3A087AFEA9DA8
F48FBFBFEA9DA8
SELECT HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding)) FROM t1,t2;
HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding))
-
-EA9DA8
-EFB9AB
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB
+3F3F3F3F3F3F3F3F
+3F3F3F3FEA9DA8
+3F3F3F3FEFB9AB
+EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB3F3F3F3F
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEFB9AB
-F09D8480
+F09D84803F3F3F3F
F09D8480EA9DA8
F09D8480EFB9AB
-F09D849E
+F09D849E3F3F3F3F
F09D849EEA9DA8
F09D849EEFB9AB
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
-F09D859E
+F09D859E3F3F3F3F
F09D859EEA9DA8
F09D859EEFB9AB
-F09D878F
+F09D878F3F3F3F3F
F09D878FEA9DA8
F09D878FEFB9AB
-F09D9C9F
+F09D9C9F3F3F3F3F
F09D9C9FEA9DA8
F09D9C9FEFB9AB
-F09D9E9F
+F09D9E9F3F3F3F3F
F09D9E9FEA9DA8
F09D9E9FEFB9AB
-F3A087AF
+F3A087AF3F3F3F3F
F3A087AFEA9DA8
F3A087AFEFB9AB
-F48FBFBF
+F48FBFBF3F3F3F3F
F48FBFBFEA9DA8
F48FBFBFEFB9AB
SELECT count(*) FROM t1, t2
@@ -2337,8 +2337,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding),utf8mb4_encoding FROM t1;
u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
-1114111
1114111 3F ?
+1114111 3F3F3F3F ????
119040 3F ?
119070 3F ?
119070 3F3F3F3F3F3F3F3F3F3F ??????????
@@ -2358,7 +2358,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
@@ -2370,7 +2370,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3;
@@ -2382,8 +2382,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
u_decimal hex(utf8mb4_encoding)
-1114111
1114111 3F
+1114111 3F3F3F3F
119040 3F
119070 3F
119070 3F3F3F3F3F3F3F3F3F3F
@@ -2403,8 +2403,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
u_decimal hex(utf8mb4_encoding)
-1114111
1114111 3F
+1114111 3F3F3F3F
119040 3F
119070 3F
119070 3F3F3F3F3F3F3F3F3F3F
@@ -2424,7 +2424,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
DROP TABLE IF EXISTS t3;
@@ -2468,7 +2468,7 @@ Table Create Table
t3 CREATE TEMPORARY TABLE `t3` (
`utf8mb4` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
`utf8mb3` varchar(10) CHARACTER SET utf8 NOT NULL,
- `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1
DROP TEMPORARY TABLE t3;
SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
@@ -2495,5 +2495,66 @@ DROP TABLE t1;
# End of 5.5 tests
#
#
-# End of tests
+# ctype_utf8mb4.inc: Start of 10.1 tests
+#
+#
+# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (0x61);
+INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF);
+INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF);
+INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+id HEX(a)
+1 61
+2 C280
+3 DFBF
+4 E0A080
+6 F0908080
+7 F48FBFBF
+5 EFBFBF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+5 EFBFBF
+7 F48FBFBF
+6 F0908080
+4 E0A080
+3 DFBF
+2 C280
+1 61
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+6
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+id HEX(a)
+1 61
+2 C280
+3 DFBF
+4 E0A080
+5 EFBFBF
+6 F0908080
+7 F48FBFBF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+7 F48FBFBF
+6 F0908080
+5 EFBFBF
+4 E0A080
+3 DFBF
+2 C280
+1 61
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+7
+DROP TABLE t1;
+#
+# ctype_utf8mb4.inc: End of 10.1 tests
+#
+#
+# End of ctype_utf8mb4.inc
#
diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-test/r/ctype_utf8mb4_innodb.result
index cc0ded6728d..cfd9bf969ad 100644
--- a/mysql-test/r/ctype_utf8mb4_innodb.result
+++ b/mysql-test/r/ctype_utf8mb4_innodb.result
@@ -225,7 +225,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 varchar(10) character set utf8mb4) engine InnoDB;
insert into t1 values (0x41FF);
@@ -233,7 +233,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 text character set utf8mb4) engine InnoDB;
insert into t1 values (0x41FF);
@@ -241,7 +241,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (a text character set utf8mb4, primary key(a(371))) engine InnoDB;
ERROR 42000: Specified key was too long; max key length is 767 bytes
@@ -901,8 +901,8 @@ create table t2 engine InnoDB select concat(a,_utf8mb4'') as a, concat(b,_utf8mb
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL,
+ `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
drop table t1;
@@ -1126,8 +1126,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -1904,9 +1904,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
select char(0xff,0x8f using utf8mb4);
char(0xff,0x8f using utf8mb4)
@@ -1930,9 +1930,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-NULL
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
hex(convert(char(2557 using latin1) using utf8mb4))
09C3BD
@@ -2099,9 +2099,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-NULL
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -2118,9 +2118,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -2285,7 +2285,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xF0\x8F\x80\x80' for column 'utf8mb4' at row 1
select hex(utf8mb4) from t1;
hex(utf8mb4)
-
+3F
F0908080
F0BFBFBF
delete from t1;
@@ -2305,7 +2305,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xF4\x90\x80\x80' for column 'utf8mb4' at row 1
select hex(utf8mb4) from t1;
hex(utf8mb4)
-
+3F
F4808080
F48F8080
drop table t1;
@@ -2421,7 +2421,7 @@ Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBD' for column 'utf8mb3_enco
UPDATE t2 SET utf8mb3_encoding= _utf8mb4 x'ea9da8' where u_decimal= 42856;
SELECT HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8')) FROM t1;
HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8'))
-EA9DA8
+3F3F3F3FEA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
F09D8480EA9DA8
F09D849EEA9DA8
@@ -2435,40 +2435,40 @@ F3A087AFEA9DA8
F48FBFBFEA9DA8
SELECT HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding)) FROM t1,t2;
HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding))
-
-EA9DA8
-EFB9AB
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB
+3F3F3F3F3F3F3F3F
+3F3F3F3FEA9DA8
+3F3F3F3FEFB9AB
+EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB3F3F3F3F
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEFB9AB
-F09D8480
+F09D84803F3F3F3F
F09D8480EA9DA8
F09D8480EFB9AB
-F09D849E
+F09D849E3F3F3F3F
F09D849EEA9DA8
F09D849EEFB9AB
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
-F09D859E
+F09D859E3F3F3F3F
F09D859EEA9DA8
F09D859EEFB9AB
-F09D878F
+F09D878F3F3F3F3F
F09D878FEA9DA8
F09D878FEFB9AB
-F09D9C9F
+F09D9C9F3F3F3F3F
F09D9C9FEA9DA8
F09D9C9FEFB9AB
-F09D9E9F
+F09D9E9F3F3F3F3F
F09D9E9FEA9DA8
F09D9E9FEFB9AB
-F3A087AF
+F3A087AF3F3F3F3F
F3A087AFEA9DA8
F3A087AFEFB9AB
-F48FBFBF
+F48FBFBF3F3F3F3F
F48FBFBFEA9DA8
F48FBFBFEFB9AB
SELECT count(*) FROM t1, t2
@@ -2484,8 +2484,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding),utf8mb4_encoding FROM t1;
u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
-1114111
1114111 3F ?
+1114111 3F3F3F3F ????
119040 3F ?
119070 3F ?
119070 3F3F3F3F3F3F3F3F3F3F ??????????
@@ -2505,7 +2505,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
@@ -2517,7 +2517,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3;
@@ -2529,8 +2529,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
u_decimal hex(utf8mb4_encoding)
-1114111
1114111 3F
+1114111 3F3F3F3F
119040 3F
119070 3F
119070 3F3F3F3F3F3F3F3F3F3F
@@ -2550,8 +2550,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
u_decimal hex(utf8mb4_encoding)
-1114111
1114111 3F
+1114111 3F3F3F3F
119040 3F
119070 3F
119070 3F3F3F3F3F3F3F3F3F3F
@@ -2571,7 +2571,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
DROP TABLE IF EXISTS t3;
@@ -2615,7 +2615,7 @@ Table Create Table
t3 CREATE TEMPORARY TABLE `t3` (
`utf8mb4` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
`utf8mb3` varchar(10) CHARACTER SET utf8 NOT NULL,
- `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TEMPORARY TABLE t3;
SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
@@ -2642,5 +2642,66 @@ DROP TABLE t1;
# End of 5.5 tests
#
#
-# End of tests
+# ctype_utf8mb4.inc: Start of 10.1 tests
+#
+#
+# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (0x61);
+INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF);
+INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF);
+INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+id HEX(a)
+1 61
+2 C280
+3 DFBF
+4 E0A080
+6 F0908080
+7 F48FBFBF
+5 EFBFBF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+5 EFBFBF
+7 F48FBFBF
+6 F0908080
+4 E0A080
+3 DFBF
+2 C280
+1 61
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+6
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+id HEX(a)
+1 61
+2 C280
+3 DFBF
+4 E0A080
+5 EFBFBF
+6 F0908080
+7 F48FBFBF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+7 F48FBFBF
+6 F0908080
+5 EFBFBF
+4 E0A080
+3 DFBF
+2 C280
+1 61
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+7
+DROP TABLE t1;
+#
+# ctype_utf8mb4.inc: End of 10.1 tests
+#
+#
+# End of ctype_utf8mb4.inc
#
diff --git a/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-test/r/ctype_utf8mb4_myisam.result
index 03e32836cb5..53ae410046f 100644
--- a/mysql-test/r/ctype_utf8mb4_myisam.result
+++ b/mysql-test/r/ctype_utf8mb4_myisam.result
@@ -225,7 +225,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 varchar(10) character set utf8mb4) engine MyISAM;
insert into t1 values (0x41FF);
@@ -233,7 +233,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (s1 text character set utf8mb4) engine MyISAM;
insert into t1 values (0x41FF);
@@ -241,7 +241,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
-41
+413F
drop table t1;
create table t1 (a text character set utf8mb4, primary key(a(371))) engine MyISAM;
ERROR 42000: Specified key was too long; max key length is 1000 bytes
@@ -901,8 +901,8 @@ create table t2 engine MyISAM select concat(a,_utf8mb4'') as a, concat(b,_utf8mb
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL,
+ `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
drop table t1;
@@ -1126,8 +1126,8 @@ CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` int(1) NOT NULL DEFAULT '0'
+ `a` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
+ `b` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
@@ -1904,9 +1904,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
select char(0xff,0x8f using utf8mb4);
char(0xff,0x8f using utf8mb4)
@@ -1930,9 +1930,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
-NULL
+??
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
+Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
hex(convert(char(2557 using latin1) using utf8mb4))
09C3BD
@@ -2099,9 +2099,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-NULL
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -2118,9 +2118,9 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
-
+3F
Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
+Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
ERROR HY000: Invalid utf8mb4 character string: 'FF'
select hex(_utf8mb4 X'616263FF');
@@ -2285,7 +2285,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xF0\x8F\x80\x80' for column 'utf8mb4' at row 1
select hex(utf8mb4) from t1;
hex(utf8mb4)
-
+3F
F0908080
F0BFBFBF
delete from t1;
@@ -2305,7 +2305,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xF4\x90\x80\x80' for column 'utf8mb4' at row 1
select hex(utf8mb4) from t1;
hex(utf8mb4)
-
+3F
F4808080
F48F8080
drop table t1;
@@ -2421,7 +2421,7 @@ Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBD' for column 'utf8mb3_enco
UPDATE t2 SET utf8mb3_encoding= _utf8mb4 x'ea9da8' where u_decimal= 42856;
SELECT HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8')) FROM t1;
HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8'))
-EA9DA8
+3F3F3F3FEA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
F09D8480EA9DA8
F09D849EEA9DA8
@@ -2435,40 +2435,40 @@ F3A087AFEA9DA8
F48FBFBFEA9DA8
SELECT HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding)) FROM t1,t2;
HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding))
-
-EA9DA8
-EFB9AB
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB
+3F3F3F3F3F3F3F3F
+3F3F3F3FEA9DA8
+3F3F3F3FEFB9AB
+EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB3F3F3F3F
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEFB9AB
-F09D8480
+F09D84803F3F3F3F
F09D8480EA9DA8
F09D8480EFB9AB
-F09D849E
+F09D849E3F3F3F3F
F09D849EEA9DA8
F09D849EEFB9AB
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
+F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D84803F3F3F3F
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
-F09D859E
+F09D859E3F3F3F3F
F09D859EEA9DA8
F09D859EEFB9AB
-F09D878F
+F09D878F3F3F3F3F
F09D878FEA9DA8
F09D878FEFB9AB
-F09D9C9F
+F09D9C9F3F3F3F3F
F09D9C9FEA9DA8
F09D9C9FEFB9AB
-F09D9E9F
+F09D9E9F3F3F3F3F
F09D9E9FEA9DA8
F09D9E9FEFB9AB
-F3A087AF
+F3A087AF3F3F3F3F
F3A087AFEA9DA8
F3A087AFEFB9AB
-F48FBFBF
+F48FBFBF3F3F3F3F
F48FBFBFEA9DA8
F48FBFBFEFB9AB
SELECT count(*) FROM t1, t2
@@ -2484,8 +2484,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding),utf8mb4_encoding FROM t1;
u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
-1114111
1114111 3F ?
+1114111 3F3F3F3F ????
119040 3F ?
119070 3F ?
119070 3F3F3F3F3F3F3F3F3F3F ??????????
@@ -2505,7 +2505,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
@@ -2517,7 +2517,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3;
@@ -2529,8 +2529,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
u_decimal hex(utf8mb4_encoding)
-1114111
1114111 3F
+1114111 3F3F3F3F
119040 3F
119070 3F
119070 3F3F3F3F3F3F3F3F3F3F
@@ -2550,8 +2550,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
u_decimal hex(utf8mb4_encoding)
-1114111
1114111 3F
+1114111 3F3F3F3F
119040 3F
119070 3F
119070 3F3F3F3F3F3F3F3F3F3F
@@ -2571,7 +2571,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
u_decimal hex(utf8mb3_encoding)
-1114111
+1114111 3F3F3F3F
42856 EA9DA8
65131 EFB9AB
DROP TABLE IF EXISTS t3;
@@ -2615,7 +2615,7 @@ Table Create Table
t3 CREATE TEMPORARY TABLE `t3` (
`utf8mb4` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
`utf8mb3` varchar(10) CHARACTER SET utf8 NOT NULL,
- `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
+ `concat(utf8mb4,utf8mb3)` varchar(20) CHARACTER SET utf8mb4 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TEMPORARY TABLE t3;
SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
@@ -2642,5 +2642,66 @@ DROP TABLE t1;
# End of 5.5 tests
#
#
-# End of tests
+# ctype_utf8mb4.inc: Start of 10.1 tests
+#
+#
+# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (0x61);
+INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF);
+INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF);
+INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+id HEX(a)
+1 61
+2 C280
+3 DFBF
+4 E0A080
+6 F0908080
+7 F48FBFBF
+5 EFBFBF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+5 EFBFBF
+7 F48FBFBF
+6 F0908080
+4 E0A080
+3 DFBF
+2 C280
+1 61
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+6
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+id HEX(a)
+1 61
+2 C280
+3 DFBF
+4 E0A080
+5 EFBFBF
+6 F0908080
+7 F48FBFBF
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+id HEX(a)
+7 F48FBFBF
+6 F0908080
+5 EFBFBF
+4 E0A080
+3 DFBF
+2 C280
+1 61
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+7
+DROP TABLE t1;
+#
+# ctype_utf8mb4.inc: End of 10.1 tests
+#
+#
+# End of ctype_utf8mb4.inc
#
diff --git a/mysql-test/r/ctype_utf8mb4_uca.result b/mysql-test/r/ctype_utf8mb4_uca.result
index ef18272ca24..4792d746709 100644
--- a/mysql-test/r/ctype_utf8mb4_uca.result
+++ b/mysql-test/r/ctype_utf8mb4_uca.result
@@ -2752,7 +2752,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_myanmar_ci NOT NULL DEFAULT '',
+ `s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_myanmar_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (s1) VALUES
@@ -5315,3 +5315,703 @@ DROP TABLE t1;
#
# End of MariaDB-10.0 tests
#
+#
+# Start of 10.1 tests
+#
+SET NAMES utf8;
+SET collation_connection=utf8mb4_thai_520_w2;
+#
+# Start of ctype_uca_w2.inc
+#
+SELECT @@collation_connection;
+@@collation_connection
+utf8mb4_thai_520_w2
+SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE @@collation_connection;
+ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME
+610 4 utf8mb4_thai_520_w2 utf8mb4
+#
+# Testing strnxfrm
+#
+CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8)))
+ 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+20 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+2020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4)))
+ 020A020A020A020A0020002000200020
+20 020A020A020A020A0020002000200020
+2020 020A020A020A020A0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1))
+ 020A020A020A020A
+20 020A020A020A020A
+2020 020A020A020A020A
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2))
+ 0020002000200020
+20 0020002000200020
+2020 0020002000200020
+SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
+HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3))
+ 0020002000200020
+20 0020002000200020
+2020 0020002000200020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (_ucs2 0x3400);
+INSERT INTO t1 VALUES (_ucs2 0xF001);
+SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1;
+ucs2 HEX(a) HEX(WEIGHT_STRING(a))
+3400 E39080 FB80B4000020
+F001 EF8081 FBC1F0010020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+A 0020
+Ã 00200032
+À 00200035
+Â 0020003C
+Ã… 00200043
+Ä 00200047
+Ã 0020004E
+SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
+a HEX(WEIGHT_STRING(a LEVEL 2))
+Ã 0020004E
+Ä 00200047
+Ã… 00200043
+Â 0020003C
+À 00200035
+Ã 00200032
+A 0020
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
+INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
+SELECT * FROM t1 ORDER BY a;
+a
+cota
+cote
+coté
+cotë
+côte
+côté
+côtë
+cotz
+SELECT * FROM t1 ORDER BY a DESC;
+a
+cotz
+côtë
+côté
+côte
+cotë
+coté
+cote
+cota
+DROP TABLE t1;
+#
+# End of ctype_uca_w2.inc
+#
+#
+# Start of ctype_thai.inc
+#
+CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
+INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡');
+INSERT INTO t1 VALUES ('à¸à¸');
+INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š');
+INSERT INTO t1 VALUES ('ข่าง');
+INSERT INTO t1 VALUES ('ข้าง');
+INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน');
+INSERT INTO t1 VALUES ('ข้างขึ้น');
+INSERT INTO t1 VALUES ('ข้างควาย');
+INSERT INTO t1 VALUES ('ข้างเงิน');
+INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡');
+INSERT INTO t1 VALUES ('ข้างออà¸');
+INSERT INTO t1 VALUES ('ข้างๆ');
+INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
+INSERT INTO t1 VALUES ('ขาง');
+INSERT INTO t1 VALUES ('à¹à¸‚็ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่ง');
+INSERT INTO t1 VALUES ('à¹à¸‚่งขัน');
+INSERT INTO t1 VALUES ('à¹à¸‚้ง');
+INSERT INTO t1 VALUES ('à¹à¸‚้งขวา');
+INSERT INTO t1 VALUES ('à¹à¸‚็งขัน');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡');
+INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯');
+INSERT INTO t1 VALUES ('บุà¸à¸à¸²');
+INSERT INTO t1 VALUES ('บุà¸-หลง');
+INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡');
+INSERT INTO t1 VALUES ('ป่า');
+INSERT INTO t1 VALUES ('ป่าน');
+INSERT INTO t1 VALUES ('ป้า');
+INSERT INTO t1 VALUES ('ป้าน');
+INSERT INTO t1 VALUES ('ป๊า');
+INSERT INTO t1 VALUES ('ป๊าน');
+INSERT INTO t1 VALUES ('ป๋า');
+INSERT INTO t1 VALUES ('ป๋าน');
+INSERT INTO t1 VALUES ('ปา');
+INSERT INTO t1 VALUES ('ปาน');
+INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡');
+INSERT INTO t1 VALUES ('พณิชย์');
+INSERT INTO t1 VALUES ('ม้า');
+INSERT INTO t1 VALUES ('ฯพณฯ');
+INSERT INTO t1 VALUES ('A');
+INSERT INTO t1 VALUES ('a');
+INSERT INTO t1 VALUES ('a\'');
+INSERT INTO t1 VALUES ('A-');
+INSERT INTO t1 VALUES ('a-');
+INSERT INTO t1 VALUES ('-a');
+INSERT INTO t1 VALUES ('A.');
+INSERT INTO t1 VALUES ('a.');
+INSERT INTO t1 VALUES ('A-1');
+INSERT INTO t1 VALUES ('aa');
+INSERT INTO t1 VALUES ('AA');
+INSERT INTO t1 VALUES ('A.A.');
+INSERT INTO t1 VALUES ('a.a.');
+INSERT INTO t1 VALUES ('AAA');
+INSERT INTO t1 VALUES ('A.A.A.');
+INSERT INTO t1 VALUES ('AAAA');
+INSERT INTO t1 VALUES ('A.A.A.L.');
+INSERT INTO t1 VALUES ('A.A.A.S.');
+INSERT INTO t1 VALUES ('Aachen');
+INSERT INTO t1 VALUES ('A.A.E.');
+INSERT INTO t1 VALUES ('A.Ae.E.');
+INSERT INTO t1 VALUES ('A.A.E.E.');
+INSERT INTO t1 VALUES ('AAES');
+INSERT INTO t1 VALUES ('AAF');
+INSERT INTO t1 VALUES ('A.Agr');
+INSERT INTO t1 VALUES ('aah');
+INSERT INTO t1 VALUES ('@@@@@');
+INSERT INTO t1 VALUES ('0000');
+INSERT INTO t1 VALUES ('9999');
+INSERT INTO t1 VALUES ('Aalborg');
+INSERT INTO t1 VALUES ('aide');
+INSERT INTO t1 VALUES ('air');
+INSERT INTO t1 VALUES ('@@@air');
+INSERT INTO t1 VALUES ('air@@@');
+INSERT INTO t1 VALUES ('C.A.F');
+INSERT INTO t1 VALUES ('Canon');
+INSERT INTO t1 VALUES ('coop');
+INSERT INTO t1 VALUES ('co-op');
+INSERT INTO t1 VALUES ('COOP');
+INSERT INTO t1 VALUES ('CO-OP');
+INSERT INTO t1 VALUES ('Copenhegen');
+INSERT INTO t1 VALUES ('McArthur');
+INSERT INTO t1 VALUES ('Mc Arthur');
+INSERT INTO t1 VALUES ('Mc Mahon');
+INSERT INTO t1 VALUES ('vice-president');
+INSERT INTO t1 VALUES ('vice versa');
+INSERT INTO t1 VALUES ('vice-versa');
+INSERT INTO t1 VALUES ('10 ลิตร');
+INSERT INTO t1 VALUES ('๑๠ลิตร');
+INSERT INTO t1 VALUES ('10 litre');
+INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
+INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)');
+INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)');
+INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]');
+INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}');
+ALTER TABLE t1 ORDER BY a;
+SET @backup_character_set_connection=@@character_set_connection;
+SET @backup_collation_connection=@@collation_connection;
+SET NAMES utf8;
+SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
+' CHARACTER SET ', @backup_character_set_connection,
+' COLLATE ', @backup_collation_connection,
+' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
+ ' , ADD KEY a_id (a, id)');
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET collation_connection=@backup_collation_connection;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`),
+ KEY `a_id` (`a`,`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1
+#
+# Ascending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a, BINARY a;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using filesort
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort
+SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+#
+# Ascending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a, id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a, id;
+a
+-a
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+@@@@@
+@@@air
+0000
+10 litre
+10 litre (10 ลิตร)
+10 litre (๑๠ลิตร)
+10 ลิตร
+๑๠ลิตร
+10 ลิตร (10 litre)
+๑๠ลิตร (10 litre)
+๑๠ลิตร [10 litre]
+๑๠ลิตร {10 litre}
+9999
+A
+a
+A-
+a-
+A-1
+A.
+a.
+A.A.
+a.a.
+A.A.A.
+A.A.A.L.
+A.A.A.S.
+A.A.E.
+A.A.E.E.
+A.Ae.E.
+A.Agr
+a'
+AA
+aa
+AAA
+AAAA
+Aachen
+AAES
+AAF
+aah
+Aalborg
+aide
+air
+air@@@
+C.A.F
+Canon
+CO-OP
+co-op
+COOP
+coop
+Copenhegen
+Mc Arthur
+Mc Mahon
+McArthur
+vice versa
+vice-president
+vice-versa
+à¸à¸
+à¸à¸£à¸²à¸š
+ขาง
+ข่าง
+ข้าง
+ข้างๆ
+ข้างๆ คูๆ
+ข้างà¸à¸£à¸°à¸”าน
+ข้างขึ้น
+ข้างควาย
+ข้างเงิน
+ข้างà¹à¸£à¸¡
+ข้างออà¸
+à¹à¸‚็ง
+à¹à¸‚่ง
+à¹à¸‚้ง
+à¹à¸‚้งขวา
+à¹à¸‚็งขัน
+à¹à¸‚่งขัน
+ทูลเà¸à¸¥à¹‰à¸²
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+บุà¸-หลง
+บุà¸à¸à¸²
+บุà¸à¸«à¸¥à¸‡
+ปา
+ป่า
+ป้า
+ป๊า
+ป๋า
+ปาน
+ป่าน
+ป้าน
+ป๊าน
+ป๋าน
+à¹à¸›à¹‰à¸‡
+พณิชย์
+ม้า
+ฯพณฯ
+#
+# Descending sort, using index
+#
+EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index
+SELECT a FROM t1 ORDER BY a DESC, id DESC;
+a
+ฯพณฯ
+ม้า
+พณิชย์
+à¹à¸›à¹‰à¸‡
+ป๋าน
+ป๊าน
+ป้าน
+ป่าน
+ปาน
+ป๋า
+ป๊า
+ป้า
+ป่า
+ปา
+บุà¸à¸«à¸¥à¸‡
+บุà¸à¸à¸²
+บุà¸-หลง
+ทูลเà¸à¸¥à¹‰à¸²à¸¯
+ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡
+ทูลเà¸à¸¥à¹‰à¸²
+à¹à¸‚่งขัน
+à¹à¸‚็งขัน
+à¹à¸‚้งขวา
+à¹à¸‚้ง
+à¹à¸‚่ง
+à¹à¸‚็ง
+ข้างออà¸
+ข้างà¹à¸£à¸¡
+ข้างเงิน
+ข้างควาย
+ข้างขึ้น
+ข้างà¸à¸£à¸°à¸”าน
+ข้างๆ คูๆ
+ข้างๆ
+ข้าง
+ข่าง
+ขาง
+à¸à¸£à¸²à¸š
+à¸à¸
+vice-versa
+vice-president
+vice versa
+McArthur
+Mc Mahon
+Mc Arthur
+Copenhegen
+coop
+COOP
+co-op
+CO-OP
+Canon
+C.A.F
+air@@@
+air
+aide
+Aalborg
+aah
+AAF
+AAES
+Aachen
+AAAA
+AAA
+aa
+AA
+a'
+A.Agr
+A.Ae.E.
+A.A.E.E.
+A.A.E.
+A.A.A.S.
+A.A.A.L.
+A.A.A.
+a.a.
+A.A.
+a.
+A.
+A-1
+a-
+A-
+a
+A
+9999
+๑๠ลิตร {10 litre}
+๑๠ลิตร [10 litre]
+๑๠ลิตร (10 litre)
+10 ลิตร (10 litre)
+๑๠ลิตร
+10 ลิตร
+10 litre (๑๠ลิตร)
+10 litre (10 ลิตร)
+10 litre
+0000
+@@@air
+@@@@@
+-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡
+-a
+DROP TABLE t1;
+#
+# End of ctype_thai.inc
+#
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result
index fbed2ac1565..d81b6af0aeb 100644
--- a/mysql-test/r/ddl_i18n_koi8r.result
+++ b/mysql-test/r/ddl_i18n_koi8r.result
@@ -1,3 +1,4 @@
+set sql_mode="";
set names koi8r;
-------------------------------------------------------------------
@@ -34,16 +35,16 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -86,16 +87,16 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -143,16 +144,16 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci UNDEFINED
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result
index 98da459dafc..5921a7f538d 100644
--- a/mysql-test/r/ddl_i18n_utf8.result
+++ b/mysql-test/r/ddl_i18n_utf8.result
@@ -1,3 +1,4 @@
+set sql_mode="";
set names utf8;
-------------------------------------------------------------------
@@ -34,16 +35,16 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -86,16 +87,16 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -143,16 +144,16 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci UNDEFINED
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result
index ad3569e7b3d..4057c18226e 100644
--- a/mysql-test/r/default.result
+++ b/mysql-test/r/default.result
@@ -1,5 +1,6 @@
drop table if exists t1,t2,t3,t4,t5,t6;
drop database if exists mysqltest;
+set sql_mode="";
CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ',
b varchar(1) binary NOT NULL DEFAULT ' ',
c varchar(4) binary NOT NULL DEFAULT '0000',
@@ -29,6 +30,7 @@ z varchar(20) binary NOT NULL DEFAULT ' ',
a1 varchar(30) binary NOT NULL DEFAULT ' ',
b1 tinyblob NULL)
ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin;
+set sql_mode=default;
INSERT into t1 (b) values ('1');
SHOW WARNINGS;
Level Code Message
@@ -261,3 +263,17 @@ DROP TABLE t1;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+CREATE TABLE t1 (a INT DEFAULT 100, b INT DEFAULT NULL);
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1 WHERE DEFAULT(a);
+a b
+100 NULL
+SELECT * FROM t1 WHERE DEFAULT(b);
+a b
+DROP TABLE IF EXISTS t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index 98c8b599e88..8cc5645eeda 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -466,3 +466,37 @@ commit;
# Reaping ALTER TABLE:
# Connection 'default'.
drop tables tm, t1, t2;
+#
+# MDEV-9621 INSERT DELAYED fails on insert for tables with many columns
+#
+CREATE TABLE t1 (
+a int,b int,c int,d int,e int,f int,g int,h int,i int,j int,k int,l int,m int,n int,o int,p int,q int,r int,s int,t int,u int,v int,x int,y int,z int
+) ENGINE=MyISAM;
+INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z)
+values (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);
+INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z)
+values (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);
+drop table t1;
+#
+# INSERT DELAYED hangs if table was crashed
+#
+create table t1 (a int, b int) engine=myisam;
+insert into t1 values (1,1);
+SET debug_dbug="d,crash_shutdown";
+shutdown;
+ERROR HY000: Lost connection to MySQL server during query
+call mtr.add_suppression(" marked as crashed and should be repaired");
+call mtr.add_suppression("Checking table");
+insert delayed into t1 values (2,2);
+Warnings:
+Error 145 Table './test/t1' is marked as crashed and should be repaired
+Error 1194 Table 't1' is marked as crashed and should be repaired
+Error 1034 1 client is using or hasn't closed the table properly
+insert delayed into t1 values (3,3);
+flush tables t1;
+select * from t1;
+a b
+1 1
+2 2
+3 3
+drop table t1;
diff --git a/mysql-test/r/delete_returning_grant.result b/mysql-test/r/delete_returning_grant.result
index c15d3627a39..bdd171940ba 100644
--- a/mysql-test/r/delete_returning_grant.result
+++ b/mysql-test/r/delete_returning_grant.result
@@ -1,3 +1,5 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
CREATE TABLE t1 (a int(11), b varchar(32));
INSERT INTO t1 VALUES (7,'ggggggg'),(1,'a'),(3,'ccc'),(4,'dddd'),(1,'A'),
(2,'BB'),(4,'DDDD'),(5,'EEEEE'),(7,'GGGGGGG'),(2,'bb');
@@ -67,3 +69,4 @@ DROP DATABASE mysqltest;
DROP USER mysqltest_1@localhost;
DROP VIEW v1;
DROP TABLE t1;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/have_mutex_deadlock_detector.require b/mysql-test/r/delimiter_command_case_sensitivity.result
index 6ed281c757a..6ed281c757a 100644
--- a/mysql-test/r/have_mutex_deadlock_detector.require
+++ b/mysql-test/r/delimiter_command_case_sensitivity.result
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 88ec6e4c881..687497ceb7e 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -102,7 +102,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 8
2 DERIVED t1 ALL NULL NULL NULL NULL 4
3 UNION t1 ALL NULL NULL NULL NULL 4
-NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
CREATE TABLE t2 (a int not null);
insert into t2 values(1);
select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a;
@@ -622,13 +621,13 @@ SELECT f3 FROM t2 HAVING f3 >= 8
);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
-1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 sq.f2 1 100.00
+1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 const 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(<subquery4>); Using join buffer (flat, BNL join)
4 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1276 Field or reference 'sq.f2' of SELECT #3 was resolved in SELECT #1
-Note 1003 select 6 AS `f1` from <materialize> (select `test`.`t2`.`f3` from `test`.`t2` having (`test`.`t2`.`f3` >= 8)) semi join (`test`.`t2`) where ((`test`.`t2`.`f3` = 6) and (9 = `<subquery4>`.`f3`))
+Note 1003 select 6 AS `f1` from <materialize> (select `test`.`t2`.`f3` from `test`.`t2` having (`test`.`t2`.`f3` >= 8)) semi join (`test`.`t2`) where ((`test`.`t2`.`f3` = 6) and (`<subquery4>`.`f3` = 9))
DROP TABLE t2,t1;
#
# MDEV-9462: Out of memory using explain on 2 empty tables
@@ -1079,3 +1078,48 @@ drop procedure pr;
drop view v1;
drop table t1;
# end of 5.5
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8747 Wrong result for SELECT..WHERE derived_table_column='a' AND derived_table_column<>_latin1'A' COLLATE latin1_bin
+#
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a' AND a <> _latin1'A' COLLATE latin1_bin;
+a
+a
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='a' AND a <> _latin1'A' COLLATE latin1_bin;
+a
+a
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5';
+a
+5
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a=1;
+a
+5
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5' AND a=1;
+a
+5
+DROP TABLE t1;
+#
+# MDEV-8749 Wrong result for SELECT..WHERE derived_table_enum_column='number' AND derived_table_enum_column OP number2
+#
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5';
+a
+5
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a=1;
+a
+5
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5' AND a=1;
+a
+5
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result
index 8346f7afb40..416d4e3aeb9 100644
--- a/mysql-test/r/derived_view.result
+++ b/mysql-test/r/derived_view.result
@@ -1111,7 +1111,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(7))) and trigcond(((<cache>(5) = 5) or isnull(5))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
+Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where 1
SELECT t.a,t.b FROM t3 RIGHT JOIN ((SELECT * FROM t1) AS t, t2) ON t2.b != 0
WHERE (t.a,t.b) NOT IN (SELECT 7, 5);
a b
@@ -1125,7 +1125,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(7))) and trigcond(((<cache>(5) = 5) or isnull(5))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
+Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where 1
SELECT t.a,t.b FROM t3 RIGHT JOIN (v1 AS t, t2) ON t2.b != 0
WHERE (t.a,t.b) NOT IN (SELECT 7, 5);
a b
@@ -1139,7 +1139,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(7))) and trigcond(((<cache>(5) = 5) or isnull(5))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
+Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where 1
DROP VIEW v1;
DROP TABLE t1,t2,t3;
#
@@ -1979,6 +1979,11 @@ GROUP BY TABLE_SCHEMA) AS UNIQUES
ON ( COLUMNS.TABLE_SCHEMA = UNIQUES.TABLE_SCHEMA);
COUNT(*) > 0
1
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
DROP TABLE t1;
SET SESSION optimizer_switch= @save_optimizer_switch;
#
@@ -2272,10 +2277,7 @@ CREATE TABLE IF NOT EXISTS `galleries` (
`year` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 'galleries'
+) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `pictures` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
@@ -2288,10 +2290,7 @@ CREATE TABLE IF NOT EXISTS `pictures` (
`type` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `gallery_id` (`gallery_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 'pictures'
+) DEFAULT CHARSET=utf8 ;
ALTER TABLE `pictures`
ADD CONSTRAINT `pictures_ibfk_1` FOREIGN KEY (`gallery_id`) REFERENCES `galleries` (`id`);
INSERT INTO `galleries` (`id`, `name`, `year`) VALUES
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index bd7deee43e9..b5e8cefca69 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -212,7 +212,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 1 Using index
explain SELECT distinct a from t3 order by a desc limit 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index NULL a 5 NULL 40 Using index
+1 SIMPLE t3 index NULL a 5 NULL 2 Using index
explain SELECT distinct a,b from t3 order by a+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
@@ -744,7 +744,7 @@ a a b
1 1 3
DROP TABLE t1;
End of 5.0 tests
-CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT,
+CREATE TABLE t1(a INT, b INT, c INT, d INT default 0, e INT default 0,
PRIMARY KEY(a,b,c,d,e),
KEY(a,b,d,c)
);
@@ -925,9 +925,6 @@ set join_buffer_size=1024;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id
-7
-8
-9
18
20
24
@@ -937,34 +934,37 @@ id
51
61
64
+7
71
74
77
78
+8
+9
93
94
set join_buffer_size=1024*16;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id
-7
-9
18
20
24
-8
+43
+45
50
51
61
-43
-45
-71
64
+7
+71
74
77
78
-94
+8
+9
93
+94
set join_buffer_size=default;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
diff --git a/mysql-test/r/drop_bad_db_type.result b/mysql-test/r/drop_bad_db_type.result
index 6a125cdccf5..de22373e0fd 100644
--- a/mysql-test/r/drop_bad_db_type.result
+++ b/mysql-test/r/drop_bad_db_type.result
@@ -4,6 +4,27 @@ create table t1 (a int) engine=archive;
insert t1 values (1),(2),(3);
flush tables;
uninstall soname 'ha_archive';
+select table_schema, table_name from information_schema.tables where table_name like 't1';
+table_schema test
+table_name t1
+select table_schema, table_name, engine, version from information_schema.tables where table_name like 't1';
+table_schema test
+table_name t1
+engine ARCHIVE
+version NULL
+Warnings:
+Level Warning
+Code 1286
+Message Unknown storage engine 'ARCHIVE'
+select table_schema, table_name, engine, row_format from information_schema.tables where table_name like 't1';
+table_schema test
+table_name t1
+engine ARCHIVE
+row_format NULL
+Warnings:
+Level Warning
+Code 1286
+Message Unknown storage engine 'ARCHIVE'
install soname 'ha_archive';
t1.ARZ
t1.frm
diff --git a/mysql-test/r/enforce_storage_engine.result b/mysql-test/r/enforce_storage_engine.result
new file mode 100644
index 00000000000..6b5e1f6958b
--- /dev/null
+++ b/mysql-test/r/enforce_storage_engine.result
@@ -0,0 +1,154 @@
+set local sql_mode="";
+set global sql_mode="";
+drop table if exists t1;
+SET SESSION enforce_storage_engine=MyISAM;
+select @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MyISAM
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+Warnings:
+Note 1266 Using storage engine MyISAM for table 't1'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 values (1,'abba');
+CREATE TABLE t2 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+ERROR 42000: Unknown storage engine 'MEMORY'
+SET SESSION sql_mode='';
+SET SESSION enforce_storage_engine=MyISAM;
+select @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MyISAM
+select * from t1;
+c1 c2
+1 abba
+drop table t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SET SESSION enforce_storage_engine=FooBar;
+ERROR 42000: Unknown storage engine 'FooBar'
+select @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MyISAM
+SET SESSION enforce_storage_engine=MyISAM;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SET SESSION enforce_storage_engine=NULL;
+SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SET GLOBAL enforce_storage_engine=Memory;
+SET SESSION sql_mode='';
+select @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MEMORY
+select @@global.enforce_storage_engine;
+@@global.enforce_storage_engine
+MEMORY
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+Warnings:
+Note 1266 Using storage engine MEMORY for table 't1'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+DROP TABLE t1;
+set global sql_mode=default;
+SET SESSION enforce_storage_engine=NULL;
+SET GLOBAL enforce_storage_engine=NULL;
+CREATE TABLE t3 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t3 values (NULL, 'test');
+SET SESSION enforce_storage_engine=Memory;
+ALTER TABLE t3 ENGINE=MyISAM;
+Warnings:
+Note 1266 Using storage engine MEMORY for table 't3'
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+DROP TABLE t3;
+SET SESSION enforce_storage_engine=NULL;
+CREATE TABLE t3 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t3 values (NULL, 'test');
+SET SESSION enforce_storage_engine=Memory;
+ALTER TABLE t3 ADD COLUMN c3 INT;
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+DROP TABLE t3;
+SET SESSION enforce_storage_engine=NULL;
+SET GLOBAL enforce_storage_engine=NULL;
diff --git a/mysql-test/r/enforce_storage_engine_opt.result b/mysql-test/r/enforce_storage_engine_opt.result
new file mode 100644
index 00000000000..1b03aa281d9
--- /dev/null
+++ b/mysql-test/r/enforce_storage_engine_opt.result
@@ -0,0 +1,15 @@
+SET SQL_MODE="";
+create table t1 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory;
+Warnings:
+Note 1266 Using storage engine MyISAM for table 't1'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set session sql_mode='no_engine_substitution';
+create table t2 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory;
+ERROR 42000: Unknown storage engine 'MEMORY'
+drop table t1;
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index d71759cb128..e1d494d3324 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -168,3 +168,7 @@ UPDATE t1 SET a = 'new'
WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL;
ERROR 22007: Illegal value used as argument of dynamic column function
drop table t1;
+set max_session_mem_used = 50000;
+select * from seq_1_to_1000;
+set max_session_mem_used = 8192;
+select * from seq_1_to_1000;
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index 4e7ff526eca..a105dcd2125 100644
--- a/mysql-test/r/events_1.result
+++ b/mysql-test/r/events_1.result
@@ -1,3 +1,4 @@
+set sql_mode="";
call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
drop database if exists events_test;
drop database if exists db_x;
diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result
index 65a2de3bae5..1589fbddf0c 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -1,3 +1,4 @@
+set sql_mode="";
drop database if exists events_test;
create database events_test;
use events_test;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 3e12b43e72c..bde4f1c785b 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -1,3 +1,4 @@
+SET SQL_MODE="";
drop database if exists events_test;
drop database if exists mysqltest_db1;
drop database if exists mysqltest_db2;
@@ -218,13 +219,13 @@ drop event events_test.mysqltest_user1;
drop user mysqltest_user1@localhost;
drop database mysqltest_db1;
create event e_53 on schedule at (select s1 from ttx) do drop table t;
-ERROR 42000: This version of MariaDB doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
+ERROR 42000: CREATE/ALTER EVENT does not support subqueries or stored functions.
create event e_53 on schedule every (select s1 from ttx) second do drop table t;
-ERROR 42000: This version of MariaDB doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
+ERROR 42000: CREATE/ALTER EVENT does not support subqueries or stored functions.
create event e_53 on schedule every 5 second starts (select s1 from ttx) do drop table t;
-ERROR 42000: This version of MariaDB doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
+ERROR 42000: CREATE/ALTER EVENT does not support subqueries or stored functions.
create event e_53 on schedule every 5 second ends (select s1 from ttx) do drop table t;
-ERROR 42000: This version of MariaDB doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
+ERROR 42000: CREATE/ALTER EVENT does not support subqueries or stored functions.
drop event if exists e_16;
drop procedure if exists p_16;
create event e_16 on schedule every 1 second do set @a=5;
@@ -265,7 +266,7 @@ begin
call p22830_wait();
select 123;
end|
-ERROR 42000: This version of MariaDB doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
+ERROR 42000: CREATE/ALTER EVENT does not support subqueries or stored functions.
create event e22830_1 on schedule every 1 hour do
begin
call p22830_wait();
diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result
index 084587079ba..873f0441089 100644
--- a/mysql-test/r/events_trans.result
+++ b/mysql-test/r/events_trans.result
@@ -1,3 +1,4 @@
+set sql_mode="";
drop database if exists events_test;
drop database if exists mysqltest_no_such_database;
create database events_test;
diff --git a/mysql-test/r/events_trans_notembedded.result b/mysql-test/r/events_trans_notembedded.result
index 1e3dfffe232..fb68bc9ceab 100644
--- a/mysql-test/r/events_trans_notembedded.result
+++ b/mysql-test/r/events_trans_notembedded.result
@@ -2,6 +2,7 @@ drop database if exists events_test;
drop database if exists mysqltest_db2;
create database events_test;
use events_test;
+create user mysqltest_user1@localhost;
grant create, insert, select, delete on mysqltest_db2.*
to mysqltest_user1@localhost;
create database mysqltest_db2;
diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result
new file mode 100644
index 00000000000..9e5515f3cfa
--- /dev/null
+++ b/mysql-test/r/explain_json.result
@@ -0,0 +1,1545 @@
+drop table if exists t0,t1,t2;
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+explain format=json select * from t0;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+}
+explain format=json select * from t0 where 1>2;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "Impossible WHERE"
+ }
+ }
+}
+explain format=json select * from t0 where a<3;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t0.a < 3)"
+ }
+ }
+}
+# Try a basic join
+create table t1 (a int, b int, filler char(32), key(a));
+insert into t1
+select
+a.a + b.a* 10 + c.a * 100,
+a.a + b.a* 10 + c.a * 100,
+'filler'
+from t0 a, t0 b, t0 c;
+explain format=json select * from t0,t1 where t1.a=t0.a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t0.a is not null)"
+ },
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+}
+# Try range and index_merge
+create table t2 (a1 int, a2 int, b1 int, b2 int, key(a1,a2), key(b1,b2));
+insert into t2 select a,a,a,a from t1;
+explain format=json select * from t2 where a1<5;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a1"],
+ "key": "a1",
+ "key_length": "5",
+ "used_key_parts": ["a1"],
+ "rows": 5,
+ "filtered": 100,
+ "index_condition": "(t2.a1 < 5)"
+ }
+ }
+}
+explain format=json select * from t2 where a1=1 or b1=2;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "index_merge",
+ "possible_keys": ["a1", "b1"],
+ "key_length": "5,5",
+ "index_merge": {
+ "sort_union": {
+ "range": {
+ "key": "a1",
+ "used_key_parts": ["a1"]
+ },
+ "range": {
+ "key": "b1",
+ "used_key_parts": ["b1"]
+ }
+ }
+ },
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "((t2.a1 = 1) or (t2.b1 = 2))"
+ }
+ }
+}
+explain format=json select * from t2 where a1=1 or (b1=2 and b2=3);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "index_merge",
+ "possible_keys": ["a1", "b1"],
+ "key_length": "5,10",
+ "index_merge": {
+ "sort_union": {
+ "range": {
+ "key": "a1",
+ "used_key_parts": ["a1"]
+ },
+ "range": {
+ "key": "b1",
+ "used_key_parts": ["b1", "b2"]
+ }
+ }
+ },
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "((t2.a1 = 1) or ((t2.b1 = 2) and (t2.b2 = 3)))"
+ }
+ }
+}
+explain format=json select * from t2 where (a1=1 and a2=1) or
+(b1=2 and b2=1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "index_merge",
+ "possible_keys": ["a1", "b1"],
+ "key_length": "10,10",
+ "index_merge": {
+ "union": {
+ "range": {
+ "key": "a1",
+ "used_key_parts": ["a1", "a2"]
+ },
+ "range": {
+ "key": "b1",
+ "used_key_parts": ["b1", "b2"]
+ }
+ }
+ },
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(((t2.a1 = 1) and (t2.a2 = 1)) or ((t2.b1 = 2) and (t2.b2 = 1)))"
+ }
+ }
+}
+# Try ref access on two key components
+explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t0.a is not null)"
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["b1"],
+ "key": "b1",
+ "key_length": "10",
+ "used_key_parts": ["b1", "b2"],
+ "ref": ["test.t0.a", "const"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+}
+drop table t1,t2;
+#
+# Try a UNION
+#
+explain format=json select * from t0 A union select * from t0 B;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "A",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "B",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+explain format=json select * from t0 A union all select * from t0 B;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "A",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "B",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+#
+# Subqueries
+#
+create table t1 (a int, b int);
+insert into t1 select a,a from t0;
+explain format=json select a, a > (select max(b) from t1 where t1.b=t0.a) from t0;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "subqueries": [
+ {
+ "expression_cache": {
+ "state": "uninitialized",
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t1.b = t0.a)"
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+explain format=json
+select * from t0 where
+a > (select max(b) from t1 where t1.b=t0.a) or a < 3 ;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "((t0.a > (subquery#2)) or (t0.a < 3))"
+ },
+ "subqueries": [
+ {
+ "expression_cache": {
+ "state": "uninitialized",
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t1.b = t0.a)"
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+drop table t1;
+#
+# Join buffering
+#
+create table t1 (a int, b int);
+insert into t1 select tbl1.a+10*tbl2.a, tbl1.a+10*tbl2.a from t0 tbl1, t0 tbl2;
+explain format=json
+select * from t1 tbl1, t1 tbl2 where tbl1.a=tbl2.a and tbl1.b < 3 and tbl2.b < 5;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "tbl1",
+ "access_type": "ALL",
+ "rows": 100,
+ "filtered": 100,
+ "attached_condition": "(tbl1.b < 3)"
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "tbl2",
+ "access_type": "ALL",
+ "rows": 100,
+ "filtered": 100,
+ "attached_condition": "(tbl2.b < 5)"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(tbl2.a = tbl1.a)"
+ }
+ }
+}
+drop table t1;
+#
+# Single-table UPDATE/DELETE, INSERT
+#
+explain format=json delete from t0;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "Deleting all rows"
+ }
+ }
+}
+explain format=json delete from t0 where 1 > 2;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "Impossible WHERE"
+ }
+ }
+}
+explain format=json delete from t0 where a < 3;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "delete": 1,
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "attached_condition": "(t0.a < 3)"
+ }
+ }
+}
+explain format=json update t0 set a=3 where a in (2,3,4);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "update": 1,
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "attached_condition": "(t0.a in (2,3,4))"
+ }
+ }
+}
+explain format=json insert into t0 values (1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t0"
+ }
+ }
+}
+create table t1 like t0;
+explain format=json insert into t1 values ((select max(a) from t0));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1"
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ ]
+ }
+}
+drop table t1;
+#
+# A derived table
+#
+create table t1 (a int, b int);
+insert into t1 select a,a from t0;
+explain format=json
+select * from (select a, count(*) as cnt from t1 group by a) as tbl
+where cnt>0;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(tbl.cnt > 0)",
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "filesort": {
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+explain format=json
+select * from (select a, count(*) as cnt from t1 group by a) as tbl1, t1 as
+tbl2 where cnt=tbl2.a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "tbl2",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(tbl2.a is not null)"
+ },
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ref",
+ "possible_keys": ["key0"],
+ "key": "key0",
+ "key_length": "8",
+ "used_key_parts": ["cnt"],
+ "ref": ["test.tbl2.a"],
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(tbl1.cnt = tbl2.a)",
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "filesort": {
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+#
+# Non-merged semi-join (aka JTBM)
+#
+explain format=json
+select * from t1 where a in (select max(a) from t1 group by b);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t1.a is not null)"
+ },
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["max(a)"],
+ "ref": ["test.t1.a"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ }
+ }
+ }
+}
+#
+# Semi-join Materialization
+#
+create table t2 like t1;
+insert into t2 select * from t1;
+explain format=json
+select * from t1,t2 where t1.a in ( select a from t0);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "const_condition": "1",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["a"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL"
+ }
+ }
+}
+#
+# First-Match
+#
+explain
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where; FirstMatch(t2); Using join buffer (flat, BNL join)
+explain format=json
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "first_match": "t2"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))"
+ }
+ }
+}
+#
+# Duplicate Weedout
+#
+set @tmp= @@optimizer_switch;
+set optimizer_switch='firstmatch=off';
+explain
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+explain format=json
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "duplicates_removal": {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))"
+ }
+ }
+ }
+}
+set optimizer_switch=@tmp;
+drop table t1,t2;
+#
+# MRR for range access (no BKA, just MRR)
+#
+create table t1 (a int, b int, key(a));
+insert into t1 select tbl1.a+10*tbl2.a, 12345 from t0 tbl1, t0 tbl2;
+set @tmp= @@optimizer_switch;
+set optimizer_switch='mrr=on,mrr_sort_keys=on';
+explain format=json select * from t1 where a < 3;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "rows": 1,
+ "filtered": 100,
+ "index_condition": "(t1.a < 3)",
+ "mrr_type": "Rowid-ordered scan"
+ }
+ }
+}
+# 'Range checked for each record'
+set optimizer_switch=@tmp;
+explain format=json
+select * from t1 tbl1, t1 tbl2 where tbl2.a < tbl1.b;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "tbl1",
+ "access_type": "ALL",
+ "rows": 100,
+ "filtered": 100
+ },
+ "range-checked-for-each-record": {
+ "keys": ["a"],
+ "table": {
+ "table_name": "tbl2",
+ "access_type": "ALL",
+ "possible_keys": ["a"],
+ "rows": 100,
+ "filtered": 100
+ }
+ }
+ }
+}
+drop table t1;
+drop table t0;
+#
+# MDEV-7265: "Full scan on NULL key", the join case
+#
+CREATE TABLE t1 (a INT, KEY(a));
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM t1, t2 WHERE b <> outer_t1.a );
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "outer_t1",
+ "access_type": "index",
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(not(<in_optimizer>(outer_t1.a,<exists>(subquery#2))))",
+ "using_index": true
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "having_condition": "trigcond(<is_not_null_test>(t1.a))",
+ "full-scan-on-null_key": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref_or_null",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["func"],
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "trigcond(((<cache>(outer_t1.a) = t1.a) or isnull(t1.a)))",
+ "using_index": true
+ }
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(t2.b <> outer_t1.a)"
+ }
+ }
+ }
+ ]
+ }
+}
+DROP TABLE t1,t2;
+#
+# Join's constant expression
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1(a int, b int);
+insert into t1 select tbl1.a+10*tbl2.a, 1234 from t0 tbl1, t0 tbl2;
+explain format=json
+select * from t0
+where
+20000 > all (select max(tbl1.a + tbl2.a)
+from t1 tbl1, t1 tbl2 where tbl1.b=tbl2.b);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "const_condition": "<not>(<in_optimizer>(20000,(<max>(subquery#2) >= 20000)))",
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "tbl1",
+ "access_type": "ALL",
+ "rows": 100,
+ "filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "tbl2",
+ "access_type": "ALL",
+ "rows": 100,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(tbl2.b = tbl1.b)"
+ }
+ }
+ }
+ ]
+ }
+}
+drop table t1;
+drop table t0;
+#
+# MDEV-7264: Assertion `0' failed in subselect_engine::get_identifier() on EXPLAIN JSON
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a <> ALL ( SELECT b FROM t2 );
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(not(<in_optimizer>(t1.a,t1.a in (subquery#2))))"
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ }
+ }
+ }
+ ]
+ }
+}
+DROP TABLE t1, t2;
+#
+# MDEV-7927: Server crashes in in Time_and_counter_tracker::incr_loops
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN SELECT * FROM t1 WHERE 3 IN ( SELECT 4 UNION SELECT 5 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+DROP TABLE t1;
+#
+# MDEV-7860: EXPLAIN FORMAT=JSON crashes for loose scan query
+#
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int, c int, d int, key(a,b,c));
+insert into t1 select A.a, B.a, C.a, D.a from t2 A, t2 B, t2 C, t2 D;
+explain select count(distinct b) from t1 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 101 Using index for group-by
+explain format=json select count(distinct b) from t1 group by a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "key": "a",
+ "key_length": "10",
+ "used_key_parts": ["a", "b"],
+ "rows": 101,
+ "filtered": 100,
+ "using_index_for_group_by": true
+ }
+ }
+}
+analyze format=json select count(distinct b) from t1 group by a;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "key": "a",
+ "key_length": "10",
+ "used_key_parts": ["a", "b"],
+ "r_loops": 1,
+ "rows": 101,
+ "r_rows": 100,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "using_index_for_group_by": true
+ }
+ }
+}
+drop table t1,t2;
+#
+# Try both variants of LooseScan (data/queries borrowed from group_min_max.test)
+#
+create table t1 (
+a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(248) default ' '
+);
+insert into t1 (a1, a2, b, c, d) values
+('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
+('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
+('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
+('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
+('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
+('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
+('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
+('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
+('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
+('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
+('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
+('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
+('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
+('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
+('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
+('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'),
+('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
+('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
+('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
+('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
+('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
+('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
+('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
+('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
+('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
+('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
+('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
+('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
+('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
+('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
+('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
+('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4');
+create index idx_t1_0 on t1 (a1);
+create index idx_t1_1 on t1 (a1,a2,b,c);
+create index idx_t1_2 on t1 (a1,a2,b);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Table is already up to date
+explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
+explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
+explain format=json select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "index",
+ "key": "idx_t1_2",
+ "key_length": "147",
+ "used_key_parts": ["a1", "a2", "b"],
+ "rows": 128,
+ "filtered": 100,
+ "attached_condition": "((t1.b = 'a') and (t1.a2 >= 'b'))",
+ "using_index": true
+ }
+ }
+}
+explain format=json select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "index",
+ "key": "idx_t1_1",
+ "key_length": "163",
+ "used_key_parts": ["a1", "a2", "b", "c"],
+ "rows": 128,
+ "filtered": 100,
+ "attached_condition": "((t1.b = 'a') and (t1.c = 'i121') and (t1.a2 >= 'b'))",
+ "using_index": true
+ }
+ }
+}
+drop table t1;
+#
+# MDEV-8786 Wrong result for SELECT FORMAT=JSON * FROM t1 WHERE a=_latin1 0xDF
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('b');
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a=_latin1 0xDF;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(t1.a = _latin1'\xDF')"
+ }
+ }
+}
+DROP TABLE t1;
+#
+# MDEV-8785 Wrong results for EXPLAIN EXTENDED...WHERE NULLIF(latin1_col, _utf8'a' COLLATE utf8_bin) IS NOT NULL
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('A');
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE NULLIF(a,_utf8'a' COLLATE utf8_bin);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(case when convert(t1.a using utf8) = <cache>((_utf8'a' collate utf8_bin)) then NULL else t1.a end)"
+ }
+ }
+}
+DROP TABLE t1;
+#
+# MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+create table t2 (
+a int,
+b int,
+key (a)
+);
+insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
+# normal HAVING
+explain format=json select a, max(b) as TOP from t2 group by a having TOP > a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "having_condition": "(TOP > t2.a)",
+ "filesort": {
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 256,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+# HAVING is always TRUE (not printed)
+explain format=json select a, max(b) as TOP from t2 group by a having 1<>2;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "filesort": {
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 256,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+# HAVING is always FALSE (intercepted by message)
+explain format=json select a, max(b) as TOP from t2 group by a having 1=2;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "Impossible HAVING"
+ }
+ }
+}
+# HAVING is absent
+explain format=json select a, max(b) as TOP from t2 group by a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "filesort": {
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 256,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+drop table t0, t1, t2;
+#
+# MDEV-8829: Assertion `0' failed in Explain_table_access::tag_to_json
+#
+# Check ET_CONST_ROW_NOT_FOUND
+create table t1 (i int) engine=myisam;
+explain
+select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+explain format=json
+select * from t1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "system",
+ "rows": 0,
+ "filtered": 0,
+ "const_row_not_found": true
+ }
+ }
+}
+analyze format=json
+select * from t1;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "no matching row in const table"
+ }
+ }
+}
+drop table t1;
+# Check ET_IMPOSSIBLE_ON_CONDITION
+create table t1 (a int);
+create table t2 (pk int primary key);
+insert into t1 values (1),(2);
+insert into t2 values (1),(2);
+explain
+select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const PRIMARY NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+explain format=json
+select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "const_condition": "1",
+ "table": {
+ "table_name": "t2",
+ "access_type": "const",
+ "possible_keys": ["PRIMARY"],
+ "rows": 1,
+ "filtered": 100,
+ "impossible_on_condition": true
+ },
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ }
+ }
+}
+analyze format=json
+select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "const_condition": "1",
+ "table": {
+ "table_name": "t2",
+ "access_type": "const",
+ "possible_keys": ["PRIMARY"],
+ "r_loops": 0,
+ "rows": 1,
+ "r_rows": null,
+ "filtered": 100,
+ "r_filtered": null,
+ "impossible_on_condition": true
+ },
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+}
+# Check ET_NOT_EXISTS:
+explain
+select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using index; Not exists
+explain format=json
+select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "rows": 1,
+ "filtered": 100,
+ "attached_condition": "(trigcond(isnull(t2.pk)) and trigcond(trigcond((t1.a is not null))))",
+ "using_index": true,
+ "not_exists": true
+ }
+ }
+}
+analyze format=json
+select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "r_loops": 2,
+ "rows": 1,
+ "r_rows": 1,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "(trigcond(isnull(t2.pk)) and trigcond(trigcond((t1.a is not null))))",
+ "using_index": true,
+ "not_exists": true
+ }
+ }
+}
+# Check ET_DISTINCT
+explain
+select distinct t1.a from t1 join t2 on t2.pk=t1.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where; Using temporary
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index; Distinct
+explain format=json
+select distinct t1.a from t1 join t2 on t2.pk=t1.a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "temporary_table": {
+ "function": "buffer",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(t1.a is not null)"
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "rows": 1,
+ "filtered": 100,
+ "using_index": true,
+ "distinct": true
+ }
+ }
+ }
+}
+analyze format=json
+select distinct t1.a from t1 join t2 on t2.pk=t1.a;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "(t1.a is not null)"
+ },
+ "table": {
+ "table_name": "t2",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "r_loops": 2,
+ "rows": 1,
+ "r_rows": 1,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "using_index": true,
+ "distinct": true
+ }
+ }
+ }
+}
+drop table t1,t2;
+# Check ET_USING_INDEX_CONDITION_BKA
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2(a int);
+insert into t2 select A.a + B.a* 10 + C.a * 100 from t1 A, t1 B, t1 C;
+create table t3(a int, b int);
+insert into t3 select a,a from t1;
+create table t4(a int, b int, c int, filler char(100), key (a,b));
+insert into t4 select a,a,a, 'filler-data' from t2;
+set @tmp_optimizer_switch=@@optimizer_switch;
+set @tmp_join_cache_level=@@join_cache_level;
+set optimizer_switch='mrr=on';
+set join_cache_level=6;
+explain
+select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ALL NULL NULL NULL NULL 10 Using where
+1 SIMPLE t4 ref a a 5 test.t3.a 1 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+explain format=json
+select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t3.a is not null)"
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t4",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t3.a"],
+ "rows": 1,
+ "filtered": 100,
+ "index_condition_bka": "((t4.b + 1) <= (t3.b + 1))"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BKA",
+ "mrr_type": "Rowid-ordered scan"
+ }
+ }
+}
+analyze format=json
+select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "(t3.a is not null)"
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t4",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t3.a"],
+ "r_loops": 1,
+ "rows": 1,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "index_condition_bka": "((t4.b + 1) <= (t3.b + 1))"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BKA",
+ "mrr_type": "Rowid-ordered scan",
+ "r_filtered": 100
+ }
+ }
+}
+set optimizer_switch=@tmp_optimizer_switch;
+set join_cache_level=@tmp_join_cache_level;
+drop table t1,t2,t3,t4;
diff --git a/mysql-test/r/explain_json_format_partitions.result b/mysql-test/r/explain_json_format_partitions.result
new file mode 100644
index 00000000000..fa2b5681120
--- /dev/null
+++ b/mysql-test/r/explain_json_format_partitions.result
@@ -0,0 +1,86 @@
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+a int not null
+) partition by key(a);
+insert into t1 select a from t2;
+explain partitions select * from t1 where a in (2,3,4);
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
+explain format=json select * from t1 where a in (2,3,4);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "partitions": ["p0"],
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "(t1.a in (2,3,4))"
+ }
+ }
+}
+analyze format=json select * from t1 where a in (2,3,4);
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "partitions": ["p0"],
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 30,
+ "attached_condition": "(t1.a in (2,3,4))"
+ }
+ }
+}
+analyze format=json update t1 set a=a+10 where a in (2,3,4);
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_total_time_ms": "REPLACED",
+ "buffer": {
+ "table": {
+ "update": 1,
+ "table_name": "t1",
+ "partitions": ["p0"],
+ "access_type": "ALL",
+ "rows": 10,
+ "r_rows": 10,
+ "r_filtered": 30,
+ "r_total_time_ms": "REPLACED",
+ "attached_condition": "(t1.a in (2,3,4))"
+ }
+ }
+ }
+}
+analyze format=json delete from t1 where a in (20,30,40);
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "delete": 1,
+ "table_name": "t1",
+ "partitions": ["p0"],
+ "access_type": "ALL",
+ "rows": 10,
+ "r_rows": 10,
+ "r_filtered": 0,
+ "r_total_time_ms": "REPLACED",
+ "attached_condition": "(t1.a in (20,30,40))"
+ }
+ }
+}
+drop table t1,t2;
diff --git a/mysql-test/r/explain_json_innodb.result b/mysql-test/r/explain_json_innodb.result
new file mode 100644
index 00000000000..cc389c63bda
--- /dev/null
+++ b/mysql-test/r/explain_json_innodb.result
@@ -0,0 +1,57 @@
+drop table if exists t0,t1,t2;
+#
+# MDEV-7266: Assertion `!element_started' failed in Json_writer& Json_writer::add_member
+#
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (column_name_1 INT, column_name_2 VARCHAR(52)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (3,'United States');
+CREATE TABLE t3 (b INT, c VARCHAR(3), PRIMARY KEY (c,b)) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (4,'USA'),(5,'CAN');
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE 0 < ALL (
+SELECT tbl_alias1.column_name_1 FROM t2 AS tbl_alias1, t3 AS tbl_alias2
+WHERE tbl_alias2.b = tbl_alias1.column_name_1 AND tbl_alias2.c = tbl_alias1.column_name_2
+);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "tbl_alias1",
+ "access_type": "ALL",
+ "rows": 1,
+ "filtered": 100,
+ "attached_condition": "((tbl_alias1.column_name_2 is not null) and (tbl_alias1.column_name_1 is not null))"
+ },
+ "table": {
+ "table_name": "tbl_alias2",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "9",
+ "used_key_parts": ["c", "b"],
+ "ref": [
+ "test.tbl_alias1.column_name_2",
+ "test.tbl_alias1.column_name_1"
+ ],
+ "rows": 1,
+ "filtered": 100,
+ "attached_condition": "(tbl_alias2.c = tbl_alias1.column_name_2)",
+ "using_index": true
+ }
+ }
+ }
+ ]
+ }
+}
+drop table t1,t2,t3;
diff --git a/mysql-test/r/fast_prefix_index_fetch_innodb.result b/mysql-test/r/fast_prefix_index_fetch_innodb.result
new file mode 100644
index 00000000000..92af85f7fdb
--- /dev/null
+++ b/mysql-test/r/fast_prefix_index_fetch_innodb.result
@@ -0,0 +1,102 @@
+drop table if exists prefixinno;
+set global innodb_prefix_index_cluster_optimization = ON;
+show variables like 'innodb_prefix_index_cluster_optimization';
+Variable_name Value
+innodb_prefix_index_cluster_optimization ON
+# Create a table with a large varchar field that we index the prefix
+# of and ensure we only trigger cluster lookups when we expect it.
+create table prefixinno (
+id int not null,
+fake_id int not null,
+bigfield varchar(4096),
+primary key(id),
+index bigfield_idx (bigfield(32)),
+index fake_id_bigfield_prefix (fake_id, bigfield(32))
+) engine=innodb;
+insert into prefixinno values (1, 1001, repeat('a', 1)),
+(8, 1008, repeat('b', 8)),
+(24, 1024, repeat('c', 24)),
+(31, 1031, repeat('d', 31)),
+(32, 1032, repeat('x', 32)),
+(33, 1033, repeat('y', 33)),
+(128, 1128, repeat('z', 128));
+select * from prefixinno;
+id fake_id bigfield
+1 1001 a
+8 1008 bbbbbbbb
+24 1024 cccccccccccccccccccccccc
+31 1031 ddddddddddddddddddddddddddddddd
+32 1032 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+33 1033 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
+128 1128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+# Baseline sanity check: 0, 0.
+no-op query
+no-op query
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Eligible for optimization.
+id bigfield
+31 ddddddddddddddddddddddddddddddd
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Eligible for optimization, access via fake_id only.
+id bigfield
+31 ddddddddddddddddddddddddddddddd
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Not eligible for optimization, access via fake_id of big row.
+id bigfield
+33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Not eligible for optimization.
+id bigfield
+32 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Not eligible for optimization.
+id bigfield
+33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Eligible, should not increment lookup counter.
+id bigfield
+8 bbbbbbbb
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Eligible, should not increment lookup counter.
+id bigfield
+24 cccccccccccccccccccccccc
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Should increment lookup counter.
+id bigfield
+128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# Disable optimization, confirm we still increment counter.
+id bigfield
+33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
+cluster_lookups_matched
+1
+cluster_lookups_avoided_matched
+1
+# make test suite happy by cleaning up our mess
diff --git a/mysql-test/r/features.result b/mysql-test/r/features.result
index 04e0df98ec7..52650d118b3 100644
--- a/mysql-test/r/features.result
+++ b/mysql-test/r/features.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+set sql_mode="";
flush status;
show status like "feature%";
Variable_name Value
diff --git a/mysql-test/r/file_contents.result b/mysql-test/r/file_contents.result
index 0b0d5d598d6..2b5e6e6229b 100644
--- a/mysql-test/r/file_contents.result
+++ b/mysql-test/r/file_contents.result
@@ -1,6 +1,6 @@
Checking 'INFO_SRC' and 'INFO_BIN'
-INFO_SRC: Found MySQL version number / Found GIT revision id
+INFO_SRC: Found MariaDB version number / Found GIT revision id
INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line
End of tests
diff --git a/mysql-test/r/fix_priv_tables.result b/mysql-test/r/fix_priv_tables.result
index e54330a5520..dea1ccdbd18 100644
--- a/mysql-test/r/fix_priv_tables.result
+++ b/mysql-test/r/fix_priv_tables.result
@@ -1,4 +1,5 @@
drop table if exists t1,t1aa,t2aa;
+set sql_mode="";
DROP DATABASE IF EXISTS testdb;
CREATE DATABASE testdb;
CREATE TABLE testdb.t1 (
diff --git a/mysql-test/r/flush-innodb-notembedded.result b/mysql-test/r/flush-innodb-notembedded.result
index 817d57d9d79..911abfe6daf 100644
--- a/mysql-test/r/flush-innodb-notembedded.result
+++ b/mysql-test/r/flush-innodb-notembedded.result
@@ -1,3 +1,4 @@
+set sql_mode="";
# Test 7: Check privileges required.
#
CREATE DATABASE db1;
diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result
index 13bcc371ef6..ff5d8755f01 100644
--- a/mysql-test/r/flush2.result
+++ b/mysql-test/r/flush2.result
@@ -3,10 +3,32 @@ set global expire_logs_days = 3;
show variables like 'log_bin%';
Variable_name Value
log_bin OFF
+log_bin_basename
+log_bin_index
log_bin_trust_function_creators ON
+show variables like 'relay_log%';
+Variable_name Value
+relay_log mysqld-relay-bin
+relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
+relay_log_info_file relay-log.info
+relay_log_purge ON
+relay_log_recovery OFF
+relay_log_space_limit 0
flush logs;
show variables like 'log_bin%';
Variable_name Value
log_bin OFF
+log_bin_basename
+log_bin_index
log_bin_trust_function_creators ON
+show variables like 'relay_log%';
+Variable_name Value
+relay_log mysqld-relay-bin
+relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
+relay_log_info_file relay-log.info
+relay_log_purge ON
+relay_log_recovery OFF
+relay_log_space_limit 0
set global expire_logs_days = 0;
diff --git a/mysql-test/r/flush_read_lock.result b/mysql-test/r/flush_read_lock.result
index c2e8531d01f..260edf8e51d 100644
--- a/mysql-test/r/flush_read_lock.result
+++ b/mysql-test/r/flush_read_lock.result
@@ -1,3 +1,5 @@
+set global sql_mode="";
+set local sql_mode="";
# FTWRL takes two global metadata locks -- a global shared
# metadata lock and the commit blocker lock.
# The first lock prevents DDL from taking place.
@@ -1667,3 +1669,4 @@ drop database `#mysql50#mysqltest-2`;
drop database mysqltest1;
drop temporary tables t1_temp, t2_temp;
drop tables t1_base, t2_base, t3_trans;
+set global sql_mode=default;
diff --git a/mysql-test/r/fulltext_order_by.result b/mysql-test/r/fulltext_order_by.result
index 419c1f53a2c..c2f57c6f9c2 100644
--- a/mysql-test/r/fulltext_order_by.result
+++ b/mysql-test/r/fulltext_order_by.result
@@ -126,7 +126,7 @@ group by
a.text, b.id, b.betreff
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+ERROR 42000: Table 'b' from one of the SELECTs cannot be used in field list
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -142,7 +142,7 @@ where
match(c.beitrag) against ('+abc' in boolean mode)
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+ERROR 42000: Table 'b' from one of the SELECTs cannot be used in field list
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -158,7 +158,7 @@ where
match(c.beitrag) against ('+abc' in boolean mode)
order by
match(betreff) against ('+abc' in boolean mode) desc;
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+text id betreff
(select b.id, b.betreff from t3 b) union
(select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc' in boolean mode) desc;
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index 9fde006b377..1f15c74ff0d 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -1,3 +1,4 @@
+set global max_allowed_packet=1048576;
select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ';
@test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -72,6 +73,9 @@ set @@global.max_allowed_packet=1048576*100;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: XXX
+Warning 1292 Truncated incorrect DOUBLE value: XXX
set @@global.max_allowed_packet=default;
create table t1(a blob);
insert into t1 values(NULL), (compress('a'));
@@ -152,6 +156,31 @@ UNCOMPRESS(CAST(0 AS BINARY(5)))
NULL
Warnings:
Warning 1259 ZLIB: Input data corrupted
+set global max_allowed_packet=default;
#
# End of 5.5 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',compress('test')), ('TEST', compress('TEST'));
+SELECT f1,HEX(f2) FROM t1 ignore index(k1) WHERE f1='test' AND (f2= compress("test") OR f2= compress("TEST"));
+f1 HEX(f2)
+test 04000000789C2B492D2E0100045D01C1
+TEST 04000000789C0B710D0E0100031D0141
+SELECT f1,HEX(f2) FROM t1 WHERE f1='test' AND (f2= compress("test") OR f2= compress("TEST"));
+f1 HEX(f2)
+TEST 04000000789C0B710D0E0100031D0141
+test 04000000789C2B492D2E0100045D01C1
+SELECT f1,HEX(f2) FROM t1 WHERE f1='test' AND (f2= compress("TEST") OR f2= compress("test"));
+f1 HEX(f2)
+TEST 04000000789C0B710D0E0100031D0141
+test 04000000789C2B492D2E0100045D01C1
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result
index 707e767ddf5..2be8ab6c5dd 100644
--- a/mysql-test/r/func_crypt.result
+++ b/mysql-test/r/func_crypt.result
@@ -124,3 +124,83 @@ SET optimizer_switch=@save_optimizer_switch;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+# Start of func_str_ascii_checksum.inc
+#
+# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',password('test')), ('TEST', password('TEST'));
+SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= password("test") OR f2= password("TEST"));
+f1 f2
+test *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+TEST *47A6B0EA08A36FAEBE4305B373FE37E3CF27C357
+SELECT * FROM t1 WHERE f1='test' AND (f2= password("test") OR f2= password("TEST"));
+f1 f2
+TEST *47A6B0EA08A36FAEBE4305B373FE37E3CF27C357
+test *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+SELECT * FROM t1 WHERE f1='test' AND (f2= password("TEST") OR f2= password("test"));
+f1 f2
+TEST *47A6B0EA08A36FAEBE4305B373FE37E3CF27C357
+test *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+DROP TABLE t1;
+#
+# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
+#
+PREPARE stmt FROM "SELECT password(CONVERT('foo' USING latin1))";
+EXECUTE stmt;
+password(CONVERT('foo' USING latin1))
+*F3A2A51A9B0F2BE2468926B4132313728C250DBF
+DEALLOCATE PREPARE stmt;
+# End of func_str_ascii_checksum.inc
+# Start of func_str_ascii_checksum.inc
+#
+# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',old_password('test')), ('TEST', old_password('TEST'));
+SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= old_password("test") OR f2= old_password("TEST"));
+f1 f2
+test 378b243e220ca493
+TEST 06df397e084be793
+SELECT * FROM t1 WHERE f1='test' AND (f2= old_password("test") OR f2= old_password("TEST"));
+f1 f2
+TEST 06df397e084be793
+test 378b243e220ca493
+SELECT * FROM t1 WHERE f1='test' AND (f2= old_password("TEST") OR f2= old_password("test"));
+f1 f2
+TEST 06df397e084be793
+test 378b243e220ca493
+DROP TABLE t1;
+#
+# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
+#
+PREPARE stmt FROM "SELECT old_password(CONVERT('foo' USING latin1))";
+EXECUTE stmt;
+old_password(CONVERT('foo' USING latin1))
+7c786c222596437b
+DEALLOCATE PREPARE stmt;
+# End of func_str_ascii_checksum.inc
+#
+# MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',encrypt('test','key')), ('TEST', encrypt('TEST','key'));
+SELECT f1 FROM t1 ignore index(k1) WHERE f1='test' AND (f2= encrypt('test','key') OR f2= encrypt('TEST','key'));
+f1
+test
+TEST
+SELECT f1 FROM t1 WHERE f1='test' AND (f2= encrypt('test','key') OR f2= encrypt('TEST','key'));
+f1
+TEST
+test
+SELECT f1 FROM t1 WHERE f1='test' AND (f2= encrypt('TEST','key') OR f2= encrypt('test','key'));
+f1
+TEST
+test
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_digest.result b/mysql-test/r/func_digest.result
index 095b69363ce..6821c84d8d8 100644
--- a/mysql-test/r/func_digest.result
+++ b/mysql-test/r/func_digest.result
@@ -1426,3 +1426,35 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def sha2('1',224) 253 56 56 Y 0 31 8
sha2('1',224)
e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BAS E64('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',SHA2('test',224)), ('TEST', SHA2('TEST',224));
+SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= SHA2("test",224) OR f2= SHA2("TEST",224));
+f1 f2
+test 90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809
+TEST 917ecca24f3e6ceaf52375d8083381f1f80a21e6e49fbadc40afeb8e
+SELECT * FROM t1 WHERE f1='test' AND (f2= SHA2("test",224) OR f2= SHA2("TEST",224));
+f1 f2
+test 90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809
+TEST 917ecca24f3e6ceaf52375d8083381f1f80a21e6e49fbadc40afeb8e
+SELECT * FROM t1 WHERE f1='test' AND (f2= SHA2("TEST",224) OR f2= SHA2("test",224));
+f1 f2
+test 90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809
+TEST 917ecca24f3e6ceaf52375d8083381f1f80a21e6e49fbadc40afeb8e
+DROP TABLE t1;
+#
+# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
+#
+PREPARE stmt FROM "SELECT SHA2(CONVERT('foo' USING latin1), 224)";
+EXECUTE stmt;
+SHA2(CONVERT('foo' USING latin1), 224)
+0808f64e60d58979fcb676c96ec938270dea42445aeefcd3a4e6f8db
+DEALLOCATE PREPARE stmt;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result
index 91ff4e218fb..f5e03a90327 100644
--- a/mysql-test/r/func_encrypt.result
+++ b/mysql-test/r/func_encrypt.result
@@ -190,3 +190,21 @@ insert into t1 values (null,'contraction\'s');
insert into t1 values (-15818,'requirement\'s');
select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
drop table t1;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+#
+CREATE TABLE t1 (a INT(6) ZEROFILL);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND DES_ENCRYPT('test',a)=_latin1 'abc' COLLATE latin1_bin;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and (des_encrypt('test',`test`.`t1`.`a`) = 'abc'))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 0bc31a5e85b..9014450bef3 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -1119,3 +1119,84 @@ GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0)
1,1
2,2
DROP TABLE t1;
+#
+# WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
+# Bug#13387020 GROUP_CONCAT WITH ORDER BY RESULTS ARE TRUNCATED.
+#
+SET group_concat_max_len= 9999999;
+CREATE TABLE t1 (f1 LONGTEXT , f2 INTEGER);
+INSERT INTO t1 VALUES (REPEAT('a', 500000), 0), (REPEAT('b', 500000), 1), (REPEAT('c', 500000), 2);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+1500002
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC))
+1500002
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5) FROM t1;
+SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5)
+ccccc
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT f1))
+1500002
+SELECT LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2))
+1500002
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1))
+1500002
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5) FROM t1;
+SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5)
+AAAAA
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1))) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1)))
+1500002
+CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `GROUP_CONCAT(f1 order by f2)` mediumtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `GROUP_CONCAT(UPPER(f1) ORDER BY f2)` mediumtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+SET group_concat_max_len= DEFAULT;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+1024
+Warnings:
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+SET group_concat_max_len= 499999;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 WHERE f2 = 0;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+499999
+499999
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+499999
+499999
+499999
+499999
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+Warning 1260 Row 5 was cut by GROUP_CONCAT()
+DROP TABLE t1;
+SET group_concat_max_len= DEFAULT;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 38fae2f0a4f..e0e870d1573 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -787,7 +787,7 @@ drop table t2;
create table t2 select f2 from (select now() f2 from t1) a;
show columns from t2;
Field Type Null Key Default Extra
-f2 datetime NO 0000-00-00 00:00:00
+f2 datetime NO NULL
drop table t2, t1;
CREATE TABLE t1(
id int PRIMARY KEY,
@@ -2107,6 +2107,9 @@ select avg(export_set( 3, 'y', sha(i))), group_concat(d) from t1 group by d orde
avg(export_set( 3, 'y', sha(i))) group_concat(d)
0 2008-10-02
0 2010-12-12
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'y,y,356a192b7913b04c54574d18c28d46e6395428ab,356a192b7913b04c54574d18c28d46e6395428ab,356a192b7913b04c54574d18c28d46e6395428ab,3'
+Warning 1292 Truncated incorrect DOUBLE value: 'y,y,da4b9237bacccdf19c0760cab7aec4a8359010b0,da4b9237bacccdf19c0760cab7aec4a8359010b0,da4b9237bacccdf19c0760cab7aec4a8359010b0,d'
drop table t1;
#
# MDEV-4290: crash in st_select_lex::mark_as_dependent
@@ -2309,3 +2312,134 @@ Warning 1292 Truncated incorrect DOUBLE value: '-1e+309'
SELECT STDDEV(f) FROM (SELECT 1.7976931348623157e+308 AS f UNION SELECT -1.7976931348623157e+308 AS f) tbl;
STDDEV(f)
1.7976931348623157e308
+#
+# MDEV-8852 Implicit or explicit CAST from MAX(string) to INT,DOUBLE,DECIMAL does not produce warnings
+#
+SELECT MAX('x') << 1, CAST(MAX('x') AS DOUBLE), CAST(MAX('x') AS DECIMAL);
+MAX('x') << 1 CAST(MAX('x') AS DOUBLE) CAST(MAX('x') AS DECIMAL)
+0 0 0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'x'
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DECIMAL value: 'x'
+#
+# MDEV-8918 Wrong result for CAST(AVG(a) AS SIGNED)
+#
+CREATE TABLE t1 (id INT, a BIGINT);
+INSERT INTO t1 VALUES (1,0x7FFFFFFFFFFFFFFF),(2,0x7FFFFFFFFFFFFFFF);
+SELECT id, AVG(a) AS avg, CAST(MIN(a) AS SIGNED) AS cast_min FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id;
+id avg cast_min
+1 9223372036854775807.0000 9223372036854775807
+2 9223372036854775807.0000 9223372036854775807
+SELECT id, AVG(a) AS avg, CAST(AVG(a) AS SIGNED) AS cast_avg FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id;
+id avg cast_avg
+1 9223372036854775807.0000 9223372036854775807
+2 9223372036854775807.0000 9223372036854775807
+DROP TABLE t1;
+#
+# MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field()
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT DISTINCT VAR_POP(1) FROM t1 GROUP BY @a := 's';
+VAR_POP(1)
+0.0000
+DROP TABLE t1;
+#
+# MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED)
+#
+CREATE TABLE t1 (id INT, a DOUBLE);
+INSERT INTO t1 VALUES (1,0x7FFFFFFFFFFFFFFF),(2,0x7FFFFFFFFFFFFFFF);
+SELECT id, AVG(a) AS avg, CAST(MIN(a) AS SIGNED) AS cast_min,CAST(AVG(a) AS SIGNED) AS cast_avg FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id;
+id avg cast_min cast_avg
+1 9.223372036854776e18 9223372036854775807 9223372036854775807
+2 9.223372036854776e18 9223372036854775807 9223372036854775807
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
+SELECT MIN(a), SUM(a), CAST(SUM(a) AS SIGNED), CAST(AVG(a) AS SIGNED) FROM t1;
+MIN(a) SUM(a) CAST(SUM(a) AS SIGNED) CAST(AVG(a) AS SIGNED)
+9.223372036854776e18 9.223372036854776e18 9223372036854775807 9223372036854775807
+DROP TABLE t1;
+#
+# MDEV-7195 AVG() loses precision in INT context
+#
+CREATE TABLE t1 (
+auto SERIAL,
+fld1 bigint unsigned NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+UNIQUE fld1 (fld1)
+);
+INSERT INTO t1 VALUES (1,0x7FFFFFFFFFFFFFFF,00);
+INSERT INTO t1 VALUES (2,0x7FFFFFFFFFFFFFFE,37);
+INSERT INTO t1 VALUES (3,0x7FFFFFFFFFFFFFFC,37);
+SELECT companynr, AVG(fld1), AVG(fld1)<<0 AS avg1, CAST(AVG(fld1) AS UNSIGNED)<<0 AS avg2 FROM t1 GROUP BY companynr;
+companynr AVG(fld1) avg1 avg2
+00 9223372036854775807.0000 9223372036854775807 9223372036854775807
+37 9223372036854775805.0000 9223372036854775805 9223372036854775805
+DROP TABLE t1;
+#
+# case where aggregate resolved in the local SELECT
+# but outer ones are checked
+#
+create table t10 (a int , b int, c int);
+insert into t10 values (0,0,0),(1,1,1);
+create table t11 as select * from t10;
+create table t12 as select * from t10;
+explain extended select a from t10 where c<3 or a in (select c from t12 union select max(t10.b) from t11 group by t11.c);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t10 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t12 ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DEPENDENT UNION t11 ALL NULL NULL NULL NULL 2 100.00 Using temporary
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1276 Field or reference 'test.t10.b' of SELECT #3 was resolved in SELECT #1
+Note 1003 select `test`.`t10`.`a` AS `a` from `test`.`t10` where ((`test`.`t10`.`c` < 3) or <expr_cache><`test`.`t10`.`a`,`test`.`t10`.`b`>(<in_optimizer>(`test`.`t10`.`a`,<exists>(select `test`.`t12`.`c` from `test`.`t12` where (<cache>(`test`.`t10`.`a`) = `test`.`t12`.`c`) union select max(`test`.`t10`.`b`) from `test`.`t11` group by `test`.`t11`.`c` having (<cache>(`test`.`t10`.`a`) = <ref_null_helper>(max(`test`.`t10`.`b`)))))))
+drop table t10,t11,t12;
+#
+# MDEV-10017: Get unexpected `Empty Set` for correlated subquery
+# with aggregate functions
+#
+create table t1(c1 int, c2 int, c3 int);
+insert into t1 values(1,1,1),(2,2,2),(3,3,3);
+select * from t1;
+c1 c2 c3
+1 1 1
+2 2 2
+3 3 3
+create table t2(c1 int, c2 int);
+insert into t2 values(2,2);
+select * from t2;
+c1 c2
+2 2
+explain extended
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+c) from t2 tt));
+ERROR HY000: Invalid use of group function
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+c) from t2 tt));
+ERROR HY000: Invalid use of group function
+explain extended
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+tt.c1) from t2 tt));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
+2 DEPENDENT SUBQUERY t system NULL NULL NULL NULL 1 100.00
+3 DEPENDENT SUBQUERY tt system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.c1' of SELECT #3 was resolved in SELECT #1
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` having (`test`.`t1`.`c1` >= <expr_cache><`test`.`t1`.`c1`>((select 2 AS `c` from dual order by (select min((`test`.`t1`.`c1` + 2)) from dual))))
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+tt.c1) from t2 tt));
+c1
+2
+3
+drop table t1,t2;
+#
+# MDEV-10556 Assertion `0' failed in virtual void Item_sum_field::set_result_field(Field*)
+#
+CREATE TABLE t1 (i INT, KEY(i)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (10),(20),(30);
+SELECT DISTINCT STDDEV(1) FROM t1 GROUP BY i ORDER BY BENCHMARK(0, BIT_XOR(i));
+STDDEV(1)
+0.0000
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_hybrid_type.result b/mysql-test/r/func_hybrid_type.result
new file mode 100644
index 00000000000..eeaa79e7dce
--- /dev/null
+++ b/mysql-test/r/func_hybrid_type.result
@@ -0,0 +1,3431 @@
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8865 Wrong field type or metadata for COALESCE(signed_int_column, unsigned_int_column)
+#
+#
+CREATE TABLE t1 (a INT, b INT UNSIGNED);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-1,1);
+INSERT INTO t1 VALUES (-2147483648,4294967295);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 3 11 11 Y 32768 0 63
+def case_______a 3 11 11 Y 32896 0 63
+def case_____a_a 3 11 11 Y 32896 0 63
+def coalesce___a 3 11 11 Y 32896 0 63
+def coalesce_a_a 3 11 11 Y 32896 0 63
+def if_______a_a 3 11 11 Y 32896 0 63
+def ifnull___a_a 3 11 11 Y 32896 0 63
+def least____a_a 3 11 11 Y 32896 0 63
+def greatest_a_a 3 11 11 Y 32896 0 63
+def test t1 t1 b ___________b 3 10 10 Y 32800 0 63
+def case_______b 3 10 10 Y 32928 0 63
+def case_____b_b 3 10 10 Y 32928 0 63
+def coalesce___b 3 10 10 Y 32928 0 63
+def coalesce_b_b 3 10 10 Y 32928 0 63
+def if_______b_b 3 10 10 Y 32928 0 63
+def ifnull___b_b 3 10 10 Y 32928 0 63
+def least____b_b 3 10 10 Y 32928 0 63
+def greatest_b_b 3 10 10 Y 32928 0 63
+___________a 1
+case_______a 1
+case_____a_a 1
+coalesce___a 1
+coalesce_a_a 1
+if_______a_a 1
+ifnull___a_a 1
+least____a_a 1
+greatest_a_a 1
+___________b 1
+case_______b 1
+case_____b_b 1
+coalesce___b 1
+coalesce_b_b 1
+if_______b_b 1
+ifnull___b_b 1
+least____b_b 1
+greatest_b_b 1
+___________a -1
+case_______a -1
+case_____a_a -1
+coalesce___a -1
+coalesce_a_a -1
+if_______a_a -1
+ifnull___a_a -1
+least____a_a -1
+greatest_a_a -1
+___________b 1
+case_______b 1
+case_____b_b 1
+coalesce___b 1
+coalesce_b_b 1
+if_______b_b 1
+ifnull___b_b 1
+least____b_b 1
+greatest_b_b 1
+___________a -2147483648
+case_______a -2147483648
+case_____a_a -2147483648
+coalesce___a -2147483648
+coalesce_a_a -2147483648
+if_______a_a -2147483648
+ifnull___a_a -2147483648
+least____a_a -2147483648
+greatest_a_a -2147483648
+___________b 4294967295
+case_______b 4294967295
+case_____b_b 4294967295
+coalesce___b 4294967295
+coalesce_b_b 4294967295
+if_______b_b 4294967295
+ifnull___b_b 4294967295
+least____b_b 4294967295
+greatest_b_b 4294967295
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 246 11 11 Y 32896 0 63
+def case_____b_a 246 11 10 Y 32896 0 63
+def coalesce_a_b 246 11 11 Y 32896 0 63
+def coalesce_b_a 246 11 10 Y 32896 0 63
+def if_______a_b 246 11 10 Y 32896 0 63
+def if_______b_a 246 11 11 Y 32896 0 63
+def ifnull___a_b 246 11 11 Y 32896 0 63
+def ifnull___b_a 246 11 10 Y 32896 0 63
+def least____a_b 246 11 11 Y 32896 0 63
+def least____b_a 246 11 11 Y 32896 0 63
+def greatest_a_b 246 11 10 Y 32896 0 63
+def greatest_b_a 246 11 10 Y 32896 0 63
+case_____a_b 1
+case_____b_a 1
+coalesce_a_b 1
+coalesce_b_a 1
+if_______a_b 1
+if_______b_a 1
+ifnull___a_b 1
+ifnull___b_a 1
+least____a_b 1
+least____b_a 1
+greatest_a_b 1
+greatest_b_a 1
+case_____a_b -1
+case_____b_a 1
+coalesce_a_b -1
+coalesce_b_a 1
+if_______a_b 1
+if_______b_a -1
+ifnull___a_b -1
+ifnull___b_a 1
+least____a_b -1
+least____b_a -1
+greatest_a_b 1
+greatest_b_a 1
+case_____a_b -2147483648
+case_____b_a 4294967295
+coalesce_a_b -2147483648
+coalesce_b_a 4294967295
+if_______a_b 4294967295
+if_______b_a -2147483648
+ifnull___a_b -2147483648
+ifnull___b_a 4294967295
+least____a_b -2147483648
+least____b_a -2147483648
+greatest_a_b 4294967295
+greatest_b_a 4294967295
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` int(11) DEFAULT NULL,
+ `case_______a` int(11) DEFAULT NULL,
+ `case_____a_a` int(11) DEFAULT NULL,
+ `coalesce___a` int(11) DEFAULT NULL,
+ `coalesce_a_a` int(11) DEFAULT NULL,
+ `if_______a_a` int(11) DEFAULT NULL,
+ `ifnull___a_a` int(11) DEFAULT NULL,
+ `least____a_a` int(11) DEFAULT NULL,
+ `greatest_a_a` int(11) DEFAULT NULL,
+ `___________b` int(10) unsigned DEFAULT NULL,
+ `case_______b` int(10) unsigned DEFAULT NULL,
+ `case_____b_b` int(10) unsigned DEFAULT NULL,
+ `coalesce___b` int(10) unsigned DEFAULT NULL,
+ `coalesce_b_b` int(10) unsigned DEFAULT NULL,
+ `if_______b_b` int(10) unsigned DEFAULT NULL,
+ `ifnull___b_b` int(10) unsigned DEFAULT NULL,
+ `least____b_b` int(10) unsigned DEFAULT NULL,
+ `greatest_b_b` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` decimal(10,0) DEFAULT NULL,
+ `case_____b_a` decimal(10,0) DEFAULT NULL,
+ `coalesce_a_b` decimal(10,0) DEFAULT NULL,
+ `coalesce_b_a` decimal(10,0) DEFAULT NULL,
+ `if_______a_b` decimal(10,0) DEFAULT NULL,
+ `if_______b_a` decimal(10,0) DEFAULT NULL,
+ `ifnull___a_b` decimal(10,0) DEFAULT NULL,
+ `ifnull___b_a` decimal(10,0) DEFAULT NULL,
+ `least____a_b` decimal(10,0) DEFAULT NULL,
+ `least____b_a` decimal(10,0) DEFAULT NULL,
+ `greatest_a_b` decimal(10,0) DEFAULT NULL,
+ `greatest_b_a` decimal(10,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-2147483648,2147483647);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 3 11 11 Y 32768 0 63
+def case_______a 3 11 11 Y 32896 0 63
+def case_____a_a 3 11 11 Y 32896 0 63
+def coalesce___a 3 11 11 Y 32896 0 63
+def coalesce_a_a 3 11 11 Y 32896 0 63
+def if_______a_a 3 11 11 Y 32896 0 63
+def ifnull___a_a 3 11 11 Y 32896 0 63
+def least____a_a 3 11 11 Y 32896 0 63
+def greatest_a_a 3 11 11 Y 32896 0 63
+def test t1 t1 b ___________b 3 11 10 Y 32768 0 63
+def case_______b 3 11 10 Y 32896 0 63
+def case_____b_b 3 11 10 Y 32896 0 63
+def coalesce___b 3 11 10 Y 32896 0 63
+def coalesce_b_b 3 11 10 Y 32896 0 63
+def if_______b_b 3 11 10 Y 32896 0 63
+def ifnull___b_b 3 11 10 Y 32896 0 63
+def least____b_b 3 11 10 Y 32896 0 63
+def greatest_b_b 3 11 10 Y 32896 0 63
+___________a 1
+case_______a 1
+case_____a_a 1
+coalesce___a 1
+coalesce_a_a 1
+if_______a_a 1
+ifnull___a_a 1
+least____a_a 1
+greatest_a_a 1
+___________b 1
+case_______b 1
+case_____b_b 1
+coalesce___b 1
+coalesce_b_b 1
+if_______b_b 1
+ifnull___b_b 1
+least____b_b 1
+greatest_b_b 1
+___________a -2147483648
+case_______a -2147483648
+case_____a_a -2147483648
+coalesce___a -2147483648
+coalesce_a_a -2147483648
+if_______a_a -2147483648
+ifnull___a_a -2147483648
+least____a_a -2147483648
+greatest_a_a -2147483648
+___________b 2147483647
+case_______b 2147483647
+case_____b_b 2147483647
+coalesce___b 2147483647
+coalesce_b_b 2147483647
+if_______b_b 2147483647
+ifnull___b_b 2147483647
+least____b_b 2147483647
+greatest_b_b 2147483647
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 3 11 11 Y 32896 0 63
+def case_____b_a 3 11 10 Y 32896 0 63
+def coalesce_a_b 3 11 11 Y 32896 0 63
+def coalesce_b_a 3 11 10 Y 32896 0 63
+def if_______a_b 3 11 10 Y 32896 0 63
+def if_______b_a 3 11 11 Y 32896 0 63
+def ifnull___a_b 3 11 11 Y 32896 0 63
+def ifnull___b_a 3 11 10 Y 32896 0 63
+def least____a_b 3 11 11 Y 32896 0 63
+def least____b_a 3 11 11 Y 32896 0 63
+def greatest_a_b 3 11 10 Y 32896 0 63
+def greatest_b_a 3 11 10 Y 32896 0 63
+case_____a_b 1
+case_____b_a 1
+coalesce_a_b 1
+coalesce_b_a 1
+if_______a_b 1
+if_______b_a 1
+ifnull___a_b 1
+ifnull___b_a 1
+least____a_b 1
+least____b_a 1
+greatest_a_b 1
+greatest_b_a 1
+case_____a_b -2147483648
+case_____b_a 2147483647
+coalesce_a_b -2147483648
+coalesce_b_a 2147483647
+if_______a_b 2147483647
+if_______b_a -2147483648
+ifnull___a_b -2147483648
+ifnull___b_a 2147483647
+least____a_b -2147483648
+least____b_a -2147483648
+greatest_a_b 2147483647
+greatest_b_a 2147483647
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` int(11) DEFAULT NULL,
+ `case_______a` int(11) DEFAULT NULL,
+ `case_____a_a` int(11) DEFAULT NULL,
+ `coalesce___a` int(11) DEFAULT NULL,
+ `coalesce_a_a` int(11) DEFAULT NULL,
+ `if_______a_a` int(11) DEFAULT NULL,
+ `ifnull___a_a` int(11) DEFAULT NULL,
+ `least____a_a` int(11) DEFAULT NULL,
+ `greatest_a_a` int(11) DEFAULT NULL,
+ `___________b` int(11) DEFAULT NULL,
+ `case_______b` int(11) DEFAULT NULL,
+ `case_____b_b` int(11) DEFAULT NULL,
+ `coalesce___b` int(11) DEFAULT NULL,
+ `coalesce_b_b` int(11) DEFAULT NULL,
+ `if_______b_b` int(11) DEFAULT NULL,
+ `ifnull___b_b` int(11) DEFAULT NULL,
+ `least____b_b` int(11) DEFAULT NULL,
+ `greatest_b_b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` int(11) DEFAULT NULL,
+ `case_____b_a` int(11) DEFAULT NULL,
+ `coalesce_a_b` int(11) DEFAULT NULL,
+ `coalesce_b_a` int(11) DEFAULT NULL,
+ `if_______a_b` int(11) DEFAULT NULL,
+ `if_______b_a` int(11) DEFAULT NULL,
+ `ifnull___a_b` int(11) DEFAULT NULL,
+ `ifnull___b_a` int(11) DEFAULT NULL,
+ `least____a_b` int(11) DEFAULT NULL,
+ `least____b_a` int(11) DEFAULT NULL,
+ `greatest_a_b` int(11) DEFAULT NULL,
+ `greatest_b_a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a BIGINT, b BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-9223372036854775808,0xFFFFFFFFFFFFFFFF);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 8 20 20 Y 32768 0 63
+def case_______a 8 20 20 Y 32896 0 63
+def case_____a_a 8 20 20 Y 32896 0 63
+def coalesce___a 8 20 20 Y 32896 0 63
+def coalesce_a_a 8 20 20 Y 32896 0 63
+def if_______a_a 8 20 20 Y 32896 0 63
+def ifnull___a_a 8 20 20 Y 32896 0 63
+def least____a_a 8 20 20 Y 32896 0 63
+def greatest_a_a 8 20 20 Y 32896 0 63
+def test t1 t1 b ___________b 8 20 20 Y 32800 0 63
+def case_______b 8 20 20 Y 32928 0 63
+def case_____b_b 8 20 20 Y 32928 0 63
+def coalesce___b 8 20 20 Y 32928 0 63
+def coalesce_b_b 8 20 20 Y 32928 0 63
+def if_______b_b 8 20 20 Y 32928 0 63
+def ifnull___b_b 8 20 20 Y 32928 0 63
+def least____b_b 8 20 20 Y 32928 0 63
+def greatest_b_b 8 20 20 Y 32928 0 63
+___________a 1
+case_______a 1
+case_____a_a 1
+coalesce___a 1
+coalesce_a_a 1
+if_______a_a 1
+ifnull___a_a 1
+least____a_a 1
+greatest_a_a 1
+___________b 1
+case_______b 1
+case_____b_b 1
+coalesce___b 1
+coalesce_b_b 1
+if_______b_b 1
+ifnull___b_b 1
+least____b_b 1
+greatest_b_b 1
+___________a -9223372036854775808
+case_______a -9223372036854775808
+case_____a_a -9223372036854775808
+coalesce___a -9223372036854775808
+coalesce_a_a -9223372036854775808
+if_______a_a -9223372036854775808
+ifnull___a_a -9223372036854775808
+least____a_a -9223372036854775808
+greatest_a_a -9223372036854775808
+___________b 18446744073709551615
+case_______b 18446744073709551615
+case_____b_b 18446744073709551615
+coalesce___b 18446744073709551615
+coalesce_b_b 18446744073709551615
+if_______b_b 18446744073709551615
+ifnull___b_b 18446744073709551615
+least____b_b 18446744073709551615
+greatest_b_b 18446744073709551615
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 246 21 20 Y 32896 0 63
+def case_____b_a 246 21 20 Y 32896 0 63
+def coalesce_a_b 246 21 20 Y 32896 0 63
+def coalesce_b_a 246 21 20 Y 32896 0 63
+def if_______a_b 246 21 20 Y 32896 0 63
+def if_______b_a 246 21 20 Y 32896 0 63
+def ifnull___a_b 246 21 20 Y 32896 0 63
+def ifnull___b_a 246 21 20 Y 32896 0 63
+def least____a_b 246 21 20 Y 32896 0 63
+def least____b_a 246 21 20 Y 32896 0 63
+def greatest_a_b 246 21 20 Y 32896 0 63
+def greatest_b_a 246 21 20 Y 32896 0 63
+case_____a_b 1
+case_____b_a 1
+coalesce_a_b 1
+coalesce_b_a 1
+if_______a_b 1
+if_______b_a 1
+ifnull___a_b 1
+ifnull___b_a 1
+least____a_b 1
+least____b_a 1
+greatest_a_b 1
+greatest_b_a 1
+case_____a_b -9223372036854775808
+case_____b_a 18446744073709551615
+coalesce_a_b -9223372036854775808
+coalesce_b_a 18446744073709551615
+if_______a_b 18446744073709551615
+if_______b_a -9223372036854775808
+ifnull___a_b -9223372036854775808
+ifnull___b_a 18446744073709551615
+least____a_b -9223372036854775808
+least____b_a -9223372036854775808
+greatest_a_b 18446744073709551615
+greatest_b_a 18446744073709551615
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` bigint(20) DEFAULT NULL,
+ `case_______a` bigint(20) DEFAULT NULL,
+ `case_____a_a` bigint(20) DEFAULT NULL,
+ `coalesce___a` bigint(20) DEFAULT NULL,
+ `coalesce_a_a` bigint(20) DEFAULT NULL,
+ `if_______a_a` bigint(20) DEFAULT NULL,
+ `ifnull___a_a` bigint(20) DEFAULT NULL,
+ `least____a_a` bigint(20) DEFAULT NULL,
+ `greatest_a_a` bigint(20) DEFAULT NULL,
+ `___________b` bigint(20) unsigned DEFAULT NULL,
+ `case_______b` bigint(20) unsigned DEFAULT NULL,
+ `case_____b_b` bigint(20) unsigned DEFAULT NULL,
+ `coalesce___b` bigint(20) unsigned DEFAULT NULL,
+ `coalesce_b_b` bigint(20) unsigned DEFAULT NULL,
+ `if_______b_b` bigint(20) unsigned DEFAULT NULL,
+ `ifnull___b_b` bigint(20) unsigned DEFAULT NULL,
+ `least____b_b` bigint(20) unsigned DEFAULT NULL,
+ `greatest_b_b` bigint(20) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` decimal(20,0) DEFAULT NULL,
+ `case_____b_a` decimal(20,0) DEFAULT NULL,
+ `coalesce_a_b` decimal(20,0) DEFAULT NULL,
+ `coalesce_b_a` decimal(20,0) DEFAULT NULL,
+ `if_______a_b` decimal(20,0) DEFAULT NULL,
+ `if_______b_a` decimal(20,0) DEFAULT NULL,
+ `ifnull___a_b` decimal(20,0) DEFAULT NULL,
+ `ifnull___b_a` decimal(20,0) DEFAULT NULL,
+ `least____a_b` decimal(20,0) DEFAULT NULL,
+ `least____b_a` decimal(20,0) DEFAULT NULL,
+ `greatest_a_b` decimal(20,0) DEFAULT NULL,
+ `greatest_b_a` decimal(20,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a BIGINT, b BIGINT);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-9223372036854775808,9223372036854775807);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 8 20 20 Y 32768 0 63
+def case_______a 8 20 20 Y 32896 0 63
+def case_____a_a 8 20 20 Y 32896 0 63
+def coalesce___a 8 20 20 Y 32896 0 63
+def coalesce_a_a 8 20 20 Y 32896 0 63
+def if_______a_a 8 20 20 Y 32896 0 63
+def ifnull___a_a 8 20 20 Y 32896 0 63
+def least____a_a 8 20 20 Y 32896 0 63
+def greatest_a_a 8 20 20 Y 32896 0 63
+def test t1 t1 b ___________b 8 20 19 Y 32768 0 63
+def case_______b 8 20 19 Y 32896 0 63
+def case_____b_b 8 20 19 Y 32896 0 63
+def coalesce___b 8 20 19 Y 32896 0 63
+def coalesce_b_b 8 20 19 Y 32896 0 63
+def if_______b_b 8 20 19 Y 32896 0 63
+def ifnull___b_b 8 20 19 Y 32896 0 63
+def least____b_b 8 20 19 Y 32896 0 63
+def greatest_b_b 8 20 19 Y 32896 0 63
+___________a 1
+case_______a 1
+case_____a_a 1
+coalesce___a 1
+coalesce_a_a 1
+if_______a_a 1
+ifnull___a_a 1
+least____a_a 1
+greatest_a_a 1
+___________b 1
+case_______b 1
+case_____b_b 1
+coalesce___b 1
+coalesce_b_b 1
+if_______b_b 1
+ifnull___b_b 1
+least____b_b 1
+greatest_b_b 1
+___________a -9223372036854775808
+case_______a -9223372036854775808
+case_____a_a -9223372036854775808
+coalesce___a -9223372036854775808
+coalesce_a_a -9223372036854775808
+if_______a_a -9223372036854775808
+ifnull___a_a -9223372036854775808
+least____a_a -9223372036854775808
+greatest_a_a -9223372036854775808
+___________b 9223372036854775807
+case_______b 9223372036854775807
+case_____b_b 9223372036854775807
+coalesce___b 9223372036854775807
+coalesce_b_b 9223372036854775807
+if_______b_b 9223372036854775807
+ifnull___b_b 9223372036854775807
+least____b_b 9223372036854775807
+greatest_b_b 9223372036854775807
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 8 20 20 Y 32896 0 63
+def case_____b_a 8 20 19 Y 32896 0 63
+def coalesce_a_b 8 20 20 Y 32896 0 63
+def coalesce_b_a 8 20 19 Y 32896 0 63
+def if_______a_b 8 20 19 Y 32896 0 63
+def if_______b_a 8 20 20 Y 32896 0 63
+def ifnull___a_b 8 20 20 Y 32896 0 63
+def ifnull___b_a 8 20 19 Y 32896 0 63
+def least____a_b 8 20 20 Y 32896 0 63
+def least____b_a 8 20 20 Y 32896 0 63
+def greatest_a_b 8 20 19 Y 32896 0 63
+def greatest_b_a 8 20 19 Y 32896 0 63
+case_____a_b 1
+case_____b_a 1
+coalesce_a_b 1
+coalesce_b_a 1
+if_______a_b 1
+if_______b_a 1
+ifnull___a_b 1
+ifnull___b_a 1
+least____a_b 1
+least____b_a 1
+greatest_a_b 1
+greatest_b_a 1
+case_____a_b -9223372036854775808
+case_____b_a 9223372036854775807
+coalesce_a_b -9223372036854775808
+coalesce_b_a 9223372036854775807
+if_______a_b 9223372036854775807
+if_______b_a -9223372036854775808
+ifnull___a_b -9223372036854775808
+ifnull___b_a 9223372036854775807
+least____a_b -9223372036854775808
+least____b_a -9223372036854775808
+greatest_a_b 9223372036854775807
+greatest_b_a 9223372036854775807
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` bigint(20) DEFAULT NULL,
+ `case_______a` bigint(20) DEFAULT NULL,
+ `case_____a_a` bigint(20) DEFAULT NULL,
+ `coalesce___a` bigint(20) DEFAULT NULL,
+ `coalesce_a_a` bigint(20) DEFAULT NULL,
+ `if_______a_a` bigint(20) DEFAULT NULL,
+ `ifnull___a_a` bigint(20) DEFAULT NULL,
+ `least____a_a` bigint(20) DEFAULT NULL,
+ `greatest_a_a` bigint(20) DEFAULT NULL,
+ `___________b` bigint(20) DEFAULT NULL,
+ `case_______b` bigint(20) DEFAULT NULL,
+ `case_____b_b` bigint(20) DEFAULT NULL,
+ `coalesce___b` bigint(20) DEFAULT NULL,
+ `coalesce_b_b` bigint(20) DEFAULT NULL,
+ `if_______b_b` bigint(20) DEFAULT NULL,
+ `ifnull___b_b` bigint(20) DEFAULT NULL,
+ `least____b_b` bigint(20) DEFAULT NULL,
+ `greatest_b_b` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` bigint(20) DEFAULT NULL,
+ `case_____b_a` bigint(20) DEFAULT NULL,
+ `coalesce_a_b` bigint(20) DEFAULT NULL,
+ `coalesce_b_a` bigint(20) DEFAULT NULL,
+ `if_______a_b` bigint(20) DEFAULT NULL,
+ `if_______b_a` bigint(20) DEFAULT NULL,
+ `ifnull___a_b` bigint(20) DEFAULT NULL,
+ `ifnull___b_a` bigint(20) DEFAULT NULL,
+ `least____a_b` bigint(20) DEFAULT NULL,
+ `least____b_a` bigint(20) DEFAULT NULL,
+ `greatest_a_b` bigint(20) DEFAULT NULL,
+ `greatest_b_a` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a INT, b BIT(8));
+INSERT INTO t1 VALUES (-2147483648,0x32);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 3 11 11 Y 32768 0 63
+def case_______a 3 11 11 Y 32896 0 63
+def case_____a_a 3 11 11 Y 32896 0 63
+def coalesce___a 3 11 11 Y 32896 0 63
+def coalesce_a_a 3 11 11 Y 32896 0 63
+def if_______a_a 3 11 11 Y 32896 0 63
+def ifnull___a_a 3 11 11 Y 32896 0 63
+def least____a_a 3 11 11 Y 32896 0 63
+def greatest_a_a 3 11 11 Y 32896 0 63
+def test t1 t1 b ___________b 16 8 1 Y 32 0 63
+def case_______b 16 8 2 Y 160 0 63
+def case_____b_b 16 8 2 Y 160 0 63
+def coalesce___b 16 8 2 Y 160 0 63
+def coalesce_b_b 16 8 2 Y 160 0 63
+def if_______b_b 16 8 2 Y 160 0 63
+def ifnull___b_b 16 8 2 Y 160 0 63
+def least____b_b 16 8 2 Y 160 0 63
+def greatest_b_b 16 8 2 Y 160 0 63
+___________a -2147483648
+case_______a -2147483648
+case_____a_a -2147483648
+coalesce___a -2147483648
+coalesce_a_a -2147483648
+if_______a_a -2147483648
+ifnull___a_a -2147483648
+least____a_a -2147483648
+greatest_a_a -2147483648
+___________b 2
+case_______b 50
+case_____b_b 50
+coalesce___b 50
+coalesce_b_b 50
+if_______b_b 50
+ifnull___b_b 50
+least____b_b 50
+greatest_b_b 50
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 246 11 11 Y 32896 0 63
+def case_____b_a 246 11 2 Y 32896 0 63
+def coalesce_a_b 246 11 11 Y 32896 0 63
+def coalesce_b_a 246 11 2 Y 32896 0 63
+def if_______a_b 246 11 2 Y 32896 0 63
+def if_______b_a 246 11 11 Y 32896 0 63
+def ifnull___a_b 246 11 11 Y 32896 0 63
+def ifnull___b_a 246 11 2 Y 32896 0 63
+def least____a_b 246 11 11 Y 32896 0 63
+def least____b_a 246 11 11 Y 32896 0 63
+def greatest_a_b 246 11 2 Y 32896 0 63
+def greatest_b_a 246 11 2 Y 32896 0 63
+case_____a_b -2147483648
+case_____b_a 50
+coalesce_a_b -2147483648
+coalesce_b_a 50
+if_______a_b 50
+if_______b_a -2147483648
+ifnull___a_b -2147483648
+ifnull___b_a 50
+least____a_b -2147483648
+least____b_a -2147483648
+greatest_a_b 50
+greatest_b_a 50
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` int(11) DEFAULT NULL,
+ `case_______a` int(11) DEFAULT NULL,
+ `case_____a_a` int(11) DEFAULT NULL,
+ `coalesce___a` int(11) DEFAULT NULL,
+ `coalesce_a_a` int(11) DEFAULT NULL,
+ `if_______a_a` int(11) DEFAULT NULL,
+ `ifnull___a_a` int(11) DEFAULT NULL,
+ `least____a_a` int(11) DEFAULT NULL,
+ `greatest_a_a` int(11) DEFAULT NULL,
+ `___________b` bit(8) DEFAULT NULL,
+ `case_______b` int(8) unsigned DEFAULT NULL,
+ `case_____b_b` int(8) unsigned DEFAULT NULL,
+ `coalesce___b` int(8) unsigned DEFAULT NULL,
+ `coalesce_b_b` int(8) unsigned DEFAULT NULL,
+ `if_______b_b` int(8) unsigned DEFAULT NULL,
+ `ifnull___b_b` bit(8) DEFAULT NULL,
+ `least____b_b` int(8) unsigned DEFAULT NULL,
+ `greatest_b_b` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` decimal(10,0) DEFAULT NULL,
+ `case_____b_a` decimal(10,0) DEFAULT NULL,
+ `coalesce_a_b` decimal(10,0) DEFAULT NULL,
+ `coalesce_b_a` decimal(10,0) DEFAULT NULL,
+ `if_______a_b` decimal(10,0) DEFAULT NULL,
+ `if_______b_a` decimal(10,0) DEFAULT NULL,
+ `ifnull___a_b` decimal(10,0) DEFAULT NULL,
+ `ifnull___b_a` decimal(10,0) DEFAULT NULL,
+ `least____a_b` decimal(10,0) DEFAULT NULL,
+ `least____b_a` decimal(10,0) DEFAULT NULL,
+ `greatest_a_b` decimal(10,0) DEFAULT NULL,
+ `greatest_b_a` decimal(10,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a INT UNSIGNED, b BIT(8));
+INSERT INTO t1 VALUES (4294967295,0x32);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 3 10 10 Y 32800 0 63
+def case_______a 3 10 10 Y 32928 0 63
+def case_____a_a 3 10 10 Y 32928 0 63
+def coalesce___a 3 10 10 Y 32928 0 63
+def coalesce_a_a 3 10 10 Y 32928 0 63
+def if_______a_a 3 10 10 Y 32928 0 63
+def ifnull___a_a 3 10 10 Y 32928 0 63
+def least____a_a 3 10 10 Y 32928 0 63
+def greatest_a_a 3 10 10 Y 32928 0 63
+def test t1 t1 b ___________b 16 8 1 Y 32 0 63
+def case_______b 16 8 2 Y 160 0 63
+def case_____b_b 16 8 2 Y 160 0 63
+def coalesce___b 16 8 2 Y 160 0 63
+def coalesce_b_b 16 8 2 Y 160 0 63
+def if_______b_b 16 8 2 Y 160 0 63
+def ifnull___b_b 16 8 2 Y 160 0 63
+def least____b_b 16 8 2 Y 160 0 63
+def greatest_b_b 16 8 2 Y 160 0 63
+___________a 4294967295
+case_______a 4294967295
+case_____a_a 4294967295
+coalesce___a 4294967295
+coalesce_a_a 4294967295
+if_______a_a 4294967295
+ifnull___a_a 4294967295
+least____a_a 4294967295
+greatest_a_a 4294967295
+___________b 2
+case_______b 50
+case_____b_b 50
+coalesce___b 50
+coalesce_b_b 50
+if_______b_b 50
+ifnull___b_b 50
+least____b_b 50
+greatest_b_b 50
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 8 10 10 Y 32928 0 63
+def case_____b_a 8 10 2 Y 32928 0 63
+def coalesce_a_b 8 10 10 Y 32928 0 63
+def coalesce_b_a 8 10 2 Y 32928 0 63
+def if_______a_b 8 10 2 Y 32928 0 63
+def if_______b_a 8 10 10 Y 32928 0 63
+def ifnull___a_b 8 10 10 Y 32928 0 63
+def ifnull___b_a 8 10 2 Y 32928 0 63
+def least____a_b 8 10 2 Y 32928 0 63
+def least____b_a 8 10 2 Y 32928 0 63
+def greatest_a_b 8 10 10 Y 32928 0 63
+def greatest_b_a 8 10 10 Y 32928 0 63
+case_____a_b 4294967295
+case_____b_a 50
+coalesce_a_b 4294967295
+coalesce_b_a 50
+if_______a_b 50
+if_______b_a 4294967295
+ifnull___a_b 4294967295
+ifnull___b_a 50
+least____a_b 50
+least____b_a 50
+greatest_a_b 4294967295
+greatest_b_a 4294967295
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` int(10) unsigned DEFAULT NULL,
+ `case_______a` int(10) unsigned DEFAULT NULL,
+ `case_____a_a` int(10) unsigned DEFAULT NULL,
+ `coalesce___a` int(10) unsigned DEFAULT NULL,
+ `coalesce_a_a` int(10) unsigned DEFAULT NULL,
+ `if_______a_a` int(10) unsigned DEFAULT NULL,
+ `ifnull___a_a` int(10) unsigned DEFAULT NULL,
+ `least____a_a` int(10) unsigned DEFAULT NULL,
+ `greatest_a_a` int(10) unsigned DEFAULT NULL,
+ `___________b` bit(8) DEFAULT NULL,
+ `case_______b` int(8) unsigned DEFAULT NULL,
+ `case_____b_b` int(8) unsigned DEFAULT NULL,
+ `coalesce___b` int(8) unsigned DEFAULT NULL,
+ `coalesce_b_b` int(8) unsigned DEFAULT NULL,
+ `if_______b_b` int(8) unsigned DEFAULT NULL,
+ `ifnull___b_b` bit(8) DEFAULT NULL,
+ `least____b_b` int(8) unsigned DEFAULT NULL,
+ `greatest_b_b` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` int(10) unsigned DEFAULT NULL,
+ `case_____b_a` int(10) unsigned DEFAULT NULL,
+ `coalesce_a_b` int(10) unsigned DEFAULT NULL,
+ `coalesce_b_a` int(10) unsigned DEFAULT NULL,
+ `if_______a_b` int(10) unsigned DEFAULT NULL,
+ `if_______b_a` int(10) unsigned DEFAULT NULL,
+ `ifnull___a_b` bigint(10) unsigned DEFAULT NULL,
+ `ifnull___b_a` bigint(10) unsigned DEFAULT NULL,
+ `least____a_b` int(10) unsigned DEFAULT NULL,
+ `least____b_a` int(10) unsigned DEFAULT NULL,
+ `greatest_a_b` int(10) unsigned DEFAULT NULL,
+ `greatest_b_a` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a BIT(7), b BIT(8));
+INSERT INTO t1 VALUES (0x32,0x32);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 16 7 1 Y 32 0 63
+def case_______a 16 7 2 Y 160 0 63
+def case_____a_a 16 7 2 Y 160 0 63
+def coalesce___a 16 7 2 Y 160 0 63
+def coalesce_a_a 16 7 2 Y 160 0 63
+def if_______a_a 16 7 2 Y 160 0 63
+def ifnull___a_a 16 7 2 Y 160 0 63
+def least____a_a 16 7 2 Y 160 0 63
+def greatest_a_a 16 7 2 Y 160 0 63
+def test t1 t1 b ___________b 16 8 1 Y 32 0 63
+def case_______b 16 8 2 Y 160 0 63
+def case_____b_b 16 8 2 Y 160 0 63
+def coalesce___b 16 8 2 Y 160 0 63
+def coalesce_b_b 16 8 2 Y 160 0 63
+def if_______b_b 16 8 2 Y 160 0 63
+def ifnull___b_b 16 8 2 Y 160 0 63
+def least____b_b 16 8 2 Y 160 0 63
+def greatest_b_b 16 8 2 Y 160 0 63
+___________a 2
+case_______a 50
+case_____a_a 50
+coalesce___a 50
+coalesce_a_a 50
+if_______a_a 50
+ifnull___a_a 50
+least____a_a 50
+greatest_a_a 50
+___________b 2
+case_______b 50
+case_____b_b 50
+coalesce___b 50
+coalesce_b_b 50
+if_______b_b 50
+ifnull___b_b 50
+least____b_b 50
+greatest_b_b 50
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 16 8 2 Y 160 0 63
+def case_____b_a 16 8 2 Y 160 0 63
+def coalesce_a_b 16 8 2 Y 160 0 63
+def coalesce_b_a 16 8 2 Y 160 0 63
+def if_______a_b 16 8 2 Y 160 0 63
+def if_______b_a 16 8 2 Y 160 0 63
+def ifnull___a_b 16 8 2 Y 160 0 63
+def ifnull___b_a 16 8 2 Y 160 0 63
+def least____a_b 16 8 2 Y 160 0 63
+def least____b_a 16 8 2 Y 160 0 63
+def greatest_a_b 16 8 2 Y 160 0 63
+def greatest_b_a 16 8 2 Y 160 0 63
+case_____a_b 50
+case_____b_a 50
+coalesce_a_b 50
+coalesce_b_a 50
+if_______a_b 50
+if_______b_a 50
+ifnull___a_b 50
+ifnull___b_a 50
+least____a_b 50
+least____b_a 50
+greatest_a_b 50
+greatest_b_a 50
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` bit(7) DEFAULT NULL,
+ `case_______a` int(7) unsigned DEFAULT NULL,
+ `case_____a_a` int(7) unsigned DEFAULT NULL,
+ `coalesce___a` int(7) unsigned DEFAULT NULL,
+ `coalesce_a_a` int(7) unsigned DEFAULT NULL,
+ `if_______a_a` int(7) unsigned DEFAULT NULL,
+ `ifnull___a_a` bit(7) DEFAULT NULL,
+ `least____a_a` int(7) unsigned DEFAULT NULL,
+ `greatest_a_a` int(7) unsigned DEFAULT NULL,
+ `___________b` bit(8) DEFAULT NULL,
+ `case_______b` int(8) unsigned DEFAULT NULL,
+ `case_____b_b` int(8) unsigned DEFAULT NULL,
+ `coalesce___b` int(8) unsigned DEFAULT NULL,
+ `coalesce_b_b` int(8) unsigned DEFAULT NULL,
+ `if_______b_b` int(8) unsigned DEFAULT NULL,
+ `ifnull___b_b` bit(8) DEFAULT NULL,
+ `least____b_b` int(8) unsigned DEFAULT NULL,
+ `greatest_b_b` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` int(8) unsigned DEFAULT NULL,
+ `case_____b_a` int(8) unsigned DEFAULT NULL,
+ `coalesce_a_b` int(8) unsigned DEFAULT NULL,
+ `coalesce_b_a` int(8) unsigned DEFAULT NULL,
+ `if_______a_b` int(8) unsigned DEFAULT NULL,
+ `if_______b_a` int(8) unsigned DEFAULT NULL,
+ `ifnull___a_b` bit(8) DEFAULT NULL,
+ `ifnull___b_a` bit(8) DEFAULT NULL,
+ `least____a_b` int(8) unsigned DEFAULT NULL,
+ `least____b_a` int(8) unsigned DEFAULT NULL,
+ `greatest_a_b` int(8) unsigned DEFAULT NULL,
+ `greatest_b_a` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a FLOAT, b SMALLINT);
+INSERT INTO t1 VALUES (1,-32678);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 4 12 1 Y 32768 31 63
+def case_______a 4 12 1 Y 32896 31 63
+def case_____a_a 4 12 1 Y 32896 31 63
+def coalesce___a 4 12 1 Y 32896 31 63
+def coalesce_a_a 4 12 1 Y 32896 31 63
+def if_______a_a 4 12 1 Y 32896 31 63
+def ifnull___a_a 4 12 1 Y 32896 31 63
+def least____a_a 5 23 1 Y 32896 31 63
+def greatest_a_a 5 23 1 Y 32896 31 63
+def test t1 t1 b ___________b 2 6 6 Y 32768 0 63
+def case_______b 2 6 6 Y 32896 0 63
+def case_____b_b 2 6 6 Y 32896 0 63
+def coalesce___b 2 6 6 Y 32896 0 63
+def coalesce_b_b 2 6 6 Y 32896 0 63
+def if_______b_b 2 6 6 Y 32896 0 63
+def ifnull___b_b 2 6 6 Y 32896 0 63
+def least____b_b 2 6 6 Y 32896 0 63
+def greatest_b_b 2 6 6 Y 32896 0 63
+___________a 1
+case_______a 1
+case_____a_a 1
+coalesce___a 1
+coalesce_a_a 1
+if_______a_a 1
+ifnull___a_a 1
+least____a_a 1
+greatest_a_a 1
+___________b -32678
+case_______b -32678
+case_____b_b -32678
+coalesce___b -32678
+coalesce_b_b -32678
+if_______b_b -32678
+ifnull___b_b -32678
+least____b_b -32678
+greatest_b_b -32678
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 4 12 1 Y 32896 31 63
+def case_____b_a 4 12 6 Y 32896 31 63
+def coalesce_a_b 4 12 1 Y 32896 31 63
+def coalesce_b_a 4 12 6 Y 32896 31 63
+def if_______a_b 4 12 6 Y 32896 31 63
+def if_______b_a 4 12 1 Y 32896 31 63
+def ifnull___a_b 4 12 1 Y 32896 31 63
+def ifnull___b_a 4 12 6 Y 32896 31 63
+def least____a_b 5 23 6 Y 32896 31 63
+def least____b_a 5 23 6 Y 32896 31 63
+def greatest_a_b 5 23 1 Y 32896 31 63
+def greatest_b_a 5 23 1 Y 32896 31 63
+case_____a_b 1
+case_____b_a -32678
+coalesce_a_b 1
+coalesce_b_a -32678
+if_______a_b -32678
+if_______b_a 1
+ifnull___a_b 1
+ifnull___b_a -32678
+least____a_b -32678
+least____b_a -32678
+greatest_a_b 1
+greatest_b_a 1
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` float DEFAULT NULL,
+ `case_______a` double DEFAULT NULL,
+ `case_____a_a` double DEFAULT NULL,
+ `coalesce___a` double DEFAULT NULL,
+ `coalesce_a_a` double DEFAULT NULL,
+ `if_______a_a` double DEFAULT NULL,
+ `ifnull___a_a` float DEFAULT NULL,
+ `least____a_a` double DEFAULT NULL,
+ `greatest_a_a` double DEFAULT NULL,
+ `___________b` smallint(6) DEFAULT NULL,
+ `case_______b` int(6) DEFAULT NULL,
+ `case_____b_b` int(6) DEFAULT NULL,
+ `coalesce___b` int(6) DEFAULT NULL,
+ `coalesce_b_b` int(6) DEFAULT NULL,
+ `if_______b_b` int(6) DEFAULT NULL,
+ `ifnull___b_b` smallint(6) DEFAULT NULL,
+ `least____b_b` int(6) DEFAULT NULL,
+ `greatest_b_b` int(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` double DEFAULT NULL,
+ `case_____b_a` double DEFAULT NULL,
+ `coalesce_a_b` double DEFAULT NULL,
+ `coalesce_b_a` double DEFAULT NULL,
+ `if_______a_b` double DEFAULT NULL,
+ `if_______b_a` double DEFAULT NULL,
+ `ifnull___a_b` float DEFAULT NULL,
+ `ifnull___b_a` float DEFAULT NULL,
+ `least____a_b` double DEFAULT NULL,
+ `least____b_a` double DEFAULT NULL,
+ `greatest_a_b` double DEFAULT NULL,
+ `greatest_b_a` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a VARCHAR(10), b ENUM('b'));
+INSERT INTO t1 VALUES ('a','b');
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 253 10 1 Y 0 0 8
+def case_______a 253 10 1 Y 0 31 8
+def case_____a_a 253 10 1 Y 0 31 8
+def coalesce___a 253 10 1 Y 0 31 8
+def coalesce_a_a 253 10 1 Y 0 31 8
+def if_______a_a 253 10 1 Y 0 31 8
+def ifnull___a_a 253 10 1 Y 0 31 8
+def least____a_a 253 10 1 Y 0 31 8
+def greatest_a_a 253 10 1 Y 0 31 8
+def test t1 t1 b ___________b 254 1 1 Y 256 0 8
+def case_______b 254 1 1 Y 0 31 8
+def case_____b_b 254 1 1 Y 0 31 8
+def coalesce___b 254 1 1 Y 0 31 8
+def coalesce_b_b 254 1 1 Y 0 31 8
+def if_______b_b 254 1 1 Y 0 31 8
+def ifnull___b_b 254 1 1 Y 0 31 8
+def least____b_b 254 1 1 Y 0 0 8
+def greatest_b_b 254 1 1 Y 0 0 8
+___________a a
+case_______a a
+case_____a_a a
+coalesce___a a
+coalesce_a_a a
+if_______a_a a
+ifnull___a_a a
+least____a_a a
+greatest_a_a a
+___________b b
+case_______b b
+case_____b_b b
+coalesce___b b
+coalesce_b_b b
+if_______b_b b
+ifnull___b_b b
+least____b_b b
+greatest_b_b b
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 253 10 1 Y 0 31 8
+def case_____b_a 253 10 1 Y 0 31 8
+def coalesce_a_b 253 10 1 Y 0 31 8
+def coalesce_b_a 253 10 1 Y 0 31 8
+def if_______a_b 253 10 1 Y 0 31 8
+def if_______b_a 253 10 1 Y 0 31 8
+def ifnull___a_b 253 10 1 Y 0 31 8
+def ifnull___b_a 253 10 1 Y 0 31 8
+def least____a_b 253 10 1 Y 0 31 8
+def least____b_a 253 10 1 Y 0 31 8
+def greatest_a_b 253 10 1 Y 0 31 8
+def greatest_b_a 253 10 1 Y 0 31 8
+case_____a_b a
+case_____b_a b
+coalesce_a_b a
+coalesce_b_a b
+if_______a_b b
+if_______b_a a
+ifnull___a_b a
+ifnull___b_a b
+least____a_b a
+least____b_a a
+greatest_a_b b
+greatest_b_a b
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` varchar(10) DEFAULT NULL,
+ `case_______a` varchar(10) DEFAULT NULL,
+ `case_____a_a` varchar(10) DEFAULT NULL,
+ `coalesce___a` varchar(10) DEFAULT NULL,
+ `coalesce_a_a` varchar(10) DEFAULT NULL,
+ `if_______a_a` varchar(10) DEFAULT NULL,
+ `ifnull___a_a` varchar(10) DEFAULT NULL,
+ `least____a_a` varchar(10) DEFAULT NULL,
+ `greatest_a_a` varchar(10) DEFAULT NULL,
+ `___________b` enum('b') DEFAULT NULL,
+ `case_______b` varchar(1) DEFAULT NULL,
+ `case_____b_b` varchar(1) DEFAULT NULL,
+ `coalesce___b` varchar(1) DEFAULT NULL,
+ `coalesce_b_b` varchar(1) DEFAULT NULL,
+ `if_______b_b` varchar(1) DEFAULT NULL,
+ `ifnull___b_b` varchar(1) DEFAULT NULL,
+ `least____b_b` varchar(1) DEFAULT NULL,
+ `greatest_b_b` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` varchar(10) DEFAULT NULL,
+ `case_____b_a` varchar(10) DEFAULT NULL,
+ `coalesce_a_b` varchar(10) DEFAULT NULL,
+ `coalesce_b_a` varchar(10) DEFAULT NULL,
+ `if_______a_b` varchar(10) DEFAULT NULL,
+ `if_______b_a` varchar(10) DEFAULT NULL,
+ `ifnull___a_b` varchar(10) DEFAULT NULL,
+ `ifnull___b_a` varchar(10) DEFAULT NULL,
+ `least____a_b` varchar(10) DEFAULT NULL,
+ `least____b_a` varchar(10) DEFAULT NULL,
+ `greatest_a_b` varchar(10) DEFAULT NULL,
+ `greatest_b_a` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a INT, b YEAR);
+INSERT INTO t1 VALUES (-2147483648,2015);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 3 11 11 Y 32768 0 63
+def case_______a 3 11 11 Y 32896 0 63
+def case_____a_a 3 11 11 Y 32896 0 63
+def coalesce___a 3 11 11 Y 32896 0 63
+def coalesce_a_a 3 11 11 Y 32896 0 63
+def if_______a_a 3 11 11 Y 32896 0 63
+def ifnull___a_a 3 11 11 Y 32896 0 63
+def least____a_a 3 11 11 Y 32896 0 63
+def greatest_a_a 3 11 11 Y 32896 0 63
+def test t1 t1 b ___________b 13 4 4 Y 32864 0 63
+def case_______b 13 4 4 Y 32928 0 63
+def case_____b_b 13 4 4 Y 32928 0 63
+def coalesce___b 13 4 4 Y 32928 0 63
+def coalesce_b_b 13 4 4 Y 32928 0 63
+def if_______b_b 13 4 4 Y 32928 0 63
+def ifnull___b_b 13 4 4 Y 32928 0 63
+def least____b_b 13 4 4 Y 32928 0 63
+def greatest_b_b 13 4 4 Y 32928 0 63
+___________a -2147483648
+case_______a -2147483648
+case_____a_a -2147483648
+coalesce___a -2147483648
+coalesce_a_a -2147483648
+if_______a_a -2147483648
+ifnull___a_a -2147483648
+least____a_a -2147483648
+greatest_a_a -2147483648
+___________b 2015
+case_______b 2015
+case_____b_b 2015
+coalesce___b 2015
+coalesce_b_b 2015
+if_______b_b 2015
+ifnull___b_b 2015
+least____b_b 2015
+greatest_b_b 2015
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 246 11 11 Y 32896 0 63
+def case_____b_a 246 11 4 Y 32896 0 63
+def coalesce_a_b 246 11 11 Y 32896 0 63
+def coalesce_b_a 246 11 4 Y 32896 0 63
+def if_______a_b 246 11 4 Y 32896 0 63
+def if_______b_a 246 11 11 Y 32896 0 63
+def ifnull___a_b 246 11 11 Y 32896 0 63
+def ifnull___b_a 246 11 4 Y 32896 0 63
+def least____a_b 246 11 11 Y 32896 0 63
+def least____b_a 246 11 11 Y 32896 0 63
+def greatest_a_b 246 11 4 Y 32896 0 63
+def greatest_b_a 246 11 4 Y 32896 0 63
+case_____a_b -2147483648
+case_____b_a 2015
+coalesce_a_b -2147483648
+coalesce_b_a 2015
+if_______a_b 2015
+if_______b_a -2147483648
+ifnull___a_b -2147483648
+ifnull___b_a 2015
+least____a_b -2147483648
+least____b_a -2147483648
+greatest_a_b 2015
+greatest_b_a 2015
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` int(11) DEFAULT NULL,
+ `case_______a` int(11) DEFAULT NULL,
+ `case_____a_a` int(11) DEFAULT NULL,
+ `coalesce___a` int(11) DEFAULT NULL,
+ `coalesce_a_a` int(11) DEFAULT NULL,
+ `if_______a_a` int(11) DEFAULT NULL,
+ `ifnull___a_a` int(11) DEFAULT NULL,
+ `least____a_a` int(11) DEFAULT NULL,
+ `greatest_a_a` int(11) DEFAULT NULL,
+ `___________b` year(4) DEFAULT NULL,
+ `case_______b` int(4) unsigned DEFAULT NULL,
+ `case_____b_b` int(4) unsigned DEFAULT NULL,
+ `coalesce___b` int(4) unsigned DEFAULT NULL,
+ `coalesce_b_b` int(4) unsigned DEFAULT NULL,
+ `if_______b_b` int(4) unsigned DEFAULT NULL,
+ `ifnull___b_b` year(4) DEFAULT NULL,
+ `least____b_b` int(4) unsigned DEFAULT NULL,
+ `greatest_b_b` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` decimal(10,0) DEFAULT NULL,
+ `case_____b_a` decimal(10,0) DEFAULT NULL,
+ `coalesce_a_b` decimal(10,0) DEFAULT NULL,
+ `coalesce_b_a` decimal(10,0) DEFAULT NULL,
+ `if_______a_b` decimal(10,0) DEFAULT NULL,
+ `if_______b_a` decimal(10,0) DEFAULT NULL,
+ `ifnull___a_b` decimal(10,0) DEFAULT NULL,
+ `ifnull___b_a` decimal(10,0) DEFAULT NULL,
+ `least____a_b` decimal(10,0) DEFAULT NULL,
+ `least____b_a` decimal(10,0) DEFAULT NULL,
+ `greatest_a_b` decimal(10,0) DEFAULT NULL,
+ `greatest_b_a` decimal(10,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (a INT UNSIGNED, b YEAR);
+INSERT INTO t1 VALUES (4294967295,2015);
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 3 10 10 Y 32800 0 63
+def case_______a 3 10 10 Y 32928 0 63
+def case_____a_a 3 10 10 Y 32928 0 63
+def coalesce___a 3 10 10 Y 32928 0 63
+def coalesce_a_a 3 10 10 Y 32928 0 63
+def if_______a_a 3 10 10 Y 32928 0 63
+def ifnull___a_a 3 10 10 Y 32928 0 63
+def least____a_a 3 10 10 Y 32928 0 63
+def greatest_a_a 3 10 10 Y 32928 0 63
+def test t1 t1 b ___________b 13 4 4 Y 32864 0 63
+def case_______b 13 4 4 Y 32928 0 63
+def case_____b_b 13 4 4 Y 32928 0 63
+def coalesce___b 13 4 4 Y 32928 0 63
+def coalesce_b_b 13 4 4 Y 32928 0 63
+def if_______b_b 13 4 4 Y 32928 0 63
+def ifnull___b_b 13 4 4 Y 32928 0 63
+def least____b_b 13 4 4 Y 32928 0 63
+def greatest_b_b 13 4 4 Y 32928 0 63
+___________a 4294967295
+case_______a 4294967295
+case_____a_a 4294967295
+coalesce___a 4294967295
+coalesce_a_a 4294967295
+if_______a_a 4294967295
+ifnull___a_a 4294967295
+least____a_a 4294967295
+greatest_a_a 4294967295
+___________b 2015
+case_______b 2015
+case_____b_b 2015
+coalesce___b 2015
+coalesce_b_b 2015
+if_______b_b 2015
+ifnull___b_b 2015
+least____b_b 2015
+greatest_b_b 2015
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 3 10 10 Y 32928 0 63
+def case_____b_a 3 10 4 Y 32928 0 63
+def coalesce_a_b 3 10 10 Y 32928 0 63
+def coalesce_b_a 3 10 4 Y 32928 0 63
+def if_______a_b 3 10 4 Y 32928 0 63
+def if_______b_a 3 10 10 Y 32928 0 63
+def ifnull___a_b 3 10 10 Y 32928 0 63
+def ifnull___b_a 3 10 4 Y 32928 0 63
+def least____a_b 3 10 4 Y 32928 0 63
+def least____b_a 3 10 4 Y 32928 0 63
+def greatest_a_b 3 10 10 Y 32928 0 63
+def greatest_b_a 3 10 10 Y 32928 0 63
+case_____a_b 4294967295
+case_____b_a 2015
+coalesce_a_b 4294967295
+coalesce_b_a 2015
+if_______a_b 2015
+if_______b_a 4294967295
+ifnull___a_b 4294967295
+ifnull___b_a 2015
+least____a_b 2015
+least____b_a 2015
+greatest_a_b 4294967295
+greatest_b_a 4294967295
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` int(10) unsigned DEFAULT NULL,
+ `case_______a` int(10) unsigned DEFAULT NULL,
+ `case_____a_a` int(10) unsigned DEFAULT NULL,
+ `coalesce___a` int(10) unsigned DEFAULT NULL,
+ `coalesce_a_a` int(10) unsigned DEFAULT NULL,
+ `if_______a_a` int(10) unsigned DEFAULT NULL,
+ `ifnull___a_a` int(10) unsigned DEFAULT NULL,
+ `least____a_a` int(10) unsigned DEFAULT NULL,
+ `greatest_a_a` int(10) unsigned DEFAULT NULL,
+ `___________b` year(4) DEFAULT NULL,
+ `case_______b` int(4) unsigned DEFAULT NULL,
+ `case_____b_b` int(4) unsigned DEFAULT NULL,
+ `coalesce___b` int(4) unsigned DEFAULT NULL,
+ `coalesce_b_b` int(4) unsigned DEFAULT NULL,
+ `if_______b_b` int(4) unsigned DEFAULT NULL,
+ `ifnull___b_b` year(4) DEFAULT NULL,
+ `least____b_b` int(4) unsigned DEFAULT NULL,
+ `greatest_b_b` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` int(10) unsigned DEFAULT NULL,
+ `case_____b_a` int(10) unsigned DEFAULT NULL,
+ `coalesce_a_b` int(10) unsigned DEFAULT NULL,
+ `coalesce_b_a` int(10) unsigned DEFAULT NULL,
+ `if_______a_b` int(10) unsigned DEFAULT NULL,
+ `if_______b_a` int(10) unsigned DEFAULT NULL,
+ `ifnull___a_b` int(10) unsigned DEFAULT NULL,
+ `ifnull___b_a` int(10) unsigned DEFAULT NULL,
+ `least____a_b` int(10) unsigned DEFAULT NULL,
+ `least____b_a` int(10) unsigned DEFAULT NULL,
+ `greatest_a_b` int(10) unsigned DEFAULT NULL,
+ `greatest_b_a` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a DATE, b TIME);
+INSERT INTO t1 VALUES ('2010-01-01','10:20:30');
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 10 10 10 Y 128 0 63
+def case_______a 10 10 10 Y 128 0 63
+def case_____a_a 10 10 10 Y 128 0 63
+def coalesce___a 10 10 10 Y 128 0 63
+def coalesce_a_a 10 10 10 Y 128 0 63
+def if_______a_a 10 10 10 Y 128 0 63
+def ifnull___a_a 10 10 10 Y 128 0 63
+def least____a_a 10 10 10 Y 128 0 63
+def greatest_a_a 10 10 10 Y 128 0 63
+def test t1 t1 b ___________b 11 10 8 Y 128 0 63
+def case_______b 11 10 8 Y 128 0 63
+def case_____b_b 11 10 8 Y 128 0 63
+def coalesce___b 11 10 8 Y 128 0 63
+def coalesce_b_b 11 10 8 Y 128 0 63
+def if_______b_b 11 10 8 Y 128 0 63
+def ifnull___b_b 11 10 8 Y 128 0 63
+def least____b_b 11 10 8 Y 128 0 63
+def greatest_b_b 11 10 8 Y 128 0 63
+___________a 2010-01-01
+case_______a 2010-01-01
+case_____a_a 2010-01-01
+coalesce___a 2010-01-01
+coalesce_a_a 2010-01-01
+if_______a_a 2010-01-01
+ifnull___a_a 2010-01-01
+least____a_a 2010-01-01
+greatest_a_a 2010-01-01
+___________b 10:20:30
+case_______b 10:20:30
+case_____b_b 10:20:30
+coalesce___b 10:20:30
+coalesce_b_b 10:20:30
+if_______b_b 10:20:30
+ifnull___b_b 10:20:30
+least____b_b 10:20:30
+greatest_b_b 10:20:30
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 12 19 19 Y 128 0 63
+def case_____b_a 12 19 19 Y 128 0 63
+def coalesce_a_b 12 19 19 Y 128 0 63
+def coalesce_b_a 12 19 19 Y 128 0 63
+def if_______a_b 12 19 19 Y 128 0 63
+def if_______b_a 12 19 19 Y 128 0 63
+def ifnull___a_b 12 19 19 Y 128 0 63
+def ifnull___b_a 12 19 19 Y 128 0 63
+def least____a_b 12 10 19 Y 128 0 63
+def least____b_a 12 10 19 Y 128 0 63
+def greatest_a_b 12 10 19 Y 128 0 63
+def greatest_b_a 12 10 19 Y 128 0 63
+case_____a_b 2010-01-01 00:00:00
+case_____b_a 2001-01-01 10:20:30
+coalesce_a_b 2010-01-01 00:00:00
+coalesce_b_a 2001-01-01 10:20:30
+if_______a_b 2001-01-01 10:20:30
+if_______b_a 2010-01-01 00:00:00
+ifnull___a_b 2010-01-01 00:00:00
+ifnull___b_a 2001-01-01 10:20:30
+least____a_b 2001-01-01 10:20:30
+least____b_a 2001-01-01 10:20:30
+greatest_a_b 2010-01-01 00:00:00
+greatest_b_a 2010-01-01 00:00:00
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` date DEFAULT NULL,
+ `case_______a` date DEFAULT NULL,
+ `case_____a_a` date DEFAULT NULL,
+ `coalesce___a` date DEFAULT NULL,
+ `coalesce_a_a` date DEFAULT NULL,
+ `if_______a_a` date DEFAULT NULL,
+ `ifnull___a_a` date DEFAULT NULL,
+ `least____a_a` date DEFAULT NULL,
+ `greatest_a_a` date DEFAULT NULL,
+ `___________b` time DEFAULT NULL,
+ `case_______b` time DEFAULT NULL,
+ `case_____b_b` time DEFAULT NULL,
+ `coalesce___b` time DEFAULT NULL,
+ `coalesce_b_b` time DEFAULT NULL,
+ `if_______b_b` time DEFAULT NULL,
+ `ifnull___b_b` time DEFAULT NULL,
+ `least____b_b` time DEFAULT NULL,
+ `greatest_b_b` time DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` datetime DEFAULT NULL,
+ `case_____b_a` datetime DEFAULT NULL,
+ `coalesce_a_b` datetime DEFAULT NULL,
+ `coalesce_b_a` datetime DEFAULT NULL,
+ `if_______a_b` datetime DEFAULT NULL,
+ `if_______b_a` datetime DEFAULT NULL,
+ `ifnull___a_b` datetime DEFAULT NULL,
+ `ifnull___b_a` datetime DEFAULT NULL,
+ `least____a_b` datetime DEFAULT NULL,
+ `least____b_a` datetime DEFAULT NULL,
+ `greatest_a_b` datetime DEFAULT NULL,
+ `greatest_b_a` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a TIMESTAMP, b TIME);
+INSERT INTO t1 VALUES ('2010-01-01 00:00:00','10:20:30');
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 7 19 19 N 9377 0 63
+def case_______a 7 19 19 Y 128 0 63
+def case_____a_a 7 19 19 N 129 0 63
+def coalesce___a 7 19 19 N 129 0 63
+def coalesce_a_a 7 19 19 N 129 0 63
+def if_______a_a 7 19 19 N 129 0 63
+def ifnull___a_a 7 19 19 N 129 0 63
+def least____a_a 7 19 19 N 161 0 63
+def greatest_a_a 7 19 19 N 161 0 63
+def test t1 t1 b ___________b 11 10 8 Y 128 0 63
+def case_______b 11 10 8 Y 128 0 63
+def case_____b_b 11 10 8 Y 128 0 63
+def coalesce___b 11 10 8 Y 128 0 63
+def coalesce_b_b 11 10 8 Y 128 0 63
+def if_______b_b 11 10 8 Y 128 0 63
+def ifnull___b_b 11 10 8 Y 128 0 63
+def least____b_b 11 10 8 Y 128 0 63
+def greatest_b_b 11 10 8 Y 128 0 63
+___________a 2010-01-01 00:00:00
+case_______a 2010-01-01 00:00:00
+case_____a_a 2010-01-01 00:00:00
+coalesce___a 2010-01-01 00:00:00
+coalesce_a_a 2010-01-01 00:00:00
+if_______a_a 2010-01-01 00:00:00
+ifnull___a_a 2010-01-01 00:00:00
+least____a_a 2010-01-01 00:00:00
+greatest_a_a 2010-01-01 00:00:00
+___________b 10:20:30
+case_______b 10:20:30
+case_____b_b 10:20:30
+coalesce___b 10:20:30
+coalesce_b_b 10:20:30
+if_______b_b 10:20:30
+ifnull___b_b 10:20:30
+least____b_b 10:20:30
+greatest_b_b 10:20:30
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 12 19 19 Y 128 0 63
+def case_____b_a 12 19 19 Y 128 0 63
+def coalesce_a_b 12 19 19 Y 128 0 63
+def coalesce_b_a 12 19 19 Y 128 0 63
+def if_______a_b 12 19 19 Y 128 0 63
+def if_______b_a 12 19 19 Y 128 0 63
+def ifnull___a_b 12 19 19 Y 128 0 63
+def ifnull___b_a 12 19 19 N 129 0 63
+def least____a_b 12 19 19 Y 128 0 63
+def least____b_a 12 19 19 Y 128 0 63
+def greatest_a_b 12 19 19 Y 128 0 63
+def greatest_b_a 12 19 19 Y 128 0 63
+case_____a_b 2010-01-01 00:00:00
+case_____b_a 2001-01-01 10:20:30
+coalesce_a_b 2010-01-01 00:00:00
+coalesce_b_a 2001-01-01 10:20:30
+if_______a_b 2001-01-01 10:20:30
+if_______b_a 2010-01-01 00:00:00
+ifnull___a_b 2010-01-01 00:00:00
+ifnull___b_a 2001-01-01 10:20:30
+least____a_b 2001-01-01 10:20:30
+least____b_a 2001-01-01 10:20:30
+greatest_a_b 2010-01-01 00:00:00
+greatest_b_a 2010-01-01 00:00:00
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `case_______a` timestamp NULL DEFAULT NULL,
+ `case_____a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `coalesce___a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `coalesce_a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `if_______a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `ifnull___a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `least____a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `greatest_a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `___________b` time DEFAULT NULL,
+ `case_______b` time DEFAULT NULL,
+ `case_____b_b` time DEFAULT NULL,
+ `coalesce___b` time DEFAULT NULL,
+ `coalesce_b_b` time DEFAULT NULL,
+ `if_______b_b` time DEFAULT NULL,
+ `ifnull___b_b` time DEFAULT NULL,
+ `least____b_b` time DEFAULT NULL,
+ `greatest_b_b` time DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` datetime DEFAULT NULL,
+ `case_____b_a` datetime DEFAULT NULL,
+ `coalesce_a_b` datetime DEFAULT NULL,
+ `coalesce_b_a` datetime DEFAULT NULL,
+ `if_______a_b` datetime DEFAULT NULL,
+ `if_______b_a` datetime DEFAULT NULL,
+ `ifnull___a_b` datetime DEFAULT NULL,
+ `ifnull___b_a` datetime NOT NULL,
+ `least____a_b` datetime DEFAULT NULL,
+ `least____b_a` datetime DEFAULT NULL,
+ `greatest_a_b` datetime DEFAULT NULL,
+ `greatest_b_a` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a DATETIME, b TIME);
+INSERT INTO t1 VALUES ('2010-01-01 00:00:00','10:20:30');
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 12 19 19 Y 128 0 63
+def case_______a 12 19 19 Y 128 0 63
+def case_____a_a 12 19 19 Y 128 0 63
+def coalesce___a 12 19 19 Y 128 0 63
+def coalesce_a_a 12 19 19 Y 128 0 63
+def if_______a_a 12 19 19 Y 128 0 63
+def ifnull___a_a 12 19 19 Y 128 0 63
+def least____a_a 12 19 19 Y 128 0 63
+def greatest_a_a 12 19 19 Y 128 0 63
+def test t1 t1 b ___________b 11 10 8 Y 128 0 63
+def case_______b 11 10 8 Y 128 0 63
+def case_____b_b 11 10 8 Y 128 0 63
+def coalesce___b 11 10 8 Y 128 0 63
+def coalesce_b_b 11 10 8 Y 128 0 63
+def if_______b_b 11 10 8 Y 128 0 63
+def ifnull___b_b 11 10 8 Y 128 0 63
+def least____b_b 11 10 8 Y 128 0 63
+def greatest_b_b 11 10 8 Y 128 0 63
+___________a 2010-01-01 00:00:00
+case_______a 2010-01-01 00:00:00
+case_____a_a 2010-01-01 00:00:00
+coalesce___a 2010-01-01 00:00:00
+coalesce_a_a 2010-01-01 00:00:00
+if_______a_a 2010-01-01 00:00:00
+ifnull___a_a 2010-01-01 00:00:00
+least____a_a 2010-01-01 00:00:00
+greatest_a_a 2010-01-01 00:00:00
+___________b 10:20:30
+case_______b 10:20:30
+case_____b_b 10:20:30
+coalesce___b 10:20:30
+coalesce_b_b 10:20:30
+if_______b_b 10:20:30
+ifnull___b_b 10:20:30
+least____b_b 10:20:30
+greatest_b_b 10:20:30
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 12 19 19 Y 128 0 63
+def case_____b_a 12 19 19 Y 128 0 63
+def coalesce_a_b 12 19 19 Y 128 0 63
+def coalesce_b_a 12 19 19 Y 128 0 63
+def if_______a_b 12 19 19 Y 128 0 63
+def if_______b_a 12 19 19 Y 128 0 63
+def ifnull___a_b 12 19 19 Y 128 0 63
+def ifnull___b_a 12 19 19 Y 128 0 63
+def least____a_b 12 19 19 Y 128 0 63
+def least____b_a 12 19 19 Y 128 0 63
+def greatest_a_b 12 19 19 Y 128 0 63
+def greatest_b_a 12 19 19 Y 128 0 63
+case_____a_b 2010-01-01 00:00:00
+case_____b_a 2001-01-01 10:20:30
+coalesce_a_b 2010-01-01 00:00:00
+coalesce_b_a 2001-01-01 10:20:30
+if_______a_b 2001-01-01 10:20:30
+if_______b_a 2010-01-01 00:00:00
+ifnull___a_b 2010-01-01 00:00:00
+ifnull___b_a 2001-01-01 10:20:30
+least____a_b 2001-01-01 10:20:30
+least____b_a 2001-01-01 10:20:30
+greatest_a_b 2010-01-01 00:00:00
+greatest_b_a 2010-01-01 00:00:00
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` datetime DEFAULT NULL,
+ `case_______a` datetime DEFAULT NULL,
+ `case_____a_a` datetime DEFAULT NULL,
+ `coalesce___a` datetime DEFAULT NULL,
+ `coalesce_a_a` datetime DEFAULT NULL,
+ `if_______a_a` datetime DEFAULT NULL,
+ `ifnull___a_a` datetime DEFAULT NULL,
+ `least____a_a` datetime DEFAULT NULL,
+ `greatest_a_a` datetime DEFAULT NULL,
+ `___________b` time DEFAULT NULL,
+ `case_______b` time DEFAULT NULL,
+ `case_____b_b` time DEFAULT NULL,
+ `coalesce___b` time DEFAULT NULL,
+ `coalesce_b_b` time DEFAULT NULL,
+ `if_______b_b` time DEFAULT NULL,
+ `ifnull___b_b` time DEFAULT NULL,
+ `least____b_b` time DEFAULT NULL,
+ `greatest_b_b` time DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` datetime DEFAULT NULL,
+ `case_____b_a` datetime DEFAULT NULL,
+ `coalesce_a_b` datetime DEFAULT NULL,
+ `coalesce_b_a` datetime DEFAULT NULL,
+ `if_______a_b` datetime DEFAULT NULL,
+ `if_______b_a` datetime DEFAULT NULL,
+ `ifnull___a_b` datetime DEFAULT NULL,
+ `ifnull___b_a` datetime DEFAULT NULL,
+ `least____a_b` datetime DEFAULT NULL,
+ `least____b_a` datetime DEFAULT NULL,
+ `greatest_a_b` datetime DEFAULT NULL,
+ `greatest_b_a` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a DATETIME, b DATE);
+INSERT INTO t1 VALUES ('2010-01-01 10:20:30','2001-01-02');
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 12 19 19 Y 128 0 63
+def case_______a 12 19 19 Y 128 0 63
+def case_____a_a 12 19 19 Y 128 0 63
+def coalesce___a 12 19 19 Y 128 0 63
+def coalesce_a_a 12 19 19 Y 128 0 63
+def if_______a_a 12 19 19 Y 128 0 63
+def ifnull___a_a 12 19 19 Y 128 0 63
+def least____a_a 12 19 19 Y 128 0 63
+def greatest_a_a 12 19 19 Y 128 0 63
+def test t1 t1 b ___________b 10 10 10 Y 128 0 63
+def case_______b 10 10 10 Y 128 0 63
+def case_____b_b 10 10 10 Y 128 0 63
+def coalesce___b 10 10 10 Y 128 0 63
+def coalesce_b_b 10 10 10 Y 128 0 63
+def if_______b_b 10 10 10 Y 128 0 63
+def ifnull___b_b 10 10 10 Y 128 0 63
+def least____b_b 10 10 10 Y 128 0 63
+def greatest_b_b 10 10 10 Y 128 0 63
+___________a 2010-01-01 10:20:30
+case_______a 2010-01-01 10:20:30
+case_____a_a 2010-01-01 10:20:30
+coalesce___a 2010-01-01 10:20:30
+coalesce_a_a 2010-01-01 10:20:30
+if_______a_a 2010-01-01 10:20:30
+ifnull___a_a 2010-01-01 10:20:30
+least____a_a 2010-01-01 10:20:30
+greatest_a_a 2010-01-01 10:20:30
+___________b 2001-01-02
+case_______b 2001-01-02
+case_____b_b 2001-01-02
+coalesce___b 2001-01-02
+coalesce_b_b 2001-01-02
+if_______b_b 2001-01-02
+ifnull___b_b 2001-01-02
+least____b_b 2001-01-02
+greatest_b_b 2001-01-02
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 12 19 19 Y 128 0 63
+def case_____b_a 12 19 19 Y 128 0 63
+def coalesce_a_b 12 19 19 Y 128 0 63
+def coalesce_b_a 12 19 19 Y 128 0 63
+def if_______a_b 12 19 19 Y 128 0 63
+def if_______b_a 12 19 19 Y 128 0 63
+def ifnull___a_b 12 19 19 Y 128 0 63
+def ifnull___b_a 12 19 19 Y 128 0 63
+def least____a_b 12 19 19 Y 128 0 63
+def least____b_a 12 19 19 Y 128 0 63
+def greatest_a_b 12 19 19 Y 128 0 63
+def greatest_b_a 12 19 19 Y 128 0 63
+case_____a_b 2010-01-01 10:20:30
+case_____b_a 2001-01-02 00:00:00
+coalesce_a_b 2010-01-01 10:20:30
+coalesce_b_a 2001-01-02 00:00:00
+if_______a_b 2001-01-02 00:00:00
+if_______b_a 2010-01-01 10:20:30
+ifnull___a_b 2010-01-01 10:20:30
+ifnull___b_a 2001-01-02 00:00:00
+least____a_b 2001-01-02 00:00:00
+least____b_a 2001-01-02 00:00:00
+greatest_a_b 2010-01-01 10:20:30
+greatest_b_a 2010-01-01 10:20:30
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` datetime DEFAULT NULL,
+ `case_______a` datetime DEFAULT NULL,
+ `case_____a_a` datetime DEFAULT NULL,
+ `coalesce___a` datetime DEFAULT NULL,
+ `coalesce_a_a` datetime DEFAULT NULL,
+ `if_______a_a` datetime DEFAULT NULL,
+ `ifnull___a_a` datetime DEFAULT NULL,
+ `least____a_a` datetime DEFAULT NULL,
+ `greatest_a_a` datetime DEFAULT NULL,
+ `___________b` date DEFAULT NULL,
+ `case_______b` date DEFAULT NULL,
+ `case_____b_b` date DEFAULT NULL,
+ `coalesce___b` date DEFAULT NULL,
+ `coalesce_b_b` date DEFAULT NULL,
+ `if_______b_b` date DEFAULT NULL,
+ `ifnull___b_b` date DEFAULT NULL,
+ `least____b_b` date DEFAULT NULL,
+ `greatest_b_b` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` datetime DEFAULT NULL,
+ `case_____b_a` datetime DEFAULT NULL,
+ `coalesce_a_b` datetime DEFAULT NULL,
+ `coalesce_b_a` datetime DEFAULT NULL,
+ `if_______a_b` datetime DEFAULT NULL,
+ `if_______b_a` datetime DEFAULT NULL,
+ `ifnull___a_b` datetime DEFAULT NULL,
+ `ifnull___b_a` datetime DEFAULT NULL,
+ `least____a_b` datetime DEFAULT NULL,
+ `least____b_a` datetime DEFAULT NULL,
+ `greatest_a_b` datetime DEFAULT NULL,
+ `greatest_b_a` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+# MDEV-8873 Wrong field type or metadata for LEAST(int_column,string_column)
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (-2147483648,'100x');
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a ___________a 3 11 11 Y 32768 0 63
+def case_______a 3 11 11 Y 32896 0 63
+def case_____a_a 3 11 11 Y 32896 0 63
+def coalesce___a 3 11 11 Y 32896 0 63
+def coalesce_a_a 3 11 11 Y 32896 0 63
+def if_______a_a 3 11 11 Y 32896 0 63
+def ifnull___a_a 3 11 11 Y 32896 0 63
+def least____a_a 3 11 11 Y 32896 0 63
+def greatest_a_a 3 11 11 Y 32896 0 63
+def test t1 t1 b ___________b 253 10 4 Y 0 0 8
+def case_______b 253 10 4 Y 0 31 8
+def case_____b_b 253 10 4 Y 0 31 8
+def coalesce___b 253 10 4 Y 0 31 8
+def coalesce_b_b 253 10 4 Y 0 31 8
+def if_______b_b 253 10 4 Y 0 31 8
+def ifnull___b_b 253 10 4 Y 0 31 8
+def least____b_b 253 10 4 Y 0 31 8
+def greatest_b_b 253 10 4 Y 0 31 8
+___________a -2147483648
+case_______a -2147483648
+case_____a_a -2147483648
+coalesce___a -2147483648
+coalesce_a_a -2147483648
+if_______a_a -2147483648
+ifnull___a_a -2147483648
+least____a_a -2147483648
+greatest_a_a -2147483648
+___________b 100x
+case_______b 100x
+case_____b_b 100x
+coalesce___b 100x
+coalesce_b_b 100x
+if_______b_b 100x
+ifnull___b_b 100x
+least____b_b 100x
+greatest_b_b 100x
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def case_____a_b 253 11 11 Y 0 31 8
+def case_____b_a 253 11 4 Y 0 31 8
+def coalesce_a_b 253 11 11 Y 0 31 8
+def coalesce_b_a 253 11 4 Y 0 31 8
+def if_______a_b 253 11 4 Y 0 31 8
+def if_______b_a 253 11 11 Y 0 31 8
+def ifnull___a_b 253 11 11 Y 0 31 8
+def ifnull___b_a 253 11 4 Y 0 31 8
+def least____a_b 5 23 11 Y 32896 31 63
+def least____b_a 5 23 11 Y 32896 31 63
+def greatest_a_b 5 23 3 Y 32896 31 63
+def greatest_b_a 5 23 3 Y 32896 31 63
+case_____a_b -2147483648
+case_____b_a 100x
+coalesce_a_b -2147483648
+coalesce_b_a 100x
+if_______a_b 100x
+if_______b_a -2147483648
+ifnull___a_b -2147483648
+ifnull___b_a 100x
+least____a_b -2147483648
+least____b_a -2147483648
+greatest_a_b 100
+greatest_b_a 100
+Warnings:
+Level Warning
+Code 1292
+Message Truncated incorrect DOUBLE value: '100x'
+Level Warning
+Code 1292
+Message Truncated incorrect DOUBLE value: '100x'
+Level Warning
+Code 1292
+Message Truncated incorrect DOUBLE value: '100x'
+Level Warning
+Code 1292
+Message Truncated incorrect DOUBLE value: '100x'
+CREATE TABLE t2 AS
+SELECT
+a AS ___________a,
+CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+COALESCE(a) AS coalesce___a,
+COALESCE(a, a) AS coalesce_a_a,
+IF(a IS NULL, a, a) AS if_______a_a,
+IFNULL(a, a) AS ifnull___a_a,
+LEAST(a, a) AS least____a_a,
+GREATEST(a, a) AS greatest_a_a,
+b AS ___________b,
+CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+COALESCE(b) AS coalesce___b,
+COALESCE(b, b) AS coalesce_b_b,
+IF(a IS NULL, b, b) AS if_______b_b,
+IFNULL(b, b) AS ifnull___b_b,
+LEAST(b, b) AS least____b_b,
+GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `___________a` int(11) DEFAULT NULL,
+ `case_______a` int(11) DEFAULT NULL,
+ `case_____a_a` int(11) DEFAULT NULL,
+ `coalesce___a` int(11) DEFAULT NULL,
+ `coalesce_a_a` int(11) DEFAULT NULL,
+ `if_______a_a` int(11) DEFAULT NULL,
+ `ifnull___a_a` int(11) DEFAULT NULL,
+ `least____a_a` int(11) DEFAULT NULL,
+ `greatest_a_a` int(11) DEFAULT NULL,
+ `___________b` varchar(10) DEFAULT NULL,
+ `case_______b` varchar(10) DEFAULT NULL,
+ `case_____b_b` varchar(10) DEFAULT NULL,
+ `coalesce___b` varchar(10) DEFAULT NULL,
+ `coalesce_b_b` varchar(10) DEFAULT NULL,
+ `if_______b_b` varchar(10) DEFAULT NULL,
+ `ifnull___b_b` varchar(10) DEFAULT NULL,
+ `least____b_b` varchar(10) DEFAULT NULL,
+ `greatest_b_b` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+COALESCE(a, b) AS coalesce_a_b,
+COALESCE(b, a) AS coalesce_b_a,
+IF(a IS NULL, a, b) AS if_______a_b,
+IF(a IS NULL, b, a) AS if_______b_a,
+IFNULL(a, b) AS ifnull___a_b,
+IFNULL(b, a) AS ifnull___b_a,
+LEAST(a, b) AS least____a_b,
+LEAST(b, a) AS least____b_a,
+GREATEST(a, b) AS greatest_a_b,
+GREATEST(b, a) AS greatest_b_a
+FROM t1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '100x'
+Warning 1292 Truncated incorrect DOUBLE value: '100x'
+Warning 1292 Truncated incorrect DOUBLE value: '100x'
+Warning 1292 Truncated incorrect DOUBLE value: '100x'
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `case_____a_b` varchar(11) DEFAULT NULL,
+ `case_____b_a` varchar(11) DEFAULT NULL,
+ `coalesce_a_b` varchar(11) DEFAULT NULL,
+ `coalesce_b_a` varchar(11) DEFAULT NULL,
+ `if_______a_b` varchar(11) DEFAULT NULL,
+ `if_______b_a` varchar(11) DEFAULT NULL,
+ `ifnull___a_b` varchar(11) DEFAULT NULL,
+ `ifnull___b_a` varchar(11) DEFAULT NULL,
+ `least____a_b` double DEFAULT NULL,
+ `least____b_a` double DEFAULT NULL,
+ `greatest_a_b` double DEFAULT NULL,
+ `greatest_b_a` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# MDEV-4848 Wrong metadata or column type for LEAST(1.0,'10')
+#
+SELECT LEAST(1.0,'10');
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def LEAST(1.0,'10') 5 23 1 N 32897 31 63
+LEAST(1.0,'10')
+1
+CREATE TABLE t1 AS SELECT LEAST(1.0,'10');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `LEAST(1.0,'10')` double NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# MDEV-657 LP:873142 - GREATEST() does not always return same signness of argument types
+#
+CREATE TABLE t1 (a BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY);
+INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
+INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
+SELECT * FROM t1;
+a
+13836376518955650385
+DROP TABLE t1;
+#
+# MDEV-5694 GREATEST(date, time) returns a wrong data type
+#
+SET timestamp=UNIX_TIMESTAMP('2010-01-01 01:02:03');
+SELECT GREATEST(CURRENT_TIME, CURRENT_DATE), COALESCE(CURRENT_TIME, CURRENT_DATE);
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def GREATEST(CURRENT_TIME, CURRENT_DATE) 12 10 19 N 129 0 63
+def COALESCE(CURRENT_TIME, CURRENT_DATE) 12 19 19 N 129 0 63
+GREATEST(CURRENT_TIME, CURRENT_DATE) COALESCE(CURRENT_TIME, CURRENT_DATE)
+2010-01-01 01:02:03 2010-01-01 01:02:03
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES ('2010-01-01 10:20:30');
+SELECT GREATEST(a,a) FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def GREATEST(a,a) 7 19 19 N 161 0 63
+GREATEST(a,a)
+2010-01-01 10:20:30
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP, b DATETIME);
+CREATE TABLE t2 AS SELECT LEAST(a,a),LEAST(b,b),LEAST(a,b) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `LEAST(a,a)` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `LEAST(b,b)` datetime DEFAULT NULL,
+ `LEAST(a,b)` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+# MDEV-8910 Wrong metadata or field type for MAX(COALESCE(string_field))
+#
+CREATE TABLE t1 (c1 TINYBLOB, c2 MEDIUMBLOB, c3 BLOB, c4 LONGBLOB);
+CREATE TABLE t2 AS
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2,
+MAX(COALESCE(c3)) AS c3,
+MAX(COALESCE(c4)) AS c4
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varbinary(255) DEFAULT NULL,
+ `c2` mediumblob,
+ `c3` blob,
+ `c4` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2,
+MAX(COALESCE(c3)) AS c3,
+MAX(COALESCE(c4)) AS c4
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 255 0 Y 128 31 63
+def c2 250 16777215 0 Y 128 31 63
+def c3 252 65535 0 Y 128 31 63
+def c4 251 4294967295 0 Y 128 31 63
+c1 c2 c3 c4
+NULL NULL NULL NULL
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) DEFAULT NULL,
+ `c2` varchar(255) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+c1 c2
+NULL NULL
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
+ `c2` varchar(255) CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+c1 c2
+NULL NULL
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2,
+MAX(COALESCE(c3)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) DEFAULT NULL,
+ `c2` varchar(255) DEFAULT NULL,
+ `c3` text
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2,
+MAX(COALESCE(c3)) AS c3
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+def c3 252 20000 0 Y 0 31 8
+c1 c2 c3
+NULL NULL NULL
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2,
+MAX(COALESCE(c3)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
+ `c2` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
+ `c3` text CHARACTER SET utf8
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+MAX(COALESCE(c1)) AS c1,
+MAX(COALESCE(c2)) AS c2,
+MAX(COALESCE(c3)) AS c3
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+def c3 252 60000 0 Y 0 31 8
+c1 c2 c3
+NULL NULL NULL
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+MAX(COALESCE(c1)) AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+MAX(COALESCE(c1)) AS c1
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+c1
+NULL
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+MAX(COALESCE(c1)) AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+MAX(COALESCE(c1)) AS c1
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+c1
+NULL
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# MDEV-8912 Wrong metadata or type for @c:=string_or_blob_field
+#
+CREATE TABLE t1 (c1 TINYBLOB, c2 BLOB, c3 MEDIUMBLOB, c4 LONGBLOB);
+CREATE TABLE t2 AS
+SELECT
+@c1:=c1 AS c1,
+@c2:=c2 AS c2,
+@c3:=c3 AS c3,
+@c4:=c4 AS c4
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varbinary(255) DEFAULT NULL,
+ `c2` blob,
+ `c3` mediumblob,
+ `c4` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+@c1:=c1 AS c1,
+@c2:=c2 AS c2,
+@c3:=c3 AS c3,
+@c4:=c4 AS c4
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 255 0 Y 128 31 63
+def c2 252 65535 0 Y 128 31 63
+def c3 250 16777215 0 Y 128 31 63
+def c4 251 4294967295 0 Y 128 31 63
+c1 c2 c3 c4
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+@c1:=c1 AS c1,
+@c2:=c2 AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) DEFAULT NULL,
+ `c2` varchar(255) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+@c1:=c1 AS c1,
+@c2:=c2 AS c2
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+c1 c2
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+@c1:=c1 AS c1,
+@c2:=c2 AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
+ `c2` varchar(255) CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+@c1:=c1 AS c1,
+@c2:=c2 AS c2
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+c1 c2
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+@c:=c1 AS c1,
+@c:=c2 AS c2,
+@c:=c3 AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) DEFAULT NULL,
+ `c2` varchar(255) DEFAULT NULL,
+ `c3` text
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+@c:=c1 AS c1,
+@c:=c2 AS c2,
+@c:=c3 AS c3
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+def c3 252 20000 0 Y 0 31 8
+c1 c2 c3
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+@c:=c1 AS c1,
+@c:=c2 AS c2,
+@c:=c3 AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
+ `c2` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
+ `c3` text CHARACTER SET utf8
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+@c:=c1 AS c1,
+@c:=c2 AS c2,
+@c:=c3 AS c3
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 31 8
+def c2 253 255 0 Y 0 31 8
+def c3 252 60000 0 Y 0 31 8
+c1 c2 c3
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+@c:=c1 AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+@c:=c1 AS c1
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 0 8
+c1
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+@c:=c1 AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+@c:=c1 AS c1
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c1 253 1 0 Y 0 0 8
+c1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+#
+SELECT CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END;
+CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END
+NULL
+SELECT CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END;
+CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END
+NULL
+SELECT CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END;
+CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END
+NULL
+SELECT COALESCE(COALESCE(NULL), 1.1) AS c0, IF(0, COALESCE(NULL), 1.1) AS c1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c0 246 4 3 Y 32896 1 63
+def c1 246 4 3 Y 32896 1 63
+c0 c1
+1.1 1.1
+#
+# MDEV-9752 Wrong data type for COALEASCE(?,1) in prepared statements
+#
+PREPARE stmt FROM "CREATE TABLE t1 AS SELECT CONCAT(COALESCE(?,1)) AS a, CONCAT(CASE WHEN TRUE THEN ? ELSE 1 END) AS b";
+SET @a=1;
+EXECUTE stmt USING @a,@a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(21) DEFAULT NULL,
+ `b` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index 61f63cc7253..637fd8cd2a2 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -240,10 +240,7 @@ End of 5.2 tests
#
CREATE TABLE `t1` (
`datas` VARCHAR(25) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+) DEFAULT CHARSET=utf8;
INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4');
SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`;
First Second Third
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index c574244c2b4..c80ea5d13e1 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -271,7 +271,7 @@ select * from t2 where a NOT IN (
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range a a 9 NULL 18 Using index condition
+1 SIMPLE t2 range a a 6 NULL 12 Using index condition
select * from t2 where a NOT IN (
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
@@ -701,11 +701,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 WHERE c_datetime
IN ('2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using index condition
+1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition
EXPLAIN SELECT * FROM t1 WHERE c_datetime
IN (NULL, '2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using index condition
+1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition
EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@@ -811,7 +811,9 @@ PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @:= (1 IN (SELECT 1 FROM
EXECUTE s;
1
DROP TABLE t1;
+#
# End of 5.3 tests
+#
create table t1 (a int);
insert t1 values (1),(2),(3);
select * from t1 where 1 in (a, name_const('a', null));
@@ -819,7 +821,7 @@ a
1
drop table t1;
#
-# Start of 10.0 tests
+# End of 5.5 tests
#
#
# MDEV-10020 InnoDB NOT IN Query Crash When One Item Is NULL
@@ -837,3 +839,27 @@ DROP TABLE t1;
#
# End of 10.0 tests
#
+#
+# MDEV-8755 Equal field propagation is not performed any longer for the IN list when multiple comparison types
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+# Ok to propagate equalities into the left IN argument in case of a single comparison type
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a IN (1,2,3);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 1)
+# Ok to propagate equalities into IN () list, even if multiple comparison types
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND 1 IN (1,a,'3');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 1)
+# Not Ok to propagate equalities into the left IN argument in case of multiple comparison types
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a IN (1,2,'3');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and (`test`.`t1`.`a` in (1,2,'3')))
+DROP TABLE t1;
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index 8d72b818cf8..9c8e9727d16 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -200,3 +200,57 @@ SELECT 'a' LIKE REPEAT('',0);
SELECT 'a' LIKE EXTRACTVALUE('bar','qux');
'a' LIKE EXTRACTVALUE('bar','qux')
0
+#
+# End of 10.0 tests
+#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8257 Erroneous "Impossible where" when mixing decimal comparison and LIKE
+#
+CREATE TABLE t1 (a DECIMAL(8,2));
+INSERT INTO t1 VALUES (10),(20);
+SELECT * FROM t1 WHERE a=10.0;
+a
+10.00
+SELECT * FROM t1 WHERE a LIKE 10.00;
+a
+10.00
+SELECT * FROM t1 WHERE a=10.0 AND a LIKE 10.00;
+a
+10.00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10.0 AND a LIKE 10.00;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 10.0) and (`test`.`t1`.`a` like 10.00))
+DROP TABLE t1;
+#
+# MDEV-8599 "WHERE varchar_field LIKE temporal_const" does not use range optimizer
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('00:00:00');
+INSERT INTO t1 VALUES ('00:00:01');
+INSERT INTO t1 VALUES ('00:00:02');
+INSERT INTO t1 VALUES ('00:00:03');
+INSERT INTO t1 VALUES ('00:00:04');
+INSERT INTO t1 VALUES ('00:00:05');
+INSERT INTO t1 VALUES ('00:00:06');
+INSERT INTO t1 VALUES ('00:00:07');
+EXPLAIN SELECT * FROM t1 WHERE a LIKE '00:00:00';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 13 NULL 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a LIKE TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 13 NULL 1 Using where; Using index
+SELECT * FROM t1 WHERE a LIKE '00:00:00';
+a
+00:00:00
+SELECT * FROM t1 WHERE a LIKE TIME'00:00:00';
+a
+00:00:00
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 32352dddd86..f694d25cb04 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -165,7 +165,7 @@ create table t1 select round(1, 6);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `round(1, 6)` int(1) NOT NULL DEFAULT '0'
+ `round(1, 6)` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
round(1, 6)
@@ -214,7 +214,9 @@ CAST(RAND(2) * 1000 AS UNSIGNED) CAST(RAND(?) * 1000 AS UNSIGNED)
122 122
645 645
DROP TABLE t1;
+set sql_mode="";
create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
+set sql_mode=default;
insert into t1 values ('http://www.foo.com/', now());
select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
a
@@ -474,8 +476,13 @@ CREATE TABLE t1(f1 LONGTEXT) engine=myisam;
INSERT INTO t1 VALUES ('a');
SELECT 1 FROM (SELECT ROUND(f1) AS a FROM t1) AS s WHERE a LIKE 'a';
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM (SELECT ROUND(f1, f1) AS a FROM t1) AS s WHERE a LIKE 'a';
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect INTEGER value: 'a'
DROP TABLE t1;
End of 5.0 tests
SELECT 1e308 + 1e308;
@@ -700,6 +707,9 @@ SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
as foo;
foo
2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '53064635.445796e3130837'
+Warning 1292 Truncated incorrect DOUBLE value: '179,769,313,486,231,570,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,'
#
# Bug #58137 char(0) column cause:
# my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index d54a70cab45..545d515176d 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -100,8 +100,8 @@ create table t1 as select uuid(), length(uuid());
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `uuid()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `length(uuid())` int(10) NOT NULL DEFAULT '0'
+ `uuid()` varchar(36) CHARACTER SET utf8 NOT NULL,
+ `length(uuid())` int(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select INET_ATON('255.255.0.1') as `a`;
@@ -295,6 +295,8 @@ INSERT INTO t1 VALUES ('', 0);
SELECT COALESCE(a) = COALESCE(b) FROM t1;
COALESCE(a) = COALESCE(b)
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
DROP TABLE t1;
#
# Bug #54461: crash with longblob and union or update with subquery
@@ -334,10 +336,7 @@ CREATE TABLE t1 (a char(2) not null );
INSERT INTO t1 VALUES (4),(7),(1);
set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='materialization=off';
-CREATE TABLE tv (e char(2) not null ) engine=mysql;
-Warnings:
-Warning 1286 Unknown storage engine 'mysql'
-Warning 1266 Using storage engine MyISAM for table 'tv'
+CREATE TABLE tv (e char(2) not null );
INSERT INTO tv VALUES (1);
CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv;
CREATE ALGORITHM=MERGE VIEW vm AS SELECT * FROM tv;
@@ -1387,6 +1386,46 @@ INET6_NTOA(ip) HEX(ip) LENGTH(ip)
DROP TABLE t1;
DROP TABLE t2;
+#
+# MDEV-4018 : Microseconds in GET_LOCK()
+#
+# -> Switching to connection 'default'
+select is_used_lock('test') = connection_id();
+is_used_lock('test') = connection_id()
+NULL
+# GET_LOCK returns 1 if it manages to acquire a lock
+select get_lock('test', 0);
+get_lock('test', 0)
+1
+# -> Switching to connection 'con1'
+select is_used_lock('test') = connection_id();
+is_used_lock('test') = connection_id()
+0
+select get_lock('test', 0);
+get_lock('test', 0)
+0
+select get_lock('test', 1.0);
+get_lock('test', 1.0)
+0
+select get_lock('test', 1.5);
+get_lock('test', 1.5)
+0
+select get_lock('test', 0.1);
+get_lock('test', 0.1)
+0
+select get_lock('test', 0.000001);
+get_lock('test', 0.000001)
+0
+select get_lock('test', 0.0000000000000001);
+get_lock('test', 0.0000000000000001)
+0
+# -> Switching to connection 'default'
+select is_used_lock('test') = connection_id();
+is_used_lock('test') = connection_id()
+1
+select release_lock('test');
+release_lock('test')
+1
# -- Done.
diff --git a/mysql-test/r/func_regexp_pcre.result b/mysql-test/r/func_regexp_pcre.result
index d7d57356fe2..cda1c2e7e69 100644
--- a/mysql-test/r/func_regexp_pcre.result
+++ b/mysql-test/r/func_regexp_pcre.result
@@ -445,10 +445,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select regexp_replace('abc','b','x') AS `REGEXP_REPLACE('abc','b','x')`
CREATE TABLE t1 AS SELECT REGEXP_REPLACE('abc','b','x')+0;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'axc'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `REGEXP_REPLACE('abc','b','x')+0` double NOT NULL DEFAULT '0'
+ `REGEXP_REPLACE('abc','b','x')+0` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT REGEXP_REPLACE(NULL,'b','c');
@@ -736,7 +738,7 @@ CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `REGEXP_SUBSTR('abc','b')` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `REGEXP_SUBSTR('abc','b')` varchar(3) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
EXPLAIN EXTENDED SELECT REGEXP_SUBSTR('abc','b');
@@ -745,10 +747,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select regexp_substr('abc','b') AS `REGEXP_SUBSTR('abc','b')`
CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b')+0;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `REGEXP_SUBSTR('abc','b')+0` double NOT NULL DEFAULT '0'
+ `REGEXP_SUBSTR('abc','b')+0` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT REGEXP_SUBSTR('See https://mariadb.org/en/foundation/ for details', 'https?://[^/]*');
@@ -879,35 +883,44 @@ SELECT 1 FROM dual WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,
1
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
-SELECT CONCAT(REPEAT('100,',190),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
-CONCAT(REPEAT('100,',190),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
+SELECT CONCAT(REPEAT('100,',60),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
+CONCAT(REPEAT('100,',60),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
1
-SELECT CONCAT(REPEAT('100,',600),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
-CONCAT(REPEAT('100,',600),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
+SELECT CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
+CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
-SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',190),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
-REGEXP_INSTR(CONCAT(REPEAT('100,',190),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
+SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
+REGEXP_INSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
1
-SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',600),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
-REGEXP_INSTR(CONCAT(REPEAT('100,',600),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
+SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
+REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
-SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',190/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
-LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',190/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
-255
-SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',600/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
-LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',600/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
+SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
+LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
+243
+SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
+LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
-SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',190/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
-LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',190/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
+SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
+LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
0
-SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',600/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
-LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',600/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
+SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
+LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
803
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
+SELECT REGEXP_INSTR('a_kollision', 'oll');
+REGEXP_INSTR('a_kollision', 'oll')
+4
+SELECT REGEXP_INSTR('a_kollision', '(oll)');
+REGEXP_INSTR('a_kollision', '(oll)')
+4
+SELECT REGEXP_INSTR('a_kollision', 'o([lm])\\1');
+REGEXP_INSTR('a_kollision', 'o([lm])\\1')
+4
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index 2c531ac4d78..23931bde1b5 100644
--- a/mysql-test/r/func_set.result
+++ b/mysql-test/r/func_set.result
@@ -172,8 +172,8 @@ INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 )
8
8
Warnings:
-Warning 1292 Incorrect datetime value: '10'
-Warning 1292 Incorrect datetime value: '11'
+Warning 1292 Incorrect datetime value: '10' for column 'pk' at row 1
+Warning 1292 Incorrect datetime value: '11' for column 'pk' at row 2
DROP TABLE t1;
#
# End of 5.3 tests
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 9a9b9f0d73d..3c84134d450 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1,4 +1,5 @@
drop table if exists t1,t2;
+set global max_allowed_packet=1048576;
set names latin1;
select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
@@ -264,6 +265,9 @@ NULL
select aes_decrypt(aes_encrypt("","a"),"a");
aes_decrypt(aes_encrypt("","a"),"a")
+select aes_decrypt("", "a");
+aes_decrypt("", "a")
+NULL
select repeat('monty',5),concat('*',space(5),'*');
repeat('monty',5) concat('*',space(5),'*')
montymontymontymontymonty * *
@@ -723,34 +727,34 @@ t1 CREATE TABLE `t1` (
`bin(130)` varchar(64) DEFAULT NULL,
`oct(130)` varchar(64) DEFAULT NULL,
`conv(130,16,10)` varchar(64) DEFAULT NULL,
- `hex(130)` varchar(6) NOT NULL DEFAULT '',
- `char(130)` varbinary(4) NOT NULL DEFAULT '',
- `format(130,10)` varchar(37) NOT NULL DEFAULT '',
- `left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `ucase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `substring(_latin2'a',1,1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `concat(_latin2'a',_latin2'b')` varchar(2) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `lpad(_latin2'a',4,_latin2'b')` varchar(4) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `rpad(_latin2'a',4,_latin2'b')` varchar(4) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `concat_ws(_latin2'a',_latin2'b')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `make_set(255,_latin2'a',_latin2'b',_latin2'c')` varchar(5) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `export_set(255,_latin2'y',_latin2'n',_latin2' ')` varchar(127) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `trim(_latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `ltrim(_latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `rtrim(_latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `trim(LEADING _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `trim(TRAILING _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `trim(BOTH _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `repeat(_latin2'a',10)` varchar(10) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `reverse(_latin2'ab')` varchar(2) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `quote(_latin2'ab')` varchar(6) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `soundex(_latin2'ab')` varchar(4) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `substring(_latin2'ab',1)` varchar(2) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `insert(_latin2'abcd',2,3,_latin2'ef')` varchar(6) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `replace(_latin2'abcd',_latin2'b',_latin2'B')` varchar(4) CHARACTER SET latin2 NOT NULL DEFAULT '',
- `encode('abcd','ab')` varbinary(4) NOT NULL DEFAULT ''
+ `hex(130)` varchar(6) NOT NULL,
+ `char(130)` varbinary(4) NOT NULL,
+ `format(130,10)` varchar(37) NOT NULL,
+ `left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL,
+ `right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL,
+ `lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL,
+ `ucase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL,
+ `substring(_latin2'a',1,1)` varchar(1) CHARACTER SET latin2 NOT NULL,
+ `concat(_latin2'a',_latin2'b')` varchar(2) CHARACTER SET latin2 NOT NULL,
+ `lpad(_latin2'a',4,_latin2'b')` varchar(4) CHARACTER SET latin2 NOT NULL,
+ `rpad(_latin2'a',4,_latin2'b')` varchar(4) CHARACTER SET latin2 NOT NULL,
+ `concat_ws(_latin2'a',_latin2'b')` varchar(1) CHARACTER SET latin2 NOT NULL,
+ `make_set(255,_latin2'a',_latin2'b',_latin2'c')` varchar(5) CHARACTER SET latin2 NOT NULL,
+ `export_set(255,_latin2'y',_latin2'n',_latin2' ')` varchar(127) CHARACTER SET latin2 NOT NULL,
+ `trim(_latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL,
+ `ltrim(_latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL,
+ `rtrim(_latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL,
+ `trim(LEADING _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL,
+ `trim(TRAILING _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL,
+ `trim(BOTH _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 NOT NULL,
+ `repeat(_latin2'a',10)` varchar(10) CHARACTER SET latin2 NOT NULL,
+ `reverse(_latin2'ab')` varchar(2) CHARACTER SET latin2 NOT NULL,
+ `quote(_latin2'ab')` varchar(6) CHARACTER SET latin2 NOT NULL,
+ `soundex(_latin2'ab')` varchar(4) CHARACTER SET latin2 NOT NULL,
+ `substring(_latin2'ab',1)` varchar(2) CHARACTER SET latin2 NOT NULL,
+ `insert(_latin2'abcd',2,3,_latin2'ef')` varchar(6) CHARACTER SET latin2 NOT NULL,
+ `replace(_latin2'abcd',_latin2'b',_latin2'B')` varchar(4) CHARACTER SET latin2 NOT NULL,
+ `encode('abcd','ab')` varbinary(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a char character set latin2);
@@ -1156,6 +1160,8 @@ Warning 1292 Truncated incorrect DOUBLE value: 'notnumber'
SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
str num
notnumber 0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'notnum'
DROP TABLE t1,t2;
CREATE TABLE t1(
id int(11) NOT NULL auto_increment,
@@ -1348,6 +1354,8 @@ cast(rtrim(' 20.06 ') as decimal(19,2))
select cast(ltrim(' 20.06 ') as decimal(19,2));
cast(ltrim(' 20.06 ') as decimal(19,2))
20.06
+Warnings:
+Note 1292 Truncated incorrect DECIMAL value: '20.06 '
select cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2));
cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2))
20.06
@@ -2845,7 +2853,7 @@ CREATE TABLE t1 AS SELECT format(123,2,'no_NO');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `format(123,2,'no_NO')` varchar(37) NOT NULL DEFAULT ''
+ `format(123,2,'no_NO')` varchar(37) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t1;
format(123,2,'no_NO')
@@ -2889,6 +2897,8 @@ NULL
SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)))
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
((0xf3) * (rpad(1.0,2048,1)) << (0xcc))
0
@@ -2909,7 +2919,7 @@ format(rpad('111111111.1',
1111111,
'999999999999999999999999999999999999999999'),0,'be_BY')
;
-DO
+SELECT
round(
concat( (
coalesce( (
@@ -2924,9 +2934,14 @@ sha1('P'),
)
)
)
-);
+) AS r;
+r
+0
Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '511993d3c99719e38a6779073019dacd7178ddb9'
Warning 1292 Truncated incorrect DECIMAL value: '[.DC2.]'
+Warning 1292 Truncated incorrect INTEGER value: '511993d3c99719e38a6779073019dacd7178ddb9'
+Warning 1292 Truncated incorrect DOUBLE value: '0.000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'
SET @@global.max_allowed_packet:= @tmp_max;
SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
@@ -2977,7 +2992,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',63)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(85) NOT NULL DEFAULT ''
+ `to_base64` varchar(85) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -2999,7 +3014,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',62)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(85) NOT NULL DEFAULT ''
+ `to_base64` varchar(85) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3021,7 +3036,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',61)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(85) NOT NULL DEFAULT ''
+ `to_base64` varchar(85) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3043,7 +3058,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',60)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(81) NOT NULL DEFAULT ''
+ `to_base64` varchar(81) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3065,7 +3080,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',59)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(81) NOT NULL DEFAULT ''
+ `to_base64` varchar(81) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3087,7 +3102,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',58)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(81) NOT NULL DEFAULT ''
+ `to_base64` varchar(81) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3109,7 +3124,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',57)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(76) NOT NULL DEFAULT ''
+ `to_base64` varchar(76) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3130,7 +3145,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',56)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(76) NOT NULL DEFAULT ''
+ `to_base64` varchar(76) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3151,7 +3166,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',55)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(76) NOT NULL DEFAULT ''
+ `to_base64` varchar(76) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3172,7 +3187,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',54)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(72) NOT NULL DEFAULT ''
+ `to_base64` varchar(72) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3193,7 +3208,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',53)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(72) NOT NULL DEFAULT ''
+ `to_base64` varchar(72) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3214,7 +3229,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',52)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(72) NOT NULL DEFAULT ''
+ `to_base64` varchar(72) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3235,7 +3250,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',51)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(68) NOT NULL DEFAULT ''
+ `to_base64` varchar(68) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3256,7 +3271,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',50)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(68) NOT NULL DEFAULT ''
+ `to_base64` varchar(68) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3277,7 +3292,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',49)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(68) NOT NULL DEFAULT ''
+ `to_base64` varchar(68) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3298,7 +3313,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',48)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(64) NOT NULL DEFAULT ''
+ `to_base64` varchar(64) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3319,7 +3334,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',47)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(64) NOT NULL DEFAULT ''
+ `to_base64` varchar(64) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3340,7 +3355,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',46)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(64) NOT NULL DEFAULT ''
+ `to_base64` varchar(64) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3361,7 +3376,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',45)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(60) NOT NULL DEFAULT ''
+ `to_base64` varchar(60) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3382,7 +3397,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',44)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(60) NOT NULL DEFAULT ''
+ `to_base64` varchar(60) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3403,7 +3418,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',43)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(60) NOT NULL DEFAULT ''
+ `to_base64` varchar(60) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3424,7 +3439,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',42)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(56) NOT NULL DEFAULT ''
+ `to_base64` varchar(56) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3445,7 +3460,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',41)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(56) NOT NULL DEFAULT ''
+ `to_base64` varchar(56) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3466,7 +3481,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',40)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(56) NOT NULL DEFAULT ''
+ `to_base64` varchar(56) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3487,7 +3502,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',39)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(52) NOT NULL DEFAULT ''
+ `to_base64` varchar(52) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3508,7 +3523,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',38)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(52) NOT NULL DEFAULT ''
+ `to_base64` varchar(52) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3529,7 +3544,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',37)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(52) NOT NULL DEFAULT ''
+ `to_base64` varchar(52) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3550,7 +3565,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',36)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(48) NOT NULL DEFAULT ''
+ `to_base64` varchar(48) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3571,7 +3586,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',35)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(48) NOT NULL DEFAULT ''
+ `to_base64` varchar(48) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3592,7 +3607,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',34)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(48) NOT NULL DEFAULT ''
+ `to_base64` varchar(48) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3613,7 +3628,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',33)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(44) NOT NULL DEFAULT ''
+ `to_base64` varchar(44) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3634,7 +3649,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',32)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(44) NOT NULL DEFAULT ''
+ `to_base64` varchar(44) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3655,7 +3670,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',31)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(44) NOT NULL DEFAULT ''
+ `to_base64` varchar(44) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3676,7 +3691,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',30)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(40) NOT NULL DEFAULT ''
+ `to_base64` varchar(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3697,7 +3712,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',29)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(40) NOT NULL DEFAULT ''
+ `to_base64` varchar(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3718,7 +3733,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',28)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(40) NOT NULL DEFAULT ''
+ `to_base64` varchar(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3739,7 +3754,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',27)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(36) NOT NULL DEFAULT ''
+ `to_base64` varchar(36) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3760,7 +3775,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',26)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(36) NOT NULL DEFAULT ''
+ `to_base64` varchar(36) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3781,7 +3796,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',25)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(36) NOT NULL DEFAULT ''
+ `to_base64` varchar(36) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3802,7 +3817,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',24)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(32) NOT NULL DEFAULT ''
+ `to_base64` varchar(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3823,7 +3838,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',23)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(32) NOT NULL DEFAULT ''
+ `to_base64` varchar(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3844,7 +3859,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',22)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(32) NOT NULL DEFAULT ''
+ `to_base64` varchar(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3865,7 +3880,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',21)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(28) NOT NULL DEFAULT ''
+ `to_base64` varchar(28) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3886,7 +3901,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',20)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(28) NOT NULL DEFAULT ''
+ `to_base64` varchar(28) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3907,7 +3922,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',19)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(28) NOT NULL DEFAULT ''
+ `to_base64` varchar(28) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3928,7 +3943,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',18)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(24) NOT NULL DEFAULT ''
+ `to_base64` varchar(24) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3949,7 +3964,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',17)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(24) NOT NULL DEFAULT ''
+ `to_base64` varchar(24) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3970,7 +3985,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',16)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(24) NOT NULL DEFAULT ''
+ `to_base64` varchar(24) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -3991,7 +4006,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',15)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(20) NOT NULL DEFAULT ''
+ `to_base64` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4012,7 +4027,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',14)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(20) NOT NULL DEFAULT ''
+ `to_base64` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4033,7 +4048,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',13)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(20) NOT NULL DEFAULT ''
+ `to_base64` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4054,7 +4069,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',12)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(16) NOT NULL DEFAULT ''
+ `to_base64` varchar(16) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4075,7 +4090,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',11)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(16) NOT NULL DEFAULT ''
+ `to_base64` varchar(16) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4096,7 +4111,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',10)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(16) NOT NULL DEFAULT ''
+ `to_base64` varchar(16) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4117,7 +4132,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',9)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(12) NOT NULL DEFAULT ''
+ `to_base64` varchar(12) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4138,7 +4153,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',8)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(12) NOT NULL DEFAULT ''
+ `to_base64` varchar(12) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4159,7 +4174,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',7)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(12) NOT NULL DEFAULT ''
+ `to_base64` varchar(12) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4180,7 +4195,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',6)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(8) NOT NULL DEFAULT ''
+ `to_base64` varchar(8) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4201,7 +4216,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',5)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(8) NOT NULL DEFAULT ''
+ `to_base64` varchar(8) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4222,7 +4237,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',4)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(8) NOT NULL DEFAULT ''
+ `to_base64` varchar(8) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4243,7 +4258,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',3)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(4) NOT NULL DEFAULT ''
+ `to_base64` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4264,7 +4279,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',2)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(4) NOT NULL DEFAULT ''
+ `to_base64` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4285,7 +4300,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',1)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` varchar(4) NOT NULL DEFAULT ''
+ `to_base64` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4306,7 +4321,7 @@ CREATE TABLE t1 AS SELECT TO_BASE64(REPEAT('a',0)) AS to_base64;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `to_base64` char(0) NOT NULL DEFAULT ''
+ `to_base64` char(0) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT to_base64, LENGTH(to_base64) FROM t1;
to_base64 LENGTH(to_base64)
@@ -4527,6 +4542,7 @@ SET NAMES latin2;
EXECUTE stmt;
COLLATION(space(2))
latin2_general_ci
+set global max_allowed_packet=default;
#
# End of 5.6 tests
#
@@ -4551,3 +4567,115 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF)`
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+#
+CREATE TABLE t1 (a BIGINT(20) ZEROFILL);
+INSERT INTO t1 VALUES (18446744073709551615),(0);
+SELECT * FROM t1 WHERE a=18446744073709551615;
+a
+18446744073709551615
+SELECT * FROM t1 WHERE FORMAT(a,0)='18,446,744,073,709,551,615';
+a
+18446744073709551615
+SELECT * FROM t1 WHERE a=18446744073709551615 AND FORMAT(a,0)='18,446,744,073,709,551,615';
+a
+18446744073709551615
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=18446744073709551615 AND FORMAT(a,0)='18,446,744,073,709,551,615';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 18446744073709551615) and (format(`test`.`t1`.`a`,0) = '18,446,744,073,709,551,615'))
+DROP TABLE t1;
+#
+# Bug#58081 Duplicate entry error when doing GROUP BY
+# MDEV-9332 Bug after upgrade to 10.1.10
+#
+SET NAMES latin1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0),(0),(1),(0),(0);
+SELECT COUNT(*) FROM t1, t1 t2 GROUP BY INSERT('', t2.a, t1.a, @@global.max_binlog_size);
+COUNT(*)
+25
+DROP TABLE t1;
+# Start of func_str_ascii_checksum.inc
+#
+# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',hex('test')), ('TEST', hex('TEST'));
+SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= hex("test") OR f2= hex("TEST"));
+f1 f2
+test 74657374
+TEST 54455354
+SELECT * FROM t1 WHERE f1='test' AND (f2= hex("test") OR f2= hex("TEST"));
+f1 f2
+TEST 54455354
+test 74657374
+SELECT * FROM t1 WHERE f1='test' AND (f2= hex("TEST") OR f2= hex("test"));
+f1 f2
+TEST 54455354
+test 74657374
+DROP TABLE t1;
+#
+# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
+#
+PREPARE stmt FROM "SELECT hex(CONVERT('foo' USING latin1))";
+EXECUTE stmt;
+hex(CONVERT('foo' USING latin1))
+666F6F
+DEALLOCATE PREPARE stmt;
+# End of func_str_ascii_checksum.inc
+# Start of func_str_ascii_checksum.inc
+#
+# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',to_base64('test')), ('TEST', to_base64('TEST'));
+SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= to_base64("test") OR f2= to_base64("TEST"));
+f1 f2
+test dGVzdA==
+TEST VEVTVA==
+SELECT * FROM t1 WHERE f1='test' AND (f2= to_base64("test") OR f2= to_base64("TEST"));
+f1 f2
+test dGVzdA==
+TEST VEVTVA==
+SELECT * FROM t1 WHERE f1='test' AND (f2= to_base64("TEST") OR f2= to_base64("test"));
+f1 f2
+test dGVzdA==
+TEST VEVTVA==
+DROP TABLE t1;
+#
+# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
+#
+PREPARE stmt FROM "SELECT to_base64(CONVERT('foo' USING latin1))";
+EXECUTE stmt;
+to_base64(CONVERT('foo' USING latin1))
+Zm9v
+DEALLOCATE PREPARE stmt;
+# End of func_str_ascii_checksum.inc
+#
+# MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
+#
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(128), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('YQ==',from_base64('YQ==')), ('Yq==', from_base64('Yq=='));
+SELECT f1,HEX(f2) FROM t1 ignore index(k1) WHERE f1='YQ==' AND (f2= from_base64("YQ==") OR f2= from_base64("Yq=="));
+f1 HEX(f2)
+YQ== 61
+Yq== 62
+SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64("YQ==") OR f2= from_base64("Yq=="));
+f1 HEX(f2)
+YQ== 61
+Yq== 62
+SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64("Yq==") OR f2= from_base64("YQ=="));
+f1 HEX(f2)
+YQ== 61
+Yq== 62
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result
index 1452cf7e533..2fc0a59f5d2 100644
--- a/mysql-test/r/func_system.result
+++ b/mysql-test/r/func_system.result
@@ -47,7 +47,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`database()` varchar(34) CHARACTER SET utf8 DEFAULT NULL,
- `user()` varchar(141) CHARACTER SET utf8 NOT NULL DEFAULT '',
+ `user()` varchar(141) CHARACTER SET utf8 NOT NULL,
`version` char(60) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
@@ -61,8 +61,8 @@ create table t1 select charset(_utf8'a'), collation(_utf8'a');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `charset(_utf8'a')` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `collation(_utf8'a')` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `charset(_utf8'a')` varchar(64) CHARACTER SET utf8 NOT NULL,
+ `collation(_utf8'a')` varchar(64) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select TRUE,FALSE,NULL;
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index 97ef61047a5..387b8545f59 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -337,3 +337,84 @@ Note 1003 select (strcmp('a','b') <> 0) AS `NOT NOT strcmp('a','b')`
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8167 XOR returns bad results for an indexed column
+#
+CREATE TABLE t1 (
+id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+k INTEGER UNSIGNED DEFAULT '0' NOT NULL,
+c CHAR(120) DEFAULT '' NOT NULL,
+pad CHAR(60) DEFAULT '' NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (k, c, pad) VALUES (10, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (11, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (12, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (13, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (14, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (15, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (16, 'a', 'xxx');
+SELECT * FROM t1 WHERE id XOR 0;
+id k c pad
+1 10 a xxx
+2 11 a xxx
+3 12 a xxx
+4 13 a xxx
+5 14 a xxx
+6 15 a xxx
+7 16 a xxx
+SELECT * FROM t1 IGNORE KEY(PRIMARY) WHERE id XOR 0;
+id k c pad
+1 10 a xxx
+2 11 a xxx
+3 12 a xxx
+4 13 a xxx
+5 14 a xxx
+6 15 a xxx
+7 16 a xxx
+DROP TABLE t1;
+#
+# MDEV-8871 Wrong result for CREATE TABLE .. SELECT LEAST(unsigned_column,unsigned_column)
+#
+CREATE TABLE t1 (a INT,b INT UNSIGNED);
+INSERT INTO t1 VALUES (-2147483648,4294967295);
+SELECT a, b, LEAST(a,a), LEAST(b,b), LEAST(a,b), LEAST(b,a), GREATEST(a,b), GREATEST(b,a) FROM t1;
+a -2147483648
+b 4294967295
+LEAST(a,a) -2147483648
+LEAST(b,b) 4294967295
+LEAST(a,b) -2147483648
+LEAST(b,a) -2147483648
+GREATEST(a,b) 4294967295
+GREATEST(b,a) 4294967295
+CREATE TABLE t2 AS
+SELECT a, b, LEAST(a,a), LEAST(b,b), LEAST(a,b), LEAST(b,a), GREATEST(a,b), GREATEST(b,a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(10) unsigned DEFAULT NULL,
+ `LEAST(a,a)` int(11) DEFAULT NULL,
+ `LEAST(b,b)` int(10) unsigned DEFAULT NULL,
+ `LEAST(a,b)` decimal(10,0) DEFAULT NULL,
+ `LEAST(b,a)` decimal(10,0) DEFAULT NULL,
+ `GREATEST(a,b)` decimal(10,0) DEFAULT NULL,
+ `GREATEST(b,a)` decimal(10,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a -2147483648
+b 4294967295
+LEAST(a,a) -2147483648
+LEAST(b,b) 4294967295
+LEAST(a,b) -2147483648
+LEAST(b,a) -2147483648
+GREATEST(a,b) 4294967295
+GREATEST(b,a) 4294967295
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index ab0576c69a7..371dffdd3ae 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -163,6 +163,8 @@ Saturday 5
select monthname("1972-03-04"),monthname("1972-03-04")+0;
monthname("1972-03-04") monthname("1972-03-04")+0
March 0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'March'
select time_format(000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T');
time_format(000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T') date_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
00|12|0|12|00|AM|12:00:00 AM|00|00:00:00 00|12|0|12|00|AM|12:00:00 AM|00|00:00:00
@@ -872,7 +874,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select period_add('9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
+Note 1003 select period_add('9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03',@@default_week_format) AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
SET @TMP='2007-08-01 12:22:49';
CREATE TABLE t1 (d DATETIME);
INSERT INTO t1 VALUES ('2007-08-01 12:22:59');
@@ -948,8 +950,8 @@ sec_to_time(1) + 0, from_unixtime(1) + 0;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `now() - now()` bigint(21) NOT NULL DEFAULT '0',
- `curtime() - curtime()` bigint(12) NOT NULL DEFAULT '0',
+ `now() - now()` bigint(21) NOT NULL,
+ `curtime() - curtime()` bigint(12) NOT NULL,
`sec_to_time(1) + 0` bigint(12) DEFAULT NULL,
`from_unixtime(1) + 0` bigint(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -1714,14 +1716,19 @@ min(timestampadd(month, 1>'', from_days('%Z')))
NULL
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '%Z'
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Incorrect datetime value: '0000-00-00'
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 00:00:00');
create table t1(a time);
insert into t1 values ('00:00:00'),('00:01:00');
select 1 from t1 where 1 < some (select cast(a as datetime) from t1);
1
1
1
+Warnings:
+Warning 1292 Incorrect datetime value: '1'
drop table t1;
+SET timestamp=DEFAULT;
#
# Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6
# UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%M"
@@ -1739,6 +1746,8 @@ Warning 1292 Incorrect datetime value: '2015-06-00'
SELECT UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'));
UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'))
NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '0000-00-00 10:30:30' for function str_to_date
set sql_mode= 'TRADITIONAL';
SELECT @@sql_mode;
@@sql_mode
@@ -1860,8 +1869,6 @@ create table t1 (f1 datetime, key (f1));
insert into t1 values ('2000-09-12 00:00:00'), ('2007-04-25 05:08:49');
select * from t1 where f1 > time('-23:00:06');
f1
-2000-09-12 00:00:00
-2007-04-25 05:08:49
drop table t1;
select maketime(20,61,10)+0;
maketime(20,61,10)+0
@@ -1872,25 +1879,14 @@ select last_day(f2) from t1;
last_day(f2)
NULL
NULL
-Warnings:
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '0'
select last_day(f2) from t1 where last_day(f2) is null;
last_day(f2)
NULL
NULL
-Warnings:
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '0'
select * from t1 order by last_day (f2);
f2
0
0
-Warnings:
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '0'
drop table t1;
SET timestamp=unix_timestamp('2001-02-03 10:20:30');
select convert_tz(timediff('0000-00-00 00:00:00', cast('2008-03-26 07:09:06' as datetime)), 'UTC', 'Europe/Moscow');
@@ -1946,8 +1942,6 @@ insert ignore t1 values ('04:38:11','0000-00-00 00:00:00',0,'0000-00-00 00:00:00
select least(greatest(f3, f2, f4), f5) from t1;
least(greatest(f3, f2, f4), f5)
0000-00-00 00:00:00
-Warnings:
-Warning 1292 Incorrect datetime value: '0'
drop table t1;
select day(coalesce(null));
day(coalesce(null))
@@ -1964,16 +1958,19 @@ drop table t1;
SET timestamp=UNIX_TIMESTAMP('2014-06-01 10:20:30');
select greatest(cast("0-0-0" as date), cast("10:20:05" as time));
greatest(cast("0-0-0" as date), cast("10:20:05" as time))
-2014-06-01
+2014-06-01 10:20:05
select greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '0000-00-00';
greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '0000-00-00'
0
select greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '2014-06-01';
greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '2014-06-01'
+0
+select greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '2014-06-01 10:20:05';
+greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '2014-06-01 10:20:05'
1
select cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetime(6));
cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetime(6))
-2014-06-01 00:00:00.000000
+2014-06-01 10:20:05.000000
SET timestamp=DEFAULT;
select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010');
microsecond('12:00:00.123456') microsecond('2009-12-31 23:59:59.000010')
@@ -2017,6 +2014,9 @@ SELECT * FROM t1 GROUP BY SEC_TO_TIME(concat(a,'10'))*1;
a
2000-02-23
2005-05-04
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
DROP TABLE t1;
CREATE TABLE t1 (a DATE) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
@@ -2066,22 +2066,37 @@ SELECT * FROM t1 GROUP BY FROM_UNIXTIME(concat(a,'10'))*1;
a
2000-02-23
2005-05-04
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
SELECT * FROM t1 GROUP BY (-FROM_UNIXTIME(concat(a,'10')))*1;
a
2005-05-04
2000-02-23
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
SELECT * FROM t1 GROUP BY (-FROM_UNIXTIME(concat(a,'10')));
a
2005-05-04
2000-02-23
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
SELECT * FROM t1 GROUP BY ABS(FROM_UNIXTIME(concat(a,'10')));
a
2000-02-23
2005-05-04
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
SELECT * FROM t1 GROUP BY @a:=(FROM_UNIXTIME(concat(a,'10'))*1);
a
2000-02-23
2005-05-04
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
DROP TABLE t1;
SET TIME_ZONE='+02:00';
#
@@ -2093,10 +2108,18 @@ SELECT a, FROM_UNIXTIME(CONCAT(a,'10')) AS f1, FROM_UNIXTIME(CONCAT(a,'10'))+0 A
a f1 f2
2005-05-04 1970-01-01 02:33:25 19700101023325.000000
2000-02-23 1970-01-01 02:33:20 19700101023320.000000
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
SELECT * FROM t1 GROUP BY FROM_UNIXTIME(CONCAT(a,'10'))+0;
a
2000-02-23
2005-05-04
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
DROP TABLE t1;
CREATE TABLE t1 (a DATE) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
@@ -2104,16 +2127,28 @@ SELECT * FROM t1 GROUP BY FROM_UNIXTIME(concat(a,'10'))/1;
a
2000-02-23
2005-05-04
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2000-02-2310'
DROP TABLE t1;
CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES ('2005-05-04');
SELECT CONCAT(FROM_UNIXTIME(CONCAT(a,'10')) MOD FROM_UNIXTIME(CONCAT(a,'10'))) AS f2 FROM t1;
f2
0.000000
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
SELECT CHAR_LENGTH(CONCAT(FROM_UNIXTIME(CONCAT(a,'10')) MOD FROM_UNIXTIME(CONCAT(a,'10')))) AS f2 FROM t1;
f2
8
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
CREATE TABLE t2 AS SELECT CONCAT(FROM_UNIXTIME(CONCAT(a,'10')) MOD FROM_UNIXTIME(CONCAT(a,'10'))) AS f2 FROM t1;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
+Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -2570,18 +2605,12 @@ CREATE TABLE t1 (t TIME);
INSERT INTO t1 VALUES ('03:22:30'),('18:30:05');
SELECT CONVERT_TZ(GREATEST(t, CURRENT_DATE()), '+02:00', '+10:00') FROM t1;
CONVERT_TZ(GREATEST(t, CURRENT_DATE()), '+02:00', '+10:00')
-2014-02-26 06:59:59
-2014-02-26 06:59:59
-Warnings:
-Warning 1292 Truncated incorrect time value: '1296:00:00'
-Warning 1292 Truncated incorrect time value: '1296:00:00'
+2014-01-22 11:22:30
+2014-01-23 02:30:05
SELECT GREATEST(t, CURRENT_DATE()) FROM t1;
GREATEST(t, CURRENT_DATE())
-838:59:59
-838:59:59
-Warnings:
-Warning 1292 Truncated incorrect time value: '1296:00:00'
-Warning 1292 Truncated incorrect time value: '1296:00:00'
+2014-01-22 03:22:30
+2014-01-22 18:30:05
DROP TABLE t1;
SET TIMESTAMP=DEFAULT;
#
@@ -2702,18 +2731,15 @@ SET timestamp=DEFAULT;
#
# MDEV-5750 Assertion `ltime->year == 0' fails on a query with EXTRACT DAY_MINUTE and TIME column
#
+SET timestamp=UNIX_TIMESTAMP('2010-01-01 00:00:00');
CREATE TABLE t1 ( d DATE, t TIME );
INSERT INTO t1 VALUES ('2008-12-05','22:34:09'),('2005-03-27','14:26:02');
SELECT EXTRACT(DAY_MINUTE FROM GREATEST(t,d)), GREATEST(t,d) FROM t1;
EXTRACT(DAY_MINUTE FROM GREATEST(t,d)) GREATEST(t,d)
-342259 838:59:59
-342259 838:59:59
-Warnings:
-Warning 1292 Truncated incorrect time value: '9336:00:00'
-Warning 1292 Truncated incorrect time value: '9336:00:00'
-Warning 1292 Truncated incorrect time value: '2952:00:00'
-Warning 1292 Truncated incorrect time value: '2952:00:00'
+12234 2010-01-01 22:34:09
+11426 2010-01-01 14:26:02
DROP TABLE t1;
+SET timestamp=DEFAULT;
#
# MDEV-7221 from_days fails after null value
#
@@ -2880,3 +2906,332 @@ Warning 1441 Datetime function: datetime field overflow
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-10317 EXCTACT(MINUTE_MICROSECOND) truncates data
+#
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('1999-12-31 23:59:59.999999');
+SELECT
+a,
+EXTRACT(YEAR FROM a),
+EXTRACT(YEAR_MONTH FROM a),
+EXTRACT(QUARTER FROM a),
+EXTRACT(MONTH FROM a),
+EXTRACT(WEEK FROM a),
+EXTRACT(DAY FROM a),
+EXTRACT(DAY_HOUR FROM a),
+EXTRACT(DAY_MINUTE FROM a),
+EXTRACT(DAY_SECOND FROM a),
+EXTRACT(HOUR FROM a),
+EXTRACT(HOUR_MINUTE FROM a),
+EXTRACT(HOUR_SECOND FROM a),
+EXTRACT(MINUTE FROM a),
+EXTRACT(MINUTE_SECOND FROM a),
+EXTRACT(SECOND FROM a),
+EXTRACT(MICROSECOND FROM a),
+EXTRACT(DAY_MICROSECOND FROM a),
+EXTRACT(HOUR_MICROSECOND FROM a),
+EXTRACT(MINUTE_MICROSECOND FROM a),
+EXTRACT(SECOND_MICROSECOND FROM a)
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a a 12 26 26 Y 128 6 63
+def EXTRACT(YEAR FROM a) 3 4 4 Y 32896 0 63
+def EXTRACT(YEAR_MONTH FROM a) 3 6 6 Y 32896 0 63
+def EXTRACT(QUARTER FROM a) 3 2 1 Y 32896 0 63
+def EXTRACT(MONTH FROM a) 3 2 2 Y 32896 0 63
+def EXTRACT(WEEK FROM a) 3 2 2 Y 32896 0 63
+def EXTRACT(DAY FROM a) 3 2 2 Y 32896 0 63
+def EXTRACT(DAY_HOUR FROM a) 3 5 4 Y 32896 0 63
+def EXTRACT(DAY_MINUTE FROM a) 3 7 6 Y 32896 0 63
+def EXTRACT(DAY_SECOND FROM a) 3 9 8 Y 32896 0 63
+def EXTRACT(HOUR FROM a) 3 3 2 Y 32896 0 63
+def EXTRACT(HOUR_MINUTE FROM a) 3 5 4 Y 32896 0 63
+def EXTRACT(HOUR_SECOND FROM a) 3 7 6 Y 32896 0 63
+def EXTRACT(MINUTE FROM a) 3 3 2 Y 32896 0 63
+def EXTRACT(MINUTE_SECOND FROM a) 3 5 4 Y 32896 0 63
+def EXTRACT(SECOND FROM a) 3 3 2 Y 32896 0 63
+def EXTRACT(MICROSECOND FROM a) 3 7 6 Y 32896 0 63
+def EXTRACT(DAY_MICROSECOND FROM a) 8 15 14 Y 32896 0 63
+def EXTRACT(HOUR_MICROSECOND FROM a) 8 13 12 Y 32896 0 63
+def EXTRACT(MINUTE_MICROSECOND FROM a) 8 11 10 Y 32896 0 63
+def EXTRACT(SECOND_MICROSECOND FROM a) 3 9 8 Y 32896 0 63
+a 1999-12-31 23:59:59.999999
+EXTRACT(YEAR FROM a) 1999
+EXTRACT(YEAR_MONTH FROM a) 199912
+EXTRACT(QUARTER FROM a) 4
+EXTRACT(MONTH FROM a) 12
+EXTRACT(WEEK FROM a) 52
+EXTRACT(DAY FROM a) 31
+EXTRACT(DAY_HOUR FROM a) 3123
+EXTRACT(DAY_MINUTE FROM a) 312359
+EXTRACT(DAY_SECOND FROM a) 31235959
+EXTRACT(HOUR FROM a) 23
+EXTRACT(HOUR_MINUTE FROM a) 2359
+EXTRACT(HOUR_SECOND FROM a) 235959
+EXTRACT(MINUTE FROM a) 59
+EXTRACT(MINUTE_SECOND FROM a) 5959
+EXTRACT(SECOND FROM a) 59
+EXTRACT(MICROSECOND FROM a) 999999
+EXTRACT(DAY_MICROSECOND FROM a) 31235959999999
+EXTRACT(HOUR_MICROSECOND FROM a) 235959999999
+EXTRACT(MINUTE_MICROSECOND FROM a) 5959999999
+EXTRACT(SECOND_MICROSECOND FROM a) 59999999
+CREATE TABLE t2 AS SELECT
+a,
+EXTRACT(YEAR FROM a),
+EXTRACT(YEAR_MONTH FROM a),
+EXTRACT(QUARTER FROM a),
+EXTRACT(MONTH FROM a),
+EXTRACT(WEEK FROM a),
+EXTRACT(DAY FROM a),
+EXTRACT(DAY_HOUR FROM a),
+EXTRACT(DAY_MINUTE FROM a),
+EXTRACT(DAY_SECOND FROM a),
+EXTRACT(HOUR FROM a),
+EXTRACT(HOUR_MINUTE FROM a),
+EXTRACT(HOUR_SECOND FROM a),
+EXTRACT(MINUTE FROM a),
+EXTRACT(MINUTE_SECOND FROM a),
+EXTRACT(SECOND FROM a),
+EXTRACT(MICROSECOND FROM a),
+EXTRACT(DAY_MICROSECOND FROM a),
+EXTRACT(HOUR_MICROSECOND FROM a),
+EXTRACT(MINUTE_MICROSECOND FROM a),
+EXTRACT(SECOND_MICROSECOND FROM a)
+FROM t1;
+SELECT * FROM t2;
+a 1999-12-31 23:59:59.999999
+EXTRACT(YEAR FROM a) 1999
+EXTRACT(YEAR_MONTH FROM a) 199912
+EXTRACT(QUARTER FROM a) 4
+EXTRACT(MONTH FROM a) 12
+EXTRACT(WEEK FROM a) 52
+EXTRACT(DAY FROM a) 31
+EXTRACT(DAY_HOUR FROM a) 3123
+EXTRACT(DAY_MINUTE FROM a) 312359
+EXTRACT(DAY_SECOND FROM a) 31235959
+EXTRACT(HOUR FROM a) 23
+EXTRACT(HOUR_MINUTE FROM a) 2359
+EXTRACT(HOUR_SECOND FROM a) 235959
+EXTRACT(MINUTE FROM a) 59
+EXTRACT(MINUTE_SECOND FROM a) 5959
+EXTRACT(SECOND FROM a) 59
+EXTRACT(MICROSECOND FROM a) 999999
+EXTRACT(DAY_MICROSECOND FROM a) 31235959999999
+EXTRACT(HOUR_MICROSECOND FROM a) 235959999999
+EXTRACT(MINUTE_MICROSECOND FROM a) 5959999999
+EXTRACT(SECOND_MICROSECOND FROM a) 59999999
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` datetime(6) DEFAULT NULL,
+ `EXTRACT(YEAR FROM a)` int(4) DEFAULT NULL,
+ `EXTRACT(YEAR_MONTH FROM a)` int(6) DEFAULT NULL,
+ `EXTRACT(QUARTER FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(MONTH FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(WEEK FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(DAY FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(DAY_HOUR FROM a)` int(5) DEFAULT NULL,
+ `EXTRACT(DAY_MINUTE FROM a)` int(7) DEFAULT NULL,
+ `EXTRACT(DAY_SECOND FROM a)` int(9) DEFAULT NULL,
+ `EXTRACT(HOUR FROM a)` int(3) DEFAULT NULL,
+ `EXTRACT(HOUR_MINUTE FROM a)` int(5) DEFAULT NULL,
+ `EXTRACT(HOUR_SECOND FROM a)` int(7) DEFAULT NULL,
+ `EXTRACT(MINUTE FROM a)` int(3) DEFAULT NULL,
+ `EXTRACT(MINUTE_SECOND FROM a)` int(5) DEFAULT NULL,
+ `EXTRACT(SECOND FROM a)` int(3) DEFAULT NULL,
+ `EXTRACT(MICROSECOND FROM a)` int(7) DEFAULT NULL,
+ `EXTRACT(DAY_MICROSECOND FROM a)` bigint(15) DEFAULT NULL,
+ `EXTRACT(HOUR_MICROSECOND FROM a)` bigint(13) DEFAULT NULL,
+ `EXTRACT(MINUTE_MICROSECOND FROM a)` bigint(11) DEFAULT NULL,
+ `EXTRACT(SECOND_MICROSECOND FROM a)` int(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('-838:59:59.999999'),('838:59:59.999999');
+SELECT
+a,
+EXTRACT(YEAR FROM a),
+EXTRACT(YEAR_MONTH FROM a),
+EXTRACT(QUARTER FROM a),
+EXTRACT(MONTH FROM a),
+EXTRACT(WEEK FROM a),
+EXTRACT(DAY FROM a),
+EXTRACT(DAY_HOUR FROM a),
+EXTRACT(DAY_MINUTE FROM a),
+EXTRACT(DAY_SECOND FROM a),
+EXTRACT(HOUR FROM a),
+EXTRACT(HOUR_MINUTE FROM a),
+EXTRACT(HOUR_SECOND FROM a),
+EXTRACT(MINUTE FROM a),
+EXTRACT(MINUTE_SECOND FROM a),
+EXTRACT(SECOND FROM a),
+EXTRACT(MICROSECOND FROM a),
+EXTRACT(DAY_MICROSECOND FROM a),
+EXTRACT(HOUR_MICROSECOND FROM a),
+EXTRACT(MINUTE_MICROSECOND FROM a),
+EXTRACT(SECOND_MICROSECOND FROM a)
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a a 11 17 17 Y 128 6 63
+def EXTRACT(YEAR FROM a) 3 4 1 Y 32896 0 63
+def EXTRACT(YEAR_MONTH FROM a) 3 6 1 Y 32896 0 63
+def EXTRACT(QUARTER FROM a) 3 2 1 Y 32896 0 63
+def EXTRACT(MONTH FROM a) 3 2 1 Y 32896 0 63
+def EXTRACT(WEEK FROM a) 3 2 9 Y 32896 0 63
+def EXTRACT(DAY FROM a) 3 2 2 Y 32896 0 63
+def EXTRACT(DAY_HOUR FROM a) 3 5 5 Y 32896 0 63
+def EXTRACT(DAY_MINUTE FROM a) 3 7 7 Y 32896 0 63
+def EXTRACT(DAY_SECOND FROM a) 3 9 9 Y 32896 0 63
+def EXTRACT(HOUR FROM a) 3 3 3 Y 32896 0 63
+def EXTRACT(HOUR_MINUTE FROM a) 3 5 5 Y 32896 0 63
+def EXTRACT(HOUR_SECOND FROM a) 3 7 7 Y 32896 0 63
+def EXTRACT(MINUTE FROM a) 3 3 3 Y 32896 0 63
+def EXTRACT(MINUTE_SECOND FROM a) 3 5 5 Y 32896 0 63
+def EXTRACT(SECOND FROM a) 3 3 3 Y 32896 0 63
+def EXTRACT(MICROSECOND FROM a) 3 7 7 Y 32896 0 63
+def EXTRACT(DAY_MICROSECOND FROM a) 8 15 15 Y 32896 0 63
+def EXTRACT(HOUR_MICROSECOND FROM a) 8 13 13 Y 32896 0 63
+def EXTRACT(MINUTE_MICROSECOND FROM a) 8 11 11 Y 32896 0 63
+def EXTRACT(SECOND_MICROSECOND FROM a) 3 9 9 Y 32896 0 63
+a -838:59:59.999999
+EXTRACT(YEAR FROM a) 0
+EXTRACT(YEAR_MONTH FROM a) 0
+EXTRACT(QUARTER FROM a) 0
+EXTRACT(MONTH FROM a) 0
+EXTRACT(WEEK FROM a) 613566757
+EXTRACT(DAY FROM a) 34
+EXTRACT(DAY_HOUR FROM a) -3422
+EXTRACT(DAY_MINUTE FROM a) -342259
+EXTRACT(DAY_SECOND FROM a) -34225959
+EXTRACT(HOUR FROM a) -22
+EXTRACT(HOUR_MINUTE FROM a) -2259
+EXTRACT(HOUR_SECOND FROM a) -225959
+EXTRACT(MINUTE FROM a) -59
+EXTRACT(MINUTE_SECOND FROM a) -5959
+EXTRACT(SECOND FROM a) -59
+EXTRACT(MICROSECOND FROM a) -999999
+EXTRACT(DAY_MICROSECOND FROM a) -34225959999999
+EXTRACT(HOUR_MICROSECOND FROM a) -225959999999
+EXTRACT(MINUTE_MICROSECOND FROM a) -5959999999
+EXTRACT(SECOND_MICROSECOND FROM a) -59999999
+a 838:59:59.999999
+EXTRACT(YEAR FROM a) 0
+EXTRACT(YEAR_MONTH FROM a) 0
+EXTRACT(QUARTER FROM a) 0
+EXTRACT(MONTH FROM a) 0
+EXTRACT(WEEK FROM a) 613566757
+EXTRACT(DAY FROM a) 34
+EXTRACT(DAY_HOUR FROM a) 3422
+EXTRACT(DAY_MINUTE FROM a) 342259
+EXTRACT(DAY_SECOND FROM a) 34225959
+EXTRACT(HOUR FROM a) 22
+EXTRACT(HOUR_MINUTE FROM a) 2259
+EXTRACT(HOUR_SECOND FROM a) 225959
+EXTRACT(MINUTE FROM a) 59
+EXTRACT(MINUTE_SECOND FROM a) 5959
+EXTRACT(SECOND FROM a) 59
+EXTRACT(MICROSECOND FROM a) 999999
+EXTRACT(DAY_MICROSECOND FROM a) 34225959999999
+EXTRACT(HOUR_MICROSECOND FROM a) 225959999999
+EXTRACT(MINUTE_MICROSECOND FROM a) 5959999999
+EXTRACT(SECOND_MICROSECOND FROM a) 59999999
+CREATE TABLE t2 AS SELECT
+a,
+EXTRACT(YEAR FROM a),
+EXTRACT(YEAR_MONTH FROM a),
+EXTRACT(QUARTER FROM a),
+EXTRACT(MONTH FROM a),
+EXTRACT(WEEK FROM a),
+EXTRACT(DAY FROM a),
+EXTRACT(DAY_HOUR FROM a),
+EXTRACT(DAY_MINUTE FROM a),
+EXTRACT(DAY_SECOND FROM a),
+EXTRACT(HOUR FROM a),
+EXTRACT(HOUR_MINUTE FROM a),
+EXTRACT(HOUR_SECOND FROM a),
+EXTRACT(MINUTE FROM a),
+EXTRACT(MINUTE_SECOND FROM a),
+EXTRACT(SECOND FROM a),
+EXTRACT(MICROSECOND FROM a),
+EXTRACT(DAY_MICROSECOND FROM a),
+EXTRACT(HOUR_MICROSECOND FROM a),
+EXTRACT(MINUTE_MICROSECOND FROM a),
+EXTRACT(SECOND_MICROSECOND FROM a)
+FROM t1;
+SELECT * FROM t2;
+a -838:59:59.999999
+EXTRACT(YEAR FROM a) 0
+EXTRACT(YEAR_MONTH FROM a) 0
+EXTRACT(QUARTER FROM a) 0
+EXTRACT(MONTH FROM a) 0
+EXTRACT(WEEK FROM a) 613566757
+EXTRACT(DAY FROM a) 34
+EXTRACT(DAY_HOUR FROM a) -3422
+EXTRACT(DAY_MINUTE FROM a) -342259
+EXTRACT(DAY_SECOND FROM a) -34225959
+EXTRACT(HOUR FROM a) -22
+EXTRACT(HOUR_MINUTE FROM a) -2259
+EXTRACT(HOUR_SECOND FROM a) -225959
+EXTRACT(MINUTE FROM a) -59
+EXTRACT(MINUTE_SECOND FROM a) -5959
+EXTRACT(SECOND FROM a) -59
+EXTRACT(MICROSECOND FROM a) -999999
+EXTRACT(DAY_MICROSECOND FROM a) -34225959999999
+EXTRACT(HOUR_MICROSECOND FROM a) -225959999999
+EXTRACT(MINUTE_MICROSECOND FROM a) -5959999999
+EXTRACT(SECOND_MICROSECOND FROM a) -59999999
+a 838:59:59.999999
+EXTRACT(YEAR FROM a) 0
+EXTRACT(YEAR_MONTH FROM a) 0
+EXTRACT(QUARTER FROM a) 0
+EXTRACT(MONTH FROM a) 0
+EXTRACT(WEEK FROM a) 613566757
+EXTRACT(DAY FROM a) 34
+EXTRACT(DAY_HOUR FROM a) 3422
+EXTRACT(DAY_MINUTE FROM a) 342259
+EXTRACT(DAY_SECOND FROM a) 34225959
+EXTRACT(HOUR FROM a) 22
+EXTRACT(HOUR_MINUTE FROM a) 2259
+EXTRACT(HOUR_SECOND FROM a) 225959
+EXTRACT(MINUTE FROM a) 59
+EXTRACT(MINUTE_SECOND FROM a) 5959
+EXTRACT(SECOND FROM a) 59
+EXTRACT(MICROSECOND FROM a) 999999
+EXTRACT(DAY_MICROSECOND FROM a) 34225959999999
+EXTRACT(HOUR_MICROSECOND FROM a) 225959999999
+EXTRACT(MINUTE_MICROSECOND FROM a) 5959999999
+EXTRACT(SECOND_MICROSECOND FROM a) 59999999
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` time(6) DEFAULT NULL,
+ `EXTRACT(YEAR FROM a)` int(4) DEFAULT NULL,
+ `EXTRACT(YEAR_MONTH FROM a)` int(6) DEFAULT NULL,
+ `EXTRACT(QUARTER FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(MONTH FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(WEEK FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(DAY FROM a)` int(2) DEFAULT NULL,
+ `EXTRACT(DAY_HOUR FROM a)` int(5) DEFAULT NULL,
+ `EXTRACT(DAY_MINUTE FROM a)` int(7) DEFAULT NULL,
+ `EXTRACT(DAY_SECOND FROM a)` int(9) DEFAULT NULL,
+ `EXTRACT(HOUR FROM a)` int(3) DEFAULT NULL,
+ `EXTRACT(HOUR_MINUTE FROM a)` int(5) DEFAULT NULL,
+ `EXTRACT(HOUR_SECOND FROM a)` int(7) DEFAULT NULL,
+ `EXTRACT(MINUTE FROM a)` int(3) DEFAULT NULL,
+ `EXTRACT(MINUTE_SECOND FROM a)` int(5) DEFAULT NULL,
+ `EXTRACT(SECOND FROM a)` int(3) DEFAULT NULL,
+ `EXTRACT(MICROSECOND FROM a)` int(7) DEFAULT NULL,
+ `EXTRACT(DAY_MICROSECOND FROM a)` bigint(15) DEFAULT NULL,
+ `EXTRACT(HOUR_MICROSECOND FROM a)` bigint(13) DEFAULT NULL,
+ `EXTRACT(MINUTE_MICROSECOND FROM a)` bigint(11) DEFAULT NULL,
+ `EXTRACT(SECOND_MICROSECOND FROM a)` int(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/func_time_hires.result b/mysql-test/r/func_time_hires.result
index 62004687c22..baa53b11fd6 100644
--- a/mysql-test/r/func_time_hires.result
+++ b/mysql-test/r/func_time_hires.result
@@ -39,14 +39,14 @@ t1 CREATE TABLE `t1` (
`sec_to_time(12345)` time DEFAULT NULL,
`sec_to_time(12345.6789)` time(4) DEFAULT NULL,
`sec_to_time(1234567e-2)` time(6) DEFAULT NULL,
- `now()` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `curtime(0)` time NOT NULL DEFAULT '00:00:00',
- `utc_timestamp(1)` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0',
- `utc_time(2)` time(2) NOT NULL DEFAULT '00:00:00.00',
- `current_time(3)` time(3) NOT NULL DEFAULT '00:00:00.000',
- `current_timestamp(4)` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000',
- `localtime(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000',
- `localtimestamp(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `now()` datetime NOT NULL,
+ `curtime(0)` time NOT NULL,
+ `utc_timestamp(1)` datetime(1) NOT NULL,
+ `utc_time(2)` time(2) NOT NULL,
+ `current_time(3)` time(3) NOT NULL,
+ `current_timestamp(4)` datetime(4) NOT NULL,
+ `localtime(5)` datetime(5) NOT NULL,
+ `localtimestamp(6)` datetime(6) NOT NULL,
`time_to_sec(123456)` bigint(17) DEFAULT NULL,
`time_to_sec('12:34:56.789')` decimal(19,3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
diff --git a/mysql-test/r/func_weight_string.result b/mysql-test/r/func_weight_string.result
index 91ca9f68076..e63ee4267ea 100644
--- a/mysql-test/r/func_weight_string.result
+++ b/mysql-test/r/func_weight_string.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+set global max_allowed_packet=1048576;
set names latin1;
select hex(weight_string(0x010203));
hex(weight_string(0x010203))
@@ -90,3 +91,52 @@ NULL
Warnings:
Warning 1301 Result of cast_as_binary() was larger than max_allowed_packet (1048576) - truncated
Warning 1301 Result of weight_string() was larger than max_allowed_packet (1048576) - truncated
+set global max_allowed_packet=default;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+#
+CREATE TABLE t1 (a INT(6) ZEROFILL);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE a=1;
+a
+000001
+SELECT * FROM t1 WHERE WEIGHT_STRING(a) IS NULL;
+a
+000001
+000002
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+a
+000001
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`)))
+ALTER TABLE t1 MODIFY a DOUBLE ZEROFILL;
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+a
+0000000000000000000001
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`)))
+ALTER TABLE t1 MODIFY a DECIMAL(10,1) ZEROFILL;
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+a
+000000001.0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`)))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/gis-debug.result b/mysql-test/r/gis-debug.result
index 8593f434c2b..5e8b4747f6d 100644
--- a/mysql-test/r/gis-debug.result
+++ b/mysql-test/r/gis-debug.result
@@ -267,6 +267,8 @@ POLYGON
# Bug#13358363 - ASSERTION: N > 0 && N < SINUSES_CALCULATED*2+1 | GET_N_SINCOS/ADD_EDGE_BUFFER
#
DO ST_BUFFER(ST_GEOMCOLLFROMTEXT('linestring(1 1,2 2)'),'');
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
SELECT ST_WITHIN(
LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
ST_BUFFER(MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5))) '),
diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result
index c0b8b85d216..89e5c237413 100644
--- a/mysql-test/r/gis-precise.result
+++ b/mysql-test/r/gis-precise.result
@@ -175,7 +175,7 @@ st_touches(geomfromtext('point(0 0)'), geomfromtext('point(1 1)'))
0
select st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)'));
st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)'))
-1
+0
select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)'));
st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)'))
1
@@ -187,7 +187,7 @@ st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1
0
select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))'));
st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))'))
-1
+0
select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))'));
st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))'))
1
@@ -477,6 +477,34 @@ ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER( POLYGONFROMTEXT( 'POLYGON( ( 0.0 -3.0,
select astext(buffer(st_linestringfromwkb(linestring(point(-1,1), point(-1,-2))),-1));
astext(buffer(st_linestringfromwkb(linestring(point(-1,1), point(-1,-2))),-1))
GEOMETRYCOLLECTION EMPTY
+select ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)'));
+ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)'))
+1
+select ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)'));
+ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)'))
+1
+select ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'));
+ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'))
+0
+SELECT ST_RELATE(
+ST_DIFFERENCE(
+GEOMETRYFROMTEXT('
+ MULTILINESTRING(
+ ( 12841 36140, 8005 31007, 26555 31075, 52765 41191,
+ 28978 6548, 45720 32057, 53345 3221 ),
+ ( 8304 59107, 25233 31592, 40502 25303, 8205 42940 ),
+ ( 7829 7305, 58841 56759, 64115 8512, 37562 54145, 2210 14701 ),
+ ( 20379 2805, 40807 27770, 28147 14883, 26439 29383, 55663 5086 ),
+ ( 35944 64702, 14433 23728, 49317 26241, 790 16941 )
+ )
+ '),
+GEOMETRYFROMTEXT('POINT(46061 13545)')
+),
+GEOMETRYFROMTEXT('POINT(4599 60359)'),
+'F*FFFF**F'
+ ) as relate_res;
+relate_res
+0
DROP TABLE IF EXISTS p1;
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
BEGIN
@@ -745,6 +773,8 @@ POLYGON
# Bug#13358363 - ASSERTION: N > 0 && N < SINUSES_CALCULATED*2+1 | GET_N_SINCOS/ADD_EDGE_BUFFER
#
DO ST_BUFFER(ST_GEOMCOLLFROMTEXT('linestring(1 1,2 2)'),'');
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
SELECT ST_WITHIN(
LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
ST_BUFFER(MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5))) '),
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index c400ebb39ef..0506a0b2a0a 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -1596,3 +1596,51 @@ SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'
COUNT(*)
1
DROP TABLE t1;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
+#
+CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (Point(1,2)),(Point(1,3));
+EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(a,Point(1,2));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 34 NULL 1 Using where
+EXPLAIN SELECT * FROM t1 WHERE ST_INTERSECTS(a,Point(1,2));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 34 NULL 1 Using where
+EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(Point(1,2),a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 34 NULL 1 Using where
+EXPLAIN SELECT * FROM t1 WHERE ST_INTERSECTS(Point(1,2),a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 34 NULL 1 Using where
+DROP TABLE t1;
+#
+# MDEV-8610 "WHERE CONTAINS(indexed_geometry_column,1)" causes full table scan
+#
+CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (Point(1,1)),(Point(2,2)),(Point(3,3));
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1.0);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1e0);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,TIME'00:00:00');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,DATE'2001-01-01');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,TIMESTAMP'2001-01-01 00:00:00');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index f77cd4d14bf..76f4f6accdb 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1,5 +1,3 @@
-DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
-DROP VIEW IF EXISTS v1;
CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
@@ -405,12 +403,12 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
-120 120 1 1 0 1 0 1 1 0
+120 120 1 1 0 1 0 0 1 0
120 121 0 0 1 0 0 0 1 0
120 122 NULL NULL NULL NULL NULL NULL NULL NULL
120 123 NULL NULL NULL NULL NULL NULL NULL NULL
121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 1 1 0
+121 121 1 1 0 1 0 0 1 0
121 122 NULL NULL NULL NULL NULL NULL NULL NULL
121 123 NULL NULL NULL NULL NULL NULL NULL NULL
122 120 NULL NULL NULL NULL NULL NULL NULL NULL
@@ -811,7 +809,7 @@ drop procedure if exists fn3;
create function fn3 () returns point deterministic return GeomFromText("point(1 1)");
show create function fn3;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn3 CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS point
+fn3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS point
DETERMINISTIC
return GeomFromText("point(1 1)") latin1 latin1_swedish_ci latin1_swedish_ci
select astext(fn3());
@@ -879,7 +877,7 @@ mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
-big,center,down,down2,left,left2,right,right2,small,up,up2
+down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
@@ -900,7 +898,7 @@ overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
-big,center,down,down2,left,left2,right,right2,small,up,up2
+down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
@@ -1113,7 +1111,7 @@ DROP TABLE t0, t1, t2;
#
SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)));
ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)))
-NULL
+-1
#
# BUG#12537203 - CRASH WHEN SUBSELECTING GLOBAL VARIABLES IN
# GEOMETRY FUNCTION ARGUMENTS
@@ -1327,6 +1325,18 @@ WHERE name = 'Route 5'
AND aliases = 'Main Street';
IsEmpty(centerline)
0
+# Conformance Item T12
+SELECT IsSimple(shore)
+FROM lakes
+WHERE name = 'Blue Lake';
+IsSimple(shore)
+1
+# Conformance Item T13
+SELECT AsText(ST_Boundary(boundary))
+FROM named_places
+WHERE name = 'Goose Island';
+AsText(ST_Boundary(boundary))
+LINESTRING(67 13,67 18,59 18,59 13,67 13)
# Conformance Item T14
SELECT AsText(Envelope(boundary))
FROM named_places
@@ -1357,6 +1367,17 @@ FROM road_segments
WHERE fid = 102;
AsText(EndPoint(centerline))
POINT(44 31)
+SELECT IsClosed(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
+FROM named_places
+WHERE name = 'Goose Island';
+IsClosed(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
+1
+# Conformance Item T20
+SELECT IsRing(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
+FROM named_places
+WHERE name = 'Goose Island';
+IsRing(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
+1
# Conformance Item T21
SELECT GLength(centerline)
FROM road_segments
@@ -1381,6 +1402,11 @@ FROM named_places
WHERE name = 'Goose Island';
AsText(Centroid(boundary))
POINT(63 15.5)
+SELECT ST_Contains(boundary, PointOnSurface(boundary))
+FROM named_places
+WHERE name = 'Goose Island';
+ST_Contains(boundary, PointOnSurface(boundary))
+1
# Conformance Item T26
SELECT Area(boundary)
FROM named_places
@@ -1435,6 +1461,12 @@ FROM ponds
WHERE fid = 120;
AsText(Centroid(shores))
POINT(25 42)
+# Conformance Item T35
+SELECT Contains(shores, PointOnSurface(shores))
+FROM ponds
+WHERE fid = 120;
+Contains(shores, PointOnSurface(shores))
+1
# Conformance Item T36
SELECT Area(shores)
FROM ponds
@@ -1463,6 +1495,20 @@ WHERE streams.name = 'Cam Stream'
AND lakes.name = 'Blue Lake';
ST_Touches(centerline, shore)
1
+# Conformance Item T40
+SELECT ST_Within(footprint, boundary)
+FROM named_places, buildings
+WHERE named_places.name = 'Ashton'
+AND buildings.address = '215 Main Street';
+ST_Within(footprint, boundary)
+1
+# Conformance Item T41
+SELECT ST_Overlaps(forests.boundary, named_places.boundary)
+FROM forests, named_places
+WHERE forests.name = 'Green Forest'
+AND named_places.name = 'Ashton';
+ST_Overlaps(forests.boundary, named_places.boundary)
+1
# Conformance Item T42
SELECT Crosses(road_segments.centerline, divided_routes.centerlines)
FROM road_segments, divided_routes
@@ -1484,6 +1530,13 @@ WHERE forests.name = 'Green Forest'
AND named_places.name = 'Ashton';
ST_Contains(forests.boundary, named_places.boundary)
0
+# Conformance Item T45
+SELECT ST_Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT')
+FROM forests, named_places
+WHERE forests.name = 'Green Forest'
+AND named_places.name = 'Ashton';
+ST_Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT')
+1
# Conformance Item T46
SELECT ST_Distance(position, boundary)
FROM bridges, named_places
@@ -1491,6 +1544,13 @@ WHERE bridges.name = 'Cam Bridge'
AND named_places.name = 'Ashton';
ST_Distance(position, boundary)
12
+# Conformance Item T47
+SELECT AsText(ST_Intersection(centerline, shore))
+FROM streams, lakes
+WHERE streams.name = 'Cam Stream'
+AND lakes.name = 'Blue Lake';
+AsText(ST_Intersection(centerline, shore))
+POINT(52 18)
# Conformance Item T48
SELECT AsText(ST_Difference(named_places.boundary, forests.boundary))
FROM named_places, forests
@@ -1517,6 +1577,12 @@ FROM buildings, bridges
WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1;
count(*)
1
+# Conformance Item T52
+SELECT AsText(ConvexHull(shore))
+FROM lakes
+WHERE lakes.name = 'Blue Lake';
+AsText(ConvexHull(shore))
+POLYGON((48 6,52 18,66 23,73 9,48 6))
DROP DATABASE gis_ogs;
USE test;
#
@@ -1552,11 +1618,16 @@ insert into t1 values(geomfromtext("POINT(0 9.2233720368548e18)"));
select equals(`a`,convert(`a` using utf8)) from `t1`;
equals(`a`,convert(`a` using utf8))
1
+0
+0
+Warnings:
+Warning 1300 Invalid utf8 character string: '\xE0C'
+Warning 1300 Invalid utf8 character string: '\xE0C'
+select equals(`a`,left(`a`,23)) from `t1`;
+equals(`a`,left(`a`,23))
+NULL
NULL
NULL
-Warnings:
-Warning 1300 Invalid utf8 character string: 'E043'
-Warning 1300 Invalid utf8 character string: 'E043'
drop table t1;
#
# MDEV-6883 ST_WITHIN crashes server if (0,0) is matched to POLYGON((0 0))
@@ -1590,6 +1661,9 @@ INSERT INTO g1 VALUES ('a'),('a');
SELECT 1 FROM g1 WHERE a >= ANY
(SELECT 1 FROM g1 WHERE a = geomfromtext('') OR a) ;
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
DROP TABLE g1;
#
# Bug#16451878 GEOMETRY QUERY CRASHES SERVER
@@ -1661,3 +1735,129 @@ SET optimizer_switch=@save_optimizer_switch;
#
# End 10.0 tests
#
+SHOW CREATE TABLE information_schema.geometry_columns;
+Table Create Table
+GEOMETRY_COLUMNS CREATE TEMPORARY TABLE `GEOMETRY_COLUMNS` (
+ `F_TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
+ `F_TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
+ `F_TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `F_GEOMETRY_COLUMN` varchar(64) NOT NULL DEFAULT '',
+ `G_TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
+ `G_TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
+ `G_TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `G_GEOMETRY_COLUMN` varchar(64) NOT NULL DEFAULT '',
+ `STORAGE_TYPE` tinyint(2) NOT NULL DEFAULT '0',
+ `GEOMETRY_TYPE` int(7) NOT NULL DEFAULT '0',
+ `COORD_DIMENSION` tinyint(2) NOT NULL DEFAULT '0',
+ `MAX_PPR` tinyint(2) NOT NULL DEFAULT '0',
+ `SRID` smallint(5) NOT NULL DEFAULT '0'
+) ENGINE=MEMORY DEFAULT CHARSET=utf8
+SHOW CREATE TABLE information_schema.spatial_ref_sys;
+Table Create Table
+SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` (
+ `SRID` smallint(5) NOT NULL DEFAULT '0',
+ `AUTH_NAME` varchar(512) NOT NULL DEFAULT '',
+ `AUTH_SRID` int(5) NOT NULL DEFAULT '0',
+ `SRTEXT` varchar(2048) NOT NULL DEFAULT ''
+) ENGINE=MEMORY DEFAULT CHARSET=utf8
+create table t1(g GEOMETRY, pt POINT);
+create table t2(g LINESTRING, pl POLYGON);
+select * from information_schema.geometry_columns where f_table_schema='test';
+F_TABLE_CATALOG F_TABLE_SCHEMA F_TABLE_NAME F_GEOMETRY_COLUMN G_TABLE_CATALOG G_TABLE_SCHEMA G_TABLE_NAME G_GEOMETRY_COLUMN STORAGE_TYPE GEOMETRY_TYPE COORD_DIMENSION MAX_PPR SRID
+def test t1 def test t1 g 1 0 2 0 0
+def test t1 def test t1 pt 1 1 2 0 0
+def test t2 def test t2 g 1 2 2 0 0
+def test t2 def test t2 pl 1 3 2 0 0
+drop table t1, t2;
+10.1 tests
+create table t1(g GEOMETRY(9,4) REF_SYSTEM_ID=101, pt POINT(8,2), pg GEOMETRY REF_SYSTEM_ID=102);
+SELECT SRID from information_schema.geometry_columns WHERE f_table_schema='test' and G_TABLE_NAME='t1';
+SRID
+101
+0
+102
+drop table t1;
+# Expect an int(1) column to be created
+CREATE TABLE t1 AS SELECT CONTAINS(NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CONTAINS(NULL, NULL)` int(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# MDEV-7334 valgrind warning "unitialized bytes" in 10.1.
+#
+CREATE TABLE t1 (
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+ALTER TABLE t1 ADD fid INT NOT NULL;
+select SRID from information_schema.geometry_columns where F_TABLE_NAME='t1';
+SRID
+0
+0
+0
+0
+0
+0
+0
+0
+drop table t1;
+#
+# MDEV-7510 GIS: IsRing returns false for a primitive triangle.
+#
+select ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)'));
+ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)'))
+1
+select ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,-10 -10, 0 -10, 0 0)'));
+ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,-10 -10, 0 -10, 0 0)'))
+0
+#
+# MDEV-7514 GIS: PointOnSurface returns NULL instead of the point.
+#
+SELECT ST_GEOMETRYTYPE(ST_PointOnSurface(ST_PolyFromText('POLYGON((-70.916 42.1002,-70.9468 42.0946,-70.9754 42.0875,-70.9749 42.0879,-70.9759 42.0897,-70.916 42.1002))')));
+ST_GEOMETRYTYPE(ST_PointOnSurface(ST_PolyFromText('POLYGON((-70.916 42.1002,-70.9468 42.0946,-70.9754 42.0875,-70.9749 42.0879,-70.9759 42.0897,-70.916 42.1002))')))
+NULL
+#
+# MDEV-7529 GIS: ST_Relate returns unexpected results for POINT relations
+#
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'T*F**FFF*') AS equals;
+equals
+1
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'T*****FF*') AS contains;
+contains
+1
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'T*F**F***') AS within;
+within
+1
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(1 1)'),'FF*FF****') as disjoint;
+disjoint
+1
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'FF*FF****') as disjoint;
+disjoint
+0
+#
+# MDEV-7528 GIS: Functions return NULL instead of specified -1 for NULL arguments.
+#
+select ST_IsRing(NULL);
+ST_IsRing(NULL)
+-1
+#
+# MDEV-8675 Different results of GIS functions on NULL vs NOT NULL columns
+#
+CREATE TABLE t1 (g1 GEOMETRY NOT NULL,g2 GEOMETRY NULL);
+CREATE TABLE t2 AS SELECT WITHIN(g1,g1) as w1,WITHIN(g2,g2) AS w2 FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `w1` int(1) DEFAULT NULL,
+ `w2` int(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 0b17e82e5a9..826d1f6c6b2 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1,3 +1,5 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
drop table if exists t1;
@@ -57,6 +59,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
@@ -84,7 +88,7 @@ delete from mysql.user where user='mysqltest_1';
flush privileges;
delete from mysql.user where user='mysqltest_1';
flush privileges;
-grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
+grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10 max_statement_time 60;
select * from mysql.user where user="mysqltest_1";
Host localhost
User mysqltest_1
@@ -130,10 +134,12 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 60.000000
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
-grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_STATEMENT_TIME 60.000000
+grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30 max_statement_time 0;
select * from mysql.user where user="mysqltest_1";
Host localhost
User mysqltest_1
@@ -179,6 +185,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
@@ -2600,3 +2608,4 @@ ERROR 42000: Access denied for user 'untrusted'@'localhost' to database 'secret'
# Connection default
DROP USER untrusted@localhost;
DROP DATABASE secret;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 9e9b3ffc4e5..cf58a2dc6f5 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -1,3 +1,5 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
SET NAMES binary;
drop database if exists mysqltest;
drop database if exists mysqltest_1;
@@ -335,7 +337,7 @@ delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
drop database mysqltest_1;
set password = password("changed");
-ERROR 42000: You are using MariaDB as an anonymous user and anonymous users are not allowed to change passwords
+ERROR 42000: You are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settings
lock table mysql.user write;
flush privileges;
grant all on *.* to 'mysqltest_1'@'localhost';
@@ -845,3 +847,4 @@ DROP USER mysqltest_u2@localhost;
DROP USER mysqltest_u3@localhost;
DROP USER mysqltest_u4@localhost;
DROP USER mysqltest_u5@localhost;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result
index fd51a83d4b2..d1722fc8ea9 100644
--- a/mysql-test/r/grant3.result
+++ b/mysql-test/r/grant3.result
@@ -1,3 +1,5 @@
+set global sql_mode="";
+set local sql_mode="";
SET NAMES binary;
drop table if exists t1;
delete from mysql.user where user like 'mysqltest\_%';
@@ -177,4 +179,5 @@ SELECT b FROM temp.t1;
ERROR 42000: SELECT command denied to user 'user2'@'localhost' for column 'b' in table 't1'
DROP USER 'user2'@'%';
DROP DATABASE temp;
+set global sql_mode=default;
End of 5.0 tests
diff --git a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result
index 60617acbd1f..5a0032cd338 100644
--- a/mysql-test/r/grant4.result
+++ b/mysql-test/r/grant4.result
@@ -1,4 +1,6 @@
drop database if exists mysqltest_db1;
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
create database mysqltest_db1;
use mysqltest_db1;
create table t_column_priv_only (a int, b int);
@@ -178,3 +180,38 @@ mysqltest_db1.t1 repair status OK
# Switching to connection 'default'.
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
+create user foo1 identified by password '11111111111111111111111111111111111111111';
+create user foo2 identified by password '2222222222222222';
+create user foo3 identified via mysql_native_password using '11111111111111111111111111111111111111111';
+create user foo4 identified via mysql_old_password using '2222222222222222';
+grant select on test.* to foo5 identified by password '11111111111111111111111111111111111111111';
+grant select on test.* to foo6 identified by password '2222222222222222';
+grant select on test.* to foo7 identified via mysql_native_password using '11111111111111111111111111111111111111111';
+grant select on test.* to foo8 identified via mysql_old_password using '2222222222222222';
+select user,password,plugin,authentication_string from mysql.user where user like 'foo%';
+user password plugin authentication_string
+foo1 11111111111111111111111111111111111111111
+foo2 2222222222222222
+foo3 11111111111111111111111111111111111111111
+foo4 2222222222222222
+foo5 11111111111111111111111111111111111111111
+foo6 2222222222222222
+foo7 11111111111111111111111111111111111111111
+foo8 2222222222222222
+drop user foo1;
+drop user foo2;
+drop user foo3;
+drop user foo4;
+drop user foo5;
+drop user foo6;
+drop user foo7;
+drop user foo8;
+create user foo1 identified via mysql_native_password using '00';
+ERROR HY000: Password hash should be a 41-digit hexadecimal number
+create user foo2 identified via mysql_native_password using '2222222222222222';
+ERROR HY000: Password hash should be a 41-digit hexadecimal number
+create user foo3 identified via mysql_old_password using '00';
+ERROR HY000: Password hash should be a 16-digit hexadecimal number
+create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111';
+ERROR HY000: Password hash should be a 16-digit hexadecimal number
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/grant_4332.result b/mysql-test/r/grant_4332.result
index 5a475bed6d8..93c0a24d164 100644
--- a/mysql-test/r/grant_4332.result
+++ b/mysql-test/r/grant_4332.result
@@ -1,3 +1,5 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
alter table mysql.user modify User char(16) binary not null default '';
alter table mysql.db modify User char(16) binary not null default '';
alter table mysql.tables_priv modify User char(16) binary not null default '';
@@ -30,3 +32,4 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def user() 253 141 14 N 1 31 8
user()
root@localhost
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/grant_cache_no_prot.result b/mysql-test/r/grant_cache_no_prot.result
index 777eb10cda6..34abd96f026 100644
--- a/mysql-test/r/grant_cache_no_prot.result
+++ b/mysql-test/r/grant_cache_no_prot.result
@@ -1,5 +1,9 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
@@ -219,3 +223,7 @@ flush privileges;
drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;
set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
+set GLOBAL sql_mode=default;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/r/grant_cache_ps_prot.result b/mysql-test/r/grant_cache_ps_prot.result
index b504dc4be35..5fe57c7c35d 100644
--- a/mysql-test/r/grant_cache_ps_prot.result
+++ b/mysql-test/r/grant_cache_ps_prot.result
@@ -1,5 +1,9 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
@@ -219,3 +223,7 @@ flush privileges;
drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;
set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
+set GLOBAL sql_mode=default;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/r/grant_explain_non_select.result b/mysql-test/r/grant_explain_non_select.result
index 85b0ae5c4b4..1dbb5b1e3c0 100644
--- a/mysql-test/r/grant_explain_non_select.result
+++ b/mysql-test/r/grant_explain_non_select.result
@@ -1,3 +1,5 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
CREATE DATABASE privtest_db;
CREATE TABLE privtest_db.t1 (a INT);
CREATE TABLE privtest_db.t2 (a INT);
@@ -140,7 +142,7 @@ REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
CREATE VIEW privtest_db.v1 (a) AS SELECT a FROM privtest_db.t1;
GRANT SELECT, INSERT, UPDATE, DELETE ON privtest_db.v1 TO 'privtest'@'localhost';
EXPLAIN SELECT * FROM v1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
SELECT * FROM v1;
a
11
@@ -150,29 +152,31 @@ a
4
4
EXPLAIN INSERT INTO v1 VALUES (10);
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
INSERT INTO v1 VALUES (10);
EXPLAIN INSERT INTO v1 SELECT * FROM t2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
INSERT INTO v1 SELECT * FROM t2;
EXPLAIN REPLACE INTO v1 VALUES (10);
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
REPLACE INTO v1 VALUES (10);
EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
REPLACE INTO v1 SELECT * FROM t2;
EXPLAIN UPDATE v1 SET a = a + 1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
UPDATE v1 SET a = a + 1;
EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
EXPLAIN DELETE FROM v1 WHERE a = 10;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
DELETE FROM v1 WHERE a = 10;
EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
DROP USER 'privtest'@localhost;
USE test;
DROP DATABASE privtest_db;
+set GLOBAL sql_mode=default;
+set LOCAL sql_mode=default;
diff --git a/mysql-test/r/grant_lowercase.result b/mysql-test/r/grant_lowercase.result
index f13b077c214..b449453a47a 100644
--- a/mysql-test/r/grant_lowercase.result
+++ b/mysql-test/r/grant_lowercase.result
@@ -1,3 +1,4 @@
+set sql_mode="";
grant file on *.* to user1@localhost with grant option;
grant select on `a%`.* to user1@localhost with grant option;
grant file on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.* to 'user'@'%' identified by 'secret';
@@ -5,7 +6,7 @@ ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
drop user user1@localhost;
call mtr.add_suppression("Incorrect database name");
alter table mysql.host modify Db varchar(200);
-alter table mysql.db modify User char(16), modify Db varchar(200);
+alter table mysql.db modify User char(16) default "", modify Db varchar(200) default "";
insert mysql.host set db=concat('=>', repeat(_utf8 'й', 200));
Warnings:
Warning 1265 Data truncated for column 'Db' at row 1
@@ -15,6 +16,6 @@ Warning 1265 Data truncated for column 'Db' at row 1
flush privileges;
delete from mysql.host where db like '=>%';
delete from mysql.db where db like '=>%';
-alter table mysql.host modify Db char(64);
-alter table mysql.db modify Db char(64), modify User char(80);
+alter table mysql.host modify Db char(64) default "";
+alter table mysql.db modify Db char(64) default "", modify User char(80) default "";
flush privileges;
diff --git a/mysql-test/r/grant_lowercase_fs.result b/mysql-test/r/grant_lowercase_fs.result
index 5a3087ed5cd..eb27b1d7ea0 100644
--- a/mysql-test/r/grant_lowercase_fs.result
+++ b/mysql-test/r/grant_lowercase_fs.result
@@ -1,4 +1,6 @@
create database db1;
+create user user_1@localhost;
+create user USER_1@localhost;
GRANT CREATE ON db1.* to user_1@localhost;
GRANT SELECT ON db1.* to USER_1@localhost;
CREATE TABLE t1(f1 int);
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index ed08315cf6a..eb730a8c954 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -522,6 +522,7 @@ NULL 9
3
b 1
drop table t1;
+set big_tables=0;
create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1);
create table t2 (a int not null, b int not null, key(a));
@@ -659,7 +660,10 @@ insert into t1 (a,b) values (1,2),(1,3),(2,5);
select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1;
a r2 r1
1 1.0 2
-select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2;
+select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2;
+a r2 r1
+1 2 2
+select a, round(rand(100)*10) r2, sum(1) r1 from t1 group by a having r1>1 and r2<=2;
a r2 r1
1 2 2
select a,sum(b) from t1 where a=1 group by c;
@@ -668,6 +672,12 @@ a sum(b)
select a*sum(b) from t1 where a=1 group by c;
a*sum(b)
5
+select a*sum(b) as f1 from t1 where a=1 group by c having f1 <= 10;
+f1
+5
+select a,a*sum(b) as f1 from t1 where a=1 group by c having a*sum(b)+0 <= 10;
+a f1
+1 5
select sum(a)*sum(b) from t1 where a=1 group by c;
sum(a)*sum(b)
10
@@ -1988,12 +1998,12 @@ SHOW SESSION STATUS LIKE 'Sort_scan%';
Variable_name Value
Sort_scan 0
EXPLAIN SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2
-FROM t1 GROUP BY field1, field2;;
+FROM t1 GROUP BY field1, field2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx 5 NULL 20 Using index; Using filesort
FLUSH STATUS;
SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2
-FROM t1 GROUP BY field1, field2;;
+FROM t1 GROUP BY field1, field2;
field1 field2
1 1
2 2
@@ -2082,6 +2092,58 @@ f1 f2
19 19
20 20
explain
+select col1 f1, col1 f2 from t1 group by f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL idx 5 NULL 20 Using index
+select col1 f1, col1 f2 from t1 group by f1;
+f1 f2
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+11 11
+12 12
+13 13
+14 14
+15 15
+16 16
+17 17
+18 18
+19 19
+20 20
+explain
+select col1 f1, col1 f2 from t1 group by f1, f2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL idx 5 NULL 20 Using index
+select col1 f1, col1 f2 from t1 group by f1, f2;
+f1 f2
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+11 11
+12 12
+13 13
+14 14
+15 15
+16 16
+17 17
+18 18
+19 19
+20 20
+explain
select col1 f1, col1 f2 from t1 group by f2 order by f2, f1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx 5 NULL 20 Using index
@@ -2141,6 +2203,22 @@ INSERT INTO t2(col1, col2) VALUES
(1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11),
(11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1);
explain
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL idx 5 NULL 7 Using index for group-by
+explain
+select SQL_BIG_RESULT col1 f1, col2 f2, col1 f3 from t2 group by f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL idx 5 NULL 7 Using index for group-by
+explain
+select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL idx 10 NULL 20 Using index
+explain
+select col1 f1, col1 f2 from t2 group by f1, 1+1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL idx 5 NULL 7 Using index for group-by
+explain
select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2, f3+0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL idx 10 NULL 20 Using index; Using temporary; Using filesort
@@ -2167,6 +2245,10 @@ f1 f2 f3
19 2 19
20 1 20
explain
+select col1 f1, col2 f2, col1 f3 from t2 order by f1,f2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL idx 10 NULL 20 Using index
+explain
select col1 f1, col2 f2, col1 f3 from t2 order by f1, f2, f3+0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL idx 10 NULL 20 Using index; Using filesort
@@ -2207,20 +2289,16 @@ field1 field2
2004-10-11 18:13:00 1
2009-02-19 02:05:00 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'x'
Warning 1292 Truncated incorrect DOUBLE value: 'g'
Warning 1292 Truncated incorrect DOUBLE value: 'o'
-Warning 1292 Truncated incorrect DOUBLE value: 'g'
Warning 1292 Truncated incorrect DOUBLE value: 'v'
SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ;
field1 field2
2004-10-11 18:13:00 1
2009-02-19 02:05:00 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'x'
Warning 1292 Truncated incorrect DOUBLE value: 'g'
Warning 1292 Truncated incorrect DOUBLE value: 'o'
-Warning 1292 Truncated incorrect DOUBLE value: 'g'
Warning 1292 Truncated incorrect DOUBLE value: 'v'
SET SESSION SQL_MODE=default;
drop table t1;
@@ -2628,3 +2706,89 @@ field1 field2
DROP TABLE t1;
DROP TABLE where_subselect;
# End of Bug #58782
+#
+# MDEV-8988: Apparently valid SQL query gives wrong result (nested WHERE)
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int, c int);
+insert into t1 select A.a + 10*B.a, A.a, A.a + 10*B.a from t0 A, t0 B;
+insert into t1 values (NULL, NULL, NULL);
+create table t2 (c int, col1 int, key(c));
+insert into t2 select t1.a, 100000 from t1;
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status Table is already up to date
+explain
+select
+max(a)+ (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 101 Using temporary; Using filesort
+2 DEPENDENT SUBQUERY t2 ref c c 5 func 1
+select
+max(a) + (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+max(a) + (select col1 from t2 where t2.c=t1.c)
+NULL
+100090
+100091
+100092
+100093
+100094
+100095
+100096
+100097
+100098
+100099
+drop table t0,t1,t2;
+#
+# MDEV-9602 crash in st_key::actual_rec_per_key when group by constant
+#
+create table t1 (a date not null,unique (a)) engine=innodb;
+Warnings:
+Warning 1286 Unknown storage engine 'innodb'
+Warning 1266 Using storage engine MyISAM for table 't1'
+select distinct a from t1 group by 'a';
+a
+insert into t1 values("2001-02-02"),("2001-02-03");
+select distinct a from t1 group by 'a';
+a
+2001-02-02
+drop table t1;
+#
+# MDEV-10324: Server crash in get_sel_arg_for_keypart or Assertion `n < size()' failed in Mem_root_array
+#
+CREATE TABLE t1 (
+job_id int(10) unsigned NOT NULL AUTO_INCREMENT,
+job_cmd varbinary(60) NOT NULL DEFAULT '',
+job_namespace int(11) NOT NULL,
+job_title varbinary(255) NOT NULL,
+job_params blob NOT NULL,
+job_timestamp varbinary(14) DEFAULT NULL,
+job_random int(10) unsigned NOT NULL DEFAULT '0',
+job_token varbinary(32) NOT NULL DEFAULT '',
+job_token_timestamp varbinary(14) DEFAULT NULL,
+job_sha1 varbinary(32) NOT NULL DEFAULT '',
+job_attempts int(10) unsigned NOT NULL DEFAULT '0',
+PRIMARY KEY (job_id),
+KEY job_cmd (job_cmd,job_namespace,job_title,job_params(128)),
+KEY job_timestamp (job_timestamp),
+KEY job_sha1 (job_sha1),
+KEY job_cmd_token (job_cmd,job_token,job_random),
+KEY job_cmd_token_id (job_cmd,job_token,job_id)
+);
+INSERT INTO t1 VALUES
+(NULL, 'foo', 1, 'foo', 'foo', 'foo', 1, 'foo', 'foo', 'foo', 1),
+(NULL, 'bar', 2, 'bar', 'bar', 'bar', 2, 'bar', 'bar', 'bar', 2);
+SELECT DISTINCT job_cmd FROM t1 WHERE job_cmd IN ('foobar','null');
+job_cmd
+drop table t1;
+CREATE TABLE t1 (f1 INT NOT NULL, f2 VARCHAR(3) NOT NULL, KEY(f1), KEY(f2, f1));
+INSERT INTO t1 VALUES (0,'foo'),(1,'bar');
+SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
+1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 )
+0
+drop table t1;
diff --git a/mysql-test/r/group_by_innodb.result b/mysql-test/r/group_by_innodb.result
index af68640c0b1..034866b63d5 100644
--- a/mysql-test/r/group_by_innodb.result
+++ b/mysql-test/r/group_by_innodb.result
@@ -133,4 +133,39 @@ NULL
SELECT i FROM t1 order by i LIMIT 1;
i
DROP TABLE t1;
+# Port of testcase:
+#
+# Bug#20819199 ASSERTION FAILED IN TEST_IF_SKIP_SORT_ORDER
+#
+CREATE TABLE t0 ( a INT );
+INSERT INTO t0 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE t1 (
+pk INT NOT NULL AUTO_INCREMENT,
+a INT,
+b INT,
+PRIMARY KEY (pk),
+KEY idx1 (a),
+KEY idx2 (b, a),
+KEY idx3 (a, b)
+) ENGINE = InnoDB;
+INSERT INTO t1 (a, b) SELECT t01.a, t02.a FROM t0 t01, t0 t02;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+EXPLAIN SELECT DISTINCT a, MAX(b) FROM t1 WHERE a >= 0 GROUP BY a,a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx3 idx3 5 NULL 100 Using where; Using index
+SELECT DISTINCT a, MAX(b) FROM t1 WHERE a >= 0 GROUP BY a,a;
+a MAX(b)
+1 10
+2 10
+3 10
+4 10
+5 10
+6 10
+7 10
+8 10
+9 10
+10 10
+DROP TABLE t0, t1;
# End of tests
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index 25cd4a25279..cd7f1014ec0 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -1707,13 +1707,13 @@ select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1
a1 a2 b
explain select distinct a1,a2,b from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
+1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using index
explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
+1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 50.78 Using where; Using index
+1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 100.00 Using where; Using index
Warnings:
Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 'a') and (`test`.`t1`.`c` = 'i121') and (`test`.`t1`.`a2` >= 'b'))
explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
@@ -1724,13 +1724,13 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
explain select distinct a1,a2,b from t2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using index for group-by
+1 SIMPLE t2 index NULL idx_t2_2 146 NULL # Using index
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
+1 SIMPLE t2 index NULL idx_t2_2 146 NULL # Using where; Using index
explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 50.61 Using where; Using index
+1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 100.00 Using where; Using index
Warnings:
Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`b` = 'a') and (`test`.`t2`.`c` = 'i121') and (`test`.`t2`.`a2` >= 'b'))
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
@@ -1855,7 +1855,7 @@ c e
d e
explain select distinct a1,a2,b from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
+1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using index
explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
@@ -1870,7 +1870,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by; Using temporary; Using filesort
explain select distinct a1,a2,b from t2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using index for group-by
+1 SIMPLE t2 index NULL idx_t2_2 146 NULL # Using index
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
@@ -1953,10 +1953,10 @@ b
a
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
+1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 163 NULL 65 Using where; Using index for group-by (scanning)
+1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 100.00 Using where; Using index for group-by
@@ -2173,7 +2173,7 @@ c
d
explain select distinct a1 from t1 where a2 = 'b';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using where; Using index for group-by
+1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
select distinct a1 from t1 where a2 = 'b';
a1
a
@@ -2283,7 +2283,7 @@ INSERT INTO t1 (a) VALUES
('SOUTH EAST'), ('SOUTH WEST'), ('WESTERN');
EXPLAIN SELECT DISTINCT a,a FROM t1 ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 66 NULL 6 Using index for group-by
+1 SIMPLE t1 index NULL a 66 NULL 11 Using index
SELECT DISTINCT a,a FROM t1 ORDER BY a;
a a
@@ -2499,7 +2499,7 @@ INSERT INTO t1 VALUES
(4), (2), (1), (2), (2), (4), (1), (4);
EXPLAIN SELECT DISTINCT(a) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by
+1 SIMPLE t1 index NULL idx 5 NULL 16 Using index
SELECT DISTINCT(a) FROM t1;
a
1
@@ -2507,7 +2507,7 @@ a
4
EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by
+1 SIMPLE t1 index NULL idx 5 NULL 16 Using index
SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
a
1
@@ -2646,7 +2646,7 @@ INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT a,b,c+1,d FROM t1;
EXPLAIN SELECT DISTINCT c FROM t1 WHERE d=4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL foo 10 NULL 9 Using where; Using index for group-by
+1 SIMPLE t1 index NULL foo 20 NULL 32 Using where; Using index
SELECT DISTINCT c FROM t1 WHERE d=4;
c
1
@@ -3339,19 +3339,19 @@ INSERT INTO t2 SELECT a, b + 4, c,d,e,f FROM t2;
INSERT INTO t2 SELECT a + 1, b, c,d,e,f FROM t2;
EXPLAIN SELECT COUNT(DISTINCT a) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
SELECT COUNT(DISTINCT a) FROM t1;
COUNT(DISTINCT a)
2
EXPLAIN SELECT COUNT(DISTINCT a,b) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
SELECT COUNT(DISTINCT a,b) FROM t1;
COUNT(DISTINCT a,b)
16
EXPLAIN SELECT COUNT(DISTINCT b,a) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
SELECT COUNT(DISTINCT b,a) FROM t1;
COUNT(DISTINCT b,a)
16
@@ -3414,7 +3414,7 @@ COUNT(DISTINCT a)
2
EXPLAIN SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
1
1
@@ -3435,19 +3435,19 @@ COUNT(DISTINCT t1_1.a)
1
EXPLAIN SELECT COUNT(DISTINCT a), 12 FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
SELECT COUNT(DISTINCT a), 12 FROM t1;
COUNT(DISTINCT a) 12
2 12
EXPLAIN SELECT COUNT(DISTINCT a, b, c) FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL a 15 NULL 9 Using index for group-by
+1 SIMPLE t2 index NULL a 15 NULL 16 Using index
SELECT COUNT(DISTINCT a, b, c) FROM t2;
COUNT(DISTINCT a, b, c)
16
EXPLAIN SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+1 SIMPLE t2 index NULL a 15 NULL 16 Using index
SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
COUNT(DISTINCT a) SUM(DISTINCT a) AVG(DISTINCT a)
2 3 1.5000
@@ -3459,7 +3459,7 @@ COUNT(DISTINCT a) SUM(DISTINCT a) AVG(DISTINCT f)
2 3 1.0000
EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
+1 SIMPLE t2 index NULL a 15 NULL 16 Using index
SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
COUNT(DISTINCT a, b) COUNT(DISTINCT b, a)
16 16
@@ -3735,3 +3735,163 @@ DROP TABLE t1;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-6990 GROUP_MIN_MAX optimization is not applied in some cases when it could
+#
+CREATE TABLE t1 (id INT NOT NULL, a DATE, KEY(id,a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,'2001-01-01');
+INSERT INTO t1 VALUES (1,'2001-01-02');
+INSERT INTO t1 VALUES (1,'2001-01-03');
+INSERT INTO t1 VALUES (1,'2001-01-04');
+INSERT INTO t1 VALUES (2,'2001-01-01');
+INSERT INTO t1 VALUES (2,'2001-01-02');
+INSERT INTO t1 VALUES (2,'2001-01-03');
+INSERT INTO t1 VALUES (2,'2001-01-04');
+INSERT INTO t1 VALUES (3,'2001-01-01');
+INSERT INTO t1 VALUES (3,'2001-01-02');
+INSERT INTO t1 VALUES (3,'2001-01-03');
+INSERT INTO t1 VALUES (3,'2001-01-04');
+INSERT INTO t1 VALUES (4,'2001-01-01');
+INSERT INTO t1 VALUES (4,'2001-01-02');
+INSERT INTO t1 VALUES (4,'2001-01-03');
+INSERT INTO t1 VALUES (4,'2001-01-04');
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>='2001-01-04' GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104.0 GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>='2001-01-04' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104.0 GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+DROP TABLE t1;
+#
+# MDEV-8229 GROUP_MIN_MAX is erroneously applied for BETWEEN in some cases
+#
+SET NAMES latin1;
+CREATE TABLE t1 (id INT NOT NULL, a VARCHAR(20)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,'2001-01-01');
+INSERT INTO t1 VALUES (1,'2001-01-02');
+INSERT INTO t1 VALUES (1,'2001-01-03');
+INSERT INTO t1 VALUES (1,' 2001-01-04');
+INSERT INTO t1 VALUES (2,'2001-01-01');
+INSERT INTO t1 VALUES (2,'2001-01-02');
+INSERT INTO t1 VALUES (2,'2001-01-03');
+INSERT INTO t1 VALUES (2,' 2001-01-04');
+INSERT INTO t1 VALUES (3,'2001-01-01');
+INSERT INTO t1 VALUES (3,'2001-01-02');
+INSERT INTO t1 VALUES (3,'2001-01-03');
+INSERT INTO t1 VALUES (3,' 2001-01-04');
+INSERT INTO t1 VALUES (4,'2001-01-01');
+INSERT INTO t1 VALUES (4,'2001-01-02');
+INSERT INTO t1 VALUES (4,'2001-01-03');
+INSERT INTO t1 VALUES (4,' 2001-01-04');
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN ' 2001-01-04' AND '2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-03
+2 2001-01-04 2001-01-03
+3 2001-01-04 2001-01-03
+4 2001-01-04 2001-01-03
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND '2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+ALTER TABLE t1 ADD KEY(id,a);
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN ' 2001-01-04' AND '2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-03
+2 2001-01-04 2001-01-03
+3 2001-01-04 2001-01-03
+4 2001-01-04 2001-01-03
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND '2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+id MIN(a) MAX(a)
+1 2001-01-04 2001-01-04
+2 2001-01-04 2001-01-04
+3 2001-01-04 2001-01-04
+4 2001-01-04 2001-01-04
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN ' 2001-01-04' AND '2001-01-05' GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL id 27 NULL 9 Using where; Using index for group-by
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND '2001-01-05' GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL id 27 NULL 9 Using where; Using index for group-by
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL id 27 NULL 16 Using where; Using index
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL id 27 NULL 16 Using where; Using index
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL id 27 NULL 16 Using where; Using index
+DROP TABLE t1;
+#
+# MIN() optimization didn't work correctly with BETWEEN when using too
+# long strings.
+#
+create table t1 (a varchar(10), key (a)) engine=myisam;
+insert into t1 values("bar"),("Cafe");
+explain select min(a) from t1 where a between "a" and "Cafe2";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+explain select min(a) from t1 where a between "a" and "Cafeeeeeeeeeeeeeeeeeeeeeeeeee";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index a a 13 NULL 2 Using where; Using index
+explain select min(a) from t1 where a between "abbbbbbbbbbbbbbbbbbbb" and "Cafe2";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index a a 13 NULL 2 Using where; Using index
+drop table t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/handlersocket.result b/mysql-test/r/handlersocket.result
index b519e2e7c93..1b3fc573548 100644
--- a/mysql-test/r/handlersocket.result
+++ b/mysql-test/r/handlersocket.result
@@ -5,7 +5,7 @@ plugin_version 1.0
plugin_status ACTIVE
plugin_type DAEMON
plugin_library handlersocket.so
-plugin_library_version 1.8
+plugin_library_version 1.13
plugin_author higuchi dot akira at dena dot jp
plugin_description Direct access into InnoDB
plugin_license BSD
diff --git a/mysql-test/r/have_ndb_extra.require b/mysql-test/r/have_ndb_extra.require
deleted file mode 100644
index 8f7c125196a..00000000000
--- a/mysql-test/r/have_ndb_extra.require
+++ /dev/null
@@ -1,3 +0,0 @@
-select 1;
-1
-1
diff --git a/mysql-test/r/have_ndbapi_examples.require b/mysql-test/r/have_ndbapi_examples.require
deleted file mode 100644
index 924d2d51708..00000000000
--- a/mysql-test/r/have_ndbapi_examples.require
+++ /dev/null
@@ -1,2 +0,0 @@
-have_ndb_example
-1
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 0b933427303..f7503597d32 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -724,3 +724,23 @@ c1 c2
x x
DROP TABLE t1,t2;
End of 10.0 tests
+#
+# MDEV-10716: Assertion `real_type() != FIELD_ITEM' failed in
+# Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**)
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT i, COUNT(*) FROM t1 GROUP BY i HAVING i<>0 AND 1;
+i COUNT(*)
+1 1
+2 1
+SELECT i-1 A, COUNT(*) FROM t1 GROUP BY i HAVING A AND 1;
+A COUNT(*)
+1 1
+CREATE VIEW v1 as select i, i-1 as A from t1;
+SELECT A, COUNT(*) FROM v1 GROUP BY i HAVING A AND 1;
+A COUNT(*)
+1 1
+DROP VIEW v1;
+DROP TABLE t1;
+End of 10.1 tests
diff --git a/mysql-test/r/help.result b/mysql-test/r/help.result
index 319a1ba3e85..aefe6f8381e 100644
--- a/mysql-test/r/help.result
+++ b/mysql-test/r/help.result
@@ -163,10 +163,12 @@ impossible_function_1 description of
example of
impossible_function1
SET sql_mode=DEFAULT;
+set sql_mode="";
alter table mysql.help_relation engine=innodb;
alter table mysql.help_keyword engine=innodb;
alter table mysql.help_topic engine=innodb;
alter table mysql.help_category engine=innodb;
+set sql_mode=default;
help 'function_of_my_dream';
name is_it_category
help '%possible_f%';
diff --git a/mysql-test/r/host_cache_size_functionality.result b/mysql-test/r/host_cache_size_functionality.result
index e7f9e09fd2f..069cf61bcad 100644
--- a/mysql-test/r/host_cache_size_functionality.result
+++ b/mysql-test/r/host_cache_size_functionality.result
@@ -6,7 +6,7 @@ echo '##'
####################################################################
SELECT COUNT(@@GLOBAL.Host_Cache_Size)
1 Expected
-set @Default_host_cache_size=128;
+set @Default_host_cache_size=279;
select @@global.Host_Cache_Size=@Default_host_cache_size;
@@global.Host_Cache_Size=@Default_host_cache_size
1
diff --git a/mysql-test/r/implicit_commit.result b/mysql-test/r/implicit_commit.result
index d568d05e7b7..07536ab0719 100644
--- a/mysql-test/r/implicit_commit.result
+++ b/mysql-test/r/implicit_commit.result
@@ -1,3 +1,4 @@
+SET SQL_MODE="";
SET GLOBAL EVENT_SCHEDULER = OFF;
SET BINLOG_FORMAT = STATEMENT;
CREATE DATABASE db1;
diff --git a/mysql-test/r/index_intersect.result b/mysql-test/r/index_intersect.result
index 1337c3fac2d..7a0633d4dc8 100644
--- a/mysql-test/r/index_intersect.result
+++ b/mysql-test/r/index_intersect.result
@@ -1013,10 +1013,7 @@ f4 varchar(32),
f5 int,
PRIMARY KEY (f1),
KEY (f4)
-) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+);
INSERT INTO t1 VALUES
(5,'H',1), (9,'g',0), (527,'i',0), (528,'y',1), (529,'S',6),
(530,'m',7), (531,'b',2), (532,'N',1), (533,'V',NULL), (534,'l',1),
diff --git a/mysql-test/r/index_intersect_innodb.result b/mysql-test/r/index_intersect_innodb.result
index 33f2247e5d1..9c3a501111d 100644
--- a/mysql-test/r/index_intersect_innodb.result
+++ b/mysql-test/r/index_intersect_innodb.result
@@ -1014,7 +1014,7 @@ f4 varchar(32),
f5 int,
PRIMARY KEY (f1),
KEY (f4)
-) ENGINE=InnoDB;
+);
INSERT INTO t1 VALUES
(5,'H',1), (9,'g',0), (527,'i',0), (528,'y',1), (529,'S',6),
(530,'m',7), (531,'b',2), (532,'N',1), (533,'V',NULL), (534,'l',1),
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index b3beff5a967..6ec17254809 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -74,7 +74,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 index_merge i1,i2 i1,i2 4,4 NULL 17 Using sort_union(i1,i2); Using where
explain select * from t0 where key2 = 45 or key1 <=> null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t0 range i1,i2 i2 4 NULL 1 Using where
+1 SIMPLE t0 range i1,i2 i2 4 NULL 1 Using index condition
explain select * from t0 where key2 = 45 or key1 is not null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL i1,i2 NULL NULL NULL 1024 Using where
diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result
index 9bf015d1b37..112d4842e42 100644
--- a/mysql-test/r/information_schema-big.result
+++ b/mysql-test/r/information_schema-big.result
@@ -31,6 +31,7 @@ ENABLED_ROLES ROLE_NAME
ENGINES ENGINE
EVENTS EVENT_SCHEMA
FILES TABLE_SCHEMA
+GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
@@ -47,7 +48,9 @@ SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
+SPATIAL_REF_SYS SRID
STATISTICS TABLE_SCHEMA
+SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
@@ -85,6 +88,7 @@ ENABLED_ROLES ROLE_NAME
ENGINES ENGINE
EVENTS EVENT_SCHEMA
FILES TABLE_SCHEMA
+GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
@@ -101,7 +105,9 @@ SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
+SPATIAL_REF_SYS SRID
STATISTICS TABLE_SCHEMA
+SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 21bb6abd7bd..2b5a536308a 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1,3 +1,5 @@
+set global sql_mode="";
+set local sql_mode="";
DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5;
DROP VIEW IF EXISTS v1;
show variables where variable_name like "skip_show_database";
@@ -42,7 +44,7 @@ insert into t5 values (10);
create view v1 (c) as
SELECT table_name FROM information_schema.TABLES
WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND
-table_name not like 'ndb_%' AND table_name not like 'innodb_%' AND
+table_name not like 'innodb_%' AND
table_name not like 'xtradb_%';
select * from v1;
c
@@ -58,6 +60,7 @@ ENABLED_ROLES
ENGINES
EVENTS
FILES
+GEOMETRY_COLUMNS
GLOBAL_STATUS
GLOBAL_VARIABLES
INDEX_STATISTICS
@@ -74,7 +77,9 @@ SCHEMATA
SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
+SPATIAL_REF_SYS
STATISTICS
+SYSTEM_VARIABLES
TABLES
TABLESPACES
TABLE_CONSTRAINTS
@@ -128,6 +133,11 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
+t1 t1
+t2 t2
+t3 t3
+t4 t4
+t5 t5
table_stats table_stats
tables_priv tables_priv
time_zone time_zone
@@ -135,11 +145,6 @@ time_zone_leap_second time_zone_leap_second
time_zone_name time_zone_name
time_zone_transition time_zone_transition
time_zone_transition_type time_zone_transition_type
-t1 t1
-t4 t4
-t2 t2
-t3 t3
-t5 t5
select c,table_name from v1
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
@@ -150,6 +155,11 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
+t1 t1
+t2 t2
+t3 t3
+t4 t4
+t5 t5
table_stats table_stats
tables_priv tables_priv
time_zone time_zone
@@ -157,11 +167,6 @@ time_zone_leap_second time_zone_leap_second
time_zone_name time_zone_name
time_zone_transition time_zone_transition
time_zone_transition_type time_zone_transition_type
-t1 t1
-t4 t4
-t2 t2
-t3 t3
-t5 t5
select c, v2.table_name from v1
right join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
@@ -172,6 +177,11 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
+t1 t1
+t2 t2
+t3 t3
+t4 t4
+t5 t5
table_stats table_stats
tables_priv tables_priv
time_zone time_zone
@@ -179,11 +189,6 @@ time_zone_leap_second time_zone_leap_second
time_zone_name time_zone_name
time_zone_transition time_zone_transition
time_zone_transition_type time_zone_transition_type
-t1 t1
-t4 t4
-t2 t2
-t3 t3
-t5 t5
select table_name from information_schema.TABLES
where table_schema = "mysqltest" and table_name like "t%";
table_name
@@ -237,7 +242,7 @@ where table_schema = 'mysqltest' and table_name = 'v1';
table_name column_name privileges
v1 c select
explain select * from v1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
drop view v1, mysqltest.v1;
drop tables mysqltest.t4, mysqltest.t1, t2, t3, t5;
drop database mysqltest;
@@ -423,12 +428,12 @@ latin1_spanish_ci
show keys from v4;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
select * from information_schema.views where TABLE_NAME like "v%";
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def test v0 select `information_schema`.`schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-def test v1 select `information_schema`.`tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`information_schema`.`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-def test v2 select `information_schema`.`columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`information_schema`.`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-def test v3 select `information_schema`.`character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`information_schema`.`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-def test v4 select `information_schema`.`collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`information_schema`.`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def test v0 select `information_schema`.`schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test v1 select `information_schema`.`tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`information_schema`.`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test v2 select `information_schema`.`columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`information_schema`.`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test v3 select `information_schema`.`character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`information_schema`.`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test v4 select `information_schema`.`collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`information_schema`.`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
drop view v0, v1, v2, v3, v4;
create table t1 (a int);
grant select,update,insert on t1 to mysqltest_1@localhost;
@@ -485,7 +490,7 @@ Note 1831 Duplicate index `key_2`. This is deprecated and will be disallowed in
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `constraint_1` (`a`),
UNIQUE KEY `key_1` (`a`),
@@ -524,10 +529,10 @@ create view v1 (c) as select a from t1 with check option;
create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION;
create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION;
select * from information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
-def test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
-def test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
grant select (a) on test.t1 to joe@localhost with grant option;
select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
@@ -715,6 +720,7 @@ max_user_connections select,insert,update,references
authentication_string select,insert,update,references
password_expired select,insert,update,references
is_role select,insert,update,references
+default_role select,insert,update,references
use test;
create function sub1(i int) returns int
return i+1;
@@ -781,6 +787,7 @@ Database Table In_use Name_locked
mysql user 0 0
show status where variable_name like "%database%";
Variable_name Value
+Acl_database_grants 2
Com_show_databases 3
show variables where variable_name like "skip_show_databas";
Variable_name Value
@@ -818,6 +825,7 @@ information_schema PROCESSLIST INFO
information_schema ROUTINES DTD_IDENTIFIER
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES ROUTINE_COMMENT
+information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
information_schema VIEWS VIEW_DEFINITION
@@ -1217,9 +1225,9 @@ create definer = mysqltest_1@localhost
sql security definer view v2 as select 1;
select * from information_schema.views
where table_name='v1' or table_name='v2';
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
-def test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
drop view v1, v2;
drop table t1;
drop user mysqltest_1@localhost;
@@ -1540,9 +1548,9 @@ TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATA
select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_TABLE` = NULL;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
explain extended select 1 from information_schema.tables;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE tables ALL NULL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
@@ -1627,9 +1635,32 @@ drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
-drop table if exists t1;drop table if exists
-Warnings:
-Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row 1
+drop table if exists t1;drop table if exists t1;
+select * from information_schema.global_variables where variable_name like 'init%' order by variable_name;
+VARIABLE_NAME VARIABLE_VALUE
+INIT_CONNECT drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+INIT_FILE
+INIT_SLAVE
set global init_connect="";
create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT';
SELECT 1;
@@ -1829,6 +1860,7 @@ DEFINER root@localhost
SECURITY_TYPE DEFINER
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
+ALGORITHM UNDEFINED
Warnings:
Level Warning
Code 1356
@@ -2036,3 +2068,36 @@ Variable_name Value
Opened_tables 3
drop database mysqltest;
drop database db1;
+set global sql_mode=default;
+USE test;
+#
+# End of 10.0 tests
+#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-13242 Wrong results for queries with row constructors and information_schema
+#
+CREATE TABLE tt1(c1 INT);
+CREATE TABLE tt2(c2 INT);
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (('tt1', 'c1'));
+count(*)
+1
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (('tt2', 'c2'));
+count(*)
+1
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (('tt1','c1'),('tt2', 'c2'));
+count(*)
+2
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (SELECT 'tt1','c1' FROM dual UNION SELECT 'tt2', 'c2' FROM dual);
+count(*)
+2
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name='tt1' AND column_name='c1') OR (table_name='tt2' AND column_name='c2');
+count(*)
+2
+SELECT column_name FROM information_schema.columns WHERE (table_name, column_name) IN (('tt1','c1'),('tt2', 'c2')) ORDER BY column_name;
+column_name
+c1
+c2
+DROP TABLE tt1, tt2;
diff --git a/mysql-test/r/information_schema_all_engines.result b/mysql-test/r/information_schema_all_engines.result
index 7e6cfd176a4..7f79dd883e2 100644
--- a/mysql-test/r/information_schema_all_engines.result
+++ b/mysql-test/r/information_schema_all_engines.result
@@ -13,6 +13,7 @@ ENABLED_ROLES
ENGINES
EVENTS
FILES
+GEOMETRY_COLUMNS
GLOBAL_STATUS
GLOBAL_VARIABLES
INDEX_STATISTICS
@@ -22,8 +23,8 @@ INNODB_CMPMEM
INNODB_CMPMEM_RESET
INNODB_CMP_PER_INDEX
INNODB_CMP_RESET
-INNODB_LOCKS
INNODB_LOCK_WAITS
+INNODB_MUTEXES
INNODB_SYS_COLUMNS
INNODB_SYS_FIELDS
INNODB_SYS_FOREIGN
@@ -31,6 +32,8 @@ INNODB_SYS_FOREIGN_COLS
INNODB_SYS_INDEXES
INNODB_SYS_TABLES
INNODB_SYS_TABLESTATS
+INNODB_TABLESPACES_ENCRYPTION
+INNODB_TABLESPACES_SCRUBBING
INNODB_TRX
KEY_CACHES
KEY_COLUMN_USAGE
@@ -45,7 +48,9 @@ SCHEMATA
SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
+SPATIAL_REF_SYS
STATISTICS
+SYSTEM_VARIABLES
TABLES
TABLESPACES
TABLE_CONSTRAINTS
@@ -82,6 +87,7 @@ ENABLED_ROLES ROLE_NAME
ENGINES ENGINE
EVENTS EVENT_SCHEMA
FILES TABLE_SCHEMA
+GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
@@ -91,8 +97,8 @@ INNODB_CMPMEM page_size
INNODB_CMPMEM_RESET page_size
INNODB_CMP_PER_INDEX database_name
INNODB_CMP_RESET page_size
-INNODB_LOCKS lock_id
INNODB_LOCK_WAITS requesting_trx_id
+INNODB_MUTEXES NAME
INNODB_SYS_COLUMNS TABLE_ID
INNODB_SYS_FIELDS INDEX_ID
INNODB_SYS_FOREIGN ID
@@ -100,6 +106,8 @@ INNODB_SYS_FOREIGN_COLS ID
INNODB_SYS_INDEXES INDEX_ID
INNODB_SYS_TABLES TABLE_ID
INNODB_SYS_TABLESTATS TABLE_ID
+INNODB_TABLESPACES_ENCRYPTION SPACE
+INNODB_TABLESPACES_SCRUBBING SPACE
INNODB_TRX trx_id
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
@@ -114,7 +122,9 @@ SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
+SPATIAL_REF_SYS SRID
STATISTICS TABLE_SCHEMA
+SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
@@ -151,6 +161,7 @@ ENABLED_ROLES ROLE_NAME
ENGINES ENGINE
EVENTS EVENT_SCHEMA
FILES TABLE_SCHEMA
+GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
@@ -160,8 +171,8 @@ INNODB_CMPMEM page_size
INNODB_CMPMEM_RESET page_size
INNODB_CMP_PER_INDEX database_name
INNODB_CMP_RESET page_size
-INNODB_LOCKS lock_id
INNODB_LOCK_WAITS requesting_trx_id
+INNODB_MUTEXES NAME
INNODB_SYS_COLUMNS TABLE_ID
INNODB_SYS_FIELDS INDEX_ID
INNODB_SYS_FOREIGN ID
@@ -169,6 +180,8 @@ INNODB_SYS_FOREIGN_COLS ID
INNODB_SYS_INDEXES INDEX_ID
INNODB_SYS_TABLES TABLE_ID
INNODB_SYS_TABLESTATS TABLE_ID
+INNODB_TABLESPACES_ENCRYPTION SPACE
+INNODB_TABLESPACES_SCRUBBING SPACE
INNODB_TRX trx_id
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
@@ -183,7 +196,9 @@ SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
+SPATIAL_REF_SYS SRID
STATISTICS TABLE_SCHEMA
+SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
@@ -225,6 +240,7 @@ COLUMN_PRIVILEGES information_schema.COLUMN_PRIVILEGES 1
ENGINES information_schema.ENGINES 1
EVENTS information_schema.EVENTS 1
FILES information_schema.FILES 1
+GEOMETRY_COLUMNS information_schema.GEOMETRY_COLUMNS 1
GLOBAL_STATUS information_schema.GLOBAL_STATUS 1
GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
@@ -234,8 +250,8 @@ INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
INNODB_CMP_PER_INDEX information_schema.INNODB_CMP_PER_INDEX 1
INNODB_CMP_RESET information_schema.INNODB_CMP_RESET 1
-INNODB_LOCKS information_schema.INNODB_LOCKS 1
INNODB_LOCK_WAITS information_schema.INNODB_LOCK_WAITS 1
+INNODB_MUTEXES information_schema.INNODB_MUTEXES 1
INNODB_SYS_COLUMNS information_schema.INNODB_SYS_COLUMNS 1
INNODB_SYS_FIELDS information_schema.INNODB_SYS_FIELDS 1
INNODB_SYS_FOREIGN information_schema.INNODB_SYS_FOREIGN 1
@@ -243,6 +259,8 @@ INNODB_SYS_FOREIGN_COLS information_schema.INNODB_SYS_FOREIGN_COLS 1
INNODB_SYS_INDEXES information_schema.INNODB_SYS_INDEXES 1
INNODB_SYS_TABLES information_schema.INNODB_SYS_TABLES 1
INNODB_SYS_TABLESTATS information_schema.INNODB_SYS_TABLESTATS 1
+INNODB_TABLESPACES_ENCRYPTION information_schema.INNODB_TABLESPACES_ENCRYPTION 1
+INNODB_TABLESPACES_SCRUBBING information_schema.INNODB_TABLESPACES_SCRUBBING 1
INNODB_TRX information_schema.INNODB_TRX 1
KEY_CACHES information_schema.KEY_CACHES 1
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
@@ -257,7 +275,9 @@ SCHEMATA information_schema.SCHEMATA 1
SCHEMA_PRIVILEGES information_schema.SCHEMA_PRIVILEGES 1
SESSION_STATUS information_schema.SESSION_STATUS 1
SESSION_VARIABLES information_schema.SESSION_VARIABLES 1
+SPATIAL_REF_SYS information_schema.SPATIAL_REF_SYS 1
STATISTICS information_schema.STATISTICS 1
+SYSTEM_VARIABLES information_schema.SYSTEM_VARIABLES 1
TABLES information_schema.TABLES 1
TABLESPACES information_schema.TABLESPACES 1
TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
@@ -284,6 +304,7 @@ Database: information_schema
| ENGINES |
| EVENTS |
| FILES |
+| GEOMETRY_COLUMNS |
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| INDEX_STATISTICS |
@@ -293,8 +314,8 @@ Database: information_schema
| INNODB_CMPMEM_RESET |
| INNODB_CMP_PER_INDEX |
| INNODB_CMP_RESET |
-| INNODB_LOCKS |
| INNODB_LOCK_WAITS |
+| INNODB_MUTEXES |
| INNODB_SYS_COLUMNS |
| INNODB_SYS_FIELDS |
| INNODB_SYS_FOREIGN |
@@ -302,6 +323,8 @@ Database: information_schema
| INNODB_SYS_INDEXES |
| INNODB_SYS_TABLES |
| INNODB_SYS_TABLESTATS |
+| INNODB_TABLESPACES_ENCRYPTION |
+| INNODB_TABLESPACES_SCRUBBING |
| INNODB_TRX |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
@@ -316,7 +339,9 @@ Database: information_schema
| SCHEMA_PRIVILEGES |
| SESSION_STATUS |
| SESSION_VARIABLES |
+| SPATIAL_REF_SYS |
| STATISTICS |
+| SYSTEM_VARIABLES |
| TABLES |
| TABLESPACES |
| TABLE_CONSTRAINTS |
@@ -343,6 +368,7 @@ Database: INFORMATION_SCHEMA
| ENGINES |
| EVENTS |
| FILES |
+| GEOMETRY_COLUMNS |
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| INDEX_STATISTICS |
@@ -352,8 +378,8 @@ Database: INFORMATION_SCHEMA
| INNODB_CMPMEM_RESET |
| INNODB_CMP_PER_INDEX |
| INNODB_CMP_RESET |
-| INNODB_LOCKS |
| INNODB_LOCK_WAITS |
+| INNODB_MUTEXES |
| INNODB_SYS_COLUMNS |
| INNODB_SYS_FIELDS |
| INNODB_SYS_FOREIGN |
@@ -361,6 +387,8 @@ Database: INFORMATION_SCHEMA
| INNODB_SYS_INDEXES |
| INNODB_SYS_TABLES |
| INNODB_SYS_TABLESTATS |
+| INNODB_TABLESPACES_ENCRYPTION |
+| INNODB_TABLESPACES_SCRUBBING |
| INNODB_TRX |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
@@ -375,7 +403,9 @@ Database: INFORMATION_SCHEMA
| SCHEMA_PRIVILEGES |
| SESSION_STATUS |
| SESSION_VARIABLES |
+| SPATIAL_REF_SYS |
| STATISTICS |
+| SYSTEM_VARIABLES |
| TABLES |
| TABLESPACES |
| TABLE_CONSTRAINTS |
@@ -391,7 +421,7 @@ Database: INFORMATION_SCHEMA
Wildcard: inf_rmation_schema
| Databases |
| information_schema |
-SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
+SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 54
+information_schema 59
mysql 30
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index 81a17e7ed3b..c09e04f786a 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -1,3 +1,5 @@
+set local sql_mode="";
+set global sql_mode="";
drop table if exists t1,t2;
drop view if exists v1,v2;
drop function if exists f1;
@@ -216,3 +218,4 @@ show create view testdb_1.v1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v1'
drop user mysqltest_1@localhost;
drop database testdb_1;
+set global sql_mode=default;
diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result
index 838a7ad5162..7755d112f8e 100644
--- a/mysql-test/r/information_schema_inno.result
+++ b/mysql-test/r/information_schema_inno.result
@@ -101,3 +101,8 @@ SELECT * FROM information_schema.partitions
WHERE table_schema= 'test' AND table_name= 'v1';
DROP TABLE t1;
DROP VIEW v1;
+CREATE TABLE t1(i int) ENGINE=Innodb ROW_FORMAT=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp';
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME='t1';
+CREATE_OPTIONS
+row_format=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/'
+DROP TABLE t1;
diff --git a/mysql-test/r/information_schema_linux.result b/mysql-test/r/information_schema_linux.result
new file mode 100644
index 00000000000..43095b76151
--- /dev/null
+++ b/mysql-test/r/information_schema_linux.result
@@ -0,0 +1,7 @@
+#
+# MDEV-6756: map a linux pid (child pid) to a connection id shown in
+# the output of SHOW PROCESSLIST
+#
+SELECT max(tid) != min(tid) FROM information_schema.processlist;
+max(tid) != min(tid)
+1
diff --git a/mysql-test/r/information_schema_routines.result b/mysql-test/r/information_schema_routines.result
index b8f4fb9b1ef..65e352e3af3 100644
--- a/mysql-test/r/information_schema_routines.result
+++ b/mysql-test/r/information_schema_routines.result
@@ -1,3 +1,5 @@
+set sql_mode="";
+set sql_mode="";
# ========== routines.1 ==========
USE INFORMATION_SCHEMA;
SHOW CREATE TABLE INFORMATION_SCHEMA.ROUTINES;
diff --git a/mysql-test/r/innodb_ext_key.result b/mysql-test/r/innodb_ext_key.result
index 2b3b98eb26a..de1323e00f8 100644
--- a/mysql-test/r/innodb_ext_key.result
+++ b/mysql-test/r/innodb_ext_key.result
@@ -1030,7 +1030,7 @@ insert into t2 (b) values (null), (null), (null);
set optimizer_switch='extended_keys=on';
explain select a from t1 where b is null order by a desc limit 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref b b 9 const 2 Using where; Using filesort
+1 SIMPLE t1 index b PRIMARY 8 NULL 3 Using where
select a from t1 where b is null order by a desc limit 2;
a
3
@@ -1068,5 +1068,151 @@ a
1
drop table t1, t2;
set optimizer_switch=@save_optimizer_switch;
+#
+# MDEV-10325: Queries examines all rows of a tables when it should not
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+pk int not null,
+col1 varchar(32),
+filler varchar(100),
+key idx1(col1(10)),
+primary key (pk)
+)engine=innodb;
+insert into t1
+select
+A.a + 10*B.a + 100*C.a,
+concat('1234567890-', 1000+ A.a + 10*B.a + 100*C.a),
+repeat('filler-data-', 4)
+from
+t0 A, t0 B, t0 C;
+drop table t0,t1;
+#
+# MDEV-10360: Extended keys: index properties depend on index order
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+index_id bigint(20) unsigned NOT NULL,
+index_class varchar(265) COLLATE latin1_general_ci DEFAULT NULL ,
+index_object_id int(10) unsigned NOT NULL DEFAULT '0' ,
+index_date_updated int(10) unsigned DEFAULT NULL ,
+PRIMARY KEY (index_id),
+KEY object (index_class(181),index_object_id),
+KEY index_date_updated (index_date_updated)
+) engine=innodb;
+create table t2 (
+index_id bigint(20) unsigned NOT NULL,
+index_class varchar(265) COLLATE latin1_general_ci DEFAULT NULL ,
+index_object_id int(10) unsigned NOT NULL DEFAULT '0' ,
+index_date_updated int(10) unsigned DEFAULT NULL ,
+PRIMARY KEY (index_id),
+KEY index_date_updated (index_date_updated),
+KEY object (index_class(181),index_object_id)
+) engine=innodb;
+insert into t1 select
+@a:=A.a + 10*B.a + 100*C.a,
+concat('val-', @a),
+123456,
+A.a + 10*B.a
+from
+t0 A, t0 B, t0 C;
+insert into t2 select * from t1;
+# This must have the same query plan as the query below it:
+# type=range, key=index_date_updated, key_len=13
+explain
+select * from t1 force index(index_date_updated)
+where index_date_updated= 10 and index_id < 800;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range index_date_updated index_date_updated 13 NULL # Using index condition
+# This used to work from the start:
+explain
+select * from t2 force index(index_date_updated)
+where index_date_updated= 10 and index_id < 800;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range index_date_updated index_date_updated 13 NULL # Using index condition
+drop table t0,t1,t2;
+#
+# MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'
+# was corrupted, server crashes in opt_sum_query
+set @save_innodb_file_format= @@innodb_file_format;
+set @save_innodb_large_prefix= @@innodb_large_prefix;
+set global innodb_file_format = BARRACUDA;
+set global innodb_large_prefix = ON;
+CREATE TABLE t1 (
+pk INT,
+f1 VARCHAR(3),
+f2 VARCHAR(1024),
+PRIMARY KEY (pk),
+KEY(f2)
+) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
+INSERT INTO t1 VALUES (1,'foo','abc'),(2,'bar','def');
+SELECT MAX(t2.pk) FROM t1 t2 INNER JOIN t1 t3 ON t2.f1 = t3.f1 WHERE t2.pk <= 4;
+MAX(t2.pk)
+2
+drop table t1;
+CREATE TABLE t1 (
+pk1 INT,
+pk2 INT,
+f1 VARCHAR(3),
+f2 VARCHAR(1021),
+PRIMARY KEY (pk1,pk2),
+KEY(f2)
+) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
+INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
+explain format= json
+select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["f2"],
+ "key": "f2",
+ "key_length": "3070",
+ "used_key_parts": ["f2", "pk1"],
+ "rows": 1,
+ "filtered": 100,
+ "index_condition": "((t1.pk1 <= 5) and (t1.pk2 <= 5) and (t1.f2 = 'abc'))",
+ "attached_condition": "(t1.f1 <= '3')"
+ }
+ }
+}
+drop table t1;
+CREATE TABLE t1 (
+f2 INT,
+pk2 INT,
+f1 VARCHAR(3),
+pk1 VARCHAR(1000),
+PRIMARY KEY (pk1,pk2),
+KEY k1(pk1,f2)
+) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
+INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
+explain format= json
+select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["k1"],
+ "key": "k1",
+ "key_length": "3011",
+ "used_key_parts": ["pk1", "f2", "pk2"],
+ "rows": 1,
+ "filtered": 100,
+ "index_condition": "((t1.f2 <= 5) and (t1.pk2 <= 5) and (t1.pk1 = 'abc'))",
+ "attached_condition": "(t1.f1 <= '3')"
+ }
+ }
+}
+drop table t1;
set optimizer_switch=@save_ext_key_optimizer_switch;
+set global innodb_file_format = @save_innodb_file_format;
+set global innodb_large_prefix = @save_innodb_large_prefix;
SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/r/innodb_group.result b/mysql-test/r/innodb_group.result
new file mode 100644
index 00000000000..58bd75e0baf
--- /dev/null
+++ b/mysql-test/r/innodb_group.result
@@ -0,0 +1,13 @@
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-10556 Assertion `0' failed in virtual void Item_sum_field::set_result_field(Field*)
+#
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+SELECT DISTINCT STDDEV(1) FROM t1 GROUP BY i ORDER BY BENCHMARK(0, BIT_XOR(i));
+STDDEV(1)
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result
index fb6cdefa14f..a5215bf9f0d 100644
--- a/mysql-test/r/innodb_icp.result
+++ b/mysql-test/r/innodb_icp.result
@@ -416,11 +416,11 @@ DROP TABLE t1;
# Bug#59259 "Incorrect rows returned for a correlated subquery
# when ICP is on"
#
-CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t1 VALUES (11,0);
INSERT INTO t1 VALUES (12,5);
INSERT INTO t1 VALUES (15,0);
-CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t2 VALUES (11,1);
INSERT INTO t2 VALUES (12,2);
INSERT INTO t2 VALUES (15,4);
@@ -600,6 +600,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
d1 pk i1
1 4 1
+EXPLAIN
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL k1 9 NULL 3 Using index
+1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+d1 pk i1
+1 4 1
DROP TABLE t1, t2;
#
# BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89
diff --git a/mysql-test/r/innodb_load_xa.result b/mysql-test/r/innodb_load_xa.result
index 017bc7450bd..515c820b40c 100644
--- a/mysql-test/r/innodb_load_xa.result
+++ b/mysql-test/r/innodb_load_xa.result
@@ -9,14 +9,9 @@ start transaction;
insert t1 values (1);
insert t1 values (2);
commit;
-include/show_binlog_events.inc
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Gtid # # GTID #-#-#
-mysqld-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
-mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
-mysqld-bin.000001 # Query # # use `test`; insert t1 values (1)
-mysqld-bin.000001 # Query # # use `test`; insert t1 values (2)
-mysqld-bin.000001 # Query # # COMMIT
+show status like 'Handler_prepare';
+Variable_name Value
+Handler_prepare 0
drop table t1;
uninstall plugin innodb;
Warnings:
diff --git a/mysql-test/r/innodb_mrr_cpk.result b/mysql-test/r/innodb_mrr_cpk.result
index 99ed73a3e83..28d7dd51df8 100644
--- a/mysql-test/r/innodb_mrr_cpk.result
+++ b/mysql-test/r/innodb_mrr_cpk.result
@@ -11,7 +11,7 @@ create table t1(a char(8), b char(8), filler char(100), primary key(a));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` char(8) NOT NULL DEFAULT '',
+ `a` char(8) NOT NULL,
`b` char(8) DEFAULT NULL,
`filler` char(100) DEFAULT NULL,
PRIMARY KEY (`a`)
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 39cb4cac85d..5a0b6b10db8 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -20,7 +20,7 @@ insert into t1 values (0,"mysql a");
insert into t1 values (0,"r1manic");
insert into t1 values (0,"r1man");
drop table t1;
-create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int);
+create table t1 (a int not null auto_increment, primary key (a), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c char(10) default "hello", i int);
insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default);
select a,t>0,c,i from t1;
a t>0 c i
@@ -92,14 +92,14 @@ create table t1(number int auto_increment primary key, original_value varchar(50
set @value= "aa";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
-Warning 1265 Data truncated for column 'f_double' at row 1
-Warning 1265 Data truncated for column 'f_float' at row 1
-Warning 1265 Data truncated for column 'f_double_7_2' at row 1
-Warning 1265 Data truncated for column 'f_float_4_3' at row 1
-Warning 1265 Data truncated for column 'f_double_u' at row 1
-Warning 1265 Data truncated for column 'f_float_u' at row 1
-Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
-Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_double' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_float' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_double_7_2' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_float_4_3' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_double_u' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_float_u' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_double_15_1_u' at row 1
+Warning 1366 Incorrect double value: 'aa' for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 1
original_value aa
@@ -136,14 +136,14 @@ f_float_3_1_u 1.0
set @value= "aa1";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
-Warning 1265 Data truncated for column 'f_double' at row 1
-Warning 1265 Data truncated for column 'f_float' at row 1
-Warning 1265 Data truncated for column 'f_double_7_2' at row 1
-Warning 1265 Data truncated for column 'f_float_4_3' at row 1
-Warning 1265 Data truncated for column 'f_double_u' at row 1
-Warning 1265 Data truncated for column 'f_float_u' at row 1
-Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
-Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_double' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_float' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_double_7_2' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_float_4_3' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_double_u' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_float_u' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_double_15_1_u' at row 1
+Warning 1366 Incorrect double value: 'aa1' for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 3
original_value aa1
diff --git a/mysql-test/r/insert_notembedded.result b/mysql-test/r/insert_notembedded.result
index ba3e2221922..41e31508fe0 100644
--- a/mysql-test/r/insert_notembedded.result
+++ b/mysql-test/r/insert_notembedded.result
@@ -1,3 +1,5 @@
+set local sql_mode="";
+set global sql_mode="";
drop table if exists t1;
create table t1 (n int);
create view v1 as select * from t1;
@@ -125,3 +127,5 @@ a b
unlock tables;
drop table t1;
set low_priority_updates=default;
+set local sql_mode=default;
+set global sql_mode=default;
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index 1987c5c0559..e8e6e16fe5a 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -242,14 +242,16 @@ ERROR 42S22: Unknown column 'a' in 'field list'
DROP TABLE t1,t2;
SET SQL_MODE = 'TRADITIONAL';
CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL);
+INSERT INTO t1 VALUES (1,1);
INSERT INTO t1 (a) VALUES (1);
ERROR HY000: Field 'b' doesn't have a default value
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b;
ERROR HY000: Field 'b' doesn't have a default value
+INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = a;
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b;
-ERROR HY000: Field 'b' doesn't have a default value
SELECT * FROM t1;
a b
+1 1
DROP TABLE t1;
CREATE TABLE t1 (f1 INT AUTO_INCREMENT PRIMARY KEY,
f2 VARCHAR(5) NOT NULL UNIQUE);
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index d500b38a8dc..3e39c95fe16 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -757,6 +757,9 @@ from information_schema.statistics join information_schema.columns using(table_n
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA COLUMN_COMMENT
user Host def mysql 0 mysql PRIMARY 1 A NULL NULL BTREE def mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
user User def mysql 0 mysql PRIMARY 2 A NULL NULL BTREE def mysql NO char 80 240 NULL NULL utf8 utf8_bin char(80) PRI
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
drop table t1;
drop table t2;
drop table t3;
diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result
index f2383ce2681..9eb1654e2cc 100644
--- a/mysql-test/r/join_cache.result
+++ b/mysql-test/r/join_cache.result
@@ -39,7 +39,7 @@ COUNT(*)
984
show variables like 'join_buffer_size';
Variable_name Value
-join_buffer_size 131072
+join_buffer_size 262144
set join_cache_level=1;
show variables like 'join_cache_level';
Variable_name Value
@@ -774,7 +774,7 @@ set join_cache_level=default;
set join_buffer_size=default;
show variables like 'join_buffer_size';
Variable_name Value
-join_buffer_size 131072
+join_buffer_size 262144
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 2
@@ -808,7 +808,7 @@ INDEX (Percentage)
);
show variables like 'join_buffer_size';
Variable_name Value
-join_buffer_size 131072
+join_buffer_size 262144
set join_cache_level=3;
show variables like 'join_cache_level';
Variable_name Value
@@ -1008,7 +1008,7 @@ Russian Federation NULL
Vietnam NULL
show variables like 'join_buffer_size';
Variable_name Value
-join_buffer_size 131072
+join_buffer_size 262144
set join_cache_level=4;
show variables like 'join_cache_level';
Variable_name Value
@@ -1267,7 +1267,7 @@ Czech Republic 10278100 NULL NULL
DROP INDEX City_Name ON City;
show variables like 'join_buffer_size';
Variable_name Value
-join_buffer_size 131072
+join_buffer_size 262144
set join_cache_level=5;
show variables like 'join_cache_level';
Variable_name Value
@@ -2688,7 +2688,7 @@ set join_cache_level=default;
set join_buffer_size=default;
show variables like 'join_buffer_size';
Variable_name Value
-join_buffer_size 131072
+join_buffer_size 262144
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 2
@@ -4321,6 +4321,23 @@ h
n
v
p
+EXPLAIN
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+GROUP BY t2.v ORDER BY t1.pk,t2.v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index idx1 idx2 7 NULL 20 Using index; Using temporary; Using filesort
+1 SIMPLE t3 eq_ref PRIMARY,idx2 PRIMARY 4 test.t2.i 1 Using where
+1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5 Using where
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+GROUP BY t2.v ORDER BY t1.pk,t2.v;
+v
+b
+h
+n
+v
+p
SET SESSION join_cache_level=6;
EXPLAIN
SELECT t2.v FROM t1, t2, t3
@@ -4339,6 +4356,23 @@ h
n
v
p
+EXPLAIN
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+GROUP BY t2.v ORDER BY t1.pk,t2.v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index idx1 idx2 7 NULL 20 Using index; Using temporary; Using filesort
+1 SIMPLE t3 eq_ref PRIMARY,idx2 PRIMARY 4 test.t2.i 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+GROUP BY t2.v ORDER BY t1.pk,t2.v;
+v
+b
+h
+n
+v
+p
SET SESSION join_cache_level=4;
EXPLAIN
SELECT t2.v FROM t1, t2, t3
@@ -4357,6 +4391,23 @@ h
n
v
p
+EXPLAIN
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+GROUP BY t2.v ORDER BY t1.pk,t2.v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index idx1 idx2 7 NULL 20 Using index; Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL PRIMARY,idx2 #hash#PRIMARY 4 test.t2.i 20 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL idx2 #hash#idx2 3 test.t3.v 44 Using where; Using join buffer (incremental, BNLH join)
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+GROUP BY t2.v ORDER BY t1.pk,t2.v;
+v
+b
+h
+n
+v
+p
DROP TABLE t1,t2,t3;
SET SESSION join_cache_level=DEFAULT;
#
@@ -5887,7 +5938,7 @@ where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@co
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-2 UNCACHEABLE SUBQUERY t3 system NULL NULL NULL NULL 1
+2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
set @counter=0;
select count(*) from t1 straight_join t2
where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@counter+1);
@@ -5933,7 +5984,7 @@ select @@join_buffer_space_limit;
8192
select @@join_buffer_size;
@@join_buffer_size
-131072
+262144
explain select count(*) from t1, t1 t2 where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 11
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index c0bf5657aa1..78cdfe6ecb1 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -2093,10 +2093,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where; Using filesort
+1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
Warnings:
-Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (((`test`.`t1`.`pk` between 5 and 6) and isnull(`test`.`t1`.`b`)) or (`test`.`t1`.`b` = 5))) order by `test`.`t1`.`b`
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
@@ -2249,6 +2249,97 @@ WHERE b IN (1,2,3) OR b = d;
a b c d
DROP TABLE t1,t2,t3;
#
+# MDEV-6634: Wrong estimates for ref(const) and key IS NULL predicate
+#
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, b int, c int, key(b), key(c));
+insert into t2 select
+@a:=A.a + 10*B.a+100*C.a,
+IF(@a<900, NULL, @a),
+IF(@a<500, NULL, @a)
+from t1 A, t1 B, t1 C;
+delete from t1 where a=0;
+# Check that there are different #rows of NULLs for b and c, both !=10:
+explain select * from t2 force index (b) where b is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref b b 5 const 780 Using index condition
+explain select * from t2 force index (c) where c is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref c c 5 const 393 Using index condition
+explain select * from t1 left join t2 on t2.b is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 9
+1 SIMPLE t2 ref b b 5 const 780 Using where
+explain select * from t1 left join t2 on t2.c is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 9
+1 SIMPLE t2 ref c c 5 const 393 Using where
+drop table t1,t2;
+#
+# MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause
+#
+CREATE TABLE t1(i1 int primary key, v1 int, key(v1));
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (3, 3);
+INSERT INTO t1 VALUES (4, 4);
+INSERT INTO t1 VALUES (5, 3);
+INSERT INTO t1 VALUES (6, 6);
+INSERT INTO t1 VALUES (7, 7);
+INSERT INTO t1 VALUES (8, 8);
+INSERT INTO t1 VALUES (9, 9);
+CREATE TABLE t2(i2 int primary key, v2 int, key(v2));
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 3);
+INSERT INTO t2 VALUES (4, 4);
+INSERT INTO t2 VALUES (5, 3);
+INSERT INTO t2 VALUES (6, 6);
+INSERT INTO t2 VALUES (7, 7);
+INSERT INTO t2 VALUES (8, 8);
+INSERT INTO t2 VALUES (9, 9);
+CREATE TABLE t3(i3 int primary key, v3 int, key(v3));
+INSERT INTO t3 VALUES (2, 2);
+INSERT INTO t3 VALUES (4, 4);
+INSERT INTO t3 VALUES (6, 6);
+INSERT INTO t3 VALUES (8, 8);
+# This should have a join order of t3,t1,t2 (or t3,t2,t1, the idea is that t3 is the first one)
+EXPLAIN EXTENDED
+SELECT * FROM
+(SELECT t1.i1 as i1, t1.v1 as v1,
+t2.i2 as i2, t2.v2 as v2,
+t3.i3 as i3, t3.v3 as v3
+FROM t1 JOIN t2 on t1.i1 = t2.i2
+LEFT JOIN t3 on t2.i2 = t3.i3
+) as w1
+WHERE v3 = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`))
+# This should have the same join order like the query above:
+EXPLAIN EXTENDED
+SELECT * FROM
+(SELECT t1.i1 as i1, t1.v1 as v1,
+t2.i2 as i2, t2.v2 as v2,
+t3.i3 as i3, t3.v3 as v3
+FROM t1 JOIN t2 on t1.i1 = t2.i2
+LEFT JOIN t3 on t2.i2 = t3.i3
+WHERE t1.i1 = t2.i2
+AND 1 = 1
+) as w2
+WHERE v3 = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`))
+drop table t1,t2,t3;
+#
# MDEV-11958: LEFT JOIN with stored routine produces incorrect result
#
CREATE TABLE t (x INT);
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 7e5f89f55b5..861b224043c 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -2104,10 +2104,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where; Using filesort
+1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
Warnings:
-Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (((`test`.`t1`.`pk` between 5 and 6) and isnull(`test`.`t1`.`b`)) or (`test`.`t1`.`b` = 5))) order by `test`.`t1`.`b`
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
@@ -2260,6 +2260,97 @@ WHERE b IN (1,2,3) OR b = d;
a b c d
DROP TABLE t1,t2,t3;
#
+# MDEV-6634: Wrong estimates for ref(const) and key IS NULL predicate
+#
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, b int, c int, key(b), key(c));
+insert into t2 select
+@a:=A.a + 10*B.a+100*C.a,
+IF(@a<900, NULL, @a),
+IF(@a<500, NULL, @a)
+from t1 A, t1 B, t1 C;
+delete from t1 where a=0;
+# Check that there are different #rows of NULLs for b and c, both !=10:
+explain select * from t2 force index (b) where b is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref b b 5 const 780 Using index condition
+explain select * from t2 force index (c) where c is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref c c 5 const 393 Using index condition
+explain select * from t1 left join t2 on t2.b is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 9
+1 SIMPLE t2 ref b b 5 const 780 Using where
+explain select * from t1 left join t2 on t2.c is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 9
+1 SIMPLE t2 ref c c 5 const 393 Using where
+drop table t1,t2;
+#
+# MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause
+#
+CREATE TABLE t1(i1 int primary key, v1 int, key(v1));
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (3, 3);
+INSERT INTO t1 VALUES (4, 4);
+INSERT INTO t1 VALUES (5, 3);
+INSERT INTO t1 VALUES (6, 6);
+INSERT INTO t1 VALUES (7, 7);
+INSERT INTO t1 VALUES (8, 8);
+INSERT INTO t1 VALUES (9, 9);
+CREATE TABLE t2(i2 int primary key, v2 int, key(v2));
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 3);
+INSERT INTO t2 VALUES (4, 4);
+INSERT INTO t2 VALUES (5, 3);
+INSERT INTO t2 VALUES (6, 6);
+INSERT INTO t2 VALUES (7, 7);
+INSERT INTO t2 VALUES (8, 8);
+INSERT INTO t2 VALUES (9, 9);
+CREATE TABLE t3(i3 int primary key, v3 int, key(v3));
+INSERT INTO t3 VALUES (2, 2);
+INSERT INTO t3 VALUES (4, 4);
+INSERT INTO t3 VALUES (6, 6);
+INSERT INTO t3 VALUES (8, 8);
+# This should have a join order of t3,t1,t2 (or t3,t2,t1, the idea is that t3 is the first one)
+EXPLAIN EXTENDED
+SELECT * FROM
+(SELECT t1.i1 as i1, t1.v1 as v1,
+t2.i2 as i2, t2.v2 as v2,
+t3.i3 as i3, t3.v3 as v3
+FROM t1 JOIN t2 on t1.i1 = t2.i2
+LEFT JOIN t3 on t2.i2 = t3.i3
+) as w1
+WHERE v3 = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`))
+# This should have the same join order like the query above:
+EXPLAIN EXTENDED
+SELECT * FROM
+(SELECT t1.i1 as i1, t1.v1 as v1,
+t2.i2 as i2, t2.v2 as v2,
+t3.i3 as i3, t3.v3 as v3
+FROM t1 JOIN t2 on t1.i1 = t2.i2
+LEFT JOIN t3 on t2.i2 = t3.i3
+WHERE t1.i1 = t2.i2
+AND 1 = 1
+) as w2
+WHERE v3 = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`))
+drop table t1,t2,t3;
+#
# MDEV-11958: LEFT JOIN with stored routine produces incorrect result
#
CREATE TABLE t (x INT);
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 0616a1b0d0a..ed541c791e1 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -418,7 +418,7 @@ create table t1 (
c1 int,
c2 char(12),
c3 varchar(123),
-c4 timestamp,
+c4 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
index (c1),
index i1 (c1),
index i2 (c2),
@@ -433,8 +433,8 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL,
- `c2` char(12) NOT NULL DEFAULT '',
- `c3` varchar(123) NOT NULL DEFAULT '',
+ `c2` char(12) NOT NULL,
+ `c3` varchar(123) NOT NULL,
`c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`c2`,`c3`),
UNIQUE KEY `i4` (`c4`),
@@ -471,9 +471,9 @@ ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL DEFAULT '0',
- `c2` char(12) NOT NULL DEFAULT '',
- `c3` varchar(123) NOT NULL DEFAULT '',
+ `c1` int(11) NOT NULL,
+ `c2` char(12) NOT NULL,
+ `c3` varchar(123) NOT NULL,
`c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
KEY `i1` (`c1`),
KEY `i5` (`c1`,`c2`,`c3`,`c4`),
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result
index 6afce67cc1a..d40c4ee758c 100644
--- a/mysql-test/r/kill.result
+++ b/mysql-test/r/kill.result
@@ -1,3 +1,5 @@
+set local sql_mode="";
+set global sql_mode="";
SET DEBUG_SYNC = 'RESET';
DROP TABLE IF EXISTS t1, t2, t3;
DROP FUNCTION IF EXISTS MY_KILL;
@@ -24,7 +26,7 @@ SELECT 4;
4
4
KILL (SELECT COUNT(*) FROM mysql.user);
-ERROR 42000: This version of MariaDB doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
+ERROR 42000: KILL does not support subqueries or stored functions.
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read WAIT_FOR kill';
SET DEBUG_SYNC= 'now WAIT_FOR con1_read';
@@ -308,5 +310,18 @@ SLEEP(1000)
1
KILL QUERY ID 0;
ERROR HY000: Unknown query id: 0
+#
+# MDEV-5096 - Wrong error message on attempt to kill somebody else's
+# query ID
+#
+CREATE USER u1@localhost;
+SELECT SLEEP(1000);
+KILL QUERY ID ID;
+ERROR HY000: You are not owner of query ID
+KILL QUERY ID @id;
+SLEEP(1000)
+1
+DROP USER u1@localhost;
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
+set global sql_mode=default;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index f446a503317..42f919d0cfb 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -43,8 +43,11 @@ drop table t1;
create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 2
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
+Note 1265 Data truncated for column 'a' at row 4
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 5
Warning 1262 Row 5 was truncated; it contained more data than there were input columns
select * from t1;
@@ -57,6 +60,9 @@ a b
truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 2
+Note 1265 Data truncated for column 'a' at row 3
Warning 1366 Incorrect integer value: '
' for column 'a' at row 4
Warning 1261 Row 4 doesn't contain data for all columns
@@ -73,6 +79,8 @@ insert into t1 values(0);
select * from t1;
id
0
+Warnings:
+Note 1265 Data truncated for column 'id' at row 1
select * from t1;
id
0
@@ -180,6 +188,13 @@ NULL 10 10
NULL 15 15
truncate table t1;
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'b' at row 1
+Note 1265 Data truncated for column 'a' at row 2
+Note 1265 Data truncated for column 'b' at row 2
+Note 1265 Data truncated for column 'a' at row 3
+Note 1265 Data truncated for column 'b' at row 3
select * from t1;
a b c
1 2 Wow
@@ -187,6 +202,13 @@ a b c
5 6 Wow
truncate table t1;
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'b' at row 1
+Note 1265 Data truncated for column 'a' at row 2
+Note 1265 Data truncated for column 'b' at row 2
+Note 1265 Data truncated for column 'a' at row 3
+Note 1265 Data truncated for column 'b' at row 3
select * from t1;
a b c
1 2 1+2+123+2+NIL
@@ -234,7 +256,9 @@ f1
2
delete from t1;
Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
Warning 1261 Row 1 doesn't contain data for all columns
+Note 1265 Data truncated for column 'f1' at row 2
Warning 1261 Row 2 doesn't contain data for all columns
select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
f1
diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result
index 250037f60b8..94db3cc913f 100644
--- a/mysql-test/r/loadxml.result
+++ b/mysql-test/r/loadxml.result
@@ -120,3 +120,14 @@ col1 col2 col3
ABC DEF NULL
GHI NULL 123
DROP TABLE t1;
+#
+# MDEV-12696 Crash with LOAD XML and non-updatable VIEW column
+#
+CREATE TABLE t1 (c1 TEXT);
+CREATE VIEW v1 AS SELECT CONCAT(c1,'') AS c1, NULL AS c2 FROM t1;
+LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c1);
+ERROR HY000: Column 'c1' is not updatable
+LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c2);
+ERROR HY000: Column 'c2' is not updatable
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index f9e4a88fe95..12960a4f5f6 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -115,7 +115,9 @@ ERROR HY000: Can't execute the query because you have a conflicting read lock
UNLOCK TABLES;
DROP DATABASE mysqltest_1;
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
+set sql_mode="";
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
+set sql_mode=default;
lock tables t1 write;
alter table t1 auto_increment=0;
alter table t1 auto_increment=0;
diff --git a/mysql-test/r/log_slow.result b/mysql-test/r/log_slow.result
index 4f5eb9359f6..02e04cfbb2d 100644
--- a/mysql-test/r/log_slow.result
+++ b/mysql-test/r/log_slow.result
@@ -9,8 +9,10 @@ select @@log_slow_verbosity;
show variables like "log_slow%";
Variable_name Value
+log_slow_admin_statements OFF
log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
log_slow_rate_limit 1
+log_slow_slave_statements OFF
log_slow_verbosity
set @org_slow_query_log= @@global.slow_query_log;
set @@log_slow_filter= "filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk,admin";
@@ -56,6 +58,7 @@ insert_id int(11) NO NULL
server_id int(10) unsigned NO NULL
sql_text mediumtext NO NULL
thread_id bigint(21) unsigned NO NULL
+rows_affected int(11) NO NULL
flush slow logs;
set long_query_time=0.1;
set log_slow_filter='';
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index cc6f3709ae4..6e3ab8a991a 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -39,17 +39,24 @@ select sleep(@long_query_time + 1);
sleep(@long_query_time + 1)
0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
# Switch to connection default
set global slow_query_log= ON;
+set local slow_query_log= ON;
# Switch to connection con1
set session long_query_time = @long_query_time;
select sleep(@long_query_time + 1);
sleep(@long_query_time + 1)
0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
-TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 select sleep(@long_query_time + 1) THREAD_ID
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
+set local slow_query_log= ON;
+select sleep(@long_query_time + 2);
+sleep(@long_query_time + 2)
+0
+select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
+TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 select sleep(@long_query_time + 2) THREAD_ID 0
# Switch to connection default
show global variables
where Variable_name = 'general_log' or Variable_name = 'slow_query_log';
@@ -62,6 +69,7 @@ set global general_log= OFF;
set global slow_query_log= ON;
set global slow_query_log= OFF;
set global slow_query_log= OFF;
+set local slow_query_log= ON;
set global general_log= ON;
truncate table mysql.general_log;
create table t1(f1 int);
@@ -124,6 +132,9 @@ Variable_name Value
general_log OFF
show variables like 'slow_query_log';
Variable_name Value
+slow_query_log ON
+show global variables like 'slow_query_log';
+Variable_name Value
slow_query_log OFF
set global general_log=ON;
set global log_output=default;
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index 04cd2f01050..ff5055e1ae4 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -1,3 +1,4 @@
+SET SQL_MODE="";
SET @old_general_log_state = @@global.general_log;
SET @old_log_output= @@global.log_output;
SET @old_slow_query_log= @@global.slow_query_log;
@@ -17,7 +18,7 @@ event_time user_host thread_id server_id command_type argument
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from general_log
truncate table slow_log;
select * from slow_log;
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
truncate table general_log;
select * from general_log where argument like '%general_log%';
event_time user_host thread_id server_id command_type argument
@@ -82,7 +83,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show fields from mysql.slow_log;
Field Type Null Key Default Extra
@@ -98,6 +100,7 @@ insert_id int(11) NO NULL
server_id int(10) unsigned NO NULL
sql_text mediumtext NO NULL
thread_id bigint(21) unsigned NO NULL
+rows_affected int(11) NO NULL
flush logs;
flush tables;
SET GLOBAL GENERAL_LOG=ON;
@@ -148,8 +151,8 @@ select sleep(2);
sleep(2)
0
select * from mysql.slow_log;
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
-TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 mysql 0 0 1 select sleep(2) THREAD_ID
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
+TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 mysql 0 0 1 select sleep(2) THREAD_ID 0
set @@session.long_query_time = @saved_long_query_time;
alter table mysql.general_log engine=myisam;
ERROR HY000: You cannot 'ALTER' a log table if logging is enabled
@@ -187,7 +190,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
alter table mysql.general_log engine=myisam;
alter table mysql.slow_log engine=myisam;
@@ -215,7 +219,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Slow log'
set global general_log='ON';
set global slow_query_log='ON';
@@ -286,7 +291,8 @@ ON UPDATE CURRENT_TIMESTAMP,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
-`thread_id` BIGINT(21) UNSIGNED NOT NULL
+`thread_id` BIGINT(21) UNSIGNED NOT NULL,
+`rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
set global general_log='ON';
set global slow_query_log='ON';
@@ -313,7 +319,7 @@ event_time user_host thread_id server_id command_type argument
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from general_log
truncate table slow_log;
select * from slow_log;
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
create table general_log_new like general_log;
rename table general_log TO renamed_general_log, general_log_new TO general_log;
create table slow_log_new like slow_log;
@@ -334,9 +340,9 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query select * from slow_log
TIMESTAMP USER_HOST THREAD_ID 1 Query create table general_log_new like general_log
TIMESTAMP USER_HOST THREAD_ID 1 Query rename table general_log TO renamed_general_log, general_log_new TO general_log
select * from slow_log;
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
select * from renamed_slow_log;
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
set global general_log='OFF';
RENAME TABLE general_log TO general_log2;
set global slow_query_log='OFF';
@@ -429,10 +435,10 @@ SELECT "My own slow query", sleep(2);
My own slow query sleep(2)
My own slow query 0
SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3;
-start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id seq
-START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 2
-START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 3
-START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 4
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected seq
+START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 0 2
+START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 0 3
+START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 0 4
SET GLOBAL slow_query_log = 0;
SET SESSION long_query_time =@saved_long_query_time;
FLUSH LOGS;
@@ -537,7 +543,8 @@ CREATE TABLE `db_17876.slow_log_data` (
`insert_id` int(11) default NULL,
`server_id` int(11) default NULL,
`sql_text` mediumtext,
-`thread_id` bigint(21) unsigned default NULL
+`thread_id` bigint(21) unsigned default NULL,
+`rows_affected` int(11) default NULL
);
CREATE TABLE `db_17876.general_log_data` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
@@ -551,7 +558,7 @@ CREATE procedure `db_17876.archiveSlowLog`()
BEGIN
DECLARE start_time, query_time, lock_time CHAR(28);
DECLARE user_host MEDIUMTEXT;
-DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT;
+DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id, rows_affected INT;
DECLARE thread_id BIGINT UNSIGNED;
DECLARE dbname MEDIUMTEXT;
DECLARE sql_text BLOB;
@@ -566,14 +573,15 @@ DECLARE CONTINUE HANDLER FOR ER_SP_FETCH_NO_DATA SET done = 1;
FETCH cur1 INTO
start_time, user_host, query_time, lock_time,
rows_set, rows_examined, dbname, last_insert_id,
-insert_id, server_id, sql_text, thread_id;
+insert_id, server_id, sql_text, thread_id, rows_affected;
END;
IF NOT done THEN
BEGIN
INSERT INTO
`db_17876.slow_log_data`
VALUES(start_time, user_host, query_time, lock_time, rows_set, rows_examined,
-dbname, last_insert_id, insert_id, server_id, sql_text, thread_id);
+dbname, last_insert_id, insert_id, server_id, sql_text, thread_id,
+rows_affected);
END;
END IF;
END;
diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result
index 6cbb25bd1d4..a56d067c2cd 100644
--- a/mysql-test/r/log_tables_upgrade.result
+++ b/mysql-test/r/log_tables_upgrade.result
@@ -11,7 +11,7 @@ Table Op Msg_type Msg_text
test.bug49823 repair status OK
RENAME TABLE general_log TO renamed_general_log;
RENAME TABLE test.bug49823 TO general_log;
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -43,10 +43,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -54,7 +55,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
DROP TABLE general_log;
RENAME TABLE renamed_general_log TO general_log;
diff --git a/mysql-test/r/lowercase_fs_off.result b/mysql-test/r/lowercase_fs_off.result
index d7e1b8c9e5b..dea4670d2c7 100644
--- a/mysql-test/r/lowercase_fs_off.result
+++ b/mysql-test/r/lowercase_fs_off.result
@@ -1,3 +1,5 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
create database d1;
grant all on d1.* to 'sample'@'localhost' identified by 'password';
flush privileges;
@@ -68,3 +70,4 @@ create trigger t1_bi before insert on t1 for each row set new.a= 1;
show triggers like '%T1%';
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
drop table t1;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/lowercase_table4.result b/mysql-test/r/lowercase_table4.result
index 02e2012a186..72c2e9ebf95 100644
--- a/mysql-test/r/lowercase_table4.result
+++ b/mysql-test/r/lowercase_table4.result
@@ -4,6 +4,9 @@
#
CREATE DATABASE XY;
USE XY;
+set @old_table_open_cache=@@table_open_cache;
+set global table_open_cache = 512;
+set global table_open_cache = @old_table_open_cache;
DROP DATABASE XY;
USE TEST;
#
diff --git a/mysql-test/r/lowercase_table_grant.result b/mysql-test/r/lowercase_table_grant.result
index afb54f8c472..009965c0c8e 100644
--- a/mysql-test/r/lowercase_table_grant.result
+++ b/mysql-test/r/lowercase_table_grant.result
@@ -1,4 +1,5 @@
use mysql;
+set sql_mode="";
create database MYSQLtest;
grant all on MySQLtest.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
diff --git a/mysql-test/r/lowercase_table_qcache.result b/mysql-test/r/lowercase_table_qcache.result
index f8d34e0f592..9d7e1007e4c 100644
--- a/mysql-test/r/lowercase_table_qcache.result
+++ b/mysql-test/r/lowercase_table_qcache.result
@@ -1,4 +1,6 @@
set GLOBAL query_cache_size=1355776;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
drop database if exists MySQLtesT;
create database MySQLtesT;
create table MySQLtesT.t1 (a int);
@@ -21,4 +23,5 @@ select * from MySQL.db;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
-set GLOBAL query_cache_size=0;
+set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/r/max_statement_time.result b/mysql-test/r/max_statement_time.result
new file mode 100644
index 00000000000..44ee03b813a
--- /dev/null
+++ b/mysql-test/r/max_statement_time.result
@@ -0,0 +1,183 @@
+
+# Test the MAX_STATEMENT_TIME option.
+
+SET @@MAX_STATEMENT_TIME=2;
+select @@max_statement_time;
+@@max_statement_time
+2.000000
+SELECT SLEEP(1);
+SLEEP(1)
+0
+SELECT SLEEP(3);
+SLEEP(3)
+1
+SET @@MAX_STATEMENT_TIME=0;
+SELECT SLEEP(1);
+SLEEP(1)
+0
+SHOW STATUS LIKE "max_statement_time_exceeded";
+Variable_name Value
+Max_statement_time_exceeded 1
+CREATE TABLE t1 (a INT, b VARCHAR(300)) engine=myisam;
+INSERT INTO t1 VALUES (1, 'string');
+SELECT 0;
+0
+0
+
+# Test the MAX_STATEMENT_TIME option with SF (should have no effect).
+
+CREATE PROCEDURE p1()
+BEGIN
+declare tmp int;
+SET @@MAX_STATEMENT_TIME=0.0001;
+SELECT COUNT(*) INTO tmp FROM t1 WHERE b LIKE '%z%';
+SET @@MAX_STATEMENT_TIME=0;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SET @@MAX_STATEMENT_TIME=5;
+END|
+SELECT @@MAX_STATEMENT_TIME;
+@@MAX_STATEMENT_TIME
+0.000000
+CALL p1();
+CALL p2();
+SELECT @@MAX_STATEMENT_TIME;
+@@MAX_STATEMENT_TIME
+5.000000
+SET @@MAX_STATEMENT_TIME=0;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+# MAX_STATEMENT_TIME account resource
+
+set statement sql_mode="" for
+GRANT USAGE ON *.* TO user1@localhost WITH MAX_STATEMENT_TIME 1.005;
+# con1
+SELECT @@max_statement_time;
+@@max_statement_time
+1.005000
+# restart and reconnect
+set @global.userstat=1;
+SELECT @@global.max_statement_time,@@session.max_statement_time;
+@@global.max_statement_time @@session.max_statement_time
+0.000000 1.005000
+select sleep(100);
+sleep(100)
+1
+SHOW STATUS LIKE "max_statement_time_exceeded";
+Variable_name Value
+Max_statement_time_exceeded 1
+show grants for user1@localhost;
+Grants for user1@localhost
+GRANT USAGE ON *.* TO 'user1'@'localhost' WITH MAX_STATEMENT_TIME 1.005000
+set @global.userstat=0;
+DROP USER user1@localhost;
+
+# MAX_STATEMENT_TIME status variables.
+
+flush status;
+SET @@max_statement_time=0;
+SELECT CONVERT(VARIABLE_VALUE, UNSIGNED) INTO @time_exceeded
+FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME = 'max_statement_time_exceeded';
+SET @@max_statement_time=0.5;
+SELECT SLEEP(2);
+SLEEP(2)
+1
+SHOW STATUS LIKE '%timeout%';
+Variable_name Value
+Binlog_group_commit_trigger_timeout 0
+Master_gtid_wait_timeouts 0
+Ssl_default_timeout 0
+Ssl_session_cache_timeouts 0
+SET @@max_statement_time=0;
+# Ensure that the counters for:
+# - statements that exceeded their maximum execution time
+# are incremented.
+SELECT 1 AS STATUS FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME = 'max_statement_time_exceeded'
+ AND CONVERT(VARIABLE_VALUE, UNSIGNED) > @time_exceeded;
+STATUS
+1
+
+# Check that the appropriate error status is set.
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+SELECT * FROM t1 FOR UPDATE;
+a
+1
+SET @@SESSION.max_statement_time = 0.5;
+UPDATE t1 SET a = 2;
+ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
+SHOW WARNINGS;
+Level Code Message
+Error 1969 Query execution was interrupted (max_statement_time exceeded)
+ROLLBACK;
+DROP TABLE t1;
+
+# Test interaction with lock waits.
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET @@SESSION.max_statement_time= 0.5;
+LOCK TABLES t1 WRITE;
+SELECT @@SESSION.max_statement_time;
+@@SESSION.max_statement_time
+0.500000
+LOCK TABLES t1 READ;
+ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
+UNLOCK TABLES;
+BEGIN;
+SELECT * FROM t1;
+a
+1
+ALTER TABLE t1 ADD COLUMN b INT;
+ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
+ROLLBACK;
+SELECT GET_LOCK('lock', 1);
+GET_LOCK('lock', 1)
+1
+SELECT GET_LOCK('lock', 1);
+GET_LOCK('lock', 1)
+NULL
+SELECT RELEASE_LOCK('lock');
+RELEASE_LOCK('lock')
+1
+DROP TABLE t1;
+#
+# MDEV-7011:MAX_STATEMENT_TIME has no effect in a procedure after
+# a previous successful statement
+#
+create table t1 (i int);
+insert into t1 values (1),(2),(3),(4);
+insert into t1 select a.* from t1 a, t1 b, t1 c, t1 d, t1 e, t1 f, t1 g;
+create procedure pr()
+begin
+select 1;
+select sql_no_cache * from t1 where i > 5;
+select sql_no_cache * from t1 where i > 5;
+select sleep(2);
+end |
+set max_statement_time = 0.001;
+call pr();
+1
+1
+ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
+set max_statement_time = 0;
+drop procedure pr;
+create procedure pr()
+begin
+select sql_no_cache * from t1 where i > 5;
+select sql_no_cache * from t1 where i > 5;
+select sleep(2);
+end |
+set max_statement_time = 0.001;
+call pr();
+ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
+set max_statement_time = 0;
+drop procedure pr;
+drop table t1;
diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result
index 206ad509e37..8b6f96033c9 100644
--- a/mysql-test/r/mdl_sync.result
+++ b/mysql-test/r/mdl_sync.result
@@ -3100,3 +3100,18 @@ a
# Connection default
DROP TABLE m1, t1, t2;
SET DEBUG_SYNC= 'RESET';
+#
+# MDEV-12620 - set lock_wait_timeout = 1;flush tables with read lock;
+# lock not released after timeout
+#
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+SET debug_sync='open_tables_after_open_and_process_table SIGNAL ready WAIT_FOR go';
+SELECT * FROM t1;
+SET debug_sync='now WAIT_FOR ready';
+SET lock_wait_timeout=1;
+FLUSH TABLES WITH READ LOCK;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET debug_sync='now SIGNAL go';
+a
+SET debug_sync='RESET';
+DROP TABLE t1;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 14308959557..97c391566dd 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -2270,7 +2270,7 @@ CREATE TABLE t3(a int) ENGINE = MERGE UNION(t1, t2);
CREATE TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo();
SHOW CREATE TRIGGER tr1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo() latin1 latin1_swedish_ci latin1_swedish_ci
+tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo() latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER tr1;
DROP TABLE t1, t2, t3;
#
@@ -2545,11 +2545,14 @@ DROP TABLE t1;
# Test merge table with too many merge children.
#
drop table if exists t_parent;
-set @save_table_definition_cache=@@global.table_definition_cache;
+set @save_table_open_cache=@@global.table_open_cache;
#
-# Set @@global.table_definition_cache to minimum
+# Set @@global.table_open_cache to minimum
#
-set @@global.table_definition_cache=400;
+set @@global.table_open_cache=400;
+select @@table_open_cache;
+@@table_open_cache
+400
set @a=null;
#
# Create 400 merge children
@@ -2573,7 +2576,7 @@ deallocate prepare stmt;
# Cleanup
#
drop table t_parent;
-set @@global.table_definition_cache=@save_table_definition_cache;
+set @@global.table_open_cache=@save_table_open_cache;
DROP DATABASE IF EXISTS mysql_test1;
CREATE DATABASE mysql_test1;
CREATE TABLE t1 ... DATA DIRECTORY=... INDEX DIRECTORY=...
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index fcaeb3359f0..ffdab244f31 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -8,7 +8,7 @@ def hello 253 5 5 N 1 31 8
def NULL 6 0 0 Y 32896 0 63
1 1.0 -1 hello NULL
1 1.0 -1 hello NULL
-create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
+create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, l datetime, m enum('a','b'), n set('a','b'), o char(10));
select * from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 a a 1 4 0 Y 32768 0 63
@@ -239,7 +239,7 @@ dcol_uns double unsigned,
# date/time types
date_col date,
time_col time,
-timestamp_col timestamp,
+timestamp_col timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
year_col year,
datetime_col datetime,
# string types
diff --git a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result
index 8aacbf060bd..7c98ec49b60 100644
--- a/mysql-test/r/mix2_myisam.result
+++ b/mysql-test/r/mix2_myisam.result
@@ -608,7 +608,7 @@ update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
set @a:=now();
-CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=MyISAM;
+CREATE TABLE t1 (a int not null, b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key (a)) engine=MyISAM;
insert into t1 (a) values(1),(2),(3);
select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
a
@@ -843,9 +843,9 @@ number bigint(20) NOT NULL default '0',
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
-last_mod_date timestamp NOT NULL,
+last_mod_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
last_mod_id smallint(6) NOT NULL default '0',
-last_app_date timestamp NOT NULL,
+last_app_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
@@ -862,9 +862,9 @@ number bigint(20) NOT NULL default '0',
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
-last_mod_date timestamp NOT NULL,
+last_mod_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
last_mod_id smallint(6) NOT NULL default '0',
-last_app_date timestamp NOT NULL,
+last_app_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 3b75cef2cf0..5991a5fd25a 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -181,8 +181,8 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
set sql_safe_updates=0;
drop table t1,t2;
set timestamp=1038401397;
-create table t1 (n int(10) not null primary key, d int(10), t timestamp);
-create table t2 (n int(10) not null primary key, d int(10), t timestamp);
+create table t1 (n int(10) not null primary key, d int(10), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+create table t2 (n int(10) not null primary key, d int(10), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values(1,1,NULL);
insert into t2 values(1,10,NULL),(2,20,NULL);
set timestamp=1038000000;
@@ -422,6 +422,7 @@ create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key (a));
create table mysqltest.t2 (a int, b int, primary key (a));
create table mysqltest.t3 (a int, b int, primary key (a));
+create user mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
grant update on mysqltest.t1 to mysqltest_1@localhost;
update t1, t2 set t1.b=1 where t1.a=t2.a;
diff --git a/mysql-test/r/myisam-optimize.result b/mysql-test/r/myisam-optimize.result
new file mode 100644
index 00000000000..9451046fe08
--- /dev/null
+++ b/mysql-test/r/myisam-optimize.result
@@ -0,0 +1,69 @@
+#
+# MDEV-8475 stale .TMM file causes Aria engine to stop serving the table
+#
+create table t1 (pk int primary key, i int) engine=MyISAM;
+insert into t1 values (1,1),(2,2);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+DROP TABLE t1;
+create table t1 (pk int primary key, i int) engine=aria;
+insert into t1 values (1,1),(2,2);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+DROP TABLE t1;
diff --git a/mysql-test/r/myisam-system.result b/mysql-test/r/myisam-system.result
index af5de8f2749..e489f87948a 100644
--- a/mysql-test/r/myisam-system.result
+++ b/mysql-test/r/myisam-system.result
@@ -2,18 +2,18 @@ drop table if exists t1,t2;
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
-Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
+Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
create table t1 (a int) engine=myisam;
select * from t1;
ERROR HY000: Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
drop table t1;
Warnings:
-Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
+Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
create table t1 (a int) engine=myisam;
select * from t1;
ERROR HY000: File './test/t1.MYD' not found (Errcode: 2 "No such file or directory")
drop table t1;
Warnings:
-Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
+Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
drop table t1;
ERROR 42S02: Unknown table 'test.t1'
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 6b23aefd73b..e114f424ede 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -656,7 +656,7 @@ test.t2 984116287
drop table t1, t2;
show variables like 'myisam_stats_method';
Variable_name Value
-myisam_stats_method nulls_unequal
+myisam_stats_method NULLS_UNEQUAL
create table t1 (a int, key(a));
insert into t1 values (0),(1),(2),(3),(4);
insert into t1 select NULL from t1;
@@ -677,7 +677,7 @@ t1 1 a 1 a A 10 NULL NULL YES BTREE
set myisam_stats_method=nulls_equal;
show variables like 'myisam_stats_method';
Variable_name Value
-myisam_stats_method nulls_equal
+myisam_stats_method NULLS_EQUAL
insert into t1 values (11);
delete from t1 where a=11;
analyze table t1;
@@ -697,7 +697,7 @@ t1 1 a 1 a A 5 NULL NULL YES BTREE
set myisam_stats_method=DEFAULT;
show variables like 'myisam_stats_method';
Variable_name Value
-myisam_stats_method nulls_unequal
+myisam_stats_method NULLS_UNEQUAL
insert into t1 values (11);
delete from t1 where a=11;
analyze table t1;
@@ -718,7 +718,7 @@ drop table t1;
set myisam_stats_method=nulls_ignored;
show variables like 'myisam_stats_method';
Variable_name Value
-myisam_stats_method nulls_ignored
+myisam_stats_method NULLS_IGNORED
create table t1 (
a char(3), b char(4), c char(5), d char(6),
key(a,b,c,d)
diff --git a/mysql-test/r/myisam_explain_non_select_all.result b/mysql-test/r/myisam_explain_non_select_all.result
index 3dfa56c38d6..fc0f54286a1 100644
--- a/mysql-test/r/myisam_explain_non_select_all.result
+++ b/mysql-test/r/myisam_explain_non_select_all.result
@@ -674,14 +674,14 @@ FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 0) order by `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
# Status of "equivalent" SELECT query execution:
Variable_name Value
-Handler_read_first 1
+Handler_read_key 1
Handler_read_next 3
# Status of testing query execution:
Variable_name Value
@@ -2785,10 +2785,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
DROP TABLE t1,t2;
#74
-CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+CREATE TABLE t1(a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
# used key is modified & Using temporary
#
diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result
index ea57146dad2..3c45117616c 100644
--- a/mysql-test/r/myisam_icp.result
+++ b/mysql-test/r/myisam_icp.result
@@ -414,17 +414,11 @@ DROP TABLE t1;
# Bug#59259 "Incorrect rows returned for a correlated subquery
# when ICP is on"
#
-CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t1 VALUES (11,0);
INSERT INTO t1 VALUES (12,5);
INSERT INTO t1 VALUES (15,0);
-CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't2'
+CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t2 VALUES (11,1);
INSERT INTO t2 VALUES (12,2);
INSERT INTO t2 VALUES (15,4);
@@ -604,6 +598,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
d1 pk i1
1 4 1
+EXPLAIN
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL k1 9 NULL 3 Using index
+1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+d1 pk i1
+1 4 1
DROP TABLE t1, t2;
#
# BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 8a24128daa2..09f014da627 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -1,3 +1,5 @@
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
drop table if exists t1,t2,t3;
create table t1(a int);
insert into t1 values(1);
@@ -527,6 +529,19 @@ a
| a |
| aaaaaaaaaaaaaaaaa |
+-------------------+
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database
+#
+#
+# End of 10.1 tests
+#
+ERROR 1300 (HY000): Invalid utf8 character string: 'test\xF0\x9F\x98\x81 '
+ERROR 1300 (HY000): Invalid binary character string: 'test\xF0\x9F\x98\x81 '
+ERROR 1300 (HY000) at line 2: Invalid utf8 character string: 'test\xF0\x9F\x98\x81'
+set GLOBAL sql_mode=default;
End of tests
create table `a1\``b1` (a int);
diff --git a/mysql-test/r/mysql_comments.result b/mysql-test/r/mysql_comments.result
index 7f1c0b50c5e..4865c7a7af0 100644
--- a/mysql-test/r/mysql_comments.result
+++ b/mysql-test/r/mysql_comments.result
@@ -1,3 +1,4 @@
+set global sql_mode="";
drop table if exists t1;
drop function if exists foofct;
drop procedure if exists empty;
@@ -59,4 +60,5 @@ Trigger sql_mode SQL Original Statement character_set_client collation_connectio
t1_bi CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1\nfor each row\nbegin\n# comment 1a\n-- comment 1b\n/*\n comment 1c\n*/\n -- declare some variables here\n declare b int;\n declare c float;\n\n -- do more stuff here\n -- commented nicely and so on\n\n -- famous last words ...\n set NEW.data := 12;\nend latin1 latin1_swedish_ci latin1_swedish_ci
id data
trig 12
+set global sql_mode=default;
End of 5.0 tests
diff --git a/mysql-test/r/mysql_plugin.result b/mysql-test/r/mysql_plugin.result
deleted file mode 100644
index 0bcb47e4a10..00000000000
--- a/mysql-test/r/mysql_plugin.result
+++ /dev/null
@@ -1,132 +0,0 @@
-#
-# Ensure the plugin isn't loaded.
-#
-SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
-name dl
-#
-# Enable the plugin...
-#
-#
-# Simulate loading a plugin libary with multiple entry points.
-# This will test the DISABLE to ensure all rows are removed.
-#
-INSERT INTO mysql.plugin VALUES ('wicky', 'libdaemon_example.so');
-INSERT INTO mysql.plugin VALUES ('wacky', 'libdaemon_example.so');
-INSERT INTO mysql.plugin VALUES ('wonky', 'libdaemon_example.so');
-#
-# Ensure the plugin is now loaded.
-#
-SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
-name dl
-daemon_example libdaemon_example.so
-wacky libdaemon_example.so
-wicky libdaemon_example.so
-wonky libdaemon_example.so
-#
-# Ensure the plugin is loaded.
-#
-SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
-name dl
-daemon_example libdaemon_example.so
-#
-# Ensure the plugin is replaced.
-#
-SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
-name dl
-daemon_example liblibdaemon_example.so
-#
-# Disable the plugin...
-#
-#
-# Ensure the plugin isn't loaded.
-#
-SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
-name dl
-#
-# Attempt to load non-existant plugin
-#
-ERROR: Cannot read plugin config file NOT_THERE_AT_ALL. File does not exist.
-#
-# Attempt to use non-existant plugin.ini file
-#
-ERROR: Cannot read plugin config file daemon_example. File does not exist.
-#
-# Attempt to omit the plugin
-#
-ERROR: No plugin specified.
-#
-# Attempt to omit DISABLE|ENABLE
-#
-ERROR: missing operation. Please specify either '<plugin> ENABLE' or '<plugin> DISABLE'.
-#
-# Attempt to use bad paths - datadir
-#
-ERROR: Cannot access datadir at '/data_not_there/'.
-#
-# Attempt to use bad paths - basedir
-#
-ERROR: Cannot access basedir at '/basedir_not_there/'.
-#
-# Attempt to use bad paths - plugin_dir
-#
-ERROR: Cannot read plugin config file daemon_example. File does not exist.
-#
-# Attempt to use bad paths - mysqld
-#
-ERROR: Cannot access mysqld path '/mysqld_not_there/'.
-#
-# Attempt to use bad paths - my_print_defaults
-#
-ERROR: Cannot access my-print-defaults path '/my_print_defaults_not_there/'.
-#
-# Missing library
-#
-ERROR: The plugin library is missing or in a different location.
-#
-# Bad format for config file
-#
-ERROR: Cannot read plugin config file daemon_example. Bad format in plugin configuration file.
-#
-# Missing base_dir option
-#
-ERROR: Missing --basedir option.
-#
-# Missing data_dir option
-#
-ERROR: Missing --datadir option.
-#
-# Missing plugin_dir option
-#
-ERROR: Missing --plugin_dir option.
-#
-# Show the help.
-#
-mysql_plugin Ver V.V.VV Distrib XX.XX.XX
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
-
-Enable or disable plugins.
-
-Usage: mysql_plugin [options] <plugin> ENABLE|DISABLE
-
-Options:
- -?, --help Display this help and exit.
- -b, --basedir=name The basedir for the server.
- -d, --datadir=name The datadir for the server.
- -p, --plugin-dir=name
- The plugin dir for the server.
- -i, --plugin-ini=name
- Read plugin information from configuration file specified
- instead of from <plugin-dir>/<plugin_name>.ini.
- -n, --no-defaults Do not read values from configuration file.
- -P, --print-defaults
- Show default values from configuration file.
- -m, --mysqld=name Path to mysqld executable. Example: /sbin/temp1/mysql/bin
- -f, --my-print-defaults=name
- Path to my_print_defaults executable. Example:
- /source/temp11/extra
- -v, --verbose More verbose output; you can use this multiple times to
- get even more verbose output.
- -V, --version Output version information and exit.
-
-
-mysql_plugin Ver V.V.VV Distrib XX.XX.XX
diff --git a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result
index f127e756987..03543244105 100644
--- a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result
+++ b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result
@@ -2,6 +2,9 @@
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
#
# Verbose run
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition;
@@ -25,7 +28,11 @@ Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zo
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
# Silent run
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition;
@@ -46,26 +53,39 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
#
# Testing with explicit timezonefile
#
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'GMT')
;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
#
# Testing --leap
#
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
TRUNCATE TABLE time_zone_leap_second;
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
#
# MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL
#
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
diff --git a/mysql-test/r/mysql_upgrade-6984.result b/mysql-test/r/mysql_upgrade-6984.result
index 6aea4806ddb..dacea61d094 100644
--- a/mysql-test/r/mysql_upgrade-6984.result
+++ b/mysql-test/r/mysql_upgrade-6984.result
@@ -1,5 +1,5 @@
update mysql.user set password=password("foo") where user='root';
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -42,10 +42,11 @@ error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -53,7 +54,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
update mysql.user set password='' where user='root';
flush privileges;
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 565423be624..69637f4078f 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -1,5 +1,6 @@
+set sql_mode="";
Run mysql_upgrade once
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -30,10 +31,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -41,12 +43,12 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
Run it again - should say already completed
This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
Force should run it regardless of whether it has been run before
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -77,10 +79,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -88,12 +91,12 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
GRANT ALL ON *.* TO mysqltest1@'%';
Run mysql_upgrade with password protected account
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -124,10 +127,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -135,7 +139,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
DROP USER mysqltest1@'%';
Version check failed. Got the following error when calling the 'mysql' command line client
@@ -145,7 +149,7 @@ Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -176,10 +180,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -187,7 +192,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
set GLOBAL sql_mode=default;
#
@@ -198,7 +203,7 @@ CREATE PROCEDURE testproc() BEGIN END;
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -229,10 +234,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -240,7 +246,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
CALL testproc();
DROP PROCEDURE testproc;
@@ -254,7 +260,7 @@ WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been
GRANT USAGE ON *.* TO 'user3'@'%';
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
Run mysql_upgrade with all privileges on a user
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -285,10 +291,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -296,7 +303,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
@@ -305,7 +312,7 @@ GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
DROP USER 'user3'@'%';
End of 5.1 tests
The --upgrade-system-tables option was used, user tables won't be touched.
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -336,11 +343,12 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views... Skipped
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names ... Skipped
-Phase 5/6: Checking and upgrading tables... Skipped
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views... Skipped
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names ... Skipped
+Phase 6/7: Checking and upgrading tables... Skipped
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
#
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
@@ -348,7 +356,7 @@ OK
#
# Droping the previously created mysql_upgrade_info file..
# Running mysql_upgrade with --skip-write-binlog..
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -379,10 +387,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -390,7 +399,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
#
# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
@@ -411,7 +420,7 @@ GRANT INSERT ON mysql.user TO very_long_user_name_number_2;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2;
CREATE PROCEDURE test.pr() BEGIN END;
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -442,10 +451,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -453,7 +463,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr';
definer
@@ -465,6 +475,7 @@ even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@loca
DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost;
DROP PROCEDURE test.pr;
use test;
+call mtr.add_suppression('Column last_update in table "mysql"."innodb_table_stats" is INT NOT NULL but should be');
alter table mysql.innodb_table_stats modify last_update int not null;
create table extralongname_extralongname_extralongname_extralongname_ext (
id int(10) unsigned not null,
@@ -486,3 +497,66 @@ length(table_name)
79
drop table extralongname_extralongname_extralongname_extralongname_ext;
End of 10.0 tests
+set sql_mode=default;
+# Droping the previously created mysql_upgrade_info file..
+create table test.t1(a int) engine=MyISAM;
+# Trying to enforce InnoDB for all tables
+SET GLOBAL enforce_storage_engine=InnoDB;
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.index_stats OK
+mysql.innodb_index_stats OK
+mysql.innodb_table_stats OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+performance_schema
+test
+test.t1 OK
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+# Should return 2
+SELECT count(*) FROM information_schema.tables where ENGINE="InnoDB";
+count(*)
+2
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE test.t1;
+SET GLOBAL enforce_storage_engine=NULL;
+End of 10.1 tests
diff --git a/mysql-test/r/mysql_upgrade_no_innodb.result b/mysql-test/r/mysql_upgrade_no_innodb.result
index acbca131587..6ad818278f8 100644
--- a/mysql-test/r/mysql_upgrade_no_innodb.result
+++ b/mysql-test/r/mysql_upgrade_no_innodb.result
@@ -1,5 +1,5 @@
The --upgrade-system-tables option was used, user tables won't be touched.
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -42,9 +42,10 @@ error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
-Phase 2/6: Fixing views... Skipped
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names ... Skipped
-Phase 5/6: Checking and upgrading tables... Skipped
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views... Skipped
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names ... Skipped
+Phase 6/7: Checking and upgrading tables... Skipped
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
diff --git a/mysql-test/r/mysql_upgrade_noengine.result b/mysql-test/r/mysql_upgrade_noengine.result
new file mode 100644
index 00000000000..09e705abb69
--- /dev/null
+++ b/mysql-test/r/mysql_upgrade_noengine.result
@@ -0,0 +1,297 @@
+install soname 'ha_blackhole';
+install soname 'ha_archive';
+create table t1 (a int) engine=blackhole;
+create table t2 (a int) engine=archive;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+table_catalog def
+table_schema test
+table_name t1
+table_type BASE TABLE
+engine BLACKHOLE
+row_format Fixed
+table_rows 0
+data_length 0
+table_comment
+table_catalog def
+table_schema test
+table_name t2
+table_type BASE TABLE
+engine ARCHIVE
+row_format Compressed
+table_rows 0
+data_length 521
+table_comment
+flush tables;
+uninstall plugin blackhole;
+uninstall plugin archive;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+table_catalog def
+table_schema test
+table_name t1
+table_type BASE TABLE
+engine BLACKHOLE
+row_format NULL
+table_rows NULL
+data_length NULL
+table_comment Unknown storage engine 'BLACKHOLE'
+table_catalog def
+table_schema test
+table_name t2
+table_type BASE TABLE
+engine ARCHIVE
+row_format NULL
+table_rows NULL
+data_length NULL
+table_comment Unknown storage engine 'ARCHIVE'
+Warnings:
+Level Warning
+Code 1286
+Message Unknown storage engine 'BLACKHOLE'
+Level Warning
+Code 1286
+Message Unknown storage engine 'ARCHIVE'
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.index_stats OK
+mysql.innodb_index_stats OK
+mysql.innodb_table_stats OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+performance_schema
+test
+test.t1
+Error : Unknown storage engine 'BLACKHOLE'
+error : Corrupt
+test.t2
+Error : Unknown storage engine 'ARCHIVE'
+error : Corrupt
+
+Repairing tables
+test.t1
+Error : Unknown storage engine 'BLACKHOLE'
+error : Corrupt
+test.t2
+Error : Unknown storage engine 'ARCHIVE'
+error : Corrupt
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+table_catalog def
+table_schema test
+table_name t1
+table_type BASE TABLE
+engine BLACKHOLE
+row_format NULL
+table_rows NULL
+data_length NULL
+table_comment Unknown storage engine 'BLACKHOLE'
+table_catalog def
+table_schema test
+table_name t2
+table_type BASE TABLE
+engine ARCHIVE
+row_format NULL
+table_rows NULL
+data_length NULL
+table_comment Unknown storage engine 'ARCHIVE'
+Warnings:
+Level Warning
+Code 1286
+Message Unknown storage engine 'BLACKHOLE'
+Level Warning
+Code 1286
+Message Unknown storage engine 'ARCHIVE'
+alter table mysql.user drop column default_role, drop column max_statement_time;
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.index_stats OK
+mysql.innodb_index_stats OK
+mysql.innodb_table_stats OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+performance_schema
+test
+test.t1
+Error : Unknown storage engine 'BLACKHOLE'
+error : Corrupt
+test.t2
+Error : Unknown storage engine 'ARCHIVE'
+error : Corrupt
+
+Repairing tables
+test.t1
+Error : Unknown storage engine 'BLACKHOLE'
+error : Corrupt
+test.t2
+Error : Unknown storage engine 'ARCHIVE'
+error : Corrupt
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+table_catalog def
+table_schema test
+table_name t1
+table_type BASE TABLE
+engine BLACKHOLE
+row_format NULL
+table_rows NULL
+data_length NULL
+table_comment Unknown storage engine 'BLACKHOLE'
+table_catalog def
+table_schema test
+table_name t2
+table_type BASE TABLE
+engine ARCHIVE
+row_format NULL
+table_rows NULL
+data_length NULL
+table_comment Unknown storage engine 'ARCHIVE'
+Warnings:
+Level Warning
+Code 1286
+Message Unknown storage engine 'BLACKHOLE'
+Level Warning
+Code 1286
+Message Unknown storage engine 'ARCHIVE'
+alter table mysql.user drop column default_role, drop column max_statement_time;
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.index_stats OK
+mysql.innodb_index_stats OK
+mysql.innodb_table_stats OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+Upgrading from a version before MariaDB-10.1
+Phase 2/7: Installing used storage engines
+Checking for tables with unknown storage engine
+installing plugin for 'blackhole' storage engine
+installing plugin for 'archive' storage engine
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+performance_schema
+test
+test.t1 OK
+test.t2 OK
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+table_catalog def
+table_schema test
+table_name t1
+table_type BASE TABLE
+engine BLACKHOLE
+row_format Fixed
+table_rows 0
+data_length 0
+table_comment
+table_catalog def
+table_schema test
+table_name t2
+table_type BASE TABLE
+engine ARCHIVE
+row_format Compressed
+table_rows 0
+data_length 521
+table_comment
+drop table t1, t2;
+uninstall plugin blackhole;
+uninstall plugin archive;
diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result
index e06d1bb1671..918a24ffc71 100644
--- a/mysql-test/r/mysql_upgrade_ssl.result
+++ b/mysql-test/r/mysql_upgrade_ssl.result
@@ -1,7 +1,7 @@
#
# Bug#55672 mysql_upgrade dies with internal error
#
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -32,10 +32,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-Phase 2/6: Fixing views
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -43,5 +44,5 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result
index 7966941cb1f..dc31592566a 100644
--- a/mysql-test/r/mysql_upgrade_view.result
+++ b/mysql-test/r/mysql_upgrade_view.result
@@ -63,7 +63,7 @@ test.v2 check error Upgrade required. Please do "REPAIR VIEW `v2`" or dump/reloa
check view v3 for upgrade;
Table Op Msg_type Msg_text
test.v3 check error Upgrade required. Please do "REPAIR VIEW `v3`" or dump/reload to fix it!
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -106,14 +106,15 @@ error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
-Phase 2/6: Fixing views
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
test.v1 OK
test.v1badcheck OK
test.v2 OK
test.v3 OK
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -123,7 +124,7 @@ performance_schema
test
test.kv OK
test.t1 OK
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
show create view v1;
View Create View character_set_client collation_connection
@@ -205,7 +206,7 @@ show create view v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
MySQL upgrade detected
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -249,14 +250,15 @@ error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
-Phase 2/6: Fixing views from mysql
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views from mysql
test.v1 OK
test.v2 OK
test.v3 OK
test.v4 OK
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names
-Phase 5/6: Checking and upgrading tables
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
@@ -266,8 +268,9 @@ performance_schema
test
test.kv OK
test.t1 OK
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
+flush tables;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
@@ -322,7 +325,7 @@ rename table mysql.event to mysql.ev_bk;
flush tables;
The --upgrade-system-tables option was used, user tables won't be touched.
MySQL upgrade detected
-Phase 1/6: Checking and upgrading mysql database
+Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
@@ -366,14 +369,15 @@ error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
-Phase 2/6: Fixing views from mysql
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views from mysql
test.v1 OK
test.v2 OK
test.v3 OK
-Phase 3/6: Running 'mysql_fix_privilege_tables'
-Phase 4/6: Fixing table and database names ... Skipped
-Phase 5/6: Checking and upgrading tables... Skipped
-Phase 6/6: Running 'FLUSH PRIVILEGES'
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names ... Skipped
+Phase 6/7: Checking and upgrading tables... Skipped
+Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
drop table mysql.event;
rename table mysql.ev_bk to mysql.event;
diff --git a/mysql-test/r/mysqlbinlog-innodb.result b/mysql-test/r/mysqlbinlog-innodb.result
index f0358928c0e..2704be9e3ed 100644
--- a/mysql-test/r/mysqlbinlog-innodb.result
+++ b/mysql-test/r/mysqlbinlog-innodb.result
@@ -30,7 +30,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -61,7 +61,7 @@ use `foo`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index fe1af53e837..8463c3074a0 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -23,7 +23,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -103,7 +103,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -139,7 +139,7 @@ BEGIN
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -190,7 +190,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -217,7 +217,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -297,7 +297,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -333,7 +333,7 @@ BEGIN
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -384,7 +384,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -493,7 +493,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -545,7 +545,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/r/mysqlbinlog_raw_mode.result b/mysql-test/r/mysqlbinlog_raw_mode.result
new file mode 100644
index 00000000000..b64a2148a82
--- /dev/null
+++ b/mysql-test/r/mysqlbinlog_raw_mode.result
@@ -0,0 +1,274 @@
+reset master;
+set timestamp=1000000000;
+drop table if exists t1;
+CREATE TABLE t1 (c01 BIT);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+CREATE TABLE t1 (c01 BIT(7));
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (16);
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (64);
+INSERT INTO t1 VALUES (127);
+DELETE FROM t1 WHERE c01=127;
+UPDATE t1 SET c01=15 WHERE c01=16;
+DROP TABLE t1;
+CREATE TABLE t1 (a BIT(20), b CHAR(2));
+INSERT INTO t1 VALUES (b'00010010010010001001', 'ab');
+DROP TABLE t1;
+CREATE TABLE t1 (c02 BIT(64));
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (128);
+INSERT INTO t1 VALUES (b'1111111111111111111111111111111111111111111111111111111111111111');
+DROP TABLE t1;
+CREATE TABLE t1 (c03 TINYINT);
+INSERT INTO t1 VALUES (1),(2),(3);
+INSERT INTO t1 VALUES (-128);
+UPDATE t1 SET c03=2 WHERE c03=1;
+DELETE FROM t1 WHERE c03=-128;
+DROP TABLE t1;
+CREATE TABLE t1 (c04 TINYINT UNSIGNED);
+INSERT INTO t1 VALUES (128), (255);
+UPDATE t1 SET c04=2 WHERE c04=1;
+DELETE FROM t1 WHERE c04=255;
+DROP TABLE t1;
+CREATE TABLE t1 (c06 BOOL);
+INSERT INTO t1 VALUES (TRUE);
+DELETE FROM t1 WHERE c06=TRUE;
+DROP TABLE t1;
+CREATE TABLE t1 (c07 SMALLINT);
+INSERT INTO t1 VALUES (1234);
+DELETE FROM t1 WHERE c07=1234;
+DROP TABLE t1;
+CREATE TABLE t1 (c08 SMALLINT UNSIGNED);
+INSERT INTO t1 VALUES (32768), (65535);
+UPDATE t1 SET c08=2 WHERE c08=32768;
+DELETE FROM t1 WHERE c08=65535;
+DROP TABLE t1;
+CREATE TABLE t1 (c10 MEDIUMINT);
+INSERT INTO t1 VALUES (12345);
+DELETE FROM t1 WHERE c10=12345;
+DROP TABLE t1;
+CREATE TABLE t1 (c11 MEDIUMINT UNSIGNED);
+INSERT INTO t1 VALUES (8388608), (16777215);
+UPDATE t1 SET c11=2 WHERE c11=8388608;
+DELETE FROM t1 WHERE c11=16777215;
+DROP TABLE t1;
+CREATE TABLE t1 (c13 INT);
+INSERT INTO t1 VALUES (123456);
+DELETE FROM t1 WHERE c13=123456;
+DROP TABLE t1;
+CREATE TABLE t1 (c14 INT UNSIGNED);
+INSERT INTO t1 VALUES (2147483648), (4294967295);
+UPDATE t1 SET c14=2 WHERE c14=2147483648;
+DELETE FROM t1 WHERE c14=4294967295;
+DROP TABLE t1;
+CREATE TABLE t1 (c16 BIGINT);
+INSERT INTO t1 VALUES (1234567890);
+DELETE FROM t1 WHERE c16=1234567890;
+DROP TABLE t1;
+CREATE TABLE t1 (c17 BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (9223372036854775808), (18446744073709551615);
+UPDATE t1 SET c17=2 WHERE c17=9223372036854775808;
+DELETE FROM t1 WHERE c17=18446744073709551615;
+DROP TABLE t1;
+CREATE TABLE t1 (c19 FLOAT);
+INSERT INTO t1 VALUES (123.2234);
+DELETE FROM t1 WHERE c19>123;
+DROP TABLE t1;
+CREATE TABLE t1 (c22 DOUBLE);
+INSERT INTO t1 VALUES (123434.22344545);
+DELETE FROM t1 WHERE c22>123434;
+DROP TABLE t1;
+CREATE TABLE t1 (c25 DECIMAL(10,5));
+INSERT INTO t1 VALUES (124.45);
+INSERT INTO t1 VALUES (-543.21);
+DELETE FROM t1 WHERE c25=124.45;
+DROP TABLE t1;
+CREATE TABLE t1 (c28 DATE);
+INSERT INTO t1 VALUES ('2001-02-03');
+DELETE FROM t1 WHERE c28='2001-02-03';
+DROP TABLE t1;
+CREATE TABLE t1 (c29 DATETIME);
+INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
+DELETE FROM t1 WHERE c29='2001-02-03 10:20:30';
+DROP TABLE t1;
+CREATE TABLE t1 (c30 TIMESTAMP);
+INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
+DELETE FROM t1 WHERE c30='2001-02-03 10:20:30';
+DROP TABLE t1;
+CREATE TABLE t1 (c31 TIME);
+INSERT INTO t1 VALUES ('11:22:33');
+DELETE FROM t1 WHERE c31='11:22:33';
+DROP TABLE t1;
+CREATE TABLE t1 (c32 YEAR);
+INSERT INTO t1 VALUES ('2001');
+DELETE FROM t1 WHERE c32=2001;
+DROP TABLE t1;
+CREATE TABLE t1 (c33 CHAR);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c33='a';
+DROP TABLE t1;
+CREATE TABLE t1 (c34 CHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c34='';
+DROP TABLE t1;
+CREATE TABLE t1 (c35 CHAR(1));
+INSERT INTO t1 VALUES ('b');
+DELETE FROM t1 WHERE c35='b';
+DROP TABLE t1;
+CREATE TABLE t1 (c36 CHAR(255));
+INSERT INTO t1 VALUES (repeat('c',255));
+DELETE FROM t1 WHERE c36>'c';
+DROP TABLE t1;
+CREATE TABLE t1 (c37 NATIONAL CHAR);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c37='a';
+DROP TABLE t1;
+CREATE TABLE t1 (c38 NATIONAL CHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c38='';
+DROP TABLE t1;
+CREATE TABLE t1 (c39 NATIONAL CHAR(1));
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c39='a';
+DROP TABLE t1;
+CREATE TABLE t1 (c40 NATIONAL CHAR(255));
+INSERT INTO t1 VALUES (repeat('a', 255));
+INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
+DELETE FROM t1 WHERE c40>'a';
+DROP TABLE t1;
+CREATE TABLE t1 (c45 VARCHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c45='';
+DROP TABLE t1;
+CREATE TABLE t1 (c46 VARCHAR(1));
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c46='a';
+DROP TABLE t1;
+CREATE TABLE t1 (c47 VARCHAR(255));
+INSERT INTO t1 VALUES (repeat('a',255));
+DELETE FROM t1 WHERE c47>'a';
+DROP TABLE t1;
+CREATE TABLE t1 (c48 VARCHAR(261));
+INSERT INTO t1 VALUES (repeat('a',261));
+DELETE FROM t1 WHERE c48>'a';
+DROP TABLE t1;
+CREATE TABLE t1 (c49 NATIONAL VARCHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c49='';
+DROP TABLE t1;
+CREATE TABLE t1 (c50 NATIONAL VARCHAR(1));
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c50='a';
+DROP TABLE t1;
+CREATE TABLE t1 (c51 NATIONAL VARCHAR(255));
+INSERT INTO t1 VALUES (repeat('a',255));
+INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
+DELETE FROM t1 WHERE c51>'a';
+DROP TABLE t1;
+CREATE TABLE t1 (c52 NATIONAL VARCHAR(261));
+INSERT INTO t1 VALUES (repeat('a',261));
+INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 261));
+DELETE FROM t1 WHERE c52>'a';
+DROP TABLE t1;
+CREATE TABLE t1 (c57 BINARY);
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c57='a';
+DROP TABLE t1;
+CREATE TABLE t1 (c58 BINARY(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c58='';
+DROP TABLE t1;
+CREATE TABLE t1 (c59 BINARY(1));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c59='a';
+DROP TABLE t1;
+CREATE TABLE t1 (c60 BINARY(255));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES (repeat('a\0',120));
+DELETE FROM t1 WHERE c60<0x02;
+DROP TABLE t1;
+CREATE TABLE t1 (c61 VARBINARY(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c61='';
+DROP TABLE t1;
+CREATE TABLE t1 (c62 VARBINARY(1));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c62=0x02;
+DROP TABLE t1;
+CREATE TABLE t1 (c63 VARBINARY(255));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES (repeat('a\0',120));
+DELETE FROM t1 WHERE c63=0x02;
+DROP TABLE t1;
+flush logs;
+CREATE TABLE t1 (c65 TINYBLOB);
+INSERT INTO t1 VALUES ('tinyblob1');
+DELETE FROM t1 WHERE c65='tinyblob1';
+DROP TABLE t1;
+CREATE TABLE t1 (c68 BLOB);
+INSERT INTO t1 VALUES ('blob1');
+DELETE FROM t1 WHERE c68='blob1';
+DROP TABLE t1;
+CREATE TABLE t1 (c71 MEDIUMBLOB);
+INSERT INTO t1 VALUES ('mediumblob1');
+DELETE FROM t1 WHERE c71='mediumblob1';
+DROP TABLE t1;
+CREATE TABLE t1 (c74 LONGBLOB);
+INSERT INTO t1 VALUES ('longblob1');
+DELETE FROM t1 WHERE c74='longblob1';
+DROP TABLE t1;
+CREATE TABLE t1 (c66 TINYTEXT);
+INSERT INTO t1 VALUES ('tinytext1');
+DELETE FROM t1 WHERE c66='tinytext1';
+DROP TABLE t1;
+CREATE TABLE t1 (c69 TEXT);
+INSERT INTO t1 VALUES ('text1');
+DELETE FROM t1 WHERE c69='text1';
+DROP TABLE t1;
+CREATE TABLE t1 (c72 MEDIUMTEXT);
+INSERT INTO t1 VALUES ('mediumtext1');
+DELETE FROM t1 WHERE c72='mediumtext1';
+DROP TABLE t1;
+CREATE TABLE t1 (c75 LONGTEXT);
+INSERT INTO t1 VALUES ('longtext1');
+DELETE FROM t1 WHERE c75='longtext1';
+DROP TABLE t1;
+CREATE TABLE t1 (c77 ENUM('a','b','c'));
+INSERT INTO t1 VALUES ('b');
+DELETE FROM t1 WHERE c77='b';
+DROP TABLE t1;
+CREATE TABLE t1 (c78 SET('a','b','c','d','e','f'));
+INSERT INTO t1 VALUES ('a,b');
+INSERT INTO t1 VALUES ('a,c');
+INSERT INTO t1 VALUES ('b,c');
+INSERT INTO t1 VALUES ('a,b,c');
+INSERT INTO t1 VALUES ('a,b,c,d');
+INSERT INTO t1 VALUES ('a,b,c,d,e');
+INSERT INTO t1 VALUES ('a,b,c,d,e,f');
+DELETE FROM t1 WHERE c78='a,b';
+DROP TABLE t1;
+CREATE TABLE t1 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
+CREATE TABLE t2 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
+INSERT INTO t1 SET a=1;
+INSERT INTO t1 SET b=1;
+INSERT INTO t2 SET a=1;
+INSERT INTO t2 SET b=1;
+UPDATE t1, t2 SET t1.a=10, t2.a=20;
+DROP TABLE t1,t2;
+flush logs;
+End of tests
diff --git a/mysql-test/r/mysqlbinlog_row_big.result b/mysql-test/r/mysqlbinlog_row_big.result
index 0bdbfdcee3a..70e39266d1d 100644
--- a/mysql-test/r/mysqlbinlog_row_big.result
+++ b/mysql-test/r/mysqlbinlog_row_big.result
@@ -97,6 +97,6 @@ FLUSH LOGS;
# Cleanup.
#
# reset variable value to pass testcase checks
-SET @@global.max_allowed_packet = 1048576;
+SET @@global.max_allowed_packet = 4194304;
DROP TABLE t1;
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
diff --git a/mysql-test/r/mysqlbinlog_row_minimal.result b/mysql-test/r/mysqlbinlog_row_minimal.result
new file mode 100644
index 00000000000..6ffaeeafc53
--- /dev/null
+++ b/mysql-test/r/mysqlbinlog_row_minimal.result
@@ -0,0 +1,300 @@
+CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1));
+CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1));
+INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "");
+INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL);
+INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A");
+INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A");
+INSERT INTO t2 SELECT * FROM t1;
+UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL;
+DELETE FROM t1;
+DELETE FROM t2;
+FLUSH BINARY LOGS;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at 4
+#<date> server id 1 end_log_pos 249 Start: xxx
+ROLLBACK/*!*/;
+# at 249
+#<date> server id 1 end_log_pos 274 Gtid list []
+# at 274
+#<date> server id 1 end_log_pos 314 Binlog checkpoint master-bin.000001
+# at 314
+#<date> server id 1 end_log_pos 352 GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
+/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
+/*!100001 SET @@session.server_id=1*//*!*/;
+/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
+# at 352
+#<date> server id 1 end_log_pos 532 Query thread_id=4 exec_time=x error_code=0
+use `test`/*!*/;
+SET TIMESTAMP=X/*!*/;
+SET @@session.pseudo_thread_id=4/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1))
+/*!*/;
+# at 532
+#<date> server id 1 end_log_pos 570 GTID 0-1-2 ddl
+/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
+# at 570
+#<date> server id 1 end_log_pos 743 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1))
+/*!*/;
+# at 743
+#<date> server id 1 end_log_pos 781 GTID 0-1-3
+/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
+BEGIN
+/*!*/;
+# at 781
+#<date> server id 1 end_log_pos 833 Table_map: `test`.`t1` mapped to number 30
+# at 833
+#<date> server id 1 end_log_pos 898 Write_rows: table id 30 flags: STMT_END_F
+### INSERT INTO `test`.`t1`
+### SET
+### @1=10 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */
+### @5=4 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# at 898
+#<date> server id 1 end_log_pos 967 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 967
+#<date> server id 1 end_log_pos 1005 GTID 0-1-4
+/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
+BEGIN
+/*!*/;
+# at 1005
+#<date> server id 1 end_log_pos 1057 Table_map: `test`.`t1` mapped to number 30
+# at 1057
+#<date> server id 1 end_log_pos 1121 Write_rows: table id 30 flags: STMT_END_F
+### INSERT INTO `test`.`t1`
+### SET
+### @1=11 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */
+### @5=4 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+# at 1121
+#<date> server id 1 end_log_pos 1190 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 1190
+#<date> server id 1 end_log_pos 1228 GTID 0-1-5
+/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
+BEGIN
+/*!*/;
+# at 1228
+#<date> server id 1 end_log_pos 1280 Table_map: `test`.`t1` mapped to number 30
+# at 1280
+#<date> server id 1 end_log_pos 1343 Write_rows: table id 30 flags: STMT_END_F
+### INSERT INTO `test`.`t1`
+### SET
+### @1=12 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */
+### @5=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# at 1343
+#<date> server id 1 end_log_pos 1412 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 1412
+#<date> server id 1 end_log_pos 1450 GTID 0-1-6
+/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
+BEGIN
+/*!*/;
+# at 1450
+#<date> server id 1 end_log_pos 1502 Table_map: `test`.`t1` mapped to number 30
+# at 1502
+#<date> server id 1 end_log_pos 1568 Write_rows: table id 30 flags: STMT_END_F
+### INSERT INTO `test`.`t1`
+### SET
+### @1=13 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */
+### @5=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# at 1568
+#<date> server id 1 end_log_pos 1637 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 1637
+#<date> server id 1 end_log_pos 1675 GTID 0-1-7
+/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
+BEGIN
+/*!*/;
+# at 1675
+#<date> server id 1 end_log_pos 1727 Table_map: `test`.`t2` mapped to number 31
+# at 1727
+#<date> server id 1 end_log_pos 1890 Write_rows: table id 31 flags: STMT_END_F
+### INSERT INTO `test`.`t2`
+### SET
+### @1=10 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* INT meta=0 nullable=1 is_null=0 */
+### @5=4 /* INT meta=0 nullable=1 is_null=0 */
+### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=11 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* INT meta=0 nullable=1 is_null=0 */
+### @5=4 /* INT meta=0 nullable=1 is_null=0 */
+### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=12 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* INT meta=0 nullable=1 is_null=0 */
+### @5=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=13 /* INT meta=0 nullable=0 is_null=0 */
+### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4=3 /* INT meta=0 nullable=1 is_null=0 */
+### @5=0 /* INT meta=0 nullable=1 is_null=0 */
+### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+### @7=6 /* INT meta=0 nullable=1 is_null=0 */
+### @8=7 /* INT meta=0 nullable=1 is_null=0 */
+### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# at 1890
+#<date> server id 1 end_log_pos 1959 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 1959
+#<date> server id 1 end_log_pos 1997 GTID 0-1-8
+/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
+BEGIN
+/*!*/;
+# at 1997
+#<date> server id 1 end_log_pos 2049 Table_map: `test`.`t2` mapped to number 31
+# at 2049
+#<date> server id 1 end_log_pos 2119 Update_rows: table id 31 flags: STMT_END_F
+### UPDATE `test`.`t2`
+### WHERE
+### @1=10 /* INT meta=0 nullable=0 is_null=0 */
+### @5=4 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @5=5 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=11 /* INT meta=0 nullable=0 is_null=0 */
+### @5=4 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @5=5 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=12 /* INT meta=0 nullable=0 is_null=0 */
+### @5=NULL /* INT meta=0 nullable=1 is_null=1 */
+### SET
+### @5=5 /* INT meta=0 nullable=1 is_null=0 */
+# at 2119
+#<date> server id 1 end_log_pos 2188 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 2188
+#<date> server id 1 end_log_pos 2226 GTID 0-1-9
+/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
+BEGIN
+/*!*/;
+# at 2226
+#<date> server id 1 end_log_pos 2278 Table_map: `test`.`t1` mapped to number 30
+# at 2278
+#<date> server id 1 end_log_pos 2328 Delete_rows: table id 30 flags: STMT_END_F
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=10 /* INT meta=0 nullable=0 is_null=0 */
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=11 /* INT meta=0 nullable=0 is_null=0 */
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=12 /* INT meta=0 nullable=0 is_null=0 */
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=13 /* INT meta=0 nullable=0 is_null=0 */
+# at 2328
+#<date> server id 1 end_log_pos 2397 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 2397
+#<date> server id 1 end_log_pos 2435 GTID 0-1-10
+/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
+BEGIN
+/*!*/;
+# at 2435
+#<date> server id 1 end_log_pos 2487 Table_map: `test`.`t2` mapped to number 31
+# at 2487
+#<date> server id 1 end_log_pos 2537 Delete_rows: table id 31 flags: STMT_END_F
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=10 /* INT meta=0 nullable=0 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=11 /* INT meta=0 nullable=0 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=12 /* INT meta=0 nullable=0 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=13 /* INT meta=0 nullable=0 is_null=0 */
+# at 2537
+#<date> server id 1 end_log_pos 2606 Query thread_id=4 exec_time=x error_code=0
+SET TIMESTAMP=X/*!*/;
+COMMIT
+/*!*/;
+# at 2606
+#<date> server id 1 end_log_pos 2650 Rotate to master-bin.000002 pos: 4
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 256b1375b6b..8894616fbb3 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -329,7 +329,7 @@ DROP TABLE bug47205;
# Should indicate that REPAIR TABLE is needed
CHECK TABLE bug47205 FOR UPGRADE;
Table Op Msg_type Msg_text
-test.bug47205 check error Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it!
+test.bug47205 check error Upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it!
# Running mysqlcheck to check and upgrade
test.bug47205 Needs upgrade
diff --git a/mysql-test/r/mysqld--help,win.rdiff b/mysql-test/r/mysqld--help,win.rdiff
index 24719fce917..06116a2e630 100644
--- a/mysql-test/r/mysqld--help,win.rdiff
+++ b/mysql-test/r/mysqld--help,win.rdiff
@@ -1,6 +1,6 @@
---- mysql-test/r/mysqld--help.result 2012-09-08 22:22:06 +0000
-+++ mysql-test/r/mysqld--help.result 2012-10-01 14:03:59 +0000
-@@ -248,7 +248,6 @@
+--- mysqld--help.result
++++ mysqld--help,win.reject
+@@ -333,7 +333,6 @@
The number of segments in a key cache
-L, --language=name Client error messages in given language. May be given as
a full path. Deprecated. Use --lc-messages-dir instead.
@@ -8,15 +8,15 @@
--lc-messages=name Set the language used for the error messages.
-L, --lc-messages-dir=name
Directory where error messages are
-@@ -443,6 +442,7 @@
- NULLS_UNEQUAL (default behavior for 4.1 and later),
- NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
- --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
+@@ -533,6 +532,7 @@
+ Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
+ DATETIME, TIMESTAMP columns.
+ (Defaults to on; use --skip-mysql56-temporal-format to disable.)
+ --named-pipe Enable the named pipe (NT)
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
-@@ -710,6 +710,9 @@
+@@ -924,6 +924,9 @@
files within specified directory
--server-id=# Uniquely identifies the server instance in the community
of replication partners
@@ -26,7 +26,7 @@
--show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this
master.
-@@ -777,6 +780,10 @@
+@@ -1034,6 +1037,10 @@
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
slow log options
@@ -37,16 +37,16 @@
--socket=name Socket file to use for connection
--sort-buffer-size=#
Each thread that needs to do a sort allocates a buffer of
-@@ -785,6 +792,7 @@
- for the complete list of valid sql modes
+@@ -1052,6 +1059,7 @@
+ NO_ENGINE_SUBSTITUTION, PAD_CHAR_TO_FULL_LENGTH
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
+ --standalone Dummy option to start as a standalone program (NT).
--stored-program-cache=#
The soft upper limit for number of cached stored routines
for one connection.
-@@ -817,25 +825,11 @@
- values are COMMIT or ROLLBACK.
+@@ -1088,25 +1096,11 @@
+ COMMIT, ROLLBACK
--thread-cache-size=#
How many threads we should keep in a cache for reuse
- --thread-pool-idle-timeout=#
@@ -72,10 +72,10 @@
+ Minimum number of threads in the thread pool.
--thread-stack=# The stack size for each thread
--time-format=name The TIME format (ignored)
- --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are
-@@ -844,8 +838,8 @@
- size, MySQL will automatically convert it to an on-disk
- MyISAM or Aria table
+ --timed-mutexes Specify whether to time mutexes. Deprecated, has no
+@@ -1115,8 +1109,8 @@
+ size, MariaDB will automatically convert it to an on-disk
+ MyISAM or Aria table.
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
- separated by a colon (:), in this case they are used in a
- round-robin fashion
@@ -84,48 +84,55 @@
--transaction-alloc-block-size=#
Allocation block size for transactions to be stored in
binary log
-@@ -949,7 +943,6 @@
- key-cache-block-size 1024
+@@ -1240,7 +1234,6 @@
key-cache-division-limit 100
+ key-cache-file-hash-size 512
key-cache-segments 0
-large-pages FALSE
lc-messages en_US
lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
-@@ -1012,6 +1005,7 @@
- myisam-sort-buffer-size 8388608
- myisam-stats-method nulls_unequal
+@@ -1307,6 +1300,7 @@
+ myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
+ mysql56-temporal-format TRUE
+named-pipe FALSE
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
-@@ -1077,6 +1071,8 @@
- secure-auth FALSE
+@@ -1403,6 +1397,8 @@
+ secure-auth TRUE
secure-file-priv (No default value)
server-id 0
+shared-memory FALSE
+shared-memory-base-name MYSQL
show-slave-auth-info FALSE
+ silent-startup FALSE
skip-grant-tables TRUE
- skip-name-resolve FALSE
-@@ -1093,6 +1089,7 @@
+@@ -1426,6 +1422,7 @@
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
+slow-start-timeout 15000
sort-buffer-size 2097152
- sql-mode
+ sql-mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
stack-trace TRUE
-@@ -1109,10 +1106,8 @@
- table-open-cache 400
- tc-heuristic-recover COMMIT
+@@ -1438,15 +1435,13 @@
+ sync-relay-log 10000
+ sync-relay-log-info 10000
+ sysdate-is-now FALSE
+-table-cache 431
++table-cache 2000
+ table-definition-cache 400
+-table-open-cache 431
++table-open-cache 2000
+ tc-heuristic-recover OFF
thread-cache-size 0
-thread-pool-idle-timeout 60
- thread-pool-max-threads 500
+ thread-pool-max-threads 1000
-thread-pool-oversubscribe 3
-thread-pool-stall-limit 500
+thread-pool-min-threads 1
- thread-stack 294912
+ thread-stack 295936
time-format %H:%i:%s
timed-mutexes FALSE
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index 79a00a568b2..e84921bfa0a 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -1,3 +1,4 @@
+Windows bug: happens when a new line is exactly at the right offset.
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
@@ -21,13 +22,16 @@ The following options may be given as the first argument:
--automatic-sp-privileges
Creating and dropping stored procedures alters ACLs
(Defaults to on; use --skip-automatic-sp-privileges to disable.)
- --back-log=# The number of outstanding connection requests MySQL can
- have. This comes into play when the main MySQL thread
+ --back-log=# The number of outstanding connection requests MariaDB can
+ have. This comes into play when the main MariaDB thread
gets very many connection requests in a very short time
+ (Automatically configured unless set explicitly)
-b, --basedir=name Path to installation directory. All paths are usually
resolved relative to this
- --big-tables Allow big result sets by saving all temporary sets on
- file (Solves most 'table full' errors)
+ --big-tables Old variable, which if set to 1, allows large result sets
+ by saving all temporary sets to disk, avoiding 'table
+ full' errors. No longer needed, as the server now handles
+ this automatically. sql_big_tables is a synonym.
--bind-address=name IP address to bind to.
--binlog-annotate-row-events
Tells the master to annotate RBR events with the
@@ -39,8 +43,7 @@ The following options may be given as the first argument:
increase this to get more performance
--binlog-checksum=name
Type of BINLOG_CHECKSUM_ALG. Include checksum for log
- events in the binary log. Possible values are NONE and
- CRC32; default is NONE.
+ events in the binary log. One of: NONE, CRC32
--binlog-commit-wait-count=#
If non-zero, binlog write will wait at most
binlog_commit_wait_usec microseconds for at least this
@@ -71,10 +74,7 @@ The following options may be given as the first argument:
statements where only row-based is correct: those which
involve user-defined functions (i.e. UDFs) or the UUID()
function; for those, row-based binary logging is
- automatically used. If NDBCLUSTER is enabled and
- binlog-format is MIXED, the format switches to row-based
- and back implicitly per each query accessing an
- NDBCLUSTER table
+ automatically used.
--binlog-ignore-db=name
Tells the master that updates to the given database
should not be logged to the binary log.
@@ -91,15 +91,29 @@ The following options may be given as the first argument:
The maximum size of a row-based binary log event in
bytes. Rows will be grouped into events smaller than this
size if possible. The value has to be a multiple of 256.
+ --binlog-row-image=name
+ Controls whether rows should be logged in 'FULL',
+ 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all
+ columns in the before and after image are logged.
+ 'NOBLOB', means that mysqld avoids logging blob columns
+ whenever possible (eg, blob column was not changed or is
+ not part of primary key). 'MINIMAL', means that a PK
+ equivalent (PK columns or full row if there is no PK in
+ the table) is logged in the before image, and only
+ changed columns are logged in the after image. (Default:
+ FULL).
--binlog-stmt-cache-size=#
The size of the statement cache for updates to
non-transactional engines for the binary log. If you
often use statements updating a great number of rows, you
- can increase this to get more performance
+ can increase this to get more performance.
--bootstrap Used by mysql installation scripts.
--bulk-insert-buffer-size=#
Size of tree cache used in bulk insert optimisation. Note
that this is a limit per thread!
+ --changed-page-bitmaps[=name]
+ Enable or disable CHANGED_PAGE_BITMAPS plugin. One of:
+ ON, OFF, FORCE (don't start if the plugin fails to load).
--character-set-client-handshake
Don't ignore client side character set value sent during
handshake.
@@ -114,11 +128,11 @@ The following options may be given as the first argument:
--collation-server=name
Set the default collation.
--completion-type=name
- The transaction completion type, one of NO_CHAIN, CHAIN,
+ The transaction completion type. One of: NO_CHAIN, CHAIN,
RELEASE
--concurrent-insert[=name]
- Use concurrent insert with MyISAM. Possible values are
- NEVER, AUTO, ALWAYS
+ Use concurrent insert with MyISAM. One of: NEVER, AUTO,
+ ALWAYS
--console Write error output on screen; don't remove the console
window on windows.
--core-file Write core on errors.
@@ -137,22 +151,33 @@ The following options may be given as the first argument:
Short timeout for the two-step deadlock detection (in
microseconds)
--default-regex-flags=name
- Default flags for the regex library. Syntax:
- default-regex-flags='[flag[,flag[,flag...]]]'. See the
- manual for the complete list of valid flags
+ Default flags for the regex library. Any combination of:
+ DOTALL, DUPNAMES, EXTENDED, EXTRA, MULTILINE, UNGREEDY
--default-storage-engine=name
The default storage engine for new tables
--default-time-zone=name
Set the default time zone.
+ --default-tmp-storage-engine=name
+ The default storage engine for user-created temporary
+ tables
--default-week-format=#
The default week format used by WEEK() functions
--delay-key-write[=name]
- Type of DELAY_KEY_WRITE
+ Specifies how MyISAM tables handles CREATE TABLE
+ DELAY_KEY_WRITE. If set to ON, the default, any DELAY KEY
+ WRITEs are honored. The key buffer is then flushed only
+ when the table closes, speeding up writes. MyISAM tables
+ should be automatically checked upon startup in this
+ case, and --external locking should not be used, as it
+ can lead to index corruption. If set to OFF, DELAY KEY
+ WRITEs are ignored, while if set to ALL, all new opened
+ tables are treated as if created with DELAY KEY WRITEs
+ enabled.
--delayed-insert-limit=#
After inserting delayed_insert_limit rows, the INSERT
DELAYED handler will check if there are any SELECT
statements pending. If so, it allows these to execute
- before continuing
+ before continuing.
--delayed-insert-timeout=#
How long a INSERT DELAYED thread should wait for INSERT
statements before terminating
@@ -164,6 +189,14 @@ The following options may be given as the first argument:
--div-precision-increment=#
Precision of the result of '/' operator will be increased
on that value
+ --encrypt-binlog Encrypt binary logs (including relay logs)
+ --encrypt-tmp-disk-tables
+ Encrypt temporary on-disk tables (created as part of
+ query execution)
+ --encrypt-tmp-files Encrypt temporary files (created for filesort, binary log
+ cache, etc)
+ --enforce-storage-engine=name
+ Force the use of a storage engine for new tables
--event-scheduler[=name]
Enable the event scheduler. Possible values are ON, OFF,
and DISABLED (keep the event scheduler completely
@@ -176,6 +209,11 @@ The following options may be given as the first argument:
If non-zero, binary logs will be purged after
expire_logs_days days; possible purges happen at startup
and at binary log rotation
+ --explicit-defaults-for-timestamp
+ This option causes CREATE TABLE to create all TIMESTAMP
+ columns as NULL with DEFAULT NULL attribute, Without this
+ option, TIMESTAMP columns are NOT NULL and have implicit
+ DEFAULT clauses. The old behavior is deprecated.
--external-locking Use system (external) locking (disabled by default).
With this option enabled you can run myisamchk to test
(not repair) tables while the MySQL server is running.
@@ -204,9 +242,13 @@ The following options may be given as the first argument:
--gdb Set up signals usable for debugging. Deprecated, use
--general-log Log connections and queries to a table or log file.
Defaults logging to a file 'hostname'.log or a table
- mysql.general_logif --log-output=TABLE is used
+ mysql.general_logif --log-output=TABLE is used.
--general-log-file=name
Log connections and queries to given file
+ --getopt-prefix-matching
+ Recognize command-line options by their unambiguos
+ prefixes.
+ (Defaults to on; use --skip-getopt-prefix-matching to disable.)
--group-concat-max-len=#
The maximum length of the result of function
GROUP_CONCAT()
@@ -239,6 +281,7 @@ The following options may be given as the first argument:
height-balanced, DOUBLE_PREC_HB - double precision
height-balanced.
--host-cache-size=# How many host names should be cached to avoid resolving.
+ (Automatically configured unless set explicitly)
--ignore-builtin-innodb
Disable initialization of builtin InnoDB plugin
--ignore-db-dirs=name
@@ -249,7 +292,7 @@ The following options may be given as the first argument:
(unless the user has SUPER privilege)
--init-file=name Read SQL commands from this file at startup
--init-rpl-role=name
- Set the replication role.
+ Set the replication role. One of: MASTER, SLAVE
--init-slave=name Command(s) that are executed by a slave server each time
the SQL thread starts
--interactive-timeout=#
@@ -331,8 +374,8 @@ The following options may be given as the first argument:
not specified then 'datadir'/'log-basename'.err or the
'pid-file' path with extension .err is used
--log-isam[=name] Log all MyISAM changes to file.
- --log-output=name Syntax: log-output=value[,value...], where "value" could
- be TABLE, FILE or NONE
+ --log-output=name How logs should be written. Any combination of: NONE,
+ FILE, TABLE
--log-queries-not-using-indexes
Log queries that are executed without benefit of any
index to the slow log if it is open
@@ -340,15 +383,14 @@ The following options may be given as the first argument:
logs.
--log-slave-updates Tells the slave to log the updates from the slave thread
to the binary log. You will need to turn it on if you
- plan to daisy-chain the slaves
+ plan to daisy-chain the slaves.
--log-slow-admin-statements
Log slow OPTIMIZE, ANALYZE, ALTER and other
administrative statements to the slow log if it is open.
--log-slow-filter=name
- Log only certain types of queries. Multiple flags can be
- specified, separated by commas. Valid values are admin,
- slave, filesort, filesort_on_disk, full_join, full_scan,
- query_cache, query_cache_miss, tmp_table,
+ Log only certain types of queries. Any combination of:
+ admin, filesort, filesort_on_disk, full_join, full_scan,
+ query_cache, query_cache_miss, tmp_table,
tmp_table_on_disk
--log-slow-rate-limit=#
Write to slow log every #th slow query. Set to 1 to log
@@ -358,8 +400,8 @@ The following options may be given as the first argument:
Log slow statements executed by slave thread to the slow
log if it is open.
--log-slow-verbosity=name
- log-slow-verbosity=[value[,value ...]] where value is one
- of 'innodb', 'query_plan', 'explain'
+ Verbosity level for the slow log. Any combination of:
+ innodb, query_plan, explain
--log-tc=name Path to transaction coordinator log (used for
transactions that affect more than one storage engine,
when binary log is disabled).
@@ -422,18 +464,26 @@ The following options may be given as the first argument:
Maximum number of prepared statements in the server
--max-relay-log-size=#
relay log will be rotated automatically when the size
- exceeds this value. If 0 are startup, it's set to
+ exceeds this value. If 0 at startup, it's set to
max_binlog_size
--max-seeks-for-key=#
Limit assumed max number of seeks when looking up rows
based on a key
+ --max-session-mem-used=#
+ Amount of memory a single user session is allowed to
+ allocate. This limits the value of the session variable
+ MEM_USED
--max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
values (only the first max_sort_length bytes of each
value are used; the rest are ignored)
--max-sp-recursion-depth[=#]
Maximum stored procedure recursion depth
- --max-tmp-tables=# Maximum number of temporary tables a client can keep open
- at a time
+ --max-statement-time=#
+ A query that has taken more than max_statement_time
+ seconds will be aborted. The argument will be treated as
+ a decimal value with microsecond precision. A value of 0
+ (default) means no timeout
+ --max-tmp-tables=# Unused, will be removed.
--max-user-connections=#
The maximum number of active connections for a single
user (0 = no limit)
@@ -442,9 +492,9 @@ The following options may be given as the first argument:
in between
--memlock Lock mysqld in memory.
--metadata-locks-cache-size=#
- Size of unused metadata locks cache
+ Unused
--metadata-locks-hash-instances=#
- Number of metadata locks hash instances
+ Unused
--min-examined-row-limit=#
Don't write queries to slow log that examine fewer rows
than that
@@ -462,9 +512,9 @@ The following options may be given as the first argument:
Restricts the total memory used for memory mapping of
MySQL tables
--myisam-recover-options[=name]
- Syntax: myisam-recover-options[=option[,option...]],
- where option can be DEFAULT, BACKUP, BACKUP_ALL, FORCE,
- QUICK, or OFF
+ Specifies how corrupted tables should be automatically
+ repaired. Any combination of: DEFAULT, BACKUP, FORCE,
+ QUICK, BACKUP_ALL, OFF
--myisam-repair-threads=#
If larger than 1, when repairing a MyISAM table all
indexes will be created in parallel, with one thread per
@@ -479,6 +529,10 @@ The following options may be given as the first argument:
NULLS_UNEQUAL (default behavior for 4.1 and later),
NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
--myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
+ --mysql56-temporal-format
+ Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
+ DATETIME, TIMESTAMP columns.
+ (Defaults to on; use --skip-mysql56-temporal-format to disable.)
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
@@ -493,8 +547,9 @@ The following options may be given as the first argument:
See also --old-mode
--old-alter-table Use old, non-optimized alter table
--old-mode=name Used to emulate old behavior from earlier MariaDB or
- MySQL versions. Syntax: old_mode=mode[,mode[,mode...]].
- See the manual for the complete list of valid old modes
+ MySQL versions. Any combination of:
+ NO_DUP_KEY_WARNINGS_WITH_IGNORE, NO_PROGRESS_INFO,
+ ZERO_DATE_TIME_CAST
--old-passwords Use old password encryption method (needed for 4.0 and
older clients)
--old-style-user-limits
@@ -523,24 +578,25 @@ The following options may be given as the first argument:
automatically pick a reasonable value; if set to 63, the
optimizer will switch to the original find_best search.
NOTE: The value 63 and its associated behaviour is
- deprecated
+ deprecated.
--optimizer-selectivity-sampling-limit=#
Controls number of record samples to check condition
selectivity
--optimizer-switch=name
- optimizer_switch=option=val[,option=val...], where option
- is one of {derived_merge, derived_with_keys, firstmatch,
- in_to_exists, engine_condition_pushdown,
- index_condition_pushdown, index_merge,
- index_merge_intersection, index_merge_sort_intersection,
- index_merge_sort_union, index_merge_union,
- join_cache_bka, join_cache_hashed,
- join_cache_incremental, loosescan, materialization, mrr,
- mrr_cost_based, mrr_sort_keys, optimize_join_buffer_size,
- outer_join_with_cache, partial_match_rowid_merge,
- partial_match_table_scan, semijoin, semijoin_with_cache,
- subquery_cache, table_elimination, extended_keys,
- exists_to_in } and val is one of {on, off, default}
+ Fine-tune the optimizer behavior. Takes a comma-separated
+ list of option=value pairs, where value is on, off, or
+ default, and options are: index_merge, index_merge_union,
+ index_merge_sort_union, index_merge_intersection,
+ index_merge_sort_intersection, engine_condition_pushdown,
+ index_condition_pushdown, derived_merge,
+ derived_with_keys, firstmatch, loosescan, materialization,
+ in_to_exists, semijoin, partial_match_rowid_merge,
+ partial_match_table_scan, subquery_cache, mrr,
+ mrr_cost_based, mrr_sort_keys, outer_join_with_cache,
+ semijoin_with_cache, join_cache_incremental,
+ join_cache_hashed, join_cache_bka,
+ optimize_join_buffer_size, table_elimination,
+ extended_keys, exists_to_in, orderby_uses_equalities
--optimizer-use-condition-selectivity=#
Controls selectivity of which conditions the optimizer
takes into account to calculate cardinality of a partial
@@ -696,9 +752,9 @@ The following options may be given as the first argument:
in an incremental way. It can be specified many times,
adding more plugins every time.
--plugin-maturity=name
- The lowest desirable plugin maturity (unknown,
- experimental, alpha, beta, gamma, or stable). Plugins
- less mature than that will not be installed or loaded.
+ The lowest desirable plugin maturity. Plugins less mature
+ than that will not be installed or loaded. One of:
+ unknown, experimental, alpha, beta, gamma, stable
-P, --port=# Port number to use for connection or 0 to default to,
my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
(3306), whatever comes first
@@ -709,7 +765,9 @@ The following options may be given as the first argument:
The size of the buffer that is allocated when preloading
indexes
--profiling-history-size=#
- Limit of query profiling memory
+ Number of statements about which profiling information is
+ maintained. If set to 0, no profiles are stored. See SHOW
+ PROFILES.
--progress-report-time=#
Seconds between sending progress reports to the client
for time-consuming statements. Set to 0 to disable
@@ -747,21 +805,21 @@ The following options may be given as the first argument:
--read-rnd-buffer-size=#
When reading rows in sorted order after a sort, the rows
are read through this buffer to avoid a disk seeks
- --relay-log=name The location and name to use for relay logs
+ --relay-log=name The location and name to use for relay logs.
--relay-log-index=name
The location and name to use for the file that keeps a
list of the last relay logs
--relay-log-info-file=name
The location and name of the file that remembers where
- the SQL replication thread is in the relay logs
+ the SQL replication thread is in the relay logs.
--relay-log-purge if disabled - do not purge relay logs. if enabled - purge
- them as soon as they are no more needed
+ them as soon as they are no more needed.
(Defaults to on; use --skip-relay-log-purge to disable.)
--relay-log-recovery
Enables automatic relay log recovery right after the
database startup, which means that the IO Thread starts
re-fetching from the master right after the last
- transaction processed
+ transaction processed.
--relay-log-space-limit=#
Maximum space to use for all relay logs
--replicate-annotate-row-events
@@ -855,13 +913,12 @@ The following options may be given as the first argument:
--rowid-merge-buff-size=#
The size of the buffers used [NOT] IN evaluation via
partial matching
- --rpl-recovery-rank=#
- Unused, will be removed
--safe-mode Skip some optimize stages (for testing). Deprecated.
--safe-user-create Don't allow new user creation by the user who has no
write privileges to the mysql.user table.
--secure-auth Disallow authentication for accounts that have old
(pre-4.1) passwords
+ (Defaults to on; use --skip-secure-auth to disable.)
--secure-file-priv=name
Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
files within specified directory
@@ -870,7 +927,8 @@ The following options may be given as the first argument:
--show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this
master.
- --skip-bdb Deprecated option; Exist only for compatiblity with old
+ --silent-startup Don't print [Note] to the error log during startup.
+ --skip-bdb Deprecated option; Exist only for compatibility with old
my.cnf files
--skip-grant-tables Start without grant tables. This gives all users FULL
ACCESS to all tables.
@@ -905,7 +963,7 @@ The following options may be given as the first argument:
idempotent. For example, in row based replication
attempts to delete rows that doesn't exist will be
ignored. In STRICT mode, replication will stop on any
- unexpected difference between the master and the slave
+ unexpected difference between the master and the slave.
--slave-load-tmpdir=name
The location where the slave should put its temporary
files when replicating a LOAD DATA INFILE command
@@ -920,6 +978,16 @@ The following options may be given as the first argument:
parallel replication thread when reading ahead in the
relay log looking for opportunities for parallel
replication. Only used when --slave-parallel-threads > 0.
+ --slave-parallel-mode=name
+ Controls what transactions are applied in parallel when
+ using --slave-parallel-threads. Possible values:
+ "optimistic" tries to apply most transactional DML in
+ parallel, and handles any conflicts with rollback and
+ retry. "conservative" limits parallelism in an effort to
+ avoid any conflicts. "aggressive" tries to maximise the
+ parallelism, possibly at the cost of increased conflict
+ rate. "minimal" only parallelizes the commit steps of
+ transactions. "none" disables parallel apply completely.
--slave-parallel-threads=#
If non-zero, number of threads to spawn to apply in
parallel events on the slave that were group-committed on
@@ -927,6 +995,15 @@ The following options may be given as the first argument:
replication domains. Note that these threads are in
addition to the IO and SQL threads, which are always
created by a replication slave
+ --slave-run-triggers-for-rbr=name
+ Modes for how triggers in row-base replication on slave
+ side will be executed. Legal values are NO (default), YES
+ and LOGGING. NO means that trigger for RBR will not be
+ running on slave. YES and LOGGING means that triggers
+ will be running on slave, if there was not triggers
+ running on the master for the statement. LOGGING also
+ means results of that the executed triggers work will be
+ written to the binlog.
--slave-skip-errors=name
Tells the slave thread to continue replication when a
query event returns an error from the provided list
@@ -941,11 +1018,10 @@ The following options may be given as the first argument:
transaction in case it failed with a deadlock or elapsed
lock wait timeout, before giving up and stopping
--slave-type-conversions=name
- Set of slave type conversions that are enabled. Legal
- values are: ALL_LOSSY to enable lossy conversions and
- ALL_NON_LOSSY to enable non-lossy conversions. If the
- variable is assigned the empty set, no conversions are
- allowed and it is expected that the types match exactly.
+ Set of slave type conversions that are enabled. If the
+ variable is empty, no conversions are allowed and it is
+ expected that the types match exactly. Any combination
+ of: ALL_LOSSY, ALL_NON_LOSSY
--slow-launch-time=#
If creating the thread takes longer than this value (in
seconds), the Slow_launch_threads counter will be
@@ -953,7 +1029,7 @@ The following options may be given as the first argument:
--slow-query-log Log slow queries to a table or log file. Defaults logging
to a file 'hostname'-slow.log or a table mysql.slow_log
if --log-output=TABLE is used. Must be enabled to
- activate other slow log options
+ activate other slow log options.
--slow-query-log-file=name
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
@@ -962,13 +1038,28 @@ The following options may be given as the first argument:
--sort-buffer-size=#
Each thread that needs to do a sort allocates a buffer of
this size
- --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual
- for the complete list of valid sql modes
+ --sql-mode=name Sets the sql mode. Any combination of: REAL_AS_FLOAT,
+ PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE,
+ IGNORE_BAD_TABLE_OPTIONS, ONLY_FULL_GROUP_BY,
+ NO_UNSIGNED_SUBTRACTION, NO_DIR_IN_CREATE, POSTGRESQL,
+ ORACLE, MSSQL, DB2, MAXDB, NO_KEY_OPTIONS,
+ NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, MYSQL323, MYSQL40,
+ ANSI, NO_AUTO_VALUE_ON_ZERO, NO_BACKSLASH_ESCAPES,
+ STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE,
+ NO_ZERO_DATE, ALLOW_INVALID_DATES,
+ ERROR_FOR_DIVISION_BY_ZERO, TRADITIONAL,
+ NO_AUTO_CREATE_USER, HIGH_NOT_PRECEDENCE,
+ NO_ENGINE_SUBSTITUTION, PAD_CHAR_TO_FULL_LENGTH
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
--stored-program-cache=#
The soft upper limit for number of cached stored routines
for one connection.
+ --strict-password-validation
+ When password validation plugins are enabled, reject
+ passwords that cannot be validated (passwords specified
+ as a hash)
+ (Defaults to on; use --skip-strict-password-validation to disable.)
-s, --symbolic-links
Enable symbolic link support.
--sync-binlog=# Synchronously flush binary log to disk after every #th
@@ -977,13 +1068,12 @@ The following options may be given as the first argument:
(Defaults to on; use --skip-sync-frm to disable.)
--sync-master-info=#
Synchronously flush master info to disk after every #th
- event. Use 0 (default) to disable synchronous flushing
+ event. Use 0 to disable synchronous flushing
--sync-relay-log=# Synchronously flush relay log to disk after every #th
- event. Use 0 (default) to disable synchronous flushing
+ event. Use 0 to disable synchronous flushing
--sync-relay-log-info=#
Synchronously flush relay log info to disk after every
- #th transaction. Use 0 (default) to disable synchronous
- flushing
+ #th transaction. Use 0 to disable synchronous flushing
--sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it
safe-replicable. Since 5.0, SYSDATE() returns a `dynamic'
value different for different invocations, even within
@@ -994,8 +1084,8 @@ The following options may be given as the first argument:
--table-open-cache=#
The number of cached open tables
--tc-heuristic-recover=name
- Decision to use in heuristic recover process. Possible
- values are COMMIT or ROLLBACK.
+ Decision to use in heuristic recover process. One of: OFF,
+ COMMIT, ROLLBACK
--thread-cache-size=#
How many threads we should keep in a cache for reuse
--thread-pool-idle-timeout=#
@@ -1022,8 +1112,8 @@ The following options may be given as the first argument:
--timed-mutexes Specify whether to time mutexes. Deprecated, has no
effect.
--tmp-table-size=# If an internal in-memory temporary table exceeds this
- size, MySQL will automatically convert it to an on-disk
- MyISAM or Aria table
+ size, MariaDB will automatically convert it to an on-disk
+ MyISAM or Aria table.
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
separated by a colon (:), in this case they are used in a
round-robin fashion
@@ -1031,7 +1121,9 @@ The following options may be given as the first argument:
Allocation block size for transactions to be stored in
binary log
--transaction-isolation=name
- Default transaction isolation level.
+ Default transaction isolation level. One of:
+ READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ,
+ SERIALIZABLE
--transaction-prealloc-size=#
Persistent buffer for transactions to be stored in binary
log
@@ -1046,8 +1138,8 @@ The following options may be given as the first argument:
of the underlying table and the query uses a LIMIT clause
(usually get from GUI tools)
--use-stat-tables=name
- Specifies how to use system statistics tables. Possible
- values are NEVER, COMPLEMENTARY, PREFERABLY
+ Specifies how to use system statistics tables. One of:
+ NEVER, COMPLEMENTARY, PREFERABLY
-u, --user=name Run mysqld daemon as user.
--userstat Enables statistics gathering for USER_STATISTICS,
CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS
@@ -1063,7 +1155,7 @@ auto-increment-increment 1
auto-increment-offset 1
autocommit TRUE
automatic-sp-privileges TRUE
-back-log 150
+back-log 80
big-tables FALSE
bind-address (No default value)
binlog-annotate-row-events FALSE
@@ -1075,8 +1167,10 @@ binlog-direct-non-transactional-updates FALSE
binlog-format STATEMENT
binlog-optimize-thread-scheduling TRUE
binlog-row-event-max-size 1024
+binlog-row-image FULL
binlog-stmt-cache-size 32768
bulk-insert-buffer-size 8388608
+changed-page-bitmaps ON
character-set-client-handshake TRUE
character-set-filesystem binary
character-sets-dir MYSQL_CHARSETSDIR/
@@ -1093,15 +1187,21 @@ deadlock-timeout-short 10000
default-regex-flags
default-storage-engine myisam
default-time-zone (No default value)
+default-tmp-storage-engine (No default value)
default-week-format 0
delay-key-write ON
delayed-insert-limit 100
delayed-insert-timeout 300
delayed-queue-size 1000
div-precision-increment 4
+encrypt-binlog FALSE
+encrypt-tmp-disk-tables FALSE
+encrypt-tmp-files FALSE
+enforce-storage-engine (No default value)
event-scheduler OFF
expensive-subquery-limit 100
expire-logs-days 0
+explicit-defaults-for-timestamp FALSE
external-locking FALSE
extra-max-connections 1
extra-port 0
@@ -1114,6 +1214,7 @@ ft-query-expansion-limit 20
ft-stopword-file (No default value)
gdb FALSE
general-log FALSE
+getopt-prefix-matching FALSE
group-concat-max-len 1024
gtid-domain-id 0
gtid-ignore-duplicates FALSE
@@ -1121,7 +1222,7 @@ gtid-strict-mode FALSE
help TRUE
histogram-size 0
histogram-type SINGLE_PREC_HB
-host-cache-size 128
+host-cache-size 279
ignore-builtin-innodb FALSE
ignore-db-dirs
init-connect
@@ -1129,7 +1230,7 @@ init-file (No default value)
init-rpl-role MASTER
init-slave
interactive-timeout 28800
-join-buffer-size 131072
+join-buffer-size 262144
join-buffer-space-limit 2097152
join-cache-level 2
keep-files-on-create FALSE
@@ -1160,7 +1261,6 @@ log-slow-rate-limit 1
log-slow-slave-statements FALSE
log-slow-verbosity
log-tc tc.log
-log-tc-size 24576
log-warnings 1
long-query-time 10
low-priority-updates FALSE
@@ -1168,7 +1268,7 @@ lower-case-table-names 1
master-info-file master.info
master-retry-count 86400
master-verify-checksum FALSE
-max-allowed-packet 1048576
+max-allowed-packet 4194304
max-binlog-cache-size 18446744073709547520
max-binlog-size 1073741824
max-binlog-stmt-cache-size 18446744073709547520
@@ -1180,12 +1280,14 @@ max-error-count 64
max-heap-table-size 16777216
max-join-size 18446744073709551615
max-length-for-sort-data 1024
-max-long-data-size 1048576
+max-long-data-size 4194304
max-prepared-stmt-count 16382
max-relay-log-size 1073741824
max-seeks-for-key 18446744073709551615
+max-session-mem-used 9223372036854775807
max-sort-length 1024
max-sp-recursion-depth 0
+max-statement-time 0
max-tmp-tables 32
max-user-connections 0
max-write-lock-count 18446744073709551615
@@ -1202,8 +1304,9 @@ myisam-mmap-size 18446744073709551615
myisam-recover-options DEFAULT
myisam-repair-threads 1
myisam-sort-buffer-size 134216704
-myisam-stats-method nulls_unequal
+myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
+mysql56-temporal-format TRUE
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
@@ -1254,7 +1357,7 @@ performance-schema-max-rwlock-instances -1
performance-schema-max-socket-classes 10
performance-schema-max-socket-instances -1
performance-schema-max-stage-classes 150
-performance-schema-max-statement-classes 180
+performance-schema-max-statement-classes 178
performance-schema-max-table-handles -1
performance-schema-max-table-instances -1
performance-schema-max-thread-classes 50
@@ -1270,14 +1373,14 @@ preload-buffer-size 32768
profiling-history-size 15
progress-report-time 5
protocol-version 10
-query-alloc-block-size 8192
+query-alloc-block-size 16384
query-cache-limit 1048576
query-cache-min-res-unit 4096
-query-cache-size 0
+query-cache-size 1048576
query-cache-strip-comments FALSE
-query-cache-type ON
+query-cache-type OFF
query-cache-wlock-invalidate FALSE
-query-prealloc-size 8192
+query-prealloc-size 24576
range-alloc-block-size 4096
read-buffer-size 131072
read-only FALSE
@@ -1289,19 +1392,19 @@ relay-log-purge TRUE
relay-log-recovery FALSE
relay-log-space-limit 0
replicate-annotate-row-events FALSE
-replicate-events-marked-for-skip replicate
+replicate-events-marked-for-skip REPLICATE
replicate-same-server-id FALSE
report-host (No default value)
report-password (No default value)
report-port 0
report-user (No default value)
rowid-merge-buff-size 8388608
-rpl-recovery-rank 0
safe-user-create FALSE
-secure-auth FALSE
+secure-auth TRUE
secure-file-priv (No default value)
server-id 0
show-slave-auth-info FALSE
+silent-startup FALSE
skip-grant-tables TRUE
skip-name-resolve FALSE
skip-networking FALSE
@@ -1314,7 +1417,9 @@ slave-exec-mode STRICT
slave-max-allowed-packet 1073741824
slave-net-timeout 3600
slave-parallel-max-queued 131072
+slave-parallel-mode conservative
slave-parallel-threads 0
+slave-run-triggers-for-rbr NO
slave-skip-errors (No default value)
slave-sql-verify-checksum TRUE
slave-transaction-retries 10
@@ -1322,26 +1427,27 @@ slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
sort-buffer-size 2097152
-sql-mode
+sql-mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
stack-trace TRUE
stored-program-cache 256
+strict-password-validation TRUE
symbolic-links FALSE
sync-binlog 0
sync-frm FALSE
-sync-master-info 0
-sync-relay-log 0
-sync-relay-log-info 0
+sync-master-info 10000
+sync-relay-log 10000
+sync-relay-log-info 10000
sysdate-is-now FALSE
-table-cache 400
+table-cache 431
table-definition-cache 400
-table-open-cache 400
+table-open-cache 431
tc-heuristic-recover OFF
thread-cache-size 0
thread-pool-idle-timeout 60
-thread-pool-max-threads 500
+thread-pool-max-threads 1000
thread-pool-oversubscribe 3
thread-pool-stall-limit 500
-thread-stack 294912
+thread-stack 295936
time-format %H:%i:%s
timed-mutexes FALSE
tmp-table-size 16777216
diff --git a/mysql-test/r/mysqld_help_crash-9183.result b/mysql-test/r/mysqld_help_crash-9183.result
new file mode 100644
index 00000000000..c0e5323d6d7
--- /dev/null
+++ b/mysql-test/r/mysqld_help_crash-9183.result
@@ -0,0 +1,3 @@
+rename table mysql.plugin to test.plugin;
+flush tables;
+rename table test.plugin to mysql.plugin;
diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result
index 8d5ab551bee..5eff7a41abd 100644
--- a/mysql-test/r/mysqldump-max.result
+++ b/mysql-test/r/mysqldump-max.result
@@ -332,12 +332,12 @@ a b
2 1
DROP TABLE t1;
DROP TABLE t2;
-SHOW BINLOG EVENTS LIMIT 7,3;
+include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 593 Xid 1 620 COMMIT /* XID */
-master-bin.000001 620 Gtid 1 658 GTID 0-1-3
-master-bin.000001 658 Query 1 777 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
--- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=939;
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,0), (2,0)
+master-bin.000001 # Xid # # COMMIT /* XID */
+-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=<pos>;
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/r/mysqldump-nl.result b/mysql-test/r/mysqldump-nl.result
index bca199dc46a..d397453b071 100644
--- a/mysql-test/r/mysqldump-nl.result
+++ b/mysql-test/r/mysqldump-nl.result
@@ -71,7 +71,7 @@ SET character_set_client = @saved_cs_client;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
select * from `v1
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 2d26bc774cb..a5fe01d63c3 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -418,7 +418,7 @@ UNLOCK TABLES;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-set global sql_mode='';
+set global sql_mode=default;
drop table t1;
#
# Bug#2705 mysqldump --tab extra output
@@ -1970,9 +1970,9 @@ DROP TABLE IF EXISTS "t1";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "t1" (
- "a b" int(11) NOT NULL DEFAULT '0',
- "c""d" int(11) NOT NULL DEFAULT '0',
- "e`f" int(11) NOT NULL DEFAULT '0',
+ "a b" int(11) NOT NULL,
+ "c""d" int(11) NOT NULL,
+ "e`f" int(11) NOT NULL,
PRIMARY KEY ("a b","c""d","e`f")
);
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -2004,9 +2004,9 @@ DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
- `a b` int(11) NOT NULL DEFAULT '0',
- `c"d` int(11) NOT NULL DEFAULT '0',
- `e``f` int(11) NOT NULL DEFAULT '0',
+ `a b` int(11) NOT NULL,
+ `c"d` int(11) NOT NULL,
+ `e``f` int(11) NOT NULL,
PRIMARY KEY (`a b`,`c"d`,`e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -2468,10 +2468,10 @@ if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
-end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end BEFORE 0000-00-00 00:00:00 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg2 UPDATE t1 begin
if old.a % 2 = 0 then set new.b := 12; end if;
-end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end BEFORE 0000-00-00 00:00:00 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg3 UPDATE t1 begin
if new.a = -1 then
set @fired:= "Yes";
@@ -2515,7 +2515,7 @@ UNLOCK TABLES;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg1 before insert on t1 for each row
begin
@@ -2536,7 +2536,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg2 before update on t1 for each row begin
if old.a % 2 = 0 then set new.b := 12; end if;
@@ -2671,10 +2671,10 @@ if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
-end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end BEFORE # NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg2 UPDATE t1 begin
if old.a % 2 = 0 then set new.b := 12; end if;
-end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end BEFORE # NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg3 UPDATE t1 begin
if new.a = -1 then
set @fired:= "Yes";
@@ -2717,7 +2717,7 @@ a2
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
testref INSERT test1 BEGIN
-INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM `test1`;
a1
1
@@ -2789,7 +2789,7 @@ UNLOCK TABLES;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
RETURN a+b ;;
@@ -2806,7 +2806,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1
begin
@@ -2843,7 +2843,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
BEGIN SELECT a+b INTO c; end ;;
@@ -2860,7 +2860,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc2`(OUT a INT)
BEGIN
@@ -2891,7 +2891,7 @@ drop table t1;
# Bug#13052 mysqldump timestamp reloads broken
#
drop table if exists t1;
-create table t1 (`d` timestamp, unique (`d`));
+create table t1 (`d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, unique (`d`));
set time_zone='+00:00';
insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00');
select * from t1;
@@ -3715,7 +3715,7 @@ CREATE TEMPORARY TABLE `TABLES` (
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
- `CREATE_OPTIONS` varchar(255) DEFAULT NULL,
+ `CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -3849,7 +3849,7 @@ create procedure mysqldump_test_db.sp1() select 'hello';
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`user1`@`%` PROCEDURE `sp1`()
select 'hello' ;;
@@ -5260,7 +5260,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
SET @@global.log_output= @old_log_output_state;
SET @@global.slow_query_log= @old_slow_query_log_state;
@@ -5310,6 +5311,7 @@ a
DROP TABLE t1;
DROP TABLE t2;
DROP DATABASE db_20772273;
+USE test;
#
# Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERY
#
@@ -5403,4 +5405,177 @@ DELIMITER ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `a\"'``b` CHARACTER SET utf8 COLLATE utf8_general_ci ;
DROP DATABASE `a\"'``b`;
+use test;
+#
+# Test mysqldump with --disable-query-logs
+#
+create table t1 (a int);
+insert into t1 values (1);
+drop table t1;
+select * from t1;
+a
+1
+drop table t1;
+#
+# MDEV-9124 mysqldump does not dump data if table name is same as view earlier on
+#
+CREATE DATABASE db1 CHARSET=utf8;
+CREATE DATABASE db2 CHARSET=utf8;
+USE db2;
+CREATE TABLE nonunique_table_name (i1 serial) ENGINE=MEMORY;
+INSERT INTO nonunique_table_name VALUES (1),(2);
+CREATE TABLE nonunique_table_view_name (i2 int) ENGINE=InnoDB;
+INSERT INTO nonunique_table_view_name VALUES (3),(4);
+use db1;
+CREATE TABLE basetable (id smallint) ENGINE=MyISAM;
+CREATE TABLE nonunique_table_name (i3 smallint) ENGINE=MERGE UNION (basetable) INSERT_METHOD=LAST;
+INSERT INTO nonunique_table_name VALUES (5),(6);
+CREATE VIEW nonunique_table_view_name AS SELECT 1;
+
+##################################################
+# --compact --databases db1 db2
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `db1`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `basetable` (
+ `id` smallint(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `basetable` VALUES (5),(6);
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_name` (
+ `i3` smallint(6) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 INSERT_METHOD=LAST UNION=(`basetable`);
+/*!40101 SET character_set_client = @saved_cs_client */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `nonunique_table_view_name` (
+ `1` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db2` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `db2`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_name` (
+ `i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ UNIQUE KEY `i1` (`i1`)
+) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `nonunique_table_name` VALUES (1),(2);
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_view_name` (
+ `i2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `nonunique_table_view_name` VALUES (3),(4);
+
+USE `db1`;
+/*!50001 DROP TABLE IF EXISTS `nonunique_table_view_name`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `nonunique_table_view_name` AS select 1 AS `1` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
+USE `db2`;
+
+##################################################
+# --compact db2
+
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_name` (
+ `i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ UNIQUE KEY `i1` (`i1`)
+) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `nonunique_table_name` VALUES (1),(2);
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_view_name` (
+ `i2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `nonunique_table_view_name` VALUES (3),(4);
+
+##################################################
+# --compact --delayed-insert --no-data-med=0 --databases db2 db1
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db2` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `db2`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_name` (
+ `i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ UNIQUE KEY `i1` (`i1`)
+) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT DELAYED INTO `nonunique_table_name` VALUES (1),(2);
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_view_name` (
+ `i2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `nonunique_table_view_name` VALUES (3),(4);
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `db1`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `basetable` (
+ `id` smallint(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT DELAYED INTO `basetable` VALUES (5),(6);
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `nonunique_table_name` (
+ `i3` smallint(6) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 INSERT_METHOD=LAST UNION=(`basetable`);
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `nonunique_table_name` VALUES (5),(6);
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+/*!50001 CREATE TABLE `nonunique_table_view_name` (
+ `1` tinyint NOT NULL
+) ENGINE=MyISAM */;
+SET character_set_client = @saved_cs_client;
+
+USE `db2`;
+
+USE `db1`;
+/*!50001 DROP TABLE IF EXISTS `nonunique_table_view_name`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = utf8 */;
+/*!50001 SET character_set_results = utf8 */;
+/*!50001 SET collation_connection = utf8_general_ci */;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `nonunique_table_view_name` AS select 1 AS `1` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+
+DROP DATABASE db1;
+DROP DATABASE db2;
FOUND /Database: mysql/ in bug11505.sql
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index b3d8fb93e1f..f904207d2da 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -672,7 +672,9 @@ drop table t1;
y
txt
b is b and more is more
-txt
+txt2
+b is b or more is more
+txt3
a is a and less is more
sflfdt 'ABCDfF bbddff h' bs txt;
txt
diff --git a/mysql-test/r/ndb_default_cluster.require b/mysql-test/r/ndb_default_cluster.require
deleted file mode 100644
index 3616ae0f343..00000000000
--- a/mysql-test/r/ndb_default_cluster.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-Ndb_config_from_host localhost
diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result
index 2295276099a..1cd54b131c3 100644
--- a/mysql-test/r/not_embedded_server.result
+++ b/mysql-test/r/not_embedded_server.result
@@ -1,4 +1,4 @@
-call mtr.add_suppression("Can't open and lock privilege tables: Table 'host' was not locked with LOCK TABLES");
+call mtr.add_suppression("Can't open and lock privilege tables: Table 'user' was not locked with LOCK TABLES");
SHOW VARIABLES like 'slave_skip_errors';
Variable_name Value
slave_skip_errors OFF
@@ -16,7 +16,7 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT);
LOCK TABLES t1 READ;
FLUSH PRIVILEGES;
-ERROR HY000: Table 'host' was not locked with LOCK TABLES
+ERROR HY000: Table 'user' was not locked with LOCK TABLES
UNLOCK TABLES;
DROP TABLE t1;
#
diff --git a/mysql-test/r/not_ndb.require b/mysql-test/r/not_ndb.require
deleted file mode 100644
index 36fcf7958d4..00000000000
--- a/mysql-test/r/not_ndb.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-have_ndbcluster NO
diff --git a/mysql-test/r/not_ndb_default.require b/mysql-test/r/not_ndb_default.require
deleted file mode 100644
index 09aae1ed1d0..00000000000
--- a/mysql-test/r/not_ndb_default.require
+++ /dev/null
@@ -1,2 +0,0 @@
-TRUE
-1
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index b5219333ef1..d25e78c1ce4 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -230,7 +230,7 @@ t1 CREATE TABLE `t1` (
`c00` binary(0) DEFAULT NULL,
`c01` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
`c02` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
- `c03` varchar(6) CHARACTER SET latin2 NOT NULL DEFAULT '',
+ `c03` varchar(6) CHARACTER SET latin2 NOT NULL,
`c04` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
`c05` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
`c06` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
@@ -241,7 +241,7 @@ t1 CREATE TABLE `t1` (
`c11` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
`c12` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
`c13` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
- `c14` char(0) CHARACTER SET latin2 DEFAULT NULL,
+ `c14` binary(0) DEFAULT NULL,
`c15` char(0) CHARACTER SET latin2 DEFAULT NULL,
`c16` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
`c17` varchar(6) CHARACTER SET latin2 DEFAULT NULL,
@@ -394,3 +394,1217 @@ NOT NOT NULLIF(2,3)
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-7146 NULLIF returns unexpected result with a YEAR field
+#
+CREATE TABLE t1 (a YEAR(2));
+Warnings:
+Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+INSERT INTO t1 VALUES (0);
+SELECT a,NULLIF(a,2000),NULLIF(2000,a) FROM t1;
+a NULLIF(a,2000) NULLIF(2000,a)
+00 NULL NULL
+SELECT a,NULLIF(a,2001),NULLIF(2001,a) FROM t1;
+a NULLIF(a,2001) NULLIF(2001,a)
+00 0 2001
+DROP TABLE t1;
+#
+# MDEV-7005 NULLIF does not work as documented
+#
+CREATE TABLE t1 (a TIME);
+CREATE TABLE t2 AS SELECT a,NULLIF(a,a), CASE WHEN a=a THEN NULL ELSE a END FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` time DEFAULT NULL,
+ `NULLIF(a,a)` time DEFAULT NULL,
+ `CASE WHEN a=a THEN NULL ELSE a END` time DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
+SELECT NULLIF(_latin1'a' COLLATE latin1_general_ci, _latin1'a' COLLATE latin1_bin);
+ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'nullif'
+CREATE TABLE t1 AS SELECT
+NULLIF(1,1),
+NULLIF(1,1.0),
+NULLIF(1,1e0),
+NULLIF(1,'2001-01-01'),
+NULLIF(1,TIME'00:00:00');
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '2001-01-01'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `NULLIF(1,1)` int(1) DEFAULT NULL,
+ `NULLIF(1,1.0)` int(1) DEFAULT NULL,
+ `NULLIF(1,1e0)` int(1) DEFAULT NULL,
+ `NULLIF(1,'2001-01-01')` int(1) DEFAULT NULL,
+ `NULLIF(1,TIME'00:00:00')` int(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+NULLIF(1.0,1),
+NULLIF(1.0,1.0),
+NULLIF(1.0,1e0),
+NULLIF(1.0,'2001-01-01'),
+NULLIF(1.0,TIME'00:00:00');
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '2001-01-01'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `NULLIF(1.0,1)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0,1.0)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0,1e0)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0,'2001-01-01')` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0,TIME'00:00:00')` decimal(2,1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+NULLIF(1e0,1),
+NULLIF(1e0,1.0),
+NULLIF(1e0,1e0),
+NULLIF(1e0,'2001-01-01'),
+NULLIF(1e0,TIME'00:00:00');
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '2001-01-01'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `NULLIF(1e0,1)` double DEFAULT NULL,
+ `NULLIF(1e0,1.0)` double DEFAULT NULL,
+ `NULLIF(1e0,1e0)` double DEFAULT NULL,
+ `NULLIF(1e0,'2001-01-01')` double DEFAULT NULL,
+ `NULLIF(1e0,TIME'00:00:00')` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+NULLIF('1',1),
+NULLIF('1',1.0),
+NULLIF('1',1e0),
+NULLIF('1','2001-01-01'),
+NULLIF('1',TIME'00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `NULLIF('1',1)` varchar(1) DEFAULT NULL,
+ `NULLIF('1',1.0)` varchar(1) DEFAULT NULL,
+ `NULLIF('1',1e0)` varchar(1) DEFAULT NULL,
+ `NULLIF('1','2001-01-01')` varchar(1) DEFAULT NULL,
+ `NULLIF('1',TIME'00:00:00')` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+NULLIF(TIMESTAMP'2001-01-01 00:00:00',1),
+NULLIF(TIMESTAMP'2001-01-01 00:00:00',1.0),
+NULLIF(TIMESTAMP'2001-01-01 00:00:00',1e0),
+NULLIF(TIMESTAMP'2001-01-01 00:00:00','2001-01-01'),
+NULLIF(TIMESTAMP'2001-01-01 00:00:00',TIME'00:00:00');
+Warnings:
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1.0'
+Warning 1292 Incorrect datetime value: '1'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `NULLIF(TIMESTAMP'2001-01-01 00:00:00',1)` datetime DEFAULT NULL,
+ `NULLIF(TIMESTAMP'2001-01-01 00:00:00',1.0)` datetime DEFAULT NULL,
+ `NULLIF(TIMESTAMP'2001-01-01 00:00:00',1e0)` datetime DEFAULT NULL,
+ `NULLIF(TIMESTAMP'2001-01-01 00:00:00','2001-01-01')` datetime DEFAULT NULL,
+ `NULLIF(TIMESTAMP'2001-01-01 00:00:00',TIME'00:00:00')` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+NULLIF(DATE'2001-01-01',1),
+NULLIF(DATE'2001-01-01',1.0),
+NULLIF(DATE'2001-01-01',1e0),
+NULLIF(DATE'2001-01-01','2001-01-01'),
+NULLIF(DATE'2001-01-01',TIME'00:00:00');
+Warnings:
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1.0'
+Warning 1292 Incorrect datetime value: '1'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `NULLIF(DATE'2001-01-01',1)` date DEFAULT NULL,
+ `NULLIF(DATE'2001-01-01',1.0)` date DEFAULT NULL,
+ `NULLIF(DATE'2001-01-01',1e0)` date DEFAULT NULL,
+ `NULLIF(DATE'2001-01-01','2001-01-01')` date DEFAULT NULL,
+ `NULLIF(DATE'2001-01-01',TIME'00:00:00')` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+NULLIF(TIME'00:00:01',1),
+NULLIF(TIME'00:00:01',1.0),
+NULLIF(TIME'00:00:01',1e0),
+NULLIF(TIME'00:00:01','00:00:00'),
+NULLIF(TIME'00:00:01',DATE'2001-01-01');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `NULLIF(TIME'00:00:01',1)` time DEFAULT NULL,
+ `NULLIF(TIME'00:00:01',1.0)` time DEFAULT NULL,
+ `NULLIF(TIME'00:00:01',1e0)` time DEFAULT NULL,
+ `NULLIF(TIME'00:00:01','00:00:00')` time DEFAULT NULL,
+ `NULLIF(TIME'00:00:01',DATE'2001-01-01')` time DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1
+(
+c_tinyint TINYINT,
+c_smallint SMALLINT,
+c_int INT,
+c_bigint BIGINT,
+c_float FLOAT,
+c_double DOUBLE,
+c_decimal103 DECIMAL(10,3),
+c_varchar10 VARCHAR(10),
+c_text TEXT,
+c_blob BLOB,
+c_enum ENUM('one','two','tree'),
+c_datetime3 DATETIME(3),
+c_timestamp3 TIMESTAMP(3),
+c_date DATE,
+c_time TIME
+);
+#
+# Checking that the return type depends only on args[0], even when compared to a super type
+#
+CREATE TABLE t2 AS SELECT
+NULLIF(c_tinyint, 1),
+NULLIF(c_tinyint, c_smallint),
+NULLIF(c_tinyint, c_tinyint),
+NULLIF(c_tinyint, c_int),
+NULLIF(c_tinyint, c_bigint),
+NULLIF(c_tinyint, c_float),
+NULLIF(c_tinyint, c_double),
+NULLIF(c_tinyint, c_decimal103),
+NULLIF(c_tinyint, c_varchar10),
+NULLIF(c_tinyint, c_text),
+NULLIF(c_tinyint, c_blob),
+NULLIF(c_tinyint, c_enum),
+NULLIF(c_tinyint, c_datetime3),
+NULLIF(c_tinyint, c_timestamp3),
+NULLIF(c_tinyint, c_date),
+NULLIF(c_tinyint, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_tinyint, 1)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_smallint)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_tinyint)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_int)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_bigint)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_float)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_double)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_decimal103)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_varchar10)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_text)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_blob)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_enum)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_datetime3)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_timestamp3)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_date)` int(4) DEFAULT NULL,
+ `NULLIF(c_tinyint, c_time)` int(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_smallint, 1),
+NULLIF(c_smallint, c_smallint),
+NULLIF(c_smallint, c_tinyint),
+NULLIF(c_smallint, c_int),
+NULLIF(c_smallint, c_bigint),
+NULLIF(c_smallint, c_float),
+NULLIF(c_smallint, c_double),
+NULLIF(c_smallint, c_decimal103),
+NULLIF(c_smallint, c_varchar10),
+NULLIF(c_smallint, c_text),
+NULLIF(c_smallint, c_blob),
+NULLIF(c_smallint, c_enum),
+NULLIF(c_smallint, c_datetime3),
+NULLIF(c_smallint, c_timestamp3),
+NULLIF(c_smallint, c_date),
+NULLIF(c_smallint, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_smallint, 1)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_smallint)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_tinyint)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_int)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_bigint)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_float)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_double)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_decimal103)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_varchar10)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_text)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_blob)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_enum)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_datetime3)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_timestamp3)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_date)` int(6) DEFAULT NULL,
+ `NULLIF(c_smallint, c_time)` int(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_int, 1),
+NULLIF(c_int, c_smallint),
+NULLIF(c_int, c_tinyint),
+NULLIF(c_int, c_int),
+NULLIF(c_int, c_bigint),
+NULLIF(c_int, c_float),
+NULLIF(c_int, c_double),
+NULLIF(c_int, c_decimal103),
+NULLIF(c_int, c_varchar10),
+NULLIF(c_int, c_text),
+NULLIF(c_int, c_blob),
+NULLIF(c_int, c_enum),
+NULLIF(c_int, c_datetime3),
+NULLIF(c_int, c_timestamp3),
+NULLIF(c_int, c_date),
+NULLIF(c_int, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_int, 1)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_smallint)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_tinyint)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_int)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_bigint)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_float)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_double)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_decimal103)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_varchar10)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_text)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_blob)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_enum)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_datetime3)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_timestamp3)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_date)` int(11) DEFAULT NULL,
+ `NULLIF(c_int, c_time)` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_bigint, 1),
+NULLIF(c_bigint, c_smallint),
+NULLIF(c_bigint, c_tinyint),
+NULLIF(c_bigint, c_int),
+NULLIF(c_bigint, c_bigint),
+NULLIF(c_bigint, c_float),
+NULLIF(c_bigint, c_double),
+NULLIF(c_bigint, c_decimal103),
+NULLIF(c_bigint, c_varchar10),
+NULLIF(c_bigint, c_text),
+NULLIF(c_bigint, c_blob),
+NULLIF(c_bigint, c_enum),
+NULLIF(c_bigint, c_datetime3),
+NULLIF(c_bigint, c_timestamp3),
+NULLIF(c_bigint, c_date),
+NULLIF(c_bigint, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_bigint, 1)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_smallint)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_tinyint)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_int)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_bigint)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_float)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_double)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_decimal103)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_varchar10)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_text)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_blob)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_enum)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_datetime3)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_timestamp3)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_date)` bigint(20) DEFAULT NULL,
+ `NULLIF(c_bigint, c_time)` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_float, 1),
+NULLIF(c_float, c_smallint),
+NULLIF(c_float, c_tinyint),
+NULLIF(c_float, c_int),
+NULLIF(c_float, c_bigint),
+NULLIF(c_float, c_float),
+NULLIF(c_float, c_double),
+NULLIF(c_float, c_decimal103),
+NULLIF(c_float, c_varchar10),
+NULLIF(c_float, c_text),
+NULLIF(c_float, c_blob),
+NULLIF(c_float, c_enum),
+NULLIF(c_float, c_datetime3),
+NULLIF(c_float, c_timestamp3),
+NULLIF(c_float, c_date),
+NULLIF(c_float, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_float, 1)` double DEFAULT NULL,
+ `NULLIF(c_float, c_smallint)` double DEFAULT NULL,
+ `NULLIF(c_float, c_tinyint)` double DEFAULT NULL,
+ `NULLIF(c_float, c_int)` double DEFAULT NULL,
+ `NULLIF(c_float, c_bigint)` double DEFAULT NULL,
+ `NULLIF(c_float, c_float)` double DEFAULT NULL,
+ `NULLIF(c_float, c_double)` double DEFAULT NULL,
+ `NULLIF(c_float, c_decimal103)` double DEFAULT NULL,
+ `NULLIF(c_float, c_varchar10)` double DEFAULT NULL,
+ `NULLIF(c_float, c_text)` double DEFAULT NULL,
+ `NULLIF(c_float, c_blob)` double DEFAULT NULL,
+ `NULLIF(c_float, c_enum)` double DEFAULT NULL,
+ `NULLIF(c_float, c_datetime3)` double DEFAULT NULL,
+ `NULLIF(c_float, c_timestamp3)` double DEFAULT NULL,
+ `NULLIF(c_float, c_date)` double DEFAULT NULL,
+ `NULLIF(c_float, c_time)` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_double, 1),
+NULLIF(c_double, c_smallint),
+NULLIF(c_double, c_tinyint),
+NULLIF(c_double, c_int),
+NULLIF(c_double, c_bigint),
+NULLIF(c_double, c_float),
+NULLIF(c_double, c_double),
+NULLIF(c_double, c_decimal103),
+NULLIF(c_double, c_varchar10),
+NULLIF(c_double, c_text),
+NULLIF(c_double, c_blob),
+NULLIF(c_double, c_enum),
+NULLIF(c_double, c_datetime3),
+NULLIF(c_double, c_timestamp3),
+NULLIF(c_double, c_date),
+NULLIF(c_double, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_double, 1)` double DEFAULT NULL,
+ `NULLIF(c_double, c_smallint)` double DEFAULT NULL,
+ `NULLIF(c_double, c_tinyint)` double DEFAULT NULL,
+ `NULLIF(c_double, c_int)` double DEFAULT NULL,
+ `NULLIF(c_double, c_bigint)` double DEFAULT NULL,
+ `NULLIF(c_double, c_float)` double DEFAULT NULL,
+ `NULLIF(c_double, c_double)` double DEFAULT NULL,
+ `NULLIF(c_double, c_decimal103)` double DEFAULT NULL,
+ `NULLIF(c_double, c_varchar10)` double DEFAULT NULL,
+ `NULLIF(c_double, c_text)` double DEFAULT NULL,
+ `NULLIF(c_double, c_blob)` double DEFAULT NULL,
+ `NULLIF(c_double, c_enum)` double DEFAULT NULL,
+ `NULLIF(c_double, c_datetime3)` double DEFAULT NULL,
+ `NULLIF(c_double, c_timestamp3)` double DEFAULT NULL,
+ `NULLIF(c_double, c_date)` double DEFAULT NULL,
+ `NULLIF(c_double, c_time)` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_decimal103, 1),
+NULLIF(c_decimal103, c_smallint),
+NULLIF(c_decimal103, c_tinyint),
+NULLIF(c_decimal103, c_int),
+NULLIF(c_decimal103, c_bigint),
+NULLIF(c_decimal103, c_float),
+NULLIF(c_decimal103, c_double),
+NULLIF(c_decimal103, c_decimal103),
+NULLIF(c_decimal103, c_varchar10),
+NULLIF(c_decimal103, c_text),
+NULLIF(c_decimal103, c_blob),
+NULLIF(c_decimal103, c_enum),
+NULLIF(c_decimal103, c_datetime3),
+NULLIF(c_decimal103, c_timestamp3),
+NULLIF(c_decimal103, c_date),
+NULLIF(c_decimal103, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_decimal103, 1)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_smallint)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_tinyint)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_int)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_bigint)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_float)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_double)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_decimal103)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_varchar10)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_text)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_blob)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_enum)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_datetime3)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_timestamp3)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_date)` decimal(10,3) DEFAULT NULL,
+ `NULLIF(c_decimal103, c_time)` decimal(10,3) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_varchar10, 1),
+NULLIF(c_varchar10, c_smallint),
+NULLIF(c_varchar10, c_tinyint),
+NULLIF(c_varchar10, c_int),
+NULLIF(c_varchar10, c_bigint),
+NULLIF(c_varchar10, c_float),
+NULLIF(c_varchar10, c_double),
+NULLIF(c_varchar10, c_decimal103),
+NULLIF(c_varchar10, c_varchar10),
+NULLIF(c_varchar10, c_text),
+NULLIF(c_varchar10, c_blob),
+NULLIF(c_varchar10, c_enum),
+NULLIF(c_varchar10, c_datetime3),
+NULLIF(c_varchar10, c_timestamp3),
+NULLIF(c_varchar10, c_date),
+NULLIF(c_varchar10, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_varchar10, 1)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_smallint)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_tinyint)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_int)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_bigint)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_float)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_double)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_decimal103)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_varchar10)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_text)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_blob)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_enum)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_datetime3)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_timestamp3)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_date)` varchar(10) DEFAULT NULL,
+ `NULLIF(c_varchar10, c_time)` varchar(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_text, 1),
+NULLIF(c_text, c_smallint),
+NULLIF(c_text, c_tinyint),
+NULLIF(c_text, c_int),
+NULLIF(c_text, c_bigint),
+NULLIF(c_text, c_float),
+NULLIF(c_text, c_double),
+NULLIF(c_text, c_decimal103),
+NULLIF(c_text, c_varchar10),
+NULLIF(c_text, c_text),
+NULLIF(c_text, c_blob),
+NULLIF(c_text, c_enum),
+NULLIF(c_text, c_datetime3),
+NULLIF(c_text, c_timestamp3),
+NULLIF(c_text, c_date),
+NULLIF(c_text, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_text, 1)` longtext,
+ `NULLIF(c_text, c_smallint)` longtext,
+ `NULLIF(c_text, c_tinyint)` longtext,
+ `NULLIF(c_text, c_int)` longtext,
+ `NULLIF(c_text, c_bigint)` longtext,
+ `NULLIF(c_text, c_float)` longtext,
+ `NULLIF(c_text, c_double)` longtext,
+ `NULLIF(c_text, c_decimal103)` longtext,
+ `NULLIF(c_text, c_varchar10)` longtext,
+ `NULLIF(c_text, c_text)` longtext,
+ `NULLIF(c_text, c_blob)` longtext,
+ `NULLIF(c_text, c_enum)` longtext,
+ `NULLIF(c_text, c_datetime3)` longtext,
+ `NULLIF(c_text, c_timestamp3)` longtext,
+ `NULLIF(c_text, c_date)` longtext,
+ `NULLIF(c_text, c_time)` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_blob, 1),
+NULLIF(c_blob, c_smallint),
+NULLIF(c_blob, c_tinyint),
+NULLIF(c_blob, c_int),
+NULLIF(c_blob, c_bigint),
+NULLIF(c_blob, c_float),
+NULLIF(c_blob, c_double),
+NULLIF(c_blob, c_decimal103),
+NULLIF(c_blob, c_varchar10),
+NULLIF(c_blob, c_text),
+NULLIF(c_blob, c_blob),
+NULLIF(c_blob, c_enum),
+NULLIF(c_blob, c_datetime3),
+NULLIF(c_blob, c_timestamp3),
+NULLIF(c_blob, c_date),
+NULLIF(c_blob, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_blob, 1)` longblob,
+ `NULLIF(c_blob, c_smallint)` longblob,
+ `NULLIF(c_blob, c_tinyint)` longblob,
+ `NULLIF(c_blob, c_int)` longblob,
+ `NULLIF(c_blob, c_bigint)` longblob,
+ `NULLIF(c_blob, c_float)` longblob,
+ `NULLIF(c_blob, c_double)` longblob,
+ `NULLIF(c_blob, c_decimal103)` longblob,
+ `NULLIF(c_blob, c_varchar10)` longblob,
+ `NULLIF(c_blob, c_text)` longblob,
+ `NULLIF(c_blob, c_blob)` longblob,
+ `NULLIF(c_blob, c_enum)` longblob,
+ `NULLIF(c_blob, c_datetime3)` longblob,
+ `NULLIF(c_blob, c_timestamp3)` longblob,
+ `NULLIF(c_blob, c_date)` longblob,
+ `NULLIF(c_blob, c_time)` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_enum, 1),
+NULLIF(c_enum, c_smallint),
+NULLIF(c_enum, c_tinyint),
+NULLIF(c_enum, c_int),
+NULLIF(c_enum, c_bigint),
+NULLIF(c_enum, c_float),
+NULLIF(c_enum, c_double),
+NULLIF(c_enum, c_decimal103),
+NULLIF(c_enum, c_varchar10),
+NULLIF(c_enum, c_text),
+NULLIF(c_enum, c_blob),
+NULLIF(c_enum, c_enum),
+NULLIF(c_enum, c_datetime3),
+NULLIF(c_enum, c_timestamp3),
+NULLIF(c_enum, c_date),
+NULLIF(c_enum, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_enum, 1)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_smallint)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_tinyint)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_int)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_bigint)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_float)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_double)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_decimal103)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_varchar10)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_text)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_blob)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_enum)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_datetime3)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_timestamp3)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_date)` varchar(4) DEFAULT NULL,
+ `NULLIF(c_enum, c_time)` varchar(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_datetime3, 1),
+NULLIF(c_datetime3, c_smallint),
+NULLIF(c_datetime3, c_tinyint),
+NULLIF(c_datetime3, c_int),
+NULLIF(c_datetime3, c_bigint),
+NULLIF(c_datetime3, c_float),
+NULLIF(c_datetime3, c_double),
+NULLIF(c_datetime3, c_decimal103),
+NULLIF(c_datetime3, c_varchar10),
+NULLIF(c_datetime3, c_text),
+NULLIF(c_datetime3, c_blob),
+NULLIF(c_datetime3, c_enum),
+NULLIF(c_datetime3, c_datetime3),
+NULLIF(c_datetime3, c_timestamp3),
+NULLIF(c_datetime3, c_date),
+NULLIF(c_datetime3, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_datetime3, 1)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_smallint)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_tinyint)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_int)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_bigint)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_float)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_double)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_decimal103)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_varchar10)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_text)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_blob)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_enum)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_datetime3)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_timestamp3)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_date)` datetime(3) DEFAULT NULL,
+ `NULLIF(c_datetime3, c_time)` datetime(3) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_timestamp3, 1),
+NULLIF(c_timestamp3, c_smallint),
+NULLIF(c_timestamp3, c_tinyint),
+NULLIF(c_timestamp3, c_int),
+NULLIF(c_timestamp3, c_bigint),
+NULLIF(c_timestamp3, c_float),
+NULLIF(c_timestamp3, c_double),
+NULLIF(c_timestamp3, c_decimal103),
+NULLIF(c_timestamp3, c_varchar10),
+NULLIF(c_timestamp3, c_text),
+NULLIF(c_timestamp3, c_blob),
+NULLIF(c_timestamp3, c_enum),
+NULLIF(c_timestamp3, c_datetime3),
+NULLIF(c_timestamp3, c_timestamp3),
+NULLIF(c_timestamp3, c_date),
+NULLIF(c_timestamp3, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_timestamp3, 1)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_smallint)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_tinyint)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_int)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_bigint)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_float)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_double)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_decimal103)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_varchar10)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_text)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_blob)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_enum)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_datetime3)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_timestamp3)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_date)` timestamp(3) NULL DEFAULT NULL,
+ `NULLIF(c_timestamp3, c_time)` timestamp(3) NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_date, 1),
+NULLIF(c_date, c_smallint),
+NULLIF(c_date, c_tinyint),
+NULLIF(c_date, c_int),
+NULLIF(c_date, c_bigint),
+NULLIF(c_date, c_float),
+NULLIF(c_date, c_double),
+NULLIF(c_date, c_decimal103),
+NULLIF(c_date, c_varchar10),
+NULLIF(c_date, c_text),
+NULLIF(c_date, c_blob),
+NULLIF(c_date, c_enum),
+NULLIF(c_date, c_datetime3),
+NULLIF(c_date, c_timestamp3),
+NULLIF(c_date, c_date),
+NULLIF(c_date, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_date, 1)` date DEFAULT NULL,
+ `NULLIF(c_date, c_smallint)` date DEFAULT NULL,
+ `NULLIF(c_date, c_tinyint)` date DEFAULT NULL,
+ `NULLIF(c_date, c_int)` date DEFAULT NULL,
+ `NULLIF(c_date, c_bigint)` date DEFAULT NULL,
+ `NULLIF(c_date, c_float)` date DEFAULT NULL,
+ `NULLIF(c_date, c_double)` date DEFAULT NULL,
+ `NULLIF(c_date, c_decimal103)` date DEFAULT NULL,
+ `NULLIF(c_date, c_varchar10)` date DEFAULT NULL,
+ `NULLIF(c_date, c_text)` date DEFAULT NULL,
+ `NULLIF(c_date, c_blob)` date DEFAULT NULL,
+ `NULLIF(c_date, c_enum)` date DEFAULT NULL,
+ `NULLIF(c_date, c_datetime3)` date DEFAULT NULL,
+ `NULLIF(c_date, c_timestamp3)` date DEFAULT NULL,
+ `NULLIF(c_date, c_date)` date DEFAULT NULL,
+ `NULLIF(c_date, c_time)` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(c_time, 1),
+NULLIF(c_time, c_smallint),
+NULLIF(c_time, c_tinyint),
+NULLIF(c_time, c_int),
+NULLIF(c_time, c_bigint),
+NULLIF(c_time, c_float),
+NULLIF(c_time, c_double),
+NULLIF(c_time, c_decimal103),
+NULLIF(c_time, c_varchar10),
+NULLIF(c_time, c_text),
+NULLIF(c_time, c_blob),
+NULLIF(c_time, c_enum),
+NULLIF(c_time, c_datetime3),
+NULLIF(c_time, c_timestamp3),
+NULLIF(c_time, c_date),
+NULLIF(c_time, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(c_time, 1)` time DEFAULT NULL,
+ `NULLIF(c_time, c_smallint)` time DEFAULT NULL,
+ `NULLIF(c_time, c_tinyint)` time DEFAULT NULL,
+ `NULLIF(c_time, c_int)` time DEFAULT NULL,
+ `NULLIF(c_time, c_bigint)` time DEFAULT NULL,
+ `NULLIF(c_time, c_float)` time DEFAULT NULL,
+ `NULLIF(c_time, c_double)` time DEFAULT NULL,
+ `NULLIF(c_time, c_decimal103)` time DEFAULT NULL,
+ `NULLIF(c_time, c_varchar10)` time DEFAULT NULL,
+ `NULLIF(c_time, c_text)` time DEFAULT NULL,
+ `NULLIF(c_time, c_blob)` time DEFAULT NULL,
+ `NULLIF(c_time, c_enum)` time DEFAULT NULL,
+ `NULLIF(c_time, c_datetime3)` time DEFAULT NULL,
+ `NULLIF(c_time, c_timestamp3)` time DEFAULT NULL,
+ `NULLIF(c_time, c_date)` time DEFAULT NULL,
+ `NULLIF(c_time, c_time)` time DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+#
+# Checking that the return type depends only on args[0], even if compared to a field
+#
+CREATE TABLE t2 AS SELECT
+NULLIF(1, 1),
+NULLIF(1, c_smallint),
+NULLIF(1, c_tinyint),
+NULLIF(1, c_int),
+NULLIF(1, c_bigint),
+NULLIF(1, c_float),
+NULLIF(1, c_double),
+NULLIF(1, c_decimal103),
+NULLIF(1, c_varchar10),
+NULLIF(1, c_text),
+NULLIF(1, c_blob),
+NULLIF(1, c_enum),
+NULLIF(1, c_datetime3),
+NULLIF(1, c_timestamp3),
+NULLIF(1, c_date),
+NULLIF(1, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(1, 1)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_smallint)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_tinyint)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_int)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_bigint)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_float)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_double)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_decimal103)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_varchar10)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_text)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_blob)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_enum)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_datetime3)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_timestamp3)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_date)` int(1) DEFAULT NULL,
+ `NULLIF(1, c_time)` int(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(1.0, 1),
+NULLIF(1.0, c_smallint),
+NULLIF(1.0, c_tinyint),
+NULLIF(1.0, c_int),
+NULLIF(1.0, c_bigint),
+NULLIF(1.0, c_float),
+NULLIF(1.0, c_double),
+NULLIF(1.0, c_decimal103),
+NULLIF(1.0, c_varchar10),
+NULLIF(1.0, c_text),
+NULLIF(1.0, c_blob),
+NULLIF(1.0, c_enum),
+NULLIF(1.0, c_datetime3),
+NULLIF(1.0, c_timestamp3),
+NULLIF(1.0, c_date),
+NULLIF(1.0, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(1.0, 1)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_smallint)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_tinyint)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_int)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_bigint)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_float)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_double)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_decimal103)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_varchar10)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_text)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_blob)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_enum)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_datetime3)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_timestamp3)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_date)` decimal(2,1) DEFAULT NULL,
+ `NULLIF(1.0, c_time)` decimal(2,1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(1e0, 1),
+NULLIF(1e0, c_smallint),
+NULLIF(1e0, c_tinyint),
+NULLIF(1e0, c_int),
+NULLIF(1e0, c_bigint),
+NULLIF(1e0, c_float),
+NULLIF(1e0, c_double),
+NULLIF(1e0, c_decimal103),
+NULLIF(1e0, c_varchar10),
+NULLIF(1e0, c_text),
+NULLIF(1e0, c_blob),
+NULLIF(1e0, c_enum),
+NULLIF(1e0, c_datetime3),
+NULLIF(1e0, c_timestamp3),
+NULLIF(1e0, c_date),
+NULLIF(1e0, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(1e0, 1)` double DEFAULT NULL,
+ `NULLIF(1e0, c_smallint)` double DEFAULT NULL,
+ `NULLIF(1e0, c_tinyint)` double DEFAULT NULL,
+ `NULLIF(1e0, c_int)` double DEFAULT NULL,
+ `NULLIF(1e0, c_bigint)` double DEFAULT NULL,
+ `NULLIF(1e0, c_float)` double DEFAULT NULL,
+ `NULLIF(1e0, c_double)` double DEFAULT NULL,
+ `NULLIF(1e0, c_decimal103)` double DEFAULT NULL,
+ `NULLIF(1e0, c_varchar10)` double DEFAULT NULL,
+ `NULLIF(1e0, c_text)` double DEFAULT NULL,
+ `NULLIF(1e0, c_blob)` double DEFAULT NULL,
+ `NULLIF(1e0, c_enum)` double DEFAULT NULL,
+ `NULLIF(1e0, c_datetime3)` double DEFAULT NULL,
+ `NULLIF(1e0, c_timestamp3)` double DEFAULT NULL,
+ `NULLIF(1e0, c_date)` double DEFAULT NULL,
+ `NULLIF(1e0, c_time)` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF('1', 1),
+NULLIF('1', c_smallint),
+NULLIF('1', c_tinyint),
+NULLIF('1', c_int),
+NULLIF('1', c_bigint),
+NULLIF('1', c_float),
+NULLIF('1', c_double),
+NULLIF('1', c_decimal103),
+NULLIF('1', c_varchar10),
+NULLIF('1', c_text),
+NULLIF('1', c_blob),
+NULLIF('1', c_enum),
+NULLIF('1', c_datetime3),
+NULLIF('1', c_timestamp3),
+NULLIF('1', c_date),
+NULLIF('1', c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF('1', 1)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_smallint)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_tinyint)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_int)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_bigint)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_float)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_double)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_decimal103)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_varchar10)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_text)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_blob)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_enum)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_datetime3)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_timestamp3)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_date)` varchar(1) DEFAULT NULL,
+ `NULLIF('1', c_time)` varchar(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+NULLIF(TIME'10:10:10', 1),
+NULLIF(TIME'10:10:10', c_smallint),
+NULLIF(TIME'10:10:10', c_tinyint),
+NULLIF(TIME'10:10:10', c_int),
+NULLIF(TIME'10:10:10', c_bigint),
+NULLIF(TIME'10:10:10', c_float),
+NULLIF(TIME'10:10:10', c_double),
+NULLIF(TIME'10:10:10', c_decimal103),
+NULLIF(TIME'10:10:10', c_varchar10),
+NULLIF(TIME'10:10:10', c_text),
+NULLIF(TIME'10:10:10', c_blob),
+NULLIF(TIME'10:10:10', c_enum),
+NULLIF(TIME'10:10:10', c_datetime3),
+NULLIF(TIME'10:10:10', c_timestamp3),
+NULLIF(TIME'10:10:10', c_date),
+NULLIF(TIME'10:10:10', c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `NULLIF(TIME'10:10:10', 1)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_smallint)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_tinyint)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_int)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_bigint)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_float)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_double)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_decimal103)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_varchar10)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_text)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_blob)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_enum)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_datetime3)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_timestamp3)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_date)` time DEFAULT NULL,
+ `NULLIF(TIME'10:10:10', c_time)` time DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# MDEV-7759 NULLIF(x,y) is not equal to CASE WHEN x=y THEN NULL ELSE x END
+#
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2020);
+SELECT * FROM t1 WHERE a=2010 AND NULLIF(10.1,a) IS NULL;
+a
+2010
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND NULLIF(10.1,a) IS NULL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010)
+SELECT * FROM t1 WHERE a=2010 AND CASE WHEN 10.1=a THEN NULL ELSE 10.1 END IS NULL;
+a
+2010
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND CASE WHEN 10.1=a THEN NULL ELSE 10.1 END IS NULL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010)
+DROP TABLE t1;
+# Two warnings expected
+CREATE TABLE t1 AS SELECT
+NULLIF(TIMESTAMP'2001-01-01 00:00:00',1) AS a,
+CASE WHEN TIMESTAMP'2001-01-01 00:00:00'=1 THEN NULL
+ELSE TIMESTAMP'2001-01-01 00:00:00'
+ END AS b;
+Warnings:
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1'
+DROP TABLE t1;
+#
+# MDEV-8785 Wrong results for EXPLAIN EXTENDED...WHERE NULLIF(latin1_col, _utf8'a' COLLATE utf8_bin) IS NOT NULL
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT a, NULLIF(a,_utf8'a' COLLATE utf8_bin) IS NULL FROM t1;
+a NULLIF(a,_utf8'a' COLLATE utf8_bin) IS NULL
+a 1
+A 0
+SELECT CHARSET(NULLIF(a,_utf8'a' COLLATE utf8_bin)) FROM t1;
+CHARSET(NULLIF(a,_utf8'a' COLLATE utf8_bin))
+latin1
+latin1
+EXPLAIN EXTENDED SELECT NULLIF(a,_utf8'a' COLLATE utf8_bin) IS NULL AS expr FROM t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
+Warnings:
+Note 1003 select isnull((case when convert(`test`.`t1`.`a` using utf8) = (_utf8'a' collate utf8_bin) then NULL else `test`.`t1`.`a` end)) AS `expr` from `test`.`t1`
+DROP TABLE t1;
+#
+# MDEV-8740 Wrong result for SELECT..WHERE year_field=10 AND NULLIF(year_field,2011.1)='2011'
+#
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2011);
+SELECT a=10 AND NULLIF(a,2011.1)='2011' AS cond FROM t1;
+cond
+0
+0
+SELECT * FROM t1 WHERE a=10;
+a
+2010
+SELECT * FROM t1 WHERE NULLIF(a,2011.1)='2011';
+a
+SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)='2011';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)='2011';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2010) and ((case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = '2011'))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)=CONCAT('2011',RAND());
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2010) and ((case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = concat('2011',rand())))
+DROP TABLE t1;
+#
+# MDEV-8754 Wrong result for SELECT..WHERE year_field=2020 AND NULLIF(year_field,2010)='2020'
+#
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2020);
+SELECT * FROM t1 WHERE a=2020;
+a
+2020
+SELECT * FROM t1 WHERE NULLIF(a,2010)='2020';
+a
+2020
+SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)='2020';
+a
+2020
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)='2020';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2020) and ((case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = '2020'))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)=CONCAT('2020',RAND());
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2020) and ((case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = concat('2020',rand())))
+DROP TABLE t1;
+#
+# MDEV-9181 (NULLIF(count(table.col)), 0) gives wrong result on 10.1.x
+#
+CREATE TABLE t1 (c1 varchar(50) DEFAULT NULL);
+INSERT INTO t1 (c1) VALUES ('hello'), ('hello\r\n'), ('hello'),('hello');
+SELECT NULLIF(COUNT(c1),0) FROM t1;
+NULLIF(COUNT(c1),0)
+4
+SELECT CASE WHEN COUNT(c1)=0 THEN NULL ELSE COUNT(c1) END FROM t1;
+CASE WHEN COUNT(c1)=0 THEN NULL ELSE COUNT(c1) END
+4
+SELECT NULLIF(COUNT(c1)+0,0) AS c1,NULLIF(CAST(COUNT(c1) AS SIGNED),0) AS c2,NULLIF(CONCAT(COUNT(c1)),0) AS c3 FROM t1;
+c1 c2 c3
+4 4 4
+SELECT NULLIF(COUNT(DISTINCT c1),0) FROM t1;
+NULLIF(COUNT(DISTINCT c1),0)
+2
+SELECT CASE WHEN COUNT(DISTINCT c1)=0 THEN NULL ELSE COUNT(DISTINCT c1) END FROM t1;
+CASE WHEN COUNT(DISTINCT c1)=0 THEN NULL ELSE COUNT(DISTINCT c1) END
+2
+DROP TABLE t1;
+CREATE TABLE t1 (
+id INT NOT NULL,
+c1 INT DEFAULT NULL
+);
+INSERT INTO t1 VALUES (1,1),(1,2),(2,3),(2,4);
+SELECT NULLIF(COUNT(c1),0) AS c1,NULLIF(COUNT(c1)+0,0) AS c1_wrapped,CASE WHEN COUNT(c1) IS NULL THEN 0 ELSE COUNT(c1) END AS c1_case FROM t1 GROUP BY id;
+c1 c1_wrapped c1_case
+2 2 2
+2 2 2
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SET @a=0;
+SELECT NULLIF(LAST_VALUE(@a:=@a+1,a),0) FROM t1;
+NULLIF(LAST_VALUE(@a:=@a+1,a),0)
+1
+2
+3
+SELECT @a;
+@a
+6
+SET @a=0;
+SELECT NULLIF(AVG(a),0), NULLIF(AVG(LAST_VALUE(@a:=@a+1,a)),0) FROM t1;
+NULLIF(AVG(a),0) NULLIF(AVG(LAST_VALUE(@a:=@a+1,a)),0)
+2.0000 2.0000
+SELECT @a;
+@a
+3
+EXPLAIN EXTENDED SELECT NULLIF(a,0) FROM t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select nullif(`test`.`t1`.`a`,0) AS `NULLIF(a,0)` from `test`.`t1`
+EXPLAIN EXTENDED SELECT NULLIF(AVG(a),0) FROM t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select nullif(<cache>(avg(`test`.`t1`.`a`)),0) AS `NULLIF(AVG(a),0)` from `test`.`t1`
+DROP TABLE t1;
+create table t1 (col1 varchar(50));
+create view v1 AS select nullif(count(distinct col1),0) from t1;
+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 nullif(count(distinct `t1`.`col1`),0) AS `nullif(count(distinct col1),0)` from `t1` latin1 latin1_swedish_ci
+drop view v1;
+drop table t1;
+create table t1 (col1 varchar(50) default null);
+insert into t1 (col1) values ('hello'), ('hello'), ('hello');
+create view v1 as select nullif(count(col1),0) from t1;
+select * from v1;
+nullif(count(col1),0)
+3
+select nullif(count(col1),0) from t1;
+nullif(count(col1),0)
+3
+drop view v1;
+drop table t1;
+select nullif((select 1), (select 2));
+nullif((select 1), (select 2))
+1
+create table t1 (f int);
+insert into t1 values (1),(2);
+select nullif( not f, 1 ) from t1;
+nullif( not f, 1 )
+0
+0
+drop table t1;
+set names utf8;
+create table t1 (f1 varchar(10));
+insert into t1 values ('2015-12-31');
+select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
+ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = `test`.`t1`.`f1` then NULL else '2002-09-08' end) as datetime(6)),24)'
+drop table t1;
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM "SELECT * FROM t1 WHERE NULLIF( ( 1, 2 ) IN ( SELECT 3, 4 ), 1 )";
+EXECUTE stmt;
+f1
+EXECUTE stmt;
+f1
+DROP TABLE t1;
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
+i
+DROP TABLE t1;
+#
+# MDEV-10347 mysqld got signal 11
+#
+CREATE TABLE t1 (f1 VARCHAR(10), f2 VARCHAR(40));
+CREATE TABLE t2 (f3 VARCHAR(20));
+PREPARE stmt FROM "
+ SELECT (
+ SELECT IFNULL(f3,4) FROM t2
+ WHERE IFNULL(NULLIF(f1,''),1)
+ ) AS sq
+ FROM t1
+ GROUP BY f2
+";
+EXECUTE stmt;
+sq
+DEALLOCATE PREPARE stmt;
+DROP TABLE t2,t1;
+#
+# MDEV-10236 Where expression with NOT function gives incorrect result
+#
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (((`test`.`t1`.`c1` is not null) >= <cache>((not(1)))) is not null)
+SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL;
+c1
+1
+2
+3
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/old-mode.result b/mysql-test/r/old-mode.result
index 4f650c3c781..b9a3edd4e94 100644
--- a/mysql-test/r/old-mode.result
+++ b/mysql-test/r/old-mode.result
@@ -104,6 +104,7 @@ DROP TABLE t1;
#
# MDEV-6649 Different warnings for TIME and TIME(N) when @@old_mode=zero_date_time_cast
#
+SET @@global.mysql56_temporal_format=true;
SET @@old_mode=zero_date_time_cast;
CREATE TABLE t1 (a TIME,b TIME(1));
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
@@ -114,3 +115,60 @@ Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1264 Out of range value for column 'b' at row 1
DROP TABLE t1;
+SET @@global.mysql56_temporal_format=false;
+SET @@old_mode=zero_date_time_cast;
+CREATE TABLE t1 (a TIME,b TIME(1));
+INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
+SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
+TO_DAYS(a) TO_DAYS(b)
+NULL NULL
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'b' at row 1
+DROP TABLE t1;
+SET @@global.mysql56_temporal_format=DEFAULT;
+set time_zone='Europe/Moscow';
+set global mysql56_temporal_format=false;
+create table t1 (a timestamp);
+set timestamp=1288477526;
+insert t1 values (null);
+set timestamp=1288481126;
+insert t1 values (null);
+select a, unix_timestamp(a) from t1;
+a unix_timestamp(a)
+2010-10-31 02:25:26 1288477526
+2010-10-31 02:25:26 1288481126
+set global mysql56_temporal_format=true;
+select a, unix_timestamp(a) from t1;
+a unix_timestamp(a)
+2010-10-31 02:25:26 1288477526
+2010-10-31 02:25:26 1288481126
+alter table t1 modify a timestamp;
+select a, unix_timestamp(a) from t1;
+a unix_timestamp(a)
+2010-10-31 02:25:26 1288477526
+2010-10-31 02:25:26 1288481126
+drop table t1;
+set global mysql56_temporal_format=false;
+create table t1 (a timestamp);
+set timestamp=1288477526;
+insert t1 values (null);
+set timestamp=1288481126;
+insert t1 values (null);
+select a, unix_timestamp(a) from t1;
+a unix_timestamp(a)
+2010-10-31 02:25:26 1288477526
+2010-10-31 02:25:26 1288481126
+set global mysql56_temporal_format=true;
+select a, unix_timestamp(a) from t1;
+a unix_timestamp(a)
+2010-10-31 02:25:26 1288477526
+2010-10-31 02:25:26 1288481126
+create table t2 (a timestamp);
+insert t2 select a from t1;
+select a, unix_timestamp(a) from t2;
+a unix_timestamp(a)
+2010-10-31 02:25:26 1288477526
+2010-10-31 02:25:26 1288481126
+drop table t1, t2;
+set time_zone=DEFAULT;
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 1d264bd57b1..bb817af5e2e 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -1,3 +1,5 @@
+set local sql_mode="";
+set global sql_mode="";
drop table if exists t1;
create table t1(f1 int);
insert into t1 values (5);
@@ -194,9 +196,9 @@ SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.p
mysqldump: Got error: 2026: "SSL connection error: Unable to get private key" when trying to connect
DROP TABLE t1;
Variable_name Value
-Ssl_cipher DHE-RSA-AES256-SHA
+Ssl_cipher AES256-SHA
Variable_name Value
-Ssl_cipher EDH-RSA-DES-CBC3-SHA
+Ssl_cipher AES128-SHA
select 'is still running; no cipher request crashed the server' as result from dual;
result
is still running; no cipher request crashed the server
@@ -206,6 +208,7 @@ SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS
have_ssl
1
DROP USER bug42158@localhost;
+set global sql_mode=default;
End of 5.1 tests
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
diff --git a/mysql-test/r/openssl_6975,tlsv10.result b/mysql-test/r/openssl_6975,tlsv10.result
index 52d5978749e..7a4465f4826 100644
--- a/mysql-test/r/openssl_6975,tlsv10.result
+++ b/mysql-test/r/openssl_6975,tlsv10.result
@@ -1,9 +1,11 @@
-grant select on test.* to ssl_sslv3@localhost require cipher "RC4-SHA";
+create user ssl_sslv3@localhost;
+grant select on test.* to ssl_sslv3@localhost require cipher "AES128-SHA";
+create user ssl_tls12@localhost;
grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256";
TLS1.2 ciphers: user is ok with any cipher
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
-TLS1.2 ciphers: user requires SSLv3 cipher RC4-SHA
+TLS1.2 ciphers: user requires SSLv3 cipher AES128-SHA
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
TLS1.2 ciphers: user requires TLSv1.2 cipher AES128-SHA256
@@ -11,12 +13,12 @@ ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
SSLv3 ciphers: user is ok with any cipher
Variable_name Value
-Ssl_cipher RC4-SHA
+Ssl_cipher AES256-SHA
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
-SSLv3 ciphers: user requires SSLv3 cipher RC4-SHA
+SSLv3 ciphers: user requires SSLv3 cipher AES128-SHA
Variable_name Value
-Ssl_cipher RC4-SHA
+Ssl_cipher AES128-SHA
ERROR 1045 (28000): Access denied for user 'ssl_sslv3'@'localhost' (using password: NO)
SSLv3 ciphers: user requires TLSv1.2 cipher AES128-SHA256
ERROR 1045 (28000): Access denied for user 'ssl_tls12'@'localhost' (using password: NO)
diff --git a/mysql-test/r/openssl_6975,tlsv12.result b/mysql-test/r/openssl_6975,tlsv12.result
index 033220427be..a014cbd0d9e 100644
--- a/mysql-test/r/openssl_6975,tlsv12.result
+++ b/mysql-test/r/openssl_6975,tlsv12.result
@@ -1,11 +1,13 @@
-grant select on test.* to ssl_sslv3@localhost require cipher "RC4-SHA";
+create user ssl_sslv3@localhost;
+grant select on test.* to ssl_sslv3@localhost require cipher "AES128-SHA";
+create user ssl_tls12@localhost;
grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256";
TLS1.2 ciphers: user is ok with any cipher
Variable_name Value
Ssl_cipher AES128-SHA256
Variable_name Value
Ssl_cipher DHE-RSA-AES256-GCM-SHA384
-TLS1.2 ciphers: user requires SSLv3 cipher RC4-SHA
+TLS1.2 ciphers: user requires SSLv3 cipher AES128-SHA
ERROR 1045 (28000): Access denied for user 'ssl_sslv3'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'ssl_sslv3'@'localhost' (using password: NO)
TLS1.2 ciphers: user requires TLSv1.2 cipher AES128-SHA256
@@ -15,7 +17,7 @@ ERROR 1045 (28000): Access denied for user 'ssl_tls12'@'localhost' (using passwo
SSLv3 ciphers: user is ok with any cipher
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
-SSLv3 ciphers: user requires SSLv3 cipher RC4-SHA
+SSLv3 ciphers: user requires SSLv3 cipher AES128-SHA
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
SSLv3 ciphers: user requires TLSv1.2 cipher AES128-SHA256
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index b907f50f632..4cd9aebdf49 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -287,6 +287,8 @@ PRIMARY KEY (member_id)
Warnings:
Warning 1101 BLOB/TEXT column 'info' can't have a default value
insert into t1 (member_id) values (1),(2),(3);
+Warnings:
+Warning 1364 Field 'info' doesn't have a default value
select member_id, nickname, voornaam FROM t1
ORDER by lastchange_datum DESC LIMIT 2;
member_id nickname voornaam
@@ -297,7 +299,7 @@ create table t1 (a int not null, b int, c varchar(10), key (a, b, c));
insert into t1 values (1, NULL, NULL), (1, NULL, 'b'), (1, 1, NULL), (1, 1, 'b'), (1, 1, 'b'), (2, 1, 'a'), (2, 1, 'b'), (2, 2, 'a'), (2, 2, 'b'), (2, 3, 'c'),(1,3,'b');
explain select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index a a 22 NULL 11 Using where; Using index
+1 SIMPLE t1 range a a 22 NULL 2 Using where; Using index
select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc;
a b c
1 NULL b
@@ -1161,7 +1163,7 @@ INSERT INTO t1 SELECT a +32, b +32 FROM t1;
INSERT INTO t1 SELECT a +64, b +64 FROM t1;
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (a, ab) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL ab 4 NULL 10 Using index for group-by
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 128 Using index
SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (a, ab) GROUP BY a;
a
1
@@ -2569,7 +2571,7 @@ SELECT * FROM t1 r JOIN t1 s ON r.a = s.a
WHERE s.a IN (2,9) OR s.a < 100 AND s.a != 0
ORDER BY 1 LIMIT 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE r index PRIMARY PRIMARY 4 NULL 10 100.00 Using where; Using index
+1 SIMPLE r range PRIMARY PRIMARY 4 NULL 12 100.00 Using where; Using index
1 SIMPLE s eq_ref PRIMARY PRIMARY 4 test.r.a 1 100.00 Using index
Warnings:
Note 1003 select `test`.`r`.`a` AS `a`,`test`.`s`.`a` AS `a` from `test`.`t1` `r` join `test`.`t1` `s` where ((`test`.`s`.`a` = `test`.`r`.`a`) and ((`test`.`r`.`a` in (2,9)) or ((`test`.`r`.`a` < 100) and (`test`.`r`.`a` <> 0)))) order by 1 limit 10
@@ -2600,7 +2602,7 @@ CREATE TABLE t1 (a INT,KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
EXPLAIN SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index a a 5 NULL 10 Using where; Using index; Using filesort
+1 SIMPLE t1 range a a 5 NULL 10 Using where; Using index
SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
a 1
10 1
@@ -3008,3 +3010,200 @@ explain update t1 set key1=key1+1 where key1 between 10 and 110 order by key1 li
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range key1 key1 5 NULL 2 Using where; Using buffer
drop table t1,t2;
+#
+# MDEV-465: Optimizer : wrong index choice, leading to strong performances issues
+#
+CREATE TABLE t1 (
+id1 int(10) unsigned NOT NULL auto_increment,
+id2 tinyint(3) unsigned NOT NULL default '0',
+id3 tinyint(3) unsigned NOT NULL default '0',
+id4 int(10) unsigned NOT NULL default '0',
+date timestamp NOT NULL default CURRENT_TIMESTAMP,
+PRIMARY KEY (id1),
+KEY id_234_date (id2,id3,id4,date),
+KEY id_23_date (id2,id3,date)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+# t1 has "bad" index declaration order..
+CREATE TABLE t2 (
+id1 int(10) unsigned NOT NULL auto_increment,
+id2 tinyint(3) unsigned NOT NULL default '0',
+id3 tinyint(3) unsigned NOT NULL default '0',
+id4 int(10) unsigned NOT NULL default '0',
+date timestamp NOT NULL default CURRENT_TIMESTAMP,
+PRIMARY KEY (id1),
+KEY id_23_date (id2,id3,date),
+KEY id_234_date (id2,id3,id4,date)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+# t2 has a "good" index declaration order
+INSERT INTO t1 (id2,id3,id4) VALUES (1,1,1),(1,1,1),(1,1,1),(1,1,1),(1,0,1),(1,2,1),(1,3,1);
+INSERT INTO t2 (id2,id3,id4) VALUES (1,1,1),(1,1,1),(1,1,1),(1,1,1),(1,0,1),(1,2,1),(1,3,1);
+# The following two must both use id_23_date and no "using filesort":
+EXPLAIN SELECT id1 FROM t1 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range id_234_date,id_23_date id_23_date 2 NULL 3 Using where
+# See above query
+EXPLAIN SELECT id1 FROM t2 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref id_23_date,id_234_date id_23_date 2 const,const 3 Using where
+drop table t1,t2;
+#
+# MDEV-8989: ORDER BY optimizer ignores equality propagation
+#
+set @tmp_8989=@@optimizer_switch;
+set optimizer_switch='orderby_uses_equalities=on';
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+create table t2 (
+pk int primary key,
+a int, b int,
+filler char(200),
+key(a)
+);
+insert into t2 select a, 1000-a, 1000-a, repeat('abc-',50) from t1 where a<200 limit 200;
+create table t3 (
+pk int primary key,
+a int, b int,
+filler char(200),
+key(a)
+);
+insert into t3 select a, 1000-a, 1000-a, repeat('abc-',50) from t1;
+insert into t3 select a+1000, 1000+a, 1000+a, repeat('abc-',50) from t1;
+# The optimizer produces an order of 't2,t3' for this join
+#
+# Case #1 (from the bug report):
+# Q1 can take advantage of t2.a to resolve ORDER BY limit w/o sorting
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index a a 5 NULL 5 Using where
+1 SIMPLE t3 ref a a 5 test.t2.a 1
+#
+# This is Q2 which used to have "Using temporary; using filesort" but
+# has the same query plan as Q1:
+#
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index a a 5 NULL 5 Using where
+1 SIMPLE t3 ref a a 5 test.t2.a 1
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 5;
+pk a b pk a b
+199 801 801 199 801 801
+198 802 802 198 802 802
+197 803 803 197 803 803
+196 804 804 196 804 804
+195 805 805 195 805 805
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 5;
+pk a b pk a b
+199 801 801 199 801 801
+198 802 802 198 802 802
+197 803 803 197 803 803
+196 804 804 196 804 804
+195 805 805 195 805 805
+#
+# Case #2: here, only "Using temporary" is removed. "Using filesort" remains.
+#
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 25;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort
+1 SIMPLE t3 ref a a 5 test.t2.a 1
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 25;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort
+1 SIMPLE t3 ref a a 5 test.t2.a 1
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 25;
+pk a b pk a b
+199 801 801 199 801 801
+198 802 802 198 802 802
+197 803 803 197 803 803
+196 804 804 196 804 804
+195 805 805 195 805 805
+194 806 806 194 806 806
+193 807 807 193 807 807
+192 808 808 192 808 808
+191 809 809 191 809 809
+190 810 810 190 810 810
+189 811 811 189 811 811
+188 812 812 188 812 812
+187 813 813 187 813 813
+186 814 814 186 814 814
+185 815 815 185 815 815
+184 816 816 184 816 816
+183 817 817 183 817 817
+182 818 818 182 818 818
+181 819 819 181 819 819
+180 820 820 180 820 820
+179 821 821 179 821 821
+178 822 822 178 822 822
+177 823 823 177 823 823
+176 824 824 176 824 824
+175 825 825 175 825 825
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 25;
+pk a b pk a b
+199 801 801 199 801 801
+198 802 802 198 802 802
+197 803 803 197 803 803
+196 804 804 196 804 804
+195 805 805 195 805 805
+194 806 806 194 806 806
+193 807 807 193 807 807
+192 808 808 192 808 808
+191 809 809 191 809 809
+190 810 810 190 810 810
+189 811 811 189 811 811
+188 812 812 188 812 812
+187 813 813 187 813 813
+186 814 814 186 814 814
+185 815 815 185 815 815
+184 816 816 184 816 816
+183 817 817 183 817 817
+182 818 818 182 818 818
+181 819 819 181 819 819
+180 820 820 180 820 820
+179 821 821 179 821 821
+178 822 822 178 822 822
+177 823 823 177 823 823
+176 824 824 176 824 824
+175 825 825 175 825 825
+#
+# Case #3: single table access (the code that decides whether we need
+# "Using temporary" is not invoked)
+#
+explain select * from t3 where b=a order by a limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index NULL a 5 NULL 10 Using where
+# This must not use filesort. The query plan should be like the query above:
+explain select * from t3 where b=a order by b limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index NULL a 5 NULL 10 Using where
+drop table t0,t1,t2,t3;
+set @@optimizer_switch=@tmp_8989;
+set optimizer_switch='orderby_uses_equalities=on';
+#
+# MDEV-10880: Assertions `keypart_map' or
+# `prebuilt->search_tuple->n_fields > 0' fail on DISTINCT and
+# GROUP BY constant
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT DISTINCT pk FROM t1 GROUP BY 'foo';
+pk
+1
+SELECT DISTINCT pk FROM t1;
+pk
+1
+2
+3
+DROP TABLE t1;
diff --git a/mysql-test/r/order_by_innodb.result b/mysql-test/r/order_by_innodb.result
index 3c6c4053741..4f59a2f8c20 100644
--- a/mysql-test/r/order_by_innodb.result
+++ b/mysql-test/r/order_by_innodb.result
@@ -11,3 +11,40 @@ a b c d
8 NULL 9 NULL
8 NULL 10 NULL
DROP TABLE t1;
+#
+# MDEV-9457: Poor query plan chosen for ORDER BY query by a recent 10.1
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+pk int primary key,
+key1 int,
+key2 int,
+col1 char(255),
+key(key1),
+key(key2)
+) engine=innodb;
+set @a=-1;
+insert into t1
+select
+@a:=@a+1,
+@a,
+@a,
+repeat('abcd', 63)
+from t0 A, t0 B, t0 C, t0 D;
+# The following must NOT use 'index' on PK.
+# It should use index_merge(key1,key2) + filesort
+explain
+select *
+from t1
+where key1<3 or key2<3
+order by pk;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL # Using sort_union(key1,key2); Using where; Using filesort
+explain
+select *
+from t1
+where key1<3 or key2<3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL # Using sort_union(key1,key2); Using where
+drop table t0, t1;
diff --git a/mysql-test/r/order_by_optimizer_innodb.result b/mysql-test/r/order_by_optimizer_innodb.result
new file mode 100644
index 00000000000..f3167db4b9a
--- /dev/null
+++ b/mysql-test/r/order_by_optimizer_innodb.result
@@ -0,0 +1,98 @@
+drop table if exists t0,t1,t2,t3;
+#
+# MDEV-6402: Optimizer doesn't choose best execution plan when composite key is used
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+CREATE TABLE t2 (
+pk1 int(11) NOT NULL,
+pk2 int(11) NOT NULL,
+fd5 bigint(20) DEFAULT NULL,
+filler1 char(200),
+filler2 char(200),
+PRIMARY KEY (pk1,pk2),
+UNIQUE KEY ux_pk1_fd5 (pk1,fd5)
+) ENGINE=InnoDB;
+insert into t2
+select
+round(log(2,t1.a+1)),
+t1.a,
+t1.a,
+REPEAT('filler-data-', 10),
+REPEAT('filler-data-', 10)
+from
+t1;
+select pk1, count(*) from t2 group by pk1;
+pk1 count(*)
+0 1
+1 1
+2 3
+3 6
+4 11
+5 23
+6 45
+7 91
+8 181
+9 362
+10 276
+# The following should use range(ux_pk1_fd5), two key parts (key_len=5+8=13)
+EXPLAIN SELECT * FROM t2 USE INDEX(ux_pk1_fd5) WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range ux_pk1_fd5 ux_pk1_fd5 13 NULL 137 Using where
+# This also must use range, not ref. key_len must be 13
+EXPLAIN SELECT * FROM t2 WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range PRIMARY,ux_pk1_fd5 ux_pk1_fd5 13 NULL 137 Using where
+drop table t0,t1, t2;
+#
+# MDEV-6814: Server crashes in calculate_key_len on query with ORDER BY
+#
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, KEY(f2),KEY(f2,f1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,5,0),(2,6,0);
+SELECT * FROM t1 WHERE f1 < 3 AND f2 IS NULL ORDER BY f1;
+f1 f2 f3
+DROP TABLE t1;
+#
+# MDEV-6796: Unable to skip filesort when using implicit extended key
+#
+CREATE TABLE t1 (
+pk1 int(11) NOT NULL,
+pk2 varchar(64) NOT NULL,
+col1 varchar(16) DEFAULT NULL,
+PRIMARY KEY (pk1,pk2),
+KEY key1 (pk1,col1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+pk1 int(11) NOT NULL,
+pk2 varchar(64) NOT NULL,
+col1 varchar(16) DEFAULT NULL,
+PRIMARY KEY (pk1,pk2),
+KEY key1 (pk1,col1,pk2)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `t1` VALUES
+(12321321,'a8f5f167f44f4964e6c998dee827110c','video'),
+(12321321,'d77a17a3659ffa60c54e0ea17b6c6d16','video'),
+(12321321,'wwafdsafdsafads','video'),
+(12321321,'696aa249f0738e8181957dd57c2d7d0b','video-2014-09-23'),
+(12321321,'802f9f29584b486f356693e3aa4ef0af','video=sdsd'),
+(12321321,'2f94543ff74aab82e9a058b4e8316d75','video=sdsdsds'),
+(12321321,'c1316b9df0d203fd1b9035308de52a0a','video=sdsdsdsdsd');
+insert into t2 select * from t1;
+# this must not use filesort:
+explain SELECT pk2
+FROM t1 USE INDEX(key1)
+WHERE pk1 = 123
+AND col1 = 'video'
+ORDER BY pk2 DESC LIMIT 21;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref key1 key1 55 const,const 1 Using where; Using index
+# this must not use filesort, either:
+explain SELECT pk2
+FROM t2 USE INDEX(key1)
+WHERE pk1 = 123 AND col1 = 'video'
+ORDER BY pk2 DESC LIMIT 21;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref key1 key1 55 const,const 1 Using where; Using index
+drop table t1, t2;
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index cca754da295..26f4b018726 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -672,3 +672,237 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
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 '\' at line 1
DROP TABLE t1;
+#
+# MDEV-7792 - SQL Parsing Error - UNION AND ORDER BY WITH JOIN
+#
+CREATE TABLE t1(a INT);
+SELECT * FROM t1 JOIN ((SELECT 1 AS b) UNION ALL (SELECT 2 AS b) ORDER BY b DESC) s1 WHERE a=1;
+a b
+DROP TABLE t1;
+#
+# Test of collective fix for three parser bugs:
+#
+# Bug #17727401, Bug #17426017, Bug #17473479:
+# The server accepts wrong syntax and then fails in different ways
+#
+CREATE TABLE t1 (i INT);
+# bug #17426017
+SELECT (SELECT EXISTS(SELECT * LIMIT 1 ORDER BY VALUES (c00)));
+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 'ORDER BY VALUES (c00)))' at line 1
+# bug#17473479
+CREATE TABLE a(a int);
+CREATE TABLE b(a int);
+DELETE FROM b ORDER BY(SELECT 1 FROM a ORDER BY a ORDER BY a);
+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 'ORDER BY a)' at line 1
+DROP TABLE a, b;
+# bug #17727401
+SELECT '' IN (SELECT '1' c FROM t1 ORDER BY '' ORDER BY '') FROM t1;
+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 'ORDER BY '') FROM t1' at line 1
+# regression & coverage tests
+# uniform syntax for FROM DUAL clause:
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+FOR UPDATE;
+1
+1
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+PROCEDURE ANALYSE() FOR UPDATE;
+ERROR HY000: Can't use ORDER clause with this procedure
+SELECT 1 FROM
+(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+FOR UPDATE) a;
+1
+1
+SELECT 1 FROM
+(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+PROCEDURE ANALYSE() FOR UPDATE) a;
+ERROR HY000: Incorrect usage of PROCEDURE and subquery
+SELECT 1 FROM t1
+WHERE EXISTS(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+FOR UPDATE);
+1
+SELECT 1 FROM t1
+WHERE EXISTS(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+PROCEDURE ANALYSE() FOR UPDATE);
+ERROR HY000: Incorrect usage of PROCEDURE and subquery
+SELECT 1 FROM t1
+UNION
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+FOR UPDATE;
+1
+1
+SELECT 1 FROM t1
+UNION
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+PROCEDURE ANALYSE() FOR UPDATE;
+ERROR HY000: Incorrect usage of PROCEDURE and subquery
+SELECT 1 FROM DUAL PROCEDURE ANALYSE()
+UNION
+SELECT 1 FROM t1;
+ERROR HY000: Incorrect usage of UNION and SELECT ... PROCEDURE ANALYSE()
+(SELECT 1 FROM t1)
+UNION
+(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+FOR UPDATE);
+1
+1
+(SELECT 1 FROM t1)
+UNION
+(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+PROCEDURE ANALYSE() FOR UPDATE);
+ERROR HY000: Incorrect usage of PROCEDURE and subquery
+# "FOR UPDATE" tests
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1;
+1
+SELECT 1 FROM t1 FOR UPDATE UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1;
+1
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 FOR UPDATE;
+1
+# "INTO" clause tests
+SELECT 1 FROM t1 INTO @var17727401;
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+SELECT 1 FROM DUAL INTO @var17727401;
+SELECT 1 INTO @var17727401;
+SELECT 1 INTO @var17727401 FROM t1;
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+SELECT 1 INTO @var17727401 FROM DUAL;
+SELECT 1 INTO @var17727401_1 FROM t1 INTO @var17727401_2;
+ERROR HY000: Incorrect usage of INTO and INTO
+SELECT 1 INTO @var17727401_1 FROM DUAL
+INTO @var17727401_2;
+ERROR HY000: Incorrect usage of INTO and INTO
+SELECT 1 INTO @var17727401 FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1;
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+SELECT 1 FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1 INTO @var17727401;
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+SELECT 1 FROM t1 WHERE 1 INTO @var17727401 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1;
+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 'GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1' at line 1
+SELECT 1 INTO @var17727401_1
+FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1
+INTO @var17727401_2;
+ERROR HY000: Incorrect usage of INTO and INTO
+SELECT (SELECT 1 FROM t1 INTO @var17727401);
+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 'INTO @var17727401)' at line 1
+SELECT 1 FROM (SELECT 1 FROM t1 INTO @var17727401) a;
+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 'INTO @var17727401) a' at line 1
+SELECT EXISTS(SELECT 1 FROM t1 INTO @var17727401);
+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 'INTO @var17727401)' at line 1
+SELECT 1 FROM t1 INTO @var17727401 UNION SELECT 1 FROM t1 INTO t1;
+ERROR HY000: Incorrect usage of UNION and INTO
+(SELECT 1 FROM t1 INTO @var17727401) UNION (SELECT 1 FROM t1 INTO t1);
+ERROR HY000: Incorrect usage of UNION and INTO
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 INTO @var17727401;
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+SELECT 1 INTO @var17727401 FROM t1 PROCEDURE ANALYSE();
+ERROR HY000: Incorrect usage of PROCEDURE and INTO
+SELECT 1 FROM t1 PROCEDURE ANALYSE() INTO @var17727401;
+ERROR HY000: Incorrect usage of PROCEDURE and INTO
+# ORDER and LIMIT clause combinations
+(SELECT 1 FROM t1 ORDER BY 1) ORDER BY 1;
+1
+(SELECT 1 FROM t1 LIMIT 1) LIMIT 1;
+1
+((SELECT 1 FROM t1 ORDER BY 1) ORDER BY 1) ORDER BY 1;
+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 'ORDER BY 1) ORDER BY 1' at line 1
+((SELECT 1 FROM t1 LIMIT 1) LIMIT 1) LIMIT 1;
+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 'LIMIT 1) LIMIT 1' at line 1
+(SELECT 1 FROM t1 ORDER BY 1) LIMIT 1;
+1
+(SELECT 1 FROM t1 LIMIT 1) ORDER BY 1;
+1
+((SELECT 1 FROM t1 ORDER BY 1) LIMIT 1) ORDER BY 1);
+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 'LIMIT 1) ORDER BY 1)' at line 1
+((SELECT 1 FROM t1 LIMIT 1) ORDER BY 1) LIMIT 1);
+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 'ORDER BY 1) LIMIT 1)' at line 1
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1;
+1
+SELECT (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1);
+(SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1)
+NULL
+SELECT 1 FROM (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1) a;
+1
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1;
+1
+SELECT (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1);
+(SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1)
+NULL
+SELECT 1 FROM (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1) a;
+1
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1;
+1
+SELECT (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1);
+(SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1)
+NULL
+SELECT 1 FROM (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1) a;
+1
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1 ORDER BY 1;
+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 'ORDER BY 1' at line 1
+SELECT (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1 ORDER BY 1);
+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 'ORDER BY 1)' at line 1
+SELECT 1 FROM (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1 ORDER BY 1) a;
+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 'ORDER BY 1) a' at line 1
+SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1);
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1) a;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1) a;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 UNION SELECT 1 FROM t1;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT (SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 UNION SELECT 1 FROM t1);
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 UNION SELECT 1 FROM t1) a;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM t1 LIMIT 1 ORDER BY 1 UNION SELECT 1 FROM t1;
+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 'ORDER BY 1 UNION SELECT 1 FROM t1' at line 1
+SELECT (SELECT 1 FROM t1 LIMIT 1 ORDER BY 1 UNION SELECT 1 FROM t1);
+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 'ORDER BY 1 UNION SELECT 1 FROM t1)' at line 1
+SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 ORDER BY 1 UNION SELECT 1 FROM t1) a;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 ORDER BY 1;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 ORDER BY 1);
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 ORDER BY 1) a;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 LIMIT 1;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 LIMIT 1);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 LIMIT 1) a;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 ORDER BY 1;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 ORDER BY 1);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 ORDER BY 1) a;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 LIMIT 1;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 LIMIT 1);
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 LIMIT 1) a;
+ERROR HY000: Incorrect usage of UNION and ORDER BY
+DROP TABLE t1;
+#
+# MDEV-8380: Subquery parse error
+#
+CREATE TABLE t1 ( a INT);
+INSERT INTO t1 VALUES ( 2 );
+SELECT *
+FROM ( (SELECT a FROM t1 ORDER BY a) UNION (SELECT 1 as b ORDER BY b ) ) AS a1
+WHERE a1.a = 1 OR a1.a = 2;
+a
+2
+1
+DROP TABLE t1;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index c6669176b3d..53f89c9cd55 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -2645,3 +2645,16 @@ Warnings:
Note 1517 Duplicate partition name p2
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+#
+# End of 10.0 tests
+#
+#
+# MDEV-8283 crash in get_mm_leaf with xor on binary col
+#
+CREATE TABLE t1(a BINARY(80)) PARTITION BY KEY(a) PARTITIONS 3;
+SELECT 1 FROM t1 WHERE a XOR 'a';
+1
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/partition_alter.result b/mysql-test/r/partition_alter.result
index cbd90b5ba7c..4275ef72f24 100644
--- a/mysql-test/r/partition_alter.result
+++ b/mysql-test/r/partition_alter.result
@@ -51,3 +51,64 @@ execute stmt;
execute stmt;
deallocate prepare stmt;
drop table test_data;
+create table t1(id int, d date not null, b bool not null default 0, primary key(id,d))
+engine=innodb
+partition by range columns (d) (
+partition p1 values less than ('2016-10-18'),
+partition p2 values less than ('2020-10-19'));
+insert t1 values (0, '2000-01-02', 0);
+insert t1 values (1, '2020-01-02', 10);
+alter table t1 add check (b in (0, 1));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `d` date NOT NULL,
+ `b` tinyint(1) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`,`d`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE COLUMNS(d)
+(PARTITION p1 VALUES LESS THAN ('2016-10-18') ENGINE = InnoDB,
+ PARTITION p2 VALUES LESS THAN ('2020-10-19') ENGINE = InnoDB) */
+insert t1 values (2, '2020-01-03', 20);
+drop table t1;
+create table t1(id int, d date not null, b bool not null default 0, primary key(id,d))
+partition by range columns (d) (
+partition p1 values less than ('2016-10-18'),
+partition p2 values less than ('2020-10-19'));
+insert t1 values (0, '2000-01-02', 0);
+insert t1 values (1, '2020-01-02', 10);
+alter table t1 add check (b in (0, 1));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `d` date NOT NULL,
+ `b` tinyint(1) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`,`d`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE COLUMNS(d)
+(PARTITION p1 VALUES LESS THAN ('2016-10-18') ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN ('2020-10-19') ENGINE = MyISAM) */
+insert t1 values (2, '2020-01-03', 20);
+drop table t1;
+create table t1 (id_1 int auto_increment, id_2 int, id_3 int, d1 date, dt1 datetime default current_timestamp, dt2 datetime default current_timestamp on update current_timestamp, primary key (id_2, id_3), key(id_1)) partition by hash(id_2) partitions 3 (partition p01, partition p02, partition p03);
+insert into t1 values(0, 1, 1, NULL, now(), now());
+alter online table t1 delay_key_write=1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id_1` int(11) NOT NULL AUTO_INCREMENT,
+ `id_2` int(11) NOT NULL,
+ `id_3` int(11) NOT NULL,
+ `d1` date DEFAULT NULL,
+ `dt1` datetime DEFAULT CURRENT_TIMESTAMP,
+ `dt2` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id_2`,`id_3`),
+ KEY `id_1` (`id_1`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1
+/*!50100 PARTITION BY HASH (id_2)
+(PARTITION p01 ENGINE = MyISAM,
+ PARTITION p02 ENGINE = MyISAM,
+ PARTITION p03 ENGINE = MyISAM) */
+drop table t1;
diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result
index ee7bf514807..80f11edaaf6 100644
--- a/mysql-test/r/partition_bug18198.result
+++ b/mysql-test/r/partition_bug18198.result
@@ -130,7 +130,8 @@ ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitio
create table t1 (col1 datetime)
partition by range(week(col1))
(partition p0 values less than (10), partition p1 values less than (30));
-ERROR HY000: This partition function is not allowed
+ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
+(partition p0 values less than (10), partition p1 values less than (30))' at line 2
create table t1 (col1 varchar(25))
partition by range(cast(col1 as signed))
(partition p0 values less than (10), partition p1 values less than (30));
diff --git a/mysql-test/r/partition_cache.result b/mysql-test/r/partition_cache.result
index cd579d00952..39ba4841337 100644
--- a/mysql-test/r/partition_cache.result
+++ b/mysql-test/r/partition_cache.result
@@ -1,3 +1,5 @@
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t2,t3;
set @save_query_cache_size = @@global.query_cache_size;
@@ -203,3 +205,4 @@ Variable_name Value
Qcache_hits 1
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
+SET global query_cache_type=default;
diff --git a/mysql-test/r/partition_cache_innodb.result b/mysql-test/r/partition_cache_innodb.result
index 0d0abbb096c..271b23eed92 100644
--- a/mysql-test/r/partition_cache_innodb.result
+++ b/mysql-test/r/partition_cache_innodb.result
@@ -1,3 +1,5 @@
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
SET SESSION STORAGE_ENGINE = innodb;
drop table if exists t1;
set @save_query_cache_size = @@global.query_cache_size;
@@ -149,3 +151,4 @@ Variable_name Value
Qcache_hits 1
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;
+SET global query_cache_type=default;
diff --git a/mysql-test/r/partition_cache_myisam.result b/mysql-test/r/partition_cache_myisam.result
index 0b617c03590..b7d3dc53599 100644
--- a/mysql-test/r/partition_cache_myisam.result
+++ b/mysql-test/r/partition_cache_myisam.result
@@ -1,3 +1,5 @@
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
SET SESSION STORAGE_ENGINE = myisam;
drop table if exists t1;
set @save_query_cache_size = @@global.query_cache_size;
@@ -151,3 +153,4 @@ Variable_name Value
Qcache_hits 2
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;
+SET global query_cache_type=default;
diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result
index a494656a6a6..f18e9b39e1e 100644
--- a/mysql-test/r/partition_column.result
+++ b/mysql-test/r/partition_column.result
@@ -540,7 +540,7 @@ a b
drop table t1;
create table t1 as select to_seconds(null) as to_seconds;
select data_type from information_schema.columns
-where column_name='to_seconds';
+where table_schema='test' and column_name='to_seconds';
data_type
int
drop table t1;
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 879b603c5ad..eb09d81969f 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -328,7 +328,7 @@ partition by hash (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(27) NOT NULL DEFAULT b'0',
+ `a` bit(27) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
@@ -701,7 +701,7 @@ a tz
2038-01-19 03:14:06 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
Warnings:
-Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
Warning 1264 Out of range value for column 'a' at row 34
Warning 1264 Out of range value for column 'a' at row 35
SELECT MIN(a), MAX(a) FROM t2;
@@ -784,9 +784,9 @@ a tz
2011-10-30 00:00:02 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
Warnings:
-Warning 1292 Incorrect datetime value: '0000-00-00'
-Warning 1292 Incorrect datetime value: '0000-00-00'
-Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
SELECT MIN(a), MAX(a) FROM t2;
MIN(a) MAX(a)
1970-01-01 00:00:01 2038-01-19 03:14:06
@@ -1181,7 +1181,7 @@ a tz
2038-01-19 06:14:06 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
Warnings:
-Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 8
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 9
Warning 1264 Out of range value for column 'a' at row 34
@@ -1266,9 +1266,9 @@ a tz
2011-10-30 03:00:02 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
Warnings:
-Warning 1292 Incorrect datetime value: '0000-00-00'
-Warning 1292 Incorrect datetime value: '0000-00-00'
-Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 18
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 19
SELECT MIN(a), MAX(a) FROM t2;
diff --git a/mysql-test/r/partition_example.result b/mysql-test/r/partition_example.result
index 7b6e9aa5213..2129eea0818 100644
--- a/mysql-test/r/partition_example.result
+++ b/mysql-test/r/partition_example.result
@@ -7,7 +7,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE,
PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */
@@ -20,7 +20,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE,
PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */
diff --git a/mysql-test/r/partition_exchange.result b/mysql-test/r/partition_exchange.result
index fec08e99c72..0f6ac2cf480 100644
--- a/mysql-test/r/partition_exchange.result
+++ b/mysql-test/r/partition_exchange.result
@@ -485,14 +485,14 @@ INSERT INTO tsp VALUES (2, "First value"), (10, "Ten"), (50, "Fifty"), (200, "Tw
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -523,14 +523,14 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -583,14 +583,14 @@ ERROR HY000: Found a row that does not match the partition
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -639,14 +639,14 @@ ERROR HY000: Table to exchange with partition is partitioned: 'tp'
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -656,7 +656,7 @@ tp CREATE TABLE `tp` (
SHOW CREATE TABLE tsp;
Table Create Table
tsp CREATE TABLE `tsp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -693,14 +693,14 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -731,14 +731,14 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -770,14 +770,14 @@ ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tsp;
Table Create Table
tsp CREATE TABLE `tsp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -815,14 +815,14 @@ ALTER TABLE tp ENGINE = InnoDB;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@@ -853,14 +853,14 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@@ -894,14 +894,14 @@ ALTER TABLE tp ENGINE = InnoDB;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@@ -913,14 +913,14 @@ ERROR HY000: The mix of handlers in the partitions is not allowed in this versio
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@@ -946,14 +946,14 @@ INSERT INTO t SELECT * FROM tmp2;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=1000 MAX_ROWS=100000
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -975,7 +975,7 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `ba_key` (`b`,`a`)
@@ -983,7 +983,7 @@ t CREATE TABLE `t` (
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `ba_key` (`b`,`a`)
@@ -1034,7 +1034,7 @@ ALTER TABLE tmp RENAME TO t;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TEMPORARY TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `ba_key` (`b`,`a`)
@@ -1042,7 +1042,7 @@ t CREATE TEMPORARY TABLE `t` (
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `ba_key` (`b`,`a`)
@@ -1055,7 +1055,7 @@ ERROR HY000: Table to exchange with partition is temporary: 't'
SHOW CREATE TABLE t;
Table Create Table
t CREATE TEMPORARY TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `ba_key` (`b`,`a`)
@@ -1063,7 +1063,7 @@ t CREATE TEMPORARY TABLE `t` (
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `ba_key` (`b`,`a`)
diff --git a/mysql-test/r/partition_grant.result b/mysql-test/r/partition_grant.result
index c334a473a2a..f036b0bcc28 100644
--- a/mysql-test/r/partition_grant.result
+++ b/mysql-test/r/partition_grant.result
@@ -3,6 +3,7 @@ create schema mysqltest_1;
use mysqltest_1;
create table t1 (a int) partition by list (a) (partition p1 values in (1), partition p2 values in (2), partition p3 values in (3));
insert into t1 values (1),(2);
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
revoke all privileges on *.* from mysqltest_1@localhost;
grant select,alter on mysqltest_1.* to mysqltest_1@localhost;
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 90126bdd4fd..9a63db3f974 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -166,9 +166,11 @@ select * from t1;
f1 f2
-1 #######
drop table t1;
+set sql_mode="";
CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1);
INSERT INTO t1 VALUES (0);
DROP TABLE t1;
+set sql_mode=default;
create table t1 (c1 int DEFAULT NULL,
c2 varchar (30) DEFAULT NULL,
c3 date DEFAULT NULL)
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index f863ec5522a..b322d63a7e1 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -429,6 +429,7 @@ where a between '2006-01-01' and '2007-06-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
+SET SQL_MODE="";
create table t1 (a int)
engine = x
partition by key (a);
@@ -457,6 +458,7 @@ t1 CREATE TABLE `t1` (
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */
drop table t1;
+SET SQL_MODE=default;
create table t1
(
id int unsigned auto_increment,
diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result
index 7057bb0a55b..63c9da69955 100644
--- a/mysql-test/r/partition_innodb_plugin.result
+++ b/mysql-test/r/partition_innodb_plugin.result
@@ -24,7 +24,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
- `time` date NOT NULL DEFAULT '0000-00-00',
+ `time` date NOT NULL,
`id2` bigint(20) NOT NULL,
PRIMARY KEY (`id`,`time`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
diff --git a/mysql-test/r/partition_not_blackhole.result b/mysql-test/r/partition_not_blackhole.result
index 7759f947c32..ff1e51df892 100644
--- a/mysql-test/r/partition_not_blackhole.result
+++ b/mysql-test/r/partition_not_blackhole.result
@@ -9,7 +9,7 @@ SHOW TABLES;
Tables_in_test
t1
SHOW CREATE TABLE t1;
-ERROR HY000: Incorrect information in file: './test/t1.frm'
+ERROR HY000: Failed to read from the .par file
DROP TABLE t1;
ERROR HY000: Got error 1 "Operation not permitted" from storage engine partition
t1.frm
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index 65b788a7d1b..fe19473f8e4 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -1636,139 +1636,139 @@ INSERT INTO t1 VALUES (1, '2009-01-01'), (1, '2009-04-01'), (2, '2009-04-01'),
(1, '2009-04-05'), (1, '2009-04-06'), (1, '2009-04-07');
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 9 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 9 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 3 Using where; Using index
+1 SIMPLE t1 p20090402 index NULL PRIMARY 9 NULL 3 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 13 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 9 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 9 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 9 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 9 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 3 Using where; Using index
+1 SIMPLE t1 p20090402 index NULL PRIMARY 9 NULL 3 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 13 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 9 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 9 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 9 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 9 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 9 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 9 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 3 Using where; Using index
+1 SIMPLE t1 p20090402 index NULL PRIMARY 9 NULL 3 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 13 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 9 NULL 13 Using where; Using index
DROP TABLE t1;
# Test with DATE column NOT NULL
CREATE TABLE t1 (
@@ -3138,7 +3138,6 @@ explain partitions select 1 from t1 union all select 2;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 PRIMARY t1 NULL system NULL NULL NULL NULL 0 const row not found
2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-NULL UNION RESULT <union1,2> NULL ALL NULL NULL NULL NULL NULL
drop table t1;
create table t1 (a bigint unsigned not null) partition by range(a) (
partition p0 values less than (10),
diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result
index 2588a9b10e4..5809512083d 100644
--- a/mysql-test/r/partition_symlink.result
+++ b/mysql-test/r/partition_symlink.result
@@ -33,11 +33,15 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp/'
INSERT INTO t1 VALUES (0), (1), (2);
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Tables have different definitions
ALTER TABLE t1 EXCHANGE PARTITION p2 WITH TABLE t2;
ERROR HY000: Tables have different definitions
+SELECT * FROM t1;
+a
+1
+2
SELECT * FROM t2;
a
+0
DROP TABLE t1, t2;
# Creating two non colliding tables mysqltest2.t1 and test.t1
# test.t1 have partitions in mysqltest2-directory!
diff --git a/mysql-test/r/partition_windows.result b/mysql-test/r/partition_windows.result
index dabcedcb3f9..756690925f8 100644
--- a/mysql-test/r/partition_windows.result
+++ b/mysql-test/r/partition_windows.result
@@ -26,9 +26,5 @@ ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data
Warnings:
Warning 1618 <DATA DIRECTORY> option ignored
Warning 1618 <INDEX DIRECTORY> option ignored
-Warning 1618 <DATA DIRECTORY> option ignored
-Warning 1618 <INDEX DIRECTORY> option ignored
-Warning 1618 <DATA DIRECTORY> option ignored
-Warning 1618 <INDEX DIRECTORY> option ignored
INSERT INTO t1 VALUES (NULL, "last", 4);
DROP TABLE t1;
diff --git a/mysql-test/r/perror.result b/mysql-test/r/perror.result
index 30a56840b1b..432a4fd4c04 100644
--- a/mysql-test/r/perror.result
+++ b/mysql-test/r/perror.result
@@ -2,5 +2,5 @@ Illegal error code: 10000
MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MySQL error code 1408 (ER_STARTUP): %s: ready for connections.
Version: '%s' socket: '%s' port: %d %s
-MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Table upgrade required. Please do "REPAIR TABLE `%-.32s`" or dump/reload to fix it!
+MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!
MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu)
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index ce382e35bd1..3a141a25b5c 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -1,8 +1,5 @@
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
-Warnings:
-Warning 1286 Unknown storage engine 'EXAMPLE'
-Warning 1266 Using storage engine MyISAM for table 't1'
-DROP TABLE t1;
+ERROR 42000: Unknown storage engine 'EXAMPLE'
INSTALL PLUGIN example SONAME 'ha_example';
INSTALL PLUGIN EXAMPLE SONAME 'ha_example';
ERROR HY000: Plugin 'EXAMPLE' already installed
@@ -15,7 +12,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE STORAGE ENGINE
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.8
+PLUGIN_LIBRARY_VERSION 1.13
PLUGIN_AUTHOR Brian Aker, MySQL AB
PLUGIN_DESCRIPTION Example storage engine
PLUGIN_LICENSE GPL
@@ -28,7 +25,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE DAEMON
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.8
+PLUGIN_LIBRARY_VERSION 1.13
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Unusable Daemon
PLUGIN_LICENSE GPL
@@ -67,7 +64,7 @@ PLUGIN_STATUS DELETED
PLUGIN_TYPE STORAGE ENGINE
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.8
+PLUGIN_LIBRARY_VERSION 1.13
PLUGIN_AUTHOR Brian Aker, MySQL AB
PLUGIN_DESCRIPTION Example storage engine
PLUGIN_LICENSE GPL
@@ -127,7 +124,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,f,f,f'
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000 `STR`='dskj' `one_or_two`='one' `YESNO`=0 `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000 `STR`='dskj' `one_or_two`='one' `YESNO`=0
drop table t1;
SET @OLD_SQL_MODE=@@SQL_MODE;
SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
@@ -142,7 +139,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000000000000000000 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000000000000000000 `one_or_two`='ttt' `YESNO`=SSS
#alter table
alter table t1 ULL=10000000;
Warnings:
@@ -152,7 +149,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' `ULL`=10000000
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `ULL`=10000000
alter table t1 change a a int complex='c,c,c';
Warnings:
Note 1105 EXAMPLE DEBUG: Field `a` COMPLEX '(null)' -> 'c,c,c'
@@ -161,14 +158,14 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,c,c',
`b` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' `ULL`=10000000
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `ULL`=10000000
alter table t1 one_or_two=two;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,c,c',
`b` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `YESNO`=SSS `VAROPT`='5' `ULL`=10000000 `one_or_two`=two
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `YESNO`=SSS `ULL`=10000000 `one_or_two`=two
drop table t1;
#illegal value error
SET SQL_MODE='';
@@ -183,11 +180,11 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=4660 `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=4660
SET example_varopt_default=33;
select create_options from information_schema.tables where table_schema='test' and table_name='t1';
create_options
-`ULL`=4660 `VAROPT`='5'
+`ULL`=4660
ALTER TABLE t1 ULL=DEFAULT;
Warnings:
Note 1105 EXAMPLE DEBUG: ULL 4660 -> 4294967295
@@ -195,14 +192,14 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1
DROP TABLE t1;
create table t1 (a int) engine=example;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='33'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`=33
drop table t1;
create table t1 (a int) engine=example varopt=15;
show create table t1;
@@ -215,7 +212,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='33'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`=33
drop table t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
select 1;
diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result
index 0d3948dd313..626722f9dd1 100644
--- a/mysql-test/r/plugin_auth.result
+++ b/mysql-test/r/plugin_auth.result
@@ -1,3 +1,5 @@
+SET GLOBAL SQL_MODE="";
+SET LOCAL SQL_MODE="";
SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION
FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server';
PLUGIN_STATUS ACTIVE
@@ -44,7 +46,7 @@ plug@localhost plug_dest@%
## test no_auto_create_user sql mode with plugin users
SET @@sql_mode=no_auto_create_user;
GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
-SET @@sql_mode=default;
+SET @@sql_mode="";
DROP USER grant_user;
## test utf-8 user name
CREATE USER `Ÿ` IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
@@ -426,4 +428,5 @@ USER() CURRENT_USER()
bug12818542@localhost bug12818542_dest@localhost
DROP USER bug12818542@localhost;
DROP USER bug12818542_dest@localhost;
+SET GLOBAL SQL_MODE=default;
End of 5.5 tests
diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result
index b86a01f6b52..4f274c45971 100644
--- a/mysql-test/r/plugin_auth_qa.result
+++ b/mysql-test/r/plugin_auth_qa.result
@@ -1,3 +1,4 @@
+set sql_mode="";
CREATE DATABASE test_user_db;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string
diff --git a/mysql-test/r/plugin_loaderr.result b/mysql-test/r/plugin_loaderr.result
index d1189217355..fbb144a7b90 100644
--- a/mysql-test/r/plugin_loaderr.result
+++ b/mysql-test/r/plugin_loaderr.result
@@ -3,7 +3,7 @@ SELECT
PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY,PLUGIN_LIBRARY_VERSION,LOAD_OPTION
FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name = 'innodb';
PLUGIN_NAME InnoDB
-PLUGIN_STATUS DISABLED
+PLUGIN_STATUS INACTIVE
PLUGIN_TYPE STORAGE ENGINE
PLUGIN_LIBRARY NULL
PLUGIN_LIBRARY_VERSION NULL
diff --git a/mysql-test/r/plugin_not_embedded.result b/mysql-test/r/plugin_not_embedded.result
index 27553366660..8106abc497f 100644
--- a/mysql-test/r/plugin_not_embedded.result
+++ b/mysql-test/r/plugin_not_embedded.result
@@ -1,6 +1,7 @@
#
# Bug#51770: UNINSTALL PLUGIN requires no privileges
#
+CREATE USER bug51770@localhost;
GRANT INSERT ON mysql.plugin TO bug51770@localhost;
INSTALL PLUGIN example SONAME 'ha_example.so';
UNINSTALL PLUGIN example;
diff --git a/mysql-test/r/processlist.result b/mysql-test/r/processlist.result
index eb3af67c5bf..ebec6175a5b 100644
--- a/mysql-test/r/processlist.result
+++ b/mysql-test/r/processlist.result
@@ -17,3 +17,21 @@ select command, time < 5 from information_schema.processlist where id != connect
command time < 5
Sleep 1
set debug_sync='reset';
+#
+# 10.1 tests
+#
+#
+# MDEV-7807 information_schema.processlist truncates queries with binary strings
+#
+SET NAMES utf8;
+SELECT INFO, INFO_BINARY, 'xxx😎yyy' AS utf8mb4_string FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%xxx%yyy%';
+INFO SELECT INFO, INFO_BINARY, 'xxx????yyy' AS utf8mb4_string FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%xxx%yyy%'
+INFO_BINARY SELECT INFO, INFO_BINARY, 'xxx😎yyy' AS utf8mb4_string FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%xxx%yyy%'
+utf8mb4_string xxx😎yyy
+Warnings:
+Level Warning
+Code 1366
+Message Incorrect string value: '\xF0\x9F\x98\x8Eyy...' for column 'INFO' at row 1
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 0217af9ed61..26e7bc37363 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -1,5 +1,6 @@
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
drop table if exists t1,t2,t3,t4;
+drop database if exists mysqltest1;
drop database if exists client_test_db;
create table t1
(
@@ -1105,7 +1106,7 @@ t1 CREATE TABLE `t1` (
show create table mysqltest.t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `test` varchar(4) CHARACTER SET latin1 NOT NULL DEFAULT ''
+ `test` varchar(4) CHARACTER SET latin1 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table mysqltest.t1;
drop table mysqltest.t2;
@@ -1120,7 +1121,7 @@ t1 CREATE TABLE `t1` (
show create table mysqltest.t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `test` varchar(4) NOT NULL DEFAULT ''
+ `test` varchar(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop database mysqltest;
deallocate prepare stmt1;
@@ -1201,13 +1202,22 @@ SET @aux= "SELECT COUNT(*)
prepare my_stmt from @aux;
execute my_stmt;
COUNT(*)
-44
+46
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
execute my_stmt;
COUNT(*)
-44
+46
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
execute my_stmt;
COUNT(*)
-44
+46
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
deallocate prepare my_stmt;
drop procedure if exists p1|
drop table if exists t1|
@@ -2118,9 +2128,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
call proc_1();
show open tables from mysql;
Database Table In_use Name_locked
@@ -2131,9 +2141,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
call proc_1();
show open tables from mysql;
Database Table In_use Name_locked
@@ -2144,9 +2154,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
call proc_1();
show open tables from mysql;
Database Table In_use Name_locked
@@ -2157,9 +2167,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
flush tables;
create function func_1() returns int begin flush tables; return 1; end|
ERROR 0A000: FLUSH is not allowed in stored function or trigger
@@ -2175,9 +2185,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
prepare abc from "flush tables";
execute abc;
show open tables from mysql;
@@ -2189,9 +2199,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
execute abc;
show open tables from mysql;
Database Table In_use Name_locked
@@ -2202,9 +2212,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
execute abc;
show open tables from mysql;
Database Table In_use Name_locked
@@ -2215,9 +2225,9 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql user 0 0
mysql general_log 0 0
mysql host 0 0
+mysql user 0 0
flush tables;
deallocate prepare abc;
create procedure proc_1() flush logs;
@@ -2389,15 +2399,15 @@ create procedure a() select 42;
create procedure proc_1(a char(2)) show create procedure a;
call proc_1("bb");
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
select 42 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
select 42 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
select 42 latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure proc_1;
create function func_1() returns int begin show create procedure a; return 1; end|
@@ -2409,15 +2419,15 @@ ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "show create procedure a";
execute abc;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
select 42 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
select 42 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
select 42 latin1 latin1_swedish_ci latin1_swedish_ci
deallocate prepare abc;
drop procedure a;
@@ -2426,15 +2436,15 @@ create function a() returns int return 42+13;
create procedure proc_1(a char(2)) show create function a;
call proc_1("bb");
Function sql_mode Create Function character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
Function sql_mode Create Function character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
Function sql_mode Create Function character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure proc_1;
create function func_1() returns int begin show create function a; return 1; end|
@@ -2446,15 +2456,15 @@ ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "show create function a";
execute abc;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
+a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
deallocate prepare abc;
drop function a;
@@ -2464,22 +2474,22 @@ create procedure proc_1() show create table tab1;
call proc_1();
Table Create Table
tab1 CREATE TABLE `tab1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` char(1) NOT NULL DEFAULT '',
+ `a` int(11) NOT NULL,
+ `b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
call proc_1();
Table Create Table
tab1 CREATE TABLE `tab1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` char(1) NOT NULL DEFAULT '',
+ `a` int(11) NOT NULL,
+ `b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
call proc_1();
Table Create Table
tab1 CREATE TABLE `tab1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` char(1) NOT NULL DEFAULT '',
+ `a` int(11) NOT NULL,
+ `b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop procedure proc_1;
@@ -2493,22 +2503,22 @@ prepare abc from "show create table tab1";
execute abc;
Table Create Table
tab1 CREATE TABLE `tab1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` char(1) NOT NULL DEFAULT '',
+ `a` int(11) NOT NULL,
+ `b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
execute abc;
Table Create Table
tab1 CREATE TABLE `tab1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` char(1) NOT NULL DEFAULT '',
+ `a` int(11) NOT NULL,
+ `b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
execute abc;
Table Create Table
tab1 CREATE TABLE `tab1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` char(1) NOT NULL DEFAULT '',
+ `a` int(11) NOT NULL,
+ `b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
deallocate prepare abc;
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index a1bcf734b31..f54020c44d4 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -17,7 +17,8 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -300,7 +301,7 @@ t2 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # # latin1_swedish_ci NULL
prepare stmt4 from ' show table status from test like ''t9%'' ';
execute stmt4;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t9 MyISAM 10 Dynamic 2 216 432 # 2048 0 NULL # # # latin1_swedish_ci NULL
+t9 MyISAM 10 Dynamic 2 212 424 # 2048 0 NULL # # # latin1_swedish_ci NULL
prepare stmt4 from ' show status like ''Threads_running'' ';
execute stmt4;
Variable_name Value
@@ -308,7 +309,7 @@ Threads_running #
prepare stmt4 from ' show variables like ''sql_mode'' ';
execute stmt4;
Variable_name Value
-sql_mode
+sql_mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
prepare stmt4 from ' show engine myisam logs ';
execute stmt4;
Type Name Status
@@ -446,9 +447,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
+def possible_keys 253 4_OR_8_K 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 0 31 8
+def key_len 253 4_OR_8_K 0 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 14 N 1 31 8
@@ -462,9 +463,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 5 Y 0 31 8
-def possible_keys 253 4096 7 Y 0 31 8
+def possible_keys 253 4_OR_8_K 7 Y 0 31 8
def key 253 64 7 Y 0 31 8
-def key_len 253 4096 1 Y 0 31 8
+def key_len 253 4_OR_8_K 1 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 37 N 1 31 8
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 6ca76191db5..6d7544deb4e 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -10,7 +10,8 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -49,7 +50,7 @@ test_sequence
prepare stmt1 from ' select * from t9 order by c1 ' ;
execute stmt1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
+def test t9 t9 c1 c1 1 4 1 N 53251 0 63
def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
@@ -1156,9 +1157,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
+def possible_keys 253 4_OR_8_K 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 0 31 8
+def key_len 253 4_OR_8_K 0 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1775,21 +1776,21 @@ NULL as const12, @arg12 as param12,
show create table t5 ;
Table Create Table
t5 CREATE TABLE `t5` (
- `const01` int(1) NOT NULL DEFAULT '0',
+ `const01` int(1) NOT NULL,
`param01` bigint(20) DEFAULT NULL,
- `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `const02` decimal(2,1) NOT NULL,
`param02` decimal(65,30) DEFAULT NULL,
- `const03` double NOT NULL DEFAULT '0',
+ `const03` double NOT NULL,
`param03` double DEFAULT NULL,
- `const04` varchar(3) NOT NULL DEFAULT '',
+ `const04` varchar(3) NOT NULL,
`param04` longtext,
- `const05` varbinary(3) NOT NULL DEFAULT '',
+ `const05` varbinary(3) NOT NULL,
`param05` longblob,
- `const06` varchar(10) NOT NULL DEFAULT '',
+ `const06` varchar(10) NOT NULL,
`param06` longtext,
`const07` date DEFAULT NULL,
`param07` longtext,
- `const08` varchar(19) NOT NULL DEFAULT '',
+ `const08` varchar(19) NOT NULL,
`param08` longtext,
`const09` datetime DEFAULT NULL,
`param09` longtext,
@@ -1805,21 +1806,21 @@ t5 CREATE TABLE `t5` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 3 1 1 N 32769 0 63
+def test t5 t5 const01 const01 3 1 1 N 36865 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 const02 const02 246 4 3 N 36865 1 63
def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
-def test t5 t5 const03 const03 5 17 1 N 32769 31 63
+def test t5 t5 const03 const03 5 17 1 N 36865 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
-def test t5 t5 const04 const04 253 3 3 N 1 0 8
+def test t5 t5 const04 const04 253 3 3 N 4097 0 8
def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
-def test t5 t5 const05 const05 253 3 3 N 129 0 63
+def test t5 t5 const05 const05 253 3 3 N 4225 0 63
def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
+def test t5 t5 const06 const06 253 10 10 N 4097 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
+def test t5 t5 const08 const08 253 19 19 N 4097 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 47237790ae5..a22135d30c0 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -10,7 +10,8 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -49,7 +50,7 @@ test_sequence
prepare stmt1 from ' select * from t9 order by c1 ' ;
execute stmt1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
+def test t9 t9 c1 c1 1 4 1 N 53251 0 63
def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
@@ -1156,9 +1157,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
+def possible_keys 253 4_OR_8_K 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 0 31 8
+def key_len 253 4_OR_8_K 0 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1758,21 +1759,21 @@ NULL as const12, @arg12 as param12,
show create table t5 ;
Table Create Table
t5 CREATE TABLE `t5` (
- `const01` int(1) NOT NULL DEFAULT '0',
+ `const01` int(1) NOT NULL,
`param01` bigint(20) DEFAULT NULL,
- `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `const02` decimal(2,1) NOT NULL,
`param02` decimal(65,30) DEFAULT NULL,
- `const03` double NOT NULL DEFAULT '0',
+ `const03` double NOT NULL,
`param03` double DEFAULT NULL,
- `const04` varchar(3) NOT NULL DEFAULT '',
+ `const04` varchar(3) NOT NULL,
`param04` longtext,
- `const05` varbinary(3) NOT NULL DEFAULT '',
+ `const05` varbinary(3) NOT NULL,
`param05` longblob,
- `const06` varchar(10) NOT NULL DEFAULT '',
+ `const06` varchar(10) NOT NULL,
`param06` longtext,
`const07` date DEFAULT NULL,
`param07` longtext,
- `const08` varchar(19) NOT NULL DEFAULT '',
+ `const08` varchar(19) NOT NULL,
`param08` longtext,
`const09` datetime DEFAULT NULL,
`param09` longtext,
@@ -1788,21 +1789,21 @@ t5 CREATE TABLE `t5` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 3 1 1 N 32769 0 63
+def test t5 t5 const01 const01 3 1 1 N 36865 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 const02 const02 246 4 3 N 36865 1 63
def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
-def test t5 t5 const03 const03 5 17 1 N 32769 31 63
+def test t5 t5 const03 const03 5 17 1 N 36865 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
-def test t5 t5 const04 const04 253 3 3 N 1 0 8
+def test t5 t5 const04 const04 253 3 3 N 4097 0 8
def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
-def test t5 t5 const05 const05 253 3 3 N 129 0 63
+def test t5 t5 const05 const05 253 3 3 N 4225 0 63
def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
+def test t5 t5 const06 const06 253 10 10 N 4097 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
+def test t5 t5 const08 const08 253 19 19 N 4097 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 57532797dd7..bbdb3ea7b23 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -11,7 +11,8 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 varchar(100), c24 varchar(100),
c25 varchar(100), c26 varchar(100), c27 varchar(100), c28 varchar(100),
@@ -50,7 +51,7 @@ test_sequence
prepare stmt1 from ' select * from t9 order by c1 ' ;
execute stmt1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
+def test t9 t9 c1 c1 1 4 1 N 53251 0 63
def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
@@ -1157,9 +1158,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
+def possible_keys 253 4_OR_8_K 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 0 31 8
+def key_len 253 4_OR_8_K 0 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1759,21 +1760,21 @@ NULL as const12, @arg12 as param12,
show create table t5 ;
Table Create Table
t5 CREATE TABLE `t5` (
- `const01` int(1) NOT NULL DEFAULT '0',
+ `const01` int(1) NOT NULL,
`param01` bigint(20) DEFAULT NULL,
- `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `const02` decimal(2,1) NOT NULL,
`param02` decimal(65,30) DEFAULT NULL,
- `const03` double NOT NULL DEFAULT '0',
+ `const03` double NOT NULL,
`param03` double DEFAULT NULL,
- `const04` varchar(3) NOT NULL DEFAULT '',
+ `const04` varchar(3) NOT NULL,
`param04` longtext,
- `const05` varbinary(3) NOT NULL DEFAULT '',
+ `const05` varbinary(3) NOT NULL,
`param05` longblob,
- `const06` varchar(10) NOT NULL DEFAULT '',
+ `const06` varchar(10) NOT NULL,
`param06` longtext,
`const07` date DEFAULT NULL,
`param07` longtext,
- `const08` varchar(19) NOT NULL DEFAULT '',
+ `const08` varchar(19) NOT NULL,
`param08` longtext,
`const09` datetime DEFAULT NULL,
`param09` longtext,
@@ -1789,21 +1790,21 @@ t5 CREATE TABLE `t5` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 3 1 1 N 32769 0 63
+def test t5 t5 const01 const01 3 1 1 N 36865 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 const02 const02 246 4 3 N 36865 1 63
def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
-def test t5 t5 const03 const03 5 17 1 N 32769 31 63
+def test t5 t5 const03 const03 5 17 1 N 36865 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
-def test t5 t5 const04 const04 253 3 3 N 1 0 8
+def test t5 t5 const04 const04 253 3 3 N 4097 0 8
def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
-def test t5 t5 const05 const05 253 3 3 N 129 0 63
+def test t5 t5 const05 const05 253 3 3 N 4225 0 63
def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
+def test t5 t5 const06 const06 253 10 10 N 4097 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
+def test t5 t5 const08 const08 253 19 19 N 4097 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 9a9f457a212..0262c52d948 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -12,7 +12,8 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -32,7 +33,8 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -52,7 +54,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -92,7 +94,7 @@ test_sequence
prepare stmt1 from ' select * from t9 order by c1 ' ;
execute stmt1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
+def test t9 t9 c1 c1 1 4 1 N 53251 0 63
def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
@@ -1199,9 +1201,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
+def possible_keys 253 4_OR_8_K 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 0 31 8
+def key_len 253 4_OR_8_K 0 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1695,21 +1697,21 @@ NULL as const12, @arg12 as param12,
show create table t5 ;
Table Create Table
t5 CREATE TABLE `t5` (
- `const01` int(1) NOT NULL DEFAULT '0',
+ `const01` int(1) NOT NULL,
`param01` bigint(20) DEFAULT NULL,
- `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `const02` decimal(2,1) NOT NULL,
`param02` decimal(65,30) DEFAULT NULL,
- `const03` double NOT NULL DEFAULT '0',
+ `const03` double NOT NULL,
`param03` double DEFAULT NULL,
- `const04` varchar(3) NOT NULL DEFAULT '',
+ `const04` varchar(3) NOT NULL,
`param04` longtext,
- `const05` varbinary(3) NOT NULL DEFAULT '',
+ `const05` varbinary(3) NOT NULL,
`param05` longblob,
- `const06` varchar(10) NOT NULL DEFAULT '',
+ `const06` varchar(10) NOT NULL,
`param06` longtext,
`const07` date DEFAULT NULL,
`param07` longtext,
- `const08` varchar(19) NOT NULL DEFAULT '',
+ `const08` varchar(19) NOT NULL,
`param08` longtext,
`const09` datetime DEFAULT NULL,
`param09` longtext,
@@ -1725,21 +1727,21 @@ t5 CREATE TABLE `t5` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 3 1 1 N 32769 0 63
+def test t5 t5 const01 const01 3 1 1 N 36865 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 const02 const02 246 4 3 N 36865 1 63
def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
-def test t5 t5 const03 const03 5 17 1 N 32769 31 63
+def test t5 t5 const03 const03 5 17 1 N 36865 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
-def test t5 t5 const04 const04 253 3 3 N 1 0 8
+def test t5 t5 const04 const04 253 3 3 N 4097 0 8
def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
-def test t5 t5 const05 const05 253 3 3 N 129 0 63
+def test t5 t5 const05 const05 253 3 3 N 4225 0 63
def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
+def test t5 t5 const06 const06 253 10 10 N 4097 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
+def test t5 t5 const08 const08 253 19 19 N 4097 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
@@ -3406,7 +3408,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -3446,7 +3448,7 @@ test_sequence
prepare stmt1 from ' select * from t9 order by c1 ' ;
execute stmt1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
+def test t9 t9 c1 c1 1 4 1 N 53251 0 63
def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
@@ -4553,9 +4555,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
+def possible_keys 253 4_OR_8_K 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 0 31 8
+def key_len 253 4_OR_8_K 0 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -5049,21 +5051,21 @@ NULL as const12, @arg12 as param12,
show create table t5 ;
Table Create Table
t5 CREATE TABLE `t5` (
- `const01` int(1) NOT NULL DEFAULT '0',
+ `const01` int(1) NOT NULL,
`param01` bigint(20) DEFAULT NULL,
- `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `const02` decimal(2,1) NOT NULL,
`param02` decimal(65,30) DEFAULT NULL,
- `const03` double NOT NULL DEFAULT '0',
+ `const03` double NOT NULL,
`param03` double DEFAULT NULL,
- `const04` varchar(3) NOT NULL DEFAULT '',
+ `const04` varchar(3) NOT NULL,
`param04` longtext,
- `const05` varbinary(3) NOT NULL DEFAULT '',
+ `const05` varbinary(3) NOT NULL,
`param05` longblob,
- `const06` varchar(10) NOT NULL DEFAULT '',
+ `const06` varchar(10) NOT NULL,
`param06` longtext,
`const07` date DEFAULT NULL,
`param07` longtext,
- `const08` varchar(19) NOT NULL DEFAULT '',
+ `const08` varchar(19) NOT NULL,
`param08` longtext,
`const09` datetime DEFAULT NULL,
`param09` longtext,
@@ -5079,21 +5081,21 @@ t5 CREATE TABLE `t5` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 3 1 1 N 32769 0 63
+def test t5 t5 const01 const01 3 1 1 N 36865 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 const02 const02 246 4 3 N 36865 1 63
def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
-def test t5 t5 const03 const03 5 17 1 N 32769 31 63
+def test t5 t5 const03 const03 5 17 1 N 36865 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
-def test t5 t5 const04 const04 253 3 3 N 1 0 8
+def test t5 t5 const04 const04 253 3 3 N 4097 0 8
def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
-def test t5 t5 const05 const05 253 3 3 N 129 0 63
+def test t5 t5 const05 const05 253 3 3 N 4225 0 63
def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
+def test t5 t5 const06 const06 253 10 10 N 4097 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
+def test t5 t5 const08 const08 253 19 19 N 4097 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result
index dec0d12c455..fc1832260c5 100644
--- a/mysql-test/r/ps_ddl.result
+++ b/mysql-test/r/ps_ddl.result
@@ -2542,3 +2542,32 @@ EXECUTE stmt3;
EXECUTE stmt3;
DEALLOCATE PREPARE stmt3;
DROP TEMPORARY TABLES tm, t1;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-10702 Crash in SET STATEMENT FOR EXECUTE
+#
+CREATE TABLE t1 (a INT);
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (@@max_sort_length)';
+SET STATEMENT max_sort_length=2048 FOR EXECUTE stmt;
+SELECT * FROM t1;
+a
+2048
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=NEW.a + 1;
+SET STATEMENT max_sort_length=2048 FOR EXECUTE stmt;
+SELECT * FROM t1;
+a
+2048
+1025
+DROP TRIGGER tr1;
+SET STATEMENT max_sort_length=2048 FOR EXECUTE stmt;
+SELECT * FROM t1;
+a
+2048
+1025
+1024
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 118c6785136..d34c96cd568 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1,4 +1,13 @@
+SET GLOBAL query_cache_type= Off;
+SET LOCAL query_cache_type= Off;
+SET LOCAL query_cache_type= 0;
+SET LOCAL query_cache_type= on;
+ERROR HY000: Query cache is globally disabled and you can't enable it only for this session
+SET LOCAL query_cache_type= 1;
+ERROR HY000: Query cache is globally disabled and you can't enable it only for this session
set GLOBAL query_cache_size=1355776;
+SET GLOBAL query_cache_type= ON;
+SET LOCAL query_cache_type= ON;
flush query cache;
flush query cache;
reset query cache;
@@ -1599,7 +1608,9 @@ show status like 'Qcache_free_blocks';
Variable_name Value
Qcache_free_blocks 0
set global query_cache_size=102400;
-ERROR HY000: Query cache is disabled; set query_cache_type to ON or DEMAND to enable it
+show status like 'Qcache_free_blocks';
+Variable_name Value
+Qcache_free_blocks 1
set global query_cache_type=on;
set session query_cache_type=on;
Restore default values.
@@ -1660,6 +1671,8 @@ set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
set local query_cache_type=default;
+set GLOBAL query_cache_type=on;
+set local query_cache_type=on;
FLUSH STATUS;
SET GLOBAL query_cache_size=10*1024*1024;
SET @save_concurrent_insert= @@concurrent_insert;
diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result
index a98550193be..b3070761d9c 100644
--- a/mysql-test/r/query_cache_debug.result
+++ b/mysql-test/r/query_cache_debug.result
@@ -1,3 +1,4 @@
+set global query_cache_type= ON;
flush status;
set query_cache_type=DEMAND;
set global query_cache_size= 1024*768;
diff --git a/mysql-test/r/query_cache_merge.result b/mysql-test/r/query_cache_merge.result
index c324df65f77..e31ab05b396 100644
--- a/mysql-test/r/query_cache_merge.result
+++ b/mysql-test/r/query_cache_merge.result
@@ -1,3 +1,5 @@
+SET GLOBAL query_cache_type=ON;
+SET LOCAL query_cache_type=ON;
SET @@global.query_cache_size=1355776;
flush status;
select count(*) from t00;
@@ -1690,6 +1692,7 @@ DROP TABLE t4;
DROP TABLE t3;
DROP TABLE t2;
DROP TABLE t1;
-SET @@global.query_cache_size = 0;
+SET @@global.query_cache_size = default;
SET @@global.table_definition_cache = @save_table_definition_cache;
+SET GLOBAL query_cache_type=default;
End of 5.1 tests
diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result
index f2021f9d2e7..400ac2b2718 100644
--- a/mysql-test/r/query_cache_notembedded.result
+++ b/mysql-test/r/query_cache_notembedded.result
@@ -1,4 +1,8 @@
-set GLOBAL query_cache_size=1355776;
+set @sql_mode_save=@@global.sql_mode;
+set @query_cache_type_save=@@global.query_cache_type;
+set @query_cache_size_save=@@global.query_cache_size;
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
flush query cache;
flush query cache;
reset query cache;
@@ -379,7 +383,8 @@ Qcache_queries_in_cache 1
USE test;
DROP DATABASE bug30269;
DROP USER 'bug30269'@'localhost';
-set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
@@ -435,3 +440,6 @@ flush query cache|
delete from t1|
drop procedure bug3583|
drop table t1|
+SET GLOBAL query_cache_size=@query_cache_size_save;
+SET GLOBAL query_cache_type=@query_cache_type_save;
+set GLOBAL sql_mode=@sql_mode_save;
diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result
index 02e660450d1..5076003a7fb 100644
--- a/mysql-test/r/query_cache_ps_no_prot.result
+++ b/mysql-test/r/query_cache_ps_no_prot.result
@@ -1,3 +1,5 @@
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
---- establish connection con1 (root) ----
---- switch to connection default ----
set @initial_query_cache_size = @@global.query_cache_size;
@@ -572,3 +574,4 @@ deallocate prepare stmt;
drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result
index 2115ecc62ff..4105bc40f94 100644
--- a/mysql-test/r/query_cache_ps_ps_prot.result
+++ b/mysql-test/r/query_cache_ps_ps_prot.result
@@ -1,3 +1,5 @@
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
---- establish connection con1 (root) ----
---- switch to connection default ----
set @initial_query_cache_size = @@global.query_cache_size;
@@ -572,3 +574,4 @@ deallocate prepare stmt;
drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/r/query_cache_with_views.result b/mysql-test/r/query_cache_with_views.result
index 7f0417a60c7..763113dbac3 100644
--- a/mysql-test/r/query_cache_with_views.result
+++ b/mysql-test/r/query_cache_with_views.result
@@ -1,5 +1,7 @@
drop table if exists t1,t2,v1,v2,v3;
drop view if exists t1,t2,v1,v2,v3;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
flush status;
create table t1 (a int, b int);
@@ -207,3 +209,4 @@ DROP TABLE t2;
DROP VIEW t1_view;
SET AUTOCOMMIT=DEFAULT;
set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 51e4e313eac..5adb8225b38 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -618,10 +618,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 11 const 2 Using index condition
explain select * from t1 where a=binary 'aaa';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 11 NULL 2 Using index condition
+1 SIMPLE t1 ref a a 11 const 2 Using index condition
explain select * from t1 where a='aaa' collate latin1_bin;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 11 NULL 2 Using index condition
+1 SIMPLE t1 ref a a 11 const 2 Using index condition
explain select * from t1 where a='aaa' collate latin1_german1_ci;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where
@@ -2240,3 +2240,95 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range a a 5 NULL 1 Using where; Using index
drop table t1,t2,t3;
+#
+# MDEV-6480: Remove conditions for which range optimizer returned SEL_ARG::IMPOSSIBLE.
+#
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, b int, c int, key(a), key(b));
+insert into t2
+select
+A.a + B.a* 10 + C.a * 100,
+A.a + B.a* 10 + C.a * 100,
+12345
+from
+t1 A, t1 B, t1 C;
+# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where (b > 25 and b < 15) or a<44;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
+# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where a < 44 or (b > 25 and b < 15);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
+# Here, conditions b will not be removed, because "c<44" is not sargable
+# and hence (b.. and .. b) part is not analyzed at all:
+explain extended select * from t2 where c < 44 or (b > 25 and b < 15);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44) or ((`test`.`t2`.`b` > 25) and (`test`.`t2`.`b` < 15)))
+# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where (b > 25 and b < 15) or c < 44;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44))
+# Try a case where both OR parts produce SEL_ARG::IMPOSSIBLE:
+explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 0
+drop table t1,t2;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8189 field<>const and const<>field are not symmetric
+#
+CREATE TABLE t1 (a INT, b INT, KEY(a));
+INSERT INTO t1 (a) VALUES (10),(10),(10),(10),(10),(10),(10),(10),(10),(10),(70);
+EXPLAIN SELECT * FROM t1 WHERE a<>10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 3 Using index condition
+EXPLAIN SELECT * FROM t1 WHERE 10<>a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 3 Using index condition
+SELECT * FROM t1 WHERE a<>10;
+a b
+70 NULL
+SELECT * FROM t1 WHERE 10<>a;
+a b
+70 NULL
+DROP TABLE t1;
+#
+# MDEV-8613 Full table scan for WHERE indexed_varchar_column <=> 'bad-character'
+#
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e');
+EXPLAIN SELECT * FROM t1 WHERE a<=>'😎';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1
+DROP TABLE t1;
+#
+# MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in
+# sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*)
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5;
+pk
+1
+2
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result
index 16c0825b2e2..4ef7c0b658c 100644
--- a/mysql-test/r/range_mrr_icp.result
+++ b/mysql-test/r/range_mrr_icp.result
@@ -620,10 +620,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 11 const 2 Using index condition
explain select * from t1 where a=binary 'aaa';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 11 NULL 2 Using index condition; Rowid-ordered scan
+1 SIMPLE t1 ref a a 11 const 2 Using index condition
explain select * from t1 where a='aaa' collate latin1_bin;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 11 NULL 2 Using index condition; Rowid-ordered scan
+1 SIMPLE t1 ref a a 11 const 2 Using index condition
explain select * from t1 where a='aaa' collate latin1_german1_ci;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where
@@ -2242,4 +2242,96 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range a a 5 NULL 1 Using where; Using index
drop table t1,t2,t3;
+#
+# MDEV-6480: Remove conditions for which range optimizer returned SEL_ARG::IMPOSSIBLE.
+#
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, b int, c int, key(a), key(b));
+insert into t2
+select
+A.a + B.a* 10 + C.a * 100,
+A.a + B.a* 10 + C.a * 100,
+12345
+from
+t1 A, t1 B, t1 C;
+# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where (b > 25 and b < 15) or a<44;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition; Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
+# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where a < 44 or (b > 25 and b < 15);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition; Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
+# Here, conditions b will not be removed, because "c<44" is not sargable
+# and hence (b.. and .. b) part is not analyzed at all:
+explain extended select * from t2 where c < 44 or (b > 25 and b < 15);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44) or ((`test`.`t2`.`b` > 25) and (`test`.`t2`.`b` < 15)))
+# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where (b > 25 and b < 15) or c < 44;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44))
+# Try a case where both OR parts produce SEL_ARG::IMPOSSIBLE:
+explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 0
+drop table t1,t2;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8189 field<>const and const<>field are not symmetric
+#
+CREATE TABLE t1 (a INT, b INT, KEY(a));
+INSERT INTO t1 (a) VALUES (10),(10),(10),(10),(10),(10),(10),(10),(10),(10),(70);
+EXPLAIN SELECT * FROM t1 WHERE a<>10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 3 Using index condition; Rowid-ordered scan
+EXPLAIN SELECT * FROM t1 WHERE 10<>a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 3 Using index condition; Rowid-ordered scan
+SELECT * FROM t1 WHERE a<>10;
+a b
+70 NULL
+SELECT * FROM t1 WHERE 10<>a;
+a b
+70 NULL
+DROP TABLE t1;
+#
+# MDEV-8613 Full table scan for WHERE indexed_varchar_column <=> 'bad-character'
+#
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e');
+EXPLAIN SELECT * FROM t1 WHERE a<=>'😎';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1
+DROP TABLE t1;
+#
+# MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in
+# sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*)
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5;
+pk
+1
+2
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
set optimizer_switch=@mrr_icp_extra_tmp;
diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result
index ee35549eb78..0640360f4f5 100644
--- a/mysql-test/r/read_only.result
+++ b/mysql-test/r/read_only.result
@@ -1,11 +1,13 @@
set @start_read_only= @@global.read_only;
DROP TABLE IF EXISTS t1,t2,t3;
+create user test@localhost;
grant CREATE, SELECT, DROP on *.* to test@localhost;
connect (con1,localhost,test,,test);
connection default;
set global read_only=0;
connection con1;
create table t1 (a int);
+create trigger trg1 before insert on t1 for each row set @a:=1;
insert into t1 values(1);
create table t2 select * from t1;
connection default;
@@ -20,6 +22,8 @@ create table t3 (a int);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
insert into t1 values(1);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+drop trigger trg1;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
update t1 set a=1 where 1=0;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
update t1,t2 set t1.a=t2.a+1 where t1.a=t2.a;
@@ -141,6 +145,7 @@ delete from mysql.db where User like 'mysqltest_%';
delete from mysql.tables_priv where User like 'mysqltest_%';
delete from mysql.columns_priv where User like 'mysqltest_%';
flush privileges;
+create user `mysqltest_u1`@`%`;
grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
create database mysqltest_db1;
grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
diff --git a/mysql-test/r/read_only_innodb.result b/mysql-test/r/read_only_innodb.result
index 1e041395d3c..a276e6cbc19 100644
--- a/mysql-test/r/read_only_innodb.result
+++ b/mysql-test/r/read_only_innodb.result
@@ -1,4 +1,5 @@
DROP TABLE IF EXISTS table_11733 ;
+create user test@localhost;
grant CREATE, SELECT, DROP on *.* to test@localhost;
set global read_only=0;
create table table_11733 (a int) engine=InnoDb;
@@ -16,6 +17,7 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can
set global read_only=0;
drop table table_11733 ;
drop user test@localhost;
+create user test@localhost;
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
CREATE TABLE t1(a INT) ENGINE=INNODB;
INSERT INTO t1 VALUES (0), (1);
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result
index ed4722d40fb..8d48d2f8848 100644
--- a/mysql-test/r/repair.result
+++ b/mysql-test/r/repair.result
@@ -126,7 +126,7 @@ id
# Run CHECK TABLE, it should indicate table need a REPAIR TABLE
CHECK TABLE t1 FOR UPGRADE;
Table Op Msg_type Msg_text
-test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+test.t1 check error Upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
# REPAIR old table USE_FRM should fail
REPAIR TABLE t1 USE_FRM;
Table Op Msg_type Msg_text
diff --git a/mysql-test/r/repair_symlink-5543.result b/mysql-test/r/repair_symlink-5543.result
index 051c9ca3472..c77e7162a51 100644
--- a/mysql-test/r/repair_symlink-5543.result
+++ b/mysql-test/r/repair_symlink-5543.result
@@ -1,14 +1,18 @@
create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR';
insert t1 values (1);
+# Some systems fail with errcode 40, when doing openat, while others
+# don't have openat and fail with errcode 20.
repair table t1;
Table Op Msg_type Msg_text
-test.t1 repair error Can't create new tempfile: 'MYSQL_TMP_DIR/t1.TMD'
+test.t1 repair error 20 for record at pos 0
+test.t1 repair Error File 'MYSQL_TMP_DIR/t1.MYD' not found (Errcode: 20 "<errmsg>")
test.t1 repair status Operation failed
drop table t1;
create table t2 (a int) engine=aria data directory='MYSQL_TMP_DIR';
insert t2 values (1);
repair table t2;
Table Op Msg_type Msg_text
-test.t2 repair error Can't create new tempfile: 'MYSQL_TMP_DIR/t2.TMD'
+test.t2 repair error 20 for record at pos 256
+test.t2 repair Error File 'MYSQL_TMP_DIR/t2.MAD' not found (Errcode: 20 "<errmsg>")
test.t2 repair status Operation failed
drop table t2;
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index f94c958a1be..9a19c3b0604 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -50,6 +50,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))`
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)));
+row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)))
+0
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)));
+row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)))
+NULL
SELECT (1,2,3)=(0,NULL,3);
(1,2,3)=(0,NULL,3)
0
@@ -130,7 +136,7 @@ ROW(c,2,3) IN(row(1,b,a), row(2,3,1))
0
0
1
-NULL
+0
select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1;
ROW(a,b,c) IN(row(1,2,3), row(3,2,1))
1
@@ -489,3 +495,31 @@ SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
i
DROP TABLE t1;
End of 5.1 tests
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8709 Row equality elements do not get propagated
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (10,10),(20,20);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10))
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10))
+DROP TABLE t1;
+#
+# MDEV-9369 IN operator with ( num, NULL ) gives inconsistent result
+#
+SELECT (1,null) NOT IN ((2,2),(3,3)), (1,null) NOT IN ((2,2)), (1,null) NOT IN ((3,3));
+(1,null) NOT IN ((2,2),(3,3)) (1,null) NOT IN ((2,2)) (1,null) NOT IN ((3,3))
+1 1 1
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 8d5ee08e44e..787e321dd57 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2111,7 +2111,7 @@ INSERT INTO t1 (pseudo) VALUES ('test1');
SELECT 1 as rnd1 from t1 where rand() > 2;
rnd1
DROP TABLE t1;
-CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
+CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
@@ -2956,7 +2956,7 @@ insert into t1 values (1,'x',5);
select * from t1 natural join v1;
s1 s2 s3
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DECIMAL value: 'x'
drop table t1;
drop view v1;
create table t1(a1 int);
@@ -3742,7 +3742,7 @@ WHERE ID_better=1 AND ID1_with_null IS NULL AND
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
DROP TABLE t1;
-CREATE TABLE t1 (a INT, ts TIMESTAMP, KEY ts(ts));
+CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts));
INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00");
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
@@ -3784,9 +3784,9 @@ coalesce(9223372036854775808, 1) co;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` decimal(19,0) NOT NULL DEFAULT '0',
- `c` decimal(19,0) NOT NULL DEFAULT '0',
- `co` decimal(19,0) NOT NULL DEFAULT '0'
+ `i` decimal(19,0) NOT NULL,
+ `c` decimal(19,0) NOT NULL,
+ `co` decimal(19,0) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
@@ -4483,7 +4483,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select '2001-01-01' AS `a` from dual where 1
DROP TABLE t1;
-CREATE TABLE t1(a TIMESTAMP NOT NULL);
+CREATE TABLE t1(a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES('2001-01-01');
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
a
@@ -5302,7 +5302,6 @@ f1
Warnings:
Warning 1292 Incorrect datetime value: 'zz'
Warning 1292 Incorrect datetime value: 'aa'
-Warning 1292 Incorrect datetime value: 'zz'
SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ;
f1
0000-00-00
diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result
index db7f2c473a8..10d8a05ad40 100644
--- a/mysql-test/r/select_jcl6.result
+++ b/mysql-test/r/select_jcl6.result
@@ -2122,7 +2122,7 @@ INSERT INTO t1 (pseudo) VALUES ('test1');
SELECT 1 as rnd1 from t1 where rand() > 2;
rnd1
DROP TABLE t1;
-CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
+CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
@@ -2967,7 +2967,7 @@ insert into t1 values (1,'x',5);
select * from t1 natural join v1;
s1 s2 s3
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DECIMAL value: 'x'
drop table t1;
drop view v1;
create table t1(a1 int);
@@ -3753,7 +3753,7 @@ WHERE ID_better=1 AND ID1_with_null IS NULL AND
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
DROP TABLE t1;
-CREATE TABLE t1 (a INT, ts TIMESTAMP, KEY ts(ts));
+CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts));
INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00");
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
@@ -3795,9 +3795,9 @@ coalesce(9223372036854775808, 1) co;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` decimal(19,0) NOT NULL DEFAULT '0',
- `c` decimal(19,0) NOT NULL DEFAULT '0',
- `co` decimal(19,0) NOT NULL DEFAULT '0'
+ `i` decimal(19,0) NOT NULL,
+ `c` decimal(19,0) NOT NULL,
+ `co` decimal(19,0) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
@@ -4494,7 +4494,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select '2001-01-01' AS `a` from dual where 1
DROP TABLE t1;
-CREATE TABLE t1(a TIMESTAMP NOT NULL);
+CREATE TABLE t1(a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES('2001-01-01');
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
a
@@ -5313,7 +5313,6 @@ f1
Warnings:
Warning 1292 Incorrect datetime value: 'zz'
Warning 1292 Incorrect datetime value: 'aa'
-Warning 1292 Incorrect datetime value: 'zz'
SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ;
f1
0000-00-00
diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result
index 8d5ee08e44e..787e321dd57 100644
--- a/mysql-test/r/select_pkeycache.result
+++ b/mysql-test/r/select_pkeycache.result
@@ -2111,7 +2111,7 @@ INSERT INTO t1 (pseudo) VALUES ('test1');
SELECT 1 as rnd1 from t1 where rand() > 2;
rnd1
DROP TABLE t1;
-CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
+CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
@@ -2956,7 +2956,7 @@ insert into t1 values (1,'x',5);
select * from t1 natural join v1;
s1 s2 s3
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DECIMAL value: 'x'
drop table t1;
drop view v1;
create table t1(a1 int);
@@ -3742,7 +3742,7 @@ WHERE ID_better=1 AND ID1_with_null IS NULL AND
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
DROP TABLE t1;
-CREATE TABLE t1 (a INT, ts TIMESTAMP, KEY ts(ts));
+CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts));
INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00");
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
@@ -3784,9 +3784,9 @@ coalesce(9223372036854775808, 1) co;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` decimal(19,0) NOT NULL DEFAULT '0',
- `c` decimal(19,0) NOT NULL DEFAULT '0',
- `co` decimal(19,0) NOT NULL DEFAULT '0'
+ `i` decimal(19,0) NOT NULL,
+ `c` decimal(19,0) NOT NULL,
+ `co` decimal(19,0) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
@@ -4483,7 +4483,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select '2001-01-01' AS `a` from dual where 1
DROP TABLE t1;
-CREATE TABLE t1(a TIMESTAMP NOT NULL);
+CREATE TABLE t1(a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES('2001-01-01');
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
a
@@ -5302,7 +5302,6 @@ f1
Warnings:
Warning 1292 Incorrect datetime value: 'zz'
Warning 1292 Incorrect datetime value: 'aa'
-Warning 1292 Incorrect datetime value: 'zz'
SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ;
f1
0000-00-00
diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result
index 61a77d135e7..01847006928 100644
--- a/mysql-test/r/selectivity.result
+++ b/mysql-test/r/selectivity.result
@@ -1298,10 +1298,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
a b c d a b
-1495 89366 89366 28296 28296 3
-961 24512 24512 85239 85239 4
1063 89366 89366 28296 28296 3
+1495 89366 89366 28296 28296 3
221 56120 56120 28296 28296 3
+961 24512 24512 85239 85239 4
set optimizer_use_condition_selectivity=3;
explain extended
select * from t1, t2, t1 as t3
@@ -1315,10 +1315,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
a b c d a b
-961 24512 24512 85239 85239 4
-1495 89366 89366 28296 28296 3
1063 89366 89366 28296 28296 3
+1495 89366 89366 28296 28296 3
221 56120 56120 28296 28296 3
+961 24512 24512 85239 85239 4
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
drop table t1,t2;
set histogram_type=@save_histogram_type;
@@ -1412,16 +1412,10 @@ drop table t0,t1,t2;
#
# Bug mdev-7316: a conjunct in WHERE with selectivity == 0
#
-CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB;
-Warnings:
-Warning 1286 Unknown storage engine 'INNODB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b));
INSERT INTO t1 VALUES
('USAChinese',10), ('USAEnglish',20), ('USAFrench',30);
-CREATE TABLE t2 (i int) ENGINE=INNODB;
-Warnings:
-Warning 1286 Unknown storage engine 'INNODB'
-Warning 1266 Using storage engine MyISAM for table 't2'
+CREATE TABLE t2 (i int);
INSERT INTO t2 VALUES
(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4);
ANALYZE TABLE t1, t2;
@@ -1487,6 +1481,7 @@ insert into t2 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze Warning Engine-independent statistics are not collected for column 'col1'
test.t2 analyze status OK
select * from t1 where col1 > 'b' and col1 < 'd';
col1
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result
index a026c2e6d92..070cc49ca7f 100644
--- a/mysql-test/r/selectivity_innodb.result
+++ b/mysql-test/r/selectivity_innodb.result
@@ -1308,10 +1308,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
a b c d a b
-1495 89366 89366 28296 28296 3
-961 24512 24512 85239 85239 4
1063 89366 89366 28296 28296 3
+1495 89366 89366 28296 28296 3
221 56120 56120 28296 28296 3
+961 24512 24512 85239 85239 4
set optimizer_use_condition_selectivity=3;
explain extended
select * from t1, t2, t1 as t3
@@ -1325,10 +1325,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
a b c d a b
-961 24512 24512 85239 85239 4
-1495 89366 89366 28296 28296 3
1063 89366 89366 28296 28296 3
+1495 89366 89366 28296 28296 3
221 56120 56120 28296 28296 3
+961 24512 24512 85239 85239 4
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
drop table t1,t2;
set histogram_type=@save_histogram_type;
@@ -1422,10 +1422,10 @@ drop table t0,t1,t2;
#
# Bug mdev-7316: a conjunct in WHERE with selectivity == 0
#
-CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB;
+CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b));
INSERT INTO t1 VALUES
('USAChinese',10), ('USAEnglish',20), ('USAFrench',30);
-CREATE TABLE t2 (i int) ENGINE=INNODB;
+CREATE TABLE t2 (i int);
INSERT INTO t2 VALUES
(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4);
ANALYZE TABLE t1, t2;
@@ -1491,6 +1491,7 @@ insert into t2 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze Warning Engine-independent statistics are not collected for column 'col1'
test.t2 analyze status OK
select * from t1 where col1 > 'b' and col1 < 'd';
col1
@@ -1653,6 +1654,7 @@ INSERT INTO t2 VALUES ('foo'),('bar'),('qux');
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze Warning Engine-independent statistics are not collected for column 'f1'
test.t2 analyze status OK
SELECT * FROM t2 WHERE f1 <> 'qux';
f1
@@ -1668,6 +1670,26 @@ DROP TABLE t1,t2;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-11060: sql/protocol.cc:532: void Protocol::end_statement(): Assertion `0' failed
+#
+set optimizer_use_condition_selectivity=4;
+drop view if exists v1;
+create table t1 (a int not null, b int, c int) engine=InnoDB;
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+create table t2 (d int, e int) engine=InnoDB;
+update t1, t2 set a=NULL, b=2, c=NULL where b=d and e=200;
+create view v1 as select * from t1, t2 where d=2;
+insert v1 (a,c) values (NULL, 20);
+ERROR 23000: Column 'a' cannot be null
+drop table t1,t2;
+drop view v1;
+#
+# End of 10.1 tests
+#
set use_stat_tables= @tmp_ust;
set optimizer_use_condition_selectivity= @tmp_oucs;
SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/r/servers.result b/mysql-test/r/servers.result
index c9d82c9cfcc..585f0f62af0 100644
--- a/mysql-test/r/servers.result
+++ b/mysql-test/r/servers.result
@@ -1,8 +1,26 @@
+set sql_mode="";
#
# MDEV-4594 - CREATE SERVER crashes embedded
#
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(HOST 'localhost');
SELECT * FROM mysql.servers;
Server_name Host Db Username Password Port Socket Wrapper Owner
-s1 localhost 0 mysql
+s1 localhost 3306 mysql
+DROP SERVER s1;
+CREATE SERVER s1 FOREIGN DATA WRAPPER foo OPTIONS(USER 'bar');
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 bar 0 foo
+DROP SERVER s1;
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(USER 'bar');
+ERROR HY000: Can't create federated table. Foreign data src error: either HOST or SOCKET must be set
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(HOST 'bar');
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 bar 3306 mysql
+DROP SERVER s1;
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(SOCKET 'bar');
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 3306 bar mysql
DROP SERVER s1;
diff --git a/mysql-test/r/set_password_plugin-9835.result b/mysql-test/r/set_password_plugin-9835.result
index e9ee09fe952..3cc723957d8 100644
--- a/mysql-test/r/set_password_plugin-9835.result
+++ b/mysql-test/r/set_password_plugin-9835.result
@@ -1,3 +1,4 @@
+set global secure_auth=0;
create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
create user newpassnat@localhost identified via 'mysql_native_password';
@@ -8,10 +9,10 @@ create user oldpassold@localhost identified with 'mysql_old_password';
set password for oldpassold@localhost = '378b243e220ca493';
select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
user host password plugin authentication_string
-natauth localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
newpassnat localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
-oldauth localhost mysql_old_password 378b243e220ca493
+oldauth localhost 378b243e220ca493
oldpass localhost 378b243e220ca493
oldpassold localhost 378b243e220ca493
connect con,localhost,natauth,test,;
@@ -156,3 +157,4 @@ disconnect con;
connection default;
drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
+set global secure_auth=default;
diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result
new file mode 100644
index 00000000000..adb50afde99
--- /dev/null
+++ b/mysql-test/r/set_statement.result
@@ -0,0 +1,1223 @@
+'# SET STATEMENT ..... FOR .... TEST'
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS myProc;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+DROP PROCEDURE IF EXISTS p5;
+DROP PROCEDURE IF EXISTS p6;
+DROP VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS STATEMENT;
+SET @save_binlog_format = @@binlog_format;
+SET @save_keep_files_on_create = @@keep_files_on_create;
+SET @save_max_join_size = @@max_join_size;
+SET @save_myisam_repair_threads = @@myisam_repair_threads;
+SET @save_myisam_sort_buffer_size = @@myisam_sort_buffer_size;
+SET @save_sort_buffer_size = @@sort_buffer_size;
+'# Setup database'
+CREATE TABLE t1 (v1 INT, v2 INT);
+INSERT INTO t1 VALUES (1,2);
+INSERT INTO t1 VALUES (3,4);
+''
+'#------------------ STATEMENT Test 1 -----------------------#'
+'# Initialize variables to known setting'
+SET SESSION sort_buffer_size=100000;
+''
+'# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 100000
+SET STATEMENT sort_buffer_size=150000 FOR SELECT *,@@sort_buffer_size FROM t1;
+v1 v2 @@sort_buffer_size
+1 2 150000
+3 4 150000
+''
+'# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 100000
+''
+'#------------------ STATEMENT Test 2 -----------------------#'
+'# Initialize variables to known setting'
+SET SESSION binlog_format=mixed;
+SET SESSION sort_buffer_size=100000;
+'# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 100000
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format MIXED
+SET STATEMENT sort_buffer_size=150000, binlog_format=row
+FOR SELECT *,@@sort_buffer_size,@@binlog_format FROM t1;
+v1 v2 @@sort_buffer_size @@binlog_format
+1 2 150000 ROW
+3 4 150000 ROW
+'# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 100000
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format MIXED
+''
+'#------------------ STATEMENT Test 3 -----------------------#'
+'# set initial variable value, make prepared statement
+SET SESSION binlog_format=row;
+PREPARE stmt1 FROM 'SET STATEMENT binlog_format=row FOR SELECT *,@@binlog_format FROM t1';
+''
+'# Change variable setting'
+SET SESSION binlog_format=mixed;
+''
+'# Pre-STATEMENT variable value'
+''
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format MIXED
+''
+EXECUTE stmt1;
+v1 v2 @@binlog_format
+1 2 ROW
+3 4 ROW
+''
+'# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format MIXED
+''
+DEALLOCATE PREPARE stmt1;
+'#------------------ STATEMENT Test 4 -----------------------#'
+'# set initial variable value, make prepared statement
+SET SESSION myisam_sort_buffer_size=500000, myisam_repair_threads=1;
+''
+'# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'myisam_sort_buffer_size';
+Variable_name Value
+myisam_sort_buffer_size 500000
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+Variable_name Value
+myisam_repair_threads 1
+''
+SET STATEMENT myisam_sort_buffer_size=800000,
+myisam_repair_threads=2 FOR OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+''
+'# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'myisam_sort_buffer_size';
+Variable_name Value
+myisam_sort_buffer_size 500000
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+Variable_name Value
+myisam_repair_threads 1
+''
+'#------------------ STATEMENT Test 5 -----------------------#'
+'# Initialize variables to known setting'
+SET SESSION sort_buffer_size=100000;
+''
+'# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 100000
+''
+SET STATEMENT sort_buffer_size=150000 FOR SELECT * FROM t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+''
+'# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 100000
+''
+'#------------------ STATEMENT Test 6 -----------------------#'
+'# Initialize variables to known setting'
+SET SESSION keep_files_on_create=ON;
+''
+'# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+Variable_name Value
+keep_files_on_create ON
+''
+SET STATEMENT keep_files_on_create=OFF FOR SELECT *,@@keep_files_on_create FROM t1;
+v1 v2 @@keep_files_on_create
+1 2 0
+3 4 0
+''
+'# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+Variable_name Value
+keep_files_on_create ON
+''
+'#------------------ STATEMENT Test 7 -----------------------#'
+'# Initialize variables to known setting'
+SET SESSION max_join_size=2222220000000;
+''
+'# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+Variable_name Value
+max_join_size 2222220000000
+''
+SET STATEMENT max_join_size=1000000000000 FOR SELECT *,@@max_join_size FROM t1;
+v1 v2 @@max_join_size
+1 2 1000000000000
+3 4 1000000000000
+''
+'# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+Variable_name Value
+max_join_size 2222220000000
+''
+'#------------------Test 8-----------------------#'
+'# Initialize test variables'
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size = 200000,
+max_join_size=2222220000000,
+keep_files_on_create=ON;
+''
+'# LONG '
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 200000
+SET STATEMENT sort_buffer_size = 100000
+FOR SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 100000
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+Variable_name Value
+sort_buffer_size 200000
+''
+'# MY_BOOL '
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+Variable_name Value
+keep_files_on_create ON
+SET STATEMENT keep_files_on_create=OFF
+FOR SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+Variable_name Value
+keep_files_on_create OFF
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+Variable_name Value
+keep_files_on_create ON
+''
+'# INT/LONG '
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+Variable_name Value
+myisam_repair_threads 1
+SET STATEMENT myisam_repair_threads=2
+FOR SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+Variable_name Value
+myisam_repair_threads 2
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+Variable_name Value
+myisam_repair_threads 1
+''
+'# ULONGLONG '
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+Variable_name Value
+max_join_size 2222220000000
+SET STATEMENT max_join_size=2000000000000
+FOR SHOW SESSION VARIABLES LIKE 'max_join_size';
+Variable_name Value
+max_join_size 2000000000000
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+Variable_name Value
+max_join_size 2222220000000
+''
+'#------------------Test 9-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+CREATE FUNCTION myProc (cost DECIMAL(10,2))
+RETURNS DECIMAL(10,2)
+SQL SECURITY DEFINER
+tax: BEGIN
+DECLARE order_tax DECIMAL(10,2);
+SET order_tax = cost * .05 + @@sort_buffer_size;
+RETURN order_tax;
+END|
+''
+'# During Execution values
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+SELECT myProc(123.45);
+myProc(123.45)
+200006.17
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=300000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+SELECT myProc(123.45);
+myProc(123.45)
+300006.17
+''
+'# Post-STATEMENT No 1 variable value Pre-STATEMENT for No 2'
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+DROP FUNCTION myProc;
+''
+'# Post-STATEMENT No 2 variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+'#------------------Test 11-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+PREPARE stmt1 FROM
+'SET STATEMENT binlog_format=row FOR SELECT *,@@binlog_format,@@sort_buffer_size FROM t1';
+''
+'Test No 1 Post Value & Test 2 Pre values'
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+EXECUTE stmt1;
+v1 v2 @@binlog_format @@sort_buffer_size
+1 2 ROW 200000
+3 4 ROW 200000
+''
+'# Post-STATEMENT No 2
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+'#------------------Test 12-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+CREATE PROCEDURE p1() BEGIN
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+END|
+''
+'Test No 1 Post Value & Test 2 Pre values'
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400001,
+myisam_repair_threads=3,
+sort_buffer_size=200001,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000001 FOR
+CALL p1();
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+400001 3 200001 ROW 0 4444440000001
+''
+'# Post-STATEMENT No 2
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+'#------------------Test 13-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+''
+CREATE PROCEDURE p2() BEGIN
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=3,
+sort_buffer_size=300000,
+binlog_format=mixed,
+keep_files_on_create=OFF,
+max_join_size=3333330000000 FOR
+CALL p1();
+END|
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+CALL p2();
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+400000 3 300000 MIXED 0 3333330000000
+''
+'# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+'#------------------Test 14-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+''
+CREATE PROCEDURE p3() BEGIN
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+SET STATEMENT myisam_sort_buffer_size=320000,
+myisam_repair_threads=2,
+sort_buffer_size=220022,
+binlog_format=row,
+keep_files_on_create=ON,
+max_join_size=2222220000000 FOR
+CALL p2();
+END|
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+CALL p3();
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+400000 2 200000 ROW 0 4444440000000
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+400000 3 300000 MIXED 0 3333330000000
+''
+'# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+''
+''
+'#------------------Test 15-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+''
+CREATE PROCEDURE p4() BEGIN
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+SET STATEMENT myisam_sort_buffer_size=320000,
+myisam_repair_threads=2,
+sort_buffer_size=220022,
+binlog_format=row,
+keep_files_on_create=ON,
+max_join_size=2222220000000 FOR
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+SET STATEMENT myisam_sort_buffer_size=320000,
+myisam_repair_threads=2,
+sort_buffer_size=220022,
+binlog_format=row,
+keep_files_on_create=ON,
+max_join_size=2222220000000 FOR
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+SET STATEMENT myisam_sort_buffer_size=320000,
+myisam_repair_threads=2,
+sort_buffer_size=220022,
+binlog_format=row,
+keep_files_on_create=ON,
+max_join_size=2222220000000 FOR
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+END|
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+CALL p4();
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+400000 2 200000 ROW 0 4444440000000
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+320000 2 220022 ROW 1 2222220000000
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+320000 2 220022 ROW 1 2222220000000
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+320000 2 220022 ROW 1 2222220000000
+''
+'# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+'#------------------Test 16-----------------------#'
+''
+'# Pre-STATEMENT variable value
+SELECT @@sql_mode;
+@@sql_mode
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+''
+''
+SET STATEMENT sql_mode='ansi' FOR PREPARE stmt FROM 'SELECT "t1".* FROM t1';
+execute stmt;
+v1 v2
+1 2
+3 4
+ALTER TABLE t1 ADD COLUMN v3 int;
+execute stmt;
+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 '.* FROM t1' at line 1
+ALTER TABLE t1 drop COLUMN v3;
+deallocate prepare stmt;
+''
+'# Post-STATEMENT
+SELECT @@sql_mode;
+@@sql_mode
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+check the same behaviour in normal set
+SET sql_mode='ansi';
+PREPARE stmt FROM 'SELECT "t1".* FROM t1';
+SET sql_mode=default;
+execute stmt;
+v1 v2
+1 2
+3 4
+ALTER TABLE t1 ADD COLUMN v3 int;
+execute stmt;
+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 '.* FROM t1' at line 1
+ALTER TABLE t1 drop COLUMN v3;
+deallocate prepare stmt;
+SELECT @@sql_mode;
+@@sql_mode
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+SET sql_mode='ansi';
+SELECT @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+CREATE PROCEDURE p6() BEGIN
+SELECT @@sql_mode;
+SELECT "t1".* FROM t1;
+END|
+SET sql_mode=default;
+call p6;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+v1 v2
+1 2
+3 4
+ALTER TABLE t1 ADD COLUMN v3 int;
+create view v1 as select * from t1;
+drop view v1;
+call p6;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+v1 v2 v3
+1 2 NULL
+3 4 NULL
+ALTER TABLE t1 drop COLUMN v3;
+drop procedure p6;
+SELECT @@sql_mode;
+@@sql_mode
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+# SET and the statement parsed as one unit before the SET takes effect
+SET STATEMENT sql_mode='ansi' FOR
+CREATE PROCEDURE p6() BEGIN
+SELECT @@sql_mode;
+SELECT "t1".* FROM t1;
+END|
+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 '.* FROM t1;
+END' at line 4
+SELECT @@sql_mode;
+@@sql_mode
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+SET sql_mode='ansi';
+SELECT @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+BEGIN NOT ATOMIC
+SELECT @@sql_mode;
+SELECT "t1".* FROM t1;
+END|
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+v1 v2
+1 2
+3 4
+SET sql_mode=default;
+SELECT @@sql_mode;
+@@sql_mode
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+# SET and the statement parsed as one unit before the SET takes effect
+SET STATEMENT sql_mode='ansi' FOR
+BEGIN NOT ATOMIC
+SELECT @@sql_mode;
+SELECT "t1".* FROM t1;
+END|
+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 '.* FROM t1;
+END' at line 4
+SET STATEMENT sql_mode='ansi' FOR
+BEGIN NOT ATOMIC
+SELECT @@sql_mode;
+SELECT * FROM t1;
+SELECT @@sql_mode;
+END|
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+v1 v2
+1 2
+3 4
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+''
+''
+'#------------------Test 17-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+SET STATEMENT myisam_sort_buffer_size=320000,
+myisam_repair_threads=2,
+sort_buffer_size=220022,
+binlog_format=row,
+keep_files_on_create=ON,
+max_join_size=2222220000000
+FOR SET SESSION
+myisam_sort_buffer_size=260000,
+myisam_repair_threads=3,
+sort_buffer_size=230013,
+binlog_format=row,
+keep_files_on_create=ON,
+max_join_size=2323230000000;
+''
+'# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+'#------------------Test 18-----------------------#'
+'# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+myisam_repair_threads=1,
+sort_buffer_size=100000,
+binlog_format=mixed,
+keep_files_on_create=ON,
+max_join_size=2222220000000;
+''
+'# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+CREATE PROCEDURE p5() BEGIN
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+SET SESSION
+myisam_sort_buffer_size=260000,
+myisam_repair_threads=3,
+sort_buffer_size=230013,
+binlog_format=row,
+keep_files_on_create=ON,
+max_join_size=2323230000000;
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+END|
+''
+''
+SET STATEMENT myisam_sort_buffer_size=400000,
+myisam_repair_threads=2,
+sort_buffer_size=200000,
+binlog_format=row,
+keep_files_on_create=OFF,
+max_join_size=4444440000000 FOR
+CALL p5();
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+400000 2 200000 ROW 0 4444440000000
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+260000 3 230013 ROW 1 2323230000000
+''
+'# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+@@myisam_repair_threads,
+@@sort_buffer_size,
+@@binlog_format,
+@@keep_files_on_create,
+@@max_join_size;
+@@myisam_sort_buffer_size @@myisam_repair_threads @@sort_buffer_size @@binlog_format @@keep_files_on_create @@max_join_size
+500000 1 100000 MIXED 1 2222220000000
+''
+''
+'#------------------Test 19-----------------------#'
+SET STATEMENT max_error_count=100 FOR;
+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 '' at line 1
+SET STATEMENT max_error_count=100 INSERT t1 VALUES (1,2);
+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 'INSERT t1 VALUES (1,2)' at line 1
+SET STATEMENT FOR INSERT INTO t1 VALUES (1,2);
+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 'FOR INSERT INTO t1 VALUES (1,2)' at line 1
+SET max_error_count=100 FOR INSERT INTO t1 VALUES (1,2);
+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 'FOR INSERT INTO t1 VALUES (1,2)' at line 1
+SET STATEMENT GLOBAL max_error_count=100 FOR INSERT INTO t1 VALUES (1,2);
+ERROR HY000: Unknown system variable 'GLOBAL'
+SET STATEMENT @@global.max_error_count=100 FOR INSERT INTO t1 VALUES (1,2);
+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 '@@global.max_error_count=100 FOR INSERT INTO t1 VALUES (1,2)' at line 1
+''
+''
+'#------------------Test 20-----------------------#'
+SET STATEMENT connect_timeout=100 FOR INSERT INTO t1 VALUES (1,2);
+ERROR HY000: Variable 'connect_timeout' is a GLOBAL variable and should be set with SET GLOBAL
+''
+''
+'#------------------Test 21-----------------------#'
+SELECT @@myisam_sort_buffer_size, @@sort_buffer_size;
+@@myisam_sort_buffer_size @@sort_buffer_size
+500000 100000
+SET STATEMENT myisam_sort_buffer_size = 700000, sort_buffer_size = 3000000
+FOR SET STATEMENT myisam_sort_buffer_size=200000
+FOR SELECT @@myisam_sort_buffer_size, @@sort_buffer_size;
+@@myisam_sort_buffer_size @@sort_buffer_size
+200000 100000
+SELECT @@myisam_sort_buffer_size, @@sort_buffer_size;
+@@myisam_sort_buffer_size @@sort_buffer_size
+500000 100000
+''
+''
+'#------------------Test 22-----------------------#'
+CREATE TABLE STATEMENT(a INT);
+DROP TABLE STATEMENT;
+''
+'# Cleanup'
+DROP TABLE t1;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+CREATE TABLE t1 (v1 INT, v2 INT);
+insert into t1 values (1,1);
+CREATE FUNCTION myProc ()
+RETURNS INT
+SQL SECURITY DEFINER
+BEGIN
+DECLARE mx INT;
+SET mx = (select max(v1) from t1);
+RETURN mx;
+END|
+SET STATEMENT myisam_repair_threads=(select max(v1) from t1) FOR
+select 1;
+ERROR 42000: SET STATEMENT does not support subqueries or stored functions.
+SET STATEMENT myisam_repair_threads=myProc() FOR
+select 1;
+ERROR 42000: SET STATEMENT does not support subqueries or stored functions.
+drop function myProc;
+drop table t1;
+set session binlog_format=mixed;
+PREPARE stmt1 FROM 'SELECT @@binlog_format';
+execute stmt1;
+@@binlog_format
+MIXED
+set statement binlog_format=row for execute stmt1;
+@@binlog_format
+ROW
+execute stmt1;
+@@binlog_format
+MIXED
+deallocate prepare stmt1;
+set statement binlog_format=row for PREPARE stmt1 FROM 'SELECT @@binlog_format';
+execute stmt1;
+@@binlog_format
+MIXED
+execute stmt1;
+@@binlog_format
+MIXED
+deallocate prepare stmt1;
+PREPARE stmt1 FROM 'set statement binlog_format=row for SELECT @@binlog_format';
+execute stmt1;
+@@binlog_format
+ROW
+execute stmt1;
+@@binlog_format
+ROW
+deallocate prepare stmt1;
+set session binlog_format=default;
+set session binlog_format=mixed;
+SET STATEMENT sort_buffer_size=150000 FOR set session binlog_format=row;
+SELECT @@binlog_format;
+@@binlog_format
+ROW
+SET @@binlog_format = @save_binlog_format;
+SET @@keep_files_on_create = @save_keep_files_on_create;
+SET @@max_join_size = @save_max_join_size;
+SET @@myisam_repair_threads = @save_myisam_repair_threads;
+SET @@myisam_sort_buffer_size = @save_myisam_sort_buffer_size;
+SET @@sort_buffer_size = @save_sort_buffer_size;
+#Correctly set timestamp
+set session timestamp=4646464;
+select @@timestamp != 4646464;
+@@timestamp != 4646464
+0
+select @@timestamp != 4646464;
+@@timestamp != 4646464
+0
+#Correctly returned normal behaviour
+set session timestamp=default;
+select @@timestamp != 4646464;
+@@timestamp != 4646464
+1
+select @@timestamp != 4646464;
+@@timestamp != 4646464
+1
+#here timestamp should be set only for the statement then restored default
+set statement timestamp=4646464 for select @@timestamp;
+@@timestamp
+4646464.000000
+set @save_tm=@@timestamp;
+select @@timestamp != 4646464;
+@@timestamp != 4646464
+1
+select @@timestamp != 4646464;
+@@timestamp != 4646464
+1
+select @@timestamp != @save_tm;
+@@timestamp != @save_tm
+1
+set @save_dfs=@@default_storage_engine;
+SET @@default_storage_engine=MyISAM;
+SET STATEMENT default_storage_engine=MEMORY for CREATE TABLE t1 (a int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+select @@default_storage_engine;
+@@default_storage_engine
+MyISAM
+drop table t1;
+SET STATEMENT default_storage_engine=MyISAM for CREATE TABLE t1 (a int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+SET @@default_storage_engine=@save_dfs;
+SET STATEMENT keycache1.key_buffer_size=1024 FOR SELECT 1;
+ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
+set @save_general_log=@@global.general_log;
+# SET STATEMENT works (OK)
+set statement lock_wait_timeout=1 for select @@lock_wait_timeout;
+@@lock_wait_timeout
+1
+# Setting a totally unrelated global variable
+set global general_log=0;
+# SET STATEMENT should work
+set statement lock_wait_timeout=1 for select @@lock_wait_timeout;
+@@lock_wait_timeout
+1
+set global general_log=@save_general_log;
+# MDEV-7006 MDEV-7007: SET statement and slow log
+set @save_long_query_time= @@long_query_time;
+set @save_slow_query_log= @@slow_query_log;
+set @save_log_output= @@log_output;
+set statement long_query_time=default for select @@long_query_time;
+@@long_query_time
+10.000000
+set statement log_slow_filter=default for select @@log_slow_filter;
+@@log_slow_filter
+admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+set statement log_slow_verbosity=default for select @@log_slow_verbosity;
+@@log_slow_verbosity
+
+set statement log_slow_rate_limit=default for select @@log_slow_rate_limit;
+@@log_slow_rate_limit
+1
+set statement slow_query_log=default for select @@slow_query_log;
+@@slow_query_log
+1
+truncate table mysql.slow_log;
+set slow_query_log= 1;
+set global log_output='TABLE';
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+sql_text
+set @@long_query_time=0.01;
+#should be written
+select sleep(0.1);
+sleep(0.1)
+0
+set @@long_query_time=@save_long_query_time;
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+sql_text
+select sleep(0.1)
+#---
+#should be written
+set statement long_query_time=0.01 for select sleep(0.1);
+sleep(0.1)
+0
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+sql_text
+select sleep(0.1)
+set statement long_query_time=0.01 for select sleep(0.1)
+#---
+set @@long_query_time=0.01;
+#should NOT be written
+set statement slow_query_log=0 for select sleep(0.1);
+sleep(0.1)
+0
+set @@long_query_time=@save_long_query_time;
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+sql_text
+select sleep(0.1)
+set statement long_query_time=0.01 for select sleep(0.1)
+#---
+#should NOT be written
+set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1);
+sleep(0.1)
+0
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+sql_text
+select sleep(0.1)
+set statement long_query_time=0.01 for select sleep(0.1)
+#---
+#should NOT be written
+set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1);
+sleep(0.1)
+0
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+sql_text
+select sleep(0.1)
+set statement long_query_time=0.01 for select sleep(0.1)
+#---
+#should NOT be written
+set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1);
+sleep(0.1)
+0
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+sql_text
+select sleep(0.1)
+set statement long_query_time=0.01 for select sleep(0.1)
+#---
+set global log_output= @save_log_output;
+set @@slow_query_log= @save_slow_query_log;
+set @@long_query_time= @save_long_query_time;
+truncate table mysql.slow_log;
+set statement autocommit=default for select 1;
+ERROR 42000: The system variable autocommit cannot be set in SET STATEMENT.
+set statement tx_isolation=default for select 1;
+ERROR 42000: The system variable tx_isolation cannot be set in SET STATEMENT.
+set statement skip_replication=default for select 1;
+ERROR 42000: The system variable skip_replication cannot be set in SET STATEMENT.
+set statement sql_log_off=default for select 1;
+ERROR 42000: The system variable sql_log_off cannot be set in SET STATEMENT.
+set statement character_set_client=default for select 1;
+ERROR 42000: The system variable character_set_client cannot be set in SET STATEMENT.
+set statement character_set_connection=default for select 1;
+ERROR 42000: The system variable character_set_connection cannot be set in SET STATEMENT.
+set statement character_set_filesystem=default for select 1;
+ERROR 42000: The system variable character_set_filesystem cannot be set in SET STATEMENT.
+set statement collation_connection=default for select 1;
+ERROR 42000: The system variable collation_connection cannot be set in SET STATEMENT.
+set statement query_cache_type=default for select 1;
+ERROR 42000: The system variable query_cache_type cannot be set in SET STATEMENT.
+set statement wait_timeout=default for select 1;
+ERROR 42000: The system variable wait_timeout cannot be set in SET STATEMENT.
+set statement interactive_timeout=default for select 1;
+ERROR 42000: The system variable interactive_timeout cannot be set in SET STATEMENT.
+set @save_week_format=@@default_week_format;
+set @@default_week_format=0;
+SET STATEMENT default_week_format = 2 FOR SELECT WEEK('2000-01-01');
+WEEK('2000-01-01')
+52
+create table t1 (a date);
+insert t1 values ('2000-01-01');
+explain extended select week(a) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select week('2000-01-01',@@default_week_format) AS `week(a)` from dual
+prepare stmt1 from "select week(a) from t1";
+execute stmt1;
+week(a)
+0
+set default_week_format = 2;
+execute stmt1;
+week(a)
+52
+alter table t1 engine=myisam;
+execute stmt1;
+week(a)
+52
+deallocate prepare stmt1;
+drop table t1;
+set @@default_week_format=@save_week_format;
+set @save_old_passwords=@@old_passwords;
+set @@old_passwords=0;
+set statement OLD_PASSWORDS = 0 for select password('test');
+password('test')
+*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+set statement OLD_PASSWORDS = 1 for select password('test');
+password('test')
+378b243e220ca493
+set statement OLD_PASSWORDS = 0 for explain extended select password('test');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select password('test') AS `password('test')`
+set statement OLD_PASSWORDS = 1 for explain extended select password('test');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select password('test') AS `password('test')`
+create table t1 (a char(10));
+insert t1 values ('qwertyuiop');
+prepare stmt1 from "select password(a) from t1";
+execute stmt1;
+password(a)
+*6063C78456BB048BAF36BE1104D12D547834DFEA
+set old_passwords=1;
+execute stmt1;
+password(a)
+2013610f6aac2950
+alter table t1 engine=myisam;
+execute stmt1;
+password(a)
+2013610f6aac2950
+deallocate prepare stmt1;
+drop table t1;
+set @@old_passwords=@save_old_passwords;
+#
+#MDEV-6951:Erroneous SET STATEMENT produces two identical errors
+#
+set statement non_existing=1 for select 1;
+ERROR HY000: Unknown system variable 'non_existing'
+show errors;
+Level Code Message
+Error 1193 Unknown system variable 'non_existing'
+#
+# MDEV-6954: SET STATEMENT rand_seedX = ...FOR ... makes
+# the next rand() to return 0
+#
+set @rnd=1;
+# test that rand() is not always 0 after restoring rand_seed, rand_seed2...
+# @rnd should be 0
+select @rnd;
+@rnd
+0
diff --git a/mysql-test/r/set_statement_debug.result b/mysql-test/r/set_statement_debug.result
new file mode 100644
index 00000000000..bf873a6e824
--- /dev/null
+++ b/mysql-test/r/set_statement_debug.result
@@ -0,0 +1,22 @@
+set @save_debug_dbug= @@debug_dbug;
+set statement debug_dbug="d,something" for select @@debug_dbug;
+@@debug_dbug
+d,something
+set @@debug_dbug= @save_debug_dbug;
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+CALL mtr.add_suppression("Out of sort memory");
+SET statement debug_dbug= '+d,alloc_sort_buffer_fail' for SELECT * FROM t1 ORDER BY f1 ASC, f0;
+ERROR HY001: Out of sort memory, consider increasing server sort buffer size
+SELECT * FROM t1 ORDER BY f1 ASC, f0;
+f0 f1
+1 0
+2 1
+3 2
+4 3
+5 4
+6 5
+DROP TABLE t1;
+set @@debug_dbug= @save_debug_dbug;
+set statement DEBUG_SYNC = 'now SIGNAL hi' for select 1;
+ERROR 42000: The system variable debug_sync cannot be set in SET STATEMENT.
diff --git a/mysql-test/r/set_statement_notembedded.result b/mysql-test/r/set_statement_notembedded.result
new file mode 100644
index 00000000000..561c30d49ac
--- /dev/null
+++ b/mysql-test/r/set_statement_notembedded.result
@@ -0,0 +1,18 @@
+SELECT @@MAX_STATEMENT_TIME;
+@@MAX_STATEMENT_TIME
+0.000000
+SET STATEMENT MAX_STATEMENT_TIME=2 FOR SELECT SLEEP(1);
+SLEEP(1)
+0
+SHOW STATUS LIKE "max_statement_time_exceeded";
+Variable_name Value
+Max_statement_time_exceeded 0
+SET STATEMENT MAX_STATEMENT_TIME=2 FOR SELECT SLEEP(3);
+SLEEP(3)
+1
+SHOW STATUS LIKE "max_statement_time_exceeded";
+Variable_name Value
+Max_statement_time_exceeded 1
+SELECT @@MAX_STATEMENT_TIME;
+@@MAX_STATEMENT_TIME
+0.000000
diff --git a/mysql-test/r/set_statement_notembedded_binlog.result b/mysql-test/r/set_statement_notembedded_binlog.result
new file mode 100644
index 00000000000..f23d4e97748
--- /dev/null
+++ b/mysql-test/r/set_statement_notembedded_binlog.result
@@ -0,0 +1,108 @@
+drop table if exists t1;
+drop view if exists t1;
+#
+# MDEV-6948: SET STATEMENT gtid_domain_id = ... FOR has no effect
+# (same for gtid_seq_no and server_id)
+#
+reset master;
+create table t1 (i int);
+set gtid_domain_id = 10;
+insert into t1 values (1),(2);
+set statement gtid_domain_id = 20 for insert into t1 values (3),(4);
+show binlog events limit 5,5;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x BEGIN GTID 10-1-1
+x x x x x use `test`; insert into t1 values (1),(2)
+x x x x x COMMIT
+x x x x x BEGIN GTID 20-1-1
+x x x x x use `test`; set statement gtid_domain_id = 20 for insert into t1 values (3),(4)
+drop table t1;
+reset master;
+SET @a=11;
+create table t1 (a int not null auto_increment, c int, d int, primary key (a));
+create table t2 (b int);
+insert into t2 values (1),(2);
+CREATE function f1() returns int
+BEGIN
+SET STATEMENT last_insert_id=@a for insert into t1 values (NULL, @a,
+last_insert_id());
+SET @a:=@a*100+13;
+return @a;
+end|
+call mtr.add_suppression("Unsafe statement written to the binary log using");
+select f1() from t2;
+f1()
+1113
+111313
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
+show binlog events limit 16, 100;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x LAST_INSERT_ID=0
+x x x x x INSERT_ID=1
+x x x x x @`a`=11
+x x x x x @`a`=11
+x x x x x use `test`; SELECT `test`.`f1`()
+x x x x x LAST_INSERT_ID=0
+x x x x x INSERT_ID=2
+x x x x x @`a`=1113
+x x x x x @`a`=1113
+x x x x x use `test`; SELECT `test`.`f1`()
+x x x x x COMMIT
+select * from t1;
+a c d
+1 11 11
+2 1113 1113
+drop function f1;
+drop table t1,t2;
+reset master;
+SET @a=11;
+create table t1 (a int not null auto_increment, c int, d int, primary key (a));
+create table t2 (b int);
+insert into t2 values (1),(2);
+CREATE function f1() returns int
+BEGIN
+SET @save= @@last_insert_id;
+SET session last_insert_id=@a;
+insert into t1 values (NULL, @a, last_insert_id());
+SET session last_insert_id=@save;
+SET @a:=@a*100+13;
+return @a;
+end|
+select f1() from t2;
+f1()
+1113
+111313
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
+show binlog events limit 13, 100;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x LAST_INSERT_ID=0
+x x x x x INSERT_ID=1
+x x x x x @`a`=11
+x x x x x @`save`=0
+x x x x x use `test`; SELECT `test`.`f1`()
+x x x x x LAST_INSERT_ID=0
+x x x x x INSERT_ID=2
+x x x x x @`a`=1113
+x x x x x @`save`=0
+x x x x x use `test`; SELECT `test`.`f1`()
+x x x x x COMMIT
+select * from t1;
+a c d
+1 11 11
+2 1113 1113
+drop function f1;
+drop table t1,t2;
+reset master;
+set statement last_insert_id = 112 for create table t1 as select last_insert_id();
+show binlog events limit 4,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x LAST_INSERT_ID=112
+drop table t1;
diff --git a/mysql-test/r/set_statement_profiling.result b/mysql-test/r/set_statement_profiling.result
new file mode 100644
index 00000000000..1f17c345680
--- /dev/null
+++ b/mysql-test/r/set_statement_profiling.result
@@ -0,0 +1,4 @@
+set statement profiling=default for select 1;
+ERROR 42000: The system variable profiling cannot be set in SET STATEMENT.
+set statement profiling_history_size=default for select 1;
+ERROR 42000: The system variable profiling_history_size cannot be set in SET STATEMENT.
diff --git a/mysql-test/r/show.result b/mysql-test/r/show.result
new file mode 100644
index 00000000000..3dd7af5de05
--- /dev/null
+++ b/mysql-test/r/show.result
@@ -0,0 +1,12 @@
+show statistics;
+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 'statistics' at line 1
+show spatial_ref_sys
+--error ER_PARSE_ERROR
+show system_variables;
+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 'spatial_ref_sys
+--error ER_PARSE_ERROR
+show system_variables' at line 2
+show geometry_columns;
+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 'geometry_columns' at line 1
+show nonexistent;
+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 'nonexistent' at line 1
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 5669e0bcbde..585ab305420 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -100,20 +100,20 @@ drop table t1;
-- after Bug#29394 is implemented.
show variables like "wait_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
+def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
+def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 1 0 8
Variable_name Value
wait_timeout 28800
show variables like "WAIT_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
+def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
+def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 1 0 8
Variable_name Value
wait_timeout 28800
show variables like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
-def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
+def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
+def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 0 N 1 0 8
Variable_name Value
show table status from test like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -133,7 +133,7 @@ def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
-def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
+def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 2048 0 Y 0 0 8
def information_schema TABLES TABLES TABLE_COMMENT Comment 253 2048 0 N 1 0 8
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
show databases;
@@ -259,8 +259,8 @@ create table t1(n int);
insert into t1 values (1);
show open tables;
Database Table In_use Name_locked
-test t1 0 0
mysql general_log 0 0
+test t1 0 0
drop table t1;
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
show create table t1;
@@ -316,7 +316,7 @@ type_numeric numeric(5,2),
empty_char char(0),
type_char char(2),
type_varchar varchar(10),
-type_timestamp timestamp not null,
+type_timestamp timestamp not null default current_timestamp on update current_timestamp,
type_date date not null default '0000-00-00',
type_time time not null default '00:00:00',
type_datetime datetime not null default '0000-00-00 00:00:00',
@@ -518,8 +518,11 @@ Database Create Database
mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
create table mysqltest.t1(a int);
insert into mysqltest.t1 values(1);
+create user mysqltest_1@localhost;
grant select on `mysqltest`.* to mysqltest_1@localhost;
+create user mysqltest_2@localhost;
grant usage on `mysqltest`.* to mysqltest_2@localhost;
+create user mysqltest_3@localhost;
grant drop on `mysqltest`.* to mysqltest_3@localhost;
select * from t1;
a
@@ -932,7 +935,7 @@ def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
-def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
+def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 6144 0 Y 0 0 33
def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 6144 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
@@ -997,13 +1000,13 @@ def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1
def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63
-def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
+def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 42 N 1 0 33
def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 567 14 N 1 0 33
def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci
+t1_bi INSERT t1 SET @a = 1 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost binary binary latin1_swedish_ci
----------------------------------------------------------------
SELECT
TRIGGER_CATALOG,
@@ -1041,10 +1044,10 @@ def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFER
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
-def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 42 N 1 0 33
def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 567 14 N 1 0 33
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER
-def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
+def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost
----------------------------------------------------------------
SHOW CREATE VIEW v1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1069,19 +1072,20 @@ def information_schema VIEWS VIEWS DEFINER DEFINER 253 567 14 N 1 0 33
def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
+def information_schema VIEWS VIEWS ALGORITHM ALGORITHM 253 30 9 N 1 0 33
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary UNDEFINED
----------------------------------------------------------------
SHOW CREATE PROCEDURE p1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Procedure 253 192 2 N 1 31 33
-def sql_mode 253 0 0 N 1 31 33
+def sql_mode 253 126 42 N 1 31 33
def Create Procedure 253 3072 59 Y 0 31 33
def character_set_client 253 96 6 N 1 31 33
def collation_connection 253 96 6 N 1 31 33
def Database Collation 253 96 17 N 1 31 33
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 1 binary binary latin1_swedish_ci
----------------------------------------------------------------
SELECT
@@ -1121,22 +1125,22 @@ def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9
def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 42 N 1 0 33
def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
-p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
+p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost
----------------------------------------------------------------
SHOW CREATE FUNCTION f1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Function 253 192 2 N 1 31 33
-def sql_mode 253 0 0 N 1 31 33
+def sql_mode 253 126 42 N 1 31 33
def Create Function 253 3072 74 Y 0 31 33
def character_set_client 253 96 6 N 1 31 33
def collation_connection 253 96 6 N 1 31 33
def Database Collation 253 96 17 N 1 31 33
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 1 binary binary latin1_swedish_ci
----------------------------------------------------------------
SELECT
@@ -1176,11 +1180,11 @@ def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9
def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 42 N 1 0 33
def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
-f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
+f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost
----------------------------------------------------------------
DROP DATABASE mysqltest1;
DROP TABLE t1;
@@ -1278,6 +1282,7 @@ Database Create Database
mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
create table mysqltest.t1(a int);
insert into mysqltest.t1 values(1);
+create user mysqltest_4@localhost;
grant select on `mysqltest`.`t1` to mysqltest_4@localhost;
show create database mysqltest;
Database Create Database
@@ -1345,69 +1350,69 @@ CREATE TABLE t1(c1 INT);
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1;
SHOW CREATE TRIGGER t1_bi;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CREATE PROCEDURE p1() SHOW CREATE TRIGGER t1_bi;
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
PREPARE stmt1 FROM 'SHOW CREATE TRIGGER t1_bi';
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
EXECUTE stmt1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1;
DROP PROCEDURE p1;
DEALLOCATE PREPARE stmt1;
@@ -1431,20 +1436,20 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 'теÑÑ‚' AS `test` koi8r koi8r_general_ci
SHOW CREATE PROCEDURE p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS char(10) CHARSET latin1
+f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS char(10) CHARSET latin1
RETURN 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci
SHOW CREATE TRIGGER t1_bi;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1
FOR EACH ROW
SET NEW.c1 = 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci
SHOW CREATE EVENT ev1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
+ev1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
DROP VIEW v1;
DROP PROCEDURE p1;
DROP FUNCTION f1;
@@ -1507,7 +1512,7 @@ LOCK TABLE t1 WRITE;
# Connection default
SHOW CREATE TRIGGER t1_bi;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci
# Connection con1
UNLOCK TABLES;
# Test 2: ALTER TABLE with SHOW CREATE TRIGGER in transaction
@@ -1515,7 +1520,7 @@ UNLOCK TABLES;
START TRANSACTION;
SHOW CREATE TRIGGER t1_bi;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci
+t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci
# Connection con1
ALTER TABLE t1 CHARACTER SET = utf8;
# Connection default
diff --git a/mysql-test/r/show_explain.result b/mysql-test/r/show_explain.result
index a4d12ce05ce..0dc6f2b28ac 100644
--- a/mysql-test/r/show_explain.result
+++ b/mysql-test/r/show_explain.result
@@ -641,7 +641,7 @@ set debug_dbug='+d,show_explain_probe_join_exec_start';
SHOW INDEX FROM t1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE STATISTICS ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
+1 SIMPLE STATISTICS ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Open_full_table; Scanned 0 databases
Warnings:
Note 1003 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
@@ -782,6 +782,7 @@ drop table t1,t3,t4;
#
# ---------- SHOW EXPLAIN and permissions -----------------
#
+create user test2@localhost;
grant ALL on test.* to test2@localhost;
grant super on *.* to test2@localhost;
#
@@ -1036,7 +1037,7 @@ explain
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1
-1 SIMPLE t1 index b b 6 NULL 107 Using where; Using index
+1 SIMPLE t1 range b b 6 NULL 107 Using where; Using index
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_do_select';
@@ -1044,7 +1045,7 @@ SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, fie
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1 Using filesort
-1 SIMPLE t1 index b b 6 NULL 107 Using where; Using index
+1 SIMPLE t1 range b b 6 NULL 107 Using where; Using index
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
Warnings:
Note 1003 SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2
diff --git a/mysql-test/r/show_grants_with_plugin-7985.result b/mysql-test/r/show_grants_with_plugin-7985.result
index 1898c316ac5..81880e5cc40 100644
--- a/mysql-test/r/show_grants_with_plugin-7985.result
+++ b/mysql-test/r/show_grants_with_plugin-7985.result
@@ -7,7 +7,7 @@ create user u1;
GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password;
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 % mysql_native_password
+u1 %
#
# The user's grants should show no password at all.
#
@@ -43,7 +43,7 @@ GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password
USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 % mysql_native_password *7AFEFD08B6B720E781FB000CAA418F54FA662626
+u1 % *7AFEFD08B6B720E781FB000CAA418F54FA662626
#
# Test to see if connecting with password is succesful.
#
@@ -169,10 +169,10 @@ connection default;
#
# Clear all passwords from the user.
#
-GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password;
+set password for u1 = '';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 % mysql_native_password
+u1 %
#
# Test no password connect.
#
diff --git a/mysql-test/r/single_delete_update.result b/mysql-test/r/single_delete_update.result
index 84380216b74..85e79f53c89 100644
--- a/mysql-test/r/single_delete_update.result
+++ b/mysql-test/r/single_delete_update.result
@@ -1208,35 +1208,3 @@ a b c
25 25 10
25 25 10
DROP TABLE t1, t2;
-#
-# Bug #53742: UPDATEs have no effect after applying patch for bug 36569
-#
-CREATE TABLE t1 (
-pk INT NOT NULL AUTO_INCREMENT,
-c1_idx CHAR(1) DEFAULT 'y',
-c2 INT,
-PRIMARY KEY (pk),
-INDEX c1_idx (c1_idx)
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (), (), (), ();
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-pk c1_idx c2
-4 y NULL
-3 y NULL
-UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-pk c1_idx c2
-4 y 0
-3 y 0
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
-pk c1_idx c2
-4 y 0
-3 y 0
-2 y NULL
-1 y NULL
-DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
-pk c1_idx c2
-2 y NULL
-1 y NULL
-DROP TABLE t1;
diff --git a/mysql-test/r/single_delete_update_innodb.result b/mysql-test/r/single_delete_update_innodb.result
new file mode 100644
index 00000000000..aca40974054
--- /dev/null
+++ b/mysql-test/r/single_delete_update_innodb.result
@@ -0,0 +1,32 @@
+#
+# Bug #53742: UPDATEs have no effect after applying patch for bug 36569
+#
+CREATE TABLE t1 (
+pk INT NOT NULL AUTO_INCREMENT,
+c1_idx CHAR(1) DEFAULT 'y',
+c2 INT,
+PRIMARY KEY (pk),
+INDEX c1_idx (c1_idx)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (), (), (), ();
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+pk c1_idx c2
+4 y NULL
+3 y NULL
+UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+pk c1_idx c2
+4 y 0
+3 y 0
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
+pk c1_idx c2
+4 y 0
+3 y 0
+2 y NULL
+1 y NULL
+DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
+pk c1_idx c2
+2 y NULL
+1 y NULL
+DROP TABLE t1;
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index 75792a15afa..b167a197e50 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -39,11 +39,11 @@ View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`a`@`%` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`c` AS `c` from `t1` latin1 latin1_swedish_ci
SHOW CREATE PROCEDURE p3;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-p3 CREATE DEFINER=`a`@`%` PROCEDURE `p3`()
+p3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a`@`%` PROCEDURE `p3`()
SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION f3;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f3 CREATE DEFINER=`a`@`%` FUNCTION `f3`() RETURNS int(11)
+f3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a`@`%` FUNCTION `f3`() RETURNS int(11)
RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER t1_bi;
DROP TRIGGER ti_ai;
@@ -82,3 +82,14 @@ End of 5.0 tests
select no_such_function(1);
ERROR 42000: FUNCTION test.no_such_function does not exist
End of 5.1 tests
+show global status like 'Acl%';
+Variable_name Value
+Acl_column_grants 0
+Acl_database_grants 0
+Acl_function_grants 0
+Acl_procedure_grants 0
+Acl_proxy_users 0
+Acl_role_grants 0
+Acl_roles 0
+Acl_table_grants 0
+Acl_users 0
diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result
index 1d92d52110d..b2230ccbd91 100644
--- a/mysql-test/r/skip_name_resolve.result
+++ b/mysql-test/r/skip_name_resolve.result
@@ -1,3 +1,4 @@
+CREATE USER mysqltest_1@'127.0.0.1/255.255.255.255';
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
Grants for mysqltest_1@127.0.0.1/255.255.255.255
diff --git a/mysql-test/r/slowlog_enospace-10508.result b/mysql-test/r/slowlog_enospace-10508.result
new file mode 100644
index 00000000000..f39bfa2f00e
--- /dev/null
+++ b/mysql-test/r/slowlog_enospace-10508.result
@@ -0,0 +1,60 @@
+call mtr.add_suppression('Error writing file.*errno: 28 ');
+create table t1 (a int, b int) engine=memory;
+insert t1 select seq, seq+1 from seq_1_to_1000;
+set global general_log=0;
+set global log_queries_not_using_indexes=1;
+set debug_dbug='+d,simulate_file_write_error';
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+select * from t1 where a>10;
+set debug_dbug='';
+set global general_log=1;
+set global log_queries_not_using_indexes=default;
+drop table t1;
diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result
index 81c0adb36cc..0eddfa70dd1 100644
--- a/mysql-test/r/sp-destruct.result
+++ b/mysql-test/r/sp-destruct.result
@@ -128,11 +128,8 @@ CREATE FUNCTION f1() RETURNS INT RETURN 1;
RENAME TABLE mysql.procs_priv TO procs_priv_backup;
FLUSH TABLE mysql.procs_priv;
DROP FUNCTION f1;
-ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
SHOW WARNINGS;
Level Code Message
-Error 1146 Table 'mysql.procs_priv' doesn't exist
-Warning 1405 Failed to revoke all privileges to dropped routine
# Restore the procs_priv table
RENAME TABLE procs_priv_backup TO mysql.procs_priv;
FLUSH TABLE mysql.procs_priv;
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 71fab8c9654..1f38e3888a0 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1223,9 +1223,7 @@ END' at line 1
CREATE PROCEDURE IF NOT EXISTS bug14702()
BEGIN
END;
-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 'IF NOT EXISTS bug14702()
-BEGIN
-END' at line 1
+DROP PROCEDURE IF EXISTS bug14702;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (i INT);
CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 INTO @a;
@@ -1411,7 +1409,7 @@ end|
ERROR 0A000: Not allowed to return a result set from a function
drop function if exists bug20701;
create function bug20701() returns varchar(25) binary return "test";
-ERROR 42000: This version of MariaDB doesn't yet support 'return value collation'
+drop function bug20701;
create function bug20701() returns varchar(25) return "test";
drop function bug20701;
create procedure proc_26503_error_1()
@@ -1760,7 +1758,7 @@ CAST('10 ' as unsigned integer)
CAST('10 ' as unsigned integer)
10
Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '10 '
+Note 1292 Truncated incorrect INTEGER value: '10 '
DROP PROCEDURE p1;
DROP PROCEDURE p2;
@@ -1769,7 +1767,7 @@ DROP PROCEDURE p2;
CREATE PROCEDURE p1()
BEGIN
DECLARE c INT DEFAULT 0;
-DECLARE CONTINUE HANDLER FOR SQLWARNING SET c = c + 1;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '22007' SET c = c + 1;
CALL p2();
CALL p3();
CALL p4();
@@ -1799,7 +1797,7 @@ END|
CREATE PROCEDURE P6()
BEGIN
DECLARE c INT DEFAULT 0;
-DECLARE CONTINUE HANDLER FOR SQLWARNING SET c = c + 1;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '22007' SET c = c + 1;
CALL p5();
SELECT c;
END|
@@ -1823,7 +1821,7 @@ CALL p6();
CAST('10 ' as unsigned integer)
10
Level Code Message
-Warning 1292 Truncated incorrect INTEGER value: '10 '
+Note 1292 Truncated incorrect INTEGER value: '10 '
c
1
DROP PROCEDURE p1;
@@ -1984,9 +1982,9 @@ Level Code Message
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '111111 '
+Note 1292 Truncated incorrect INTEGER value: '111111 '
Warning 1264 Out of range value for column 'a' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '222222 '
+Note 1292 Truncated incorrect INTEGER value: '222222 '
Warning 1264 Out of range value for column 'b' at row 1
Error 1048 Column 'c' cannot be null
@@ -2746,14 +2744,14 @@ END|
CALL p6()|
Level Code Message
-Warning 1292 Truncated incorrect INTEGER value: '1 '
-Warning 1292 Truncated incorrect INTEGER value: '1999999 '
+Note 1292 Truncated incorrect INTEGER value: '1 '
+Note 1292 Truncated incorrect INTEGER value: '1999999 '
Warning 1264 Out of range value for column 'a' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '2 '
-Warning 1292 Truncated incorrect INTEGER value: '2999999 '
+Note 1292 Truncated incorrect INTEGER value: '2 '
+Note 1292 Truncated incorrect INTEGER value: '2999999 '
Warning 1264 Out of range value for column 'b' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '3 '
-Warning 1292 Truncated incorrect INTEGER value: '3999999 '
+Note 1292 Truncated incorrect INTEGER value: '3 '
+Note 1292 Truncated incorrect INTEGER value: '3999999 '
Warning 1264 Out of range value for column 'c' at row 1
Msg
Handler for 1292
diff --git a/mysql-test/r/sp-lock.result b/mysql-test/r/sp-lock.result
index 860312dca3e..49ff0c7ba58 100644
--- a/mysql-test/r/sp-lock.result
+++ b/mysql-test/r/sp-lock.result
@@ -725,7 +725,7 @@ release_lock("test")
get_lock("test", 10)
1
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
BEGIN
SELECT get_lock("test", 10);
SHOW CREATE PROCEDURE p1;
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index e8c3fbff0e3..276da41a0fe 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -1,4 +1,5 @@
use test;
+create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;
drop table if exists t1;
@@ -31,10 +32,13 @@ root@localhost 1
select db();
db()
test
+create user user1@'%';
grant execute on procedure db1_secret.stamp to user1@'%';
grant execute on function db1_secret.db to user1@'%';
+set sql_mode='';
grant execute on procedure db1_secret.stamp to ''@'%';
grant execute on function db1_secret.db to ''@'%';
+set sql_mode=default;
call db1_secret.stamp(2);
select db1_secret.db();
db1_secret.db()
@@ -103,6 +107,7 @@ create table t2 (s1 int);
insert into t2 values (0);
grant usage on db2.* to user1@localhost;
grant select on db2.* to user1@localhost;
+create user user2@localhost;
grant usage on db2.* to user2@localhost;
grant select,insert,update,delete,create routine on db2.* to user2@localhost;
grant create routine on db2.* to user1@localhost;
@@ -156,8 +161,11 @@ delete from mysql.procs_priv where user='user1' or user='user2';
delete from mysql.procs_priv where user='' and host='%';
delete from mysql.db where user='user2';
flush privileges;
+create user usera@localhost;
grant usage on *.* to usera@localhost;
+create user userb@localhost;
grant usage on *.* to userb@localhost;
+create user userc@localhost;
grant usage on *.* to userc@localhost;
create database sptest;
create table t1 ( u varchar(64), i int );
@@ -220,9 +228,11 @@ delete from mysql.tables_priv where user='usera';
flush privileges;
drop table t1;
drop function if exists bug_9503;
+drop user if exists user1@localhost;
create database mysqltest//
use mysqltest//
create table t1 (s1 int)//
+create user user1@localhost//
grant select on t1 to user1@localhost//
create function bug_9503 () returns int sql security invoker begin declare v int;
select min(s1) into v from t1; return v; end//
@@ -266,6 +276,7 @@ create procedure mysqltest_1.p1()
begin
select 1 from dual;
end//
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
call mysqltest_1.p1();
ERROR 42000: execute command denied to user 'mysqltest_1'@'localhost' for routine 'mysqltest_1.p1'
@@ -366,19 +377,19 @@ Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exi
USE mysqltest;
SHOW CREATE PROCEDURE wl2897_p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`()
+wl2897_p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`()
SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE PROCEDURE wl2897_p3;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-wl2897_p3 CREATE DEFINER=`a @ b @ c`@`localhost` PROCEDURE `wl2897_p3`()
+wl2897_p3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a @ b @ c`@`localhost` PROCEDURE `wl2897_p3`()
SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION wl2897_f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-wl2897_f1 CREATE DEFINER=`mysqltest_2`@`localhost` FUNCTION `wl2897_f1`() RETURNS int(11)
+wl2897_f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`mysqltest_2`@`localhost` FUNCTION `wl2897_f1`() RETURNS int(11)
RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION wl2897_f3;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-wl2897_f3 CREATE DEFINER=`a @ b @ c`@`localhost` FUNCTION `wl2897_f3`() RETURNS int(11)
+wl2897_f3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a @ b @ c`@`localhost` FUNCTION `wl2897_f3`() RETURNS int(11)
RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci
DROP USER mysqltest_1@localhost;
DROP USER mysqltest_2@localhost;
@@ -444,7 +455,7 @@ SELECT a;
END //
SHOW CREATE PROCEDURE test.sp19857;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp19857 CREATE DEFINER=`user19857`@`localhost` PROCEDURE `sp19857`()
+sp19857 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user19857`@`localhost` PROCEDURE `sp19857`()
DETERMINISTIC
BEGIN
DECLARE a INT;
@@ -612,7 +623,7 @@ GRANT SELECT ON mysql.proc TO user2@localhost;
# This should work
SHOW CREATE PROCEDURE db1.p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
# Connection default
DROP USER user2@localhost;
@@ -647,3 +658,17 @@ ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for r
# Connection 'default'.
drop user bug12602983_user@localhost;
drop database mysqltest_db;
+set password=password('foobar');
+create procedure sp1() select 1;
+show grants;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+grant execute on procedure sp1 to current_user() identified by 'barfoo';
+show grants;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
+GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO 'root'@'localhost'
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+drop procedure sp1;
+set password='';
diff --git a/mysql-test/r/sp-ucs2.result b/mysql-test/r/sp-ucs2.result
index 605fe4ed151..3c444ad97de 100644
--- a/mysql-test/r/sp-ucs2.result
+++ b/mysql-test/r/sp-ucs2.result
@@ -40,7 +40,7 @@ BEGIN
RETURN '';
END|
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
+f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
BEGIN
RETURN '';
END latin1 latin1_swedish_ci latin1_swedish_ci
@@ -55,7 +55,7 @@ BEGIN
RETURN '';
END|
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
+f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
BEGIN
RETURN '';
END latin1 latin1_swedish_ci latin1_swedish_ci
@@ -67,7 +67,7 @@ BEGIN
RETURN '';
END|
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
+f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
BEGIN
RETURN '';
END latin1 latin1_swedish_ci latin1_swedish_ci
@@ -83,7 +83,7 @@ SET f2= f1;
SET f2= concat(collation(f1), ' ', collation(f2));
END|
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
+f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
BEGIN
RETURN '';
END latin1 latin1_swedish_ci latin1_swedish_ci
@@ -106,20 +106,20 @@ RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
RETURN 'str';
END|
-ERROR 42000: This version of MariaDB doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE'
+ERROR 42000: COLLATION 'ucs2_unicode_ci' is not valid for CHARACTER SET 'latin1'
CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci
BEGIN
RETURN 'str';
END|
-ERROR 42000: This version of MariaDB doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE'
+ERROR 42000: COLLATION 'ucs2_unicode_ci' is not valid for CHARACTER SET 'latin1'
CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci;
RETURN 'str';
END|
-ERROR 42000: This version of MariaDB doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE'
+ERROR 42000: COLLATION 'ucs2_unicode_ci' is not valid for CHARACTER SET 'latin1'
SET NAMES utf8;
DROP FUNCTION IF EXISTS bug48766;
CREATE FUNCTION bug48766 ()
@@ -127,7 +127,7 @@ RETURNS ENUM( 'w' ) CHARACTER SET ucs2
RETURN 0;
SHOW CREATE FUNCTION bug48766;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-bug48766 CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('w') CHARSET ucs2
+bug48766 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('w') CHARSET ucs2
RETURN 0 utf8 utf8_general_ci latin1_swedish_ci
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME='bug48766';
@@ -139,7 +139,7 @@ RETURNS ENUM('а','б','в','г') CHARACTER SET ucs2
RETURN 0;
SHOW CREATE FUNCTION bug48766;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-bug48766 CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('а','б','в','г') CHARSET ucs2
+bug48766 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('а','б','в','г') CHARSET ucs2
RETURN 0 utf8 utf8_general_ci latin1_swedish_ci
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME='bug48766';
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 2cb1b701e2d..57d704c36be 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -791,7 +791,7 @@ comment 'Characteristics procedure test'
insert into t1 values ("chistics", 1)|
show create procedure chistics|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`()
+chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`()
MODIFIES SQL DATA
COMMENT 'Characteristics procedure test'
insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci latin1_swedish_ci
@@ -803,7 +803,7 @@ delete from t1|
alter procedure chistics sql security invoker|
show create procedure chistics|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`()
+chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`()
MODIFIES SQL DATA
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
@@ -818,7 +818,7 @@ comment 'Characteristics procedure test'
return 42|
show create function chistics|
Function sql_mode Create Function character_set_client collation_connection Database Collation
-chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11)
+chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11)
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
@@ -831,7 +831,7 @@ no sql
comment 'Characteristics function test'|
show create function chistics|
Function sql_mode Create Function character_set_client collation_connection Database Collation
-chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11)
+chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11)
NO SQL
DETERMINISTIC
SQL SECURITY INVOKER
@@ -3548,7 +3548,10 @@ begin
set f1= concat( 'hello', f1 );
return f1;
end|
-ERROR 42000: This version of MariaDB doesn't yet support 'return value collation'
+select collation(bug9048("foo"))|
+collation(bug9048("foo"))
+latin1_bin
+drop function bug9048|
drop procedure if exists bug12849_1|
create procedure bug12849_1(inout x char) select x into x|
set @var='a'|
@@ -6069,7 +6072,7 @@ insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807,
show create table examplebug20777;
Table Create Table
examplebug20777 CREATE TABLE `examplebug20777` (
- `i` int(1) NOT NULL DEFAULT '0',
+ `i` int(1) NOT NULL,
`2**63-2` bigint(20) unsigned DEFAULT NULL,
`2**63-1` bigint(20) unsigned DEFAULT NULL,
`2**63` bigint(20) unsigned DEFAULT NULL,
@@ -7099,7 +7102,7 @@ CAST('10 ' as UNSIGNED INTEGER)
1
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '10 '
+Note 1292 Truncated incorrect INTEGER value: '10 '
DROP PROCEDURE p1;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
@@ -7125,7 +7128,7 @@ CAST('10 ' as UNSIGNED INTEGER)
2
2
Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '10 '
+Note 1292 Truncated incorrect INTEGER value: '10 '
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP PROCEDURE p3;
@@ -7990,3 +7993,253 @@ ENTITY_UID
drop procedure SP_EXAMPLE_SELECT;
drop view ENTITY_ACCESS;
drop table ANY_TABLE, SECURITY_PATH;
+# End of 10.0 test
+CREATE FUNCTION f(f1 VARCHAR(64) COLLATE latin1_german2_ci)
+RETURNS VARCHAR(64)
+BEGIN
+RETURN 'str';
+END|
+DROP FUNCTION f|
+CREATE FUNCTION f(f1 VARCHAR(64))
+RETURNS VARCHAR(64) COLLATE latin1_german2_ci
+BEGIN
+RETURN 'str';
+END|
+DROP FUNCTION f|
+CREATE FUNCTION f(f1 VARCHAR(64))
+RETURNS VARCHAR(64)
+BEGIN
+DECLARE f2 VARCHAR(64) COLLATE latin1_german2_ci;
+RETURN 'str';
+END|
+DROP FUNCTION f|
+#
+# MDEV-7023: Error 2027: Malformed packet and assertion
+# `field_types == 0 || field_types[field_pos] == MYSQL_TYPE_INT24 ||
+#field_types[field_pos] == MYSQL_TYPE_LONG' failure in
+#Protocol_text::store_long
+#
+create table t1 (i int);
+create table t2 (i int);
+create function f() returns int
+begin
+analyze insert into t1 values (1);
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+create function f() returns int
+begin
+analyze insert t1 select * from t2;
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+create function f() returns int
+begin
+analyze delete from t1;
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+create function f() returns int
+begin
+analyze delete t1 from t1,t2;
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+create function f() returns int
+begin
+analyze update t1 set i=1;
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+create function f() returns int
+begin
+analyze update t1,t2 set i=1;
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+create function f() returns int
+begin
+analyze replace t1 set i=1;
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+create function f() returns int
+begin
+analyze replace t1 select * from t2;
+return 1;
+end |
+ERROR 0A000: Not allowed to return a result set from a function
+drop table t1,t2;
+#
+# MDEV-11584: GRANT inside an SP does not work well on 2nd execution
+#
+CREATE PROCEDURE sp1()
+GRANT ALL PRIVILEGES ON *.* TO 'foo'@'%' IDENTIFIED BY 'pass';
+CALL sp1();
+CALL sp1();
+drop user 'foo'@'%';
+drop procedure sp1;
+#
+# MDEV-10972: Insert from select / view / union --
+# repeatable crash in 10.1, 10.2 Linux/Mac/Windows
+#
+create table t (id int auto_increment primary key);
+insert into t values (9494),(9495),(9496),(9497),(9498),(9499),(9500),(9501),(9502),(9503);
+create VIEW v AS
+select id from t
+union
+select id from t
+;
+drop procedure if exists p;
+Warnings:
+Note 1305 PROCEDURE test.p does not exist
+create procedure p()
+insert into tmp_t select t.id from (
+select id from v
+union
+select id from v
+) sq
+inner join t on (sq.id = t.id);
+CALL p();
+ERROR 42S02: Table 'test.tmp_t' doesn't exist
+create table tmp_t (id int null);
+CALL p();
+drop procedure p;
+drop view v;
+drop table t, tmp_t;
+#
+# MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
+#
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
+CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(i) FROM v1 );
+REPLACE INTO v1 VALUES (f1());
+ERROR HY000: The target table v1 of the INSERT is not insertable-into
+SET @aux = f1();
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# MDEV-14857: problem with 10.2.11 server crashing when
+# executing stored procedure
+#
+SET max_sp_recursion_depth=10;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+CREATE PROCEDURE proc_0()
+BEGIN
+CALL empty_1();
+CALL proc_1();
+END ||
+CREATE PROCEDURE proc_1()
+BEGIN
+CALL proc_2();
+CALL proc_3();
+CALL proc_4();
+CALL proc_5();
+END ||
+CREATE PROCEDURE proc_2()
+CALL proc_6();
+||
+CREATE PROCEDURE proc_3()
+BEGIN
+CALL empty_2();
+CALL empty_3();
+END ||
+CREATE PROCEDURE proc_4()
+CALL proc_7();
+||
+CREATE PROCEDURE proc_5()
+CALL proc_select();
+||
+CREATE PROCEDURE proc_6()
+BEGIN
+CALL empty_4();
+CALL empty_5();
+CALL empty_6();
+CALL empty_7();
+CALL proc_8();
+END ||
+CREATE PROCEDURE proc_7()
+CALL proc_9('foo');
+||
+CREATE PROCEDURE proc_8()
+CALL proc_10();
+||
+CREATE PROCEDURE proc_9(IN opt VARCHAR(40))
+IF LEFT(opt,1) <> '_' THEN
+CALL proc_11();
+END IF;
+||
+CREATE PROCEDURE proc_10()
+CALL proc_12();
+||
+CREATE PROCEDURE proc_11()
+BEGIN
+CALL empty_8();
+CALL empty_9();
+CALL empty_10();
+CALL proc_13();
+END ||
+CREATE PROCEDURE proc_12()
+BEGIN
+CALL empty_11();
+CALL empty_12();
+CALL empty_13();
+END ||
+CREATE PROCEDURE proc_13()
+BEGIN
+CALL proc_9('_bar');
+CALL empty_14();
+END ||
+CREATE PROCEDURE empty_1() BEGIN END ;
+CREATE PROCEDURE empty_2() BEGIN END ;
+CREATE PROCEDURE empty_3() BEGIN END ;
+CREATE PROCEDURE empty_4() BEGIN END ;
+CREATE PROCEDURE empty_5() BEGIN END ;
+CREATE PROCEDURE empty_6() BEGIN END ;
+CREATE PROCEDURE empty_7() BEGIN END ;
+CREATE PROCEDURE empty_8() BEGIN END ;
+CREATE PROCEDURE empty_9() BEGIN END ;
+CREATE PROCEDURE empty_10() BEGIN END ;
+CREATE PROCEDURE empty_11() BEGIN END ;
+CREATE PROCEDURE empty_12() BEGIN END ;
+CREATE PROCEDURE empty_13() BEGIN END ;
+CREATE PROCEDURE empty_14() BEGIN END ;
+CREATE PROCEDURE proc_select()
+SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * FROM t2)
+;
+CALL proc_0();
+a
+DROP PROCEDURE empty_1;
+DROP PROCEDURE empty_2;
+DROP PROCEDURE empty_3;
+DROP PROCEDURE empty_4;
+DROP PROCEDURE empty_5;
+DROP PROCEDURE empty_6;
+DROP PROCEDURE empty_7;
+DROP PROCEDURE empty_8;
+DROP PROCEDURE empty_9;
+DROP PROCEDURE empty_10;
+DROP PROCEDURE empty_11;
+DROP PROCEDURE empty_12;
+DROP PROCEDURE empty_13;
+DROP PROCEDURE empty_14;
+DROP PROCEDURE proc_0;
+DROP PROCEDURE proc_1;
+DROP PROCEDURE proc_2;
+DROP PROCEDURE proc_3;
+DROP PROCEDURE proc_4;
+DROP PROCEDURE proc_5;
+DROP PROCEDURE proc_6;
+DROP PROCEDURE proc_7;
+DROP PROCEDURE proc_8;
+DROP PROCEDURE proc_9;
+DROP PROCEDURE proc_10;
+DROP PROCEDURE proc_11;
+DROP PROCEDURE proc_12;
+DROP PROCEDURE proc_13;
+DROP PROCEDURE proc_select;
+DROP TABLE t1, t2;
+SET max_sp_recursion_depth=default;
+#End of 10.1 tests
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 3cc4ff4238b..40a06d312a0 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -150,6 +150,7 @@ drop view v1|
drop table t3|
drop procedure if exists bug15298_1;
drop procedure if exists bug15298_2;
+create user 'mysqltest_1'@'localhost';
grant all privileges on test.* to 'mysqltest_1'@'localhost';
create procedure 15298_1 () sql security definer show grants for current_user;
create procedure 15298_2 () sql security definer show grants;
@@ -203,6 +204,8 @@ Warnings:
Warning 1364 Field 'authentication_string' doesn't have a default value
FLUSH PRIVILEGES;
CREATE PROCEDURE p1(i INT) BEGIN END;
+Warnings:
+Warning 1404 Failed to grant EXECUTE and ALTER ROUTINE privileges
DROP PROCEDURE p1;
DELETE FROM mysql.user WHERE User='mysqltest_1';
FLUSH PRIVILEGES;
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index 5526fc19aae..c76615d644f 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -1,3 +1,4 @@
+set SQL_MODE="";
drop table if exists t1, t2, t3;
drop procedure if exists bug8850|
create table t1 (a int) engine=innodb|
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index 4fdac6b9cea..d71748bd9b1 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -144,7 +144,7 @@ ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL'
set session sql_mode=ansi;
create table t1
(f1 integer auto_increment primary key,
-f2 timestamp default current_timestamp on update current_timestamp);
+f2 timestamp not null default current_timestamp on update current_timestamp);
show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result
index 4bae442459a..05ba7519781 100644
--- a/mysql-test/r/ssl.result
+++ b/mysql-test/r/ssl.result
@@ -3,10 +3,10 @@ have_ssl
1
SHOW STATUS LIKE 'Ssl_server_not_before';
Variable_name Value
-Ssl_server_not_before Apr 25 14:55:05 2015 GMT
+Ssl_server_not_before Apr 25 20:52:21 2017 GMT
SHOW STATUS LIKE 'Ssl_server_not_after';
Variable_name Value
-Ssl_server_not_after Apr 20 14:55:05 2035 GMT
+Ssl_server_not_after Apr 20 20:52:21 2037 GMT
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
@@ -2172,3 +2172,8 @@ NULL
select 'still connected?';
still connected?
still connected?
+create user mysqltest_1@localhost;
+grant usage on mysqltest.* to mysqltest_1@localhost require cipher "AES256-SHA";
+Variable_name Value
+Ssl_cipher AES256-SHA
+drop user mysqltest_1@localhost;
diff --git a/mysql-test/r/stack-crash.result b/mysql-test/r/stack-crash.result
index be5b6464b9a..62870db79f3 100644
--- a/mysql-test/r/stack-crash.result
+++ b/mysql-test/r/stack-crash.result
@@ -23,10 +23,7 @@ CREATE TABLE t1 (
`sspo_lu_uid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`sspo_id`),
KEY `post_uid` (`sspo_uid`,`sspo_cr_date`)
-) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+) AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES (1,2,'P','test1','',0,'','',NULL,'','','','','A','2013-09-30 00:19:32',2,'2013-09-30 00:19:32',2),(2,2,'P','bbb','',0,'','',NULL,'','','','','A','2013-10-02 15:06:35',2,'2013-10-02 15:06:35',2);
CREATE TABLE `t2` (
`spoo_id` int(11) NOT NULL AUTO_INCREMENT,
@@ -41,10 +38,7 @@ CREATE TABLE `t2` (
`spoo_lu_uid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`spoo_id`),
KEY `object_option_main_idx` (`spoo_user_type_id`,`spoo_uid`,`spoo_option_id`,`spoo_value`(255))
-) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't2'
+) AUTO_INCREMENT=107 DEFAULT CHARSET=utf8;
INSERT INTO `t2` VALUES (19,1,2,6,'Dortmund','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2),(20,1,2,8,'49','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2);
SELECT Count(*)
FROM t1 AS tbl
diff --git a/mysql-test/r/stat_tables_par.result b/mysql-test/r/stat_tables_par.result
index ed39b7af9a9..aaebb929c9d 100644
--- a/mysql-test/r/stat_tables_par.result
+++ b/mysql-test/r/stat_tables_par.result
@@ -46,19 +46,19 @@ dbt3_s001 supplier PRIMARY 1 1.0000
dbt3_s001 supplier i_s_nationkey 1 1.1111
flush table lineitem;
set use_stat_tables='never';
-select sum(l_extendedprice*l_discount) as revenue
+select round(sum(l_extendedprice*l_discount),4) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
-77949.91860000002
+77949.9186
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
-select sum(l_extendedprice*l_discount) as revenue
+select round(sum(l_extendedprice*l_discount),4) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
@@ -68,16 +68,16 @@ set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
-select sum(l_extendedprice*l_discount) as revenue
+select round(sum(l_extendedprice*l_discount),4) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
-77949.91860000002
+77949.9186
revenue
-77949.91860000002
+77949.9186
set use_stat_tables='preferably';
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name;
diff --git a/mysql-test/r/stat_tables_par_innodb.result b/mysql-test/r/stat_tables_par_innodb.result
index cb4e4b09827..e08392678c5 100644
--- a/mysql-test/r/stat_tables_par_innodb.result
+++ b/mysql-test/r/stat_tables_par_innodb.result
@@ -49,19 +49,19 @@ dbt3_s001 supplier PRIMARY 1 1.0000
dbt3_s001 supplier i_s_nationkey 1 1.1111
flush table lineitem;
set use_stat_tables='never';
-select sum(l_extendedprice*l_discount) as revenue
+select round(sum(l_extendedprice*l_discount),4) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
-77949.91860000002
+77949.9186
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
-select sum(l_extendedprice*l_discount) as revenue
+select round(sum(l_extendedprice*l_discount),4) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
@@ -71,16 +71,16 @@ set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
-select sum(l_extendedprice*l_discount) as revenue
+select round(sum(l_extendedprice*l_discount),4) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
-77949.91860000002
+77949.9186
revenue
-77949.91860000002
+77949.9186
set use_stat_tables='preferably';
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name;
diff --git a/mysql-test/r/stat_tables_rbr.result b/mysql-test/r/stat_tables_rbr.result
index 119801bf7d4..35e74e29b08 100644
--- a/mysql-test/r/stat_tables_rbr.result
+++ b/mysql-test/r/stat_tables_rbr.result
@@ -15,20 +15,17 @@ ALTER TABLE t1 ANALYZE PARTITION p1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
-SHOW BINLOG EVENTS;
+include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 248 Server ver: #, Binlog ver: #
-master-bin.000001 248 Gtid_list 1 273 []
-master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001
-master-bin.000001 313 Gtid 1 351 GTID 0-1-1
-master-bin.000001 351 Query 1 451 use `test`; CREATE TABLE t1 (i INT) ENGINE=InnoDB
-master-bin.000001 451 Gtid 1 489 GTID 0-1-2
-master-bin.000001 489 Query 1 568 use `test`; ANALYZE TABLE t1
-master-bin.000001 568 Gtid 1 606 GTID 0-1-3
-master-bin.000001 606 Query 1 710 use `test`; DROP TABLE `t1` /* generated by server */
-master-bin.000001 710 Gtid 1 748 GTID 0-1-4
-master-bin.000001 748 Query 1 884 use `test`; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2
-master-bin.000001 884 Gtid 1 922 GTID 0-1-5
-master-bin.000001 922 Query 1 1020 use `test`; ALTER TABLE t1 ANALYZE PARTITION p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (i INT) ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; ANALYZE TABLE t1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 ANALYZE PARTITION p1
SET use_stat_tables = DEFAULT;
DROP TABLE t1;
diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result
index bd6a0849e3d..2d0f18f1ed7 100644
--- a/mysql-test/r/statistics.result
+++ b/mysql-test/r/statistics.result
@@ -1212,6 +1212,7 @@ test t2 PRIMARY 1 1.0000
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
test.t1 analyze status OK
SELECT * FROM mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
@@ -1225,7 +1226,6 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000 0 NULL NULL
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000 0 NULL NULL
test t1 e 0.01 0.112 0.2250 8.0000 6.2000 0 NULL NULL
test t1 f 1 5 0.2000 1.0000 6.4000 0 NULL NULL
-test t1 b NULL NULL 0.2000 17.1250 NULL NULL NULL NULL
SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 idx2 1 7.0000
@@ -1265,6 +1265,7 @@ set use_stat_tables='never';
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
test.t1 analyze status Table is already up to date
SELECT * FROM mysql.table_stats;
db_name table_name cardinality
@@ -1276,7 +1277,6 @@ test t1 c aaaa dddddddd 0.1250 6.6571 7.0000 0 NULL NULL
test t1 d 1989-03-12 1999-07-23 0.1500 3.0000 8.5000 0 NULL NULL
test t1 e 0.01 0.112 0.2250 8.0000 6.2000 0 NULL NULL
test t1 f 1 5 0.2000 1.0000 6.4000 0 NULL NULL
-test t1 b NULL NULL 0.2000 17.1250 NULL NULL NULL NULL
SELECT * FROM mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
test t1 PRIMARY 1 1.0000
@@ -1291,6 +1291,28 @@ test t1 idx4 3 NULL
DELETE FROM mysql.table_stats;
DELETE FROM mysql.column_stats;
DELETE FROM mysql.index_stats;
+ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES();
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
+test.t1 analyze status Table is already up to date
+ANALYZE TABLE t1 PERSISTENT FOR columns(a,b) INDEXES();
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
+test.t1 analyze status Table is already up to date
+ANALYZE TABLE t1 PERSISTENT FOR columns(b) indexes(idx2);
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
+test.t1 analyze status Table is already up to date
+ANALYZE TABLE t1 PERSISTENT FOR columns() indexes(idx2);
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
DROP TABLE t1,t2;
set names utf8;
CREATE DATABASE world;
@@ -1641,3 +1663,37 @@ FROM mysql.column_stats;
db_name table_name column_name HEX(min_value) HEX(max_value) nulls_ratio avg_frequency hist_size hist_type HEX(histogram)
test t1 a D879626AF872675F73E662F8 D879626AF872675F73E662F8 0.0000 1.0000 0 NULL NULL
drop table t1;
+#
+# MDEV-9590: Always print "Engine-independent statistic" warnings and
+# might be filtering columns unintentionally from engines
+#
+set use_stat_tables='NEVER';
+create table t1 (test blob);
+show variables like 'use_stat_tables';
+Variable_name Value
+use_stat_tables NEVER
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Table is already up to date
+drop table t1;
+#
+# MDEV-10435 crash with bad stat tables
+#
+set use_stat_tables='preferably';
+call mtr.add_suppression("Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted");
+rename table mysql.table_stats to test.table_stats;
+flush tables;
+create table t1 (a int);
+rename table t1 to t2, t3 to t4;
+ERROR 42S02: Table 'test.t3' doesn't exist
+drop table t1;
+rename table test.table_stats to mysql.table_stats;
+rename table mysql.table_stats to test.table_stats;
+create table mysql.table_stats (a int);
+flush tables;
+create table t1 (a int);
+rename table t1 to t2, t3 to t4;
+ERROR 42S02: Table 'test.t3' doesn't exist
+drop table t1, mysql.table_stats;
+rename table test.table_stats to mysql.table_stats;
+set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/r/statistics_index_crash-7362.result b/mysql-test/r/statistics_index_crash-7362.result
index 99f65d7e1b7..c213fa49afe 100644
--- a/mysql-test/r/statistics_index_crash-7362.result
+++ b/mysql-test/r/statistics_index_crash-7362.result
@@ -3,6 +3,7 @@ INSERT INTO t1 VALUES (unhex('3E0D0A4141414142334E7A6143317963324541414141424977
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status OK
SELECT * FROM mysql.index_stats WHERE index_name='a' AND table_name='t1';
db_name table_name index_name prefix_arity avg_frequency
@@ -13,6 +14,7 @@ INSERT INTO t1 VALUES (unhex('3E0D0A4141414142334E7A6143317963324541414141424977
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status OK
SELECT * FROM mysql.index_stats WHERE index_name='a' AND table_name='t1';
db_name table_name index_name prefix_arity avg_frequency
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index 600a4fbd59f..7c82936d30a 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -204,6 +204,7 @@ Com_drop_function 1
create database db37908;
create table db37908.t1(f1 int);
insert into db37908.t1 values(1);
+create user mysqltest_1@localhost;
grant usage,execute on test.* to mysqltest_1@localhost;
create procedure proc37908() begin select 1; end |
create function func37908() returns int sql security invoker
diff --git a/mysql-test/r/status_user.result b/mysql-test/r/status_user.result
deleted file mode 100644
index d00a7d3047f..00000000000
--- a/mysql-test/r/status_user.result
+++ /dev/null
@@ -1,223 +0,0 @@
-DROP TABLE IF EXISTS t1;
-select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key;
-show columns from information_schema.client_statistics;
-Field Type Null Key Default Extra
-CLIENT varchar(64) NO
-TOTAL_CONNECTIONS bigint(21) NO 0
-CONCURRENT_CONNECTIONS bigint(21) NO 0
-CONNECTED_TIME bigint(21) NO 0
-BUSY_TIME double NO 0
-CPU_TIME double NO 0
-BYTES_RECEIVED bigint(21) NO 0
-BYTES_SENT bigint(21) NO 0
-BINLOG_BYTES_WRITTEN bigint(21) NO 0
-ROWS_READ bigint(21) NO 0
-ROWS_SENT bigint(21) NO 0
-ROWS_DELETED bigint(21) NO 0
-ROWS_INSERTED bigint(21) NO 0
-ROWS_UPDATED bigint(21) NO 0
-SELECT_COMMANDS bigint(21) NO 0
-UPDATE_COMMANDS bigint(21) NO 0
-OTHER_COMMANDS bigint(21) NO 0
-COMMIT_TRANSACTIONS bigint(21) NO 0
-ROLLBACK_TRANSACTIONS bigint(21) NO 0
-DENIED_CONNECTIONS bigint(21) NO 0
-LOST_CONNECTIONS bigint(21) NO 0
-ACCESS_DENIED bigint(21) NO 0
-EMPTY_QUERIES bigint(21) NO 0
-show columns from information_schema.user_statistics;
-Field Type Null Key Default Extra
-USER varchar(128) NO
-TOTAL_CONNECTIONS int(11) NO 0
-CONCURRENT_CONNECTIONS int(11) NO 0
-CONNECTED_TIME int(11) NO 0
-BUSY_TIME double NO 0
-CPU_TIME double NO 0
-BYTES_RECEIVED bigint(21) NO 0
-BYTES_SENT bigint(21) NO 0
-BINLOG_BYTES_WRITTEN bigint(21) NO 0
-ROWS_READ bigint(21) NO 0
-ROWS_SENT bigint(21) NO 0
-ROWS_DELETED bigint(21) NO 0
-ROWS_INSERTED bigint(21) NO 0
-ROWS_UPDATED bigint(21) NO 0
-SELECT_COMMANDS bigint(21) NO 0
-UPDATE_COMMANDS bigint(21) NO 0
-OTHER_COMMANDS bigint(21) NO 0
-COMMIT_TRANSACTIONS bigint(21) NO 0
-ROLLBACK_TRANSACTIONS bigint(21) NO 0
-DENIED_CONNECTIONS bigint(21) NO 0
-LOST_CONNECTIONS bigint(21) NO 0
-ACCESS_DENIED bigint(21) NO 0
-EMPTY_QUERIES bigint(21) NO 0
-show columns from information_schema.index_statistics;
-Field Type Null Key Default Extra
-TABLE_SCHEMA varchar(192) NO
-TABLE_NAME varchar(192) NO
-INDEX_NAME varchar(192) NO
-ROWS_READ bigint(21) NO 0
-show columns from information_schema.table_statistics;
-Field Type Null Key Default Extra
-TABLE_SCHEMA varchar(192) NO
-TABLE_NAME varchar(192) NO
-ROWS_READ bigint(21) NO 0
-ROWS_CHANGED bigint(21) NO 0
-ROWS_CHANGED_X_INDEXES bigint(21) NO 0
-set @save_general_log=@@global.general_log;
-set @@global.general_log=0;
-set @@global.userstat=1;
-flush status;
-create table t1 (a int, primary key (a), b int default 0) engine=innodb;
-insert into t1 (a) values (1),(2),(3),(4);
-update t1 set b=1;
-update t1 set b=5 where a=2;
-delete from t1 where a=3;
-/* Empty query */
-select * from t1 where a=999;
-a b
-drop table t1;
-create table t1 (a int, primary key (a), b int default 0) engine=innodb;
-begin;
-insert into t1 values(1,1);
-commit;
-begin;
-insert into t1 values(2,2);
-commit;
-begin;
-insert into t1 values(3,3);
-rollback;
-drop table t1;
-select sleep(1);
-sleep(1)
-0
-show status like "rows%";
-Variable_name Value
-Rows_read 6
-Rows_sent 1
-Rows_tmp_read 0
-show status like "ha%";
-Variable_name Value
-Handler_commit 19
-Handler_delete 1
-Handler_discover 0
-Handler_external_lock 0
-Handler_icp_attempts 0
-Handler_icp_match 0
-Handler_mrr_init 0
-Handler_mrr_key_refills 0
-Handler_mrr_rowid_refills 0
-Handler_prepare 18
-Handler_read_first 0
-Handler_read_key 9
-Handler_read_last 0
-Handler_read_next 0
-Handler_read_prev 0
-Handler_read_retry 0
-Handler_read_rnd 0
-Handler_read_rnd_deleted 0
-Handler_read_rnd_next 5
-Handler_rollback 2
-Handler_savepoint 0
-Handler_savepoint_rollback 0
-Handler_tmp_update 0
-Handler_tmp_write 0
-Handler_update 5
-Handler_write 7
-select variable_value - @global_read_key as "handler_read_key" from information_schema.global_status where variable_name="handler_read_key";
-handler_read_key
-9
-set @@global.userstat=0;
-select * from information_schema.index_statistics;
-TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
-select * from information_schema.table_statistics;
-TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
-show table_statistics;
-Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
-show index_statistics;
-Table_schema Table_name Index_name Rows_read
-select TOTAL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;;
-TOTAL_CONNECTIONS 1
-CONCURRENT_CONNECTIONS 0
-ROWS_READ 6
-ROWS_SENT 2
-ROWS_DELETED 1
-ROWS_INSERTED 7
-ROWS_UPDATED 5
-SELECT_COMMANDS 3
-UPDATE_COMMANDS 11
-OTHER_COMMANDS 7
-COMMIT_TRANSACTIONS 19
-ROLLBACK_TRANSACTIONS 2
-DENIED_CONNECTIONS 0
-LOST_CONNECTIONS 0
-ACCESS_DENIED 0
-EMPTY_QUERIES 1
-select TOTAL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;;
-TOTAL_CONNECTIONS 1
-CONCURRENT_CONNECTIONS 0
-ROWS_READ 6
-ROWS_SENT 2
-ROWS_DELETED 1
-ROWS_INSERTED 7
-ROWS_UPDATED 5
-SELECT_COMMANDS 3
-UPDATE_COMMANDS 11
-OTHER_COMMANDS 7
-COMMIT_TRANSACTIONS 19
-ROLLBACK_TRANSACTIONS 2
-DENIED_CONNECTIONS 0
-LOST_CONNECTIONS 0
-ACCESS_DENIED 0
-EMPTY_QUERIES 1
-flush table_statistics;
-flush index_statistics;
-select * from information_schema.index_statistics;
-TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
-select * from information_schema.table_statistics;
-TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
-show status like "%statistics%";
-Variable_name Value
-Com_show_client_statistics 0
-Com_show_index_statistics 1
-Com_show_table_statistics 1
-Com_show_user_statistics 0
-select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
-bytes_sent <> 0, binlog_bytes_written <> 0
-from information_schema.user_statistics;
-connected_time <> 0 busy_time <> 0 bytes_received <> 0 bytes_sent <> 0 binlog_bytes_written <> 0
-1 1 1 1 1
-select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
-bytes_sent <> 0, binlog_bytes_written <> 0
-from information_schema.client_statistics;
-connected_time <> 0 busy_time <> 0 bytes_received <> 0 bytes_sent <> 0 binlog_bytes_written <> 0
-1 1 1 1 1
-create table t1 (a int) engine=innodb;
-select @@in_transaction;
-@@in_transaction
-0
-begin;
-select @@in_transaction;
-@@in_transaction
-1
-insert into t1 values (1);
-select @@in_transaction;
-@@in_transaction
-1
-commit;
-select @@in_transaction;
-@@in_transaction
-0
-set @@autocommit=0;
-select @@in_transaction;
-@@in_transaction
-0
-insert into t1 values (2);
-select @@in_transaction;
-@@in_transaction
-1
-set @@autocommit=1;
-select @@in_transaction;
-@@in_transaction
-0
-drop table t1;
-set @@global.general_log=@save_general_log;
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 2cedb32ad87..68efe3df8d0 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -778,7 +778,7 @@ ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 VALUES ('-100E+1');
ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 VALUES ('-100E');
-ERROR 22007: Incorrect decimal value: '-100E' for column 'col1' at row 1
+ERROR 01000: Data truncated for column 'col1' at row 1
UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11;
ERROR 22003: Out of range value for column 'col1' at row 6
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
@@ -790,10 +790,10 @@ ERROR 22007: Incorrect decimal value: '' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('a59b');
ERROR 22007: Incorrect decimal value: 'a59b' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('1a');
-ERROR 22007: Incorrect decimal value: '1a' for column 'col1' at row 1
+ERROR 01000: Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
Warnings:
-Note 1265 Data truncated for column 'col1' at row 1
+Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0);
Warnings:
Warning 1365 Division by 0
@@ -853,9 +853,9 @@ ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
ERROR 22012: Division by 0
INSERT INTO t1 (col1) VALUES ('');
-ERROR 01000: Data truncated for column 'col1' at row 1
+ERROR 22007: Incorrect double value: '' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('a59b');
-ERROR 01000: Data truncated for column 'col1' at row 1
+ERROR 22007: Incorrect double value: 'a59b' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('1a');
ERROR 01000: Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
@@ -903,9 +903,9 @@ ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
ERROR 22012: Division by 0
INSERT INTO t1 (col1) VALUES ('');
-ERROR 01000: Data truncated for column 'col1' at row 1
+ERROR 22007: Incorrect double value: '' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('a59b');
-ERROR 01000: Data truncated for column 'col1' at row 1
+ERROR 22007: Incorrect double value: 'a59b' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('1a');
ERROR 01000: Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
@@ -1125,6 +1125,8 @@ ERROR 22007: Truncated incorrect INTEGER value: '10a'
insert into t1 (col2) values (cast('10' as unsigned integer));
insert into t1 (col2) values (cast('10' as signed integer));
insert into t1 (col2) values (10E+0 + '0 ');
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '0 '
select * from t1;
col1 col2
NULL 10
@@ -1265,22 +1267,22 @@ d
2000-10-01
drop table t1;
set @@sql_mode='traditional';
-create table t1(a int, b timestamp);
+create table t1(a int, b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
alter table t1 add primary key(a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
-create table t1(a int, b timestamp default 20050102030405);
+create table t1(a int, b timestamp not null default 20050102030405);
alter table t1 add primary key(a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` timestamp NOT NULL DEFAULT '2005-01-02 03:04:05',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 79b2810d529..40f936fb3b4 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -130,12 +130,16 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
(SELECT 'b',2,'a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
1
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
ERROR 21000: Operand should contain 1 column(s)
SELECT 1 as a,(SELECT a+a) b,(SELECT b);
@@ -402,13 +406,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
+Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -1052,6 +1056,8 @@ create table t1 (a float);
select 10.5 IN (SELECT * from t1 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t1;
create table t1 (a int, b int, c varchar(10));
@@ -1253,7 +1259,7 @@ a
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL DEFAULT '0'
+ `a` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int);
@@ -3696,8 +3702,8 @@ WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
ORDER BY t1.t DESC LIMIT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index
-2 SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index
+1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index
+2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 5 Using where; Using index
SELECT * FROM t1,t2
WHERE t1.t = (SELECT t1.t FROM t1
WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
@@ -4663,6 +4669,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -4693,7 +4701,7 @@ pk
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
-End of 5.0 tests.
+# End of 5.0 tests.
create table t_out (subcase char(3),
a1 char(2), b1 char(2), c1 char(2));
create table t_in (a2 char(2), b2 char(2), c2 char(2));
@@ -5130,8 +5138,9 @@ SELECT a FROM t1 WHERE a = 2
a
1
2
-SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
-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 ')' at line 1
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a) q;
+a
+1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
a
1
@@ -5173,7 +5182,7 @@ a 1
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
-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 ')) ON 1' at line 1
+ERROR 42000: Every derived table must have its own alias
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
@@ -5292,7 +5301,10 @@ SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
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 'UNION SELECT 1 ) )' at line 1
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
-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 ') UNION SELECT 1 )' at line 1
+ERROR 42000: Every derived table must have its own alias
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ) a;
+1
+1
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
1
1
@@ -5564,7 +5576,7 @@ insert into t2 values ('x'), ('y');
select * from t2 where a=(select a from t1) and a='x';
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
-End of 5.1 tests
+# End of 5.1 tests
#
# Bug #11765713 58705:
# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
@@ -5931,6 +5943,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -6174,7 +6188,7 @@ WHERE (c_sq1_alias1.col_int_nokey != @var2
OR c_sq1_alias1.pk != @var3)) ) AS alias3;
pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey
DROP TABLE t1,t2;
-End of 5.2 tests
+# End of 5.2 tests
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in
#
@@ -6310,12 +6324,22 @@ SELECT 1 FROM t1 WHERE a =
ORDER BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT 1 FROM t1 WHERE a =
(SELECT 1 FROM t2 WHERE b =
(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2)
GROUP BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
DROP TABLE t1, t2;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@@ -6976,7 +7000,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7010,7 +7034,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7212,3 +7236,32 @@ a
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
+# End of 10.0 tests
+#
+# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops
+# with UNION in ALL subquery
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo');
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' );
+f
+foo
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar');
+f
+foo
+drop table t1;
+SET NAMES default;
+#
+# MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loops
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT UNSIGNED) ENGINE=MyISAM;
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo' UNION SELECT 'bar' );
+f1 f2 f3
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo');
+f1 f2 f3
+DROP TABLE t1, t2;
+SET NAMES default;
+# End of 10.1 tests
diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result
index 401d333ccfb..a54080f6cb4 100644
--- a/mysql-test/r/subselect2.result
+++ b/mysql-test/r/subselect2.result
@@ -287,7 +287,7 @@ ORDER BY mirror_date ASC
) AS calculated_result;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
-2 DERIVED t1 range date date 9 NULL 2 Using index condition; Using where; Rowid-ordered scan; Using filesort
+2 DERIVED t1 range date date 6 NULL 2 Using index condition; Using where; Rowid-ordered scan; Using filesort
SELECT * FROM (
SELECT node_uid, date, mirror_date, @result := 0 AS result
FROM t1
@@ -310,7 +310,7 @@ ORDER BY mirror_date ASC
) AS calculated_result;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
-2 DERIVED t1 range date date 9 NULL 2 Using index condition; Using where; Using filesort
+2 DERIVED t1 range date date 6 NULL 2 Using index condition; Using where; Using filesort
SELECT * FROM (
SELECT node_uid, date, mirror_date, @result := 0 AS result
FROM t1
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index 9d88d0da778..b495b0a2fa9 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -890,6 +890,7 @@ ERROR 42S22: Unknown column 'c' in 'field list'
SHOW WARNINGS;
Level Code Message
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
+Note 1981 Aggregate function 'count()' of SELECT #3 belongs to SELECT #2
Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
Error 1054 Unknown column 'c' in 'field list'
DROP TABLE t1;
diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result
index 069b9a32ae5..2e2da205fc3 100644
--- a/mysql-test/r/subselect3_jcl6.result
+++ b/mysql-test/r/subselect3_jcl6.result
@@ -900,6 +900,7 @@ ERROR 42S22: Unknown column 'c' in 'field list'
SHOW WARNINGS;
Level Code Message
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
+Note 1981 Aggregate function 'count()' of SELECT #3 belongs to SELECT #2
Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
Error 1054 Unknown column 'c' in 'field list'
DROP TABLE t1;
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index 2b9e952652e..4e70615120f 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -427,6 +427,8 @@ KEY `varchar_key` (`varchar_key`)
INSERT INTO `t1` VALUES (10,'00:00:00','i','i'),(11,'00:00:00','','');
set @old_optimizer_switch = @@session.optimizer_switch;
SET SESSION OPTIMIZER_SWITCH = 'materialization=off,semijoin=off,loosescan=off,firstmatch=off,mrr=on,engine_condition_pushdown=on';
+Warnings:
+Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release.
SELECT `time_nokey` G1 FROM t1 WHERE ( `varchar_nokey` , `varchar_key` ) IN (
SELECT `varchar_nokey` , `varchar_nokey` ) AND `varchar_key` >= 'c' HAVING G1 ORDER
BY `pk` ;
@@ -615,6 +617,8 @@ INSERT INTO t2 VALUES (9,1);
# Enable Index condition pushdown
set @old_icp=@@optimizer_switch;
SET SESSION optimizer_switch="engine_condition_pushdown=on";
+Warnings:
+Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release.
SELECT pk
FROM t2
@@ -2487,3 +2491,15 @@ field COUNT(DISTINCT c)
drop table t1,t2;
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;
+#
+# MDEV-10232 Scalar result of subquery changes after adding an outer select stmt
+#
+create table t1(c1 int, c2 int, primary key(c2));
+insert into t1 values(2,1),(1,2);
+select (select c1 from t1 group by c1,c2 order by c1 limit 1) as x;
+x
+1
+(select c1 from t1 group by c1,c2 order by c1 limit 1);
+c1
+1
+drop table t1;
diff --git a/mysql-test/r/subselect_cache.result b/mysql-test/r/subselect_cache.result
index 03d683de0d8..97a5f5a77f6 100644
--- a/mysql-test/r/subselect_cache.result
+++ b/mysql-test/r/subselect_cache.result
@@ -40,6 +40,231 @@ Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 31
+analyze format=json
+select a, (select d from t2 where b=c) from t1;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "subqueries": [
+ {
+ "expression_cache": {
+ "r_loops": 10,
+ "r_hit_ratio": 60,
+ "query_block": {
+ "select_id": 2,
+ "r_loops": 4,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 4,
+ "rows": 4,
+ "r_rows": 4,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 18.75,
+ "attached_condition": "(t1.b = t2.c)"
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+analyze format=json
+select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 10,
+ "r_rows": 10,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "subqueries": [
+ {
+ "expression_cache": {
+ "r_loops": 10,
+ "r_hit_ratio": 60,
+ "query_block": {
+ "union_result": {
+ "table_name": "<union3,4>",
+ "access_type": "ALL",
+ "r_loops": 4,
+ "r_rows": 1,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 3,
+ "r_loops": 4,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 4,
+ "rows": 4,
+ "r_rows": 4,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 18.75,
+ "attached_condition": "(t1.b = t2.c)"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 4,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "expression_cache": {
+ "r_loops": 10,
+ "r_hit_ratio": 60,
+ "query_block": {
+ "select_id": 2,
+ "r_loops": 4,
+ "r_total_time_ms": "REPLACED",
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 4,
+ "rows": 4,
+ "r_rows": 4,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 18.75,
+ "attached_condition": "(t1.b = t2.c)"
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+explain format=json
+select a, (select d from t2 where b=c) from t1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "subqueries": [
+ {
+ "expression_cache": {
+ "state": "uninitialized",
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 4,
+ "filtered": 100,
+ "attached_condition": "(t1.b = t2.c)"
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+explain format=json
+select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "subqueries": [
+ {
+ "expression_cache": {
+ "state": "uninitialized",
+ "query_block": {
+ "union_result": {
+ "table_name": "<union3,4>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 3,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 4,
+ "filtered": 100,
+ "attached_condition": "(t1.b = t2.c)"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 4,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "expression_cache": {
+ "state": "uninitialized",
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 4,
+ "filtered": 100,
+ "attached_condition": "(t1.b = t2.c)"
+ }
+ }
+ }
+ }
+ ]
+ }
+}
set optimizer_switch='subquery_cache=off';
flush status;
select a, (select d from t2 where b=c) from t1;
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index 15f1d6377e3..240a6ab47e4 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -296,8 +296,6 @@ INSERT INTO t1 VALUES ('2011-05-13', 0);
SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a);
a b
2011-05-13 0
-Warnings:
-Warning 1292 Incorrect datetime value: '0'
DROP TABLE t1;
#
# Bug #11766300 59387: FAILING ASSERTION: CURSOR->POS_STATE == 1997660512 (BTR_PCUR_IS_POSITIONE
@@ -578,3 +576,42 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL #
2 DEPENDENT SUBQUERY t2 ref key1 key1 5 test.t1.a # Using where; Using filesort
drop table t1,t2;
+#
+# mdev-12931: semi-join in ON expression of STRAIGHT_JOIN
+# joining a base table and a mergeable derived table
+#
+CREATE TABLE t1 (f1 int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (3),(2);
+CREATE TABLE t2 (f2 int) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(4);
+CREATE TABLE t3 (f3 int) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (5),(6);
+CREATE TABLE t4 (f4 int) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (1),(8);
+SELECT *
+FROM t1
+INNER JOIN
+( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
+ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
+ON ( f1 >= f2 );
+f1 f2 f3
+3 1 5
+2 1 5
+3 1 6
+2 1 6
+EXPLAIN EXTENDED
+SELECT *
+FROM t1
+INNER JOIN
+( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
+ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
+ON ( f1 >= f2 );
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (incremental, BNL join)
+3 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` semi join (`test`.`t4`) join `test`.`t3` where ((`test`.`t4`.`f4` = 1) and (`test`.`t1`.`f1` >= `test`.`t2`.`f2`))
+DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result
index db51bbb8186..934aca92f9f 100644
--- a/mysql-test/r/subselect_mat.result
+++ b/mysql-test/r/subselect_mat.result
@@ -103,7 +103,7 @@ explain extended
select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1i index NULL # 18 # 3 100.00 #
-2 MATERIALIZED t2i index it2i1,it2i3 # 9 # 5 100.00 #
+2 MATERIALIZED t2i range it2i1,it2i3 # 9 # 5 100.00 #
Warnings:
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <expr_cache><`test`.`t1i`.`a1`>(<in_optimizer>(`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( <materialize> (select max(`test`.`t2i`.`b1`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1` ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where ((`test`.`t1i`.`a1` = `<subquery2>`.`max(b1)`))))))
select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b1);
@@ -545,6 +545,10 @@ Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`
select * from t1 group by (a1 in (select col from columns));
a1 a2
1 - 00 2 - 00
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1 - 00'
+Warning 1292 Truncated incorrect DOUBLE value: '1 - 01'
+Warning 1292 Truncated incorrect DOUBLE value: '1 - 02'
/* ORDER BY clause */
explain extended
select * from t1 order by (select col from columns limit 1);
@@ -758,6 +762,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_512
@@ -771,6 +779,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_512, t2_512, t3_512;
set @blob_len = 1024;
set @suffix_len = @blob_len - @prefix_len;
@@ -851,6 +863,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
@@ -864,6 +880,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
@@ -944,6 +964,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
@@ -957,6 +981,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));
@@ -1111,6 +1139,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1
+Note 1981 Aggregate function 'max()' of SELECT #3 belongs to SELECT #1
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>(<in_optimizer>(`test`.`t1`.`a`,<exists>(select `test`.`t2`.`c` from `test`.`t2` where (<nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>(<in_optimizer>(`test`.`t2`.`d`,<exists>(select `test`.`t3`.`e` from `test`.`t3` where (max(`test`.`t1`.`b`) = `test`.`t3`.`e`) having (<cache>(`test`.`t2`.`d`) >= <ref_null_helper>(`test`.`t3`.`e`)))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`c`)))))
select a from t1 group by a
having a in (select c from t2 where d >= some(select e from t3 where max(b)=e));
@@ -2433,6 +2462,19 @@ PREPARE stmt FROM '
EXECUTE stmt;
EXECUTE stmt;
DROP TABLE t1,t2,t3;
+#
+# MDEV-10389: Query returns different results on a debug vs non-debug build of the same revision
+#
+CREATE TABLE t1 (i1 INT, i2 INT NOT NULL);
+INSERT INTO t1 VALUES (1,4),(2,6);
+SELECT * FROM t1 AS alias1
+WHERE alias1.i1 IN (
+SELECT i1 FROM t1 WHERE alias1.i2 IN ( SELECT i2 FROM t1 HAVING i2 <> 7 )
+);
+i1 i2
+1 4
+2 6
+DROP TABLE t1;
set @subselect_mat_test_optimizer_switch_value=null;
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
@@ -2714,3 +2756,18 @@ a b sq
4 4 1
4 2 1
drop table t1, t2;
+#
+# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
+# UNION ALL
+#
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+INSERT INTO t1 VALUES (1),(2);
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) LIMIT 0 )
+UNION ALL
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) )
+;
+1
+1
+1
+drop table t1, t2;
diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result
index 7b2054f4a67..a23820820ef 100644
--- a/mysql-test/r/subselect_no_exists_to_in.result
+++ b/mysql-test/r/subselect_no_exists_to_in.result
@@ -134,12 +134,16 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
(SELECT 'b',2,'a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
1
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
ERROR 21000: Operand should contain 1 column(s)
SELECT 1 as a,(SELECT a+a) b,(SELECT b);
@@ -406,13 +410,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
+Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -1056,6 +1060,8 @@ create table t1 (a float);
select 10.5 IN (SELECT * from t1 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t1;
create table t1 (a int, b int, c varchar(10));
@@ -1257,7 +1263,7 @@ a
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL DEFAULT '0'
+ `a` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int);
@@ -3699,8 +3705,8 @@ WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
ORDER BY t1.t DESC LIMIT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index
-2 SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index
+1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index
+2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 5 Using where; Using index
SELECT * FROM t1,t2
WHERE t1.t = (SELECT t1.t FROM t1
WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
@@ -4665,6 +4671,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -4695,7 +4703,7 @@ pk
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
-End of 5.0 tests.
+# End of 5.0 tests.
create table t_out (subcase char(3),
a1 char(2), b1 char(2), c1 char(2));
create table t_in (a2 char(2), b2 char(2), c2 char(2));
@@ -5132,8 +5140,9 @@ SELECT a FROM t1 WHERE a = 2
a
1
2
-SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
-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 ')' at line 1
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a) q;
+a
+1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
a
1
@@ -5175,7 +5184,7 @@ a 1
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
-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 ')) ON 1' at line 1
+ERROR 42000: Every derived table must have its own alias
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
@@ -5294,7 +5303,10 @@ SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
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 'UNION SELECT 1 ) )' at line 1
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
-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 ') UNION SELECT 1 )' at line 1
+ERROR 42000: Every derived table must have its own alias
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ) a;
+1
+1
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
1
1
@@ -5566,7 +5578,7 @@ insert into t2 values ('x'), ('y');
select * from t2 where a=(select a from t1) and a='x';
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
-End of 5.1 tests
+# End of 5.1 tests
#
# Bug #11765713 58705:
# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
@@ -5931,6 +5943,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -6174,7 +6188,7 @@ WHERE (c_sq1_alias1.col_int_nokey != @var2
OR c_sq1_alias1.pk != @var3)) ) AS alias3;
pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey
DROP TABLE t1,t2;
-End of 5.2 tests
+# End of 5.2 tests
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in
#
@@ -6310,12 +6324,22 @@ SELECT 1 FROM t1 WHERE a =
ORDER BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT 1 FROM t1 WHERE a =
(SELECT 1 FROM t2 WHERE b =
(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2)
GROUP BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
DROP TABLE t1, t2;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@@ -6976,7 +7000,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7010,7 +7034,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7212,6 +7236,35 @@ a
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
+# End of 10.0 tests
+#
+# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops
+# with UNION in ALL subquery
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo');
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' );
+f
+foo
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar');
+f
+foo
+drop table t1;
+SET NAMES default;
+#
+# MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loops
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT UNSIGNED) ENGINE=MyISAM;
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo' UNION SELECT 'bar' );
+f1 f2 f3
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo');
+f1 f2 f3
+DROP TABLE t1, t2;
+SET NAMES default;
+# End of 10.1 tests
set optimizer_switch=default;
select @@optimizer_switch like '%exists_to_in=off%';
@@optimizer_switch like '%exists_to_in=off%'
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index 51c5263ad8a..baa74307f89 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -137,12 +137,16 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
(SELECT 'b',2,'a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
1
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
ERROR 21000: Operand should contain 1 column(s)
SELECT 1 as a,(SELECT a+a) b,(SELECT b);
@@ -409,13 +413,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
+Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -1059,6 +1063,8 @@ create table t1 (a float);
select 10.5 IN (SELECT * from t1 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t1;
create table t1 (a int, b int, c varchar(10));
@@ -1260,7 +1266,7 @@ a
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL DEFAULT '0'
+ `a` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int);
@@ -3699,8 +3705,8 @@ WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
ORDER BY t1.t DESC LIMIT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index
-2 SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index
+1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index
+2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 5 Using where; Using index
SELECT * FROM t1,t2
WHERE t1.t = (SELECT t1.t FROM t1
WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
@@ -4663,6 +4669,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -4693,7 +4701,7 @@ pk
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
-End of 5.0 tests.
+# End of 5.0 tests.
create table t_out (subcase char(3),
a1 char(2), b1 char(2), c1 char(2));
create table t_in (a2 char(2), b2 char(2), c2 char(2));
@@ -5130,8 +5138,9 @@ SELECT a FROM t1 WHERE a = 2
a
1
2
-SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
-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 ')' at line 1
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a) q;
+a
+1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
a
1
@@ -5173,7 +5182,7 @@ a 1
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
-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 ')) ON 1' at line 1
+ERROR 42000: Every derived table must have its own alias
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
@@ -5292,7 +5301,10 @@ SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
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 'UNION SELECT 1 ) )' at line 1
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
-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 ') UNION SELECT 1 )' at line 1
+ERROR 42000: Every derived table must have its own alias
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ) a;
+1
+1
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
1
1
@@ -5564,7 +5576,7 @@ insert into t2 values ('x'), ('y');
select * from t2 where a=(select a from t1) and a='x';
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
-End of 5.1 tests
+# End of 5.1 tests
#
# Bug #11765713 58705:
# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
@@ -5928,6 +5940,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -6169,7 +6183,7 @@ WHERE (c_sq1_alias1.col_int_nokey != @var2
OR c_sq1_alias1.pk != @var3)) ) AS alias3;
pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey
DROP TABLE t1,t2;
-End of 5.2 tests
+# End of 5.2 tests
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in
#
@@ -6305,12 +6319,22 @@ SELECT 1 FROM t1 WHERE a =
ORDER BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT 1 FROM t1 WHERE a =
(SELECT 1 FROM t2 WHERE b =
(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2)
GROUP BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
DROP TABLE t1, t2;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@@ -6970,7 +6994,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7003,7 +7027,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7205,6 +7229,35 @@ a
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
+# End of 10.0 tests
+#
+# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops
+# with UNION in ALL subquery
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo');
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' );
+f
+foo
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar');
+f
+foo
+drop table t1;
+SET NAMES default;
+#
+# MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loops
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT UNSIGNED) ENGINE=MyISAM;
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo' UNION SELECT 'bar' );
+f1 f2 f3
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo');
+f1 f2 f3
+DROP TABLE t1, t2;
+SET NAMES default;
+# End of 10.1 tests
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
@@optimizer_switch like '%materialization=on%'
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index 574af7b4d1f..039f2fe1a9e 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -133,12 +133,16 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
(SELECT 'b',2,'a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
1
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
ERROR 21000: Operand should contain 1 column(s)
SELECT 1 as a,(SELECT a+a) b,(SELECT b);
@@ -405,13 +409,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
+Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -1055,6 +1059,8 @@ create table t1 (a float);
select 10.5 IN (SELECT * from t1 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t1;
create table t1 (a int, b int, c varchar(10));
@@ -1256,7 +1262,7 @@ a
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL DEFAULT '0'
+ `a` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int);
@@ -3695,8 +3701,8 @@ WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
ORDER BY t1.t DESC LIMIT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index
-2 SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index
+1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index
+2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 5 Using where; Using index
SELECT * FROM t1,t2
WHERE t1.t = (SELECT t1.t FROM t1
WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
@@ -4659,6 +4665,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -4689,7 +4697,7 @@ pk
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
-End of 5.0 tests.
+# End of 5.0 tests.
create table t_out (subcase char(3),
a1 char(2), b1 char(2), c1 char(2));
create table t_in (a2 char(2), b2 char(2), c2 char(2));
@@ -5126,8 +5134,9 @@ SELECT a FROM t1 WHERE a = 2
a
1
2
-SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
-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 ')' at line 1
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a) q;
+a
+1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
a
1
@@ -5169,7 +5178,7 @@ a 1
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
-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 ')) ON 1' at line 1
+ERROR 42000: Every derived table must have its own alias
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
@@ -5288,7 +5297,10 @@ SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
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 'UNION SELECT 1 ) )' at line 1
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
-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 ') UNION SELECT 1 )' at line 1
+ERROR 42000: Every derived table must have its own alias
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ) a;
+1
+1
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
1
1
@@ -5560,7 +5572,7 @@ insert into t2 values ('x'), ('y');
select * from t2 where a=(select a from t1) and a='x';
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
-End of 5.1 tests
+# End of 5.1 tests
#
# Bug #11765713 58705:
# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
@@ -5924,6 +5936,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -6165,7 +6179,7 @@ WHERE (c_sq1_alias1.col_int_nokey != @var2
OR c_sq1_alias1.pk != @var3)) ) AS alias3;
pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey
DROP TABLE t1,t2;
-End of 5.2 tests
+# End of 5.2 tests
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in
#
@@ -6301,12 +6315,22 @@ SELECT 1 FROM t1 WHERE a =
ORDER BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT 1 FROM t1 WHERE a =
(SELECT 1 FROM t2 WHERE b =
(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2)
GROUP BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
DROP TABLE t1, t2;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@@ -6967,7 +6991,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7001,7 +7025,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7203,4 +7227,33 @@ a
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
+# End of 10.0 tests
+#
+# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops
+# with UNION in ALL subquery
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo');
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' );
+f
+foo
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar');
+f
+foo
+drop table t1;
+SET NAMES default;
+#
+# MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loops
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT UNSIGNED) ENGINE=MyISAM;
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo' UNION SELECT 'bar' );
+f1 f2 f3
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo');
+f1 f2 f3
+DROP TABLE t1, t2;
+SET NAMES default;
+# End of 10.1 tests
set @optimizer_switch_for_subselect_test=null;
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index 03285cf2968..0ce77bbb376 100644
--- a/mysql-test/r/subselect_no_scache.result
+++ b/mysql-test/r/subselect_no_scache.result
@@ -136,12 +136,16 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
(SELECT 'b',2,'a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
1
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
ERROR 21000: Operand should contain 1 column(s)
SELECT 1 as a,(SELECT a+a) b,(SELECT b);
@@ -408,13 +412,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
+Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -1058,6 +1062,8 @@ create table t1 (a float);
select 10.5 IN (SELECT * from t1 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t1;
create table t1 (a int, b int, c varchar(10));
@@ -1259,7 +1265,7 @@ a
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL DEFAULT '0'
+ `a` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int);
@@ -3702,8 +3708,8 @@ WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
ORDER BY t1.t DESC LIMIT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index
-2 SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index
+1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index
+2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 5 Using where; Using index
SELECT * FROM t1,t2
WHERE t1.t = (SELECT t1.t FROM t1
WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
@@ -4669,6 +4675,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -4699,7 +4707,7 @@ pk
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
-End of 5.0 tests.
+# End of 5.0 tests.
create table t_out (subcase char(3),
a1 char(2), b1 char(2), c1 char(2));
create table t_in (a2 char(2), b2 char(2), c2 char(2));
@@ -5136,8 +5144,9 @@ SELECT a FROM t1 WHERE a = 2
a
1
2
-SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
-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 ')' at line 1
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a) q;
+a
+1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
a
1
@@ -5179,7 +5188,7 @@ a 1
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
-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 ')) ON 1' at line 1
+ERROR 42000: Every derived table must have its own alias
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
@@ -5298,7 +5307,10 @@ SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
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 'UNION SELECT 1 ) )' at line 1
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
-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 ') UNION SELECT 1 )' at line 1
+ERROR 42000: Every derived table must have its own alias
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ) a;
+1
+1
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
1
1
@@ -5570,7 +5582,7 @@ insert into t2 values ('x'), ('y');
select * from t2 where a=(select a from t1) and a='x';
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
-End of 5.1 tests
+# End of 5.1 tests
#
# Bug #11765713 58705:
# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
@@ -5937,6 +5949,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -6180,7 +6194,7 @@ WHERE (c_sq1_alias1.col_int_nokey != @var2
OR c_sq1_alias1.pk != @var3)) ) AS alias3;
pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey
DROP TABLE t1,t2;
-End of 5.2 tests
+# End of 5.2 tests
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in
#
@@ -6316,12 +6330,22 @@ SELECT 1 FROM t1 WHERE a =
ORDER BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT 1 FROM t1 WHERE a =
(SELECT 1 FROM t2 WHERE b =
(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2)
GROUP BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
DROP TABLE t1, t2;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@@ -6982,7 +7006,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7016,7 +7040,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7218,6 +7242,35 @@ a
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
+# End of 10.0 tests
+#
+# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops
+# with UNION in ALL subquery
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo');
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' );
+f
+foo
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar');
+f
+foo
+drop table t1;
+SET NAMES default;
+#
+# MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loops
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT UNSIGNED) ENGINE=MyISAM;
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo' UNION SELECT 'bar' );
+f1 f2 f3
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo');
+f1 f2 f3
+DROP TABLE t1, t2;
+SET NAMES default;
+# End of 10.1 tests
set optimizer_switch=default;
select @@optimizer_switch like '%subquery_cache=on%';
@@optimizer_switch like '%subquery_cache=on%'
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index 6669c27ede7..574e78122f1 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -133,12 +133,16 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
(SELECT 'b',2,'a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
1
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
ERROR 21000: Operand should contain 1 column(s)
SELECT 1 as a,(SELECT a+a) b,(SELECT b);
@@ -405,13 +409,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
+Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
Warnings:
-Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -1055,6 +1059,8 @@ create table t1 (a float);
select 10.5 IN (SELECT * from t1 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
+ERROR HY000: Incorrect usage of UNION and LIMIT
+select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1);
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t1;
create table t1 (a int, b int, c varchar(10));
@@ -1256,7 +1262,7 @@ a
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL DEFAULT '0'
+ `a` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int);
@@ -3695,8 +3701,8 @@ WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
ORDER BY t1.t DESC LIMIT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index
-2 SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index
+1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index
+2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 5 Using where; Using index
SELECT * FROM t1,t2
WHERE t1.t = (SELECT t1.t FROM t1
WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
@@ -4659,6 +4665,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -4689,7 +4697,7 @@ pk
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
-End of 5.0 tests.
+# End of 5.0 tests.
create table t_out (subcase char(3),
a1 char(2), b1 char(2), c1 char(2));
create table t_in (a2 char(2), b2 char(2), c2 char(2));
@@ -5126,8 +5134,9 @@ SELECT a FROM t1 WHERE a = 2
a
1
2
-SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
-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 ')' at line 1
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a) q;
+a
+1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
a
1
@@ -5169,7 +5178,7 @@ a 1
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
-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 ')) ON 1' at line 1
+ERROR 42000: Every derived table must have its own alias
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
@@ -5288,7 +5297,10 @@ SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
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 'UNION SELECT 1 ) )' at line 1
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
-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 ') UNION SELECT 1 )' at line 1
+ERROR 42000: Every derived table must have its own alias
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ) a;
+1
+1
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
1
1
@@ -5560,7 +5572,7 @@ insert into t2 values ('x'), ('y');
select * from t2 where a=(select a from t1) and a='x';
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
-End of 5.1 tests
+# End of 5.1 tests
#
# Bug #11765713 58705:
# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
@@ -5924,6 +5936,8 @@ SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
@@ -6165,7 +6179,7 @@ WHERE (c_sq1_alias1.col_int_nokey != @var2
OR c_sq1_alias1.pk != @var3)) ) AS alias3;
pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey
DROP TABLE t1,t2;
-End of 5.2 tests
+# End of 5.2 tests
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in
#
@@ -6301,12 +6315,22 @@ SELECT 1 FROM t1 WHERE a =
ORDER BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
SELECT 1 FROM t1 WHERE a =
(SELECT 1 FROM t2 WHERE b =
(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2)
GROUP BY b
);
1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
DROP TABLE t1, t2;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@@ -6967,7 +6991,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7001,7 +7025,7 @@ INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
@@ -7203,5 +7227,34 @@ a
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
+# End of 10.0 tests
+#
+# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops
+# with UNION in ALL subquery
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo');
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' );
+f
+foo
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar');
+f
+foo
+drop table t1;
+SET NAMES default;
+#
+# MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loops
+#
+SET NAMES utf8;
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT UNSIGNED) ENGINE=MyISAM;
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo' UNION SELECT 'bar' );
+f1 f2 f3
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo');
+f1 f2 f3
+DROP TABLE t1, t2;
+SET NAMES default;
+# End of 10.1 tests
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 79a98b3efa1..643034f452d 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -2094,6 +2094,9 @@ f1 f2 f3 f3
4 0 0 0
4 0 0 0
0 NULL NULL NULL
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'foo'
+Warning 1292 Truncated incorrect DOUBLE value: 'foo'
DROP TABLE t1, t2, t3, t4;
set @tmp803457=@@optimizer_switch;
#
@@ -2285,8 +2288,14 @@ CREATE TABLE t3 (a int, b int) ;
PREPARE st1 FROM "SELECT * FROM t2 LEFT JOIN t1 ON t2.a != 0 AND ('j','r') IN ( SELECT b,a FROM t3)";
EXECUTE st1;
a a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
EXECUTE st1;
a a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
DROP TABLE t1, t2, t3;
#
# BUG#849776: Wrong result with semijoin + "Impossible where"
@@ -2821,10 +2830,7 @@ col_varchar_nokey varchar(1) DEFAULT NULL,
PRIMARY KEY (pk),
KEY col_int_key (col_int_key),
KEY col_varchar_key (col_varchar_key, col_int_key)
-) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+);
INSERT INTO t1 VALUES
(10,8,'x','x'),
(11,7,'d','d'),
diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result
index e6259a3979b..21d97b3faea 100644
--- a/mysql-test/r/subselect_sj2.result
+++ b/mysql-test/r/subselect_sj2.result
@@ -703,7 +703,7 @@ create table t2 (id int, a int, primary key(id), key(a)) as select a as id, a as
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL DEFAULT '0',
+ `id` int(11) NOT NULL,
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `a` (`a`)
@@ -1092,6 +1092,27 @@ AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
COUNT(*)
3724
+EXPLAIN
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+WHERE alias5.b = alias4.b
+AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL 19 Using where
+1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d 1 Using index
+1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b 1 Using where; FirstMatch(alias3)
+1 PRIMARY alias2 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join)
+1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join)
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+WHERE alias5.b = alias4.b
+AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+COUNT(*)
+3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
#
diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result
index 64f7ab2e6bf..eb91fe6d61b 100644
--- a/mysql-test/r/subselect_sj2_jcl6.result
+++ b/mysql-test/r/subselect_sj2_jcl6.result
@@ -717,7 +717,7 @@ create table t2 (id int, a int, primary key(id), key(a)) as select a as id, a as
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL DEFAULT '0',
+ `id` int(11) NOT NULL,
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `a` (`a`)
@@ -1107,6 +1107,27 @@ AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
COUNT(*)
3724
+EXPLAIN
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+WHERE alias5.b = alias4.b
+AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL 19 Using where
+1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d 1 Using index
+1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b 1 Using where; FirstMatch(alias3)
+1 PRIMARY alias2 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join)
+1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using join buffer (incremental, BNL join)
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+WHERE alias5.b = alias4.b
+AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+COUNT(*)
+3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
#
diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result
index 5d0c64e9ddb..c8ee451c62f 100644
--- a/mysql-test/r/subselect_sj2_mat.result
+++ b/mysql-test/r/subselect_sj2_mat.result
@@ -705,7 +705,7 @@ create table t2 (id int, a int, primary key(id), key(a)) as select a as id, a as
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL DEFAULT '0',
+ `id` int(11) NOT NULL,
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `a` (`a`)
@@ -1094,6 +1094,27 @@ AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
COUNT(*)
3724
+EXPLAIN
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+WHERE alias5.b = alias4.b
+AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL 19 Using where
+1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d 1 Using index
+1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b 1 Using where; FirstMatch(alias3)
+1 PRIMARY alias2 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join)
+1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join)
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+WHERE alias5.b = alias4.b
+AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+COUNT(*)
+3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
#
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 2bc72acd478..6d9dc37345a 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -2108,6 +2108,9 @@ f1 f2 f3 f3
4 0 0 0
4 0 0 0
0 NULL NULL NULL
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'foo'
+Warning 1292 Truncated incorrect DOUBLE value: 'foo'
DROP TABLE t1, t2, t3, t4;
set @tmp803457=@@optimizer_switch;
#
@@ -2299,8 +2302,14 @@ CREATE TABLE t3 (a int, b int) ;
PREPARE st1 FROM "SELECT * FROM t2 LEFT JOIN t1 ON t2.a != 0 AND ('j','r') IN ( SELECT b,a FROM t3)";
EXECUTE st1;
a a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
EXECUTE st1;
a a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
DROP TABLE t1, t2, t3;
#
# BUG#849776: Wrong result with semijoin + "Impossible where"
@@ -2835,10 +2844,7 @@ col_varchar_nokey varchar(1) DEFAULT NULL,
PRIMARY KEY (pk),
KEY col_int_key (col_int_key),
KEY col_varchar_key (col_varchar_key, col_int_key)
-) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+);
INSERT INTO t1 VALUES
(10,8,'x','x'),
(11,7,'d','d'),
diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result
index 4feab0c78b0..3147c3dc0d9 100644
--- a/mysql-test/r/subselect_sj_mat.result
+++ b/mysql-test/r/subselect_sj_mat.result
@@ -107,7 +107,7 @@ select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1i index it1i1,it1i3 # 18 # 3 100.00 #
1 PRIMARY <subquery2> eq_ref distinct_key # 8 # 1 100.00 #
-2 MATERIALIZED t2i index it2i1,it2i3 # 9 # 5 100.00 #
+2 MATERIALIZED t2i range it2i1,it2i3 # 9 # 5 100.00 #
Warnings:
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (select max(`test`.`t2i`.`b1`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where (`<subquery2>`.`max(b1)` = `test`.`t1i`.`a1`)
select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b1);
@@ -566,6 +566,10 @@ Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`
select * from t1 group by (a1 in (select col from columns));
a1 a2
1 - 00 2 - 00
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1 - 00'
+Warning 1292 Truncated incorrect DOUBLE value: '1 - 01'
+Warning 1292 Truncated incorrect DOUBLE value: '1 - 02'
/* ORDER BY clause */
explain extended
select * from t1 order by (select col from columns limit 1);
@@ -783,6 +787,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_512
@@ -797,6 +805,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_512, t2_512, t3_512;
set @blob_len = 1024;
set @suffix_len = @blob_len - @prefix_len;
@@ -878,6 +890,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
@@ -892,6 +908,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
@@ -973,6 +993,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
@@ -987,6 +1011,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));
@@ -1145,6 +1173,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1
+Note 1981 Aggregate function 'max()' of SELECT #3 belongs to SELECT #1
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>(<in_optimizer>(`test`.`t1`.`a`,<exists>(select `test`.`t2`.`c` from `test`.`t2` where (<nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>(<in_optimizer>(`test`.`t2`.`d`,<exists>(select `test`.`t3`.`e` from `test`.`t3` where (max(`test`.`t1`.`b`) = `test`.`t3`.`e`) having (<cache>(`test`.`t2`.`d`) >= <ref_null_helper>(`test`.`t3`.`e`)))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`c`)))))
select a from t1 group by a
having a in (select c from t2 where d >= some(select e from t3 where max(b)=e));
@@ -2473,3 +2502,16 @@ PREPARE stmt FROM '
EXECUTE stmt;
EXECUTE stmt;
DROP TABLE t1,t2,t3;
+#
+# MDEV-10389: Query returns different results on a debug vs non-debug build of the same revision
+#
+CREATE TABLE t1 (i1 INT, i2 INT NOT NULL);
+INSERT INTO t1 VALUES (1,4),(2,6);
+SELECT * FROM t1 AS alias1
+WHERE alias1.i1 IN (
+SELECT i1 FROM t1 WHERE alias1.i2 IN ( SELECT i2 FROM t1 HAVING i2 <> 7 )
+);
+i1 i2
+1 4
+2 6
+DROP TABLE t1;
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 3218de4b225..63fc37300b2 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -202,6 +202,9 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
+select create_options from information_schema.tables where table_name='t1';
+create_options
+DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
# CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
# options should not fail. Per documentation newly created table
# should not inherit value of these options from the original table.
@@ -224,3 +227,15 @@ DROP DATABASE x;
CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
DATA DIRECTORY "MYSQLTEST_VARDIR/tmp";
DROP TABLE test.t1;
+use test;
+create table t1(c1 int, c2 int, c3 varchar(100)) engine=MyISAM data directory='MYSQL_TMP_DIR' index directory = 'MYSQL_TMP_DIR';
+insert t1 values (1,2,3), (2,3,4), (3,4,5), (4,5,6), (5,6,7), (6,7,8), (7,8,9);
+alter online table t1 delay_key_write=1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` varchar(100) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 DATA DIRECTORY='MYSQL_TMP_DIR/' INDEX DIRECTORY='MYSQL_TMP_DIR/'
+drop table t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 53797e2a0a4..bc4de8b4171 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -130,6 +130,8 @@ user CREATE TABLE `user` (
`authentication_string` text COLLATE utf8_bin NOT NULL,
`password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
+ `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000',
PRIMARY KEY (`Host`,`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
show create table func;
@@ -271,7 +273,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
diff --git a/mysql-test/r/system_mysql_db_fix30020.result b/mysql-test/r/system_mysql_db_fix30020.result
deleted file mode 100644
index 4c106ae2e5a..00000000000
--- a/mysql-test/r/system_mysql_db_fix30020.result
+++ /dev/null
@@ -1,311 +0,0 @@
-show tables;
-Tables_in_db
-column_stats
-columns_priv
-db
-event
-func
-general_log
-gtid_slave_pos
-help_category
-help_keyword
-help_relation
-help_topic
-host
-index_stats
-innodb_index_stats
-innodb_table_stats
-plugin
-proc
-procs_priv
-proxies_priv
-roles_mapping
-servers
-slow_log
-table_stats
-tables_priv
-time_zone
-time_zone_leap_second
-time_zone_name
-time_zone_transition
-time_zone_transition_type
-user
-show create table db;
-Table Create Table
-db CREATE TABLE `db` (
- `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- PRIMARY KEY (`Host`,`Db`,`User`),
- KEY `User` (`User`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
-show create table host;
-Table Create Table
-host CREATE TABLE `host` (
- `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- PRIMARY KEY (`Host`,`Db`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
-show create table user;
-Table Create Table
-user CREATE TABLE `user` (
- `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
- `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
- `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
- `ssl_cipher` blob NOT NULL,
- `x509_issuer` blob NOT NULL,
- `x509_subject` blob NOT NULL,
- `max_questions` int(11) unsigned NOT NULL DEFAULT '0',
- `max_updates` int(11) unsigned NOT NULL DEFAULT '0',
- `max_connections` int(11) unsigned NOT NULL DEFAULT '0',
- `max_user_connections` int(11) NOT NULL DEFAULT '0',
- `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '',
- `authentication_string` text COLLATE utf8_bin NOT NULL,
- `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
- PRIMARY KEY (`Host`,`User`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
-show create table func;
-Table Create Table
-func CREATE TABLE `func` (
- `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `ret` tinyint(1) NOT NULL DEFAULT '0',
- `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
- `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL,
- PRIMARY KEY (`name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
-show create table tables_priv;
-Table Create Table
-tables_priv CREATE TABLE `tables_priv` (
- `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
- `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
- PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
- KEY `Grantor` (`Grantor`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
-show create table columns_priv;
-Table Create Table
-columns_priv CREATE TABLE `columns_priv` (
- `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
- PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
-show create table procs_priv;
-Table Create Table
-procs_priv CREATE TABLE `procs_priv` (
- `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
- `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
- `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
- `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
- `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
- `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
- KEY `Grantor` (`Grantor`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
-show create table servers;
-Table Create Table
-servers CREATE TABLE `servers` (
- `Server_name` char(64) NOT NULL DEFAULT '',
- `Host` char(64) NOT NULL DEFAULT '',
- `Db` char(64) NOT NULL DEFAULT '',
- `Username` char(80) NOT NULL DEFAULT '',
- `Password` char(64) NOT NULL DEFAULT '',
- `Port` int(4) NOT NULL DEFAULT '0',
- `Socket` char(64) NOT NULL DEFAULT '',
- `Wrapper` char(64) NOT NULL DEFAULT '',
- `Owner` char(64) NOT NULL DEFAULT '',
- PRIMARY KEY (`Server_name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table'
-show create table proc;
-Table Create Table
-proc CREATE TABLE `proc` (
- `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
- `name` char(64) NOT NULL DEFAULT '',
- `type` enum('FUNCTION','PROCEDURE') NOT NULL,
- `specific_name` char(64) NOT NULL DEFAULT '',
- `language` enum('SQL') NOT NULL DEFAULT 'SQL',
- `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
- `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
- `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
- `param_list` blob NOT NULL,
- `returns` longblob NOT NULL,
- `body` longblob NOT NULL,
- `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
- `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `body_utf8` longblob,
- PRIMARY KEY (`db`,`name`,`type`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
-show create table event;
-Table Create Table
-event CREATE TABLE `event` (
- `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
- `name` char(64) NOT NULL DEFAULT '',
- `body` longblob NOT NULL,
- `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
- `execute_at` datetime DEFAULT NULL,
- `interval_value` int(11) DEFAULT NULL,
- `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `last_executed` datetime DEFAULT NULL,
- `starts` datetime DEFAULT NULL,
- `ends` datetime DEFAULT NULL,
- `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
- `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
- `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
- `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
- `originator` int(10) unsigned NOT NULL,
- `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
- `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `body_utf8` longblob,
- PRIMARY KEY (`db`,`name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
-show create table general_log;
-Table Create Table
-general_log CREATE TABLE `general_log` (
- `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
- `user_host` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL,
- `server_id` int(10) unsigned NOT NULL,
- `command_type` varchar(64) NOT NULL,
- `argument` mediumtext NOT NULL
-) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
-show create table slow_log;
-Table Create Table
-slow_log CREATE TABLE `slow_log` (
- `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
- `user_host` mediumtext NOT NULL,
- `query_time` time(6) NOT NULL,
- `lock_time` time(6) NOT NULL,
- `rows_sent` int(11) NOT NULL,
- `rows_examined` int(11) NOT NULL,
- `db` varchar(512) NOT NULL,
- `last_insert_id` int(11) NOT NULL,
- `insert_id` int(11) NOT NULL,
- `server_id` int(10) unsigned NOT NULL,
- `sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
-) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
-show create table table_stats;
-Table Create Table
-table_stats CREATE TABLE `table_stats` (
- `db_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `cardinality` bigint(21) unsigned DEFAULT NULL,
- PRIMARY KEY (`db_name`,`table_name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
-show create table column_stats;
-Table Create Table
-column_stats CREATE TABLE `column_stats` (
- `db_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `column_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `min_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
- `max_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
- `nulls_ratio` decimal(12,4) DEFAULT NULL,
- `avg_length` decimal(12,4) DEFAULT NULL,
- `avg_frequency` decimal(12,4) DEFAULT NULL,
- `hist_size` tinyint(3) unsigned DEFAULT NULL,
- `hist_type` enum('SINGLE_PREC_HB','DOUBLE_PREC_HB') COLLATE utf8_bin DEFAULT NULL,
- `histogram` varbinary(255) DEFAULT NULL,
- PRIMARY KEY (`db_name`,`table_name`,`column_name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
-show create table index_stats;
-Table Create Table
-index_stats CREATE TABLE `index_stats` (
- `db_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
- `prefix_arity` int(11) unsigned NOT NULL,
- `avg_frequency` decimal(12,4) DEFAULT NULL,
- PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Indexes'
-show tables;
-Tables_in_test
diff --git a/mysql-test/r/system_mysql_db_fix40123.result b/mysql-test/r/system_mysql_db_fix40123.result
index 53797e2a0a4..bc4de8b4171 100644
--- a/mysql-test/r/system_mysql_db_fix40123.result
+++ b/mysql-test/r/system_mysql_db_fix40123.result
@@ -130,6 +130,8 @@ user CREATE TABLE `user` (
`authentication_string` text COLLATE utf8_bin NOT NULL,
`password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
+ `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000',
PRIMARY KEY (`Host`,`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
show create table func;
@@ -271,7 +273,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
diff --git a/mysql-test/r/system_mysql_db_fix50030.result b/mysql-test/r/system_mysql_db_fix50030.result
index 53797e2a0a4..bc4de8b4171 100644
--- a/mysql-test/r/system_mysql_db_fix50030.result
+++ b/mysql-test/r/system_mysql_db_fix50030.result
@@ -130,6 +130,8 @@ user CREATE TABLE `user` (
`authentication_string` text COLLATE utf8_bin NOT NULL,
`password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
+ `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000',
PRIMARY KEY (`Host`,`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
show create table func;
@@ -271,7 +273,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
diff --git a/mysql-test/r/system_mysql_db_fix50117.result b/mysql-test/r/system_mysql_db_fix50117.result
index 53797e2a0a4..bc4de8b4171 100644
--- a/mysql-test/r/system_mysql_db_fix50117.result
+++ b/mysql-test/r/system_mysql_db_fix50117.result
@@ -130,6 +130,8 @@ user CREATE TABLE `user` (
`authentication_string` text COLLATE utf8_bin NOT NULL,
`password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
+ `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000',
PRIMARY KEY (`Host`,`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
show create table func;
@@ -271,7 +273,8 @@ slow_log CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` bigint(21) unsigned NOT NULL
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index 3e68a877f02..3e66880ae84 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -683,20 +683,14 @@ SET optimizer_switch=@save_optimizer_switch;
# (just a testcase)
CREATE TABLE t1 (
PostID int(10) unsigned NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't1'
+) DEFAULT CHARSET=utf8;
INSERT INTO t1 (PostID) VALUES (1), (2);
CREATE TABLE t2 (
VoteID int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
EntityID int(10) unsigned NOT NULL,
UserID int(10) unsigned NOT NULL,
UNIQUE KEY EntityID (EntityID,UserID)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine MyISAM for table 't2'
+) DEFAULT CHARSET=utf8;
INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30);
SELECT t1.*, T.Voted as Voted
FROM
diff --git a/mysql-test/r/table_options-5867.result b/mysql-test/r/table_options-5867.result
index 21041c7c5c3..f915c2740ae 100644
--- a/mysql-test/r/table_options-5867.result
+++ b/mysql-test/r/table_options-5867.result
@@ -14,7 +14,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,f,f,f' `invalid`=3
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 `foobar`=barfoo `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 `foobar`=barfoo
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -26,7 +26,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,f,f,f' /* `invalid`=3 */
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 /* `foobar`=barfoo */ `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 /* `foobar`=barfoo */
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index dd8bab31d75..0ecdcf0058a 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -128,7 +128,7 @@ This is temp. table
show create table v1;
Table Create Table
v1 CREATE TEMPORARY TABLE `v1` (
- `A` varchar(19) NOT NULL DEFAULT ''
+ `A` varchar(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create view v1;
View Create View character_set_client collation_connection
@@ -294,3 +294,20 @@ DROP TABLES t1, t2, t3;
CREATE TEMPORARY TABLE t1 (a int);
RENAME TABLE t1 TO t2;
DROP TABLE t2;
+create temporary temporary table t1 (a int);
+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 'temporary table t1 (a int)' at line 1
+flush status;
+create table t1 (a int);
+create temporary table t2 (a int);
+create temporary table t3 (a int);
+drop table t1;
+drop table t2;
+drop temporary table t3;
+show status like 'com_create%table';
+Variable_name Value
+Com_create_table 1
+Com_create_temporary_table 2
+show status like 'com_drop%table';
+Variable_name Value
+Com_drop_table 2
+Com_drop_temporary_table 1
diff --git a/mysql-test/r/temp_table_frm.result b/mysql-test/r/temp_table_frm.result
new file mode 100644
index 00000000000..19c66380af2
--- /dev/null
+++ b/mysql-test/r/temp_table_frm.result
@@ -0,0 +1,21 @@
+set @@session.max_heap_table_size=16*1024*1024;
+create table t1 select * from information_schema.session_status where variable_name like 'Opened%';
+create temporary table t2 (a int) engine=memory;
+select variable_name, session_status.variable_value - t1.variable_value
+from information_schema.session_status join t1 using (variable_name);
+variable_name session_status.variable_value - t1.variable_value
+OPENED_FILES 0
+OPENED_PLUGIN_LIBRARIES 0
+OPENED_TABLE_DEFINITIONS 2
+OPENED_TABLES 1
+OPENED_VIEWS 0
+truncate table t2;
+select variable_name, session_status.variable_value - t1.variable_value
+from information_schema.session_status join t1 using (variable_name);
+variable_name session_status.variable_value - t1.variable_value
+OPENED_FILES 0
+OPENED_PLUGIN_LIBRARIES 0
+OPENED_TABLE_DEFINITIONS 2
+OPENED_TABLES 1
+OPENED_VIEWS 0
+drop table t1;
diff --git a/mysql-test/r/temporal_literal.result b/mysql-test/r/temporal_literal.result
index e317eba37f0..f4f43fe9ba3 100644
--- a/mysql-test/r/temporal_literal.result
+++ b/mysql-test/r/temporal_literal.result
@@ -40,7 +40,7 @@ CREATE TABLE t1 AS SELECT DATE'2010-01-01';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `DATE'2010-01-01'` date NOT NULL DEFAULT '0000-00-00'
+ `DATE'2010-01-01'` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT
@@ -50,9 +50,9 @@ CREATE TABLE t1 AS SELECT
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `{d'2001-01-01'}` date NOT NULL DEFAULT '0000-00-00',
- `{ d '2001-01-01' }` date NOT NULL DEFAULT '0000-00-00',
- `2001-01-01 10:10:10` varchar(19) NOT NULL DEFAULT ''
+ `{d'2001-01-01'}` date NOT NULL,
+ `{ d '2001-01-01' }` date NOT NULL,
+ `2001-01-01 10:10:10` varchar(19) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
EXPLAIN EXTENDED SELECT {d'2010-01-01'};
@@ -150,14 +150,14 @@ TIME'10:10:10.123456';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `TIME'10:10:10'` time NOT NULL DEFAULT '00:00:00',
- `TIME'10:10:10.'` time NOT NULL DEFAULT '00:00:00',
- `TIME'10:10:10.1'` time(1) NOT NULL DEFAULT '00:00:00.0',
- `TIME'10:10:10.12'` time(2) NOT NULL DEFAULT '00:00:00.00',
- `TIME'10:10:10.123'` time(3) NOT NULL DEFAULT '00:00:00.000',
- `TIME'10:10:10.1234'` time(4) NOT NULL DEFAULT '00:00:00.0000',
- `TIME'10:10:10.12345'` time(5) NOT NULL DEFAULT '00:00:00.00000',
- `TIME'10:10:10.123456'` time(6) NOT NULL DEFAULT '00:00:00.000000'
+ `TIME'10:10:10'` time NOT NULL,
+ `TIME'10:10:10.'` time NOT NULL,
+ `TIME'10:10:10.1'` time(1) NOT NULL,
+ `TIME'10:10:10.12'` time(2) NOT NULL,
+ `TIME'10:10:10.123'` time(3) NOT NULL,
+ `TIME'10:10:10.1234'` time(4) NOT NULL,
+ `TIME'10:10:10.12345'` time(5) NOT NULL,
+ `TIME'10:10:10.123456'` time(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT
@@ -169,11 +169,11 @@ CREATE TABLE t1 AS SELECT
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `{t'10:10:10'}` time NOT NULL DEFAULT '00:00:00',
- `{ t '10:10:10' }` time NOT NULL DEFAULT '00:00:00',
- `{t'10:10:10.'}` time NOT NULL DEFAULT '00:00:00',
- `{t'10:10:10.123456'}` time(6) NOT NULL DEFAULT '00:00:00.000000',
- `2001-01-01` varchar(10) NOT NULL DEFAULT ''
+ `{t'10:10:10'}` time NOT NULL,
+ `{ t '10:10:10' }` time NOT NULL,
+ `{t'10:10:10.'}` time NOT NULL,
+ `{t'10:10:10.123456'}` time(6) NOT NULL,
+ `2001-01-01` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
EXPLAIN EXTENDED SELECT {t'10:01:01'};
@@ -242,14 +242,14 @@ TIMESTAMP'2010-01-01 10:10:10.123456';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `TIMESTAMP'2010-01-01 10:10:10'` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `TIMESTAMP'2010-01-01 10:10:10.'` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `TIMESTAMP'2010-01-01 10:10:10.1'` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0',
- `TIMESTAMP'2010-01-01 10:10:10.12'` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00',
- `TIMESTAMP'2010-01-01 10:10:10.123'` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000',
- `TIMESTAMP'2010-01-01 10:10:10.1234'` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000',
- `TIMESTAMP'2010-01-01 10:10:10.12345'` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000',
- `TIMESTAMP'2010-01-01 10:10:10.123456'` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
+ `TIMESTAMP'2010-01-01 10:10:10'` datetime NOT NULL,
+ `TIMESTAMP'2010-01-01 10:10:10.'` datetime NOT NULL,
+ `TIMESTAMP'2010-01-01 10:10:10.1'` datetime(1) NOT NULL,
+ `TIMESTAMP'2010-01-01 10:10:10.12'` datetime(2) NOT NULL,
+ `TIMESTAMP'2010-01-01 10:10:10.123'` datetime(3) NOT NULL,
+ `TIMESTAMP'2010-01-01 10:10:10.1234'` datetime(4) NOT NULL,
+ `TIMESTAMP'2010-01-01 10:10:10.12345'` datetime(5) NOT NULL,
+ `TIMESTAMP'2010-01-01 10:10:10.123456'` datetime(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT
@@ -261,11 +261,11 @@ CREATE TABLE t1 AS SELECT
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `{ts'2001-01-01 10:10:10'}` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `{ ts '2001-01-01 10:10:10' }` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `{ts'2001-01-01 10:10:10.'}` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `{ts'2001-01-01 10:10:10.123456'}` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
- `2001-01-01` varchar(10) NOT NULL DEFAULT ''
+ `{ts'2001-01-01 10:10:10'}` datetime NOT NULL,
+ `{ ts '2001-01-01 10:10:10' }` datetime NOT NULL,
+ `{ts'2001-01-01 10:10:10.'}` datetime NOT NULL,
+ `{ts'2001-01-01 10:10:10.123456'}` datetime(6) NOT NULL,
+ `2001-01-01` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
EXPLAIN EXTENDED SELECT {ts'2010-01-01 10:10:10'};
@@ -590,8 +590,8 @@ DATE'2001-01-00';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `DATE'2001-01-01'` date NOT NULL DEFAULT '0000-00-00',
- `DATE'0000-01-01'` date NOT NULL DEFAULT '0000-00-00',
+ `DATE'2001-01-01'` date NOT NULL,
+ `DATE'0000-01-01'` date NOT NULL,
`DATE'2001-00-00'` date DEFAULT NULL,
`DATE'2001-00-01'` date DEFAULT NULL,
`DATE'2001-01-00'` date DEFAULT NULL
@@ -606,8 +606,8 @@ TIMESTAMP'2001-01-00 00:00:00';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `TIMESTAMP'2001-01-01 00:00:00'` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `TIMESTAMP'0000-01-01 00:00:00'` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `TIMESTAMP'2001-01-01 00:00:00'` datetime NOT NULL,
+ `TIMESTAMP'0000-01-01 00:00:00'` datetime NOT NULL,
`TIMESTAMP'2001-00-00 00:00:00'` datetime DEFAULT NULL,
`TIMESTAMP'2001-00-01 00:00:00'` datetime DEFAULT NULL,
`TIMESTAMP'2001-01-00 00:00:00'` datetime DEFAULT NULL
diff --git a/mysql-test/r/timezone_grant.result b/mysql-test/r/timezone_grant.result
index 49918038da5..d33d92dbc9e 100644
--- a/mysql-test/r/timezone_grant.result
+++ b/mysql-test/r/timezone_grant.result
@@ -7,6 +7,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
create table t1 (a int, b datetime);
create table t2 (c int, d datetime);
+create user mysqltest_1@localhost;
grant all privileges on test.* to mysqltest_1@localhost;
show grants for current_user();
Grants for mysqltest_1@localhost
@@ -63,6 +64,7 @@ flush privileges;
drop table t1, t2;
create table t1 (a int, b datetime);
insert into t1 values (1, 20010101000000), (2, 20020101000000);
+create user mysqltest_1@localhost;
grant all privileges on test.* to mysqltest_1@localhost;
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1;
select * from v1;
diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result
index 8caba961624..7659667fb37 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -29,8 +29,8 @@ wl2818_trg2 mysqltest_dfn@localhost
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-def mysqltest_db1 wl2818_trg1 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
-def mysqltest_db1 wl2818_trg2 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 wl2818_trg1 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 wl2818_trg2 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER wl2818_trg1;
Warnings:
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 8bf31766031..8455450e294 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -214,12 +214,14 @@ end if;
end|
insert into t3 values (1);
insert into t1 values (4, "four", 1), (5, "five", 2);
-ERROR 23000: Column 'id' cannot be null
+Warnings:
+Warning 1048 Column 'id' cannot be null
select * from t1;
id data fk
1 one NULL
2 two NULL
4 four 1
+0 five 2
select * from t2;
event
INSERT INTO t1 id=1 data='one'
@@ -415,6 +417,13 @@ i j k @b
15 NULL 15 Fired
set @b:="";
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
+Warnings:
+Note 1265 Data truncated for column 'i' at row 1
+Note 1265 Data truncated for column 'j' at row 1
+Note 1265 Data truncated for column 'i' at row 2
+Note 1265 Data truncated for column 'j' at row 2
+Note 1265 Data truncated for column 'i' at row 3
+Note 1265 Data truncated for column 'j' at row 3
select *, @b from t1;
i j k @b
10 NULL 10 Fired
@@ -1957,6 +1966,8 @@ drop table if exists t1;
create table t1 (i int, j int);
create trigger t1_bi before insert on t1 for each row begin end;
create trigger t1_bi before insert on t1 for each row begin end;
+ERROR HY000: Trigger already exists
+create trigger t1_bi2 before insert on t1 for each row begin end;
ERROR 42000: This version of MariaDB doesn't yet support 'multiple triggers with the same action time and event for one table'
drop trigger t1_bi;
drop trigger t1_bi;
@@ -2264,3 +2275,35 @@ SET optimizer_switch=@save_optimizer_switch;
DROP TRIGGER tr;
DROP TABLE t1, t2;
End of 5.3 tests.
+SET @@session.sql_mode = 'STRICT_ALL_TABLES,STRICT_TRANS_TABLES';
+CREATE TABLE t1 (c CHAR(1) NOT NULL);
+CREATE TRIGGER t1_bi
+BEFORE INSERT
+ON t1
+FOR EACH ROW
+BEGIN
+SET NEW.c = 'www';
+END;
+|
+SET @@session.sql_mode = default;
+INSERT INTO t1 VALUES ('a');
+ERROR 22001: Data too long for column 'c' at row 1
+DROP TRIGGER t1_bi;
+DROP TABLE t1;
+#
+# MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
+#
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
+CREATE TABLE t2 (a int);
+CREATE TABLE t3 (a int);
+create trigger trg after insert on t2 for each row
+INSERT INTO t3 SELECT MAX(i) FROM v1 UNION SELECT MAX(i) FROM v1;
+drop table t1;
+insert into t2 value (2);
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (i INT);
+insert into t2 value (2);
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
+End of 10.1 tests.
diff --git a/mysql-test/r/trigger_no_defaults-11698.result b/mysql-test/r/trigger_no_defaults-11698.result
new file mode 100644
index 00000000000..93672092180
--- /dev/null
+++ b/mysql-test/r/trigger_no_defaults-11698.result
@@ -0,0 +1,40 @@
+set sql_mode='strict_all_tables';
+create table t1 (a int not null, b int);
+insert t1 (b) values (1);
+ERROR HY000: Field 'a' doesn't have a default value
+create trigger trgi before insert on t1 for each row
+case new.b
+when 10 then
+set new.a = new.b;
+when 30 then
+set new.a = new.a;
+else
+do 1;
+end case|
+insert t1 (b) values (10);
+insert t1 (b) values (20);
+ERROR HY000: Field 'a' doesn't have a default value
+insert t1 (b) values (30);
+select * from t1;
+a b
+10 10
+0 30
+drop table t1;
+set sql_mode=default;
+create table t1 (
+id int(11) not null auto_increment primary key,
+data1 varchar(10) not null,
+data2 varchar(10) not null
+);
+insert into t1 (data2) values ('x');
+Warnings:
+Warning 1364 Field 'data1' doesn't have a default value
+create trigger test_trigger before insert on t1 for each row begin end;
+insert into t1 (data2) values ('y');
+Warnings:
+Warning 1364 Field 'data1' doesn't have a default value
+select * from t1;
+id data1 data2
+1 x
+2 y
+drop table t1;
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result
index ef86e4c496c..795f722b0d4 100644
--- a/mysql-test/r/trigger_notembedded.result
+++ b/mysql-test/r/trigger_notembedded.result
@@ -138,8 +138,8 @@ INSERT INTO t1 VALUES(6);
ERROR HY000: The user specified as a definer ('mysqltest_nonexs'@'localhost') does not exist
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-trg2 INSERT t1 SET @new_sum = 0 AFTER NULL mysqltest_nonexs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION mysqltest_inv@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg2 INSERT t1 SET @new_sum = 0 AFTER NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION mysqltest_nonexs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER trg1;
DROP TRIGGER trg2;
CREATE TRIGGER trg1 BEFORE INSERT ON t1
@@ -168,11 +168,11 @@ trg5 @abcdef@@@hostname
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-def mysqltest_db1 trg1 INSERT def mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
-def mysqltest_db1 trg2 INSERT def mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ latin1 latin1_swedish_ci latin1_swedish_ci
-def mysqltest_db1 trg3 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@% latin1 latin1_swedish_ci latin1_swedish_ci
-def mysqltest_db1 trg4 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname latin1 latin1_swedish_ci latin1_swedish_ci
-def mysqltest_db1 trg5 DELETE def mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg1 INSERT def mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg2 INSERT def mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @ latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg3 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @abc@def@@% latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg4 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @hostname latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg5 DELETE def mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci
---> connection: default
DROP USER mysqltest_dfn@localhost;
@@ -502,6 +502,7 @@ DROP DATABASE db1;
DROP DATABASE IF EXISTS mysqltest_db1;
CREATE DATABASE mysqltest_db1;
USE mysqltest_db1;
+CREATE USER mysqltest_u1@localhost;
GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost;
CREATE TABLE t1 (
a1 int,
diff --git a/mysql-test/r/trigger_null-8605.result b/mysql-test/r/trigger_null-8605.result
new file mode 100644
index 00000000000..10315988708
--- /dev/null
+++ b/mysql-test/r/trigger_null-8605.result
@@ -0,0 +1,366 @@
+set sql_mode=strict_all_tables;
+set time_zone="+02:00";
+create table t1 (a int not null, b int, c int);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+insert t1 values (10, NULL, 1);
+insert t1 values (NULL, 2, NULL);
+insert t1 values (NULL, NULL, 20);
+ERROR 23000: Column 'a' cannot be null
+insert t1 values (1, 2, NULL);
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+insert ignore t1 values (NULL, NULL, 30);
+Warnings:
+Warning 1048 Column 'a' cannot be null
+insert ignore t1 values (1, 3, NULL);
+Warnings:
+Warning 1048 Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+0 NULL 30
+0 3 NULL
+insert t1 set a=NULL, b=4, c=a;
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+0 NULL 30
+0 3 NULL
+4 4 NULL
+delete from t1;
+insert t1 (a,c) values (10, 1);
+insert t1 (a,b) values (NULL, 2);
+insert t1 (a,c) values (NULL, 20);
+ERROR 23000: Column 'a' cannot be null
+insert t1 (a,b) values (1, 2);
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+delete from t1;
+insert t1 select 10, NULL, 1;
+insert t1 select NULL, 2, NULL;
+insert t1 select NULL, NULL, 20;
+ERROR 23000: Column 'a' cannot be null
+insert t1 select 1, 2, NULL;
+ERROR 23000: Column 'a' cannot be null
+insert ignore t1 select NULL, NULL, 30;
+Warnings:
+Warning 1048 Column 'a' cannot be null
+insert ignore t1 select 1, 3, NULL;
+Warnings:
+Warning 1048 Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+0 NULL 30
+0 3 NULL
+delete from t1;
+insert delayed t1 values (10, NULL, 1);
+insert delayed t1 values (NULL, 2, NULL);
+insert delayed t1 values (NULL, NULL, 20);
+ERROR 23000: Column 'a' cannot be null
+insert delayed t1 values (1, 2, NULL);
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+insert delayed ignore t1 values (NULL, NULL, 30);
+Warnings:
+Warning 1048 Column 'a' cannot be null
+insert delayed ignore t1 values (1, 3, NULL);
+Warnings:
+Warning 1048 Column 'a' cannot be null
+flush table t1;
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+0 NULL 30
+0 3 NULL
+delete from t1;
+alter table t1 add primary key (a);
+create trigger trgu before update on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+insert t1 values (100,100,100), (200,200,200), (300,300,300);
+insert t1 values (100,100,100) on duplicate key update a=10, b=NULL, c=1;
+insert t1 values (200,200,200) on duplicate key update a=NULL, b=2, c=NULL;
+insert t1 values (300,300,300) on duplicate key update a=NULL, b=NULL, c=20;
+ERROR 23000: Column 'a' cannot be null
+insert t1 values (300,300,300) on duplicate key update a=1, b=2, c=NULL;
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+300 300 300
+delete from t1;
+insert t1 values (1,100,1), (2,200,2);
+replace t1 values (10, NULL, 1);
+replace t1 values (NULL, 2, NULL);
+replace t1 values (NULL, NULL, 30);
+ERROR 23000: Column 'a' cannot be null
+replace t1 values (1, 3, NULL);
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+delete from t1;
+insert t1 values (100,100,100), (200,200,200), (300,300,300);
+update t1 set a=10, b=NULL, c=1 where a=100;
+update t1 set a=NULL, b=2, c=NULL where a=200;
+update t1 set a=NULL, b=NULL, c=20 where a=300;
+ERROR 23000: Column 'a' cannot be null
+update t1 set a=1, b=2, c=NULL where a=300;
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+300 300 300
+set statement sql_mode='' for update t1 set a=1, b=2, c=NULL where a > 1;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+select * from t1;
+a b c
+1 NULL 1
+0 2 NULL
+300 300 300
+update t1 set a=NULL, b=4, c=a where a=300;
+select * from t1;
+a b c
+1 NULL 1
+0 2 NULL
+4 4 NULL
+delete from t1;
+create table t2 (d int, e int);
+insert t1 values (100,100,100), (200,200,200), (300,300,300);
+insert t2 select a,b from t1;
+update t1,t2 set a=10, b=NULL, c=1 where b=d and e=100;
+update t1,t2 set a=NULL, b=2, c=NULL where b=d and e=200;
+update t1,t2 set a=NULL, b=NULL, c=20 where b=d and e=300;
+ERROR 23000: Column 'a' cannot be null
+update t1,t2 set a=1, b=2, c=NULL where b=d and e=300;
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+300 300 300
+update t1,t2 set a=NULL, b=4, c=a where b=d and e=300;
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+4 4 300
+delete from t1;
+insert t2 values (2,2);
+create view v1 as select * from t1, t2 where d=2;
+insert v1 (a,c) values (10, 1);
+insert v1 (a,b) values (NULL, 2);
+insert v1 (a,c) values (NULL, 20);
+ERROR 23000: Column 'a' cannot be null
+insert v1 (a,b) values (1, 2);
+ERROR 23000: Column 'a' cannot be null
+select * from v1;
+a b c d e
+1 NULL 1 2 2
+2 2 NULL 2 2
+delete from t1;
+drop view v1;
+drop table t2;
+load data infile 'mdev8605.txt' into table t1 fields terminated by ',';
+ERROR 23000: Column 'a' cannot be null
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+drop table t1;
+create table t1 (a timestamp, b int auto_increment primary key);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null, '2000-10-20 10:20:30', NULL);
+set statement timestamp=777777777 for insert t1 (a) values (NULL);
+set statement timestamp=888888888 for insert t1 (a) values ('1999-12-11 10:9:8');
+select b, a, unix_timestamp(a) from t1;
+b a unix_timestamp(a)
+1 2000-10-20 10:20:30 972030030
+2 1998-03-03 03:34:48 888888888
+set statement timestamp=999999999 for update t1 set b=3 where b=2;
+select b, a, unix_timestamp(a) from t1;
+b a unix_timestamp(a)
+1 2000-10-20 10:20:30 972030030
+3 2001-09-09 03:46:39 999999999
+create trigger trgu before update on t1 for each row set new.a='2011-11-11 11:11:11';
+update t1 set b=4 where b=3;
+select b, a, unix_timestamp(a) from t1;
+b a unix_timestamp(a)
+1 2000-10-20 10:20:30 972030030
+4 2011-11-11 11:11:11 1321002671
+drop table t1;
+create table t1 (a int auto_increment primary key);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null, 5, NULL);
+insert t1 values (NULL);
+insert t1 values (10);
+select a from t1;
+a
+5
+6
+drop table t1;
+create table t1 (a int, b int, c int);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+insert t1 values (10, NULL, 1);
+insert t1 values (NULL, 2, NULL);
+insert t1 values (NULL, NULL, 20);
+insert t1 values (1, 2, NULL);
+select * from t1;
+a b c
+1 NULL 1
+2 2 NULL
+NULL NULL 20
+NULL 2 NULL
+drop table t1;
+create table t1 (a1 tinyint not null, a2 timestamp not null,
+a3 tinyint not null auto_increment primary key,
+b tinyint, c int not null);
+create trigger trgi before insert on t1 for each row
+begin
+if new.b=1 then set new.a1=if(new.c,new.c,null); end if;
+if new.b=2 then set new.a2=if(new.c,new.c,null); end if;
+if new.b=3 then set new.a3=if(new.c,new.c,null); end if;
+end|
+set statement timestamp=777777777 for
+load data infile 'sep8605.txt' into table t1 fields terminated by ',';
+ERROR 23000: Column 'a1' cannot be null
+select * from t1;
+a1 a2 a3 b c
+1 2010-11-12 01:02:03 10 0 0
+2 2010-11-12 01:02:03 11 1 2
+3 1994-08-25 03:22:57 12 0 0
+4 2000-09-08 07:06:05 13 2 908070605
+5 1994-08-25 03:22:57 14 2 0
+6 2010-11-12 01:02:03 15 0 0
+7 2010-11-12 01:02:03 20 3 20
+8 2010-11-12 01:02:03 21 3 0
+delete from t1;
+set statement timestamp=777777777 for
+load data infile 'sep8605.txt' into table t1 fields terminated by ','
+ (@a,a2,a3,b,c) set a1=100-@a;
+ERROR 23000: Column 'a1' cannot be null
+select 100-a1,a2,a3,b,c from t1;
+100-a1 a2 a3 b c
+1 2010-11-12 01:02:03 10 0 0
+98 2010-11-12 01:02:03 11 1 2
+3 1994-08-25 03:22:57 12 0 0
+4 2000-09-08 07:06:05 13 2 908070605
+5 1994-08-25 03:22:57 14 2 0
+6 2010-11-12 01:02:03 22 0 0
+7 2010-11-12 01:02:03 20 3 20
+8 2010-11-12 01:02:03 23 3 0
+delete from t1;
+set statement timestamp=777777777 for
+load data infile 'fix8605.txt' into table t1 fields terminated by '';
+ERROR 23000: Column 'a1' cannot be null
+select * from t1;
+a1 a2 a3 b c
+1 2010-11-12 01:02:03 10 0 0
+5 1994-08-25 03:22:57 14 2 0
+8 2010-11-12 01:02:03 24 3 0
+delete from t1;
+set statement timestamp=777777777 for
+load xml infile 'xml8605.txt' into table t1 rows identified by '<row>';
+ERROR 23000: Column 'a1' cannot be null
+select * from t1;
+a1 a2 a3 b c
+1 2010-11-12 01:02:03 10 0 0
+2 2010-11-12 01:02:03 11 1 2
+3 1994-08-25 03:22:57 12 0 0
+4 2000-09-08 07:06:05 13 2 908070605
+5 1994-08-25 03:22:57 14 2 0
+6 2010-11-12 01:02:03 25 0 0
+7 2010-11-12 01:02:03 20 3 20
+8 2010-11-12 01:02:03 26 3 0
+drop table t1;
+create table t1 (a int not null default 5, b int, c int);
+create trigger trgi before insert on t1 for each row set new.b=new.c;
+insert t1 values (DEFAULT,2,1);
+select * from t1;
+a b c
+5 1 1
+drop table t1;
+create table t1 (a int not null, b int not null default 5, c int);
+create trigger trgi before insert on t1 for each row
+begin
+if new.c=1 then set new.a=1, new.b=1; end if;
+if new.c=2 then set new.a=NULL, new.b=NULL; end if;
+if new.c=3 then set new.a=2; end if;
+end|
+insert t1 values (9, 9, 1);
+insert t1 values (9, 9, 2);
+ERROR 23000: Column 'a' cannot be null
+insert t1 (a,c) values (9, 3);
+select * from t1;
+a b c
+1 1 1
+2 5 3
+drop table t1;
+set session sql_mode ='no_auto_value_on_zero';
+create table t1 (id int unsigned auto_increment primary key);
+insert t1 values (0);
+select * from t1;
+id
+0
+delete from t1;
+create trigger t1_bi before insert on t1 for each row begin end;
+insert t1 values (0);
+insert t1 (id) values (0);
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+drop table t1;
+create table t1 (a int not null, b int);
+create trigger trgi before update on t1 for each row do 1;
+insert t1 values (1,1),(2,2),(3,3),(1,4);
+create table t2 select a as c, b as d from t1;
+update t1 set a=(select count(c) from t2 where c+1=a+1 group by a);
+select * from t1;
+a b
+2 1
+1 2
+1 3
+2 4
+drop table t1, t2;
+create table t1 (a int not null);
+create table t2 (f1 int unsigned not null, f2 int);
+insert into t2 values (1, null);
+create trigger tr1 before update on t1 for each row do 1;
+create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
+update t2 set f2=1 where f1=1;
+drop table t1, t2;
+create table t1 (a int not null, primary key (a));
+insert into t1 (a) values (1);
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL
+create trigger t1bu before update on t1 for each row begin end;
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL
+insert into t1 (a) values (3);
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL
+drop table t1;
+create table t1 (
+pk int primary key,
+i int,
+v1 int as (i) virtual,
+v2 int as (i) virtual
+);
+create trigger tr before update on t1 for each row set @a = 1;
+insert into t1 (pk, i) values (null, null);
+ERROR 23000: Column 'pk' cannot be null
+drop table t1;
diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result
index 773075f9dae..9b4cb4a36d9 100644
--- a/mysql-test/r/truncate.result
+++ b/mysql-test/r/truncate.result
@@ -142,7 +142,7 @@ TRUNCATE p1;
ERROR 42S02: Table 'test.p1' doesn't exist
SHOW CREATE PROCEDURE p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SET @a = 5 latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE p1;
#
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index 639a97be27b..4136eb4dff7 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -806,3 +806,27 @@ SUM(a)
NULL
DROP TABLE t1;
End of 5.1 tests
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8867 Wrong field type or metadata for COALESCE(bit_column, 1)
+#
+CREATE TABLE t1 (val bit(1));
+INSERT INTO t1 VALUES (0);
+CREATE TABLE t2 AS SELECT COALESCE(val, 1) AS c FROM t1;
+SELECT * FROM t2;
+c
+0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c` decimal(1,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+SELECT COALESCE(val, 1) FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def COALESCE(val, 1) 246 2 1 Y 32896 0 63
+COALESCE(val, 1)
+0
+DROP TABLE t1;
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index bdb0a974b55..223d26ad6d8 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -506,6 +506,8 @@ create table t1 (id integer auto_increment unique,imagem LONGBLOB not null defau
Warnings:
Warning 1101 BLOB/TEXT column 'imagem' can't have a default value
insert into t1 (id) values (1);
+Warnings:
+Warning 1364 Field 'imagem' doesn't have a default value
select
charset(load_file('../../std_data/words.dat')),
collation(load_file('../../std_data/words.dat')),
@@ -711,10 +713,10 @@ alter table t1 add key (a,b,d,e);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
+ `b` int(11) NOT NULL,
`c` tinyblob NOT NULL,
- `d` int(11) NOT NULL DEFAULT '0',
+ `d` int(11) NOT NULL,
`e` int(11) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`(255),`d`),
KEY `a` (`a`,`b`,`d`,`e`)
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index ea21115a755..661dcabbcfe 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -485,3 +485,374 @@ SELECT GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3) FROM t1;
GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3)
aa1900-01-01,aa2003-04-27
DROP TABLE t1;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATE DEFAULT '0000-00-00');
+SET sql_mode=TRADITIONAL;
+INSERT INTO t1 VALUES ('0000-00-00');
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'a' at row 1
+INSERT INTO t1 VALUES ();
+ERROR 22007: Incorrect default value '0000-00-00' for column 'a'
+INSERT INTO t1 VALUES (DEFAULT);
+ERROR 22007: Incorrect default value '0000-00-00' for column 'a'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATE NOT NULL DEFAULT '0000-00-00', b DATE NOT NULL DEFAULT '0000-00-00');
+CREATE TABLE t2 (a DATE NOT NULL DEFAULT '0000-00-00');
+INSERT INTO t2 VALUES ('0000-00-00');
+SET sql_mode=TRADITIONAL;
+INSERT INTO t1 (a) SELECT a FROM t2;
+ERROR 22007: Incorrect default value '0000-00-00' for column 'b'
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATE DEFAULT '0000-00-00', b DATE DEFAULT '0000-00-00');
+INSERT INTO t1 VALUES (DEFAULT,DEFAULT);;
+SELECT a INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1;
+DELETE FROM t1;
+SET sql_mode=TRADITIONAL;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/mdev-7824.txt' INTO TABLE t1 (a);
+ERROR 22007: Incorrect default value '0000-00-00' for column 'b'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATE DEFAULT '0000-00-00');;
+SET sql_mode='NO_ZERO_DATE';
+ALTER TABLE t1 ADD b INT NOT NULL;
+ERROR 42000: Invalid default value for 'a'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
+# End of MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+#
+#
+# MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATE);;
+INSERT INTO t1 VALUES (0);
+SET sql_mode='TRADITIONAL';
+CREATE TABLE t2 AS SELECT * FROM t1;
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'a' at row 1
+DROP TABLE t1;
+#
+# End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+#
+#
+# MDEV-8722 The patch for MDEV-8688 disabled equal field propagation for temporal column and BETWEEN and IN
+#
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a BETWEEN '2001-01-01' AND '2001-01-02';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a IN ('2001-01-01','2001-01-02');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01')
+DROP TABLE t1;
+#
+# MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+#
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+SELECT * FROM t1 WHERE a='2001-01-01x';
+a
+2001-01-01
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+SELECT * FROM t1 WHERE HEX(a)!='323030312D30312D3031';
+a
+2001-01-02
+SELECT * FROM t1 WHERE HEX(a)!='323030312D30312D3031' AND a='2001-01-01x';
+a
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE HEX(a)!='323030312D30312D3031' AND a='2001-01-01x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE HEX(a)!=CONCAT('xx',RAND()) AND a='2001-01-01x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Truncated incorrect date value: '2001-01-01x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and (<cache>(hex(DATE'2001-01-01')) <> concat('xx',rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+SELECT * FROM t1 WHERE LENGTH(a)=11;
+a
+SELECT * FROM t1 WHERE LENGTH(a)=11 AND a=' 2001-01-01';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=11 AND a=' 2001-01-01';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' 2001-01-01';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and (<cache>(length(DATE'2001-01-01')) = (11 + rand())))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' garbage ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Incorrect datetime value: ' garbage '
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'0000-00-00') and (<cache>(length(DATE'0000-00-00')) = (11 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='20010101';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='20010101';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8+RAND() AND a='20010101';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and (<cache>(length(DATE'2001-01-01')) = (8 + rand())))
+DROP TABLE t1;
+#
+# MDEV-8706 Wrong result for SELECT..WHERE time_column=TIMESTAMP'2015-08-30 00:00:00' AND time_column='00:00:00'
+#
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIME'00:00:00';
+a
+2015-08-30
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+a
+2015-08-30
+2015-08-31
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'00:00:00';
+a
+2015-08-30
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-30')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-30') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIME'24:00:00';
+a
+2015-08-31
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+a
+2015-08-30
+2015-08-31
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'24:00:00';
+a
+2015-08-31
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'24:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-31')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'24:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-31') and (<cache>(length(DATE'2015-08-31')) = (30 + rand())))
+DROP TABLE t1;
+# In this example '00:00:00' is not recognized as TIME'00:00:00'
+# and is treated as DATE'0000-00-00'.
+# This may change after MDEV-8322 Distinguish between time and date strings more carefully
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a='00:00:00';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+a
+2015-08-30
+2015-08-31
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='00:00:00';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'0000-00-00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'0000-00-00') and (<cache>(length(DATE'0000-00-00')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00';
+a
+2015-08-30
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+a
+2015-08-30
+2015-08-31
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00';
+a
+2015-08-30
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00.1';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+a
+2015-08-30
+2015-08-31
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00.1';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00.1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00.1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a='2015-08-30 00:00:00';
+a
+2015-08-30
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+a
+2015-08-30
+2015-08-31
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='2015-08-30 00:00:00';
+a
+2015-08-30
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='2015-08-30 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-30')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='2015-08-30 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-30') and (<cache>(length(DATE'2015-08-30')) = (30 + rand())))
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+# MDEV-8795 Equal expression propagation does not work for temporal literals
+#
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=DATE'2001-01-01' AND COALESCE(a)>=DATE'2001-01-01';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = DATE'2001-01-01')
+DROP TABLE t1;
+#
+# MDEV-8658 DATE(zerofill_column) and DATE(COALESCE(zerofill_column)) return different results
+#
+CREATE TABLE t1 (a INT(6) ZEROFILL, b DECIMAL(6) ZEROFILL, c DOUBLE(6,0) ZEROFILL);
+INSERT INTO t1 VALUES (1,1,1);
+INSERT INTO t1 VALUES (10101,10101,10101);
+SELECT DATE(a), DATE(b), DATE(c) FROM t1;
+DATE(a) DATE(b) DATE(c)
+NULL NULL NULL
+2001-01-01 2001-01-01 2001-01-01
+Warnings:
+Warning 1292 Incorrect datetime value: '1' for column 'a' at row 1
+Warning 1292 Incorrect datetime value: '1' for column 'b' at row 1
+Warning 1292 Incorrect datetime value: '1' for column 'c' at row 1
+SELECT DATE(COALESCE(a)), DATE(COALESCE(b)), DATE(COALESCE(c)) FROM t1;
+DATE(COALESCE(a)) DATE(COALESCE(b)) DATE(COALESCE(c))
+NULL NULL NULL
+2001-01-01 2001-01-01 2001-01-01
+Warnings:
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT(6), b DECIMAL(6), c DOUBLE(6,0));
+INSERT INTO t1 VALUES (1,1,1);
+INSERT INTO t1 VALUES (10101,10101,10101);
+SELECT DATE(a), DATE(b), DATE(c) FROM t1;
+DATE(a) DATE(b) DATE(c)
+NULL NULL NULL
+2001-01-01 2001-01-01 2001-01-01
+Warnings:
+Warning 1292 Incorrect datetime value: '1' for column 'a' at row 1
+Warning 1292 Incorrect datetime value: '1' for column 'b' at row 1
+Warning 1292 Incorrect datetime value: '1' for column 'c' at row 1
+SELECT DATE(COALESCE(a)), DATE(COALESCE(b)), DATE(COALESCE(c)) FROM t1;
+DATE(COALESCE(a)) DATE(COALESCE(b)) DATE(COALESCE(c))
+NULL NULL NULL
+2001-01-01 2001-01-01 2001-01-01
+Warnings:
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1'
+DROP TABLE t1;
+#
+# MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
+#
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+SELECT d, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP HAVING CASE d WHEN '2017-05-25' THEN 0 ELSE 1 END;
+d COUNT(*)
+1985-05-13 1
+1989-12-24 1
+NULL 2
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index e033fe48607..bf09ec8d0eb 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -57,7 +57,7 @@ select * from t1;
t
0000-00-00 00:00:00
drop table t1;
-CREATE TABLE t1 (a timestamp, b date, c time, d datetime);
+CREATE TABLE t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b date, c time, d datetime);
insert into t1 (b,c,d) values(now(),curtime(),now());
Warnings:
Note 1265 Data truncated for column 'b' at row 1
@@ -103,7 +103,7 @@ date numfacture expedition
0000-00-00 00:00:00 1212 0001-00-00 00:00:00
EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref expedition expedition 8 const 1
+1 SIMPLE t1 ref expedition expedition 5 const 1
drop table t1;
create table t1 (a datetime not null, b datetime not null);
insert into t1 values (now(), now());
@@ -229,7 +229,7 @@ ERROR 42000: Invalid default value for 'da'
create table t1 (t time default '916:00:00 a');
ERROR 42000: Invalid default value for 't'
set @@sql_mode= @org_mode;
-create table t1 (f1 date, f2 datetime, f3 timestamp);
+create table t1 (f1 date, f2 datetime, f3 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1(f1) values(curdate());
select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
curdate() < now() f1 < now() cast(f1 as date) < now()
@@ -266,7 +266,7 @@ f1 f2 f1 > f2 f1 = f2 f1 < f2
2001-04-15 2001-04-15 00:00:00 0 1 0
2001-05-20 2001-05-20 01:01:01 0 0 1
drop table t1;
-create table t1 (f1 date, f2 datetime, f3 timestamp);
+create table t1 (f1 date, f2 datetime, f3 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
@@ -745,9 +745,9 @@ SET NAMES CP850;
INSERT INTO t1 VALUES (1,'2010-04-12 22:30:12'), (2,'2010-04-12 22:30:12'), (3,'2010-04-12 22:30:12');
EXPLAIN EXTENDED SELECT * FROM t1 FORCE INDEX(attime) WHERE AtTime = '2010-02-22 18:40:07';
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref AtTime AtTime 9 const 1 100.00
+1 SIMPLE t1 ref AtTime AtTime 6 const 1 100.00
Warnings:
-Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = '2010-02-22 18:40:07')
+Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = TIMESTAMP'2010-02-22 18:40:07')
DROP TABLE t1;
SET NAMES latin1;
#
@@ -773,7 +773,7 @@ f1
t2 should be const
explain select * from t2 where f1=STR_TO_DATE('4/1/2010', '%m/%d/%Y');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 const PRIMARY PRIMARY 8 const 1 Using index
+1 SIMPLE t2 const PRIMARY PRIMARY 5 const 1 Using index
DROP TABLE t1,t2;
#
# Bug#57095: Wrongly chosen expression cache type led to a wrong
@@ -844,3 +844,307 @@ DROP TABLE t1;
#
# End of 5.5 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATETIME DEFAULT '0000-00-00 00:00:00');
+SET sql_mode=TRADITIONAL;
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
+ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'a' at row 1
+INSERT INTO t1 VALUES ();
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'a'
+INSERT INTO t1 VALUES (DEFAULT);
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'a'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', b DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00');
+CREATE TABLE t2 (a DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00');
+INSERT INTO t2 VALUES ('0000-00-00 00:00:00');
+SET sql_mode=TRADITIONAL;
+INSERT INTO t1 (a) SELECT a FROM t2;
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'b'
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATETIME DEFAULT '0000-00-00 00:00:00', b DATETIME DEFAULT '0000-00-00 00:00:00');
+INSERT INTO t1 VALUES (DEFAULT,DEFAULT);;
+SELECT a INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1;
+DELETE FROM t1;
+SET sql_mode=TRADITIONAL;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/mdev-7824.txt' INTO TABLE t1 (a);
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'b'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATETIME DEFAULT '0000-00-00 00:00:00');;
+SET sql_mode='NO_ZERO_DATE';
+ALTER TABLE t1 ADD b INT NOT NULL;
+ERROR 42000: Invalid default value for 'a'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
+# End of MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+#
+#
+# MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATETIME);;
+INSERT INTO t1 VALUES (0);
+SET sql_mode='TRADITIONAL';
+CREATE TABLE t2 AS SELECT * FROM t1;
+ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'a' at row 1
+DROP TABLE t1;
+#
+# End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+#
+#
+# MDEV-8336 The meaning of NO_ZERO_DATE is not clear for DATETIME
+#
+SET sql_mode='NO_ZERO_DATE';
+SELECT TIMESTAMP'0000-00-01 10:20:30';
+TIMESTAMP'0000-00-01 10:20:30'
+0000-00-01 10:20:30
+SELECT TIMESTAMP'0000-00-00 10:20:30';
+TIMESTAMP'0000-00-00 10:20:30'
+0000-00-00 10:20:30
+SELECT TIMESTAMP'0000-00-00 00:00:00.000001';
+TIMESTAMP'0000-00-00 00:00:00.000001'
+0000-00-00 00:00:00.000001
+CREATE TABLE t1 (a DATETIME);
+INSERT INTO t1 VALUES ('0000-00-00 10:20:30');
+SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1;
+a LEAST(a,'2001-01-01 10:20:30')
+0000-00-00 10:20:30 0000-00-00 10:20:30.000000
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00.000001');
+SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1;
+a LEAST(a,'2001-01-01 10:20:30')
+0000-00-00 00:00:00.000001 0000-00-00 00:00:00.000001
+DROP TABLE t1;
+SELECT STR_TO_DATE('0000-00-00 10:20:30','%Y-%m-%d %h:%i:%s');
+STR_TO_DATE('0000-00-00 10:20:30','%Y-%m-%d %h:%i:%s')
+0000-00-00 10:20:30
+SELECT STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f');
+STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f')
+0000-00-00 00:00:00.000001
+SET old_mode=zero_date_time_cast;
+SELECT CAST(TIME'10:20:30' AS DATETIME);
+CAST(TIME'10:20:30' AS DATETIME)
+0000-00-00 10:20:30
+SELECT CAST(TIME'00:00:00.000001' AS DATETIME(6));
+CAST(TIME'00:00:00.000001' AS DATETIME(6))
+0000-00-00 00:00:00.000001
+SELECT CAST(CAST('10:20:30' AS TIME) AS DATETIME);
+CAST(CAST('10:20:30' AS TIME) AS DATETIME)
+0000-00-00 10:20:30
+SELECT CAST(CAST('00:00:00.000001' AS TIME(6)) AS DATETIME(6));
+CAST(CAST('00:00:00.000001' AS TIME(6)) AS DATETIME(6))
+0000-00-00 00:00:00.000001
+SELECT CAST(CAST(TIMESTAMP'0000-00-00 10:20:30' AS TIME) AS DATETIME);
+CAST(CAST(TIMESTAMP'0000-00-00 10:20:30' AS TIME) AS DATETIME)
+0000-00-00 10:20:30
+SELECT CAST(CAST(TIMESTAMP'0000-00-00 00:00:00.000001' AS TIME(6)) AS DATETIME(6));
+CAST(CAST(TIMESTAMP'0000-00-00 00:00:00.000001' AS TIME(6)) AS DATETIME(6))
+0000-00-00 00:00:00.000001
+SET old_mode=DEFAULT;
+SET sql_mode=DEFAULT;
+#
+# MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+#
+CREATE TABLE t1 (a DATETIME);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a='2001-01-01 00:00:00x';
+a
+2001-01-01 00:00:00
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+SELECT * FROM t1 WHERE LENGTH(a) != 20;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+a
+2001-01-01 00:00:00
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+a
+2001-01-01 00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Incorrect datetime value: ' garbage '
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and (<cache>(length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(6));;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00.000000
+SELECT * FROM t1 WHERE LENGTH(a)=26;
+a
+2001-01-01 00:00:00.000000
+2001-01-01 00:00:01.000000
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00.000000
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00.000000')) = (40 + rand())))
+DROP TABLE t1;
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+CREATE TABLE t1 (a DATETIME);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIME'00:00:00';
+a
+2001-01-01 00:00:00
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+a
+2001-01-01 00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
+DROP TABLE t1;
+#
+# MDEV-8795 Equal expression propagation does not work for temporal literals
+#
+CREATE TABLE t1 (a DATETIME);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-02 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIMESTAMP'2001-01-01 00:00:00' AND COALESCE(a)>=TIMESTAMP'2001-01-01 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIMESTAMP'2001-01-01 00:00:00')
+DROP TABLE t1;
+#
+# MDEV-8875 Wrong metadata for MAX(CAST(time_column AS DATETIME))
+#
+SET timestamp=UNIX_TIMESTAMP('2015-01-01 00:00:00');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:01:00');
+SELECT MAX(CAST(a AS DATETIME)) FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def MAX(CAST(a AS DATETIME)) 12 19 19 Y 128 0 63
+MAX(CAST(a AS DATETIME))
+2015-01-01 00:01:00
+CREATE TABLE t2 AS SELECT MAX(CAST(a AS DATETIME)) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `MAX(CAST(a AS DATETIME))` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+# MDEV-8860 Wrong result for WHERE 2016 < SOME (SELECT CAST(time_column AS DATETIME) FROM t1)
+#
+SET timestamp=UNIX_TIMESTAMP('2015-01-01 00:00:00');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:01:00');
+SELECT 1 FROM t1 WHERE 2016 > SOME (SELECT CAST(a AS DATETIME) FROM t1);
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '2016'
+SELECT * FROM t1 WHERE 2016 > CAST(a AS DATETIME);
+a
+Warnings:
+Warning 1292 Incorrect datetime value: '2016'
+SELECT 1 FROM t1 WHERE 20160101 > SOME (SELECT CAST(a AS DATETIME) FROM t1);
+1
+1
+1
+SELECT * FROM t1 WHERE 20160101 > CAST(a AS DATETIME);
+a
+00:00:00
+00:01:00
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index 7ff74c8270a..e515326e851 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -181,7 +181,7 @@ Note 1265 Data truncated for column 'a' at row 3
Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column 'a' at row 4
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
Note 1265 Data truncated for column 'a' at row 3
select * from t1;
a
@@ -245,7 +245,7 @@ Note 1265 Data truncated for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 3
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
Note 1265 Data truncated for column 'a' at row 3
select * from t1;
a
@@ -303,7 +303,7 @@ Note 1265 Data truncated for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 3
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
Note 1265 Data truncated for column 'a' at row 3
select * from t1;
a
@@ -356,6 +356,9 @@ insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
Warnings:
Note 1265 Data truncated for column 'a' at row 3
insert into t1 values (MID("987",1,2)),("987 "),("987.6e+2 ");
+Warnings:
+Note 1265 Data truncated for column 'a' at row 2
+Note 1265 Data truncated for column 'a' at row 3
select * from t1;
a
0.00
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index dd9277517d8..d901434fd6e 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -2082,3 +2082,55 @@ DROP TABLE t1;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8729 Wrong result for SELECT..WHERE HEX(enum_column)='61' AND enum_column='a '
+#
+CREATE TABLE t1 (a ENUM('a','A') CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a ';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+a
+a
+# Can't propagate the equality into HEX(a), because binary collations still ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a ') and (hex(`test`.`t1`.`a`) = '61'))
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('a','a ') CHARACTER SET BINARY);
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE a='a ';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+a
+# Ok to propagate the equality into HEX(a), because "CHARACTER SET BINARY" does not ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 57e2660750b..e7267f012ae 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -245,22 +245,22 @@ show warnings;
Level Code Message
desc t1;
Field Type Null Key Default Extra
-x decimal(21,2) NO 0.00
+x decimal(21,2) NO NULL
drop table t1;
create table t1 select 0.0 x;
desc t1;
Field Type Null Key Default Extra
-x decimal(2,1) NO 0.0
+x decimal(2,1) NO NULL
create table t2 select 105213674794682365.00 y;
desc t2;
Field Type Null Key Default Extra
-y decimal(20,2) NO 0.00
+y decimal(20,2) NO NULL
create table t3 select x+y a from t1,t2;
show warnings;
Level Code Message
desc t3;
Field Type Null Key Default Extra
-a decimal(21,2) NO 0.00
+a decimal(21,2) NO NULL
drop table t1,t2,t3;
select 1e-308, 1.00000001e-300, 100000000e-300;
1e-308 1.00000001e-300 100000000e-300
@@ -458,7 +458,7 @@ Warnings:
Warning 1265 Data truncated for column 'f' at row 1
INSERT INTO t1 VALUES ('.');
Warnings:
-Warning 1265 Data truncated for column 'f' at row 1
+Warning 1366 Incorrect double value: '.' for column 'f' at row 1
SELECT * FROM t1 ORDER BY f;
f
0
@@ -532,3 +532,109 @@ DROP TABLE t1,t2;
#
# End of 10.0 tests
#
+#
+# MDEV-8704 Wrong result for SELECT..WHERE LENGTH(double_column)!=6 AND double_column=100e0
+#
+CREATE TABLE t1 (a DOUBLE(9,2));
+INSERT INTO t1 VALUES (100),(110);
+SELECT * FROM t1 WHERE LENGTH(a)!=6;
+a
+SELECT * FROM t1 WHERE LENGTH(a)!=6 AND a=100e0;
+a
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (100),(110);
+SELECT * FROM t1 WHERE LENGTH(a)!=6;
+a
+100
+110
+SELECT * FROM t1 WHERE LENGTH(a)!=6 AND a=100e0;
+a
+100
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=6 AND a=100e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 100e0)
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=100e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 100e0) and (<cache>(length(100)) <> rand()))
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE(10,1));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=3;
+a
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10e0;
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+# Notice 1.1 instead of 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10e0) and (<cache>(length(1.1)) <> rand()))
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE(10,2));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=4;
+a
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10e0;
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+# Notice 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10e0) and (<cache>(length(1.10)) <> rand()))
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE(10,3));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=5;
+a
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10e0;
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+# Notice 1.100 rather than 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10e0) and (<cache>(length(1.100)) <> rand()))
+DROP TABLE t1;
+#
+# MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+#
+CREATE TABLE t1 (a DOUBLE ZEROFILL);
+INSERT INTO t1 VALUES (2010),(2020);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010e0 AND a>=2010e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010e0)
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_int.result b/mysql-test/r/type_int.result
new file mode 100644
index 00000000000..4e7b928ac07
--- /dev/null
+++ b/mysql-test/r/type_int.result
@@ -0,0 +1,38 @@
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+#
+CREATE TABLE t1 (a INT ZEROFILL);
+INSERT INTO t1 VALUES (2010),(2020);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=2010;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010)
+DROP TABLE t1;
+#
+# MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+#
+CREATE TABLE t1 (a INT ZEROFILL);
+INSERT INTO t1 VALUES (128),(129);
+SELECT * FROM t1 WHERE a=128;
+a
+0000000128
+SELECT * FROM t1 WHERE hex(a)='80';
+a
+0000000128
+SELECT * FROM t1 WHERE a=128 AND hex(a)='80';
+a
+0000000128
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=128 AND hex(a)='80';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 128) and (hex(`test`.`t1`.`a`) = '80'))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index ab075d29e22..56a04971fa1 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -52,13 +52,13 @@ if(1, 1.1, 1.2) if(0, 1.1, 1.2) if(0.1, 1.1, 1.2) if(0, 1, 1.1) if(0, NULL, 1.2)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `if(1, 1.1, 1.2)` decimal(2,1) NOT NULL DEFAULT '0.0',
- `if(0, 1.1, 1.2)` decimal(2,1) NOT NULL DEFAULT '0.0',
- `if(0.1, 1.1, 1.2)` decimal(2,1) NOT NULL DEFAULT '0.0',
- `if(0, 1, 1.1)` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `if(1, 1.1, 1.2)` decimal(2,1) NOT NULL,
+ `if(0, 1.1, 1.2)` decimal(2,1) NOT NULL,
+ `if(0.1, 1.1, 1.2)` decimal(2,1) NOT NULL,
+ `if(0, 1, 1.1)` decimal(2,1) NOT NULL,
`if(0, NULL, 1.2)` decimal(2,1) DEFAULT NULL,
- `if(1, 0.22e1, 1.1)` double NOT NULL DEFAULT '0',
- `if(1E0, 1.1, 1.2)` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `if(1, 0.22e1, 1.1)` double NOT NULL,
+ `if(1E0, 1.1, 1.2)` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select nullif(1.1, 1.1), nullif(1.1, 1.2), nullif(1.1, 0.11e1), nullif(1.0, 1), nullif(1, 1.0), nullif(1, 1.1);
@@ -174,10 +174,10 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(-
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `round(15.4,-1)` decimal(3,0) NOT NULL DEFAULT '0',
- `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL DEFAULT '0',
- `abs(-1.1)` decimal(3,1) NOT NULL DEFAULT '0.0',
- `-(-1.1)` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `round(15.4,-1)` decimal(3,0) NOT NULL,
+ `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL,
+ `abs(-1.1)` decimal(3,1) NOT NULL,
+ `-(-1.1)` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set session sql_mode='traditional';
@@ -771,7 +771,7 @@ create table t1 as select 0.5;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `0.5` decimal(2,1) NOT NULL DEFAULT '0.0'
+ `0.5` decimal(2,1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select round(1.5),round(2.5);
@@ -1509,7 +1509,7 @@ Warnings:
Note 1265 Data truncated for column 'f1' at row 1
DESC t1;
Field Type Null Key Default Extra
-f1 decimal(31,30) NO 0.000000000000000000000000000000
+f1 decimal(31,30) NO NULL
SELECT f1 FROM t1;
f1
0.123456789012345678901234567890
@@ -1519,7 +1519,7 @@ Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
DESC t1;
Field Type Null Key Default Extra
-f1 decimal(65,30) NO 0.000000000000000000000000000000
+f1 decimal(65,30) NO NULL
SELECT f1 FROM t1;
f1
99999999999999999999999999999999999.999999999999999999999999999999
@@ -1623,7 +1623,7 @@ Warnings:
Note 1265 Data truncated for column 'my_col' at row 1
DESCRIBE t1;
Field Type Null Key Default Extra
-my_col decimal(30,30) NO 0.000000000000000000000000000000
+my_col decimal(30,30) NO NULL
SELECT my_col FROM t1;
my_col
0.123456789123456789123456789123
@@ -1633,7 +1633,7 @@ Warnings:
Note 1265 Data truncated for column 'my_col' at row 1
DESCRIBE t1;
Field Type Null Key Default Extra
-my_col decimal(65,30) NO 0.000000000000000000000000000000
+my_col decimal(65,30) NO NULL
SELECT my_col FROM t1;
my_col
1.123456789123456789123456789123
@@ -1643,7 +1643,7 @@ Warnings:
Note 1265 Data truncated for column 'my_col' at row 1
DESCRIBE t1;
Field Type Null Key Default Extra
-my_col decimal(65,30) NO 0.000000000000000000000000000000
+my_col decimal(65,30) NO NULL
SELECT my_col FROM t1;
my_col
0.123456789123456789123456789123
@@ -1679,7 +1679,7 @@ Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,0) NO 0
+c1 decimal(65,0) NO NULL
SELECT * FROM t1;
c1
99999999999999999999999999999999999999999999999999999999999999999
@@ -1691,7 +1691,7 @@ Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,0) NO 0
+c1 decimal(65,0) NO NULL
SELECT * FROM t1;
c1
99999999999999999999999999999999999999999999999999999999999999999
@@ -1703,7 +1703,7 @@ Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,0) NO 0
+c1 decimal(65,0) NO NULL
SELECT * FROM t1;
c1
99999999999999999999999999999999999999999999999999999999999999999
@@ -1715,7 +1715,7 @@ Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated.
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,0) NO 0
+c1 decimal(65,0) NO NULL
SELECT * FROM t1;
c1
99999999999999999999999999999999999999999999999999999999999999999
@@ -1727,7 +1727,7 @@ Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,30) NO 0.000000000000000000000000000000
+c1 decimal(65,30) NO NULL
SELECT * FROM t1;
c1
99999999999999999999999999999999999.999999999999999999999999999999
@@ -1737,7 +1737,7 @@ CREATE TABLE t1 SELECT
AS c1;
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(31,30) NO 0.000000000000000000000000000000
+c1 decimal(31,30) NO NULL
SELECT * FROM t1;
c1
1.100000000000000000000000000000
@@ -1747,7 +1747,7 @@ CREATE TABLE t1 SELECT
AS c1;
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(31,30) NO 0.000000000000000000000000000000
+c1 decimal(31,30) NO NULL
SELECT * FROM t1;
c1
1.100000000000000000000000000000
@@ -1759,7 +1759,7 @@ Warnings:
Note 1265 Data truncated for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(30,30) NO 0.000000000000000000000000000000
+c1 decimal(30,30) NO NULL
SELECT * FROM t1;
c1
0.100000000000000000000000000000
@@ -1771,7 +1771,7 @@ Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,30) NO 0.000000000000000000000000000000
+c1 decimal(65,30) NO NULL
SELECT * FROM t1;
c1
99999999999999999999999999999999999.999999999999999999999999999999
@@ -1783,7 +1783,7 @@ Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,1) NO 0.0
+c1 decimal(65,1) NO NULL
SELECT * FROM t1;
c1
9999999999999999999999999999999999999999999999999999999999999999.9
@@ -1795,7 +1795,7 @@ Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,1) NO 0.0
+c1 decimal(65,1) NO NULL
SELECT * FROM t1;
c1
9999999999999999999999999999999999999999999999999999999999999999.9
@@ -1807,7 +1807,7 @@ Warnings:
Note 1265 Data truncated for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(30,30) NO 0.000000000000000000000000000000
+c1 decimal(30,30) NO NULL
SELECT * FROM t1;
c1
0.123456789012345678901234567890
@@ -1817,7 +1817,7 @@ Warnings:
Note 1265 Data truncated for column 'c1' at row 1
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(33,30) NO 0.000000000000000000000000000000
+c1 decimal(33,30) NO NULL
SELECT * FROM t1;
c1
123.123456789012345678901234567890
@@ -1825,7 +1825,7 @@ DROP TABLE t1;
CREATE TABLE t1 SELECT 1.1 + CAST(1 AS DECIMAL(65,30)) AS c1;
DESC t1;
Field Type Null Key Default Extra
-c1 decimal(65,30) NO 0.000000000000000000000000000000
+c1 decimal(65,30) NO NULL
SELECT * FROM t1;
c1
2.100000000000000000000000000000
@@ -2042,33 +2042,19 @@ SELECT t1.* FROM t1 JOIN t2 USING(a);
a
10:20:30.000000
10:20:30.000000
-Warnings:
-Note 1292 Truncated incorrect time value: '102030.0000000000'
-Note 1292 Truncated incorrect time value: '102030.0000000010'
SELECT t1.* FROM t1 LEFT JOIN t2 USING(a);
a
10:20:30.000000
10:20:30.000000
-Warnings:
-Note 1292 Truncated incorrect time value: '102030.0000000000'
-Note 1292 Truncated incorrect time value: '102030.0000000000'
-Note 1292 Truncated incorrect time value: '102030.0000000010'
ALTER TABLE t2 ADD PRIMARY KEY(a);
SELECT t1.* FROM t1 JOIN t2 USING(a);
a
10:20:30.000000
10:20:30.000000
-Warnings:
-Note 1292 Truncated incorrect time value: '102030.0000000000'
-Note 1292 Truncated incorrect time value: '102030.0000000010'
SELECT t1.* FROM t1 LEFT JOIN t2 USING(a);
a
10:20:30.000000
10:20:30.000000
-Warnings:
-Note 1292 Truncated incorrect time value: '102030.0000000000'
-Note 1292 Truncated incorrect time value: '102030.0000000000'
-Note 1292 Truncated incorrect time value: '102030.0000000010'
# t2 should NOT be eliminated
EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 USING(a);
id select_type table type possible_keys key key_len ref rows Extra
@@ -2078,3 +2064,221 @@ DROP TABLE t1,t2;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8703 Wrong result for SELECT..WHERE LENGTH(decimal_10_1_column)!=3 AND decimal_10_1_column=1.10
+#
+CREATE TABLE t1 (a DECIMAL(10,1));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=3;
+a
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10;
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+# Notice 1.1 instead of 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10) and (<cache>(length(1.1)) <> rand()))
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(10,2));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=4;
+a
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10;
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+# Notice 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10) and (<cache>(length(1.10)) <> rand()))
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(10,3));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=5;
+a
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10;
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+# Notice 1.100 rather than 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10) and (<cache>(length(1.100)) <> rand()))
+DROP TABLE t1;
+#
+# MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+#
+CREATE TABLE t1 (a DECIMAL(10,1) ZEROFILL);
+INSERT INTO t1 VALUES (2010),(2020);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010.0 AND a>=2010.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010.0)
+DROP TABLE t1;
+#
+# MDEV-8635 Redundant warnings on WHERE decimal_column='ax'
+#
+CREATE TABLE t1 (a DECIMAL, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+EXPLAIN SELECT * FROM t1 WHERE a='ax' ORDER BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 6 const 1 Using where; Using index; Using filesort
+DROP TABLE t1;
+#
+# MDEV-8502 DECIMAL accepts out of range DEFAULT values
+#
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000);
+ERROR 42000: Invalid default value for 'a'
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000.0);
+ERROR 42000: Invalid default value for 'a'
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000e0);
+ERROR 42000: Invalid default value for 'a'
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.0');
+ERROR 42000: Invalid default value for 'a'
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.1');
+ERROR 42000: Invalid default value for 'a'
+#
+# MDEV-10277 Redundant NOTE when inserting '0.00001 ' into a DECIMAL(2,1) column
+#
+CREATE TABLE t1 (a DECIMAL(2,1));
+INSERT INTO t1 VALUES ('0.00001 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+INSERT INTO t1 VALUES ('1e-10000 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+INSERT INTO t1 VALUES ('0.1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+INSERT INTO t1 VALUES ('0.111 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+SELECT * FROM t1;
+a
+0.0
+0.0
+0.1
+0.1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '1e-10000');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(2,1) DEFAULT '0.0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(2,1) DEFAULT '0.1'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(2,1) DEFAULT '0.1'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(2,1) DEFAULT '0.1'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001);
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(2,1) DEFAULT '0.1'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001e0);
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(2,1) DEFAULT '0.1'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
+#
+# Bug#18408499 UNSIGNED BIGINT HIGH VALUES
+# WRONG NUMERICAL COMPARISON RESULTS
+#
+CREATE TABLE t1(value DECIMAL(24,0) NOT NULL);
+INSERT INTO t1(value)
+VALUES('100000000000000000000001'),
+('100000000000000000000002'),
+('100000000000000000000003');
+SELECT * FROM t1 WHERE value = '100000000000000000000002';
+value
+100000000000000000000002
+SELECT * FROM t1 WHERE '100000000000000000000002' = value;
+value
+100000000000000000000002
+SELECT * FROM t1 WHERE value + 0 = '100000000000000000000002';
+value
+100000000000000000000002
+SELECT * FROM t1 WHERE value = 100000000000000000000002;
+value
+100000000000000000000002
+SELECT * FROM t1 WHERE value + 0 = 100000000000000000000002;
+value
+100000000000000000000002
+PREPARE stmt FROM 'SELECT * FROM t1 WHERE value = ?';
+set @a="100000000000000000000002";
+EXECUTE stmt using @a;
+value
+100000000000000000000002
+set @a=100000000000000000000002;
+EXECUTE stmt using @a;
+value
+100000000000000000000002
+DEALLOCATE PREPARE stmt;
+ALTER TABLE t1 ADD INDEX value (value);
+SELECT * FROM t1 WHERE value = '100000000000000000000002';
+value
+100000000000000000000002
+DROP TABLE t1;
diff --git a/mysql-test/r/type_num.result b/mysql-test/r/type_num.result
new file mode 100644
index 00000000000..2eed7890e75
--- /dev/null
+++ b/mysql-test/r/type_num.result
@@ -0,0 +1,1251 @@
+#
+# Start of 10.0 tests
+#
+#
+# MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
+#
+SET sql_mode='STRICT_ALL_TABLES';
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1 ');
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('');
+ERROR 22007: Incorrect double value: '' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('');
+ERROR 22007: Incorrect double value: '' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('');
+ERROR 22007: Incorrect integer value: '' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('');
+ERROR 22007: Incorrect integer value: '' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('');
+ERROR 22007: Incorrect integer value: '' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('');
+ERROR 22007: Incorrect integer value: '' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('');
+ERROR 22007: Incorrect decimal value: '' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('x');
+ERROR 22007: Incorrect double value: 'x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('x');
+ERROR 22007: Incorrect double value: 'x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('x');
+ERROR 22007: Incorrect integer value: 'x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('x');
+ERROR 22007: Incorrect integer value: 'x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('x');
+ERROR 22007: Incorrect integer value: 'x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('x');
+ERROR 22007: Incorrect integer value: 'x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('x');
+ERROR 22007: Incorrect decimal value: 'x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES (' x');
+ERROR 22007: Incorrect double value: ' x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (' x');
+ERROR 22007: Incorrect double value: ' x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES (' x');
+ERROR 22007: Incorrect integer value: ' x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES (' x');
+ERROR 22007: Incorrect integer value: ' x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (' x');
+ERROR 22007: Incorrect integer value: ' x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES (' x');
+ERROR 22007: Incorrect integer value: ' x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES (' x');
+ERROR 22007: Incorrect decimal value: ' x' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('.');
+ERROR 22007: Incorrect double value: '.' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('.');
+ERROR 22007: Incorrect double value: '.' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('.');
+ERROR 22007: Incorrect integer value: '.' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('.');
+ERROR 22007: Incorrect integer value: '.' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('.');
+ERROR 22007: Incorrect integer value: '.' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('.');
+ERROR 22007: Incorrect integer value: '.' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('.');
+ERROR 22007: Incorrect decimal value: '.' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('-');
+ERROR 22007: Incorrect double value: '-' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('-');
+ERROR 22007: Incorrect double value: '-' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('-');
+ERROR 22007: Incorrect integer value: '-' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('-');
+ERROR 22007: Incorrect integer value: '-' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('-');
+ERROR 22007: Incorrect integer value: '-' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('-');
+ERROR 22007: Incorrect integer value: '-' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('-');
+ERROR 22007: Incorrect decimal value: '-' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('+');
+ERROR 22007: Incorrect double value: '+' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('+');
+ERROR 22007: Incorrect double value: '+' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('+');
+ERROR 22007: Incorrect integer value: '+' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('+');
+ERROR 22007: Incorrect integer value: '+' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('+');
+ERROR 22007: Incorrect integer value: '+' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('+');
+ERROR 22007: Incorrect integer value: '+' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('+');
+ERROR 22007: Incorrect decimal value: '+' for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1e');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1e');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1e');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1e');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1e');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1e');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1e');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1e+');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1e+');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1e+');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1e+');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1e+');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1e+');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1e+');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1E-');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1E-');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1E-');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1E-');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1E-');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1E-');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1E-');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1Ex');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1Ex');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1Ex');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1Ex');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1Ex');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1Ex');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1Ex');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1e+x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1e+x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1e+x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1e+x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1e+x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1e+x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1e+x');
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1e1000');
+ERROR 22003: Out of range value for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1e1000');
+ERROR 22003: Out of range value for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1e1000');
+ERROR 22003: Out of range value for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1e1000');
+ERROR 22003: Out of range value for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1e1000');
+ERROR 22003: Out of range value for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1e1000');
+ERROR 22003: Out of range value for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1e1000');
+ERROR 22003: Out of range value for column 'a' at row 1
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (
+f4 FLOAT,
+f8 DOUBLE,
+i1 TINYINT,
+i2 SMALLINT,
+i4 INT,
+i8 BIGINT,
+d DECIMAL
+);
+INSERT INTO t1 VALUES ('1 ','1 ','1 ','1 ','1 ','1 ','1 ');
+Warnings:
+Note 1265 Data truncated for column 'f4' at row 1
+Note 1265 Data truncated for column 'f8' at row 1
+Note 1265 Data truncated for column 'i1' at row 1
+Note 1265 Data truncated for column 'i2' at row 1
+Note 1265 Data truncated for column 'i4' at row 1
+Note 1265 Data truncated for column 'i8' at row 1
+Note 1265 Data truncated for column 'd' at row 1
+INSERT INTO t1 VALUES ('','','','','','','');
+Warnings:
+Warning 1366 Incorrect double value: '' for column 'f4' at row 1
+Warning 1366 Incorrect double value: '' for column 'f8' at row 1
+Warning 1366 Incorrect integer value: '' for column 'i1' at row 1
+Warning 1366 Incorrect integer value: '' for column 'i2' at row 1
+Warning 1366 Incorrect integer value: '' for column 'i4' at row 1
+Warning 1366 Incorrect integer value: '' for column 'i8' at row 1
+Warning 1366 Incorrect decimal value: '' for column 'd' at row 1
+INSERT INTO t1 VALUES ('x','x','x','x','x','x','x');
+Warnings:
+Warning 1366 Incorrect double value: 'x' for column 'f4' at row 1
+Warning 1366 Incorrect double value: 'x' for column 'f8' at row 1
+Warning 1366 Incorrect integer value: 'x' for column 'i1' at row 1
+Warning 1366 Incorrect integer value: 'x' for column 'i2' at row 1
+Warning 1366 Incorrect integer value: 'x' for column 'i4' at row 1
+Warning 1366 Incorrect integer value: 'x' for column 'i8' at row 1
+Warning 1366 Incorrect decimal value: 'x' for column 'd' at row 1
+INSERT INTO t1 VALUES (' x',' x',' x',' x',' x',' x',' x');
+Warnings:
+Warning 1366 Incorrect double value: ' x' for column 'f4' at row 1
+Warning 1366 Incorrect double value: ' x' for column 'f8' at row 1
+Warning 1366 Incorrect integer value: ' x' for column 'i1' at row 1
+Warning 1366 Incorrect integer value: ' x' for column 'i2' at row 1
+Warning 1366 Incorrect integer value: ' x' for column 'i4' at row 1
+Warning 1366 Incorrect integer value: ' x' for column 'i8' at row 1
+Warning 1366 Incorrect decimal value: ' x' for column 'd' at row 1
+INSERT INTO t1 VALUES ('.','.','.','.','.','.','.');
+Warnings:
+Warning 1366 Incorrect double value: '.' for column 'f4' at row 1
+Warning 1366 Incorrect double value: '.' for column 'f8' at row 1
+Warning 1366 Incorrect integer value: '.' for column 'i1' at row 1
+Warning 1366 Incorrect integer value: '.' for column 'i2' at row 1
+Warning 1366 Incorrect integer value: '.' for column 'i4' at row 1
+Warning 1366 Incorrect integer value: '.' for column 'i8' at row 1
+Warning 1366 Incorrect decimal value: '.' for column 'd' at row 1
+INSERT INTO t1 VALUES ('-','-','-','-','-','-','-');
+Warnings:
+Warning 1366 Incorrect double value: '-' for column 'f4' at row 1
+Warning 1366 Incorrect double value: '-' for column 'f8' at row 1
+Warning 1366 Incorrect integer value: '-' for column 'i1' at row 1
+Warning 1366 Incorrect integer value: '-' for column 'i2' at row 1
+Warning 1366 Incorrect integer value: '-' for column 'i4' at row 1
+Warning 1366 Incorrect integer value: '-' for column 'i8' at row 1
+Warning 1366 Incorrect decimal value: '-' for column 'd' at row 1
+INSERT INTO t1 VALUES ('+','+','+','+','+','+','+');
+Warnings:
+Warning 1366 Incorrect double value: '+' for column 'f4' at row 1
+Warning 1366 Incorrect double value: '+' for column 'f8' at row 1
+Warning 1366 Incorrect integer value: '+' for column 'i1' at row 1
+Warning 1366 Incorrect integer value: '+' for column 'i2' at row 1
+Warning 1366 Incorrect integer value: '+' for column 'i4' at row 1
+Warning 1366 Incorrect integer value: '+' for column 'i8' at row 1
+Warning 1366 Incorrect decimal value: '+' for column 'd' at row 1
+INSERT INTO t1 VALUES ('1x','1x','1x','1x','1x','1x','1x');
+Warnings:
+Warning 1265 Data truncated for column 'f4' at row 1
+Warning 1265 Data truncated for column 'f8' at row 1
+Warning 1265 Data truncated for column 'i1' at row 1
+Warning 1265 Data truncated for column 'i2' at row 1
+Warning 1265 Data truncated for column 'i4' at row 1
+Warning 1265 Data truncated for column 'i8' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+INSERT INTO t1 VALUES ('1e','1e','1e','1e','1e','1e','1e');
+Warnings:
+Warning 1265 Data truncated for column 'f4' at row 1
+Warning 1265 Data truncated for column 'f8' at row 1
+Warning 1265 Data truncated for column 'i1' at row 1
+Warning 1265 Data truncated for column 'i2' at row 1
+Warning 1265 Data truncated for column 'i4' at row 1
+Warning 1265 Data truncated for column 'i8' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+INSERT INTO t1 VALUES ('1e-','1e-','1e-','1e-','1e-','1e-','1e-');
+Warnings:
+Warning 1265 Data truncated for column 'f4' at row 1
+Warning 1265 Data truncated for column 'f8' at row 1
+Warning 1265 Data truncated for column 'i1' at row 1
+Warning 1265 Data truncated for column 'i2' at row 1
+Warning 1265 Data truncated for column 'i4' at row 1
+Warning 1265 Data truncated for column 'i8' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+INSERT INTO t1 VALUES ('1E+','1E+','1E+','1E+','1E+','1E+','1E+');
+Warnings:
+Warning 1265 Data truncated for column 'f4' at row 1
+Warning 1265 Data truncated for column 'f8' at row 1
+Warning 1265 Data truncated for column 'i1' at row 1
+Warning 1265 Data truncated for column 'i2' at row 1
+Warning 1265 Data truncated for column 'i4' at row 1
+Warning 1265 Data truncated for column 'i8' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+INSERT INTO t1 VALUES ('1e1000','1e1000','1e1000','1e1000','1e1000','1e1000','1e1000');
+Warnings:
+Warning 1264 Out of range value for column 'f4' at row 1
+Warning 1264 Out of range value for column 'f4' at row 1
+Warning 1264 Out of range value for column 'f8' at row 1
+Warning 1264 Out of range value for column 'i1' at row 1
+Warning 1264 Out of range value for column 'i2' at row 1
+Warning 1264 Out of range value for column 'i4' at row 1
+Warning 1264 Out of range value for column 'i8' at row 1
+Warning 1264 Out of range value for column 'd' at row 1
+DELETE FROM t1;
+INSERT INTO t1 VALUES (0,0,0,0,0,0,0);
+INSERT INTO t1 VALUES (0,0,0,0,0,0,0);
+INSERT INTO t1 VALUES (1,1,1,1,1,1,1);
+INSERT INTO t1 VALUES (1,1,1,1,1,1,1);
+INSERT INTO t1 VALUES (2,2,2,2,2,2,2);
+INSERT INTO t1 VALUES (2,2,2,2,2,2,2);
+INSERT INTO t1 VALUES (3,3,3,3,3,3,3);
+INSERT INTO t1 VALUES (3,3,3,3,3,3,3);
+INSERT INTO t1 VALUES (4,4,4,4,4,4,4);
+INSERT INTO t1 VALUES (4,4,4,4,4,4,4);
+INSERT INTO t1 VALUES (5,5,5,5,5,5,5);
+INSERT INTO t1 VALUES (5,5,5,5,5,5,5);
+SELECT COUNT(*) FROM t1 WHERE f4='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 WHERE f8='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 WHERE i1='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 WHERE i2='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 WHERE i4='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 WHERE i8='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 WHERE d='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DECIMAL value: '1 '
+SELECT COUNT(*) FROM t1 WHERE f4='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 WHERE f8='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 WHERE i1='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 WHERE i2='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 WHERE i4='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 WHERE i8='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 WHERE d='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: ''
+SELECT COUNT(*) FROM t1 WHERE f4='x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+SELECT COUNT(*) FROM t1 WHERE f8='x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+SELECT COUNT(*) FROM t1 WHERE i1='x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+SELECT COUNT(*) FROM t1 WHERE i2='x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+SELECT COUNT(*) FROM t1 WHERE i4='x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+SELECT COUNT(*) FROM t1 WHERE i8='x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+SELECT COUNT(*) FROM t1 WHERE d='x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'x'
+SELECT COUNT(*) FROM t1 WHERE f4=' x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' x'
+SELECT COUNT(*) FROM t1 WHERE f8=' x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' x'
+SELECT COUNT(*) FROM t1 WHERE i1=' x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' x'
+SELECT COUNT(*) FROM t1 WHERE i2=' x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' x'
+SELECT COUNT(*) FROM t1 WHERE i4=' x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' x'
+SELECT COUNT(*) FROM t1 WHERE i8=' x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' x'
+SELECT COUNT(*) FROM t1 WHERE d=' x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: ' x'
+SELECT COUNT(*) FROM t1 WHERE f4='.';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '.'
+SELECT COUNT(*) FROM t1 WHERE f8='.';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '.'
+SELECT COUNT(*) FROM t1 WHERE i1='.';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '.'
+SELECT COUNT(*) FROM t1 WHERE i2='.';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '.'
+SELECT COUNT(*) FROM t1 WHERE i4='.';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '.'
+SELECT COUNT(*) FROM t1 WHERE i8='.';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '.'
+SELECT COUNT(*) FROM t1 WHERE d='.';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '.'
+SELECT COUNT(*) FROM t1 WHERE f4='-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '-'
+SELECT COUNT(*) FROM t1 WHERE f8='-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '-'
+SELECT COUNT(*) FROM t1 WHERE i1='-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '-'
+SELECT COUNT(*) FROM t1 WHERE i2='-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '-'
+SELECT COUNT(*) FROM t1 WHERE i4='-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '-'
+SELECT COUNT(*) FROM t1 WHERE i8='-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '-'
+SELECT COUNT(*) FROM t1 WHERE d='-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '-'
+SELECT COUNT(*) FROM t1 WHERE f4='+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '+'
+SELECT COUNT(*) FROM t1 WHERE f8='+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '+'
+SELECT COUNT(*) FROM t1 WHERE i1='+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '+'
+SELECT COUNT(*) FROM t1 WHERE i2='+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '+'
+SELECT COUNT(*) FROM t1 WHERE i4='+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '+'
+SELECT COUNT(*) FROM t1 WHERE i8='+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '+'
+SELECT COUNT(*) FROM t1 WHERE d='+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '+'
+SELECT COUNT(*) FROM t1 WHERE f4='1x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1x'
+SELECT COUNT(*) FROM t1 WHERE f8='1x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1x'
+SELECT COUNT(*) FROM t1 WHERE i1='1x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1x'
+SELECT COUNT(*) FROM t1 WHERE i2='1x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1x'
+SELECT COUNT(*) FROM t1 WHERE i4='1x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1x'
+SELECT COUNT(*) FROM t1 WHERE i8='1x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1x'
+SELECT COUNT(*) FROM t1 WHERE d='1x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '1x'
+SELECT COUNT(*) FROM t1 WHERE f4='1e';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e'
+SELECT COUNT(*) FROM t1 WHERE f8='1e';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e'
+SELECT COUNT(*) FROM t1 WHERE i1='1e';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e'
+SELECT COUNT(*) FROM t1 WHERE i2='1e';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e'
+SELECT COUNT(*) FROM t1 WHERE i4='1e';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e'
+SELECT COUNT(*) FROM t1 WHERE i8='1e';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e'
+SELECT COUNT(*) FROM t1 WHERE d='1e';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '1e'
+SELECT COUNT(*) FROM t1 WHERE f4='1e+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+'
+SELECT COUNT(*) FROM t1 WHERE f8='1e+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+'
+SELECT COUNT(*) FROM t1 WHERE i1='1e+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+'
+SELECT COUNT(*) FROM t1 WHERE i2='1e+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+'
+SELECT COUNT(*) FROM t1 WHERE i4='1e+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+'
+SELECT COUNT(*) FROM t1 WHERE i8='1e+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+'
+SELECT COUNT(*) FROM t1 WHERE d='1e+';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '1e+'
+SELECT COUNT(*) FROM t1 WHERE f4='1E-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1E-'
+SELECT COUNT(*) FROM t1 WHERE f8='1E-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1E-'
+SELECT COUNT(*) FROM t1 WHERE i1='1E-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1E-'
+SELECT COUNT(*) FROM t1 WHERE i2='1E-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1E-'
+SELECT COUNT(*) FROM t1 WHERE i4='1E-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1E-'
+SELECT COUNT(*) FROM t1 WHERE i8='1E-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1E-'
+SELECT COUNT(*) FROM t1 WHERE d='1E-';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '1E-'
+SELECT COUNT(*) FROM t1 WHERE f4='1Ex';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1Ex'
+SELECT COUNT(*) FROM t1 WHERE f8='1Ex';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1Ex'
+SELECT COUNT(*) FROM t1 WHERE i1='1Ex';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1Ex'
+SELECT COUNT(*) FROM t1 WHERE i2='1Ex';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1Ex'
+SELECT COUNT(*) FROM t1 WHERE i4='1Ex';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1Ex'
+SELECT COUNT(*) FROM t1 WHERE i8='1Ex';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1Ex'
+SELECT COUNT(*) FROM t1 WHERE d='1Ex';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '1Ex'
+SELECT COUNT(*) FROM t1 WHERE f4='1e+x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+x'
+SELECT COUNT(*) FROM t1 WHERE f8='1e+x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+x'
+SELECT COUNT(*) FROM t1 WHERE i1='1e+x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+x'
+SELECT COUNT(*) FROM t1 WHERE i2='1e+x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+x'
+SELECT COUNT(*) FROM t1 WHERE i4='1e+x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+x'
+SELECT COUNT(*) FROM t1 WHERE i8='1e+x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e+x'
+SELECT COUNT(*) FROM t1 WHERE d='1e+x';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '1e+x'
+SELECT COUNT(*) FROM t1 WHERE f4='1e1000';
+COUNT(*)
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e1000'
+SELECT COUNT(*) FROM t1 WHERE f8='1e1000';
+COUNT(*)
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e1000'
+SELECT COUNT(*) FROM t1 WHERE i1='1e1000';
+COUNT(*)
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e1000'
+SELECT COUNT(*) FROM t1 WHERE i2='1e1000';
+COUNT(*)
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e1000'
+SELECT COUNT(*) FROM t1 WHERE i4='1e1000';
+COUNT(*)
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e1000'
+SELECT COUNT(*) FROM t1 WHERE i8='1e1000';
+COUNT(*)
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '1e1000'
+SELECT COUNT(*) FROM t1 WHERE d='1e1000';
+COUNT(*)
+0
+Warnings:
+Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated.
+Warning 1292 Truncated incorrect DECIMAL value: '1e1000'
+ALTER TABLE t1
+ADD KEY f4(f4),
+ADD KEY f8(f8),
+ADD KEY i1(i1),
+ADD KEY i2(i2),
+ADD KEY i4(i4),
+ADD KEY i8(i8),
+ADD KEY d(d);
+SELECT COUNT(*) FROM t1 FORCE INDEX(f4) WHERE f4='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 FORCE INDEX(f8) WHERE f8='1 ';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i1) WHERE i1='1 ';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i2) WHERE i2='1 ';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i4) WHERE i4='1 ';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i8) WHERE i8='1 ';
+COUNT(*)
+2
+Warnings:
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT COUNT(*) FROM t1 FORCE INDEX(d) WHERE d='1 ';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(f4) WHERE f4='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 FORCE INDEX(f8) WHERE f8='';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i1) WHERE i1='';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i2) WHERE i2='';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i4) WHERE i4='';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 FORCE INDEX(i8) WHERE i8='';
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT COUNT(*) FROM t1 FORCE INDEX(d) WHERE d='';
+COUNT(*)
+2
+DROP TABLE t1;
+SELECT
+CAST('1 ' AS SIGNED),
+CAST('1 ' AS UNSIGNED),
+CAST('1 ' AS DECIMAL),
+CAST('1 ' AS DOUBLE);
+CAST('1 ' AS SIGNED) CAST('1 ' AS UNSIGNED) CAST('1 ' AS DECIMAL) CAST('1 ' AS DOUBLE)
+1 1 1 1
+Warnings:
+Note 1292 Truncated incorrect INTEGER value: '1 '
+Note 1292 Truncated incorrect INTEGER value: '1 '
+Note 1292 Truncated incorrect DECIMAL value: '1 '
+Note 1292 Truncated incorrect DOUBLE value: '1 '
+SELECT
+CAST('' AS SIGNED),
+CAST('' AS UNSIGNED),
+CAST('' AS DECIMAL),
+CAST('' AS DOUBLE);
+CAST('' AS SIGNED) CAST('' AS UNSIGNED) CAST('' AS DECIMAL) CAST('' AS DOUBLE)
+0 0 0 0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DOUBLE value: ''
+SELECT
+CAST('x' AS SIGNED),
+CAST('x' AS UNSIGNED),
+CAST('x' AS DECIMAL),
+CAST('x' AS DOUBLE);
+CAST('x' AS SIGNED) CAST('x' AS UNSIGNED) CAST('x' AS DECIMAL) CAST('x' AS DOUBLE)
+0 0 0 0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'x'
+Warning 1292 Truncated incorrect INTEGER value: 'x'
+Warning 1292 Truncated incorrect DECIMAL value: 'x'
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+SELECT
+CAST(' x' AS SIGNED),
+CAST(' x' AS UNSIGNED),
+CAST(' x' AS DECIMAL),
+CAST(' x' AS DOUBLE);
+CAST(' x' AS SIGNED) CAST(' x' AS UNSIGNED) CAST(' x' AS DECIMAL) CAST(' x' AS DOUBLE)
+0 0 0 0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ' x'
+Warning 1292 Truncated incorrect INTEGER value: ' x'
+Warning 1292 Truncated incorrect DECIMAL value: ' x'
+Warning 1292 Truncated incorrect DOUBLE value: ' x'
+SELECT
+CAST('.' AS SIGNED),
+CAST('.' AS UNSIGNED),
+CAST('.' AS DECIMAL),
+CAST('.' AS DOUBLE);
+CAST('.' AS SIGNED) CAST('.' AS UNSIGNED) CAST('.' AS DECIMAL) CAST('.' AS DOUBLE)
+0 0 0 0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '.'
+Warning 1292 Truncated incorrect INTEGER value: '.'
+Warning 1292 Truncated incorrect DECIMAL value: '.'
+Warning 1292 Truncated incorrect DOUBLE value: '.'
+SELECT
+CAST('-' AS SIGNED),
+CAST('-' AS UNSIGNED),
+CAST('-' AS DECIMAL),
+CAST('-' AS DOUBLE);
+CAST('-' AS SIGNED) CAST('-' AS UNSIGNED) CAST('-' AS DECIMAL) CAST('-' AS DOUBLE)
+0 0 0 0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '-'
+Warning 1292 Truncated incorrect INTEGER value: '-'
+Warning 1292 Truncated incorrect DECIMAL value: '-'
+Warning 1292 Truncated incorrect DOUBLE value: '-'
+SELECT
+CAST('+' AS SIGNED),
+CAST('+' AS UNSIGNED),
+CAST('+' AS DECIMAL),
+CAST('+' AS DOUBLE);
+CAST('+' AS SIGNED) CAST('+' AS UNSIGNED) CAST('+' AS DECIMAL) CAST('+' AS DOUBLE)
+0 0 0 0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '+'
+Warning 1292 Truncated incorrect INTEGER value: '+'
+Warning 1292 Truncated incorrect DECIMAL value: '+'
+Warning 1292 Truncated incorrect DOUBLE value: '+'
+SELECT
+CAST('1x' AS SIGNED),
+CAST('1x' AS UNSIGNED),
+CAST('1x' AS DECIMAL),
+CAST('1x' AS DOUBLE);
+CAST('1x' AS SIGNED) CAST('1x' AS UNSIGNED) CAST('1x' AS DECIMAL) CAST('1x' AS DOUBLE)
+1 1 1 1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1x'
+Warning 1292 Truncated incorrect INTEGER value: '1x'
+Warning 1292 Truncated incorrect DECIMAL value: '1x'
+Warning 1292 Truncated incorrect DOUBLE value: '1x'
+SELECT
+CAST('1e' AS SIGNED),
+CAST('1e' AS UNSIGNED),
+CAST('1e' AS DECIMAL),
+CAST('1e' AS DOUBLE);
+CAST('1e' AS SIGNED) CAST('1e' AS UNSIGNED) CAST('1e' AS DECIMAL) CAST('1e' AS DOUBLE)
+1 1 1 1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1e'
+Warning 1292 Truncated incorrect INTEGER value: '1e'
+Warning 1292 Truncated incorrect DECIMAL value: '1e'
+Warning 1292 Truncated incorrect DOUBLE value: '1e'
+SELECT
+CAST('1e-' AS SIGNED),
+CAST('1e-' AS UNSIGNED),
+CAST('1e-' AS DECIMAL),
+CAST('1e-' AS DOUBLE);
+CAST('1e-' AS SIGNED) CAST('1e-' AS UNSIGNED) CAST('1e-' AS DECIMAL) CAST('1e-' AS DOUBLE)
+1 1 1 1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1e-'
+Warning 1292 Truncated incorrect INTEGER value: '1e-'
+Warning 1292 Truncated incorrect DECIMAL value: '1e-'
+Warning 1292 Truncated incorrect DOUBLE value: '1e-'
+SELECT
+CAST('1E+' AS SIGNED),
+CAST('1E+' AS UNSIGNED),
+CAST('1E+' AS DECIMAL),
+CAST('1E+' AS DOUBLE);
+CAST('1E+' AS SIGNED) CAST('1E+' AS UNSIGNED) CAST('1E+' AS DECIMAL) CAST('1E+' AS DOUBLE)
+1 1 1 1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1E+'
+Warning 1292 Truncated incorrect INTEGER value: '1E+'
+Warning 1292 Truncated incorrect DECIMAL value: '1E+'
+Warning 1292 Truncated incorrect DOUBLE value: '1E+'
+#
+# End of 10.0 tests
+#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+#
+SELECT NULL+1 AS c0,
+COALESCE(NULL)+1 AS c2,
+COALESCE(COALESCE(NULL))+1 AS c3,
+''+1 AS c4,
+COALESCE('')+1 AS c5,
+COALESCE(COALESCE(''))+1 AS c6;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c0 5 17 0 Y 32896 0 63
+def c2 5 17 0 Y 32896 0 63
+def c3 5 17 0 Y 32896 0 63
+def c4 5 23 1 N 32897 31 63
+def c5 5 17 1 N 32897 0 63
+def c6 5 17 1 N 32897 0 63
+c0 c2 c3 c4 c5 c6
+NULL NULL NULL 1 1 1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: ''
+#
+# Start of 10.1 tests
+#
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index ad52ab5da7d..101bf0cfb2c 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -15,7 +15,7 @@ ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
-time_stamp timestamp,
+time_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_field date,
time_field time,
date_time datetime,
@@ -129,6 +129,9 @@ Warning 1264 Out of range value for column 'ushort' at row 1
Warning 1264 Out of range value for column 'umedium' at row 1
Warning 1265 Data truncated for column 'options' at row 1
insert into t1 (tiny) values (1);
+Warnings:
+Warning 1364 Field 'mediumblob_col' doesn't have a default value
+Warning 1364 Field 'longblob_col' doesn't have a default value
select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1;
auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col
10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1
@@ -275,15 +278,15 @@ drop table t2;
create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
show full columns from t2;
Field Type Collation Null Key Default Extra Privileges Comment
-auto int(11) unsigned NULL NO PRI 0 #
-t1 int(1) NULL NO 0 #
-t2 varchar(1) latin1_swedish_ci NO #
-t3 varchar(256) latin1_swedish_ci NO #
-t4 varbinary(256) NULL NO #
+auto int(11) unsigned NULL NO PRI NULL #
+t1 int(1) NULL NO NULL #
+t2 varchar(1) latin1_swedish_ci NO NULL #
+t3 varchar(256) latin1_swedish_ci NO NULL #
+t4 varbinary(256) NULL NO NULL #
t5 text latin1_swedish_ci NO NULL #
t6 blob NULL NO NULL #
-t7 char(0) latin1_swedish_ci NO #
-t8 binary(0) NULL NO #
+t7 char(0) latin1_swedish_ci NO NULL #
+t8 binary(0) NULL NO NULL #
select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2;
t1 t2 length(t3) length(t4) length(t5) length(t6) t7 t8
1 a 256 256 4096 4096
@@ -304,7 +307,7 @@ show full columns from t3;
Field Type Collation Null Key Default Extra Privileges Comment
c1 int(11) NULL YES NULL #
c2 int(11) NULL YES NULL #
-const int(1) NULL NO 0 #
+const int(1) NULL NO NULL #
drop table t1,t2,t3;
create table t1 ( myfield INT NOT NULL, UNIQUE INDEX (myfield), unique (myfield), index(myfield));
Warnings:
diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result
index f3b7019c989..586c6345e00 100644
--- a/mysql-test/r/type_set.result
+++ b/mysql-test/r/type_set.result
@@ -263,3 +263,55 @@ DROP TABLE t1;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8729 Wrong result for SELECT..WHERE HEX(enum_column)='61' AND enum_column='a '
+#
+CREATE TABLE t1 (a SET('a','A') CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a ';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+a
+a
+# Can't propagate the equality into HEX(a), because binary collations still ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a ') and (hex(`test`.`t1`.`a`) = '61'))
+DROP TABLE t1;
+CREATE TABLE t1 (a SET('a','a ') CHARACTER SET BINARY);
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE a='a ';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+a
+a
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+a
+# Ok to propagate the equality into HEX(a), because "CHARACTER SET BINARY" does not ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_temporal_innodb.result b/mysql-test/r/type_temporal_innodb.result
new file mode 100644
index 00000000000..425e499a5d3
--- /dev/null
+++ b/mysql-test/r/type_temporal_innodb.result
@@ -0,0 +1,156 @@
+#
+# MDEV-9604 crash in Item::save_in_field with empty enum value
+#
+SELECT TIME'00:00:00'='';
+TIME'00:00:00'=''
+1
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+CREATE TABLE t1 (a ENUM('a'), b TIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','00:00:00',0);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT * FROM t1 WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+DROP TABLE t1;
+SELECT DATE'0000-00-00'='';
+DATE'0000-00-00'=''
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+CREATE TABLE t1 (a ENUM('a'), b DATE, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00',0);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+DROP TABLE t1;
+SELECT TIMESTAMP'0000-00-00 00:00:00'='';
+TIMESTAMP'0000-00-00 00:00:00'=''
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+CREATE TABLE t1 (a ENUM('a'), b DATETIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00 00:00:00',0);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+DROP TABLE t1;
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index 477703edebb..b5689d31aef 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -393,3 +393,827 @@ SET timestamp=DEFAULT;
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+#
+# Trailing garbage in string literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+00:00:00
+00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00x';
+a
+00:00:00
+Warnings:
+Warning 1292 Truncated incorrect time value: '00:00:00x'
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Truncated incorrect time value: '00:00:00x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Truncated incorrect time value: '00:00:00x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIME'00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+# Trailing fractional digits in string literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+00:00:00
+00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00.000000';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIME'00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+# Trailing fractional digits in temporal literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+00:00:00
+00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00.000000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.000000') and (<cache>(length(TIME'00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+# Trailing fractional digits in temporal literals, same precision
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.000000') and (<cache>(length(TIME'00:00:00.000000')) = (30 + rand())))
+DROP TABLE t1;
+# Leading spaces in string literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+00:00:00
+00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=' 00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=' 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIME'00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+# Numeric format in string literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+00:00:00
+00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='000000';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIME'00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+#
+# MDEV-8766 Wrong result for SELECT..WHERE LENGTH(time_column)=8 AND time_column=TIMESTAMP'2001-01-01 10:20:31'
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+# TIMESTAMP literal with the same scale, ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31';
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31';
+a
+10:20:31
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31') and (<cache>(length(TIME'10:20:31')) = (30 + rand())))
+DROP TABLE t1;
+# TIMESTAMP literal with a bigger scale and fractional second truncation
+# Ok to propagate with precision truncation
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31.123';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.123000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and (<cache>(length(TIME'10:20:31')) = (30 + rand())))
+DROP TABLE t1;
+# TIMESTAMP literal with a bigger scale and no fractional second truncation
+# Ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31.000';
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.000';
+a
+10:20:31
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31') and (<cache>(length(TIME'10:20:31')) = (30 + rand())))
+DROP TABLE t1;
+# TIMESTAMP literal with a smaller scale
+# Ok to propagate
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31.123';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and (<cache>(length(TIME'10:20:31.123000')) = (30 + rand())))
+DROP TABLE t1;
+# TIME literal with a bigger scale and fractional second truncation
+# Ok to propagate with precision truncation
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIME'10:20:31.123';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.123')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123') and (<cache>(length(TIME'10:20:31')) = (30 + rand())))
+DROP TABLE t1;
+# TIME literal with a bigger scale and no fractional second truncation
+# Ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIME'10:20:31.000';
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.000';
+a
+10:20:31
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.000') and (<cache>(length(TIME'10:20:31')) = (30 + rand())))
+DROP TABLE t1;
+# TIME literal with a smaller scale
+# Ok to propagate
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIME'10:20:31.123';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123') and (<cache>(length(TIME'10:20:31.123000')) = (30 + rand())))
+DROP TABLE t1;
+# TIME-alike string literal with a bigger scale and fractional second truncation
+# Ok to propagate with precision truncation
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a='10:20:31.123';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.123000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and (<cache>(length(TIME'10:20:31')) = (30 + rand())))
+DROP TABLE t1;
+# TIME-alike string literal with a bigger scale and no fractional second truncation
+# Ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a='10:20:31.000';
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+10:20:31
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.000';
+a
+10:20:31
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31') and (<cache>(length(TIME'10:20:31')) = (30 + rand())))
+DROP TABLE t1;
+# TIME-alike string literal with a smaller scale
+# Ok to propagate
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a='10:20:31.123';
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+a
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+a
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.123';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and (<cache>(length(TIME'10:20:31.123000')) = (30 + rand())))
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+SET @@old_mode=zero_date_time_cast;
+# TIMESTAMP literal, old mode
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('0000-00-00 10:20:30'),('0000-00-00 10:20:31');
+INSERT INTO t1 VALUES ('0000-00-01 10:20:30'),('0000-00-01 10:20:31');
+INSERT INTO t1 VALUES ('31 10:20:30'),('32 10:20:30'),('33 10:20:30'),('34 10:20:30');
+SELECT * FROM t1;
+a
+10:20:30
+10:20:31
+34:20:30
+34:20:31
+754:20:30
+778:20:30
+802:20:30
+826:20:30
+# Old mode, TIMESTAMP literal, zero YYYYMMDD, Ok to propagate
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30';
+a
+10:20:30
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8;
+a
+10:20:30
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:30')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=30+RAND();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:30') and (<cache>(length(TIME'10:20:30')) = (30 + rand())))
+# Old mode, TIMESTAMP literal, zon-zero YYYYMMDD, no propagation
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30';
+a
+34:20:30
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=8;
+a
+34:20:30
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=8;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = 8))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=30+RAND();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = (30 + rand())))
+# Old mode, TIMESTAMP-alike string literal, zero YYYYMMDD, Ok to propagate
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30';
+a
+10:20:30
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8;
+a
+10:20:30
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:30')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=30+RAND();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:30') and (<cache>(length(TIME'10:20:30')) = (30 + rand())))
+# Old mode, TIMESTAMP-alike literal, zon-zero YYYYMMDD, no propagation
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30';
+a
+34:20:30
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
+a
+34:20:30
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = 8))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=30+RAND();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = (30 + rand())))
+DROP TABLE t1;
+SET @@old_mode=DEFAULT;
+#
+# MDEV-8706 Wrong result for SELECT..WHERE time_column=TIMESTAMP'2015-08-30 00:00:00' AND time_column='00:00:00'
+#
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00';
+a
+00:00:00
+SELECT * FROM t1 WHERE a='00:00:00';
+a
+00:00:00
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00' AND a='00:00:00';
+a
+00:00:00
+SELECT * FROM t1 WHERE a>=TIMESTAMP'2015-08-30 00:00:00' AND a='00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a>=TIMESTAMP'2015-08-30 00:00:00' AND a='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+DROP TABLE t1;
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE DATE(a)<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE DATE(a)<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= TIMESTAMP'2015-08-30 00:00:00.1'))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00.1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.100000') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= TIMESTAMP'2015-08-30 00:00:00.1'))
+DROP TABLE t1;
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE DATE(a)<=DATE'2015-08-30' AND a='00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE DATE(a)<=DATE'2015-08-30' AND a='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=DATE'2015-08-30' AND a='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= DATE'2015-08-30'))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=DATE'2015-08-30' AND a='00:00:00.1';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.100000') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= DATE'2015-08-30'))
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+# MDEV-8795 Equal expression propagation does not work for temporal literals
+#
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:01'),('00:00:02');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:01' AND COALESCE(a)>=TIME'00:00:01';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIME'00:00:01')
+DROP TABLE t1;
+#
+# MDEV-8793 Wrong result set for SELECT ... WHERE COALESCE(time_column)=TIME('00:00:00') AND COALESCE(time_column)=DATE('2015-09-11')
+#
+SET timestamp=UNIX_TIMESTAMP('2015-09-11 20:20:20');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES('10:20:30'),('00:00:00');
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00');
+a
+00:00:00
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11');
+a
+00:00:00
+# TIME cast + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-09-11');
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-09-11');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00)
+# TIME cast + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00)
+# TIME literal + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIME'00:00:00')
+# TIME literal + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIME'00:00:00')
+# TIME-alike string literal + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00))
+# TIME-alike string literal + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11'))
+# TIME-alike integer literal + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11');
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00))
+# TIME-alike integer literal + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11'))
+# DATE cast + TIME cast
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:00:00');
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)
+# DATE cast + TIME literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)
+# DATE cast + TIME-alike string literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = '00:00:00'))
+# DATE cast + TIME-alike integer literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = 0))
+# DATE literal + TIME cast
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00');
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11')
+# DATE literal + TIME literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11')
+# DATE literal + TIME-alike string literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)='00:00:00';
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)='00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = DATE'2015-09-11') and (coalesce(`test`.`t1`.`a`) = '00:00:00'))
+# DATE literal + TIME-alike integer literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=0;
+a
+00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = DATE'2015-09-11') and (coalesce(`test`.`t1`.`a`) = 0))
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+#
+# MDEV-8814 Wrong result for WHERE datetime_column > TIME('00:00:00')
+#
+CREATE TABLE t1 (a DATETIME);
+INSERT INTO t1 VALUES ('2000-09-12 00:00:00'), ('2007-04-25 05:08:49');
+SELECT * FROM t1 WHERE a>TIME'00:00:00';
+a
+SELECT * FROM t1 WHERE a>TIME('00:00:00');
+a
+DROP TABLE t1;
+#
+# MDEV-8660 TIME(int_zerofill_column) returns a wrong result
+#
+CREATE TABLE t1 (a BIGINT(15), b BIGINT(15) ZEROFILL);
+INSERT INTO t1 VALUES (9,9);
+SELECT TIME(a),TIME(b) FROM t1;
+TIME(a) TIME(b)
+00:00:09 00:00:09
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES (-9223372036854775808);
+SELECT CAST(a AS TIME), CAST(-9223372036854775808 AS TIME) FROM t1;
+CAST(a AS TIME) CAST(-9223372036854775808 AS TIME)
+-838:59:59 -838:59:59
+Warnings:
+Warning 1292 Incorrect time value: '-9223372036854775808' for column 'a' at row 1
+Warning 1292 Truncated incorrect time value: '-9223372036854775808'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b DECIMAL, c DOUBLE);
+INSERT INTO t1 VALUES (-9000000,-9000000,-9000000);
+INSERT INTO t1 VALUES (-1,-1,-1);
+INSERT INTO t1 VALUES (0,0,0),(1,1,1),(9,9,9);
+INSERT INTO t1 VALUES (9000000,9000000,9000000);
+SELECT a, TIME(a),TIME(b),TIME(c) FROM t1 ORDER BY a;
+a TIME(a) TIME(b) TIME(c)
+-9000000 -838:59:59 -838:59:59 -838:59:59.999999
+-1 -00:00:01 -00:00:01 -00:00:01.000000
+0 00:00:00 00:00:00 00:00:00.000000
+1 00:00:01 00:00:01 00:00:01.000000
+9 00:00:09 00:00:09 00:00:09.000000
+9000000 838:59:59 838:59:59 838:59:59.999999
+Warnings:
+Warning 1292 Incorrect time value: '-9000000' for column 'a' at row 1
+Warning 1292 Incorrect time value: '-9000000' for column 'b' at row 1
+Warning 1292 Incorrect time value: '-9000000' for column 'c' at row 1
+Warning 1292 Incorrect time value: '9000000' for column 'a' at row 6
+Warning 1292 Incorrect time value: '9000000' for column 'b' at row 6
+Warning 1292 Incorrect time value: '9000000' for column 'c' at row 6
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b DECIMAL, c DOUBLE);
+INSERT INTO t1 VALUES (0,0,0),(1,1,1),(9,9,9);
+INSERT INTO t1 VALUES (9000000,9000000,9000000);
+SELECT a, TIME(a),TIME(b),TIME(c) FROM t1 ORDER BY a;
+a TIME(a) TIME(b) TIME(c)
+0 00:00:00 00:00:00 00:00:00.000000
+1 00:00:01 00:00:01 00:00:01.000000
+9 00:00:09 00:00:09 00:00:09.000000
+9000000 838:59:59 838:59:59 838:59:59.999999
+Warnings:
+Warning 1292 Incorrect time value: '9000000' for column 'a' at row 4
+Warning 1292 Incorrect time value: '9000000' for column 'b' at row 4
+Warning 1292 Incorrect time value: '9000000' for column 'c' at row 4
+DROP TABLE t1;
+#
+# MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
+#
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:10:10'),('10:20:30');
+SELECT MAX(a), MAX(COALESCE(a)) FROM t1;
+MAX(a) MAX(COALESCE(a))
+10:20:30 10:20:30
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_time_6065.result b/mysql-test/r/type_time_6065.result
index db3efc3bcbb..a61c658d50e 100644
--- a/mysql-test/r/type_time_6065.result
+++ b/mysql-test/r/type_time_6065.result
@@ -52,7 +52,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 9 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`)
SELECT * FROM
@@ -73,7 +73,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 9 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`)
SELECT * FROM
@@ -136,7 +136,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 9 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`)
SELECT * FROM
@@ -157,7 +157,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 9 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`)
SELECT * FROM
@@ -261,7 +261,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`)
@@ -282,7 +282,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`)
@@ -303,7 +303,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using where; Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`)
@@ -324,7 +324,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using where; Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`)
@@ -717,7 +717,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_time_key >= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`)
@@ -748,7 +748,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_datetime_key >= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`)
@@ -779,7 +779,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_time_key >= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`)
@@ -810,7 +810,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_datetime_key >= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`)
@@ -1153,7 +1153,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_time_key > col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`)
@@ -1179,7 +1179,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_datetime_key > col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`)
@@ -1205,7 +1205,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_time_key > col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`)
@@ -1231,7 +1231,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_datetime_key > col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`)
@@ -1629,7 +1629,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_time_key <= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`)
@@ -1660,7 +1660,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_datetime_key <= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`)
@@ -1691,7 +1691,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_time_key <= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`)
@@ -1722,7 +1722,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_datetime_key <= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`)
@@ -2065,7 +2065,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_time_key < col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`)
@@ -2091,7 +2091,7 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_datetime_key < col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`)
@@ -2117,7 +2117,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_time_key < col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`)
@@ -2143,7 +2143,7 @@ STRAIGHT_JOIN
t1 force INDEX (col_time_key)
WHERE col_datetime_key < col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 9 NULL 5 100.00 Using index
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`)
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 28ec7e75870..69c9f68811d 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -1,6 +1,6 @@
drop table if exists t1,t2;
set time_zone="+03:00";
-CREATE TABLE t1 (a int, t timestamp);
+CREATE TABLE t1 (a int, t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
CREATE TABLE t2 (a int, t datetime);
SET TIMESTAMP=1234;
insert into t1 values(1,NULL);
@@ -27,7 +27,7 @@ a t
9 1970-01-01 03:20:38
drop table t1,t2;
SET TIMESTAMP=1234;
-CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp, PRIMARY KEY (id));
+CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id));
INSERT INTO t1 VALUES ("my value", "myKey","1999-04-02 00:00:00");
SELECT stamp FROM t1 WHERE id="myKey";
stamp
@@ -41,13 +41,13 @@ SELECT stamp FROM t1 WHERE id="myKey";
stamp
1999-04-02 00:00:00
drop table t1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (now());
select date_format(a,"%Y %y"),year(a),year(now()) from t1;
date_format(a,"%Y %y") year(a) year(now())
1970 70 1970 1970
drop table t1;
-create table t1 (ix timestamp);
+create table t1 (ix timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
select ix+0 from t1;
ix+0
@@ -69,7 +69,7 @@ ix+0
19990630232922
19990601000000
drop table t1;
-CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp);
+CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959);
INSERT INTO t1 VALUES ("1999-01-01","1999-01-01 00:00:00",19990101000000);
INSERT INTO t1 VALUES ("1999-09-09","1999-09-09 23:59:59",19990909235959);
@@ -97,7 +97,7 @@ date date_time time_stamp
2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00
2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00
drop table t1;
-create table t1 (ix timestamp);
+create table t1 (ix timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
Warnings:
Warning 1265 Data truncated for column 'ix' at row 2
@@ -157,7 +157,7 @@ create table t1 (t1 timestamp default now(), t2 timestamp on update now());
drop table t1;
create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now());
drop table t1;
-create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
+create table t1 (t1 timestamp not null default '2003-01-01 00:00:00', t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
SET TIMESTAMP=1000000000;
insert into t1 values ();
SET TIMESTAMP=1000000001;
@@ -181,7 +181,7 @@ t1 timestamp NO 2003-01-01 00:00:00
t2 datetime YES NULL
t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
-create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
+create table t1 (t1 timestamp not null default now(), t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
SET TIMESTAMP=1000000002;
insert into t1 values ();
SET TIMESTAMP=1000000003;
@@ -205,7 +205,7 @@ t1 timestamp NO CURRENT_TIMESTAMP
t2 datetime YES NULL
t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
-create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
+create table t1 (t1 timestamp not null default '2003-01-01 00:00:00' on update now(), t2 datetime);
SET TIMESTAMP=1000000004;
insert into t1 values ();
select * from t1;
@@ -230,7 +230,7 @@ Field Type Null Key Default Extra
t1 timestamp NO 2003-01-01 00:00:00 on update CURRENT_TIMESTAMP
t2 datetime YES NULL
drop table t1;
-create table t1 (t1 timestamp default now() on update now(), t2 datetime);
+create table t1 (t1 timestamp not null default now() on update now(), t2 datetime);
SET TIMESTAMP=1000000006;
insert into t1 values ();
select * from t1;
@@ -255,7 +255,7 @@ Field Type Null Key Default Extra
t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
t2 datetime YES NULL
drop table t1;
-create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
+create table t1 (t1 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
SET TIMESTAMP=1000000007;
insert into t1 values ();
select * from t1;
@@ -282,7 +282,7 @@ t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
t2 datetime YES NULL
t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
-create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
+create table t1 (t1 timestamp not null default current_timestamp on update current_timestamp, t2 datetime);
SET TIMESTAMP=1000000009;
insert into t1 values ();
select * from t1;
@@ -318,7 +318,7 @@ select * from t1;
t1 t2
2004-04-03 00:00:00 2004-04-01 00:00:00
drop table t1;
-create table t1 (pk int primary key, t1 timestamp default current_timestamp on update current_timestamp, bulk int);
+create table t1 (pk int primary key, t1 timestamp not null default current_timestamp on update current_timestamp, bulk int);
insert into t1 values (1, '2004-04-01 00:00:00', 10);
SET TIMESTAMP=1000000013;
replace into t1 set pk = 1, bulk= 20;
@@ -326,7 +326,7 @@ select * from t1;
pk t1 bulk
1 2001-09-09 04:46:53 20
drop table t1;
-create table t1 (pk int primary key, t1 timestamp default '2003-01-01 00:00:00' on update current_timestamp, bulk int);
+create table t1 (pk int primary key, t1 timestamp not null default '2003-01-01 00:00:00' on update current_timestamp, bulk int);
insert into t1 values (1, '2004-04-01 00:00:00', 10);
SET TIMESTAMP=1000000014;
replace into t1 set pk = 1, bulk= 20;
@@ -334,7 +334,7 @@ select * from t1;
pk t1 bulk
1 2003-01-01 00:00:00 20
drop table t1;
-create table t1 (pk int primary key, t1 timestamp default current_timestamp, bulk int);
+create table t1 (pk int primary key, t1 timestamp not null default current_timestamp on update current_timestamp, bulk int);
insert into t1 values (1, '2004-04-01 00:00:00', 10);
SET TIMESTAMP=1000000015;
replace into t1 set pk = 1, bulk= 20;
@@ -342,7 +342,7 @@ select * from t1;
pk t1 bulk
1 2001-09-09 04:46:55 20
drop table t1;
-create table t1 (t1 timestamp default current_timestamp on update current_timestamp);
+create table t1 (t1 timestamp not null default current_timestamp on update current_timestamp);
insert into t1 values ('2004-04-01 00:00:00');
SET TIMESTAMP=1000000016;
alter table t1 add i int default 10;
@@ -397,13 +397,13 @@ drop table t1;
create table t1 (a bigint, b bigint);
insert into t1 values (NULL, NULL), (20030101000000, 20030102000000);
set timestamp=1000000019;
-alter table t1 modify a timestamp, modify b timestamp;
+alter table t1 modify a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modify b timestamp NOT NULL DEFAULT '0000-00-00 00:00:0';
select * from t1;
a b
2001-09-09 04:46:59 2001-09-09 04:46:59
2003-01-01 00:00:00 2003-01-02 00:00:00
drop table t1;
-create table t1 (a char(2), t timestamp);
+create table t1 (a char(2), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00'),
('b', '2004-02-01 00:00:00');
select max(t) from t1 group by a;
@@ -421,7 +421,7 @@ t1 CREATE TABLE "t1" (
)
set sql_mode='';
drop table t1;
-create table t1 (a int auto_increment primary key, b int, c timestamp);
+create table t1 (a int auto_increment primary key, b int, c timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 (a, b, c) values (1, 0, '2001-01-01 01:01:01'),
(2, 0, '2002-02-02 02:02:02'), (3, 0, '2003-03-03 03:03:03');
select * from t1;
@@ -486,8 +486,8 @@ is_nullable
NO
drop table t1;
CREATE TABLE t1 ( f1 INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
-f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-f3 TIMESTAMP);
+f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+f3 TIMESTAMP NOT NULL default '0000-00-00 00:00:00');
INSERT INTO t1 (f2,f3) VALUES (NOW(), "0000-00-00 00:00:00");
INSERT INTO t1 (f2,f3) VALUES (NOW(), NULL);
INSERT INTO t1 (f2,f3) VALUES (NOW(), ASCII(NULL));
@@ -507,7 +507,7 @@ End of 5.0 tests
# Bug #55779: select does not work properly in mysql server
# Version "5.1.42 SUSE MySQL RPM"
#
-CREATE TABLE t1 (a TIMESTAMP, KEY (a));
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY (a));
INSERT INTO t1 VALUES ('2000-01-01 00:00:00'), ('2000-01-01 00:00:00'),
('2000-01-01 00:00:01'), ('2000-01-01 00:00:01');
SELECT a FROM t1 WHERE a >= 20000101000000;
@@ -604,7 +604,7 @@ Warning 1292 Incorrect datetime value: 'abc'
Bug#50888 valgrind warnings in Field_timestamp::val_str
SET TIMESTAMP=0;
-CREATE TABLE t1(a timestamp);
+CREATE TABLE t1(a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES ('2008-02-23 09:23:45'), ('2010-03-05 11:08:02');
FLUSH TABLES t1;
SELECT MAX(a) FROM t1;
@@ -741,3 +741,212 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
End of 10.0 tests
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-7831 Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND)
+#
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
+SELECT DATE_ADD(a, INTERVAL 10 SECOND) FROM t1;
+DATE_ADD(a, INTERVAL 10 SECOND)
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
+DROP TABLE t1;
+#
+# MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+SET sql_mode=TRADITIONAL;
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
+ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'a' at row 1
+INSERT INTO t1 VALUES ();
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'a'
+INSERT INTO t1 VALUES (DEFAULT);
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'a'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', b TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+CREATE TABLE t2 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+INSERT INTO t2 VALUES ('0000-00-00 00:00:00');
+SET sql_mode=TRADITIONAL;
+INSERT INTO t1 (a) SELECT a FROM t2;
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'b'
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00', b TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+INSERT INTO t1 VALUES (DEFAULT,DEFAULT);;
+SELECT a INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1;
+DELETE FROM t1;
+SET sql_mode=TRADITIONAL;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/mdev-7824.txt' INTO TABLE t1 (a);
+ERROR 22007: Incorrect default value '0000-00-00 00:00:00' for column 'b'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00');;
+SET sql_mode='NO_ZERO_DATE';
+ALTER TABLE t1 ADD b INT NOT NULL;
+ERROR 42000: Invalid default value for 'a'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
+# End of MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+#
+#
+# MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP);;
+INSERT INTO t1 VALUES (0);
+SET sql_mode='TRADITIONAL';
+CREATE TABLE t2 AS SELECT * FROM t1;
+ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'a' at row 1
+DROP TABLE t1;
+#
+# End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+#
+#
+# MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+#
+CREATE TABLE t1 (a TIMESTAMP);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a='2001-01-01 00:00:00x';
+a
+2001-01-01 00:00:00
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+SELECT * FROM t1 WHERE LENGTH(a) != 20;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+a
+2001-01-01 00:00:00
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+a
+2001-01-01 00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Warning 1292 Incorrect datetime value: ' garbage '
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and (<cache>(length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (30 + rand())))
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP(6));;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00.000000
+SELECT * FROM t1 WHERE LENGTH(a)=26;
+a
+2001-01-01 00:00:00.000000
+2001-01-01 00:00:01.000000
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+a
+2001-01-01 00:00:00.000000
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00.000000')) = (40 + rand())))
+DROP TABLE t1;
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+CREATE TABLE t1 (a TIMESTAMP);;
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIME'00:00:00';
+a
+2001-01-01 00:00:00
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+a
+2001-01-01 00:00:00
+2001-01-01 00:00:01
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+a
+2001-01-01 00:00:00
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_timestamp_hires.result b/mysql-test/r/type_timestamp_hires.result
index 6ebf83a09f0..573ebbeb709 100644
--- a/mysql-test/r/type_timestamp_hires.result
+++ b/mysql-test/r/type_timestamp_hires.result
@@ -50,7 +50,7 @@ a
2010-12-11 03:04:05.789
2010-12-11 15:47:11.123
drop table t1;
-create table t1 (a timestamp(4)) engine=innodb;
+create table t1 (a timestamp(4)NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4)) engine=innodb;
insert t1 values ('2010-12-11 01:02:03.456789');
select * from t1;
a
@@ -131,9 +131,9 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4),
- `a+0` decimal(25,4) NOT NULL DEFAULT '0.0000',
- `a-1` decimal(25,4) NOT NULL DEFAULT '0.0000',
- `a*1` decimal(25,4) NOT NULL DEFAULT '0.0000',
+ `a+0` decimal(25,4) NOT NULL,
+ `a-1` decimal(25,4) NOT NULL,
+ `a*1` decimal(25,4) NOT NULL,
`a/2` decimal(28,8) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create table t3;
@@ -216,7 +216,7 @@ decimal5_f4_timestamp 2010-11-12 11:14:17.7654
bigint_f5_timestamp 2010-11-12 11:14:17.00000
varchar_f6_timestamp 2010-11-12 11:14:17.765432
drop table t1, t2;
-create table t1 (a timestamp(6), b timestamp(6));
+create table t1 (a timestamp(6)NOT NULL DEFAULT '0000-00-00 00:00:00.000000', b timestamp(6)NOT NULL DEFAULT '0000-00-00 00:00:00.000000');
create procedure foo(x timestamp, y timestamp(4)) insert into t1 values (x, y);
call foo('2010-02-03 4:5:6.789123', '2010-02-03 4:5:6.789123');
select * from t1;
@@ -266,7 +266,7 @@ drop table t1, t2;
SET timestamp=DEFAULT;
set time_zone='+03:00';
set timestamp=unix_timestamp('2011-01-01 01:01:01') + 0.123456;
-create table t1 (a timestamp(5));
+create table t1 (a timestamp(5) DEFAULT CURRENT_TIMESTAMP);
insert t1 values ();
select * from t1;
a
diff --git a/mysql-test/r/type_varchar.result b/mysql-test/r/type_varchar.result
index 60227def751..882b7f55102 100644
--- a/mysql-test/r/type_varchar.result
+++ b/mysql-test/r/type_varchar.result
@@ -499,6 +499,7 @@ SELECT 5 = a FROM t1;
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 's'
+Warning 1292 Truncated incorrect DOUBLE value: ''
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(16));
INSERT INTO t1 VALUES ('5'), ('s'), ('');
@@ -509,6 +510,7 @@ SELECT 5 = a FROM t1;
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 's '
+Warning 1292 Truncated incorrect DOUBLE value: ' '
DROP TABLE t1;
#
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
@@ -618,5 +620,65 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 22 NULL 2 Using where; Using index
DROP TABLE IF EXISTS t1,t2;
#
+# MDEV-6989 BINARY and COLLATE xxx_bin comparisions are not used for optimization in some cases
+#
+CREATE TABLE t1 (c1 VARCHAR(20) CHARACTER SET latin1, PRIMARY KEY(c1));
+INSERT INTO t1 VALUES ('a'),('b'),('c'),('d');
+SELECT * FROM t1 WHERE c1=BINARY 'a';
+c1
+a
+EXPLAIN SELECT * FROM t1 WHERE c1=BINARY 'a';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 22 const 1 Using index
+SELECT * FROM t1 WHERE c1=_latin1'a' COLLATE latin1_bin;
+c1
+a
+EXPLAIN SELECT * FROM t1 WHERE c1=_latin1'a' COLLATE latin1_bin;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 22 const 1 Using index
+DROP TABLE t1;
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a');
+CREATE TABLE t2 (c1 VARCHAR(10) CHARACTER SET latin1, PRIMARY KEY(c1));
+INSERT INTO t2 VALUES ('a'),('b');
+SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+c1 c1
+a a
+EXPLAIN SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+1 SIMPLE t2 const PRIMARY PRIMARY 12 const 1 Using index
+ALTER TABLE t1 MODIFY c1 VARBINARY(10);
+SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+c1 c1
+a a
+EXPLAIN SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+1 SIMPLE t2 const PRIMARY PRIMARY 12 const 1 Using index
+DROP TABLE t1, t2;
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('c');
+CREATE TABLE t2 (c1 VARCHAR(10) CHARACTER SET latin1, PRIMARY KEY(c1));
+INSERT INTO t2 VALUES ('a'),('b');
+SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+c1
+a
+c
+# t2 should be eliminated
+EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+ALTER TABLE t1 MODIFY c1 VARBINARY(10);
+SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+c1
+a
+c
+# t2 should be eliminated
+EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+DROP TABLE t1,t2;
+#
# End of 10.0 tests
#
diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result
index 38bddd42cfa..204cec2cc66 100644
--- a/mysql-test/r/type_year.result
+++ b/mysql-test/r/type_year.result
@@ -387,6 +387,7 @@ a
00
select a from t1 where a=(select 2000 from dual where 1);
a
+00
select a from t1 where a=y2k();
a
00
@@ -394,3 +395,47 @@ select a from t1 where a=b;
a
drop table t1;
drop function y2k;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+#
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2020);
+SELECT * FROM t1 WHERE a=2010 AND a>=2010;
+a
+2010
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=2010;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010)
+SELECT * FROM t1 WHERE a=2010 AND a>=10;
+a
+2010
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010)
+SELECT * FROM t1 WHERE a=10 AND a>=2010;
+a
+2010
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=2010;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010)
+SELECT * FROM t1 WHERE a=10 AND a>=10;
+a
+2010
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010)
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 83d889b7b73..62b5e2841fb 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -89,6 +89,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
Warnings:
Note 1003 (select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` limit 2) union all (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`a` limit 1) order by `b` desc
+select count(*) from (
+(select a,b from t1 limit 2) union all (select a,b from t2 order by a)) q;
+count(*)
+6
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
a b
1 a
@@ -96,6 +100,10 @@ a b
select found_rows();
found_rows()
6
+select count(*) from (
+select a,b from t1 union all select a,b from t2) q;
+count(*)
+8
select sql_calc_found_rows a,b from t1 union all select a,b from t2 limit 2;
a b
1 a
@@ -107,7 +115,6 @@ explain select a,b from t1 union all select a,b from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 UNION t2 ALL NULL NULL NULL NULL 4
-NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
explain select xx from t1 union select 1;
ERROR 42S22: Unknown column 'xx' in 'field list'
explain select a,b from t1 union select 1;
@@ -309,12 +316,20 @@ create table t1 (a int);
insert into t1 values (1),(2),(3);
create table t2 (a int);
insert into t2 values (3),(4),(5);
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1) UNION all (SELECT * FROM t2)) q;
+COUNT(*)
+6
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1;
a
1
select found_rows();
found_rows()
6
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2)) q;
+COUNT(*)
+4
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2;
a
1
@@ -322,6 +337,10 @@ a
select found_rows();
found_rows()
4
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2)) q;
+COUNT(*)
+4
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2);
a
1
@@ -331,6 +350,10 @@ a
select found_rows();
found_rows()
4
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1)) q;
+COUNT(*)
+4
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1);
a
1
@@ -341,14 +364,23 @@ select found_rows();
found_rows()
4
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
-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 '' at line 1
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
a
1
-3
select found_rows();
found_rows()
-6
+4
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q;
+COUNT(*)
+4
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
+a
+1
+select found_rows();
+found_rows()
+4
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
+ERROR HY000: Incorrect usage of UNION and LIMIT
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2;
a
1
@@ -356,13 +388,29 @@ a
select found_rows();
found_rows()
6
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION SELECT * FROM t2) q;
+COUNT(*)
+5
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2;
a
1
2
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION all SELECT * FROM t2) q;
+COUNT(*)
+4
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all SELECT * FROM t2 LIMIT 2;
+a
+1
+3
select found_rows();
found_rows()
-5
+4
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION all SELECT * FROM t2) q;
+COUNT(*)
+6
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 100;
a
1
@@ -374,31 +422,40 @@ select found_rows();
found_rows()
5
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 100) UNION SELECT * FROM t2) q;
+COUNT(*)
+5
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100) UNION SELECT * FROM t2;
a
1
2
3
4
5
-select found_rows();
-found_rows()
-5
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q;
+COUNT(*)
+4
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2;
a
1
3
4
5
-select found_rows();
-found_rows()
-6
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q;
+COUNT(*)
+4
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 2;
a
1
3
-select found_rows();
-found_rows()
-6
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2;
a
3
@@ -406,14 +463,21 @@ a
select found_rows();
found_rows()
5
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION SELECT * FROM t2) q;
+COUNT(*)
+5
SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2;
+ERROR HY000: Incorrect usage of UNION and LIMIT
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 limit 2,2) UNION SELECT * FROM t2) q;
+COUNT(*)
+3
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2) UNION SELECT * FROM t2;
a
3
4
5
-select found_rows();
-found_rows()
-5
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
a
5
@@ -430,7 +494,7 @@ drop temporary table t1;
create table t1 select a from t1 union select a from t2;
ERROR 42S01: Table 't1' already exists
select a from t1 union select a from t2 order by t2.a;
-ERROR 42S22: Unknown column 't2.a' in 'order clause'
+ERROR 42000: Table 't2' from one of the SELECTs cannot be used in field list
drop table t1,t2;
select length(version()) > 1 as `*` UNION select 2;
*
@@ -1199,32 +1263,32 @@ foo
bar
drop table t1;
CREATE TABLE t1 (
-a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
+a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
b ENUM("one", "two") character set utf8,
c ENUM("one", "two")
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` enum('ä','ö','ü') CHARACTER SET utf8 NOT NULL DEFAULT 'ü',
+ `a` enum('ä','ö','ü') CHARACTER SET utf8 NOT NULL DEFAULT 'ü',
`b` enum('one','two') CHARACTER SET utf8 DEFAULT NULL,
`c` enum('one','two') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
+insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
create table t2 select NULL union select a from t1;
show columns from t2;
Field Type Null Key Default Extra
-NULL enum('ä','ö','ü') YES NULL
+NULL enum('ä','ö','ü') YES NULL
drop table t2;
create table t2 select a from t1 union select NULL;
show columns from t2;
Field Type Null Key Default Extra
-a enum('ä','ö','ü') YES NULL
+a enum('ä','ö','ü') YES NULL
drop table t2;
create table t2 select a from t1 union select a from t1;
show columns from t2;
Field Type Null Key Default Extra
-a varchar(1) NO
+a varchar(2) NO
drop table t2;
create table t2 select a from t1 union select c from t1;
drop table t2;
@@ -1306,7 +1370,7 @@ t3 CREATE TABLE `t3` (
drop tables t1,t2,t3;
SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
-1048576
+4194304
SET @@global.max_allowed_packet=25000000;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '25000000'
@@ -1367,7 +1431,7 @@ id
5
99
drop table t1;
-create table t1(f1 char(1), f2 char(5), f3 binary(1), f4 binary(5), f5 timestamp, f6 varchar(1) character set utf8 collate utf8_general_ci, f7 text);
+create table t1(f1 char(1), f2 char(5), f3 binary(1), f4 binary(5), f5 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', f6 varchar(1) character set utf8 collate utf8_general_ci, f7 text);
create table t2 as select *, f6 as f8 from t1 union select *, f7 from t1;
show create table t2;
Table Create Table
@@ -1612,11 +1676,18 @@ a
EXPLAIN EXTENDED
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
+2 UNION t1 ALL NULL NULL NULL NULL 2 100.00
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (match `a` against ('+abc' in boolean mode))
# Should not crash
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+a
+1
+2
# Should not crash
(SELECT * FROM t1) UNION (SELECT * FROM t1)
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
@@ -1634,7 +1705,7 @@ NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #-1
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (select `a` from `test`.`t2` where (`test`.`t2`.`b` = 12))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by <expr_cache><`a`>((select `a` from `test`.`t2` where (`test`.`t2`.`b` = 12)))
# Should not crash
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY (SELECT a FROM t2 WHERE b = 12);
@@ -1655,6 +1726,8 @@ a
4
5
6
+7
+8
(select a from t1 where false) UNION (select a from t1) limit 8;
a
10
@@ -2033,3 +2106,104 @@ UNION
(SELECT 2, 2);
ERROR 42S02: Table 'test.v1' doesn't exist
End of 5.5 tests
+#
+# WL#1763 Avoid creating temporary table in UNION ALL
+#
+EXPLAIN SELECT 1 UNION ALL SELECT 1 LIMIT 1 OFFSET 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+# Bug #17579498 CHANGES IN DATATYPE OF THE RESULT QUERY IN UNION.
+CREATE TABLE t1 (a TIME);
+CREATE TABLE t2 (b DATETIME);
+CREATE TABLE t3
+SELECT a FROM t1 UNION ALL SELECT b FROM t2;
+SELECT column_name, column_type
+FROM information_schema.columns
+WHERE TABLE_NAME='t3';
+column_name column_type
+a datetime
+DROP TABLE t1, t2, t3;
+# Bug #17602922 RESULT DIFFERENCES IN UNION QUERIES WITH IN
+# (SUBQUERY-UNION ALL)
+CREATE TABLE t1 (a VARCHAR(1));
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('j');
+INSERT INTO t1 VALUES ('k');
+INSERT INTO t1 VALUES ('r');
+INSERT INTO t1 VALUES ('r');
+INSERT INTO t1 VALUES ('h');
+SELECT a FROM t1 WHERE a IN (SELECT 'r' FROM t1 UNION ALL SELECT 'j');
+a
+j
+r
+r
+CREATE TABLE t2
+SELECT a FROM t1 WHERE a IN (SELECT 'r' FROM t1 UNION ALL SELECT 'j');
+SELECT * FROM t2;
+a
+j
+r
+r
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1);
+SELECT a, SUM(a) FROM t2 UNION ALL SELECT a, MIN(a) FROM t1 ;
+a SUM(a)
+1 1
+NULL NULL
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+2
+DROP TABLE t1, t2;
+# Bug #17669551 CRASH/ASSERT AT SELECT_CREATE::PREPARE2 AT
+# SQL_INSERT.CC
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 SELECT a, a FROM t1 UNION ALL SELECT a, a FROM t1;
+ERROR 42S21: Duplicate column name 'a'
+DROP TABLE t1;
+# Bug #17694956 RESULT DIFFERENCES IN UNION ALL QUERIES WITH LIMIT
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+(SELECT a FROM t1 ORDER BY a LIMIT 0) UNION ALL SELECT a FROM t1;
+a
+1
+DROP TABLE t1;
+# Bug #17708480 FOUND_ROWS() VALUE DO NOT MATCH WITH UNION ALL QUERIES
+CREATE TABLE t1 (a INT) ENGINE=MEMORY;
+CREATE TABLE t2 (a INT) ENGINE=MEMORY;
+INSERT INTO t2 VALUES (1);
+SELECT COUNT(*) FROM (
+SELECT * FROM t2 UNION ALL SELECT * FROM t1) q;
+COUNT(*)
+1
+SELECT SQL_CALC_FOUND_ROWS * FROM t2 UNION ALL SELECT * FROM t1;
+a
+1
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+1
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION ALL SELECT * FROM t2) q;
+COUNT(*)
+1
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION ALL SELECT * FROM t2;
+a
+1
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+1
+DROP TABLE t1, t2;
+# End of WL1763 tests
+#
+# Bug mdev-6874: crash with UNION ALL in a subquery
+#
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 VALUES (1,1), (2,8);
+SELECT * FROM t1 t1_1 LEFT JOIN t1 t1_2 ON ( t1_2.b = t1_1.a )
+WHERE t1_2.b NOT IN ( SELECT 4 UNION ALL SELECT 5 );
+a b a b
+1 1 1 1
+DROP TABLE t1;
diff --git a/mysql-test/r/update_innodb.result b/mysql-test/r/update_innodb.result
index 6dae6abebb1..0a85c6dab3e 100644
--- a/mysql-test/r/update_innodb.result
+++ b/mysql-test/r/update_innodb.result
@@ -39,3 +39,29 @@ DELETE FROM v1 WHERE a IN ( SELECT a FROM t2 );
DELETE FROM v1 WHERE (a,a) IN ( SELECT a,a FROM t2 );
drop view v1;
drop table t1,t2;
+#
+# MDEV-10232 Scalar result of subquery changes after adding an outer select stmt
+#
+CREATE TABLE t1 (
+a_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+b_id INT(20) UNSIGNED NULL DEFAULT NULL,
+c_id VARCHAR(255) NULL DEFAULT NULL,
+PRIMARY KEY (a_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB;
+CREATE TABLE t2 (
+b_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+c_id VARCHAR(255) NULL DEFAULT NULL,
+PRIMARY KEY (b_id),
+INDEX idx_c_id (c_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB;
+INSERT INTO t1 (b_id, c_id) VALUES (NULL, NULL);
+INSERT INTO t2 (c_id) VALUES (NULL);
+INSERT INTO t2 (c_id) VALUES (NULL);
+SELECT * FROM t1;
+a_id b_id c_id
+1 NULL NULL
+SELECT t2.b_id FROM t1,t2 WHERE t2.c_id = t1.c_id;
+b_id
+UPDATE t1 SET b_id = (SELECT t2.b_id FROM t2 t2 WHERE t2.c_id = t1.c_id);
+SELECT * FROM t1;
+a_id b_id c_id
+1 NULL NULL
+drop table t1,t2;
diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result
index b6e924c71cc..74b888e49c5 100644
--- a/mysql-test/r/upgrade.result
+++ b/mysql-test/r/upgrade.result
@@ -67,7 +67,7 @@ drop table `txu@0023p@0023p1`;
# check the table created using mysql 4.0
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+test.t1 check error Upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
# query the table created using mysql 4.0
SELECT * FROM t1;
c1 c2 c3
diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result
index 688704f528a..5ab98d1fc30 100644
--- a/mysql-test/r/user_limits.result
+++ b/mysql-test/r/user_limits.result
@@ -6,6 +6,7 @@ delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
flush user_resources;
select * from t1;
@@ -17,6 +18,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_queries_per_hour' resource
select * from t1;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_queries_per_hour' resource (current value: 2)
drop user mysqltest_1@localhost;
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
flush user_resources;
select * from t1;
@@ -36,6 +38,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_updates_per_hour' resource
select * from t1;
i
drop user mysqltest_1@localhost;
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
flush user_resources;
select * from t1;
@@ -50,6 +53,7 @@ connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections_per_hour' resource (current value: 2)
drop user mysqltest_1@localhost;
flush privileges;
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
flush user_resources;
select * from t1;
@@ -86,6 +90,7 @@ set global max_user_connections= 2;
select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
2 2
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
flush user_resources;
select @@session.max_user_connections, @@global.max_user_connections;
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index e6e9ddf9545..2e1eb15cad4 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -30,7 +30,7 @@ use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 178f9fb7db4..ec19f922b05 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -1,4 +1,3 @@
-drop table if exists t1,t2;
set @a := foo;
ERROR 42S22: Unknown column 'foo' in 'field list'
set @a := connection_id() + 3;
@@ -126,14 +125,14 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
set @a=0;
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a @a:="hello" @a @a:=3 @a @a:="hello again"
-0 hello 0 3 3 hello again
-0 hello 0 3 3 hello again
-0 hello 0 3 3 hello again
+0 hello 0 3 0 hello again
+0 hello 0 3 0 hello again
+0 hello 0 3 0 hello again
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a @a:="hello" @a @a:=3 @a @a:="hello again"
-hello again hello hello 3 3 hello again
-hello again hello hello 3 3 hello again
-hello again hello hello 3 3 hello again
+hello again hello hello again 3 hello again hello again
+hello again hello hello again 3 hello again hello again
+hello again hello hello again 3 hello again hello again
drop table t1;
set @a=_latin2'test';
select charset(@a),collation(@a),coercibility(@a);
@@ -570,3 +569,6 @@ End of 5.5 tests
#
set @var= repeat('a',20000);
1
+explain select @a:=max(seq) from seq_1_to_1000000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
diff --git a/mysql-test/r/userstat.result b/mysql-test/r/userstat.result
new file mode 100644
index 00000000000..66bb4516c85
--- /dev/null
+++ b/mysql-test/r/userstat.result
@@ -0,0 +1,229 @@
+DROP TABLE IF EXISTS t1;
+select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key;
+show columns from information_schema.client_statistics;
+Field Type Null Key Default Extra
+CLIENT varchar(64) NO
+TOTAL_CONNECTIONS bigint(21) NO 0
+CONCURRENT_CONNECTIONS bigint(21) NO 0
+CONNECTED_TIME bigint(21) NO 0
+BUSY_TIME double NO 0
+CPU_TIME double NO 0
+BYTES_RECEIVED bigint(21) NO 0
+BYTES_SENT bigint(21) NO 0
+BINLOG_BYTES_WRITTEN bigint(21) NO 0
+ROWS_READ bigint(21) NO 0
+ROWS_SENT bigint(21) NO 0
+ROWS_DELETED bigint(21) NO 0
+ROWS_INSERTED bigint(21) NO 0
+ROWS_UPDATED bigint(21) NO 0
+SELECT_COMMANDS bigint(21) NO 0
+UPDATE_COMMANDS bigint(21) NO 0
+OTHER_COMMANDS bigint(21) NO 0
+COMMIT_TRANSACTIONS bigint(21) NO 0
+ROLLBACK_TRANSACTIONS bigint(21) NO 0
+DENIED_CONNECTIONS bigint(21) NO 0
+LOST_CONNECTIONS bigint(21) NO 0
+ACCESS_DENIED bigint(21) NO 0
+EMPTY_QUERIES bigint(21) NO 0
+TOTAL_SSL_CONNECTIONS bigint(21) unsigned NO 0
+MAX_STATEMENT_TIME_EXCEEDED bigint(21) NO 0
+show columns from information_schema.user_statistics;
+Field Type Null Key Default Extra
+USER varchar(128) NO
+TOTAL_CONNECTIONS int(11) NO 0
+CONCURRENT_CONNECTIONS int(11) NO 0
+CONNECTED_TIME int(11) NO 0
+BUSY_TIME double NO 0
+CPU_TIME double NO 0
+BYTES_RECEIVED bigint(21) NO 0
+BYTES_SENT bigint(21) NO 0
+BINLOG_BYTES_WRITTEN bigint(21) NO 0
+ROWS_READ bigint(21) NO 0
+ROWS_SENT bigint(21) NO 0
+ROWS_DELETED bigint(21) NO 0
+ROWS_INSERTED bigint(21) NO 0
+ROWS_UPDATED bigint(21) NO 0
+SELECT_COMMANDS bigint(21) NO 0
+UPDATE_COMMANDS bigint(21) NO 0
+OTHER_COMMANDS bigint(21) NO 0
+COMMIT_TRANSACTIONS bigint(21) NO 0
+ROLLBACK_TRANSACTIONS bigint(21) NO 0
+DENIED_CONNECTIONS bigint(21) NO 0
+LOST_CONNECTIONS bigint(21) NO 0
+ACCESS_DENIED bigint(21) NO 0
+EMPTY_QUERIES bigint(21) NO 0
+TOTAL_SSL_CONNECTIONS bigint(21) unsigned NO 0
+MAX_STATEMENT_TIME_EXCEEDED bigint(21) NO 0
+show columns from information_schema.index_statistics;
+Field Type Null Key Default Extra
+TABLE_SCHEMA varchar(192) NO
+TABLE_NAME varchar(192) NO
+INDEX_NAME varchar(192) NO
+ROWS_READ bigint(21) NO 0
+show columns from information_schema.table_statistics;
+Field Type Null Key Default Extra
+TABLE_SCHEMA varchar(192) NO
+TABLE_NAME varchar(192) NO
+ROWS_READ bigint(21) NO 0
+ROWS_CHANGED bigint(21) NO 0
+ROWS_CHANGED_X_INDEXES bigint(21) NO 0
+set @save_general_log=@@global.general_log;
+set @@global.general_log=0;
+set @@global.userstat=1;
+flush status;
+create table t1 (a int, primary key (a), b int default 0) engine=innodb;
+insert into t1 (a) values (1),(2),(3),(4);
+update t1 set b=1;
+update t1 set b=5 where a=2;
+delete from t1 where a=3;
+/* Empty query */
+select * from t1 where a=999;
+a b
+drop table t1;
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
+have_ssl
+1
+create table t1 (a int, primary key (a), b int default 0) engine=innodb;
+begin;
+insert into t1 values(1,1);
+commit;
+begin;
+insert into t1 values(2,2);
+commit;
+begin;
+insert into t1 values(3,3);
+rollback;
+drop table t1;
+select sleep(1);
+sleep(1)
+0
+show status like "rows%";
+Variable_name Value
+Rows_read 6
+Rows_sent 1
+Rows_tmp_read 0
+show status like "ha%";
+Variable_name Value
+Handler_commit 19
+Handler_delete 1
+Handler_discover 0
+Handler_external_lock 0
+Handler_icp_attempts 0
+Handler_icp_match 0
+Handler_mrr_init 0
+Handler_mrr_key_refills 0
+Handler_mrr_rowid_refills 0
+Handler_prepare 18
+Handler_read_first 0
+Handler_read_key 9
+Handler_read_last 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_retry 0
+Handler_read_rnd 0
+Handler_read_rnd_deleted 0
+Handler_read_rnd_next 5
+Handler_rollback 2
+Handler_savepoint 0
+Handler_savepoint_rollback 0
+Handler_tmp_update 0
+Handler_tmp_write 0
+Handler_update 5
+Handler_write 7
+select variable_value - @global_read_key as "handler_read_key" from information_schema.global_status where variable_name="handler_read_key";
+handler_read_key
+9
+set @@global.userstat=0;
+select * from information_schema.index_statistics;
+TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
+select * from information_schema.table_statistics;
+TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
+show table_statistics;
+Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
+show index_statistics;
+Table_schema Table_name Index_name Rows_read
+select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;;
+TOTAL_CONNECTIONS 2
+TOTAL_SSL_CONNECTIONS 1
+CONCURRENT_CONNECTIONS 0
+ROWS_READ 6
+ROWS_SENT 3
+ROWS_DELETED 1
+ROWS_INSERTED 7
+ROWS_UPDATED 5
+SELECT_COMMANDS 4
+UPDATE_COMMANDS 11
+OTHER_COMMANDS 7
+COMMIT_TRANSACTIONS 19
+ROLLBACK_TRANSACTIONS 2
+DENIED_CONNECTIONS 0
+LOST_CONNECTIONS 0
+ACCESS_DENIED 0
+EMPTY_QUERIES 1
+select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;;
+TOTAL_CONNECTIONS 2
+TOTAL_SSL_CONNECTIONS 1
+CONCURRENT_CONNECTIONS 0
+ROWS_READ 6
+ROWS_SENT 3
+ROWS_DELETED 1
+ROWS_INSERTED 7
+ROWS_UPDATED 5
+SELECT_COMMANDS 4
+UPDATE_COMMANDS 11
+OTHER_COMMANDS 7
+COMMIT_TRANSACTIONS 19
+ROLLBACK_TRANSACTIONS 2
+DENIED_CONNECTIONS 0
+LOST_CONNECTIONS 0
+ACCESS_DENIED 0
+EMPTY_QUERIES 1
+flush table_statistics;
+flush index_statistics;
+select * from information_schema.index_statistics;
+TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
+select * from information_schema.table_statistics;
+TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
+show status like "%generic%";
+Variable_name Value
+Com_show_generic 2
+select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
+bytes_sent <> 0, binlog_bytes_written <> 0
+from information_schema.user_statistics;
+connected_time <> 0 busy_time <> 0 bytes_received <> 0 bytes_sent <> 0 binlog_bytes_written <> 0
+1 1 1 1 1
+select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
+bytes_sent <> 0, binlog_bytes_written <> 0
+from information_schema.client_statistics;
+connected_time <> 0 busy_time <> 0 bytes_received <> 0 bytes_sent <> 0 binlog_bytes_written <> 0
+1 1 1 1 1
+create table t1 (a int) engine=innodb;
+select @@in_transaction;
+@@in_transaction
+0
+begin;
+select @@in_transaction;
+@@in_transaction
+1
+insert into t1 values (1);
+select @@in_transaction;
+@@in_transaction
+1
+commit;
+select @@in_transaction;
+@@in_transaction
+0
+set @@autocommit=0;
+select @@in_transaction;
+@@in_transaction
+0
+insert into t1 values (2);
+select @@in_transaction;
+@@in_transaction
+1
+set @@autocommit=1;
+select @@in_transaction;
+@@in_transaction
+0
+drop table t1;
+set @@global.general_log=@save_general_log;
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index 689db16b5d4..58cab5ad1ca 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -91,7 +91,7 @@ length(a) length(b)
255 3
CHECK TABLE t1 FOR UPGRADE;
Table Op Msg_type Msg_text
-test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+test.t1 check error Upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
@@ -175,6 +175,8 @@ b'' 0+b''
select x'', 0+x'';
x'' 0+x''
0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
select 0x;
ERROR 42S22: Unknown column '0x' in 'field list'
select 0b;
diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result
index 75fd2430e4b..f8191345219 100644
--- a/mysql-test/r/variables-notembedded.result
+++ b/mysql-test/r/variables-notembedded.result
@@ -44,19 +44,58 @@ ERROR HY000: Variable 'relay_log' is a read only variable
SET @@global.relay_log= 'x';
ERROR HY000: Variable 'relay_log' is a read only variable
#
+SHOW VARIABLES like 'relay_log_basename';
+Variable_name Value
+relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+SELECT @@session.relay_log_basename;
+ERROR HY000: Variable 'relay_log_basename' is a GLOBAL variable
+SELECT @@global.relay_log_basename;
+@@global.relay_log_basename
+MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+SET @@session.relay_log_basename= 'x';
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+SET @@global.relay_log_basename= 'x';
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+#
+SHOW VARIABLES like 'log_bin_basename';
+Variable_name Value
+log_bin_basename
+SELECT @@session.log_bin_basename;
+ERROR HY000: Variable 'log_bin_basename' is a GLOBAL variable
+SELECT @@global.log_bin_basename;
+@@global.log_bin_basename
+NULL
+SET @@session.log_bin_basename= 'x';
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
+SET @@global.log_bin_basename= 'x';
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
+#
SHOW VARIABLES like 'relay_log_index';
Variable_name Value
-relay_log_index mysqld-relay-bin.index
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
SELECT @@session.relay_log_index;
ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
SELECT @@global.relay_log_index;
@@global.relay_log_index
-mysqld-relay-bin.index
+MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
SET @@session.relay_log_index= 'x';
ERROR HY000: Variable 'relay_log_index' is a read only variable
SET @@global.relay_log_index= 'x';
ERROR HY000: Variable 'relay_log_index' is a read only variable
#
+SHOW VARIABLES like 'log_bin_index';
+Variable_name Value
+log_bin_index
+SELECT @@session.log_bin_index;
+ERROR HY000: Variable 'log_bin_index' is a GLOBAL variable
+SELECT @@global.log_bin_index;
+@@global.log_bin_index
+NULL
+SET @@session.log_bin_index= 'x';
+ERROR HY000: Variable 'log_bin_index' is a read only variable
+SET @@global.log_bin_index= 'x';
+ERROR HY000: Variable 'log_bin_index' is a read only variable
+#
SHOW VARIABLES like 'relay_log_info_file';
Variable_name Value
relay_log_info_file relay-log.info
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index a42c0c5abcb..b621fc13ee4 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -20,7 +20,6 @@ set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
set @my_net_read_timeout =@@global.net_read_timeout;
-set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
set @my_storage_engine =@@global.default_storage_engine;
@@ -318,8 +317,8 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value
-query_alloc_block_size 8192
-query_prealloc_size 8192
+query_alloc_block_size 16384
+query_prealloc_size 24576
range_alloc_block_size 4096
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
@@ -329,8 +328,8 @@ WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1;
VARIABLE_NAME VARIABLE_VALUE
-QUERY_ALLOC_BLOCK_SIZE 8192
-QUERY_PREALLOC_SIZE 8192
+QUERY_ALLOC_BLOCK_SIZE 16384
+QUERY_PREALLOC_SIZE 24576
RANGE_ALLOC_BLOCK_SIZE 4096
TRANSACTION_ALLOC_BLOCK_SIZE 8192
TRANSACTION_PREALLOC_SIZE 4096
@@ -411,8 +410,8 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value
-query_alloc_block_size 8192
-query_prealloc_size 8192
+query_alloc_block_size 16384
+query_prealloc_size 24576
range_alloc_block_size 4096
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
@@ -522,7 +521,6 @@ Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '100'
set max_join_size=100;
set max_sort_length=100;
-set max_tmp_tables=100;
set global max_user_connections=100;
select @@max_user_connections;
@@max_user_connections
@@ -540,9 +538,6 @@ set read_buffer_size=100;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '100'
set read_rnd_buffer_size=100;
-set global rpl_recovery_rank=100;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
set global server_id=100;
set global slow_launch_time=100;
set sort_buffer_size=100;
@@ -1061,9 +1056,6 @@ Warnings:
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout;
-set global rpl_recovery_rank =@my_rpl_recovery_rank;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global default_storage_engine =@my_storage_engine;
@@ -1141,12 +1133,12 @@ ERROR HY000: Variable 'ft_stopword_file' is a read only variable
#
SHOW VARIABLES like 'back_log';
Variable_name Value
-back_log 150
+back_log 80
SELECT @@session.back_log;
ERROR HY000: Variable 'back_log' is a GLOBAL variable
SELECT @@global.back_log;
@@global.back_log
-150
+80
SET @@session.back_log= 7;
ERROR HY000: Variable 'back_log' is a read only variable
SET @@global.back_log= 7;
@@ -1536,7 +1528,7 @@ SET @@global.key_buffer_size=@kbs;
SET @@global.key_cache_block_size=@kcbs;
select @@max_long_data_size;
@@max_long_data_size
-1048576
+4194304
#
# Bug#11766424 59527:
# Assert in DECIMAL_BIN_SIZE:
@@ -1552,7 +1544,7 @@ one
1
explain SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
one
@@ -1563,7 +1555,7 @@ one
set sql_buffer_result=1;
explain SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
one
@@ -1577,7 +1569,7 @@ CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(1) unsigned NOT NULL DEFAULT '0'
+ `a` int(1) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
End of 5.1 tests
@@ -1751,7 +1743,9 @@ SET @@sql_quote_show_create = @sql_quote_show_create_saved;
drop table if exists t1;
drop function if exists t1_max;
drop function if exists t1_min;
+set sql_mode="";
create table t1 (a int) engine=innodb;
+set sql_mode=default;
insert into t1(a) values (0), (1);
create function t1_max() returns int return (select max(a) from t1);
create function t1_min() returns int return (select min(a) from t1);
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 5a51ea85f55..88f40b2cc9d 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -826,6 +826,9 @@ drop table t2;
create table t1 (a int);
insert into t1 values (1), (2);
create view v1 as select 5 from t1 order by 1;
+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 5 AS `5` from `t1` order by 1 latin1 latin1_swedish_ci
select * from v1;
5
5
@@ -1350,8 +1353,11 @@ a b
delete from t1;
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 2
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Warning 1369 CHECK OPTION failed 'test.v1'
+Note 1265 Data truncated for column 'a' at row 3
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 4
Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1 order by a,b;
@@ -2237,12 +2243,12 @@ drop table t1;
create table t1 (
r_object_id char(16) NOT NULL,
group_name varchar(32) NOT NULL
-) engine = InnoDB;
+);
create table t2 (
r_object_id char(16) NOT NULL,
i_position int(11) NOT NULL,
users_names varchar(32) default NULL
-) Engine = InnoDB;
+);
create view v1 as select r_object_id, group_name from t1;
create view v2 as select r_object_id, i_position, users_names from t2;
create unique index r_object_id on t1(r_object_id);
@@ -2902,6 +2908,8 @@ Tables_in_test
t1
DROP TABLE t1;
DROP VIEW IF EXISTS v1;
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
CREATE DATABASE bug21261DB;
USE bug21261DB;
CREATE TABLE t1 (x INT);
@@ -2924,6 +2932,8 @@ DROP VIEW v1;
DROP TABLE t1;
DROP DATABASE bug21261DB;
USE test;
+set GLOBAL sql_mode=default;
+set LOCAL sql_mode=default;
create table t1 (f1 datetime);
create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
show create view v1;
@@ -4428,36 +4438,58 @@ CREATE TABLE t1 (a varchar(10), KEY (a)) ;
INSERT INTO t1 VALUES
('DD'), ('ZZ'), ('ZZ'), ('KK'), ('FF'), ('HH'),('MM');
CREATE VIEW v1 AS SELECT * FROM t1;
+# t1 and v1 should return the same result set
SELECT * FROM v1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
a
KK
MM
ZZ
ZZ
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'VV'
+SELECT * FROM t1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
+a
+KK
+MM
+ZZ
+ZZ
+# t1 and v1 should propagate constants in the same way
EXPLAIN EXTENDED
SELECT * FROM v1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'VV'
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 'JJ')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0)))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0)))
+# t1 and v1 should return the same result set
SELECT * FROM v1 WHERE a > 'JJ' OR a AND a = 'VV';
a
KK
MM
ZZ
ZZ
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'VV'
+SELECT * FROM t1 WHERE a > 'JJ' OR a AND a = 'VV';
+a
+KK
+MM
+ZZ
+ZZ
+# t1 and v1 should propagate constants in the same way
EXPLAIN EXTENDED
SELECT * FROM v1 WHERE a > 'JJ' OR a AND a = 'VV';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'VV'
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 'JJ')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0)))
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a > 'JJ' OR a AND a = 'VV';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0)))
DROP VIEW v1;
DROP TABLE t1;
#
@@ -6035,3 +6067,108 @@ USE test;
# -- End of 10.0 tests.
# -----------------------------------------------------------------
SET optimizer_switch=@save_optimizer_switch;
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8747 Wrong result for SELECT..WHERE derived_table_column='a' AND derived_table_column<>_latin1'A' COLLATE latin1_bin
+#
+CREATE TABLE t1 (a varchar(10) character set cp1251 collate cp1251_ukrainian_ci, KEY (a)) ;
+INSERT INTO t1 VALUES ('DD'), ('ZZ'), ('ZZ'), ('KK'), ('FF'), ('HH'),('MM'),('`1');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a <> 0 AND a = ' 1';
+a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '`1'
+SELECT * FROM v1 WHERE a <> 0 AND a = ' 1';
+a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '`1'
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a='5' AND a<2;
+a
+5
+SELECT * FROM v1 WHERE a='5' AND a<2;
+a
+5
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# MDEV-8749 Wrong result for SELECT..WHERE derived_table_enum_column='number' AND derived_table_enum_column OP number2
+#
+CREATE TABLE t1 (a varchar(10) character set cp1251 collate cp1251_ukrainian_ci, KEY (a));
+INSERT INTO t1 VALUES ('DD'), ('ZZ'), ('ZZ'), ('KK'), ('FF'), ('HH'),('MM'),('`1');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a <> 0 AND a = ' 1';
+a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '`1'
+SELECT * FROM v1 WHERE a <> 0 AND a = ' 1';
+a
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '`1'
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a='5' AND a<2;
+a
+5
+SELECT * FROM v1 WHERE a='5' AND a<2;
+a
+5
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# MDEV-8742 Wrong result for SELECT..WHERE view_latin1_swedish_ci_field='a' COLLATE latin1_bin
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('A');
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE a='a';
+SELECT * FROM v1 WHERE a=_latin1'a' COLLATE latin1_bin;
+a
+a
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant
+# produces invalid definition
+#
+CREATE TABLE t1 ( i INT );
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS
+SELECT 3 AS three, COUNT(*) FROM t1 GROUP BY three;
+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 3 AS `three`,count(0) AS `COUNT(*)` from `t1` group by '' latin1 latin1_swedish_ci
+SELECT * FROM v1;
+three COUNT(*)
+3 2
+drop view v1;
+drop table t1;
+#
+# MDEV-12819: order by ordering expression changed to empty string
+# when creatin view with union
+#
+create table t1 (t1col1 int, t1col2 int,t1col3 int );
+create table t2 (t2col1 int, t2col2 int, t2col3 int);
+create view v1 as
+select t1col1,t1col2,t1col3 from t1
+union all
+select t2col1,t2col2,t2col3 from t2
+order by 2,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 `t1`.`t1col1` AS `t1col1`,`t1`.`t1col2` AS `t1col2`,`t1`.`t1col3` AS `t1col3` from `t1` union all select `t2`.`t2col1` AS `t2col1`,`t2`.`t2col2` AS `t2col2`,`t2`.`t2col3` AS `t2col3` from `t2` order by 2,3 latin1 latin1_swedish_ci
+select * from v1;
+t1col1 t1col2 t1col3
+drop view v1;
+drop table t1,t2;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/view_debug.result b/mysql-test/r/view_debug.result
new file mode 100644
index 00000000000..0aab5c5ac33
--- /dev/null
+++ b/mysql-test/r/view_debug.result
@@ -0,0 +1,20 @@
+#
+#MDEV-8087:Server crashed in Time_and_counter_tracker::incr_loops
+#
+CREATE PROCEDURE proc() SELECT * FROM v2;
+CREATE ALGORITHM = UNDEFINED VIEW v1 AS SELECT 1;
+CREATE ALGORITHM = TEMPTABLE VIEW v2 AS SELECT 3 FROM v1;
+DROP VIEW v1;
+CALL proc();
+ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SET DEBUG_SYNC= 'after_cached_view_opened SIGNAL oppp WAIT_FOR created';
+CALL proc();
+SET DEBUG_SYNC= 'now WAIT_FOR oppp';
+SET DEBUG_SYNC= 'RESET';
+CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT 2;
+SET DEBUG_SYNC= 'now SIGNAL created';
+3
+3
+SET DEBUG_SYNC= 'RESET';
+drop procedure proc;
+drop view v1,v2;
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 8f0ffdda742..525f9fbb5e1 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -1,5 +1,6 @@
drop database if exists mysqltest;
drop view if exists v1,v2,v3;
+create user test@localhost;
grant create view on test.* to test@localhost;
show grants for test@localhost;
Grants for test@localhost
@@ -13,6 +14,7 @@ drop user test@localhost;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
create table mysqltest.t2 (a int, b int);
+create user mysqltest_1@localhost;
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
create definer=root@localhost view v1 as select * from mysqltest.t1;
@@ -46,18 +48,19 @@ c
select d from mysqltest.v1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v1'
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
create algorithm=temptable view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant select (c) on mysqltest.v1 to mysqltest_1@localhost;
select c from mysqltest.v1;
c
select d from mysqltest.v1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v1'
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
@@ -67,6 +70,7 @@ create algorithm=temptable view mysqltest.v2 (c,d) as select a+1,b+1 from mysqlt
create view mysqltest.v3 (c,d) as select a+1,b+1 from mysqltest.t2;
create algorithm=temptable view mysqltest.v4 (c,d) as select a+1,b+1 from mysqltest.t2;
create view mysqltest.v5 (c,d) as select a+1,b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant select on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.v2 to mysqltest_1@localhost;
grant select on mysqltest.v3 to mysqltest_1@localhost;
@@ -91,19 +95,19 @@ Field Type Null Key Default Extra
c bigint(12) YES NULL
d bigint(12) YES NULL
explain select c from mysqltest.v1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v1;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v1'
explain select c from mysqltest.v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v2;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v2'
explain select c from mysqltest.v3;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v3;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v3'
explain select c from mysqltest.v4;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v4;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v4'
explain select c from mysqltest.v5;
@@ -115,7 +119,7 @@ show create view mysqltest.v5;
View Create View character_set_client collation_connection
v5 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v5` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci
explain select c from mysqltest.v1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v1;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v1'
grant show view on mysqltest.v1 to mysqltest_1@localhost;
@@ -128,15 +132,15 @@ show create view mysqltest.v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci
explain select c from mysqltest.v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v2;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v2'
explain select c from mysqltest.v3;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v3;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v3'
explain select c from mysqltest.v4;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v4;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v4'
explain select c from mysqltest.v5;
@@ -156,17 +160,17 @@ show create view mysqltest.v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v2` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci
explain select c from mysqltest.v3;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v3` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci
explain select c from mysqltest.v4;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key(a));
@@ -176,6 +180,7 @@ insert into mysqltest.t2 values (3), (4), (5), (6);
create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant update (a) on mysqltest.v2 to mysqltest_1@localhost;
grant update on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
@@ -222,6 +227,7 @@ update v3 set a=a+c;
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for table 'v3'
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key(a));
@@ -230,6 +236,7 @@ create table mysqltest.t2 (x int);
insert into mysqltest.t2 values (3), (4), (5), (6);
create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
create view mysqltest.v2 (a,c) as select a, b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant delete on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
use mysqltest;
@@ -250,6 +257,7 @@ delete from v2 where c < 4;
ERROR 42000: DELETE command denied to user 'mysqltest_1'@'localhost' for table 'v2'
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key(a));
@@ -258,6 +266,7 @@ create table mysqltest.t2 (x int, y int);
insert into mysqltest.t2 values (3,4);
create view mysqltest.v1 (a,c) as select a, b from mysqltest.t1;
create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
+create user mysqltest_1@localhost;
grant insert on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
use mysqltest;
@@ -280,10 +289,12 @@ insert into v2 select x,y from t2;
ERROR 42000: INSERT command denied to user 'mysqltest_1'@'localhost' for table 'v2'
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
create table mysqltest.t2 (a int, b int);
+create user mysqltest_1@localhost;
grant update on mysqltest.t1 to mysqltest_1@localhost;
grant update(b) on mysqltest.t2 to mysqltest_1@localhost;
grant create view,update on test.* to mysqltest_1@localhost;
@@ -308,18 +319,22 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column
grant update,select(b) on mysqltest.t2 to mysqltest_1@localhost;
create view v4 as select b+1 from mysqltest.t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
drop view v1,v2,v4;
create database mysqltest;
create table mysqltest.t1 (a int);
+create user mysqltest_1@localhost;
grant all privileges on mysqltest.* to mysqltest_1@localhost;
use mysqltest;
create view v1 as select * from t1;
use test;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
+create user mysqltest_1@localhost;
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
create view v1 as select * from mysqltest.t1;
@@ -333,6 +348,7 @@ grant select on mysqltest.t1 to mysqltest_1@localhost;
select * from v1;
a b
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop view v1;
drop database mysqltest;
create database mysqltest;
@@ -348,6 +364,7 @@ create algorithm=MERGE view v2 as select f2() from t1;
create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
create SQL SECURITY INVOKER view v5 as select * from v4;
+create user mysqltest_1@localhost;
grant select on v1 to mysqltest_1@localhost;
grant select on v2 to mysqltest_1@localhost;
grant select on v3 to mysqltest_1@localhost;
@@ -372,6 +389,7 @@ drop function f2;
drop table t1, t2;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
use mysqltest;
@@ -381,6 +399,7 @@ create table t2 (s1 int);
drop function if exists f2;
create function f2 () returns int begin declare v int; select s1 from t2
into v; return v; end//
+create user mysqltest_1@localhost;
grant select on t1 to mysqltest_1@localhost;
grant execute on function f2 to mysqltest_1@localhost;
grant create view on mysqltest.* to mysqltest_1@localhost;
@@ -409,12 +428,14 @@ drop function f2;
drop table t1, t2;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
use mysqltest;
create table t1 (a int);
create table v1 (a int);
insert into t1 values (1);
+create user mysqltest_1@localhost;
grant select on t1 to mysqltest_1@localhost;
grant select on v1 to mysqltest_1@localhost;
grant create view on mysqltest.* to mysqltest_1@localhost;
@@ -442,6 +463,7 @@ ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or fun
drop table t1;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
create database mysqltest;
use mysqltest;
@@ -452,6 +474,7 @@ create algorithm=MERGE view v2 as select *, a as b from t1;
create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
create SQL SECURITY INVOKER view v5 as select * from v4;
+create user mysqltest_1@localhost;
grant select on v1 to mysqltest_1@localhost;
grant select on v2 to mysqltest_1@localhost;
grant select on v3 to mysqltest_1@localhost;
@@ -475,12 +498,14 @@ drop view v1, v2, v3, v4, v5;
drop table t1;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
drop view if exists v1;
drop table if exists t1;
create table t1 as select * from mysql.user where user='';
delete from mysql.user where user='';
flush privileges;
+create user 'test14256'@'%';
grant all on test.* to 'test14256'@'%';
use test;
create view v1 as select 42;
@@ -511,6 +536,7 @@ CREATE VIEW v1 AS SELECT * FROM t1;
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`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+create user mysqltest_1@localhost;
GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
use mysqltest;
LOCK TABLES v1 READ;
@@ -853,6 +879,7 @@ INSERT INTO mysqltest1.t1 VALUES (11), (12), (13), (14);
INSERT INTO mysqltest1.t2 VALUES (21), (22), (23), (24);
INSERT INTO mysqltest1.t3 VALUES (31), (32), (33), (34);
INSERT INTO mysqltest1.t4 VALUES (41), (42), (43), (44);
+CREATE USER mysqltest_u1@localhost;
GRANT SELECT ON mysqltest1.t1 TO mysqltest_u1@localhost;
GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost;
GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost;
@@ -933,6 +960,7 @@ CREATE DATABASE db1;
USE db1;
CREATE TABLE t1(f1 INT, f2 INT);
CREATE VIEW v1 AS SELECT f1, f2 FROM t1;
+CREATE USER foo;
GRANT SELECT (f1) ON t1 TO foo;
GRANT SELECT (f1) ON v1 TO foo;
USE db1;
@@ -1027,7 +1055,7 @@ grant select, show view on mysqltest1.v1 to quintessa@localhost;
select * from v1;
i
explain select * from v1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as cecil
select * from v1;
ERROR 42000: SELECT command denied to user 'cecil'@'localhost' for table 'v1'
@@ -1043,7 +1071,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from v1;
i
explain select * from v1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as fiona
select * from v2;
i j
@@ -1057,14 +1085,14 @@ ERROR 42000: SELECT command denied to user 'fiona'@'localhost' for table 'v1'
explain select * from t2;
ERROR 42000: SELECT command denied to user 'fiona'@'localhost' for table 't2'
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as greg
select * from v2;
i j
explain select * from v1;
ERROR 42000: SELECT command denied to user 'greg'@'localhost' for table 'v1'
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as han
select * from t3;
ERROR 42000: SELECT command denied to user 'han'@'localhost' for table 't3'
@@ -1084,17 +1112,17 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from v2;
i j
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as jamie
select * from v2;
i j
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as karl
select * from v2;
i j
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as lena
select * from v2;
ERROR 42000: SELECT command denied to user 'lena'@'localhost' for table 'v2'
@@ -1111,22 +1139,22 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from v2;
i j
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as olga
select * from v2;
i j
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as pjotr
select * from v2;
i j
explain select * from v2;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as quintessa
select * from v1;
i
explain select * from v1;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
... as root again at last: clean-up time!
drop user alice@localhost;
drop user bob@localhost;
diff --git a/mysql-test/r/warnings_engine_disabled.result b/mysql-test/r/warnings_engine_disabled.result
index 9fcd3b934c0..d9e490ba18f 100644
--- a/mysql-test/r/warnings_engine_disabled.result
+++ b/mysql-test/r/warnings_engine_disabled.result
@@ -1,3 +1,4 @@
+set sql_mode="";
create table t1 (id int) engine=InnoDB;
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
@@ -6,6 +7,7 @@ alter table t1 engine=InnoDB;
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
drop table t1;
+set sql_mode=default;
SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='InnoDB';
ENGINE SUPPORT
InnoDB NO
diff --git a/mysql-test/r/xa_sync.result b/mysql-test/r/xa_sync.result
new file mode 100644
index 00000000000..769a13d1773
--- /dev/null
+++ b/mysql-test/r/xa_sync.result
@@ -0,0 +1,24 @@
+#
+# MDEV-7793 - Race condition between XA COMMIT/ROLLBACK and disconnect
+#
+# Note that this test is meaningful only with valgrind.
+XA START 'xatest';
+XA END 'xatest';
+XA PREPARE 'xatest';
+SET debug_sync='xa_after_search SIGNAL parked WAIT_FOR go';
+XA COMMIT 'xatest';
+SET debug_sync='now WAIT_FOR parked';
+# Waiting for thread to get deleted
+SET debug_sync='now SIGNAL go';
+ERROR XAE04: XAER_NOTA: Unknown XID
+SET debug_sync='RESET';
+XA START 'xatest';
+XA END 'xatest';
+XA PREPARE 'xatest';
+SET debug_sync='xa_after_search SIGNAL parked WAIT_FOR go';
+XA ROLLBACK 'xatest';
+SET debug_sync='now WAIT_FOR parked';
+# Waiting for thread to get deleted
+SET debug_sync='now SIGNAL go';
+ERROR XAE04: XAER_NOTA: Unknown XID
+SET debug_sync='RESET';
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index b12243bdfb9..375b2c62827 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -1161,6 +1161,8 @@ SET NAMES latin1;
SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0)
NULL
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
#
# Bug#12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
#
@@ -1182,6 +1184,8 @@ aa bb
SELECT ExtractValue('<a><b>abc</b><c>2</c><d>1</d></a>','substring(/a/b,..)');
ExtractValue('<a><b>abc</b><c>2</c><d>1</d></a>','substring(/a/b,..)')
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
#
# Bug#62429 XML: ExtractValue, UpdateXML max arg length 127 chars
#
@@ -1241,6 +1245,8 @@ DROP TABLE t1;
SELECT ExtractValue('<a><b>abc</b><c>2</c><d>1</d></a>','substring(/a/b,..)') AS e;
e
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
SELECT ExtractValue('<a><b>abc</b><c>2</c><d>1</d></a>','substring(/a/b,/a/c)') AS e;
e
bc
diff --git a/mysql-test/std_data/Index.xml b/mysql-test/std_data/Index.xml
index 5139db0554a..b66fdfee55c 100644
--- a/mysql-test/std_data/Index.xml
+++ b/mysql-test/std_data/Index.xml
@@ -1117,6 +1117,16 @@
</rules>
</collation>
+ <collation name="utf8_implicit_weights_ci" id="338">
+ <rules>
+ <reset>\u3400</reset><i>b</i>
+ <reset>a</reset><i>\u3561</i>
+ <reset>c</reset><i>\u1500</i>
+ <reset>\u3600</reset><i>\u1501</i>
+ <reset>\u3700</reset><i>\u3701</i>
+ </rules>
+ </collation>
+
</charset>
</charsets>
diff --git a/mysql-test/std_data/bad2_master.info b/mysql-test/std_data/bad2_master.info
new file mode 100644
index 00000000000..61722562748
--- /dev/null
+++ b/mysql-test/std_data/bad2_master.info
@@ -0,0 +1,35 @@
+33
+mysql-bin.000001
+4
+127.0.0.1
+root
+
+3310
+60
+0
+
+
+
+
+
+0
+1800.000
+
+0
+
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+using_gtid=1
+=0
diff --git a/mysql-test/std_data/bad3_master.info b/mysql-test/std_data/bad3_master.info
new file mode 100644
index 00000000000..6e632cd9a49
--- /dev/null
+++ b/mysql-test/std_data/bad3_master.info
@@ -0,0 +1,37 @@
+33
+mysql-bin.000001
+4
+127.0.0.1
+root
+
+3310
+60
+0
+
+
+
+
+
+0
+1800.000
+
+0
+
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+using_gtid=1
+
+
+0
diff --git a/mysql-test/std_data/bad4_master.info b/mysql-test/std_data/bad4_master.info
new file mode 100644
index 00000000000..87572efc8a4
--- /dev/null
+++ b/mysql-test/std_data/bad4_master.info
@@ -0,0 +1,35 @@
+33
+mysql-bin.000001
+4
+127.0.0.1
+root
+
+3310
+60
+0
+
+
+
+
+
+0
+1800.000
+
+0
+
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+using_gtid=1
+d=1
diff --git a/mysql-test/std_data/bad5_master.info b/mysql-test/std_data/bad5_master.info
new file mode 100644
index 00000000000..4ea8113250b
--- /dev/null
+++ b/mysql-test/std_data/bad5_master.info
@@ -0,0 +1,35 @@
+33
+mysql-bin.000001
+4
+127.0.0.1
+root
+
+3310
+60
+0
+
+
+
+
+
+0
+1800.000
+
+0
+
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+using_gtid=1
+using_gtid
diff --git a/mysql-test/std_data/bad6_master.info b/mysql-test/std_data/bad6_master.info
new file mode 100644
index 00000000000..0f48f4871f0
--- /dev/null
+++ b/mysql-test/std_data/bad6_master.info
@@ -0,0 +1,36 @@
+33
+mysql-bin.000001
+4
+127.0.0.1
+root
+
+3310
+60
+0
+
+
+
+
+
+0
+1800.000
+
+0
+
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+using_gtid=1
+END_MARKER
+do_domain_ids=20 Hulubulu!!?!
diff --git a/mysql-test/std_data/bad_master.info b/mysql-test/std_data/bad_master.info
new file mode 100644
index 00000000000..1541fdf2c61
--- /dev/null
+++ b/mysql-test/std_data/bad_master.info
@@ -0,0 +1,35 @@
+33
+mysql-bin.000001
+4
+127.0.0.1
+root
+
+3310
+60
+0
+
+
+
+
+
+0
+1800.000
+
+0
+
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+using_gtid=1
+
diff --git a/mysql-test/std_data/binlog-header.log b/mysql-test/std_data/binlog-header.log
new file mode 100644
index 00000000000..c415a57e616
--- /dev/null
+++ b/mysql-test/std_data/binlog-header.log
Binary files differ
diff --git a/mysql-test/std_data/cacert.pem b/mysql-test/std_data/cacert.pem
index e934823eea3..cc5d9100e30 100644
--- a/mysql-test/std_data/cacert.pem
+++ b/mysql-test/std_data/cacert.pem
@@ -1,78 +1,79 @@
Certificate:
Data:
Version: 3 (0x2)
- Serial Number: 11580370790696127632 (0xa0b5bde0f2c08c90)
- Signature Algorithm: sha1WithRSAEncryption
+ Serial Number:
+ e5:b1:e3:71:e9:6f:a9:e1
+ Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB
Validity
- Not Before: Apr 25 14:55:05 2015 GMT
- Not After : Apr 20 14:55:05 2035 GMT
+ Not Before: Apr 25 20:52:21 2017 GMT
+ Not After : Apr 20 20:52:21 2037 GMT
Subject: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
- 00:c0:1f:90:7c:2b:c2:ea:01:93:ce:e0:c5:72:e8:
- 1c:06:bd:63:4e:b6:d2:c6:00:32:13:27:42:9e:c9:
- 3c:91:33:4d:15:90:67:7d:9d:d8:be:9b:12:e2:f6:
- 1b:46:81:4a:8b:10:c5:b8:14:53:ab:6a:2c:c3:7f:
- 66:87:6c:0e:18:51:4e:9c:93:7a:6d:a1:d4:06:47:
- 58:61:a6:04:21:2c:bd:74:7a:e4:68:45:fe:91:fe:
- fb:a6:29:47:ec:c5:c3:88:c8:c9:e7:d7:c6:1a:0d:
- b8:f5:c5:02:57:25:01:cc:d5:8c:37:46:58:c6:71:
- 30:ee:63:38:99:84:5e:9e:3c:af:40:d4:f0:f2:12:
- 44:6e:2f:4d:cd:f9:da:4d:0e:1f:a6:fe:35:c3:9d:
- 40:08:82:5e:6f:7d:4d:09:16:7d:a1:78:d6:9f:9f:
- 44:d6:b1:ad:e7:50:25:1a:f3:4e:16:92:4a:17:5e:
- 0b:e1:c8:9f:62:22:c4:e2:01:96:63:ed:37:a2:e5:
- 70:b9:dc:c8:8e:c4:fe:00:21:f5:b9:48:c0:43:55:
- 4a:d8:0c:9d:ce:d6:60:30:bb:81:31:c8:e9:0e:aa:
- 1c:18:3d:e4:10:47:42:17:c0:4d:fb:f5:d9:c2:e4:
- 07:33:f7:15:94:63:6d:11:ad:4f:d4:1d:11:41:c1:
- e2:dd
+ 00:a0:ad:d5:b1:ec:45:6f:d6:33:fc:5a:03:29:14:
+ f1:8e:78:d5:27:53:79:e0:92:7c:10:3b:79:a0:d7:
+ b6:9d:a8:5c:4d:fa:68:11:b3:03:9e:ee:5e:20:79:
+ 23:d8:9c:49:34:9c:1d:c4:6e:53:1f:9a:92:1f:08:
+ c1:15:e2:ad:cf:59:cd:1e:55:84:79:f9:09:ca:36:
+ 8a:50:83:c6:38:48:c6:d3:fa:f6:f2:2a:4f:bd:5d:
+ 60:9d:eb:21:c4:8c:f2:dd:2d:49:10:63:46:47:de:
+ 2d:59:a0:4a:e0:58:e6:c0:ae:d8:d4:5e:9a:f8:f5:
+ 68:1d:ea:80:8a:d6:01:b0:d5:5f:30:4d:88:5a:c5:
+ 1f:81:92:c1:40:54:c8:bb:a6:a1:43:de:81:3c:4b:
+ 79:95:82:bb:52:da:a3:a4:a0:69:ff:7e:00:8c:86:
+ 85:ec:af:03:68:a8:83:48:a0:e4:1d:31:a9:5c:47:
+ 99:9d:3a:3f:b5:3e:12:7c:4d:47:15:72:f1:11:5c:
+ 4a:ef:08:1c:7b:8f:e6:03:06:07:4f:94:21:b0:5e:
+ 27:fa:93:8c:b4:cc:56:34:3b:6d:c4:4a:14:57:b2:
+ 21:1a:3e:2f:c5:9e:47:1a:59:05:22:0e:56:b1:a7:
+ e8:80:9b:82:c3:54:57:12:05:94:79:a2:03:d9:64:
+ 3c:63
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
- C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79
+ 1C:C7:2B:AA:1B:B1:BB:2E:9A:F4:0F:B1:86:60:57:38:C2:41:05:12
X509v3 Authority Key Identifier:
- keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79
+ keyid:1C:C7:2B:AA:1B:B1:BB:2E:9A:F4:0F:B1:86:60:57:38:C2:41:05:12
X509v3 Basic Constraints:
CA:TRUE
- Signature Algorithm: sha1WithRSAEncryption
- 40:6f:6a:54:f3:29:30:48:46:bd:da:46:71:64:52:14:a7:c2:
- 34:b7:5e:1e:42:3d:e7:47:92:cd:87:e7:9d:5d:1a:82:77:82:
- 62:32:d4:9d:b6:44:11:dc:88:78:38:a5:d3:1f:1e:be:c2:d6:
- 14:b0:58:35:cd:66:22:43:97:ba:bb:e3:44:4f:9d:75:14:9f:
- 6f:37:d3:50:07:09:36:bc:58:92:e8:fe:c0:a8:ba:29:55:65:
- e2:6f:8f:ab:a5:1d:4f:56:37:de:c7:b4:39:20:4c:a8:4c:db:
- 56:51:12:7e:e7:7f:83:9d:c4:c7:72:8f:6f:83:f0:af:e3:37:
- 1c:40:fe:5e:38:26:2f:05:46:a7:0c:a5:81:79:d6:9c:9c:d7:
- 56:eb:96:fe:c7:ae:8e:4f:5e:4a:6c:3a:fa:68:be:65:60:a2:
- d3:3f:07:76:45:b3:95:3e:11:ef:3a:0e:6f:73:47:4c:90:dd:
- 0b:36:b4:22:df:62:8d:58:d2:a6:34:5b:f0:06:5d:cd:bf:52:
- fa:ee:9b:4f:e8:79:18:6e:1c:6e:5f:96:10:6d:2f:02:1b:dd:
- bf:14:c9:32:3c:83:a5:6e:56:56:78:9d:ce:84:50:a4:df:cc:
- b5:a9:b1:ec:09:07:74:02:27:7a:9d:d2:96:a9:80:95:9a:f2:
- 8c:e9:ef:99
+ Signature Algorithm: sha256WithRSAEncryption
+ 0d:4b:21:52:fa:49:34:56:14:db:83:ae:1c:3d:a7:4d:3e:ea:
+ 55:7e:1a:37:7a:65:89:ee:19:05:94:9d:3a:ad:59:c4:38:16:
+ b2:bd:02:ee:5a:a6:7e:e2:b1:21:a3:ad:af:8c:ae:c3:30:71:
+ ad:d7:d2:24:0f:c4:d9:47:80:c5:95:05:1d:7c:8a:49:0a:7d:
+ 8b:61:ca:b5:68:3d:3e:4e:f1:c7:45:62:c8:cc:a9:2f:f3:12:
+ f1:3f:92:34:7f:07:ab:d3:ac:ab:af:2d:c9:69:63:8a:b2:e5:
+ 35:ea:7d:b8:17:38:72:82:5f:96:3d:dc:8d:e5:11:bb:ae:f3:
+ 02:2d:20:77:5c:64:59:18:a6:e7:fa:c7:89:e8:30:12:14:04:
+ 40:5b:e9:b1:8f:86:81:b9:0d:6c:b6:fc:98:f9:b7:52:ab:8f:
+ 7e:53:c8:a0:05:e4:cd:0d:6b:d2:74:9f:17:7a:a1:c3:76:5e:
+ f3:29:1c:c6:be:56:ab:02:f7:5d:e1:c9:21:27:6d:66:7a:41:
+ 29:49:a3:f8:f5:2a:e7:03:2a:7c:52:4b:f5:46:58:45:be:a4:
+ 4c:a0:65:37:1d:d8:ac:f8:1f:81:ca:9c:79:f0:ff:22:8c:1d:
+ ce:2b:d0:1e:ce:99:f2:db:fa:66:84:e6:86:6f:19:3b:10:f1:
+ 92:ac:57:b2
-----BEGIN CERTIFICATE-----
-MIIDfzCCAmegAwIBAgIJAKC1veDywIyQMA0GCSqGSIb3DQEBBQUAMFYxDzANBgNV
+MIIDfzCCAmegAwIBAgIJAOWx43Hpb6nhMA0GCSqGSIb3DQEBCwUAMFYxDzANBgNV
BAMMBmNhY2VydDELMAkGA1UEBhMCRkkxETAPBgNVBAgMCEhlbHNpbmtpMREwDwYD
-VQQHDAhIZWxzaW5raTEQMA4GA1UECgwHTWFyaWFEQjAeFw0xNTA0MjUxNDU1MDVa
-Fw0zNTA0MjAxNDU1MDVaMFYxDzANBgNVBAMMBmNhY2VydDELMAkGA1UEBhMCRkkx
+VQQHDAhIZWxzaW5raTEQMA4GA1UECgwHTWFyaWFEQjAeFw0xNzA0MjUyMDUyMjFa
+Fw0zNzA0MjAyMDUyMjFaMFYxDzANBgNVBAMMBmNhY2VydDELMAkGA1UEBhMCRkkx
ETAPBgNVBAgMCEhlbHNpbmtpMREwDwYDVQQHDAhIZWxzaW5raTEQMA4GA1UECgwH
-TWFyaWFEQjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMAfkHwrwuoB
-k87gxXLoHAa9Y0620sYAMhMnQp7JPJEzTRWQZ32d2L6bEuL2G0aBSosQxbgUU6tq
-LMN/ZodsDhhRTpyTem2h1AZHWGGmBCEsvXR65GhF/pH++6YpR+zFw4jIyefXxhoN
-uPXFAlclAczVjDdGWMZxMO5jOJmEXp48r0DU8PISRG4vTc352k0OH6b+NcOdQAiC
-Xm99TQkWfaF41p+fRNaxredQJRrzThaSShdeC+HIn2IixOIBlmPtN6LlcLncyI7E
-/gAh9blIwENVStgMnc7WYDC7gTHI6Q6qHBg95BBHQhfATfv12cLkBzP3FZRjbRGt
-T9QdEUHB4t0CAwEAAaNQME4wHQYDVR0OBBYEFMcsAZUa9T7NBKYkNTUE2acWASp5
-MB8GA1UdIwQYMBaAFMcsAZUa9T7NBKYkNTUE2acWASp5MAwGA1UdEwQFMAMBAf8w
-DQYJKoZIhvcNAQEFBQADggEBAEBvalTzKTBIRr3aRnFkUhSnwjS3Xh5CPedHks2H
-551dGoJ3gmIy1J22RBHciHg4pdMfHr7C1hSwWDXNZiJDl7q740RPnXUUn28301AH
-CTa8WJLo/sCouilVZeJvj6ulHU9WN97HtDkgTKhM21ZREn7nf4OdxMdyj2+D8K/j
-NxxA/l44Ji8FRqcMpYF51pyc11brlv7Hro5PXkpsOvpovmVgotM/B3ZFs5U+Ee86
-Dm9zR0yQ3Qs2tCLfYo1Y0qY0W/AGXc2/Uvrum0/oeRhuHG5flhBtLwIb3b8UyTI8
-g6VuVlZ4nc6EUKTfzLWpsewJB3QCJ3qd0papgJWa8ozp75k=
+TWFyaWFEQjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKCt1bHsRW/W
+M/xaAykU8Y541SdTeeCSfBA7eaDXtp2oXE36aBGzA57uXiB5I9icSTScHcRuUx+a
+kh8IwRXirc9ZzR5VhHn5Cco2ilCDxjhIxtP69vIqT71dYJ3rIcSM8t0tSRBjRkfe
+LVmgSuBY5sCu2NRemvj1aB3qgIrWAbDVXzBNiFrFH4GSwUBUyLumoUPegTxLeZWC
+u1Lao6Sgaf9+AIyGheyvA2iog0ig5B0xqVxHmZ06P7U+EnxNRxVy8RFcSu8IHHuP
+5gMGB0+UIbBeJ/qTjLTMVjQ7bcRKFFeyIRo+L8WeRxpZBSIOVrGn6ICbgsNUVxIF
+lHmiA9lkPGMCAwEAAaNQME4wHQYDVR0OBBYEFBzHK6obsbsumvQPsYZgVzjCQQUS
+MB8GA1UdIwQYMBaAFBzHK6obsbsumvQPsYZgVzjCQQUSMAwGA1UdEwQFMAMBAf8w
+DQYJKoZIhvcNAQELBQADggEBAA1LIVL6STRWFNuDrhw9p00+6lV+Gjd6ZYnuGQWU
+nTqtWcQ4FrK9Au5apn7isSGjra+MrsMwca3X0iQPxNlHgMWVBR18ikkKfYthyrVo
+PT5O8cdFYsjMqS/zEvE/kjR/B6vTrKuvLclpY4qy5TXqfbgXOHKCX5Y93I3lEbuu
+8wItIHdcZFkYpuf6x4noMBIUBEBb6bGPhoG5DWy2/Jj5t1Krj35TyKAF5M0Na9J0
+nxd6ocN2XvMpHMa+VqsC913hySEnbWZ6QSlJo/j1KucDKnxSS/VGWEW+pEygZTcd
+2Kz4H4HKnHnw/yKMHc4r0B7OmfLb+maE5oZvGTsQ8ZKsV7I=
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/cakey.pem b/mysql-test/std_data/cakey.pem
new file mode 100644
index 00000000000..88e251f00e2
--- /dev/null
+++ b/mysql-test/std_data/cakey.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCgrdWx7EVv1jP8
+WgMpFPGOeNUnU3ngknwQO3mg17adqFxN+mgRswOe7l4geSPYnEk0nB3EblMfmpIf
+CMEV4q3PWc0eVYR5+QnKNopQg8Y4SMbT+vbyKk+9XWCd6yHEjPLdLUkQY0ZH3i1Z
+oErgWObArtjUXpr49Wgd6oCK1gGw1V8wTYhaxR+BksFAVMi7pqFD3oE8S3mVgrtS
+2qOkoGn/fgCMhoXsrwNoqINIoOQdMalcR5mdOj+1PhJ8TUcVcvERXErvCBx7j+YD
+BgdPlCGwXif6k4y0zFY0O23EShRXsiEaPi/FnkcaWQUiDlaxp+iAm4LDVFcSBZR5
+ogPZZDxjAgMBAAECggEAWmy6AGFpSmEP7IpzkOEaeAWEX5dY1YtaioAOGPiM6vje
+yXuMqblG5mBbVIcYJ0T85cCd9/fmi7ifVxvEHh7tle2Bw/p4jXQbkFNVT655FR/P
+1Wg9JVeufHFaeETlQgnYe6SKo9BaswNUHkZZHRyq7/D2Ub3UFRt2tq9MG9YIKY1m
+rP9s7E+EDuH9UhYmaWdQfNm8muIXWK8WjicI5+PX0CQ1NtUy6vS7qBzcBzvT0chC
+Jtja29S6Nvg12A96nHsRmQyUaQjRlqosSwiagpc5mZmNeCEUoY+3deIdYIUMSQnf
+judZOKVPq0GOW5Y1U068LGODWaifPkinGBj+04VH0QKBgQDOp/jVCOUdEeqFJ/8m
+wEsfsRIrXvtGJHgbDXcVJ69FwlX+yaKGEuC+4f21uyxPn6GoFw+NKAyTmGKH7VAX
+OFQLrMQ/DMlNbZrCAAFcXMqrnLaVwqMeIIoVNfKAa8u15K40qc+B0it61Nlay5wq
+wvXoSZrdqXSgsI29pav20+8pTQKBgQDHC3l1+gMZ1rCar+5KdVBN1Wq4Xh7cwZw6
+FxEvyrDCJePEU2L7FpH1pFuB4WpXdBu3CPo70ZgwfqBXn4qLOOI3gTtDHActyiUm
++WRG62O+5Ye7aLB4xy0MfnKNA2g/yHj1ozwM8kA5JRptAzDnzWfVE0k47/pVAVzt
+E2bZuSykbwKBgQCL6SkMgjMr1T9j20phn/q8gBN/DZUtTe+K0Tj4N5/wqLuz/its
+fkdutG4ipZBAcCDwPnym4qBxJNBAmqiIr/gm11ceILgBFd2azoodUC1etoDfL6Fj
++j/CUH3X+CM5CJPwz67Pg80wIf7t+7/FK611ELAqtllhmWa9KPcd6yqWWQKBgHh5
+Xnvk5kmWY3BNOgrBNOjXWu/asA1n9lpGqfVmVlQ8wL6MxiU5xQCMCYL0X/ws37WK
+boMUWmxHyF8gxqd7t5hm1OrKpSG274PGgUZXpRjfLqdlNyLzUzXztvvY6xloCqaK
+tYcUfYDZD0SaINi8v7L9KF2ZCsi2uXsZOjBf30BrAoGAXPPotkw/CkcPQBS13cha
+ZWeeH5NDKBADWXfLfcRUs108c9xw4BYr5yGilSPscN2ZP0/iWONKp/c6/STS54t5
+lkOKKUbkAFbQu8UKa1J7zrnHZv+Mr4I/iBBy6VkN8Spp2vBI3Ng6jhPIJg3Gum9p
+943wWtAnIhe/UqCRT3a/GZg=
+-----END PRIVATE KEY-----
diff --git a/mysql-test/std_data/client-cert.pem b/mysql-test/std_data/client-cert.pem
index cbe8bc2c677..9f6f0cfde7c 100644
--- a/mysql-test/std_data/client-cert.pem
+++ b/mysql-test/std_data/client-cert.pem
@@ -2,25 +2,25 @@ Certificate:
Data:
Version: 3 (0x2)
Serial Number: 3 (0x3)
- Signature Algorithm: sha1WithRSAEncryption
+ Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB
Validity
- Not Before: Apr 25 14:55:16 2015 GMT
- Not After : Apr 20 14:55:16 2035 GMT
+ Not Before: Apr 25 20:52:33 2017 GMT
+ Not After : Apr 20 20:52:33 2037 GMT
Subject: C=FI, ST=Helsinki, L=Helsinki, O=MariaDB, CN=client
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
- 00:ce:a0:3d:3c:a4:bb:4f:a1:4f:91:0d:05:ac:5b:
- 8a:15:7f:d7:aa:0c:a3:a7:9f:b2:c7:26:9d:65:28:
- b1:84:d3:a0:ef:9e:b1:45:0f:33:df:98:6e:71:ff:
- 2b:66:9c:9c:c1:25:13:27:42:b6:20:46:e7:e7:47:
- a1:88:47:c2:9e:e2:45:25:99:9f:f9:28:1a:9a:13:
- 67:5d:3e:b3:b8:fe:40:25:ac:26:49:46:2c:03:43:
- 83:67:d8:0f:41:ae:2e:f4:d8:71:60:3c:8e:e7:91:
- d0:bb:2c:ca:12:da:71:1a:7b:e3:fa:8c:8f:c3:bb:
- 62:55:89:b3:bf:85:45:01:61
+ 00:a1:10:ea:cc:8e:2c:73:6b:33:1a:5e:26:19:b6:
+ 4b:4c:bc:04:b8:c2:e2:33:eb:67:a2:7a:27:af:3f:
+ f7:ef:49:5f:c1:d2:b9:d9:71:fe:17:a0:93:da:dc:
+ f1:47:de:fa:1f:c3:c1:d1:a5:2a:06:cb:b3:e8:9a:
+ c1:bd:78:77:68:45:c1:55:cd:b1:c1:d3:df:8c:12:
+ 4f:c2:3a:0d:b7:58:dc:ca:13:08:b9:fb:12:24:90:
+ aa:b7:4e:04:eb:43:0d:45:be:1c:17:d6:a8:b1:af:
+ 10:3c:39:d6:08:45:ed:a9:7e:3a:69:ae:70:22:86:
+ 7e:71:1f:f1:0e:d0:0d:32:c3
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
@@ -28,42 +28,42 @@ Certificate:
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
- 5A:73:74:8E:14:29:C3:FB:B4:19:0F:97:8F:AA:6F:E1:E1:A8:F7:5B
+ 0C:20:76:A1:80:9C:2F:30:3D:F7:AB:8D:31:19:AD:E2:F7:E2:8D:12
X509v3 Authority Key Identifier:
- keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79
+ keyid:1C:C7:2B:AA:1B:B1:BB:2E:9A:F4:0F:B1:86:60:57:38:C2:41:05:12
- Signature Algorithm: sha1WithRSAEncryption
- 32:42:4b:36:44:a5:6c:fb:70:d8:08:2b:cb:16:34:15:db:39:
- 60:7b:7e:b4:4a:bc:fb:e5:16:04:97:0d:eb:f5:68:95:da:2f:
- 23:57:4c:c9:29:2b:d1:1b:1b:9f:bd:f4:79:75:df:62:7f:63:
- b4:84:7a:95:5c:c4:ee:f3:77:16:e4:0b:8a:5e:c9:64:bd:7c:
- 04:50:ac:ff:9a:41:6b:b1:6a:9f:cd:45:10:72:83:10:8a:26:
- 1d:7f:6c:84:34:5a:41:79:72:91:ee:87:5d:1d:3a:55:ff:91:
- 7e:52:85:ff:42:41:eb:76:56:23:e5:bc:bc:79:b1:aa:4e:4c:
- bf:7b:df:63:8b:1a:3c:4b:01:72:89:35:bb:0d:92:97:16:6e:
- ae:50:cb:89:ee:c6:7a:d0:d3:32:22:0f:19:33:1e:ee:ff:41:
- a5:a1:25:c5:4c:ce:8f:98:4c:b5:2c:1f:ec:cc:f1:21:e2:3a:
- ff:7d:6a:87:fe:89:fd:2c:20:3e:fb:9b:b8:c0:f9:09:99:ce:
- 45:63:82:09:1c:bb:79:d8:a8:40:21:46:c7:ae:3e:dd:89:9d:
- 56:46:4a:f4:ed:7d:5b:a6:1e:a6:1b:26:f9:ec:26:b4:51:3a:
- 87:b6:50:13:84:33:22:1a:8a:20:c5:44:64:b8:bb:de:32:ec:
- 6b:58:db:17
+ Signature Algorithm: sha256WithRSAEncryption
+ 39:c0:90:13:19:85:47:9d:c6:ab:8c:c6:c9:0f:33:11:19:f7:
+ 01:2c:1b:08:f6:81:98:11:ab:48:05:d9:b2:29:56:32:9c:ba:
+ e5:40:df:85:5e:6d:fd:6e:36:9a:14:eb:90:50:57:de:2f:ed:
+ 2d:89:a6:8a:40:1c:41:84:9b:da:e1:6d:e6:7c:46:b2:e0:90:
+ 93:02:1c:52:2e:af:b4:d4:a1:d8:9d:19:cf:0a:67:bf:c3:3e:
+ 2e:02:f4:3e:bc:2e:59:57:30:85:8a:32:ab:22:88:72:37:6e:
+ ee:ed:f8:53:72:c9:28:87:50:47:81:1b:80:4c:f8:80:ce:2f:
+ 47:ca:78:ce:38:51:70:ec:df:ee:fc:ea:5a:40:1e:4d:1c:fd:
+ 4e:f6:74:d0:22:a4:7e:57:df:16:1a:a0:8d:be:fe:ee:f2:07:
+ 2e:39:a1:97:40:19:f9:3b:b8:e7:c4:98:6e:1d:1a:27:d3:19:
+ 4c:5c:c9:c3:31:98:c1:3c:27:0e:6a:de:cf:88:72:cf:e4:65:
+ c9:0d:33:32:f1:ea:f7:dd:5b:9d:42:6d:ee:c7:a8:b7:85:d2:
+ 41:e0:84:38:ce:86:81:ba:6e:7d:d5:ad:7a:00:58:d7:c5:83:
+ 9e:5c:1d:38:32:72:49:f5:42:4b:e7:c6:5c:12:6d:e1:5d:51:
+ 2c:f5:52:f0
-----BEGIN CERTIFICATE-----
-MIIDHjCCAgagAwIBAgIBAzANBgkqhkiG9w0BAQUFADBWMQ8wDQYDVQQDDAZjYWNl
+MIIDHjCCAgagAwIBAgIBAzANBgkqhkiG9w0BAQsFADBWMQ8wDQYDVQQDDAZjYWNl
cnQxCzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVs
-c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTUwNDI1MTQ1NTE2WhcNMzUwNDIw
-MTQ1NTE2WjBWMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV
+c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTcwNDI1MjA1MjMzWhcNMzcwNDIw
+MjA1MjMzWjBWMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV
BAcMCEhlbHNpbmtpMRAwDgYDVQQKDAdNYXJpYURCMQ8wDQYDVQQDDAZjbGllbnQw
-gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM6gPTyku0+hT5ENBaxbihV/16oM
-o6efsscmnWUosYTToO+esUUPM9+YbnH/K2acnMElEydCtiBG5+dHoYhHwp7iRSWZ
-n/koGpoTZ10+s7j+QCWsJklGLANDg2fYD0GuLvTYcWA8jueR0LssyhLacRp74/qM
-j8O7YlWJs7+FRQFhAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8W
-HU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRac3SOFCnD
-+7QZD5ePqm/h4aj3WzAfBgNVHSMEGDAWgBTHLAGVGvU+zQSmJDU1BNmnFgEqeTAN
-BgkqhkiG9w0BAQUFAAOCAQEAMkJLNkSlbPtw2AgryxY0Fds5YHt+tEq8++UWBJcN
-6/VoldovI1dMySkr0Rsbn730eXXfYn9jtIR6lVzE7vN3FuQLil7JZL18BFCs/5pB
-a7Fqn81FEHKDEIomHX9shDRaQXlyke6HXR06Vf+RflKF/0JB63ZWI+W8vHmxqk5M
-v3vfY4saPEsBcok1uw2SlxZurlDLie7GetDTMiIPGTMe7v9BpaElxUzOj5hMtSwf
-7MzxIeI6/31qh/6J/SwgPvubuMD5CZnORWOCCRy7edioQCFGx64+3YmdVkZK9O19
-W6Yephsm+ewmtFE6h7ZQE4QzIhqKIMVEZLi73jLsa1jbFw==
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKEQ6syOLHNrMxpeJhm2S0y8BLjC
+4jPrZ6J6J68/9+9JX8HSudlx/hegk9rc8Ufe+h/DwdGlKgbLs+iawb14d2hFwVXN
+scHT34wST8I6DbdY3MoTCLn7EiSQqrdOBOtDDUW+HBfWqLGvEDw51ghF7al+Ommu
+cCKGfnEf8Q7QDTLDAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8W
+HU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBQMIHahgJwv
+MD33q40xGa3i9+KNEjAfBgNVHSMEGDAWgBQcxyuqG7G7Lpr0D7GGYFc4wkEFEjAN
+BgkqhkiG9w0BAQsFAAOCAQEAOcCQExmFR53Gq4zGyQ8zERn3ASwbCPaBmBGrSAXZ
+silWMpy65UDfhV5t/W42mhTrkFBX3i/tLYmmikAcQYSb2uFt5nxGsuCQkwIcUi6v
+tNSh2J0Zzwpnv8M+LgL0PrwuWVcwhYoyqyKIcjdu7u34U3LJKIdQR4EbgEz4gM4v
+R8p4zjhRcOzf7vzqWkAeTRz9TvZ00CKkflffFhqgjb7+7vIHLjmhl0AZ+Tu458SY
+bh0aJ9MZTFzJwzGYwTwnDmrez4hyz+RlyQ0zMvHq991bnUJt7seot4XSQeCEOM6G
+gbpufdWtegBY18WDnlwdODJySfVCS+fGXBJt4V1RLPVS8A==
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/client-key.pem b/mysql-test/std_data/client-key.pem
index 5037c6e2728..b6b5507cd15 100644
--- a/mysql-test/std_data/client-key.pem
+++ b/mysql-test/std_data/client-key.pem
@@ -1,15 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQDOoD08pLtPoU+RDQWsW4oVf9eqDKOnn7LHJp1lKLGE06DvnrFF
-DzPfmG5x/ytmnJzBJRMnQrYgRufnR6GIR8Ke4kUlmZ/5KBqaE2ddPrO4/kAlrCZJ
-RiwDQ4Nn2A9Bri702HFgPI7nkdC7LMoS2nEae+P6jI/Du2JVibO/hUUBYQIDAQAB
-AoGAa/FgLFcul3oA9BjmdtVXfMXNp8N0l3QhVFLC9P7eRjK8p5GysA4yHkQmpp0U
-UkXMykYRDHiYZqJEMhnEtEowzBmodi7go+gpwAR2eUKwESmJoBhPvqDJAbS/fL5D
-H2Wk6FGsdKoPhEpigWefu6ZqlX5GCGa601eMYLMR9i+6bbUCQQDspD4j2q8oihTU
-RQt/XpF1l+5ZRHjQOokwRekuHdq0powtNxZ+X3V8Qy8JbDRNCM2YtfKMX4gXAfZp
-JWs7HoPvAkEA34doY3AKxZSpXD84m4dnJ0/Ubfk3+tcC1EPYyDJ1DHpfz7fy6aoX
-z8TWCQXtSBGaEa9Dgbz+EFXuctLbUR8/rwJACDjIo+xEK69oe9uOQ7WgbiqCMH3N
-iMaP36p+KIkHAUHMGwIP+QIODewzpSsqQgbtRcIElFX5X3tE+XBAYoRz5wJAKH3/
-CwRg7ynfBDbvqjz9EsIDWWisG2SXvpwLyThau8fvU1GfT3Tgm2Ks4zWPpl6J6mo1
-cGssGwl2CJbp4+glQQJBAJAwvKufpB+M6OjvKh89GGsCEaV1ENJ41FPcQwJ2pjed
-Fcq28ZP59v7bfBH2IkNu3pfEzmvQnmRlTEtXGjNn+i8=
+MIICXQIBAAKBgQChEOrMjixzazMaXiYZtktMvAS4wuIz62eieievP/fvSV/B0rnZ
+cf4XoJPa3PFH3vofw8HRpSoGy7PomsG9eHdoRcFVzbHB09+MEk/COg23WNzKEwi5
++xIkkKq3TgTrQw1FvhwX1qixrxA8OdYIRe2pfjpprnAihn5xH/EO0A0ywwIDAQAB
+AoGAaJMqT+vTcpDcmjcct78DPuwoiKmH4rvqCrUTRRbcbJGQSbD/F+6KUl7hAM5J
+Hifo8GzST8LT+ZuS0OiB9/naVGJjcLzpV+us+keMctB/cjmsPAAsRdeA8Xk0jTWv
+v+5a5ZWSSbRXycuUtywtoESY1RLEyB0k3Dcxvk6SD3LnNMkCQQDTyDJfP+eirhgC
+mKiNvHJjLtlRT11IMLMVTELEntsyKqzVgficZCWGkFRoF9iEO1OyCJaug7RZsuxs
+Z3lk/gq1AkEAwrHwzVPU+dTqsZ8tYHlq+d0xy+6eTtYy7e/5qH3AUz10us6BG/LY
+XVTwRFAOKQOciKZ/zPQa4oYeAc0oozSalwJBAIuMbyS0Rz262bdcQDSk5/rS8//P
++/eFn3t5NMW6p1T3KcvGSLtEgjWZBQVSMSlwrkWxwxhbUIuKip8jz6nse8ECQDgm
+g5FkLRdEfc9uXfLl8aFQVu0+y29nPVb8D9+1LMOVBNZfekLqPdZlCcpZ4EuZ3ApZ
+IqCkgiB0l7DjT2YKZM8CQQCp8z1JvoNRwhIuojh7JajY5QBkXtvHootXr+vDUHNf
+SgR5BRmqZb0F5/BK4/7JbumiHI11QUULxhOnNtlS7DDt
-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/empty_file b/mysql-test/std_data/empty_file
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/std_data/empty_file
diff --git a/mysql-test/std_data/funcs_1/ndb_tb1.txt b/mysql-test/std_data/funcs_1/ndb_tb1.txt
deleted file mode 100644
index 4c20ed1661b..00000000000
--- a/mysql-test/std_data/funcs_1/ndb_tb1.txt
+++ /dev/null
@@ -1,10 +0,0 @@
- a`0 a`0 0` 0` a`0 a`0 0` 0` ! 6 163 103 238 3058 30243 22056 9444 -5 1 1 1 -5 1 1 1 -5 1 1 1 -5 1 1 1 -5 -5 1 1 1 1 1 1 -5 0.0 1 0.0 1 0.0 1 0.0 -5 1 1 1 -5 -5
- aa0 aa0 1aa 1aa aa0 aa0 1aa 1aa @ 9 207 1 246 13214 57220 1505 58996 -4 2 2 2 -4 2 2 2 -4 2 2 2 -4 2 2 2 -4 -4 2 2 2 2 2 2 -4 1.1 2 1.1 2 1.1 2 1.1 -4 2 2 2 -4 -4
- ab0 ab0 2baa 2baa ab0 ab0 2baa 2baa # 3 50 103 193 10965 3038 31585 20149 -3 3 3 3 -3 3 3 3 -3 3 3 3 -3 3 3 3 -3 -3 3 3 3 3 3 3 -3 2.2 3 2.2 3 2.2 3 2.2 -3 3 3 3 -3 -3
- ac0 ac0 3caaa 3caaa ac0 ac0 3caaa 3caaa $ 62 188 47 176 5103 58378 13178 38317 -2 4 4 4 -2 4 4 4 -2 4 4 4 -2 4 4 4 -2 -2 4 4 4 4 4 4 -2 3.3 4 3.3 4 3.3 4 3.3 -2 4 4 4 -2 -2
- ad0 ad0 4daaaa 4daaaa ad0 ad0 4daaaa 4daaaa % 59 15 21 80 17942 48443 12646 53903 -1 5 5 5 -1 5 5 5 -1 5 5 5 -1 5 5 5 -1 -1 5 5 5 5 5 5 -1 4.4 5 4.4 5 4.4 5 4.4 -1 5 5 5 -1 -1
- ae0 ae0 5eaaaaa 5eaaaaa ae0 ae0 5eaaaaa 5eaaaaa ^ 86 223 103 88 3880 31147 5801 28348 0 6 6 6 0 6 6 6 0 6 6 6 0 6 6 6 0 0 6 6 6 6 6 6 0 5.5 6 5.5 6 5.5 6 5.5 0 6 6 6 0 0
- af0 af0 6faaaaaa 6faaaaaa af0 af0 6faaaaaa 6faaaaaa & 124 125 77 208 2591 29533 18803 21557 1 7 7 7 1 7 7 7 1 7 7 7 1 7 7 7 1 1 7 7 7 7 7 7 1 6.6 7 6.6 7 6.6 7 6.6 1 7 7 7 1 1
- ag0 ag0 7gaaaaaaa 7gaaaaaaa ag0 ag0 7gaaaaaaa 7gaaaaaaa * 123 103 80 92 10179 60769 25778 58195 2 8 8 8 2 8 8 8 2 8 8 8 2 8 8 8 2 2 8 8 8 8 8 8 2 7.7 8 7.7 8 7.7 8 7.7 2 8 8 8 2 2
- a^0 a^0 8^aaaaaaaa 8^aaaaaaaa a^0 a^0 8^aaaaaaaa 8^aaaaaaaa ( 111 166 81 66 5159 2177 6774 38396 3 9 9 9 3 9 9 9 3 9 9 9 3 9 9 9 3 3 9 9 9 9 9 9 3 8.8 9 8.8 9 8.8 9 8.8 3 9 9 9 3 3
- a_0 a_0 9_aaaaaaaaa 9_aaaaaaaaa a_0 a_0 9_aaaaaaaaa 9_aaaaaaaaa ) 37 174 97 34 9183 16470 13064 6297 4 10 10 10 4 10 10 10 4 10 10 10 4 10 10 10 4 4 10 10 10 10 10 10 4 9.9 10 9.9 10 9.9 10 9.9 4 10 10 10 4 4
diff --git a/mysql-test/std_data/funcs_1/ndb_tb2.txt b/mysql-test/std_data/funcs_1/ndb_tb2.txt
deleted file mode 100644
index 8ae7dea6df4..00000000000
--- a/mysql-test/std_data/funcs_1/ndb_tb2.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-1 1 1 1 1 1 -5 0.0 1 0.0 1 0.0 1 0.0 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 19700102000001 1902 1902 1902 2 2
-2 2 2 2 2 2 -4 1.1 2 1.1 2 1.1 2 1.1 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 19700103000002 1903 1903 1903 1 3
-3 3 3 3 3 3 -3 2.2 3 2.2 3 2.2 3 2.2 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 19700104000003 1904 1904 1904 2 1
-4 4 4 4 4 4 -2 3.3 4 3.3 4 3.3 4 3.3 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 19700105000004 1905 1905 1905 1 2
-5 5 5 5 5 5 -1 4.4 5 4.4 5 4.4 5 4.4 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 19700106000005 1906 1906 1906 2 3
-6 6 6 6 6 6 0 5.5 6 5.5 6 5.5 6 5.5 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 19700107000006 1907 1907 1907 1 1
-7 7 7 7 7 7 1 6.6 7 6.6 7 6.6 7 6.6 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 19700108000007 1908 1908 1908 2 2
-8 8 8 8 8 8 2 7.7 8 7.7 8 7.7 8 7.7 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 19700109000008 1909 1909 1909 1 3
-9 9 9 9 9 9 3 8.8 9 8.8 9 8.8 9 8.8 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 19700110000009 1910 1910 1910 2 1
-10 10 10 10 10 10 4 9.9 10 9.9 10 9.9 10 9.9 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 19700111000010 1911 1911 1911 1 2
diff --git a/mysql-test/std_data/funcs_1/ndb_tb3.txt b/mysql-test/std_data/funcs_1/ndb_tb3.txt
deleted file mode 100644
index a01cc36da54..00000000000
--- a/mysql-test/std_data/funcs_1/ndb_tb3.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-! ! ! a`0 a`0 0` 0` a`0 a`0 0` 0` ! 37 102 115 214 22348 22112 23636 18043 -5 1 1 1 -5 1 1 1 -5 1 1 1 -5 1 1 1 -5 -5 1 1 1 1 1 1 -5 0.0 1 0.0 1 0.0 1 0.0 -5 1 1 1 -5 -5
-@ @ @ aa0 aa0 1aa 1aa aa0 aa0 1aa 1aa @ 30 114 62 146 22059 6000 19024 8674 -4 2 2 2 -4 2 2 2 -4 2 2 2 -4 2 2 2 -4 -4 2 2 2 2 2 2 -4 1.1 2 1.1 2 1.1 2 1.1 -4 2 2 2 -4 -4
-# # # ab0 ab0 2baa 2baa ab0 ab0 2baa 2baa # 113 254 52 51 27963 63797 516 63989 -3 3 3 3 -3 3 3 3 -3 3 3 3 -3 3 3 3 -3 -3 3 3 3 3 3 3 -3 2.2 3 2.2 3 2.2 3 2.2 -3 3 3 3 -3 -3
-$ $ $ ac0 ac0 3caaa 3caaa ac0 ac0 3caaa 3caaa $ 70 78 40 203 28716 18828 14939 30960 -2 4 4 4 -2 4 4 4 -2 4 4 4 -2 4 4 4 -2 -2 4 4 4 4 4 4 -2 3.3 4 3.3 4 3.3 4 3.3 -2 4 4 4 -2 -2
-% % % ad0 ad0 4daaaa 4daaaa ad0 ad0 4daaaa 4daaaa % 1 228 76 249 16746 12853 8405 35402 -1 5 5 5 -1 5 5 5 -1 5 5 5 -1 5 5 5 -1 -1 5 5 5 5 5 5 -1 4.4 5 4.4 5 4.4 5 4.4 -1 5 5 5 -1 -1
-^ ^ ^ ae0 ae0 5eaaaaa 5eaaaaa ae0 ae0 5eaaaaa 5eaaaaa ^ 116 52 51 248 26877 15243 20063 65464 0 6 6 6 0 6 6 6 0 6 6 6 0 6 6 6 0 0 6 6 6 6 6 6 0 5.5 6 5.5 6 5.5 6 5.5 0 6 6 6 0 0
-& & & af0 af0 6faaaaaa 6faaaaaa af0 af0 6faaaaaa 6faaaaaa & 59 163 63 26 24559 55618 27326 12704 1 7 7 7 1 7 7 7 1 7 7 7 1 7 7 7 1 1 7 7 7 7 7 7 1 6.6 7 6.6 7 6.6 7 6.6 1 7 7 7 1 1
-* * * ag0 ag0 7gaaaaaaa 7gaaaaaaa ag0 ag0 7gaaaaaaa 7gaaaaaaa * 69 229 119 159 11779 48557 14747 42703 2 8 8 8 2 8 8 8 2 8 8 8 2 8 8 8 2 2 8 8 8 8 8 8 2 7.7 8 7.7 8 7.7 8 7.7 2 8 8 8 2 2
-( ( ( a^0 a^0 8^aaaaaaaa 8^aaaaaaaa a^0 a^0 8^aaaaaaaa 8^aaaaaaaa ( 54 89 113 155 1068 61537 14823 43439 3 9 9 9 3 9 9 9 3 9 9 9 3 9 9 9 3 3 9 9 9 9 9 9 3 8.8 9 8.8 9 8.8 9 8.8 3 9 9 9 3 3
-) ) ) a_0 a_0 9_aaaaaaaaa 9_aaaaaaaaa a_0 a_0 9_aaaaaaaaa 9_aaaaaaaaa ) 68 34 44 175 32453 44381 506 37695 4 10 10 10 4 10 10 10 4 10 10 10 4 10 10 10 4 4 10 10 10 10 10 10 4 9.9 10 9.9 10 9.9 10 9.9 4 10 10 10 4 4
diff --git a/mysql-test/std_data/funcs_1/ndb_tb4.txt b/mysql-test/std_data/funcs_1/ndb_tb4.txt
deleted file mode 100644
index 5092371d093..00000000000
--- a/mysql-test/std_data/funcs_1/ndb_tb4.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-1 1 1 1 1 1 -5 0.0 1 0.0 1 0.0 1 0.0 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 -1.17549435e-38 -1.17549435e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 19700102000001 1902 1902 1902 2 2 0! 0 0 0 0!
-2 2 2 2 2 2 -4 1.1 2 1.1 2 1.1 2 1.1 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 -1.175494349e-38 -1.175494349e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 19700103000002 1903 1903 1903 1 3 1@# 1@ 1@ 1@ 1@#
-3 3 3 3 3 3 -3 2.2 3 2.2 3 2.2 3 2.2 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 -1.175494348e-38 -1.175494348e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 19700104000003 1904 1904 1904 2 1 2#$% 2#$ 2#$ 2#$ 2#$%
-4 4 4 4 4 4 -2 3.3 4 3.3 4 3.3 4 3.3 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 -1.175494347e-38 -1.175494347e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 19700105000004 1905 1905 1905 1 2 3$%^& 3$%^ 3$%^ 3$%^ 3$%^&
-5 5 5 5 5 5 -1 4.4 5 4.4 5 4.4 5 4.4 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 -1.175494346e-38 -1.175494346e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 19700106000005 1906 1906 1906 2 3 4%^&*( 4%^&* 4%^&* 4%^&* 4%^&*(
-6 6 6 6 6 6 0 5.5 6 5.5 6 5.5 6 5.5 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 -1.175494345e-38 -1.175494345e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 19700107000006 1907 1907 1907 1 1 5^&*()_ 5^&*() 5^&*() 5^&*() 5^&*()_
-7 7 7 7 7 7 1 6.6 7 6.6 7 6.6 7 6.6 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 -1.175494344e-38 -1.175494344e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 19700108000007 1908 1908 1908 2 2 6&*()_+= 6&*()_+ 6&*()_+ 6&*()_+ 6&*()_+=
-8 8 8 8 8 8 2 7.7 8 7.7 8 7.7 8 7.7 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 -1.175494343e-38 -1.175494343e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 19700109000008 1909 1909 1909 1 3 7*()_+=-| 7*()_+=- 7*()_+=- 7*()_+=- 7*()_+=-|
-9 9 9 9 9 9 3 8.8 9 8.8 9 8.8 9 8.8 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 -1.175494342e-38 -1.175494342e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 19700110000009 1910 1910 1910 2 1 8()_+=-|{} 8()_+=-|{ 8()_+=-|{ 8()_+=-|{ 8()_+=-|{}
-10 10 10 10 10 10 4 9.9 10 9.9 10 9.9 10 9.9 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 -1.175494341e-38 -1.175494341e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 19700111000010 1911 1911 1911 1 2 9)_+=-|{}[] 9)_+=-|{}[ 9)_+=-|{}[ 9)_+=-|{}[ 9)_+=-|{}[]
diff --git a/mysql-test/std_data/galera-cert.pem b/mysql-test/std_data/galera-cert.pem
new file mode 100644
index 00000000000..2996b330cc0
--- /dev/null
+++ b/mysql-test/std_data/galera-cert.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIDWTCCAkGgAwIBAgIJAIlW4JmZGnU4MA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV
+BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
+Q29tcGFueSBMdGQwIBcNMTQxMDI0MDc1MTU1WhgPMzAxNDAyMjQwNzUxNTVaMEIx
+CzAJBgNVBAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0Rl
+ZmF1bHQgQ29tcGFueSBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
+AQDDzU6xLZDD5rZENsOpTpTmqS8YisBaefU3ZeN7VJepZZ/7unM/1YLGJtuRh2Qa
+MyTkvyjzf7bSFsDt9L5lfQwBBblVeWkrCvGnQmHDQQYB7JrSmFDPz9W9Mxf9Q2BW
+B3lcoKXXJgMnWw0WGrt0lEdFp9gWbq8H9hwJdjpyyk4ZTIuucSOD4JUP3QFEhYU5
+kdcIbDRVw81J4eAZ6EdvbjDN05S7qWjW7rJTnCHAHEd18hcsMGwjpwhjEaSdhMrM
+mhOeL8kuQV0fI8v2xfYBliIn9xBZGOVzySPzwFmQceORlW6F3V5w6mwFkmuXqXWX
+Qo98swTu7mb89qVYmR71d3L3AgMBAAGjUDBOMB0GA1UdDgQWBBRdWet/kGNTyvXK
+wuBdP/eSldOgWjAfBgNVHSMEGDAWgBRdWet/kGNTyvXKwuBdP/eSldOgWjAMBgNV
+HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCcJpP+DR4AJxVelNTSZa+V38c+
+jgrMD2Ku2eU8NQlsjgMfNEU5Md/g7FpP8aCFzVf0kAAT7DxZmSE3uWXQbMXyVJmy
+bF+qXinf71QzdWULm6sASoshC6wbHnXL9ZjWQ3gh1nqVgo3MmLQYrb3eJfKaaLoc
+wpjhYxVxGFOx1ITN3jED64lUfoLHvR6NFbESYKAuAAzSNqX4HOQ3uGk2THM8JocZ
+oH2+38d81Kd4HQ7DDDKS/isG0+rR60Ti1cMgu7OT7p1dZCwT/KQuI5eGjE9lubkc
+yAJjaod4rVLdBri3XVvtySfS2+/75qUgv2TF7d/s7mxMq4DDt29yeKSUhZCs
+-----END CERTIFICATE-----
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAJWyvKjE+s7OP4Lj1jXKGlJGWT4Vd5YaxPljihTsRe1aXkWAgsuwISXk
+/TQ8Rx5Zmze7rtwtU0PoYxvuam9FMXYqhw2dVe4qRdeSX78DSiL/YBkQzaxlfWVy
+RE9+9dzHbCtRVDlN7K1kA+mGWH4/r7NAu4Qm/003V0NTtMwQSqebAgEC
+-----END DH PARAMETERS-----
+
diff --git a/mysql-test/std_data/galera-key.pem b/mysql-test/std_data/galera-key.pem
new file mode 100644
index 00000000000..c88c613cacf
--- /dev/null
+++ b/mysql-test/std_data/galera-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDDzU6xLZDD5rZE
+NsOpTpTmqS8YisBaefU3ZeN7VJepZZ/7unM/1YLGJtuRh2QaMyTkvyjzf7bSFsDt
+9L5lfQwBBblVeWkrCvGnQmHDQQYB7JrSmFDPz9W9Mxf9Q2BWB3lcoKXXJgMnWw0W
+Grt0lEdFp9gWbq8H9hwJdjpyyk4ZTIuucSOD4JUP3QFEhYU5kdcIbDRVw81J4eAZ
+6EdvbjDN05S7qWjW7rJTnCHAHEd18hcsMGwjpwhjEaSdhMrMmhOeL8kuQV0fI8v2
+xfYBliIn9xBZGOVzySPzwFmQceORlW6F3V5w6mwFkmuXqXWXQo98swTu7mb89qVY
+mR71d3L3AgMBAAECggEBAIMT0UdZSp1quL/nrYqNGa9kuSuDz4uCM3+3jNcGZVU4
+vCYHxpmINLi0UK8W5ROJA3zC4AZKjDgOlW93NXK5iKyyiUTIN3hiJi4jiVDuGbh2
+DZtH7mmAKAU1zCx2y2osLLmurfbe8qOJF7ShhrZfgWsHFujFhhUdU92dsTkhZ7EU
+2NF8ScxCo4PbOJoHC3j0ApfwCMxUMAKZF5+08EeKYqK7OAXI79HeIvEbHn3cUDGm
+bvg6ykwlz2UUO4sg+xdCmn1Bt36HF/4e973Y5fkE/vd9mryHIlu9t7GJgWyUiPr8
+BGEoAWDSpPOMd/b9ivtxh9Gd+LW/uitMuBIfrRPgz9kCgYEA+JqeeD2xqF2IzZyq
+i1UqgKe3su2U2zhkgbu1h/1M/reNIZGylF0wFs3P+kNIB2NavmHjXcgSjdJzqRL9
+XEWfFJRmeARo9RTEQEVd8zp1Eo8ISeiksGgvbL4rrNIRR5V5MZytfISRiGCWN6jx
+ulJ6EieQk5EcvknGlWpJY/bBsQ0CgYEAyaCLqrR38gVl2Z0t6YlhW/HWAwGt+lf4
+apN1AS4uykx7wRW2B0y9QUDfsrYeVlbbeRPP4UzPmJez+J2cweoIIeFFyo3KP2L7
+79E3EVYywjXhPg52F7OjFA4Bp970XclIC5Al7kDufSgwZmWdceSx4Jjc5ixyQEC8
+Ad0ThgP6yxMCgYAvC4OFmZcvF1Q2JLmZWGqMojB/KbqLqaZLbqwxqduSMEYC3kF/
+FgttpVEAOQ8+ZqzbbkbKjnwEXpkIm9FaTsqF6HdjquH5zw48Y2QeDSfudSbKZb4U
+rAKdf3dgYvhmJYEjxFSIRcYMmsqSieQEsGrtWJNheYqI8AkmaVCuHBoXWQKBgQCj
+daelNffD2wJuQNI28axfiRjSiSsNuQHpDTCfS1ydnxH5QGu5UUphO4HfdWv03SfC
+6f/vDIGEmQBLvyOVxfDf3qzhAMCFUO8kxj1ZrcMq1dmMoNa2cmj0WkKXYNZFrmfd
+D/jgRf3Ss6FBcoIJErnudp8nb8MUOibxb9RjIpjQxwKBgEliKaGN+/QkPTNJ4vXz
+609CIilxpE+YVTzlv3YeZP5HqsJTJPS2ARIUr/Pjpbl3LHfYNeeGDCwgkJIK0JJH
+iA1M51q6t3zG2y9gKmC15FF0jShoZkRgqBxqrSHAnrCo5t2C48ElxJ3FEU8T75sz
+dlGTbkmR0Wm43Kh++dWICJ3g
+-----END PRIVATE KEY-----
diff --git a/mysql-test/std_data/galera-upgrade-ca-cert.pem b/mysql-test/std_data/galera-upgrade-ca-cert.pem
new file mode 100644
index 00000000000..13d27e84bb3
--- /dev/null
+++ b/mysql-test/std_data/galera-upgrade-ca-cert.pem
@@ -0,0 +1,40 @@
+-----BEGIN CERTIFICATE-----
+MIIDWTCCAkGgAwIBAgIJAIlW4JmZGnU4MA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV
+BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
+Q29tcGFueSBMdGQwIBcNMTQxMDI0MDc1MTU1WhgPMzAxNDAyMjQwNzUxNTVaMEIx
+CzAJBgNVBAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0Rl
+ZmF1bHQgQ29tcGFueSBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
+AQDDzU6xLZDD5rZENsOpTpTmqS8YisBaefU3ZeN7VJepZZ/7unM/1YLGJtuRh2Qa
+MyTkvyjzf7bSFsDt9L5lfQwBBblVeWkrCvGnQmHDQQYB7JrSmFDPz9W9Mxf9Q2BW
+B3lcoKXXJgMnWw0WGrt0lEdFp9gWbq8H9hwJdjpyyk4ZTIuucSOD4JUP3QFEhYU5
+kdcIbDRVw81J4eAZ6EdvbjDN05S7qWjW7rJTnCHAHEd18hcsMGwjpwhjEaSdhMrM
+mhOeL8kuQV0fI8v2xfYBliIn9xBZGOVzySPzwFmQceORlW6F3V5w6mwFkmuXqXWX
+Qo98swTu7mb89qVYmR71d3L3AgMBAAGjUDBOMB0GA1UdDgQWBBRdWet/kGNTyvXK
+wuBdP/eSldOgWjAfBgNVHSMEGDAWgBRdWet/kGNTyvXKwuBdP/eSldOgWjAMBgNV
+HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCcJpP+DR4AJxVelNTSZa+V38c+
+jgrMD2Ku2eU8NQlsjgMfNEU5Md/g7FpP8aCFzVf0kAAT7DxZmSE3uWXQbMXyVJmy
+bF+qXinf71QzdWULm6sASoshC6wbHnXL9ZjWQ3gh1nqVgo3MmLQYrb3eJfKaaLoc
+wpjhYxVxGFOx1ITN3jED64lUfoLHvR6NFbESYKAuAAzSNqX4HOQ3uGk2THM8JocZ
+oH2+38d81Kd4HQ7DDDKS/isG0+rR60Ti1cMgu7OT7p1dZCwT/KQuI5eGjE9lubkc
+yAJjaod4rVLdBri3XVvtySfS2+/75qUgv2TF7d/s7mxMq4DDt29yeKSUhZCs
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDVzCCAj+gAwIBAgIJALBO5bqmtlYkMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV
+BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
+Q29tcGFueSBMdGQwHhcNMTUwNjI2MDcxMjQ1WhcNMjUwNTA0MDcxMjQ1WjBCMQsw
+CQYDVQQGEwJGSTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZh
+dWx0IENvbXBhbnkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
+1DlcztIzSngGeTUFibj9GZ4ZO78ASpgYySZv/DRIVn/3hbF41ZRD/6uJlb5rf1R7
+fpFsurbXNDDxeap7b/Gz2XSQy96Dbm0SbsFSZttV/R2WtlT1Wf5n9ix6RLqhKSbg
+nPyL2fsDaxtZh2uywGJEXhwXFtdx3deIo/tYivDfl5Tcsv0NnZY8Vg0boBRP+FEn
+ReJOdSa5LLn+QJN2Xa+wutbLHe0hI6huKUXU2YUeBfgyk1nWol5241ZUDCgDsoaW
+8r2YeJNHmNInd3wERbqFgFHsR4N1+Atcyrfn/uQSj9zrTPO/Pp51KpjWf/gjxjXP
+biu5De50qZ4+U4no20EIOwIDAQABo1AwTjAdBgNVHQ4EFgQU3kSPGchrOoQJ5gq1
+mmV2HEra6GswHwYDVR0jBBgwFoAU3kSPGchrOoQJ5gq1mmV2HEra6GswDAYDVR0T
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAfoBD64FJ9fAR19+vwueFGmpWNIqF
+PzN7QmEpCMduV3DXuxYO73q2ikXgrVO5HWFz9IjNvzXbSRmWNzJGaZ3QYZ+Xx1JJ
+8MrAOUr6djWuyD659f64dh/2jMxiQNoEHrknXm9HSqR5oJVwndFyr/zvSkYSRexE
+KFciIprb9LOba9G3ZMBYBdqK+f3Ky16BMjaD6XfaTx+xjHk/8peSueXIQl+v2biz
+zSfpEUa0dKCIxckrzD4JknDHFimTsrzlRftcg8t8piOXwZomFcnVunyGs2bJ/Npj
+25c2e6sx7XSc5bUgPGuQcSGflZPLg9zWyJ69sVYUNAz+gqfvWfOOJuzPNg==
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/galera-upgrade-server-cert.pem b/mysql-test/std_data/galera-upgrade-server-cert.pem
new file mode 100644
index 00000000000..3af8b1ae7dd
--- /dev/null
+++ b/mysql-test/std_data/galera-upgrade-server-cert.pem
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDVzCCAj+gAwIBAgIJALBO5bqmtlYkMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV
+BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
+Q29tcGFueSBMdGQwHhcNMTUwNjI2MDcxMjQ1WhcNMjUwNTA0MDcxMjQ1WjBCMQsw
+CQYDVQQGEwJGSTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZh
+dWx0IENvbXBhbnkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
+1DlcztIzSngGeTUFibj9GZ4ZO78ASpgYySZv/DRIVn/3hbF41ZRD/6uJlb5rf1R7
+fpFsurbXNDDxeap7b/Gz2XSQy96Dbm0SbsFSZttV/R2WtlT1Wf5n9ix6RLqhKSbg
+nPyL2fsDaxtZh2uywGJEXhwXFtdx3deIo/tYivDfl5Tcsv0NnZY8Vg0boBRP+FEn
+ReJOdSa5LLn+QJN2Xa+wutbLHe0hI6huKUXU2YUeBfgyk1nWol5241ZUDCgDsoaW
+8r2YeJNHmNInd3wERbqFgFHsR4N1+Atcyrfn/uQSj9zrTPO/Pp51KpjWf/gjxjXP
+biu5De50qZ4+U4no20EIOwIDAQABo1AwTjAdBgNVHQ4EFgQU3kSPGchrOoQJ5gq1
+mmV2HEra6GswHwYDVR0jBBgwFoAU3kSPGchrOoQJ5gq1mmV2HEra6GswDAYDVR0T
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAfoBD64FJ9fAR19+vwueFGmpWNIqF
+PzN7QmEpCMduV3DXuxYO73q2ikXgrVO5HWFz9IjNvzXbSRmWNzJGaZ3QYZ+Xx1JJ
+8MrAOUr6djWuyD659f64dh/2jMxiQNoEHrknXm9HSqR5oJVwndFyr/zvSkYSRexE
+KFciIprb9LOba9G3ZMBYBdqK+f3Ky16BMjaD6XfaTx+xjHk/8peSueXIQl+v2biz
+zSfpEUa0dKCIxckrzD4JknDHFimTsrzlRftcg8t8piOXwZomFcnVunyGs2bJ/Npj
+25c2e6sx7XSc5bUgPGuQcSGflZPLg9zWyJ69sVYUNAz+gqfvWfOOJuzPNg==
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/galera-upgrade-server-key.pem b/mysql-test/std_data/galera-upgrade-server-key.pem
new file mode 100644
index 00000000000..d243c9e0381
--- /dev/null
+++ b/mysql-test/std_data/galera-upgrade-server-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDUOVzO0jNKeAZ5
+NQWJuP0Znhk7vwBKmBjJJm/8NEhWf/eFsXjVlEP/q4mVvmt/VHt+kWy6ttc0MPF5
+qntv8bPZdJDL3oNubRJuwVJm21X9HZa2VPVZ/mf2LHpEuqEpJuCc/IvZ+wNrG1mH
+a7LAYkReHBcW13Hd14ij+1iK8N+XlNyy/Q2dljxWDRugFE/4USdF4k51Jrksuf5A
+k3Zdr7C61ssd7SEjqG4pRdTZhR4F+DKTWdaiXnbjVlQMKAOyhpbyvZh4k0eY0id3
+fARFuoWAUexHg3X4C1zKt+f+5BKP3OtM878+nnUqmNZ/+CPGNc9uK7kN7nSpnj5T
+iejbQQg7AgMBAAECggEBAJ4m7VG3db+uOGzFJY5fzEX1+qn6ibYNKJNmUJfrQmkr
+zgLUoc7QQehbJhnwoN1v0OQebZ+rOC7NtnZLpNdkkPmhk3JKLTnykIT3DnhWRftt
+vG2+XGUnYMQkmy1ywz0Omt6CmZnlJMQByrNPgBM8Z+SWHGLKRTHkOBCz82T/YjDr
+wqug1Yv6W0wMNM/cikgoBldVG7hABCJuShjffIbUgVysK3dEPNywNAC78neoGECm
+evPZOaIkWEr86SpAlwA6Yh+zTQZ03CXATcGonJdWJ015DvlKRv6QyRR0Q/Y1ONwb
+f115kll15MJBEspFdSyhlMcVJlwO8WMaZ2qIzlQZmdECgYEA//P469QzX00L/urK
+7IRvtSVu5CP/A/Wui90U4KoP7XgXIeExnEtzLVs1K7vjuzdpTyq+68XuC40gPcJW
+RvoX229m6gRV8nC53UiV71jM8IvkyEqFYT/gfZC9KQCMSRJLtVnDMpZ3gMxAY6/5
+p20o616Au8DKFFetQV0aD4Hj1/MCgYEA1ENV1WkgvN6yItB77E9kN/vbKLRh0hrg
+9xj0SmMXGYyDM9NpjbgbgJIZo3ukkBtp3kEY8P9JQZRcd1EcnnSrwTB7ChdInWkR
+m/LpIZBEMqNQbeu4QSzZYYS6z4tcGGx43aHqzzNBZdnQnqhYL1CvlLwhkgX6oQCo
+woXqyfMNKJkCgYEA63gD1NGPwWkcVBSlQxpDup8JeZE0Fux6++kUP+u0Y39LqLuH
+7IXtHBkAvY9JXv8HPvHQWw/og2/97VNQFFQYhqPiRgBfIX9bPpx8c4l6YQISI8GL
+G4CsglgZ7hK2/LJ8PAascWnD3xYJVqyaPNFMB90VCaW/Qx+2IKAKTaHtfskCgYBu
+1f5C4pMqrCpeTXj4Cvis1wE4PwB5QnnH7SrakOVl/N4huLn8O2948lEa8Zwbd4UP
+ffR1Gwh4iuzBjQQhpZBt30/QFBphv5RnVy7uzLMfsfF0hEqBFdcoubMGXqGnSzTN
+nhfLO9thQJxTzFnH0xzr0FTDOAYH/h0g/eZ8r0JmuQKBgQDjhXM+hJ3Pkwua+Fnl
+nZfY5MeSzkJki/9iwVo8rSDwmZS9Nsc83oZnddM7c2x63t+zYOAcMxsVCiByMDzo
+5IB781HWRBGcU8TnW1b0bAnZimjKp/qsZ/Szr38rvImqG8TjzbcSD7w0SpyRQ/Ot
+A7SZFkWYfem8/q/VImjU/CNbOQ==
+-----END PRIVATE KEY-----
diff --git a/mysql-test/std_data/keys.txt b/mysql-test/std_data/keys.txt
new file mode 100644
index 00000000000..2d83b7fba60
--- /dev/null
+++ b/mysql-test/std_data/keys.txt
@@ -0,0 +1,12 @@
+#
+# this is a comment
+#
+1;770A8A65DA156D24EE2A093277530142
+2;4D92199549E0F2EF009B4160F3582E5528A11A45017F3EF8
+ # another comment
+33;B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF
+4;18420B5CBA31CCDFFE9716E91EB61374D05914F3ADE23E03 --> ignored
+
+5;966050D7777350B6FD5CCB3E5F648DA45C63BEFB6DEDDFA13443F156B7D35C84
+6;B5EA210C8C09EF20DB95EC584714A89F # and yet another
+10;770A8A65DA156D24EE2A093277530143
diff --git a/mysql-test/std_data/keys2.txt b/mysql-test/std_data/keys2.txt
new file mode 100644
index 00000000000..93fc537cd3e
--- /dev/null
+++ b/mysql-test/std_data/keys2.txt
@@ -0,0 +1,8 @@
+1;770A8A65DA156D24EE2A093277530142
+2;352E42F1B9DB5CB915C3262FE745520A
+3;CFE065600F5EB57481075C65180C3F8A
+4;205379930183490D3BECA139BDF4DB5B
+5;E2D944D5D837A1DCB22FF7FD397892EE
+6;BAFE99B0BB87F2CD33A6AF26A11F6BD1
+19;678D6B0063824BACCE33224B385104B35F30FF5749F0EBC030A0955DBC7FAC34
+20;BAFE99B0BB87F2CD33A6AF26A11F6BD1
diff --git a/mysql-test/std_data/keys3.txt b/mysql-test/std_data/keys3.txt
new file mode 100644
index 00000000000..be30acc6add
--- /dev/null
+++ b/mysql-test/std_data/keys3.txt
@@ -0,0 +1,7 @@
+1;770A8A65DA156D24EE2A093277530142
+2;E4B00A45BF775B4E07D634EC5CA5912B
+3;6E35ACB162B29D1FB9E178021DAF16ED
+4;971A664A88EE0022D408E40BFAB17E79
+5;C4FF86FD89879380DA97EAC0BA3057B7
+6;BAFE99B0BB87F2CD33A6AF26A11F6BD1
+
diff --git a/mysql-test/std_data/loaddata/mdev12696.xml b/mysql-test/std_data/loaddata/mdev12696.xml
new file mode 100644
index 00000000000..a2789acbde5
--- /dev/null
+++ b/mysql-test/std_data/loaddata/mdev12696.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<resultset statement="SELECT 'test' AS c1, NULL AS c2
+" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <row>
+ <field name="c1">test</field>
+ <field name="c2" xsi:nil="true" />
+ </row>
+</resultset>
diff --git a/mysql-test/std_data/logkey.txt b/mysql-test/std_data/logkey.txt
new file mode 100644
index 00000000000..cf470c15201
--- /dev/null
+++ b/mysql-test/std_data/logkey.txt
@@ -0,0 +1,2 @@
+1;36D6CB74CA7D4586CCC7261E174079CC5639E5F681D500ADFA887C165AD49301
+2;F51F5108CF6048B4C9C88BA6CE1C13F9F1CBEE82080F7FA0F979DEF5D4B94509
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-1-0.1.Data b/mysql-test/std_data/ndb_backup50/BACKUP-1-0.1.Data
deleted file mode 100644
index 32494d5a1e7..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-1-0.1.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-1-0.2.Data b/mysql-test/std_data/ndb_backup50/BACKUP-1-0.2.Data
deleted file mode 100644
index 2141fb0a6e4..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-1-0.2.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-1.1.ctl b/mysql-test/std_data/ndb_backup50/BACKUP-1.1.ctl
deleted file mode 100644
index cbe548e0ca5..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-1.1.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-1.1.log b/mysql-test/std_data/ndb_backup50/BACKUP-1.1.log
deleted file mode 100644
index e4e114d4b46..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-1.1.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-1.2.ctl b/mysql-test/std_data/ndb_backup50/BACKUP-1.2.ctl
deleted file mode 100644
index cbe548e0ca5..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-1.2.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-1.2.log b/mysql-test/std_data/ndb_backup50/BACKUP-1.2.log
deleted file mode 100644
index a1c89b7015c..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-1.2.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Data b/mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Data
deleted file mode 100644
index 09e63064666..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Data b/mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Data
deleted file mode 100644
index a8332239d8f..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctl b/mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctl
deleted file mode 100644
index f54103a2a44..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.1.log b/mysql-test/std_data/ndb_backup50/BACKUP-2.1.log
deleted file mode 100644
index 5564f952e66..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-2.1.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctl b/mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctl
deleted file mode 100644
index f54103a2a44..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.2.log b/mysql-test/std_data/ndb_backup50/BACKUP-2.2.log
deleted file mode 100644
index 5564f952e66..00000000000
--- a/mysql-test/std_data/ndb_backup50/BACKUP-2.2.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51/BACKUP-1-0.1.Data b/mysql-test/std_data/ndb_backup51/BACKUP-1-0.1.Data
deleted file mode 100644
index 2407d1f261b..00000000000
--- a/mysql-test/std_data/ndb_backup51/BACKUP-1-0.1.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51/BACKUP-1-0.2.Data b/mysql-test/std_data/ndb_backup51/BACKUP-1-0.2.Data
deleted file mode 100644
index f21e9886523..00000000000
--- a/mysql-test/std_data/ndb_backup51/BACKUP-1-0.2.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51/BACKUP-1.1.ctl b/mysql-test/std_data/ndb_backup51/BACKUP-1.1.ctl
deleted file mode 100644
index 99e2f297693..00000000000
--- a/mysql-test/std_data/ndb_backup51/BACKUP-1.1.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51/BACKUP-1.1.log b/mysql-test/std_data/ndb_backup51/BACKUP-1.1.log
deleted file mode 100644
index 4448cd98c04..00000000000
--- a/mysql-test/std_data/ndb_backup51/BACKUP-1.1.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51/BACKUP-1.2.ctl b/mysql-test/std_data/ndb_backup51/BACKUP-1.2.ctl
deleted file mode 100644
index 99e2f297693..00000000000
--- a/mysql-test/std_data/ndb_backup51/BACKUP-1.2.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51/BACKUP-1.2.log b/mysql-test/std_data/ndb_backup51/BACKUP-1.2.log
deleted file mode 100644
index 3be69891402..00000000000
--- a/mysql-test/std_data/ndb_backup51/BACKUP-1.2.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data
deleted file mode 100644
index 267039d757e..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Data b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Data
deleted file mode 100644
index 9033c2735e1..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctl b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctl
deleted file mode 100644
index 30fd0a2dda1..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.log b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.log
deleted file mode 100644
index 39f7244b014..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctl b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctl
deleted file mode 100644
index 30fd0a2dda1..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.log b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.log
deleted file mode 100644
index 39f7244b014..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Data b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Data
deleted file mode 100644
index 45d4d536c02..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data
deleted file mode 100644
index 067fc6b716d..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctl b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctl
deleted file mode 100644
index 949b7d0be8b..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.log b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.log
deleted file mode 100644
index 3686d2718a2..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctl b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctl
deleted file mode 100644
index 949b7d0be8b..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctl
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.log b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.log
deleted file mode 100644
index 3686d2718a2..00000000000
--- a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/ndb_config_config.ini b/mysql-test/std_data/ndb_config_config.ini
deleted file mode 100644
index c325952d322..00000000000
--- a/mysql-test/std_data/ndb_config_config.ini
+++ /dev/null
@@ -1,55 +0,0 @@
-[ndbd default]
-NoOfReplicas= 2
-MaxNoOfConcurrentTransactions= 64
-MaxNoOfConcurrentOperations= 10000
-DataMemory= 20M
-IndexMemory= 1M
-Diskless= 0
-TimeBetweenWatchDogCheck= 30000
-DataDir= /data/msvensson/mysql/mysql-5.1-new-maint/mysql-test/var/ndbcluster-10095
-MaxNoOfOrderedIndexes= 32
-MaxNoOfAttributes= 2048
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 4
-FragmentLogFileSize=12M
-DiskPageBufferMemory= 4M
-# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
-#ODirect= 1
-# the following parametes just function as a small regression
-# test that the parameter exists
-InitialNoOfOpenFiles= 27
-
-#
-# Increase timeouts to cater for slow test-machines
-# (possibly running several tests in parallell)
-#
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-#TransactionDeadlockDetectionTimeout= 7500
-
-[ndbd]
-HostName= localhost
-
-[ndbd]
-HostName= localhost
-
-[ndb_mgmd]
-HostName= localhost
-DataDir= /data/msvensson/mysql/mysql-5.1-new-maint/mysql-test/var/ndbcluster-10095 #
-PortNumber= 10095
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
diff --git a/mysql-test/std_data/ndb_config_mycnf1.cnf b/mysql-test/std_data/ndb_config_mycnf1.cnf
deleted file mode 100644
index c680bfd8fa3..00000000000
--- a/mysql-test/std_data/ndb_config_mycnf1.cnf
+++ /dev/null
@@ -1,15 +0,0 @@
-[cluster_config]
-NoOfReplicas=1
-DataMemory=50M
-
-[cluster_config.jonas]
-IndexMemory=50M
-ndbd = localhost,localhost,localhost,localhost
-ndb_mgmd = localhost
-mysqld = localhost
-
-[cluster_config.ndbd.1]
-DataMemory=25M
-
-[cluster_config.ndbd.2.jonas]
-DataMemory=35M
diff --git a/mysql-test/std_data/ndb_config_mycnf2.cnf b/mysql-test/std_data/ndb_config_mycnf2.cnf
deleted file mode 100644
index 3bf6b9a1194..00000000000
--- a/mysql-test/std_data/ndb_config_mycnf2.cnf
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Testing automatic node id generation
-#
-[cluster_config]
-NoOfReplicas=2
-Signum=39
-
-[cluster_config.cluster0]
-ndbd = localhost,localhost,localhost,localhost
-ndb_mgmd = localhost
-mysqld = ,,,,
-
-[cluster_config.cluster1]
-ndbd = localhost,localhost,localhost,localhost
-ndb_mgmd = localhost
-mysqld = ,,,,
-[cluster_config.ndbd.1.cluster1]
-NodeId=2
-[cluster_config.mysqld.1.cluster1]
-NodeId=1
-
-[cluster_config.cluster2]
-ndbd = localhost,localhost,localhost,localhost
-ndb_mgmd = localhost,localhost
-mysqld = ,,,,
-[cluster_config.mysqld.1.cluster2]
-NodeId=11
-[cluster_config.ndb_mgmd.1.cluster2]
-NodeId=1
-[cluster_config.ndbd.1.cluster2]
-NodeId=3
diff --git a/mysql-test/std_data/server-cert.pem b/mysql-test/std_data/server-cert.pem
index 1cc1519ada9..b874f129ce3 100644
--- a/mysql-test/std_data/server-cert.pem
+++ b/mysql-test/std_data/server-cert.pem
@@ -2,25 +2,25 @@ Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1 (0x1)
- Signature Algorithm: sha1WithRSAEncryption
+ Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB
Validity
- Not Before: Apr 25 14:55:05 2015 GMT
- Not After : Apr 20 14:55:05 2035 GMT
+ Not Before: Apr 25 20:52:21 2017 GMT
+ Not After : Apr 20 20:52:21 2037 GMT
Subject: C=FI, ST=state or province within country, in other certificates in this file it is the same as L, L=location, usually an address but often ambiguously used, O=organization name, typically a company name, OU=organizational unit name, a division name within an organization, CN=localhost
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
- 00:aa:e6:54:bd:dd:52:1e:16:f7:24:52:37:58:2b:
- a7:af:49:e1:cd:75:2a:18:52:e1:48:f0:59:82:c0:
- 7a:d9:66:b3:97:04:b3:77:f4:39:fd:d1:c0:1a:c5:
- a6:ab:44:84:d2:17:39:53:25:63:9b:c3:24:78:51:
- 5c:77:6b:df:b4:82:1d:e4:43:f4:67:0a:5d:89:a2:
- fe:b0:ea:64:3a:1d:9d:49:78:c8:7f:79:a5:cd:45:
- 4b:0c:ad:ae:4f:e2:d4:5d:ec:e8:73:06:ed:98:92:
- 85:49:b2:9c:31:3b:44:38:5f:bb:5a:f1:68:84:a9:
- c3:5b:31:39:d4:47:98:38:55
+ 00:c9:fe:83:3f:0b:38:89:1d:43:15:93:5c:26:b9:
+ 80:65:41:bd:2f:63:66:5e:db:fa:33:20:d9:c7:e1:
+ 35:f3:14:3c:c8:b4:f7:09:d8:f5:b5:44:8f:6b:7e:
+ a0:a4:3b:45:5f:e6:f4:0f:08:67:f8:5a:4c:49:e4:
+ e5:39:31:69:8c:cf:25:78:93:a6:7f:58:e9:90:9c:
+ 61:cb:2e:14:b1:57:b2:15:9c:ea:8d:6f:96:20:fe:
+ 29:ed:2c:71:b8:4f:1f:e0:05:6c:04:b1:7e:e0:bc:
+ 42:8e:bf:95:5e:a9:5e:c9:c9:a4:64:c2:1f:59:94:
+ 14:c2:06:44:79:bc:d2:65:2d
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
@@ -28,47 +28,47 @@ Certificate:
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
- E5:72:8F:57:72:D6:75:63:28:7F:E2:BF:00:B7:1D:B8:AA:FE:94:59
+ CB:22:3B:E6:DA:B8:3D:7E:39:61:18:38:50:C8:4D:B4:C8:9A:3E:2B
X509v3 Authority Key Identifier:
- keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79
+ keyid:1C:C7:2B:AA:1B:B1:BB:2E:9A:F4:0F:B1:86:60:57:38:C2:41:05:12
- Signature Algorithm: sha1WithRSAEncryption
- 88:44:46:fa:7d:16:ae:9d:16:5b:95:26:03:3c:71:f4:29:3d:
- df:cb:f4:14:20:9f:87:24:b4:29:17:2d:7a:12:48:76:ac:00:
- 44:26:ba:93:83:ad:58:7e:b7:77:e4:b0:32:0d:e5:dd:fb:cc:
- 0e:9b:88:e0:24:82:e4:41:43:47:5a:4e:d3:b4:5b:47:4b:57:
- eb:67:02:63:bb:dd:05:12:f5:95:01:0b:89:81:ca:c2:91:14:
- 21:9a:9e:c9:84:91:46:35:0e:26:44:1e:91:88:74:4f:fe:d3:
- 19:9e:65:fa:46:e2:46:04:ad:91:79:4c:70:1b:68:b2:49:e9:
- 6c:f4:58:44:3b:43:15:85:56:64:1b:84:74:49:95:9f:cd:93:
- 9d:8e:69:ab:ca:46:97:b6:74:e9:2a:83:85:62:cd:e5:be:c3:
- 52:bd:cf:90:cc:60:27:76:ee:1b:3c:da:69:73:e2:11:68:14:
- dc:7d:9f:b8:6f:20:a2:0c:b7:8e:33:40:89:d1:a3:89:e2:60:
- 6a:ec:b5:9f:e8:c5:55:10:40:b2:95:5e:54:8a:10:8e:d5:90:
- d9:98:86:d8:f9:b6:01:41:8c:d7:0d:0e:86:0e:50:6d:a2:64:
- 00:2a:91:5e:35:64:15:e3:86:34:3a:39:eb:0f:4f:56:c7:15:
- 4c:74:2e:91
+ Signature Algorithm: sha256WithRSAEncryption
+ 8e:b7:3d:cc:2b:e5:27:49:49:5a:d4:3c:83:9b:2f:7d:11:de:
+ 6b:0f:b4:51:02:e4:37:d0:c4:b5:7b:4b:e3:42:93:75:32:d1:
+ eb:41:a2:27:fe:4d:91:ae:2b:a0:8b:3b:7f:e9:1b:47:85:73:
+ 9f:b7:05:74:34:eb:62:12:d8:f2:24:6a:b4:24:58:7a:6a:55:
+ 3e:ba:54:f9:51:de:54:0e:19:06:f6:01:23:32:0a:6c:81:e2:
+ 57:8a:9e:71:c5:ba:ca:c3:0f:18:d4:ef:54:4b:e1:ee:7c:3a:
+ f3:4d:c3:a3:44:21:9f:c8:ef:85:01:ab:fe:a9:7b:36:05:10:
+ 25:5e:61:b8:1d:7c:40:8a:5d:5b:c1:bb:7c:79:45:6e:84:63:
+ b5:3f:51:e9:9c:57:01:de:2d:1e:85:cb:83:f0:16:6d:78:bb:
+ 12:01:a5:e5:a2:a7:80:fa:54:8f:9a:5c:de:1c:52:a2:bd:00:
+ 49:e4:04:65:30:f9:b9:fc:4f:94:e2:d8:39:89:b6:a5:a5:2d:
+ db:25:a3:0d:5b:f9:e1:2a:13:19:5e:d7:1a:33:89:5b:ac:bd:
+ 29:26:da:1a:90:7e:08:19:dd:59:4b:50:fd:46:c3:0b:91:33:
+ 8b:c6:70:d1:22:18:37:a3:8b:d3:8f:f8:68:cf:38:8e:e1:ef:
+ ac:17:88:ca
-----BEGIN CERTIFICATE-----
-MIIEETCCAvmgAwIBAgIBATANBgkqhkiG9w0BAQUFADBWMQ8wDQYDVQQDDAZjYWNl
+MIIEETCCAvmgAwIBAgIBATANBgkqhkiG9w0BAQsFADBWMQ8wDQYDVQQDDAZjYWNl
cnQxCzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVs
-c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTUwNDI1MTQ1NTA1WhcNMzUwNDIw
-MTQ1NTA1WjCCAUcxCzAJBgNVBAYTAkZJMWEwXwYDVQQIDFhzdGF0ZSBvciBwcm92
+c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTcwNDI1MjA1MjIxWhcNMzcwNDIw
+MjA1MjIxWjCCAUcxCzAJBgNVBAYTAkZJMWEwXwYDVQQIDFhzdGF0ZSBvciBwcm92
aW5jZSB3aXRoaW4gY291bnRyeSwgaW4gb3RoZXIgY2VydGlmaWNhdGVzIGluIHRo
aXMgZmlsZSBpdCBpcyB0aGUgc2FtZSBhcyBMMUAwPgYDVQQHDDdsb2NhdGlvbiwg
dXN1YWxseSBhbiBhZGRyZXNzIGJ1dCBvZnRlbiBhbWJpZ3VvdXNseSB1c2VkMTQw
MgYDVQQKDCtvcmdhbml6YXRpb24gbmFtZSwgdHlwaWNhbGx5IGEgY29tcGFueSBu
YW1lMUkwRwYDVQQLDEBvcmdhbml6YXRpb25hbCB1bml0IG5hbWUsIGEgZGl2aXNp
b24gbmFtZSB3aXRoaW4gYW4gb3JnYW5pemF0aW9uMRIwEAYDVQQDDAlsb2NhbGhv
-c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKrmVL3dUh4W9yRSN1grp69J
-4c11KhhS4UjwWYLAetlms5cEs3f0Of3RwBrFpqtEhNIXOVMlY5vDJHhRXHdr37SC
-HeRD9GcKXYmi/rDqZDodnUl4yH95pc1FSwytrk/i1F3s6HMG7ZiShUmynDE7RDhf
-u1rxaISpw1sxOdRHmDhVAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgEN
-BB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBTlco9X
-ctZ1Yyh/4r8Atx24qv6UWTAfBgNVHSMEGDAWgBTHLAGVGvU+zQSmJDU1BNmnFgEq
-eTANBgkqhkiG9w0BAQUFAAOCAQEAiERG+n0Wrp0WW5UmAzxx9Ck938v0FCCfhyS0
-KRctehJIdqwARCa6k4OtWH63d+SwMg3l3fvMDpuI4CSC5EFDR1pO07RbR0tX62cC
-Y7vdBRL1lQELiYHKwpEUIZqeyYSRRjUOJkQekYh0T/7TGZ5l+kbiRgStkXlMcBto
-sknpbPRYRDtDFYVWZBuEdEmVn82TnY5pq8pGl7Z06SqDhWLN5b7DUr3PkMxgJ3bu
-GzzaaXPiEWgU3H2fuG8gogy3jjNAidGjieJgauy1n+jFVRBAspVeVIoQjtWQ2ZiG
-2Pm2AUGM1w0Ohg5QbaJkACqRXjVkFeOGNDo56w9PVscVTHQukQ==
+c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMn+gz8LOIkdQxWTXCa5gGVB
+vS9jZl7b+jMg2cfhNfMUPMi09wnY9bVEj2t+oKQ7RV/m9A8IZ/haTEnk5TkxaYzP
+JXiTpn9Y6ZCcYcsuFLFXshWc6o1vliD+Ke0scbhPH+AFbASxfuC8Qo6/lV6pXsnJ
+pGTCH1mUFMIGRHm80mUtAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgEN
+BB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBTLIjvm
+2rg9fjlhGDhQyE20yJo+KzAfBgNVHSMEGDAWgBQcxyuqG7G7Lpr0D7GGYFc4wkEF
+EjANBgkqhkiG9w0BAQsFAAOCAQEAjrc9zCvlJ0lJWtQ8g5svfRHeaw+0UQLkN9DE
+tXtL40KTdTLR60GiJ/5Nka4roIs7f+kbR4Vzn7cFdDTrYhLY8iRqtCRYempVPrpU
++VHeVA4ZBvYBIzIKbIHiV4qeccW6ysMPGNTvVEvh7nw6803Do0Qhn8jvhQGr/ql7
+NgUQJV5huB18QIpdW8G7fHlFboRjtT9R6ZxXAd4tHoXLg/AWbXi7EgGl5aKngPpU
+j5pc3hxSor0ASeQEZTD5ufxPlOLYOYm2paUt2yWjDVv54SoTGV7XGjOJW6y9KSba
+GpB+CBndWUtQ/UbDC5Ezi8Zw0SIYN6OL04/4aM84juHvrBeIyg==
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server-key.pem b/mysql-test/std_data/server-key.pem
index 3125ae88a8a..feb7fbaf535 100644
--- a/mysql-test/std_data/server-key.pem
+++ b/mysql-test/std_data/server-key.pem
@@ -1,15 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQCq5lS93VIeFvckUjdYK6evSeHNdSoYUuFI8FmCwHrZZrOXBLN3
-9Dn90cAaxaarRITSFzlTJWObwyR4UVx3a9+0gh3kQ/RnCl2Jov6w6mQ6HZ1JeMh/
-eaXNRUsMra5P4tRd7OhzBu2YkoVJspwxO0Q4X7ta8WiEqcNbMTnUR5g4VQIDAQAB
-AoGAblQWXyBzdBN1Z5BgRF6ieYpj6OT70QoogJMR5lRmutUPma4iQo17pr3znBT/
-nU+1w3/UtTXNEXCwqbA01q/gkbP2PaW/sbHLVow1B7u/o42WW6I3Btnl3ClnCNjD
-Mo7/Gj027hhp7mC61r81JeJVh8fJUgxdNqoH7AkDnA+FJAECQQDjIl3k6W2P+bHb
-bp+8eyY7ITQbppZh+3hFJKRL7DZKFYL5J6gejiBURnG9DKnhoSP2nqzqdrRhWZhB
-ZHr+ciEBAkEAwJ5rMpFoIwRzgPD4Q4iSqHcBbFcJE7dK1XLq6MYUVNQGfDU8pBvI
-EocXphpsJ8CbR35dGDY19rmO2LjG3RBDVQJAetRN9Inrjw2YCjNzvKjYTuew1zcq
-YghszO94zfoKjdu+PWEdwJBZmVmTDoo3oGXVHfxHRHA3MeISvWJKRSmRAQJAHL9H
-9msXJKrEZkkQdFvMr5HbR4UR2LxxUbvt7UGqxSJDuYPkggWXbZR15hdpbuFjC1+D
-m1pz4Ve+RwAExfdoZQJBANfmuWtlLU+SMpDG4zOyC7u4dz+TtnEOfDUECFNZtqvU
-MWz98MIXAjiBDYU1Z0BrA7b0/FVsPR3t6JZFQWWI2y8=
+MIICXQIBAAKBgQDJ/oM/CziJHUMVk1wmuYBlQb0vY2Ze2/ozINnH4TXzFDzItPcJ
+2PW1RI9rfqCkO0Vf5vQPCGf4WkxJ5OU5MWmMzyV4k6Z/WOmQnGHLLhSxV7IVnOqN
+b5Yg/intLHG4Tx/gBWwEsX7gvEKOv5VeqV7JyaRkwh9ZlBTCBkR5vNJlLQIDAQAB
+AoGAZzoeMJW3arr9kYUhTtj1+MlDuXf+1PNuRbrAERnSzErHVXrF1M5/owdKlBC+
+X6+6oGwSxavyFkVvP0QusK/D1DxSs60Mk1p3Ax5nVpNYiBdeBULcYiXCSUbKItYL
+vzyECIc02t+auWf/wp3Wy3g6sU6FoT2QCPSsy0qRC48VBzECQQD79P9w0XjJGk8y
+3zPc4JOr3a1UUu4VLjFdFDR2eZZRE02NcXfLHE0+Idk3TYnNDRLoWDJjdfZ0thZZ
+KuJ58wIDAkEAzTxGYmT/aieDC3G8sHMqLUvjN30TfTocv7mWlpxWo7zbRbQm7jsB
+S5weRKtu3yVmdb6rW+5IZSCazc/j4T5tDwJAUgDRSpTCrSFE+Zevt4nYRi2mBjXf
+i0E3i8XRtWWpSMXxjcGKba7ObRRzMA6qdPR2XOynqbtw9Vd2Ops8jthKpQJBAJJm
+8tZxsXlqIiLhyXYdUPLq9XS5tlNYRvXFT9S0RWGb8NbyQesjEDN9dGIL4JUxurs3
+fkmf2ui4r3UtXSNqQqUCQQDjatAhBdibh5UawO5VpI87OJMzATCkY/mX3R+TnbOm
+MkdydjF022P0M4N24DiM+2nBTDp+F45LwtQLa4vmB2No
-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem
index 7e41195cea4..df27c77e8e0 100644
--- a/mysql-test/std_data/server8k-cert.pem
+++ b/mysql-test/std_data/server8k-cert.pem
@@ -2,85 +2,85 @@ Certificate:
Data:
Version: 3 (0x2)
Serial Number: 2 (0x2)
- Signature Algorithm: sha1WithRSAEncryption
+ Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB
Validity
- Not Before: Apr 25 14:55:16 2015 GMT
- Not After : Apr 20 14:55:16 2035 GMT
+ Not Before: Apr 25 20:52:33 2017 GMT
+ Not After : Apr 20 20:52:33 2037 GMT
Subject: C=FI, ST=Helsinki, L=Helsinki, O=MariaDB, CN=server8k
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (8192 bit)
Modulus:
- 00:e6:24:79:3d:3a:58:6a:12:1c:13:6a:43:d9:c1:
- 65:ec:55:c1:4f:7d:fc:f2:a6:56:a5:ab:c5:48:2c:
- ce:9c:9d:47:3d:94:93:d5:3b:a3:d0:09:a8:8f:e0:
- 4b:36:a0:95:ae:2d:ad:7f:a2:a3:c5:f6:87:80:4c:
- 6a:26:15:47:73:20:47:e1:f8:5f:49:b7:13:20:f7:
- 32:9f:db:7d:62:41:1b:60:26:7b:41:26:16:0c:92:
- 22:ef:b4:2e:b3:db:90:e9:09:ca:fe:1a:1b:e4:f3:
- 78:69:7d:ca:6e:c5:39:4b:46:72:09:51:08:40:78:
- 8e:04:2a:23:cb:d5:50:cf:96:dd:56:43:10:1b:d2:
- 71:28:8f:10:a9:e4:44:1c:39:8a:06:a7:fa:37:48:
- bd:5a:dd:37:7f:7a:00:cf:84:8a:48:a3:75:a5:67:
- fb:7b:47:2d:26:00:2e:65:ed:63:4e:b7:94:18:3f:
- 5a:08:74:54:e5:af:dd:86:1b:34:9b:4c:de:fe:d8:
- 69:3d:72:90:c7:5c:83:82:78:ea:ab:06:d4:f1:06:
- 20:ad:fd:24:bb:e9:94:e0:c6:32:f5:df:af:b4:14:
- 4d:9c:ce:0d:62:3a:3a:2b:11:f9:9e:d7:8e:63:2b:
- 57:35:10:7e:d5:44:64:8c:61:9b:4e:f8:e8:a5:fb:
- 47:bb:85:33:ea:c6:e0:3d:e2:2c:e8:41:e1:15:e2:
- a7:45:23:df:d0:f9:93:01:97:89:95:77:4d:d5:d4:
- c1:db:61:ca:e2:84:36:9c:01:9b:33:ec:53:83:2f:
- dd:d7:d8:20:c0:6b:4a:73:92:d2:6c:22:a6:a2:68:
- 46:8b:aa:3f:aa:fe:47:b7:98:70:fd:ba:59:88:af:
- 9f:0d:d7:cb:a0:42:44:f9:f0:54:39:c1:cd:fb:b4:
- e4:c6:d6:7e:1d:f5:ed:b9:1a:0f:d7:e6:a2:ab:a2:
- 25:1f:6c:f9:ab:9c:d8:a3:b9:da:32:72:51:6d:61:
- f1:3b:7d:06:2b:3d:43:d5:52:1f:cb:62:14:53:69:
- 4d:91:12:22:f0:55:f9:fc:4f:de:ee:e3:fc:fd:40:
- 57:50:eb:0e:7a:45:cc:52:0f:24:6f:45:02:72:6b:
- 6d:90:94:1c:d4:fb:34:f6:4b:4d:25:17:6f:df:4a:
- 64:f8:ad:1e:6e:df:ad:6c:b3:1d:1a:e6:0e:59:7b:
- f8:a7:13:77:78:85:bf:3f:7c:12:d4:8e:34:ff:01:
- 90:03:42:85:60:e4:99:d6:19:32:46:41:e8:50:ca:
- 2a:03:61:cd:c5:68:f4:92:0f:6e:48:89:41:9e:53:
- bc:41:62:ed:4a:92:64:b5:cb:3d:55:6c:d9:87:87:
- 9a:ab:fc:22:50:66:92:2b:b9:d7:9e:3b:ed:80:e3:
- fa:19:69:38:87:b6:25:3a:db:b5:d0:f2:80:4d:af:
- 6d:7d:92:90:de:aa:df:be:80:26:1c:69:ee:7a:e3:
- 45:c9:a4:4e:6a:e0:56:5f:1f:61:44:3f:62:34:c9:
- 1e:21:5f:f6:7f:68:c0:6e:bf:d2:35:1e:53:99:e4:
- e1:bd:64:a4:49:3c:c3:ce:b6:e8:a9:3d:27:54:ea:
- f1:3e:a1:fc:7b:bf:8d:71:60:90:c5:66:24:85:de:
- 7d:47:1f:62:83:e2:63:8e:10:5c:14:cd:d0:7e:86:
- 44:4d:df:05:10:43:b8:3c:87:64:69:ec:ea:fb:49:
- 9a:c6:76:c1:8f:ea:49:98:0a:d3:97:af:64:ef:da:
- 5f:a9:57:03:e3:a0:15:d8:68:c5:40:d8:7b:0f:26:
- 0d:5f:f0:be:5a:4c:fd:af:9e:bf:2d:31:40:71:25:
- de:d0:73:19:2d:ae:a6:cb:7c:f0:b8:a4:a9:5c:50:
- 80:41:4e:dc:f7:20:a4:a6:66:65:fb:92:d1:43:2d:
- bf:30:b2:0d:db:9b:a3:ac:28:08:c4:81:99:0c:0d:
- 45:e9:a9:e5:6c:da:bf:10:bb:a7:3e:5a:5f:b7:93:
- 4a:20:15:29:69:74:78:d1:eb:53:a8:88:49:cb:de:
- 0c:e2:9b:31:e2:2f:56:95:cf:55:92:a3:8e:a9:ef:
- 68:cb:00:11:d4:71:06:4b:e5:89:0c:b6:e7:2b:2f:
- 98:65:21:8e:2a:a3:86:73:bb:1b:76:e1:94:02:d8:
- a1:51:97:15:60:a2:39:d5:fd:dc:a8:be:30:12:44:
- b1:49:0b:94:82:cf:5f:93:61:1c:3c:eb:05:5b:a4:
- 17:ee:30:cd:7c:db:3f:ee:79:02:da:14:20:98:fd:
- 9a:0a:f1:39:c8:59:5b:4e:a3:ad:f8:04:e6:0b:b6:
- 81:7e:41:00:af:f7:37:ec:6e:bc:28:a3:3d:76:b6:
- fd:e9:88:c7:1e:78:79:27:62:a2:83:34:15:61:b8:
- e4:c3:ac:f5:7f:3e:4e:5f:5f:31:5b:e8:91:1b:80:
- 5e:cb:74:b2:e5:a3:8a:d5:5a:89:fa:63:f1:ff:67:
- bd:59:d0:70:77:b7:75:b5:34:74:3d:2e:99:46:0b:
- 4b:c4:64:2f:93:48:fe:47:92:6a:0b:42:5e:ef:c9:
- 06:64:84:60:89:2b:84:1f:31:0d:36:15:4e:6b:cd:
- 14:f7:a0:d1:b2:b8:ff:53:f5:aa:b9:ed:63:50:7a:
- 6f:62:e7:c7:7f:bc:f5:e2:0c:f8:28:a4:0d:ba:75:
- d0:b8:c7:9b:e3:94:62:66:1c:d8:6c:02:2e:a5:a2:
- 62:50:fe:cf:31
+ 00:b3:a7:81:cf:a3:9b:3c:57:2a:8e:de:13:08:a6:
+ 15:6a:68:08:ce:a1:a0:ef:fc:32:95:5a:9a:b5:cc:
+ 84:bb:a3:15:a0:fc:29:bb:71:0e:f3:40:20:97:35:
+ 92:92:89:36:6a:5f:be:a5:24:5a:c8:0e:f7:53:a8:
+ e0:74:05:90:38:21:a5:25:72:2b:56:70:74:aa:d6:
+ 30:25:e0:95:dd:3d:4a:48:4b:25:a7:a8:c4:eb:e5:
+ d6:10:4f:95:42:91:b0:cb:68:2f:bf:96:0f:0a:9b:
+ 2b:01:0d:03:ae:3f:b7:7e:f6:1e:c1:14:42:04:7f:
+ 09:21:e8:3e:87:c0:b3:d7:dd:4f:7e:95:b6:83:33:
+ 8f:cc:f4:bb:11:8e:66:5f:b4:32:22:8b:8e:34:93:
+ 82:0f:02:d1:6f:85:b2:a7:7e:36:0c:f3:0d:91:46:
+ f9:a5:91:dc:60:4a:0d:eb:e5:37:e3:76:d8:13:bb:
+ 55:33:23:4c:b3:90:df:6a:b6:80:3d:f6:bd:9d:bd:
+ ef:d3:8d:7a:9a:61:ac:02:3d:10:b5:c2:53:d2:7e:
+ ee:1c:90:a5:b0:e8:db:71:8f:d3:53:e4:80:b0:b6:
+ cc:b0:f2:eb:46:c3:d9:3c:48:01:1d:3a:5c:d0:f2:
+ 17:9c:9a:8e:fc:2a:36:e7:1c:59:41:66:ad:e1:d3:
+ 82:d8:95:ee:ae:dc:ab:72:94:cb:0b:8a:df:ef:70:
+ f7:f9:e2:77:76:64:67:2d:02:dc:1a:db:02:e9:5e:
+ 63:3f:3e:07:e9:65:e4:02:78:62:55:e1:52:18:5a:
+ a3:9c:56:dd:cd:d3:f7:f2:55:45:62:20:ce:fd:41:
+ 93:b9:c2:20:90:23:a4:41:4f:30:5c:5e:a0:97:6f:
+ a4:1f:87:6a:97:87:70:f9:d5:56:b7:6a:cc:f1:28:
+ d2:26:34:57:65:9c:2d:41:43:8b:6c:bd:15:6f:ec:
+ ce:3e:9f:4d:2f:a6:21:d8:f7:4d:d1:63:4f:f0:9e:
+ 04:c3:82:33:58:34:20:4b:81:0d:42:0d:44:62:48:
+ 1b:4c:cf:e0:69:e4:c8:f8:9c:98:1f:74:37:3a:3f:
+ 23:40:3a:88:80:c2:9c:9b:ba:6a:b9:2c:3a:67:a6:
+ b6:5c:83:fd:93:3f:6e:53:19:48:e3:3d:fa:f5:8e:
+ 03:40:8f:e6:af:c5:de:aa:f8:70:77:36:2b:6e:3a:
+ df:bc:d7:f6:c7:4f:02:7f:a1:ad:2f:3c:e9:08:45:
+ 2f:57:1a:f1:5b:9c:27:07:3a:44:43:3e:05:b1:4a:
+ 1b:42:a4:90:ab:ce:4b:f7:c1:9b:d7:dd:6f:05:11:
+ f9:e8:a3:a1:99:6c:2e:27:3d:b1:54:6f:eb:b2:e8:
+ f8:e6:12:6f:8a:69:05:cc:c6:f6:c4:2d:b0:06:b6:
+ 21:50:28:50:dc:8c:b2:8c:65:ce:d9:2b:51:b8:62:
+ 56:70:b4:46:4d:e4:4c:a1:86:31:3d:e3:07:7f:73:
+ e3:09:6e:ee:a7:29:2a:80:23:8a:b6:0c:22:9e:43:
+ 1c:a9:8c:47:2c:02:6d:13:ef:88:a7:d7:d1:60:d9:
+ 6b:28:80:97:8a:b7:ff:62:6b:28:54:0d:ab:63:3a:
+ ac:57:9e:2f:95:2b:f4:a0:3d:a1:60:a0:57:1a:09:
+ 23:ee:fc:4d:9b:45:83:f2:0a:1f:b3:77:0e:98:20:
+ b3:16:fc:97:03:30:fc:ab:3e:7e:fc:3e:76:64:cb:
+ 4b:4d:c9:6c:8f:aa:70:ec:03:c5:81:31:43:11:9a:
+ fc:2d:ba:25:94:0b:73:7e:c1:39:01:ca:68:70:1a:
+ ef:a4:ba:dc:13:d6:37:17:09:0d:ca:aa:21:94:bb:
+ 3e:43:fd:8c:80:e6:58:fd:75:23:5a:ca:1f:0b:2e:
+ 35:c2:cd:77:0c:73:b3:2f:9a:e4:03:68:58:c8:3f:
+ f3:76:8d:05:53:d2:34:db:09:af:70:ed:67:0b:ff:
+ 2f:64:35:2d:71:22:7a:f2:f2:2b:7d:6d:be:80:bd:
+ 18:38:37:01:67:a4:5f:48:29:52:78:9f:b5:b8:80:
+ 70:ca:10:6a:e1:27:3b:c0:61:4e:96:f8:e8:0f:42:
+ b1:fa:bc:05:ef:31:91:38:ab:0f:a7:ef:2c:86:c1:
+ ab:85:36:7c:10:9d:c7:0a:6b:e6:2b:11:dd:fa:45:
+ e7:d2:c3:3a:c1:cd:60:27:68:26:d7:87:49:5f:e3:
+ 7f:26:20:1f:99:a8:f9:00:a6:0d:d5:13:81:6e:fc:
+ 27:8a:03:58:6b:0e:3a:c7:20:a1:5c:24:d1:08:a6:
+ 5a:1e:e7:81:3d:21:05:2e:4b:5d:18:14:f1:4f:ab:
+ 5c:e5:81:da:c1:2c:f6:12:ff:25:09:97:1e:9d:51:
+ 6d:1f:63:2e:9c:ed:7d:86:45:b0:35:73:f6:9f:82:
+ 65:bc:7f:46:88:e1:a1:60:a1:37:50:26:9c:d7:76:
+ f3:dc:94:89:6d:d7:be:a6:17:a1:2b:71:14:37:17:
+ 5f:ed:5a:39:99:fc:69:af:bb:63:55:c6:60:7b:64:
+ d8:bb:b7:4a:9f:b9:aa:89:4b:30:1f:9c:ef:23:7a:
+ af:7e:31:dd:fb:dd:0a:d5:04:0a:8c:57:6f:64:80:
+ eb:f3:ee:6c:33:d2:72:c2:24:68:a2:4e:99:88:1c:
+ f7:3b:5d:10:cc:4e:ea:a5:cb:00:40:8a:a9:63:2e:
+ 18:92:eb:b1:28:05:fe:19:ea:7b:32:fb:63:56:2c:
+ 0b:20:01:92:a3
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
@@ -88,61 +88,61 @@ Certificate:
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
- B3:A9:00:04:C7:9C:2B:CD:C0:5F:D1:28:5C:5C:C6:1F:26:F7:17:5A
+ 43:3B:26:15:A5:60:62:3F:07:2A:8C:8C:DA:F8:74:BE:36:B2:33:E4
X509v3 Authority Key Identifier:
- keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79
+ keyid:1C:C7:2B:AA:1B:B1:BB:2E:9A:F4:0F:B1:86:60:57:38:C2:41:05:12
- Signature Algorithm: sha1WithRSAEncryption
- 01:43:2c:d5:1d:b5:36:05:31:ca:b2:f3:9e:71:ce:62:fe:b2:
- e5:e3:2d:30:23:99:51:3d:50:ee:d6:ce:76:e8:43:8d:5d:9d:
- 28:9b:43:90:0c:d4:24:54:3c:53:3c:18:92:ec:93:86:87:7a:
- d6:7f:5d:3b:56:cd:9d:96:7a:06:c8:16:19:8b:ed:c8:21:cf:
- 15:b9:fb:06:7d:cb:5c:46:9c:c5:2e:8e:de:77:21:e5:9d:35:
- 95:00:c7:ad:d2:57:36:65:1a:43:6c:ee:75:ad:a2:d8:c0:60:
- d5:07:d7:5c:5d:8e:ae:af:4a:e6:fa:6a:13:78:98:b8:11:c7:
- dc:d2:a7:dd:29:b5:76:fa:ef:13:62:5f:9a:0d:e2:87:6a:04:
- 3c:5f:72:44:d0:d0:7a:70:c6:09:2b:bf:92:91:6d:f4:2e:53:
- f3:b4:c5:23:61:d6:87:c1:30:ef:fe:92:6f:97:78:f2:ea:3c:
- ff:e8:54:3a:9f:49:ac:a9:2b:46:c3:76:b1:f9:eb:31:a3:4f:
- 40:58:16:90:77:b6:3d:6f:85:95:12:a9:ca:70:0a:9a:cd:61:
- 46:27:84:ce:9e:33:54:8f:9a:41:6d:4d:11:bd:14:7f:ff:32:
- e9:06:bc:36:38:11:5c:0f:e9:a5:5a:0f:5c:7c:fa:f5:73:5b:
- 4c:47:f2:f2
+ Signature Algorithm: sha256WithRSAEncryption
+ 5c:c7:4e:56:eb:21:1b:f3:5d:c4:56:fa:bf:6d:e1:0d:fa:cc:
+ b0:7c:13:58:b9:d4:47:b3:de:b4:ae:f2:45:02:88:65:43:89:
+ cf:ea:9c:d0:ea:45:42:35:d2:ec:bc:b4:73:03:db:85:7b:c7:
+ f0:68:d7:dc:2b:70:71:63:ed:33:68:9f:29:ff:67:0a:69:3b:
+ c4:65:7c:25:00:cf:7f:ee:aa:fe:44:19:70:f2:74:db:da:9f:
+ 52:92:1a:03:e6:0a:49:85:2e:2a:02:c1:81:d4:6d:cf:98:d1:
+ e9:6a:2f:bb:fa:a6:d5:4b:55:38:c2:aa:8c:f5:d3:f9:e6:74:
+ db:00:d6:29:f9:d1:9c:7a:0e:98:c5:e5:8c:16:49:d8:cf:ee:
+ a0:cb:c2:2c:31:cf:62:2c:b1:7f:6d:60:b0:ce:d5:07:45:e8:
+ 44:17:7c:c4:12:fb:00:57:24:57:e8:17:78:3b:1e:0d:91:aa:
+ 67:98:d0:e5:9a:86:4b:88:4a:2f:55:5d:2e:13:ec:f5:4a:7d:
+ e7:13:a7:57:03:41:2f:f6:6c:08:8e:58:ef:b0:7a:79:32:e3:
+ bb:4b:eb:4d:42:cd:42:96:2d:67:f6:4c:c1:f6:62:fb:c0:3e:
+ 09:69:8f:36:7e:fa:c8:cd:ff:72:3e:df:92:f7:8f:44:cf:77:
+ fe:6e:74:de
-----BEGIN CERTIFICATE-----
-MIIGpDCCBYygAwIBAgIBAjANBgkqhkiG9w0BAQUFADBWMQ8wDQYDVQQDDAZjYWNl
+MIIGpDCCBYygAwIBAgIBAjANBgkqhkiG9w0BAQsFADBWMQ8wDQYDVQQDDAZjYWNl
cnQxCzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVs
-c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTUwNDI1MTQ1NTE2WhcNMzUwNDIw
-MTQ1NTE2WjBYMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV
+c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTcwNDI1MjA1MjMzWhcNMzcwNDIw
+MjA1MjMzWjBYMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV
BAcMCEhlbHNpbmtpMRAwDgYDVQQKDAdNYXJpYURCMREwDwYDVQQDDAhzZXJ2ZXI4
-azCCBCIwDQYJKoZIhvcNAQEBBQADggQPADCCBAoCggQBAOYkeT06WGoSHBNqQ9nB
-ZexVwU99/PKmVqWrxUgszpydRz2Uk9U7o9AJqI/gSzagla4trX+io8X2h4BMaiYV
-R3MgR+H4X0m3EyD3Mp/bfWJBG2Ame0EmFgySIu+0LrPbkOkJyv4aG+TzeGl9ym7F
-OUtGcglRCEB4jgQqI8vVUM+W3VZDEBvScSiPEKnkRBw5igan+jdIvVrdN396AM+E
-ikijdaVn+3tHLSYALmXtY063lBg/Wgh0VOWv3YYbNJtM3v7YaT1ykMdcg4J46qsG
-1PEGIK39JLvplODGMvXfr7QUTZzODWI6OisR+Z7XjmMrVzUQftVEZIxhm0746KX7
-R7uFM+rG4D3iLOhB4RXip0Uj39D5kwGXiZV3TdXUwdthyuKENpwBmzPsU4Mv3dfY
-IMBrSnOS0mwipqJoRouqP6r+R7eYcP26WYivnw3Xy6BCRPnwVDnBzfu05MbWfh31
-7bkaD9fmoquiJR9s+auc2KO52jJyUW1h8Tt9Bis9Q9VSH8tiFFNpTZESIvBV+fxP
-3u7j/P1AV1DrDnpFzFIPJG9FAnJrbZCUHNT7NPZLTSUXb99KZPitHm7frWyzHRrm
-Dll7+KcTd3iFvz98EtSONP8BkANChWDkmdYZMkZB6FDKKgNhzcVo9JIPbkiJQZ5T
-vEFi7UqSZLXLPVVs2YeHmqv8IlBmkiu515477YDj+hlpOIe2JTrbtdDygE2vbX2S
-kN6q376AJhxp7nrjRcmkTmrgVl8fYUQ/YjTJHiFf9n9owG6/0jUeU5nk4b1kpEk8
-w8626Kk9J1Tq8T6h/Hu/jXFgkMVmJIXefUcfYoPiY44QXBTN0H6GRE3fBRBDuDyH
-ZGns6vtJmsZ2wY/qSZgK05evZO/aX6lXA+OgFdhoxUDYew8mDV/wvlpM/a+evy0x
-QHEl3tBzGS2upst88LikqVxQgEFO3PcgpKZmZfuS0UMtvzCyDdubo6woCMSBmQwN
-Remp5WzavxC7pz5aX7eTSiAVKWl0eNHrU6iIScveDOKbMeIvVpXPVZKjjqnvaMsA
-EdRxBkvliQy25ysvmGUhjiqjhnO7G3bhlALYoVGXFWCiOdX93Ki+MBJEsUkLlILP
-X5NhHDzrBVukF+4wzXzbP+55AtoUIJj9mgrxOchZW06jrfgE5gu2gX5BAK/3N+xu
-vCijPXa2/emIxx54eSdiooM0FWG45MOs9X8+Tl9fMVvokRuAXst0suWjitVaifpj
-8f9nvVnQcHe3dbU0dD0umUYLS8RkL5NI/keSagtCXu/JBmSEYIkrhB8xDTYVTmvN
-FPeg0bK4/1P1qrntY1B6b2Lnx3+89eIM+CikDbp10LjHm+OUYmYc2GwCLqWiYlD+
-zzECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBH
-ZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFLOpAATHnCvNwF/RKFxcxh8m
-9xdaMB8GA1UdIwQYMBaAFMcsAZUa9T7NBKYkNTUE2acWASp5MA0GCSqGSIb3DQEB
-BQUAA4IBAQABQyzVHbU2BTHKsvOecc5i/rLl4y0wI5lRPVDu1s526EONXZ0om0OQ
-DNQkVDxTPBiS7JOGh3rWf107Vs2dlnoGyBYZi+3IIc8VufsGfctcRpzFLo7edyHl
-nTWVAMet0lc2ZRpDbO51raLYwGDVB9dcXY6ur0rm+moTeJi4Ecfc0qfdKbV2+u8T
-Yl+aDeKHagQ8X3JE0NB6cMYJK7+SkW30LlPztMUjYdaHwTDv/pJvl3jy6jz/6FQ6
-n0msqStGw3ax+esxo09AWBaQd7Y9b4WVEqnKcAqazWFGJ4TOnjNUj5pBbU0RvRR/
-/zLpBrw2OBFcD+mlWg9cfPr1c1tMR/Ly
+azCCBCIwDQYJKoZIhvcNAQEBBQADggQPADCCBAoCggQBALOngc+jmzxXKo7eEwim
+FWpoCM6hoO/8MpVamrXMhLujFaD8KbtxDvNAIJc1kpKJNmpfvqUkWsgO91Oo4HQF
+kDghpSVyK1ZwdKrWMCXgld09SkhLJaeoxOvl1hBPlUKRsMtoL7+WDwqbKwENA64/
+t372HsEUQgR/CSHoPofAs9fdT36VtoMzj8z0uxGOZl+0MiKLjjSTgg8C0W+Fsqd+
+NgzzDZFG+aWR3GBKDevlN+N22BO7VTMjTLOQ32q2gD32vZ2979ONepphrAI9ELXC
+U9J+7hyQpbDo23GP01PkgLC2zLDy60bD2TxIAR06XNDyF5yajvwqNuccWUFmreHT
+gtiV7q7cq3KUywuK3+9w9/nid3ZkZy0C3BrbAuleYz8+B+ll5AJ4YlXhUhhao5xW
+3c3T9/JVRWIgzv1Bk7nCIJAjpEFPMFxeoJdvpB+HapeHcPnVVrdqzPEo0iY0V2Wc
+LUFDi2y9FW/szj6fTS+mIdj3TdFjT/CeBMOCM1g0IEuBDUINRGJIG0zP4GnkyPic
+mB90Nzo/I0A6iIDCnJu6arksOmemtlyD/ZM/blMZSOM9+vWOA0CP5q/F3qr4cHc2
+K24637zX9sdPAn+hrS886QhFL1ca8VucJwc6REM+BbFKG0KkkKvOS/fBm9fdbwUR
++eijoZlsLic9sVRv67Lo+OYSb4ppBczG9sQtsAa2IVAoUNyMsoxlztkrUbhiVnC0
+Rk3kTKGGMT3jB39z4wlu7qcpKoAjirYMIp5DHKmMRywCbRPviKfX0WDZayiAl4q3
+/2JrKFQNq2M6rFeeL5Ur9KA9oWCgVxoJI+78TZtFg/IKH7N3Dpggsxb8lwMw/Ks+
+fvw+dmTLS03JbI+qcOwDxYExQxGa/C26JZQLc37BOQHKaHAa76S63BPWNxcJDcqq
+IZS7PkP9jIDmWP11I1rKHwsuNcLNdwxzsy+a5ANoWMg/83aNBVPSNNsJr3DtZwv/
+L2Q1LXEievLyK31tvoC9GDg3AWekX0gpUniftbiAcMoQauEnO8BhTpb46A9Csfq8
+Be8xkTirD6fvLIbBq4U2fBCdxwpr5isR3fpF59LDOsHNYCdoJteHSV/jfyYgH5mo
++QCmDdUTgW78J4oDWGsOOscgoVwk0QimWh7ngT0hBS5LXRgU8U+rXOWB2sEs9hL/
+JQmXHp1RbR9jLpztfYZFsDVz9p+CZbx/RojhoWChN1AmnNd289yUiW3XvqYXoStx
+FDcXX+1aOZn8aa+7Y1XGYHtk2Lu3Sp+5qolLMB+c7yN6r34x3fvdCtUECoxXb2SA
+6/PubDPScsIkaKJOmYgc9ztdEMxO6qXLAECKqWMuGJLrsSgF/hnqezL7Y1YsCyAB
+kqMCAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBH
+ZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFEM7JhWlYGI/ByqMjNr4dL42
+sjPkMB8GA1UdIwQYMBaAFBzHK6obsbsumvQPsYZgVzjCQQUSMA0GCSqGSIb3DQEB
+CwUAA4IBAQBcx05W6yEb813EVvq/beEN+sywfBNYudRHs960rvJFAohlQ4nP6pzQ
+6kVCNdLsvLRzA9uFe8fwaNfcK3BxY+0zaJ8p/2cKaTvEZXwlAM9/7qr+RBlw8nTb
+2p9SkhoD5gpJhS4qAsGB1G3PmNHpai+7+qbVS1U4wqqM9dP55nTbANYp+dGceg6Y
+xeWMFknYz+6gy8IsMc9iLLF/bWCwztUHRehEF3zEEvsAVyRX6Bd4Ox4NkapnmNDl
+moZLiEovVV0uE+z1Sn3nE6dXA0Ev9mwIjljvsHp5MuO7S+tNQs1Cli1n9kzB9mL7
+wD4JaY82fvrIzf9yPt+S949Ez3f+bnTe
-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem
index 72d2756477c..a383b359275 100644
--- a/mysql-test/std_data/server8k-key.pem
+++ b/mysql-test/std_data/server8k-key.pem
@@ -1,99 +1,99 @@
-----BEGIN RSA PRIVATE KEY-----
-MIISKgIBAAKCBAEA5iR5PTpYahIcE2pD2cFl7FXBT3388qZWpavFSCzOnJ1HPZST
-1Tuj0Amoj+BLNqCVri2tf6KjxfaHgExqJhVHcyBH4fhfSbcTIPcyn9t9YkEbYCZ7
-QSYWDJIi77Qus9uQ6QnK/hob5PN4aX3KbsU5S0ZyCVEIQHiOBCojy9VQz5bdVkMQ
-G9JxKI8QqeREHDmKBqf6N0i9Wt03f3oAz4SKSKN1pWf7e0ctJgAuZe1jTreUGD9a
-CHRU5a/dhhs0m0ze/thpPXKQx1yDgnjqqwbU8QYgrf0ku+mU4MYy9d+vtBRNnM4N
-Yjo6KxH5nteOYytXNRB+1URkjGGbTvjopftHu4Uz6sbgPeIs6EHhFeKnRSPf0PmT
-AZeJlXdN1dTB22HK4oQ2nAGbM+xTgy/d19ggwGtKc5LSbCKmomhGi6o/qv5Ht5hw
-/bpZiK+fDdfLoEJE+fBUOcHN+7TkxtZ+HfXtuRoP1+aiq6IlH2z5q5zYo7naMnJR
-bWHxO30GKz1D1VIfy2IUU2lNkRIi8FX5/E/e7uP8/UBXUOsOekXMUg8kb0UCcmtt
-kJQc1Ps09ktNJRdv30pk+K0ebt+tbLMdGuYOWXv4pxN3eIW/P3wS1I40/wGQA0KF
-YOSZ1hkyRkHoUMoqA2HNxWj0kg9uSIlBnlO8QWLtSpJktcs9VWzZh4eaq/wiUGaS
-K7nXnjvtgOP6GWk4h7YlOtu10PKATa9tfZKQ3qrfvoAmHGnueuNFyaROauBWXx9h
-RD9iNMkeIV/2f2jAbr/SNR5TmeThvWSkSTzDzrboqT0nVOrxPqH8e7+NcWCQxWYk
-hd59Rx9ig+JjjhBcFM3QfoZETd8FEEO4PIdkaezq+0maxnbBj+pJmArTl69k79pf
-qVcD46AV2GjFQNh7DyYNX/C+Wkz9r56/LTFAcSXe0HMZLa6my3zwuKSpXFCAQU7c
-9yCkpmZl+5LRQy2/MLIN25ujrCgIxIGZDA1F6anlbNq/ELunPlpft5NKIBUpaXR4
-0etTqIhJy94M4psx4i9Wlc9VkqOOqe9oywAR1HEGS+WJDLbnKy+YZSGOKqOGc7sb
-duGUAtihUZcVYKI51f3cqL4wEkSxSQuUgs9fk2EcPOsFW6QX7jDNfNs/7nkC2hQg
-mP2aCvE5yFlbTqOt+ATmC7aBfkEAr/c37G68KKM9drb96YjHHnh5J2KigzQVYbjk
-w6z1fz5OX18xW+iRG4Bey3Sy5aOK1VqJ+mPx/2e9WdBwd7d1tTR0PS6ZRgtLxGQv
-k0j+R5JqC0Je78kGZIRgiSuEHzENNhVOa80U96DRsrj/U/Wque1jUHpvYufHf7z1
-4gz4KKQNunXQuMeb45RiZhzYbAIupaJiUP7PMQIDAQABAoIEAQDdg63OaSJAtj2f
-0mCMb8ISwFfYk4Osar5rp/Gzjq0vwZKYizHfxA/gZeuA0HqUkeyAQicE+x53pNq3
-etWQ4lprTV7i+ZV99mDLEiQACdudft1Cpsdr5aTDZMWLwvpQ072fEHX6Llc6/72e
-jB0UkXCcK6oHnZ87rs3C5Gyf/SpTJPrV1KbkoKGaUFnRrIyCPj/EOFp2a+UWWGba
-pCuzkfcoA21xT6yW8+NY+EOwh9VWJwy8af3WtWIh0ix+sCDqegsJcHObWXJQ8ZMD
-Oi9lfqXnd+ZskYOR+zn5P8w9LJiJ1CEAFLR9H15tpleFtCSw/z5pLP9ndvTwyeIb
-GSmU2VAqBgP6roGYDuL6iq6Dyi0GN4luM0pz9c/PtY2Ni8MrzeziKjAF6OXiDE41
-rxTwdG7RxnNa2q7+tjt9hrCgLbYqd6W/6VKYZY1YKvIE+PhdwGtzxwbKsOf6phqt
-6DZr0BKIX7VwMeXRHbhtjw6hR86diH2koLQPfH4crDIL3GQ2J13C/RxjTLAEOli2
-y4paeOYzOe6ANDXXBOhieFw5f6mqD9pTF2PWDTnTJhfMGJ6gXPapDYoycS8huNnM
-DnqtMVIOf2zOI8aSkumJyXq2bEpGSNK80IJgyKfpk0b4qOdbG7tklfbhVCxTida0
-qqgmJKLGrNmJNW8KLB1U4/hcowEVFz8MF0OZAnByDHi2axwSRSGD5aG2yhCfs3Sy
-C269M25v0WuTeOs02RnHUvLPIhvbOEVTu6AjvAtYIfjEq+xqrjbZqUqJeh/xo2tF
-SohWe5aQs5DntsMCkZWlqlXc4CCaCqVACegh5Rn+8JbpZvpzy4HUtThfVbB45a5P
-6uRAsoxiIHbPLyIaKHFqqfog98hzD4TZYKpfb4RCgqKgEAHGKh4/KPM9O4iw67Oj
-EnT2WduegazemzOxQIuZ1UcNu/2d7uy8v/zPGLEUfqhFLS8PMStEuLdQQZfU2DFM
-rHJZsH3UtgSreZuQnlTHYy073UhB44mhcYbwa03jMkLHb1bt9q9l8ZAZ5FjstKJD
-vN5hMqT5LBQtvArCB+aIVDQxEyZiqFxBlW658uAIhCkLXNB5BVfEUEB8w5vZXOPn
-UpNyM8v0dYOkiSOH6+Kk0i7eC8CSrSQAaLnuFZxepGCGMFksywMv7mDg6yX1sAkE
-RMakKaAaZ55QpUv1/heaBVK0xmwpjJBefAoMCyFh/I+o7BkFdWGsGF2Tc5ZxZB3F
-DF75An4WV2qFMNEIb2SGBBUHGoG75C7tRC9ll39SqX7X2pXMaHvJvEx76CmhC9ub
-TzkRDV0Zi/GqiBQXz5kn4AP3GCuJUQJIvK2l0HPqbqNULrhahwQWBOpIek/SLBFV
-3fRQc5ABAoICAQDzqaS5/JEKUGMzVikWYnxl6fXgMp/l3Hq2DyifRqgYVoSr/wOJ
-PTOOJrtuvwHK6kbOv4YRfKwgVWlJgoAP9Tz0GGpE7toSk3biHY4tTF4KR3xIIOnI
-LQLNDR0LDrJSjQhAH5z8U/E+dpOCBHLfXodZ0/ZuXx9YS/pNDQBW/+HOmDtCfqpb
-kLmxjZcvZnAZyrlSjGrHJoPjiFrVA/1xvY68TNWHWu8EXphKO/aBi5/e4wWS7I8q
-0lDjjPB3GIm0rhumowoGYDPtchcTIvip9aGSPsw56elV+PiwbZaPHZXwHeI0Q25j
-UAdkmkwO4VaYGeR4JSUTjoOwWdXXediRq9SKRwhOoat3GJdDwYByYgZb8MKdQCZV
-H9hD0rEF4JOrUnOsCteXMNEczQocfSxduLD7XLie+oXoEggNE/hD9EJ397sOvyUg
-rgmJLBPCbIPdnfCwm9rdLMsWUjvd4JFq1dyQ9QM1LkdOGQdSoUixtN8X75BdkWhL
-/LUqVV/L5/1DStYniO6k4ry67u4POisAZa4czPAJrBEOakVxkCIoaH+mZ/J3GxWc
-DvnV6myvcNXUEENhfMt2mikP5zcPthq1O1nm7RFqiow4s/f0jc6Epr/LToXwhm8j
-5ch0TkcM+ioguCyYXWEzRJUt3GBWpHoSvxqKLxaWbo1mtxHpGxHDIIFAoQKCAgEA
-8cuU0H0OE3JJaG+9Hp6q5mJfdrAzeIPTCT1jxVDptZaplMVo8X0+LIKYpzWqbGWa
-Z3cTmReOZBukuKPKXuZEufYqzwIh7lEv1ls2SJ8Gedf3Dq3C2fCITHzXlsg58mrf
-tD6cKE85EmI/GhXtaBc51Qa60w5MyXfzK3EPi8lD1v5Il5K1MG6sv+7+P1LgAQVj
-c9mPVT1WmgBFVG2/syJ9L94smwhrtM2NhxMkMtEBrOiv0Wy0bEb1wIo5ndBGBoeF
-KXBfz87HDbUCSxItDFZ5mDk2ARnzl/13+wr81aKcxW2LyQ0eiiN+HczmM1xpavU6
-KI/QnIvUNqW9XRSNpz/w+DO9+gs9BPIODMww4KpLVtgFfy5KYre1/MpgZHVlHDCI
-r72WaDFHdMs75JN1rPNnYx81LtKp0JnE2bIDda3qlCKTBtwaFEUg1F0v9NK9yiZF
-JytwUUIfURayT34hfDAJDaSemWT3b4U2kYBr7Fp+g6R5iAosx/TnCYxtuGhdSLA7
-JkL4gy6Ll6hQkIyxRxC6R38wzwUFg4pbV6qrhjP1qyuU1BsZrBSV1RSbcHghSAZj
-UmT/sCKOhnliptnnz3e6ceP8I9Y2/TOeJXPdH6zvfaTpnVLiZC48FBKnXFCM4SaS
-v5qejQChBBOyd9ybO40sxC/Db8WsPa1LCMnHzm9YtJECggIBAOitGIYZ7o7A0NnW
-7wlXJp9TWN2suhAQCIYN16axHBeRlsN/k2rcLH0T82v/rcCNEuye63GLcfq2VQJD
-QfL7JieZoPEOfOO8OYwW2QvcnviF5uIhu9zRTplsak2CzToTPsus5IX3yqjxJk7D
-3MX8SJe41tvyrcXtV6l4PtjVJFXZ/My0lA04GHq6UKKM2YNnmKyBNf3Sg6MlNEex
-tbWFY+XgIQ9OAGxVwGsy82QlZpa6hzoT92rWxzNkBMRVhDorAHCRxCLufufBSNOX
-U4lI6+7xVKgA/DaCt0gSffFQOTu/7aAmvCTN6SFiTjrvZ3d7UjaAkfUo5Avk3VUU
-H4CLazxYNFCSBWCG9PtYrkWL4bKuJ8lt1qz26ddqPGz2VU0GQTsKZ3ESxr0P9xXZ
-WiJtGWQO2KXHaVOA1HtYlHyfpVFWGSQt11BroOOCWaQRZ6KbDZo4WjlWauB3yn9H
-0NUKP8OUlGmWNbUYJWv8Y6R+qYL72wnero/RU1aHjCD0+V3m+rVqBykg80Q2oNGd
-pC6O6kLKWHWEAA2Z4ZJeJqAbmbnYDSs7i9koW96wKvUldKs6lH1lZA1vjMKI8oVo
-SfzCHklsHHN2tgv3n1HCkHEPopqL808JsNvAsziM/0AfK1dvR/Z/RTBlz2apyL0z
-9vYr0zYdXR5tl018h/fnR4Dja0nBAoICAG7z5Ui6adAgnHDQ/W5kjrWDJJ05A5Vk
-oF1YD0VG+Md76Ds9TwepWfNgxh3McXSmNvENYi/Y8F0dljun5UAg2B6hSEmPh/Rs
-ys/JMSKn3nfg0xyoPYZ2aoT2sJMfM//6bMawCEYy/FRkQuJ8d2FRbxdCrE4W/MNi
-SHKBwgl6BKhOLQ9oob4kux6j04VJSUMOrvFFPxF1QR0PzMCOT+4qgFmL0NofRhVE
-UZJPBUhQQj2O1Mb749rfwPtmMkQpg0iRvVgjmcOo9gxjKDc8kvFbaRaiAhcFSpNP
-G1RWWWjK4rdxqjhKzd3DpaaVFHkzCair+NEOFUMQowOkkD17Jfk+TRwH2kA4EfsH
-+8yBklg1rLagD/2pRzb/aAIk95CBkjEaUE6cZ71OB6UfcU9VHyWK18FTW7strgDr
-3rmqhw3kDYWGTANU0p7EjekFDfGBFtgBMbBkrXiMKAS0roPts/3hqPXauXBYNXa2
-ITEpRdzCNdXAjogPazciOTZXey2ork2hmLLY/mJr5GBmOvnppZufoGsYgVQt0Lbo
-sTuMNIMzqqKuL/AYs3IUTCDoAN/eMB911vPDJtUzNkWcw9kemtHH9gU3AceMD9Wm
-bwZuoWRcndUA7LZlhz9DPAxV9vhUeiEC60oC8IhxZnGRfE6mK5FrGcS4yiyq/3uZ
-3pmcxhQDYigRAoICAQCzK0SUG9tSzwpyuEb7hbS7isT0XOnVvLDEXL2jTwVqbN8a
-pC9jebbzJgxk5EA+np/eZlRU7h4aZjRhtDwi4HsarXzgIni6z1vswAiOSZRCfC17
-8/tjfER9w3pJMRTJ5MFeN7JvNUhWnXY5fX6SBl/Eocwwy8S/eIWUY53aI2k8UZMR
-eLUb9I6eL21qZAPp/XD8/3pF5DH0ECOS96C8mDKTGnARUyfkKrlaASSTfe5XToNb
-IpDEYtLwpHN0missq+ObqPc5lwot/nBy2fdllksb3mCCK8AxuKEDsVtWbb2maoa9
-lRGxIxr++ZV8n0dAwGCV18CbhBYh/B2YnrexI2ZfYOQbzPjHiuUgSLGBJvIUX+S+
-O8ij0vQBqECfwCq63SrdW340Huob52d/cod9pNolO5edftPNJVJP+44sZtEJoDBW
-WgzdpVV9fA8TYsO6B3Dci960fbpWnKZ01uLFWVTkou8IwqcaxJIyMzS3Gmqo4UEF
-oxBSrg9rTAMJSnm2YWBHK1Z8DDlLzw3SkNZVKm6Ai4yEcLs1PzGZejsJvsu3zGgq
-nM4liRHK2QqY1SJf6PsJGxAI62tlyTRfjxtC3Jq9oJbmJs+jl0gtNKEbkfQc83IL
-8wCHOm9G7KK7XJjMCb50Dh80YIDFj5GTQLU1tKdpDBfq6YTKUHqjPA8GRnz8vA==
+MIISKAIBAAKCBAEAs6eBz6ObPFcqjt4TCKYVamgIzqGg7/wylVqatcyEu6MVoPwp
+u3EO80AglzWSkok2al++pSRayA73U6jgdAWQOCGlJXIrVnB0qtYwJeCV3T1KSEsl
+p6jE6+XWEE+VQpGwy2gvv5YPCpsrAQ0Drj+3fvYewRRCBH8JIeg+h8Cz191PfpW2
+gzOPzPS7EY5mX7QyIouONJOCDwLRb4Wyp342DPMNkUb5pZHcYEoN6+U343bYE7tV
+MyNMs5DfaraAPfa9nb3v0416mmGsAj0QtcJT0n7uHJClsOjbcY/TU+SAsLbMsPLr
+RsPZPEgBHTpc0PIXnJqO/Co25xxZQWat4dOC2JXurtyrcpTLC4rf73D3+eJ3dmRn
+LQLcGtsC6V5jPz4H6WXkAnhiVeFSGFqjnFbdzdP38lVFYiDO/UGTucIgkCOkQU8w
+XF6gl2+kH4dql4dw+dVWt2rM8SjSJjRXZZwtQUOLbL0Vb+zOPp9NL6Yh2PdN0WNP
+8J4Ew4IzWDQgS4ENQg1EYkgbTM/gaeTI+JyYH3Q3Oj8jQDqIgMKcm7pquSw6Z6a2
+XIP9kz9uUxlI4z369Y4DQI/mr8XeqvhwdzYrbjrfvNf2x08Cf6GtLzzpCEUvVxrx
+W5wnBzpEQz4FsUobQqSQq85L98Gb191vBRH56KOhmWwuJz2xVG/rsuj45hJvimkF
+zMb2xC2wBrYhUChQ3IyyjGXO2StRuGJWcLRGTeRMoYYxPeMHf3PjCW7upykqgCOK
+tgwinkMcqYxHLAJtE++Ip9fRYNlrKICXirf/YmsoVA2rYzqsV54vlSv0oD2hYKBX
+Ggkj7vxNm0WD8gofs3cOmCCzFvyXAzD8qz5+/D52ZMtLTclsj6pw7APFgTFDEZr8
+LbollAtzfsE5AcpocBrvpLrcE9Y3FwkNyqohlLs+Q/2MgOZY/XUjWsofCy41ws13
+DHOzL5rkA2hYyD/zdo0FU9I02wmvcO1nC/8vZDUtcSJ68vIrfW2+gL0YODcBZ6Rf
+SClSeJ+1uIBwyhBq4Sc7wGFOlvjoD0Kx+rwF7zGROKsPp+8shsGrhTZ8EJ3HCmvm
+KxHd+kXn0sM6wc1gJ2gm14dJX+N/JiAfmaj5AKYN1ROBbvwnigNYaw46xyChXCTR
+CKZaHueBPSEFLktdGBTxT6tc5YHawSz2Ev8lCZcenVFtH2MunO19hkWwNXP2n4Jl
+vH9GiOGhYKE3UCac13bz3JSJbde+phehK3EUNxdf7Vo5mfxpr7tjVcZge2TYu7dK
+n7mqiUswH5zvI3qvfjHd+90K1QQKjFdvZIDr8+5sM9JywiRook6ZiBz3O10QzE7q
+pcsAQIqpYy4YkuuxKAX+Gep7MvtjViwLIAGSowIDAQABAoIEAG18dDwatQx9As62
+wFrQ/NQwOs3S6sXWqO0knoyU639+0Duf8b7uE/Ji7nm4iG8NeEAzwXfbRAgQNuKh
+VMjgaxgKSR8dCRRQzIkgp48t46dFJvQP+A7JZ9lr5J1kIs7DAz+zawYTaW9JSVgG
+mmujIS0ayXtZ4THkSaiEZTdOVUwE7+FxVB15WvXJYAg/BFzm8HblHfEkxGppiUGx
+9ULmRAJ4TZhv7Mzeq7Ny7jEJLJpPXzgHPtE/fgshC0d5mYYpzT1I99OxsTpMtAtZ
+M8nReEwcVvjJnnDGOJZo1J2X8GXBwdVE9eXWjZmTODqbytz77S/fcaxz/amzOSIG
+dYne4SsllKS0jzfxPhz2saq26ik7vxpD7i0cRQ+I0alvgISWRTQUiHSI8UTtYJ6+
+/l7VAa/isoTZOsOmwv7M7D6U9EtjrUKwBAUHFk+0Fg2w9WELhep7/bEiQWvnOMtX
+sruWBm5zv5CxW1MuujKn2t5jHNWhQaeOIrW9V6Hew3PJsLTTHUVX2Ikc8KZLObTP
+XTtGE993cADrYYxPH8l40QCHB2t6bM2maBTRy8PlMFMsYaM7rqnftlOuXyRYLm97
+oO7F8InpD1mDND4bBKbL3UOgl1QW9dbb8KOn8pERDXD9Z3K4ewyORiyuONXxBAz2
+QiaQ4gDJWD6sEySPEHcpDjemi6mKJFtDw935JxS2brso/NHoJSVdcNxisd2irA8P
+U8jyFTrTm7cO0nKFx9vv9r5dsbkqyQnJ9V0q4/DoWvnkPElKuvTeJMw6CvTjfvc1
+xIf8m3MQJTN8pqPpIOSj8DIhQIJBEVxtcajg+vlMuefR8hTCdLzQV2QEdLGjNGph
+OhFuHrHw1b3I4nCyi9MOLzpdUDgZkaw4hPg38u71RJ6bUF6pE89Yj04/svB7SZgA
+sE8+/pZcASZl1Y0T29OM3qFJvukBWwsNij5P5SLmTXDev+DXbzUvmVLCk8nJkJ5m
+n1peGst0ApHnEzxVhU+9d5FWBdIgN7fp7V2AlFt1r0TRWUYndBn9/B6xiyfd5iyK
+LpcbRjLpQ/9b3SYQZL9t65Hc40rP35rY0luQTzVd6E/D041E0NWdpAZai4GrpMKp
+NUBXBbmwnCZEzExLi78We6aF5tG9Vh+uxyYUXlrABR98jONgYIvnWaATaw6oLgam
+B84RhWUa1f+K70wrTorUO8QNvYO2n4jpwJikn4H9pFvvzzoOB7RaA+EF4HjaVmQr
+Jm6S18c7sksYFGIJYsPrXMtgOMQVYiQ3s8LDgsWKoEQYgvgxE24AoXGlXXbALrpo
+4WvRN7qLAm3n2OQYFUK0SGoELOADQFQhbNL91i0k4wzQ56ofQCb8aTmm3q76TnbK
+4gmIUIECggIBAOm3PhMqIKb3ZEZOWYMKByb7v8seuVh6mwXmgITcZIiA2f8rTfyH
+OZanYK72FsuGZEbf1ELwNUX0JobwklA1Uq9NajaJUdfe4wDpghf282APHK1nD3m3
+FX7Rsoof/dW9+bV/IIbQDwy+1ctB20m6dejt3kWyHSXly2y2L3bk1flee8oi+VCO
+ROp4u23KJcglIYlL+cL1z76lX41v8JW3deCTL/JStmK6zuvFhY5fTlOGxsLhAY3X
+VTZ0MNUpezlBaXTixi7ilgbh7rJSpCmeno5my1hdl/5Q5U/u5F5E7ZxKxlhuVWdA
+cf9qbtolSsgJ2w8axPD3dLnQ6wsNnl4yL77TdNr8OlbwIADXHH9VzZbfEgOhP4r9
+Cwz4hIUbylJ9QGZVsEVZhvqR3M6OgqlYOmC72nLPXVYbL/Rr7cTx8t+WJ4wJRP3l
+pi6AgDZXKbMKyMIhM1IscSR2swtAFyl6g6rcAjFyG+p1IKMOQ3YOqdVVUf5UYSpo
+NBTpJ+ho3CyQJK25yT2Maex5Q91M6Rk9vmXaIs+K40t/zu8cnCIH9j3In0BrpSi7
+WUyLgzXW+7ZrW7cugC93VVgjGNbgBiDimZ5duViI+xY+3OlrsUxzSHN+YY+8H2G2
+TfzT+Mgo8lJXH9tseFBLvRKhoPbbCyCwnOJ6k2k8/iqZ2eE7vQodyW/zAoICAQDE
+yK5Mlu0k3oTVasgYRNDYKJ9uyarVLaRcN6UjzNUSta2hABzQe/LG895EucK9yVa0
+4jT7EXILYQpHnQkaYtyHtN/deYWLRObT6RMws7te2MhwzQkaNavgi449dHP38TPS
+qy3Vh6v4nMhRjkhLqNiiJoDWThtkB216t+71GxdF2l9trrcvlC6q0Z65PR4LK3B/
+3m8KmlyGN940Ovb/4kEh2EZmNwbMq+3SaXiS4R7ZvKoboyNmwvCh4t5ne+NXz3Vm
+7srej0cnOM54dTuNVdXm6pajYjELNVJGsK0vo6CAZiAOyasFkwMFMr5w/ehBaZIo
+9ewWjvgDdvQ0+JBMVZJot7e5D4tUgVTaIMpQryzAp/u3r5KC1bkcC1Zie+44CaPr
+V2FspEyYQDPJHC2tRj33lbaCWDdfdhYhv6uzlcM9ExPj+RQA0xlCuxh1pxK43H4t
+PdWvcIeIKtFRWq9gsH1/wDBaIsB5Kykq4xyvMOj3dyV+dyIO1D3GG2+ZoBt8gklk
+ieDIzCMKsXbomgm64/Ewlx9tf1fbTouSWP1+Gh0Wne3sCEtCY72ebYgjtaA0w8Xr
+HGTsEdw/rSer46uULYWXYC6VYZwlyTbPh4NSD7ATrQo6HnaKugtuya9NPfYD9S9w
+PoXPXpNKvwSq9SA/XsodHet9uU+IlKnYI41hVGaukQKCAgEAu7dAFmh5vWFqmsWH
+Q6akQ/1j+KL+v0AKj1yp0Qyreq/zZ+3CP5fk+0oIb76cZG/Wzs4sUG9aeos0/qDv
+A5kwhjipnJACul38+diTcugYZgj9QZFLbrlMfIW03xf+6tQhYlNvLpih3dzRHuYQ
+WVF4LtQO+O+sVaoSD4js6pO2AQqQZrRchwUd+S1rbS0112FrZDkvrBV+/GMbMiC8
+naOy++N8WSdx8i6Uz+3f7ZBC+vd/YTsT4ncXrBr6tdsRa9VL/GPARhwb3/9LltKl
+pAAQ3dNWc+0IjW0wIVmA9u5p4mR0lsZXtgyfA0TbMD9PpwezeJhJojk++ZgBkOkp
+UAMDMkPo0ZJQ0U8ghUxBSU0DSbB1aZDz1pCTdaGN3tOJV2Pee9NLNwhHT64kKYtx
+Cs8gZF29gQVotCY2CB0/5jVmm4qgzOsNDNiM90CiugKcLX/162Z7L/8eCOmFuP2L
+HPeYFX2MDWbXYSMeSZjFOmdgpUZYCux+9m6nljwGn7bJUMmdjCNyrQrAcPydM3v4
+pRtgd7ISz5uAID3RWWAjT3oRn2Ip9rX++44ulTpg8rdviP8FtUWWE4nHdHkMFFnu
+0i7ur7Ibki7DbQSkrp6e0watJIZXmfjBQ9wHG5CteybYKqZrofOnVubeP76t6Ffa
+wjDYcVd+WsJwaosT4sH2fc+a4V0CggIAX703N+ISHGb6f47FLTGF3jTdZJxPNgpP
+teIIwUMtwz2K7RLN8gzr0Cnj0NID0iw7uCN6HVCeiLS8uJzJSgIhQxEX/XvbIify
+mdUC1iYLmhikZGUM8ah9J/Ed0f5vUYkTaoKH+SRZ4cn9l9g+ijjqtPFAq4Myxlbq
+x9LnOm7kwsJ8vTNMwqQ4lDkKHRuEG3EV+dAxfBofu9lAjW7GrzXX9Gxxy9cnwro/
+KajQ1b0bMloc9PdJCPz87/YduIFI2XcAqoSxRNi2iHmV0ntO7vN87yzg/zqNm+Nk
+VSouCEh2lSGapTcusraUuJm4l+agcfq39p+3Lj5+ocjlBUSNh+X2JmaDx1Ctu/50
+Vu+vHtQrVMwlpneQM4Fh3ygQ7jdXbgIasyw/JQlGjqhlyYmhG3VaPrOjKQVcY2Bj
+YiYLloLdi0BV5AtR1RjfaFz4iH0xmakE5mP4K7P27KPQVOFnBAa5+EZ7/856kDkU
+fV4jnYSRQ5y/LCkv88EFEPZWNIr19Hy60mRWbbsLrW8r5/zRkRDHTpmn27EiAHvV
+Ye1T3187Gb7ae4SJgRJftc2ad60s9Z7uEvYsj8Icwwoui+1nk98V6NENuPXVb3jW
+5t8KYAlr5BbDLAWYLORZHZyYYl8r6z8FxnlUxtA/nxUSY06BUvN+J+5fnTpkXJHf
+lF2vslPK5VECggIANpTlrc5Zp9c0jPOiBQT/92LdtMR9mB76WB8fX9xn1Tm7V/cI
+MatRrFzaTvi5HqHxPWJJ5cgMYKQw8kHHk1q9U7jeexZGCICFOUjk3N2Z0aXIWrx+
+hiS1i5DzRaZNI682s436cdaS4GpZIhqjIOR4/JS15Nfu+DVqyHOevWnd0D/tGoJB
+JpiePYl2k7b8sirM3bHnRDtBiMHrHyHxzpdTLImDLHXr7C5DTeQAzzo+YMu45mNm
+utKq3SRlO2wizj0qpONgJ6cHI7pypAPalliA+hPRRJqaHmTr7LpkP3+g73hf26wK
+PoF6CLkdaN945F4Z48/3zEOP3XRIQocMA46ayA+8TsOpx9rm8L1LrF1pgmJi5Ml9
+3yV93ZZ/w4Jy0pqZ28nn3gcX6JP7qtfgioLLeyuuBphpOQXl7Ys3w1d0EEErpATU
+tRG+BS16o+FhM1iXAN8c8HrqOtyJzCpYnuoWiNc+G8BIn6ox3xmihwK4hiR6s/OM
+Mxaa6T4FF/IWIzuCezYPGgybWMXj3nRHsD7eNP170irBLwS3GdD1HWM2BpmLdJa0
+m/7QQkONhCnNFtjIalfPWMX51z/8GOKRKWH5A8PY6CxVHRg1ZfHT4TlfbdRPIG8d
+6JrWt2s4eLv9VRdM+oMifHR4qvLDgg7R8pBr2FSsVXM9U2+j+drIeAhkjHI=
-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/serversan-cert.pem b/mysql-test/std_data/serversan-cert.pem
new file mode 100644
index 00000000000..e47779f420d
--- /dev/null
+++ b/mysql-test/std_data/serversan-cert.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4 (0x4)
+ Signature Algorithm: sha256WithRSAEncryption
+ Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB
+ Validity
+ Not Before: Apr 25 20:52:33 2017 GMT
+ Not After : Apr 20 20:52:33 2037 GMT
+ Subject: C=FI, ST=Helsinki, L=Helsinki, O=MariaDB, CN=server
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:a7:74:d4:2b:80:cb:96:08:2a:b9:c2:87:18:0d:
+ 69:2b:da:cf:ef:21:cb:05:d4:80:2c:f3:85:bc:78:
+ b2:42:d9:9f:f1:dc:47:68:c5:af:5a:c9:01:f0:dd:
+ 91:cb:3a:b9:38:b2:36:6b:a3:66:ef:cd:44:0f:8f:
+ 39:57:60:ad:3b:44:33:51:c2:7f:cb:5c:8d:55:b8:
+ 1e:e8:80:e0:ed:9d:8d:10:7a:42:68:73:06:63:83:
+ ce:db:05:5b:e1:7b:f9:0e:87:20:38:b8:11:6a:b7:
+ 59:3d:4a:ca:cb:60:e6:e1:73:d9:a2:24:4a:70:93:
+ 5e:cf:d5:04:d5:ad:ac:96:a5
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost
+ Signature Algorithm: sha256WithRSAEncryption
+ 4b:78:d9:09:4c:25:cc:fb:17:8f:31:13:ac:d7:36:2d:5f:d4:
+ ce:94:84:d2:a7:fa:e2:1e:ae:b6:72:1f:01:56:0f:89:80:c0:
+ 01:ba:ad:d7:cb:24:c5:25:ec:f8:35:ac:52:1b:4f:af:7c:26:
+ 8d:d4:d4:91:05:21:b7:ba:3f:6b:1b:8d:1d:a5:6b:7e:7d:be:
+ 2f:6a:09:83:c2:c3:6c:2f:8a:31:fa:7b:36:3f:6d:e1:62:ca:
+ a0:3c:43:b8:53:5a:4a:b3:4d:7a:cb:9c:6e:db:a4:ce:a1:95:
+ 5e:26:d8:22:39:8c:34:0e:92:bd:87:a2:b1:7a:68:25:57:17:
+ b2:d8:43:3b:98:e4:80:6b:7d:3e:ab:32:82:6d:b8:80:45:83:
+ d6:55:f8:cd:31:74:17:8c:42:75:09:71:66:b9:e0:94:16:ca:
+ 1d:db:1e:89:12:a1:9f:00:cb:83:99:5d:5d:28:7a:df:2a:87:
+ b5:8d:f1:9c:b9:89:2a:0d:6c:af:61:00:41:cb:03:df:99:4a:
+ fe:93:81:88:ff:47:4e:2a:b5:2b:bf:85:0f:9a:21:7b:20:58:
+ 7a:1c:67:b5:8b:da:db:03:69:25:db:76:0e:f9:23:57:8d:8a:
+ 47:dc:15:16:7c:2d:66:8f:6a:10:f3:b2:ea:2e:31:c6:d4:2c:
+ 90:15:56:f4
+-----BEGIN CERTIFICATE-----
+MIICuzCCAaOgAwIBAgIBBDANBgkqhkiG9w0BAQsFADBWMQ8wDQYDVQQDDAZjYWNl
+cnQxCzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVs
+c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTcwNDI1MjA1MjMzWhcNMzcwNDIw
+MjA1MjMzWjBWMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV
+BAcMCEhlbHNpbmtpMRAwDgYDVQQKDAdNYXJpYURCMQ8wDQYDVQQDDAZzZXJ2ZXIw
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKd01CuAy5YIKrnChxgNaSvaz+8h
+ywXUgCzzhbx4skLZn/HcR2jFr1rJAfDdkcs6uTiyNmujZu/NRA+POVdgrTtEM1HC
+f8tcjVW4HuiA4O2djRB6QmhzBmODztsFW+F7+Q6HIDi4EWq3WT1Kystg5uFz2aIk
+SnCTXs/VBNWtrJalAgMBAAGjGDAWMBQGA1UdEQQNMAuCCWxvY2FsaG9zdDANBgkq
+hkiG9w0BAQsFAAOCAQEAS3jZCUwlzPsXjzETrNc2LV/UzpSE0qf64h6utnIfAVYP
+iYDAAbqt18skxSXs+DWsUhtPr3wmjdTUkQUht7o/axuNHaVrfn2+L2oJg8LDbC+K
+Mfp7Nj9t4WLKoDxDuFNaSrNNesucbtukzqGVXibYIjmMNA6SvYeisXpoJVcXsthD
+O5jkgGt9Pqsygm24gEWD1lX4zTF0F4xCdQlxZrnglBbKHdseiRKhnwDLg5ldXSh6
+3yqHtY3xnLmJKg1sr2EAQcsD35lK/pOBiP9HTiq1K7+FD5oheyBYehxntYva2wNp
+Jdt2DvkjV42KR9wVFnwtZo9qEPOy6i4xxtQskBVW9A==
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/serversan-key.pem b/mysql-test/std_data/serversan-key.pem
new file mode 100644
index 00000000000..393c0bc9c1a
--- /dev/null
+++ b/mysql-test/std_data/serversan-key.pem
@@ -0,0 +1,16 @@
+-----BEGIN PRIVATE KEY-----
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKd01CuAy5YIKrnC
+hxgNaSvaz+8hywXUgCzzhbx4skLZn/HcR2jFr1rJAfDdkcs6uTiyNmujZu/NRA+P
+OVdgrTtEM1HCf8tcjVW4HuiA4O2djRB6QmhzBmODztsFW+F7+Q6HIDi4EWq3WT1K
+ystg5uFz2aIkSnCTXs/VBNWtrJalAgMBAAECgYBReSgZmmpzLroK8zhjXXMEIUv1
+3w02YvOR61HwJxEkMVn+hNxBf50XoKDPHh5nMMUZbqvHpxLYLZilsVuGxcTCPVzw
+YxTooPcJY8x61oUclI2Ls5czu/OfzoJhA9ESaFn6e4xReUFmNi8ygTMuPReZZ90T
+ZvDikonKtCCk99MSaQJBANrmlPtfY57KJ18f1TqLvqy73I1vQjffSOrK3deYbvvB
+jUJ79G9Wzj8Hje2y+XkkK+OIPcND1DnoTCTuqVazn+cCQQDD1jy8zrVg/JEPhQkS
+BM7nvm4PIb0cgTPrOhsHDIF4hbaAZnA0N4ZEJ2q7YitXfOeR98x+aH/WJOrzzhmE
+VXOTAkBQ4lK6b4zH57qUk5aeg3R5LxFX0XyOWJsA5uUB/PlFXUdtAZBYc6LR92Ci
+LDeyY4M0F+t6c12/5+3615UKzGSRAkA+SGV6utcOqGTOJcZTt7nCFFtWbqmBZkoH
+1qv/2udWWFhJj8rBoKMQC+UzAS69nVjcoI2l6kA17/nVXkfZQYAHAkEAmOHCZCVQ
+9CCYTJICvoZR2euUYdnatLN8d2/ARWjzcRDTdS82P2oscATwAsvJxsphDmbOmVWP
+Hfy1t8OOCHKYAQ==
+-----END PRIVATE KEY-----
diff --git a/mysql-test/std_data/wsrep_notify.sh b/mysql-test/std_data/wsrep_notify.sh
new file mode 100755
index 00000000000..7036f603c84
--- /dev/null
+++ b/mysql-test/std_data/wsrep_notify.sh
@@ -0,0 +1,99 @@
+#!/bin/sh -eu
+
+# This is a simple example of wsrep notification script (wsrep_notify_cmd).
+# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status'
+# and fill them on every membership or node status change.
+#
+# Edit parameters below to specify the address and login to server.
+
+USER=root
+HOST=127.0.0.1
+PORT=$NODE_MYPORT_1
+
+SCHEMA="mtr_wsrep_notify"
+MEMB_TABLE="$SCHEMA.membership"
+STATUS_TABLE="$SCHEMA.status"
+
+BEGIN="
+SET wsrep_on=0;
+CREATE SCHEMA IF NOT EXISTS $SCHEMA;
+CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
+ idx INT,
+ uuid CHAR(40), /* node UUID */
+ name VARCHAR(32), /* node name */
+ addr VARCHAR(256) /* node address */
+) ENGINE=MEMORY;
+CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
+ size INT, /* component size */
+ idx INT, /* this node index */
+ status CHAR(16), /* this node status */
+ uuid CHAR(40), /* cluster UUID */
+ prim BOOLEAN /* if component is primary */
+) ENGINE=MEMORY;
+BEGIN;
+"
+END="COMMIT;"
+
+configuration_change()
+{
+ echo "$BEGIN;"
+
+ local idx=0
+
+ for NODE in $(echo $MEMBERS | sed s/,/\ /g)
+ do
+ echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
+ # Don't forget to properly quote string values
+ echo "'$NODE'" | sed s/\\//\',\'/g
+ echo ");"
+ idx=$(( $idx + 1 ))
+ done
+
+ echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
+
+ echo "$END"
+}
+
+status_update()
+{
+ echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;"
+}
+
+COM=status_update # not a configuration change by default
+
+while [ $# -gt 0 ]
+do
+ case $1 in
+ --status)
+ STATUS=$2
+ shift
+ ;;
+ --uuid)
+ CLUSTER_UUID=$2
+ shift
+ ;;
+ --primary)
+ [ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0"
+ COM=configuration_change
+ shift
+ ;;
+ --index)
+ INDEX=$2
+ shift
+ ;;
+ --members)
+ MEMBERS=$2
+ shift
+ ;;
+ esac
+ shift
+done
+
+# Undefined means node is shutting down
+if [ "$STATUS" != "Undefined" ]
+then
+ $COM | mysql -B -u$USER -h$HOST -P$PORT
+fi
+
+exit 0
+#
diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm
index 199cfba3b8f..4d921d1b049 100644
--- a/mysql-test/suite.pm
+++ b/mysql-test/suite.pm
@@ -23,6 +23,16 @@ sub skip_combinations {
# don't run tests for the wrong platform
$skip{'include/platform.combinations'} = [ (IS_WINDOWS) ? 'unix' : 'win' ];
+ # and for the wrong word size
+ # check for exact values, in case the default changes to be small everywhere
+ my $longsysvar= $::mysqld_variables{'max-binlog-stmt-cache-size'};
+ my %val_map= (
+ '4294963200' => '64bit', # remember, it shows *what configuration to skip*
+ '18446744073709547520' => '32bit'
+ );
+ die "unknown value max-binlog-stmt-cache-size=$longsysvar" unless $val_map{$longsysvar};
+ $skip{'include/word_size.combinations'} = [ $val_map{$longsysvar} ];
+
# as a special case, disable certain include files as a whole
$skip{'include/not_embedded.inc'} = 'Not run for embedded server'
if $::opt_embedded_server;
@@ -53,7 +63,12 @@ sub skip_combinations {
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
$skip{'t/openssl_6975.test'} = 'no or too old openssl'
- unless ! IS_WINDOWS and ! system "openssl ciphers TLSv1.2 >/dev/null 2>&1";
+ unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
+ and $1 ge "1.0.1d";
+
+ $skip{'t/ssl_7937.combinations'} = [ 'x509v3' ]
+ unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
+ and $1 ge "1.0.2";
%skip;
}
diff --git a/mysql-test/suite/archive/archive.result b/mysql-test/suite/archive/archive.result
index b92018fba8b..1cbaa0a31ea 100644
--- a/mysql-test/suite/archive/archive.result
+++ b/mysql-test/suite/archive/archive.result
@@ -12812,7 +12812,7 @@ a b c d e
2 text varchar blob1 blob2
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+test.t1 check error Upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
SELECT * FROM t1;
a b c d e
1 text varchar blob1 blob2
diff --git a/mysql-test/suite/archive/archive_gis.result b/mysql-test/suite/archive/archive_gis.result
index 5593b53f7c3..80c1e347764 100644
--- a/mysql-test/suite/archive/archive_gis.result
+++ b/mysql-test/suite/archive/archive_gis.result
@@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
-120 120 1 1 0 1 0 1 1 0
+120 120 1 1 0 1 0 0 1 0
120 121 0 0 1 0 0 0 1 0
121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 1 1 0
+121 121 1 1 0 1 0 0 1 0
explain extended SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
@@ -494,7 +494,7 @@ mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
-big,center,down,down2,left,left2,right,right2,small,up,up2
+down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
@@ -515,7 +515,7 @@ overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
-big,center,down,down2,left,left2,right,right2,small,up,up2
+down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
diff --git a/mysql-test/suite/archive/archive_plugin.result b/mysql-test/suite/archive/archive_plugin.result
index feb825f20ee..5656704989e 100644
--- a/mysql-test/suite/archive/archive_plugin.result
+++ b/mysql-test/suite/archive/archive_plugin.result
@@ -1,8 +1,5 @@
CREATE TABLE t1(a int) ENGINE=ARCHIVE;
-Warnings:
-Warning 1286 Unknown storage engine 'ARCHIVE'
-Warning 1266 Using storage engine MyISAM for table 't1'
-DROP TABLE t1;
+ERROR 42000: Unknown storage engine 'ARCHIVE'
INSTALL PLUGIN archive SONAME 'ha_archive.so';
INSTALL PLUGIN ARCHIVE SONAME 'ha_archive.so';
ERROR HY000: Plugin 'ARCHIVE' already installed
diff --git a/mysql-test/suite/archive/archive_plugin.test b/mysql-test/suite/archive/archive_plugin.test
index 8ea40114cca..69bf9a5f4ce 100644
--- a/mysql-test/suite/archive/archive_plugin.test
+++ b/mysql-test/suite/archive/archive_plugin.test
@@ -2,8 +2,8 @@ if (!$HA_ARCHIVE_SO) {
--skip Need archive plugin
}
+--error ER_UNKNOWN_STORAGE_ENGINE
CREATE TABLE t1(a int) ENGINE=ARCHIVE;
-DROP TABLE t1;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN archive SONAME '$HA_ARCHIVE_SO';
--replace_regex /\.dll/.so/
diff --git a/mysql-test/suite/archive/discover_5438.result b/mysql-test/suite/archive/discover_5438.result
index b5ab56aa364..0cd44c40a4e 100644
--- a/mysql-test/suite/archive/discover_5438.result
+++ b/mysql-test/suite/archive/discover_5438.result
@@ -3,6 +3,7 @@ create view t1 as select "I am a view" as a;
ERROR 42S01: Table 't1' already exists
drop table t1;
create table t1 (a int) engine=archive;
+create user foo@bar;
grant select on test.t1 to foo@bar;
drop user foo@bar;
drop table t1;
diff --git a/mysql-test/suite/archive/discover_5438.test b/mysql-test/suite/archive/discover_5438.test
index c05955baaf3..892b9d49592 100644
--- a/mysql-test/suite/archive/discover_5438.test
+++ b/mysql-test/suite/archive/discover_5438.test
@@ -12,6 +12,7 @@ create view t1 as select "I am a view" as a;
drop table t1;
create table t1 (a int) engine=archive;
+create user foo@bar;
grant select on test.t1 to foo@bar;
drop user foo@bar;
drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result
index 504b3daa206..2c2c5966538 100644
--- a/mysql-test/suite/binlog/r/binlog_database.result
+++ b/mysql-test/suite/binlog/r/binlog_database.result
@@ -238,8 +238,6 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
FLUSH STATUS;
diff --git a/mysql-test/suite/binlog/r/binlog_dmls_on_tmp_tables_readonly.result b/mysql-test/suite/binlog/r/binlog_dmls_on_tmp_tables_readonly.result
index 1dfac08e762..b366bde4daf 100644
--- a/mysql-test/suite/binlog/r/binlog_dmls_on_tmp_tables_readonly.result
+++ b/mysql-test/suite/binlog/r/binlog_dmls_on_tmp_tables_readonly.result
@@ -1,6 +1,7 @@
DROP TABLE IF EXISTS t1 ;
# READ_ONLY does nothing to SUPER users
# so we use a non-SUPER one:
+CREATE USER test@localhost;
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
connect con1,localhost,test,,test;
connection default;
diff --git a/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result b/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result
new file mode 100644
index 00000000000..99f2a57835f
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result
@@ -0,0 +1,78 @@
+RESET MASTER;
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = ();
+and the command execution is effective thence rotates binlog as usual
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+Non-existed domain is warned, the command completes without rotation
+but with a warning
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
+Warnings:
+Warning 1076 The gtid domain being deleted ('99') is not in the current binlog state
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+SET @@SESSION.gtid_domain_id=1;
+SET @@SESSION.server_id=1;
+CREATE TABLE t (a int);
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
+FLUSH BINARY LOGS;
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
+PURGE BINARY LOGS TO 'master-bin.000003';;
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+Gtid_list of the current binlog does not contain '1':
+show binlog events in 'master-bin.000004' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000004 # Gtid_list 1 # []
+But the previous log's Gtid_list may have it which explains a warning from the following command
+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 # [1-1-1]
+Already deleted domain in Gtid_list of the earliest log is benign
+but may cause a warning
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+Warnings:
+Warning 1076 The current gtid binlog state is incompatible with a former one missing gtids from the '1-1' domain-server pair which is referred to in the gtid list describing an earlier state. Ignore if the domain ('1') was already explicitly deleted.
+Warning 1076 The gtid domain being deleted ('1') is not in the current binlog state
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0);
+ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
+FLUSH BINARY LOGS;
+PURGE BINARY LOGS TO 'master-bin.000005';
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0);
+Warnings:
+Warning 1076 The gtid domain being deleted ('0') is not in the current binlog state
+Gtid_list of the current binlog does not contain 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0:
+show binlog events in 'master-bin.000006' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000006 # Gtid_list 1 # []
+SET @@SESSION.gtid_domain_id=1;;
+SET @@SESSION.server_id=1;
+SET @@SESSION.gtid_seq_no=1;
+INSERT INTO t SET a=1;
+SET @@SESSION.server_id=2;
+SET @@SESSION.gtid_seq_no=2;
+INSERT INTO t SET a=2;
+SET @@SESSION.gtid_domain_id=11;
+SET @@SESSION.server_id=11;
+SET @@SESSION.gtid_seq_no=11;
+INSERT INTO t SET a=11;
+SET @gtid_binlog_state_saved=@@GLOBAL.gtid_binlog_state;
+FLUSH BINARY LOGS;
+SET @@SESSION.gtid_domain_id=11;
+SET @@SESSION.server_id=11;
+SET @@SESSION.gtid_seq_no=1;
+INSERT INTO t SET a=1;
+SELECT @gtid_binlog_state_saved "as original state", @@GLOBAL.gtid_binlog_state as "out of order for 11 domain state";
+as original state out of order for 11 domain state
+1-1-1,1-2-2,11-11-11 1-1-1,1-2-2,11-11-1
+PURGE BINARY LOGS TO 'master-bin.000007';
+the following command succeeds with warnings
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+Warnings:
+Warning 1076 The current gtid binlog state is incompatible with a former one having a gtid '11-11-1' which is less than the '11-11-11' of the gtid list describing an earlier state. The state may have been affected by manually injecting a lower sequence number gtid or via replication.
+DROP TABLE t;
+RESET MASTER;
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index 09a3d709929..618e00af72a 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -22,6 +22,7 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo
**** Clean up ****
set global binlog_format = @saved_binlog_format;
drop user mysqltest_1@localhost;
+CREATE USER 'mysqltest_1'@'localhost';
GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost';
SHOW MASTER LOGS;
SHOW BINARY LOGS;
diff --git a/mysql-test/suite/binlog/r/binlog_gtid_delete_domain_debug.result b/mysql-test/suite/binlog/r/binlog_gtid_delete_domain_debug.result
new file mode 100644
index 00000000000..b4627caceb2
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_gtid_delete_domain_debug.result
@@ -0,0 +1,6 @@
+SET @@SESSION.debug_dbug='+d,inject_binlog_delete_domain_init_error';
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
+ERROR HY000: Could not delete gtid domain. Reason: injected error.
+SHOW WARNINGS;
+Level Code Message
+Error 1076 Could not delete gtid domain. Reason: injected error.
diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result
index 962ec5ec807..82c1b4410fd 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb_row.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result
@@ -58,9 +58,6 @@ DROP TEMPORARY TABLE t1;
### assertion: No event for 'TRUNCATE TABLE t1'
###############################################
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1` /* generated by server */
###############################################
#
# Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED
diff --git a/mysql-test/suite/binlog/r/binlog_mdev717.result b/mysql-test/suite/binlog/r/binlog_mdev717.result
new file mode 100644
index 00000000000..82f8e5a6e3f
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mdev717.result
@@ -0,0 +1,40 @@
+RESET MASTER;
+CREATE DATABASE mysqltest;
+SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release";
+DROP DATABASE mysqltest;;
+SET DEBUG_SYNC= "now WAIT_FOR locked";
+SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release";
+CREATE FUNCTION mysqltest.f1() RETURNS INT RETURN 1;
+ERROR 42000: Unknown database 'mysqltest'
+CREATE DATABASE mysqltest;
+SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release";
+DROP DATABASE mysqltest;;
+SET DEBUG_SYNC= "now WAIT_FOR locked";
+SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release";
+CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END;
+ERROR 42000: Unknown database 'mysqltest'
+CREATE DATABASE mysqltest;
+CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END;
+SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release";
+DROP DATABASE mysqltest;;
+SET DEBUG_SYNC= "now WAIT_FOR locked";
+SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release";
+ALTER EVENT mysqltest.e1 ON SCHEDULE EVERY 20 MINUTE DO BEGIN END;
+ERROR 42000: Unknown database 'mysqltest'
+SET DEBUG_SYNC= "RESET";
+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 # # CREATE DATABASE mysqltest
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE mysqltest
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # CREATE DATABASE mysqltest
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE mysqltest
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # CREATE DATABASE mysqltest
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE mysqltest
diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result
deleted file mode 100644
index d0febc3f8bc..00000000000
--- a/mysql-test/suite/binlog/r/binlog_multi_engine.result
+++ /dev/null
@@ -1,106 +0,0 @@
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
-CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
-CREATE TABLE t1n (e INT, f INT) ENGINE=NDB;
-RESET MASTER;
-SET SESSION BINLOG_FORMAT=STATEMENT;
-INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-The last event before the COMMIT is use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
-*** Please look in binlog_multi_engine.test if you have a diff here ****
-START TRANSACTION;
-INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-COMMIT;
-TRUNCATE t1m;
-TRUNCATE t1b;
-TRUNCATE t1n;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
-mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m
-mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b
-mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n
-RESET MASTER;
-SET SESSION BINLOG_FORMAT=MIXED;
-INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-The last event before the COMMIT is use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
-INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-ERROR HY000: Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.
-TRUNCATE t1m;
-TRUNCATE t1b;
-TRUNCATE t1n;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
-mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows # # table_id: #
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m
-mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b
-mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n
-RESET MASTER;
-SET SESSION BINLOG_FORMAT=ROW;
-INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-ERROR HY000: Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-ERROR HY000: Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t1m)
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t1b)
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
-mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows # # table_id: #
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # COMMIT
-RESET MASTER;
-DROP TABLE t1m, t1b, t1n;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
index 7581a9a7cad..2719091f4dd 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
@@ -1,3 +1,4 @@
+set sql_mode="";
drop table if exists t1;
reset master;
set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22");
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 3dbc422e47a..9a3f4751165 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -107,7 +107,7 @@ CREATE TABLE t1 (c29 DATETIME);
INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
DELETE FROM t1 WHERE c29='2001-02-03 10:20:30';
DROP TABLE t1;
-CREATE TABLE t1 (c30 TIMESTAMP);
+CREATE TABLE t1 (c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
DELETE FROM t1 WHERE c30='2001-02-03 10:20:30';
DROP TABLE t1;
@@ -352,7 +352,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -362,7 +363,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -376,8 +377,8 @@ CREATE TABLE t1 (c01 BIT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -393,8 +394,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -405,7 +406,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -413,7 +414,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -426,8 +427,8 @@ CREATE TABLE t1 (c01 BIT(7))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -443,8 +444,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -460,8 +461,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -477,8 +478,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -494,8 +495,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -511,8 +512,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -528,8 +529,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -545,8 +546,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -562,8 +563,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -579,8 +580,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -593,7 +594,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-16
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-16 ddl
/*!100001 SET @@session.gtid_seq_no=16*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -601,7 +602,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-17
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-17 ddl
/*!100001 SET @@session.gtid_seq_no=17*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -614,8 +615,8 @@ CREATE TABLE t1 (a BIT(20), b CHAR(2))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -627,7 +628,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-19
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-19 ddl
/*!100001 SET @@session.gtid_seq_no=19*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -635,7 +636,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-20
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-20 ddl
/*!100001 SET @@session.gtid_seq_no=20*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -648,8 +649,8 @@ CREATE TABLE t1 (c02 BIT(64))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -665,8 +666,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -682,8 +683,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -699,8 +700,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -711,7 +712,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-25
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-25 ddl
/*!100001 SET @@session.gtid_seq_no=25*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -719,7 +720,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-26
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-26 ddl
/*!100001 SET @@session.gtid_seq_no=26*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -732,8 +733,8 @@ CREATE TABLE t1 (c03 TINYINT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -755,8 +756,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -772,8 +773,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -791,8 +792,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -803,7 +804,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-31
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-31 ddl
/*!100001 SET @@session.gtid_seq_no=31*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -811,7 +812,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-32
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-32 ddl
/*!100001 SET @@session.gtid_seq_no=32*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -824,8 +825,8 @@ CREATE TABLE t1 (c04 TINYINT UNSIGNED)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -844,8 +845,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -856,7 +857,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-35
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-35 ddl
/*!100001 SET @@session.gtid_seq_no=35*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -864,7 +865,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-36
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-36 ddl
/*!100001 SET @@session.gtid_seq_no=36*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -877,8 +878,8 @@ CREATE TABLE t1 (c06 BOOL)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -894,8 +895,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -906,7 +907,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-39
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-39 ddl
/*!100001 SET @@session.gtid_seq_no=39*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -914,7 +915,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-40
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-40 ddl
/*!100001 SET @@session.gtid_seq_no=40*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -927,8 +928,8 @@ CREATE TABLE t1 (c07 SMALLINT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -944,8 +945,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -956,7 +957,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-43
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-43 ddl
/*!100001 SET @@session.gtid_seq_no=43*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -964,7 +965,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-44
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-44 ddl
/*!100001 SET @@session.gtid_seq_no=44*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -977,8 +978,8 @@ CREATE TABLE t1 (c08 SMALLINT UNSIGNED)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -997,8 +998,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -1016,8 +1017,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1028,7 +1029,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-48
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-48 ddl
/*!100001 SET @@session.gtid_seq_no=48*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1036,7 +1037,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-49
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-49 ddl
/*!100001 SET @@session.gtid_seq_no=49*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1049,8 +1050,8 @@ CREATE TABLE t1 (c10 MEDIUMINT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1066,8 +1067,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1078,7 +1079,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-52
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-52 ddl
/*!100001 SET @@session.gtid_seq_no=52*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1086,7 +1087,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-53
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-53 ddl
/*!100001 SET @@session.gtid_seq_no=53*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1099,8 +1100,8 @@ CREATE TABLE t1 (c11 MEDIUMINT UNSIGNED)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1119,8 +1120,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -1138,8 +1139,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1150,7 +1151,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-57
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-57 ddl
/*!100001 SET @@session.gtid_seq_no=57*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1158,7 +1159,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-58
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-58 ddl
/*!100001 SET @@session.gtid_seq_no=58*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1171,8 +1172,8 @@ CREATE TABLE t1 (c13 INT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1188,8 +1189,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1200,7 +1201,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-61
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-61 ddl
/*!100001 SET @@session.gtid_seq_no=61*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1208,7 +1209,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-62
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-62 ddl
/*!100001 SET @@session.gtid_seq_no=62*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1221,8 +1222,8 @@ CREATE TABLE t1 (c14 INT UNSIGNED)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1241,8 +1242,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -1260,8 +1261,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1272,7 +1273,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-66
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-66 ddl
/*!100001 SET @@session.gtid_seq_no=66*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1280,7 +1281,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-67
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-67 ddl
/*!100001 SET @@session.gtid_seq_no=67*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1293,8 +1294,8 @@ CREATE TABLE t1 (c16 BIGINT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1310,8 +1311,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1322,7 +1323,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-70
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-70 ddl
/*!100001 SET @@session.gtid_seq_no=70*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1330,7 +1331,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-71
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-71 ddl
/*!100001 SET @@session.gtid_seq_no=71*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1343,8 +1344,8 @@ CREATE TABLE t1 (c17 BIGINT UNSIGNED)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1363,8 +1364,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -1382,8 +1383,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1394,7 +1395,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-75
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-75 ddl
/*!100001 SET @@session.gtid_seq_no=75*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1402,7 +1403,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-76
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-76 ddl
/*!100001 SET @@session.gtid_seq_no=76*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1415,8 +1416,8 @@ CREATE TABLE t1 (c19 FLOAT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1432,8 +1433,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1444,7 +1445,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-79
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-79 ddl
/*!100001 SET @@session.gtid_seq_no=79*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1452,7 +1453,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-80
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-80 ddl
/*!100001 SET @@session.gtid_seq_no=80*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1465,8 +1466,8 @@ CREATE TABLE t1 (c22 DOUBLE)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1482,8 +1483,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1494,7 +1495,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-83
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-83 ddl
/*!100001 SET @@session.gtid_seq_no=83*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1502,7 +1503,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-84
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-84 ddl
/*!100001 SET @@session.gtid_seq_no=84*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1515,8 +1516,8 @@ CREATE TABLE t1 (c25 DECIMAL(10,5))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1532,8 +1533,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1549,8 +1550,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1561,7 +1562,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-88
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-88 ddl
/*!100001 SET @@session.gtid_seq_no=88*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1569,7 +1570,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-89
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-89 ddl
/*!100001 SET @@session.gtid_seq_no=89*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1582,8 +1583,8 @@ CREATE TABLE t1 (c28 DATE)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1599,8 +1600,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1611,7 +1612,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-92
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-92 ddl
/*!100001 SET @@session.gtid_seq_no=92*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1619,7 +1620,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-93
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-93 ddl
/*!100001 SET @@session.gtid_seq_no=93*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1632,12 +1633,12 @@ CREATE TABLE t1 (c29 DATETIME)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
-### @1=2001-02-03 10:20:30 /* DATETIME meta=0 nullable=1 is_null=0 */
+### @1='2001-02-03 10:20:30' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1649,19 +1650,19 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
-### @1=2001-02-03 10:20:30 /* DATETIME meta=0 nullable=1 is_null=0 */
+### @1='2001-02-03 10:20:30' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-96
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-96 ddl
/*!100001 SET @@session.gtid_seq_no=96*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1669,12 +1670,12 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-97
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-97 ddl
/*!100001 SET @@session.gtid_seq_no=97*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-CREATE TABLE t1 (c30 TIMESTAMP)
+CREATE TABLE t1 (c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)
/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-98
@@ -1682,12 +1683,12 @@ CREATE TABLE t1 (c30 TIMESTAMP)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
-### @1=981184830 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
+### @1=981184830 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1700,19 +1701,19 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
-### @1=981184830 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
+### @1=981184830 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-100
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-100 ddl
/*!100001 SET @@session.gtid_seq_no=100*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1720,7 +1721,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-101
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-101 ddl
/*!100001 SET @@session.gtid_seq_no=101*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1733,12 +1734,12 @@ CREATE TABLE t1 (c31 TIME)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
-### @1='11:22:33' /* TIME meta=0 nullable=1 is_null=0 */
+### @1='11:22:33' /* TIME(0) meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1750,19 +1751,19 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
-### @1='11:22:33' /* TIME meta=0 nullable=1 is_null=0 */
+### @1='11:22:33' /* TIME(0) meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-104
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-104 ddl
/*!100001 SET @@session.gtid_seq_no=104*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1770,7 +1771,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-105
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-105 ddl
/*!100001 SET @@session.gtid_seq_no=105*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1783,8 +1784,8 @@ CREATE TABLE t1 (c32 YEAR)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1800,8 +1801,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1812,7 +1813,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-108
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-108 ddl
/*!100001 SET @@session.gtid_seq_no=108*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1820,7 +1821,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-109
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-109 ddl
/*!100001 SET @@session.gtid_seq_no=109*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1833,8 +1834,8 @@ CREATE TABLE t1 (c33 CHAR)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1850,8 +1851,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1862,7 +1863,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-112
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-112 ddl
/*!100001 SET @@session.gtid_seq_no=112*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1870,7 +1871,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-113
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-113 ddl
/*!100001 SET @@session.gtid_seq_no=113*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1883,8 +1884,8 @@ CREATE TABLE t1 (c34 CHAR(0))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1900,8 +1901,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1912,7 +1913,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-116
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-116 ddl
/*!100001 SET @@session.gtid_seq_no=116*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1920,7 +1921,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-117
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-117 ddl
/*!100001 SET @@session.gtid_seq_no=117*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1933,8 +1934,8 @@ CREATE TABLE t1 (c35 CHAR(1))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -1950,8 +1951,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -1962,7 +1963,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-120
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-120 ddl
/*!100001 SET @@session.gtid_seq_no=120*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1970,7 +1971,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-121
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-121 ddl
/*!100001 SET @@session.gtid_seq_no=121*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1983,8 +1984,8 @@ CREATE TABLE t1 (c36 CHAR(255))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2000,8 +2001,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2012,7 +2013,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-124
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-124 ddl
/*!100001 SET @@session.gtid_seq_no=124*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2020,7 +2021,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-125
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-125 ddl
/*!100001 SET @@session.gtid_seq_no=125*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2033,8 +2034,8 @@ CREATE TABLE t1 (c37 NATIONAL CHAR)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2050,8 +2051,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2062,7 +2063,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-128
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-128 ddl
/*!100001 SET @@session.gtid_seq_no=128*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2070,7 +2071,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-129
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-129 ddl
/*!100001 SET @@session.gtid_seq_no=129*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2083,8 +2084,8 @@ CREATE TABLE t1 (c38 NATIONAL CHAR(0))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2100,8 +2101,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2112,7 +2113,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-132
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-132 ddl
/*!100001 SET @@session.gtid_seq_no=132*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2120,7 +2121,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-133
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-133 ddl
/*!100001 SET @@session.gtid_seq_no=133*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2133,8 +2134,8 @@ CREATE TABLE t1 (c39 NATIONAL CHAR(1))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2150,8 +2151,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2162,7 +2163,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-136
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-136 ddl
/*!100001 SET @@session.gtid_seq_no=136*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2170,7 +2171,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-137
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-137 ddl
/*!100001 SET @@session.gtid_seq_no=137*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2183,8 +2184,8 @@ CREATE TABLE t1 (c40 NATIONAL CHAR(255))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2200,8 +2201,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2217,8 +2218,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2232,7 +2233,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-141
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-141 ddl
/*!100001 SET @@session.gtid_seq_no=141*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2240,7 +2241,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-142
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-142 ddl
/*!100001 SET @@session.gtid_seq_no=142*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2253,8 +2254,8 @@ CREATE TABLE t1 (c41 CHAR CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2270,8 +2271,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2282,7 +2283,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-145
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-145 ddl
/*!100001 SET @@session.gtid_seq_no=145*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2290,7 +2291,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-146
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-146 ddl
/*!100001 SET @@session.gtid_seq_no=146*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2303,8 +2304,8 @@ CREATE TABLE t1 (c42 CHAR(0) CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2320,8 +2321,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2332,7 +2333,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-149
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-149 ddl
/*!100001 SET @@session.gtid_seq_no=149*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2340,7 +2341,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-150
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-150 ddl
/*!100001 SET @@session.gtid_seq_no=150*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2353,8 +2354,8 @@ CREATE TABLE t1 (c43 CHAR(1) CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2370,8 +2371,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2382,7 +2383,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-153
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-153 ddl
/*!100001 SET @@session.gtid_seq_no=153*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2390,7 +2391,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-154
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-154 ddl
/*!100001 SET @@session.gtid_seq_no=154*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2403,8 +2404,8 @@ CREATE TABLE t1 (c44 CHAR(255) CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2420,8 +2421,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2437,9 +2438,9 @@ COMMIT
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
@@ -2454,7 +2455,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-158
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-158 ddl
/*!100001 SET @@session.gtid_seq_no=158*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2462,7 +2463,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-159
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-159 ddl
/*!100001 SET @@session.gtid_seq_no=159*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2475,8 +2476,8 @@ CREATE TABLE t1 (c45 VARCHAR(0))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2492,8 +2493,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2504,7 +2505,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-162
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-162 ddl
/*!100001 SET @@session.gtid_seq_no=162*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2512,7 +2513,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-163
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-163 ddl
/*!100001 SET @@session.gtid_seq_no=163*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2525,8 +2526,8 @@ CREATE TABLE t1 (c46 VARCHAR(1))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2542,8 +2543,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2554,7 +2555,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-166
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-166 ddl
/*!100001 SET @@session.gtid_seq_no=166*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2562,7 +2563,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-167
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-167 ddl
/*!100001 SET @@session.gtid_seq_no=167*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2575,8 +2576,8 @@ CREATE TABLE t1 (c47 VARCHAR(255))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2592,8 +2593,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2604,7 +2605,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-170
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-170 ddl
/*!100001 SET @@session.gtid_seq_no=170*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2612,7 +2613,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-171
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-171 ddl
/*!100001 SET @@session.gtid_seq_no=171*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2625,8 +2626,8 @@ CREATE TABLE t1 (c48 VARCHAR(261))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2642,8 +2643,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2654,7 +2655,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-174
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-174 ddl
/*!100001 SET @@session.gtid_seq_no=174*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2662,7 +2663,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-175
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-175 ddl
/*!100001 SET @@session.gtid_seq_no=175*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2675,8 +2676,8 @@ CREATE TABLE t1 (c49 NATIONAL VARCHAR(0))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2692,8 +2693,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2704,7 +2705,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-178
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-178 ddl
/*!100001 SET @@session.gtid_seq_no=178*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2712,7 +2713,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-179
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-179 ddl
/*!100001 SET @@session.gtid_seq_no=179*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2725,8 +2726,8 @@ CREATE TABLE t1 (c50 NATIONAL VARCHAR(1))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2742,8 +2743,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2754,7 +2755,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-182
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-182 ddl
/*!100001 SET @@session.gtid_seq_no=182*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2762,7 +2763,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-183
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-183 ddl
/*!100001 SET @@session.gtid_seq_no=183*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2775,8 +2776,8 @@ CREATE TABLE t1 (c51 NATIONAL VARCHAR(255))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2792,8 +2793,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2809,8 +2810,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2824,7 +2825,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-187
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-187 ddl
/*!100001 SET @@session.gtid_seq_no=187*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2832,7 +2833,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-188
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-188 ddl
/*!100001 SET @@session.gtid_seq_no=188*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2845,8 +2846,8 @@ CREATE TABLE t1 (c52 NATIONAL VARCHAR(261))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2862,8 +2863,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2879,8 +2880,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2894,7 +2895,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-192
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-192 ddl
/*!100001 SET @@session.gtid_seq_no=192*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2902,7 +2903,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-193
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-193 ddl
/*!100001 SET @@session.gtid_seq_no=193*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2915,8 +2916,8 @@ CREATE TABLE t1 (c53 VARCHAR(0) CHARACTER SET ucs2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2932,8 +2933,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2944,7 +2945,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-196
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-196 ddl
/*!100001 SET @@session.gtid_seq_no=196*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2952,7 +2953,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-197
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-197 ddl
/*!100001 SET @@session.gtid_seq_no=197*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -2965,8 +2966,8 @@ CREATE TABLE t1 (c54 VARCHAR(1) CHARACTER SET ucs2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2982,8 +2983,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -2994,7 +2995,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-200
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-200 ddl
/*!100001 SET @@session.gtid_seq_no=200*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3002,7 +3003,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-201
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-201 ddl
/*!100001 SET @@session.gtid_seq_no=201*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3015,8 +3016,8 @@ CREATE TABLE t1 (c55 VARCHAR(255) CHARACTER SET ucs2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3032,8 +3033,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3044,7 +3045,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-204
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-204 ddl
/*!100001 SET @@session.gtid_seq_no=204*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3052,7 +3053,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-205
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-205 ddl
/*!100001 SET @@session.gtid_seq_no=205*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3065,8 +3066,8 @@ CREATE TABLE t1 (c56 VARCHAR(261) CHARACTER SET ucs2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3082,8 +3083,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3094,7 +3095,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-208
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-208 ddl
/*!100001 SET @@session.gtid_seq_no=208*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3102,7 +3103,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-209
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-209 ddl
/*!100001 SET @@session.gtid_seq_no=209*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3115,8 +3116,8 @@ CREATE TABLE t1 (c57 BINARY)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3132,8 +3133,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3149,8 +3150,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3166,8 +3167,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3178,7 +3179,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-214
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-214 ddl
/*!100001 SET @@session.gtid_seq_no=214*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3186,7 +3187,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-215
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-215 ddl
/*!100001 SET @@session.gtid_seq_no=215*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3199,8 +3200,8 @@ CREATE TABLE t1 (c58 BINARY(0))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3216,8 +3217,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3228,7 +3229,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-218
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-218 ddl
/*!100001 SET @@session.gtid_seq_no=218*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3236,7 +3237,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-219
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-219 ddl
/*!100001 SET @@session.gtid_seq_no=219*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3249,8 +3250,8 @@ CREATE TABLE t1 (c59 BINARY(1))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3266,8 +3267,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3283,8 +3284,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3300,8 +3301,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3312,7 +3313,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-224
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-224 ddl
/*!100001 SET @@session.gtid_seq_no=224*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3320,7 +3321,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-225
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-225 ddl
/*!100001 SET @@session.gtid_seq_no=225*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3333,8 +3334,8 @@ CREATE TABLE t1 (c60 BINARY(255))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3350,8 +3351,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3367,8 +3368,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3384,8 +3385,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3396,7 +3397,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-230
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-230 ddl
/*!100001 SET @@session.gtid_seq_no=230*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3404,7 +3405,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-231
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-231 ddl
/*!100001 SET @@session.gtid_seq_no=231*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3417,8 +3418,8 @@ CREATE TABLE t1 (c61 VARBINARY(0))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3434,8 +3435,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3446,7 +3447,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-234
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-234 ddl
/*!100001 SET @@session.gtid_seq_no=234*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3454,7 +3455,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-235
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-235 ddl
/*!100001 SET @@session.gtid_seq_no=235*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3467,8 +3468,8 @@ CREATE TABLE t1 (c62 VARBINARY(1))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3484,8 +3485,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3501,8 +3502,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3518,8 +3519,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3530,7 +3531,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-240
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-240 ddl
/*!100001 SET @@session.gtid_seq_no=240*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3538,7 +3539,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-241
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-241 ddl
/*!100001 SET @@session.gtid_seq_no=241*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3551,8 +3552,8 @@ CREATE TABLE t1 (c63 VARBINARY(255))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3568,8 +3569,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3585,8 +3586,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3602,8 +3603,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3614,7 +3615,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-246
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-246 ddl
/*!100001 SET @@session.gtid_seq_no=246*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3622,7 +3623,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-247
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-247 ddl
/*!100001 SET @@session.gtid_seq_no=247*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3635,8 +3636,8 @@ CREATE TABLE t1 (c65 TINYBLOB)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3652,8 +3653,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3664,7 +3665,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-250
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-250 ddl
/*!100001 SET @@session.gtid_seq_no=250*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3672,7 +3673,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-251
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-251 ddl
/*!100001 SET @@session.gtid_seq_no=251*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3685,8 +3686,8 @@ CREATE TABLE t1 (c68 BLOB)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3702,8 +3703,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3714,7 +3715,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-254
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-254 ddl
/*!100001 SET @@session.gtid_seq_no=254*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3722,7 +3723,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-255
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-255 ddl
/*!100001 SET @@session.gtid_seq_no=255*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3735,8 +3736,8 @@ CREATE TABLE t1 (c71 MEDIUMBLOB)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3752,8 +3753,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3764,7 +3765,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-258
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-258 ddl
/*!100001 SET @@session.gtid_seq_no=258*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3772,7 +3773,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-259
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-259 ddl
/*!100001 SET @@session.gtid_seq_no=259*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3785,8 +3786,8 @@ CREATE TABLE t1 (c74 LONGBLOB)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3802,8 +3803,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3814,7 +3815,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-262
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-262 ddl
/*!100001 SET @@session.gtid_seq_no=262*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3822,7 +3823,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-263
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-263 ddl
/*!100001 SET @@session.gtid_seq_no=263*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3835,8 +3836,8 @@ CREATE TABLE t1 (c66 TINYTEXT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3852,8 +3853,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3864,7 +3865,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-266
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-266 ddl
/*!100001 SET @@session.gtid_seq_no=266*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3872,7 +3873,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-267
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-267 ddl
/*!100001 SET @@session.gtid_seq_no=267*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3885,8 +3886,8 @@ CREATE TABLE t1 (c69 TEXT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3902,8 +3903,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3914,7 +3915,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-270
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-270 ddl
/*!100001 SET @@session.gtid_seq_no=270*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3922,7 +3923,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-271
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-271 ddl
/*!100001 SET @@session.gtid_seq_no=271*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3935,8 +3936,8 @@ CREATE TABLE t1 (c72 MEDIUMTEXT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3952,8 +3953,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3964,7 +3965,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-274
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-274 ddl
/*!100001 SET @@session.gtid_seq_no=274*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3972,7 +3973,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-275
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-275 ddl
/*!100001 SET @@session.gtid_seq_no=275*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3985,8 +3986,8 @@ CREATE TABLE t1 (c75 LONGTEXT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4002,8 +4003,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4014,7 +4015,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-278
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-278 ddl
/*!100001 SET @@session.gtid_seq_no=278*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4022,7 +4023,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-279
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-279 ddl
/*!100001 SET @@session.gtid_seq_no=279*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4035,8 +4036,8 @@ CREATE TABLE t1 (c67 TINYTEXT CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4052,8 +4053,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4064,7 +4065,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-282
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-282 ddl
/*!100001 SET @@session.gtid_seq_no=282*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4072,7 +4073,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-283
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-283 ddl
/*!100001 SET @@session.gtid_seq_no=283*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4085,8 +4086,8 @@ CREATE TABLE t1 (c70 TEXT CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4102,8 +4103,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4114,7 +4115,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-286
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-286 ddl
/*!100001 SET @@session.gtid_seq_no=286*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4122,7 +4123,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-287
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-287 ddl
/*!100001 SET @@session.gtid_seq_no=287*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4135,8 +4136,8 @@ CREATE TABLE t1 (c73 MEDIUMTEXT CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4152,8 +4153,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4164,7 +4165,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-290
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-290 ddl
/*!100001 SET @@session.gtid_seq_no=290*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4172,7 +4173,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-291
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-291 ddl
/*!100001 SET @@session.gtid_seq_no=291*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4185,8 +4186,8 @@ CREATE TABLE t1 (c76 LONGTEXT CHARACTER SET UCS2)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4202,8 +4203,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4214,7 +4215,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-294
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-294 ddl
/*!100001 SET @@session.gtid_seq_no=294*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4222,7 +4223,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-295
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-295 ddl
/*!100001 SET @@session.gtid_seq_no=295*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4235,8 +4236,8 @@ CREATE TABLE t1 (c77 ENUM('a','b','c'))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4252,8 +4253,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4264,7 +4265,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-298
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-298 ddl
/*!100001 SET @@session.gtid_seq_no=298*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4272,7 +4273,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-299
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-299 ddl
/*!100001 SET @@session.gtid_seq_no=299*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4285,8 +4286,8 @@ CREATE TABLE t1 (c78 SET('a','b','c','d','e','f'))
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4302,8 +4303,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4319,8 +4320,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4336,8 +4337,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4353,8 +4354,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4370,8 +4371,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4387,8 +4388,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4404,8 +4405,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4416,7 +4417,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-308
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-308 ddl
/*!100001 SET @@session.gtid_seq_no=308*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4424,7 +4425,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-309
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-309 ddl
/*!100001 SET @@session.gtid_seq_no=309*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4432,7 +4433,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t1 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0)
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-310
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-310 ddl
/*!100001 SET @@session.gtid_seq_no=310*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4445,8 +4446,8 @@ CREATE TABLE t2 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4463,8 +4464,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4481,8 +4482,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
@@ -4499,8 +4500,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
@@ -4517,11 +4518,11 @@ COMMIT
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
@@ -4558,7 +4559,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-316
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-316 ddl
/*!100001 SET @@session.gtid_seq_no=316*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4571,8 +4572,8 @@ DROP TABLE `t1`,`t2` /* generated by server */
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1dec102`
### SET
@@ -4587,8 +4588,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1dec102`
### SET
@@ -4603,8 +4604,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1dec102`
### SET
@@ -4614,7 +4615,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-320
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-320 ddl
/*!100001 SET @@session.gtid_seq_no=320*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 8d23c58732a..13c1ba62231 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -1,3 +1,4 @@
+set sql_mode="";
SET NAMES 'utf8';
#
# Preparatory cleanup.
@@ -49,7 +50,7 @@ c27 DECIMAL ZEROFILL,
#
c28 DATE,
c29 DATETIME,
-c30 TIMESTAMP,
+c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
c31 TIME,
c32 YEAR,
#
@@ -2257,7 +2258,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -2304,7 +2306,7 @@ c27 DECIMAL ZEROFILL,
#
c28 DATE,
c29 DATETIME,
-c30 TIMESTAMP,
+c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
c31 TIME,
c32 YEAR,
#
@@ -2364,13 +2366,13 @@ crn INT -- row number
) ENGINE=InnoDB DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2402,9 +2404,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2457,13 +2459,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2495,9 +2497,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2550,96 +2552,96 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `test`.`t1`
### SET
@@ -2671,9 +2673,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2726,13 +2728,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -2764,9 +2766,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2844,9 +2846,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2899,13 +2901,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -2937,9 +2939,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3017,9 +3019,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3072,94 +3074,94 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-7
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
@@ -3190,9 +3192,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3245,13 +3247,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-8
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-8 trans
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -3283,9 +3285,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3335,96 +3337,96 @@ BEGIN
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
### SET
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-9
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3456,9 +3458,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3511,13 +3513,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-10
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-10 trans
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3549,9 +3551,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3604,13 +3606,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-11
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-11 trans
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3642,9 +3644,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3697,94 +3699,94 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-12
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-12 trans
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Xid = #
@@ -3890,7 +3892,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -3913,13 +3916,13 @@ crn INT -- row number
) ENGINE=InnoDB DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -3970,13 +3973,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -4045,13 +4048,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4268,7 +4271,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4291,7 +4295,7 @@ c_1_n INT -- row number
) ENGINE=InnoDB DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4303,7 +4307,7 @@ c_2_n INT -- row number
) ENGINE=InnoDB DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4315,13 +4319,13 @@ c_3_n INT -- row number
) ENGINE=InnoDB DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4372,13 +4376,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
@@ -4429,13 +4433,13 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t3`
### SET
@@ -4486,19 +4490,19 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-7
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
# at #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
@@ -4668,19 +4672,19 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-8
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-8 trans
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
# at #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
@@ -4814,7 +4818,14 @@ LOAD DATA INFILE '../../std_data/loaddata5.dat'
INTO TABLE t1 FIELDS TERMINATED BY '' ENCLOSED BY '' (c1,c2)
SET c3 = 'Wow';
affected rows: 3
-info: Records: 3 Deleted: 0 Skipped: 0 Warnings: 0
+info: Records: 3 Deleted: 0 Skipped: 0 Warnings: 6
+Warnings:
+Note 1265 Data truncated for column 'c1' at row 1
+Note 1265 Data truncated for column 'c2' at row 1
+Note 1265 Data truncated for column 'c1' at row 2
+Note 1265 Data truncated for column 'c2' at row 2
+Note 1265 Data truncated for column 'c1' at row 3
+Note 1265 Data truncated for column 'c2' at row 3
#
# Show what we have in the table.
#
@@ -4846,7 +4857,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4869,13 +4881,13 @@ c3 VARCHAR(60)
) ENGINE=InnoDB DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index ce503b7371f..e2600c9953c 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -1,3 +1,4 @@
+set sql_mode="";
SET NAMES 'utf8';
#
# Preparatory cleanup.
@@ -49,7 +50,7 @@ c27 DECIMAL ZEROFILL,
#
c28 DATE,
c29 DATETIME,
-c30 TIMESTAMP,
+c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
c31 TIME,
c32 YEAR,
#
@@ -2257,7 +2258,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -2304,7 +2306,7 @@ c27 DECIMAL ZEROFILL,
#
c28 DATE,
c29 DATETIME,
-c30 TIMESTAMP,
+c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
c31 TIME,
c32 YEAR,
#
@@ -2369,8 +2371,8 @@ crn INT -- row number
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2402,9 +2404,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2465,8 +2467,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -2498,9 +2500,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2560,91 +2562,91 @@ COMMIT
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `test`.`t1`
### SET
@@ -2676,9 +2678,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2738,8 +2740,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -2771,9 +2773,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2851,9 +2853,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -2913,8 +2915,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -2946,9 +2948,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3026,9 +3028,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3088,89 +3090,89 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
@@ -3201,9 +3203,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3263,8 +3265,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -3296,9 +3298,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3348,84 +3350,84 @@ BEGIN
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
### SET
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3438,8 +3440,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3471,9 +3473,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2155 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='ÿ' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3533,8 +3535,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3566,9 +3568,9 @@ BEGIN
### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='-838:59:59' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='-838:59:59' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=1901 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3628,8 +3630,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -3661,9 +3663,9 @@ BEGIN
### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
-### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
-### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31='16:18:47' /* TIME meta=0 nullable=1 is_null=0 */
+### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31='16:18:47' /* TIME(0) meta=0 nullable=1 is_null=0 */
### @32=2008 /* YEAR meta=0 nullable=1 is_null=0 */
### @33='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
### @34='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
@@ -3723,89 +3725,89 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
-### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
-### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
-### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @5=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @6=NULL /* type=1 meta=0 nullable=1 is_null=1 */
-### @7=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @8=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @9=NULL /* type=2 meta=0 nullable=1 is_null=1 */
-### @10=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @11=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @12=NULL /* type=9 meta=0 nullable=1 is_null=1 */
-### @13=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @14=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @15=NULL /* type=3 meta=0 nullable=1 is_null=1 */
-### @16=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @17=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @18=NULL /* type=8 meta=0 nullable=1 is_null=1 */
-### @19=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @20=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @21=NULL /* type=4 meta=4 nullable=1 is_null=1 */
-### @22=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @23=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @24=NULL /* type=5 meta=8 nullable=1 is_null=1 */
-### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
-### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
-### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
-### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @32=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @33=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @34=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @35=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @36=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @37=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @38=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @39=NULL /* TIMESTAMP meta=65027 nullable=1 is_null=1 */
-### @40=NULL /* TIMESTAMP meta=57085 nullable=1 is_null=1 */
-### @41=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @42=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @43=NULL /* TIMESTAMP meta=65026 nullable=1 is_null=1 */
-### @44=NULL /* TIMESTAMP meta=61182 nullable=1 is_null=1 */
-### @45=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @46=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @47=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @48=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @49=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @50=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @51=NULL /* TIMESTAMP meta=765 nullable=1 is_null=1 */
-### @52=NULL /* TIMESTAMP meta=783 nullable=1 is_null=1 */
-### @53=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @54=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @55=NULL /* TIMESTAMP meta=510 nullable=1 is_null=1 */
-### @56=NULL /* TIMESTAMP meta=522 nullable=1 is_null=1 */
-### @57=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @58=NULL /* TIMESTAMP meta=65024 nullable=1 is_null=1 */
-### @59=NULL /* TIMESTAMP meta=65025 nullable=1 is_null=1 */
-### @60=NULL /* TIMESTAMP meta=65279 nullable=1 is_null=1 */
-### @61=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
-### @62=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @63=NULL /* TIMESTAMP meta=255 nullable=1 is_null=1 */
-### @64=NULL /* TIMESTAMP meta=261 nullable=1 is_null=1 */
-### @65=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @66=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @67=NULL /* TIMESTAMP meta=1 nullable=1 is_null=1 */
-### @68=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @69=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @70=NULL /* TIMESTAMP meta=2 nullable=1 is_null=1 */
-### @71=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @72=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @73=NULL /* TIMESTAMP meta=3 nullable=1 is_null=1 */
-### @74=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @75=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @76=NULL /* TIMESTAMP meta=4 nullable=1 is_null=1 */
-### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
-### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
+### @1=NULL /* BIT(1) meta=1 nullable=1 is_null=1 */
+### @2=NULL /* BIT(64) meta=2048 nullable=1 is_null=1 */
+### @3=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @4=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @5=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @6=NULL /* TINYINT meta=0 nullable=1 is_null=1 */
+### @7=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @8=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @9=NULL /* SHORTINT meta=0 nullable=1 is_null=1 */
+### @10=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @11=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @12=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */
+### @13=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @14=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @15=NULL /* INT meta=0 nullable=1 is_null=1 */
+### @16=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @17=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @18=NULL /* LONGINT meta=0 nullable=1 is_null=1 */
+### @19=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @20=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @21=NULL /* FLOAT meta=4 nullable=1 is_null=1 */
+### @22=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @23=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @24=NULL /* DOUBLE meta=8 nullable=1 is_null=1 */
+### @25=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @26=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @27=NULL /* DECIMAL(10,0) meta=2560 nullable=1 is_null=1 */
+### @28=NULL /* DATE meta=0 nullable=1 is_null=1 */
+### @29=NULL /* DATETIME(0) meta=0 nullable=1 is_null=1 */
+### @30=1000000000 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+### @31=NULL /* TIME(0) meta=0 nullable=1 is_null=1 */
+### @32=NULL /* YEAR meta=0 nullable=1 is_null=1 */
+### @33=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @34=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @35=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @36=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @37=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @38=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @39=NULL /* STRING(3) meta=65027 nullable=1 is_null=1 */
+### @40=NULL /* STRING(765) meta=57085 nullable=1 is_null=1 */
+### @41=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @42=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @43=NULL /* STRING(2) meta=65026 nullable=1 is_null=1 */
+### @44=NULL /* STRING(510) meta=61182 nullable=1 is_null=1 */
+### @45=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @46=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @47=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @48=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @49=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @50=NULL /* VARSTRING(3) meta=3 nullable=1 is_null=1 */
+### @51=NULL /* VARSTRING(765) meta=765 nullable=1 is_null=1 */
+### @52=NULL /* VARSTRING(783) meta=783 nullable=1 is_null=1 */
+### @53=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @54=NULL /* VARSTRING(2) meta=2 nullable=1 is_null=1 */
+### @55=NULL /* VARSTRING(510) meta=510 nullable=1 is_null=1 */
+### @56=NULL /* VARSTRING(522) meta=522 nullable=1 is_null=1 */
+### @57=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @58=NULL /* STRING(0) meta=65024 nullable=1 is_null=1 */
+### @59=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+### @60=NULL /* STRING(255) meta=65279 nullable=1 is_null=1 */
+### @61=NULL /* VARSTRING(0) meta=0 nullable=1 is_null=1 */
+### @62=NULL /* VARSTRING(1) meta=1 nullable=1 is_null=1 */
+### @63=NULL /* VARSTRING(255) meta=255 nullable=1 is_null=1 */
+### @64=NULL /* VARSTRING(261) meta=261 nullable=1 is_null=1 */
+### @65=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @66=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @67=NULL /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=1 */
+### @68=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @69=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @70=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### @71=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @72=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @73=NULL /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=1 */
+### @74=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @75=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @76=NULL /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=1 */
+### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
+### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -3913,7 +3915,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -3941,8 +3944,8 @@ crn INT -- row number
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4000,8 +4003,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -4077,8 +4080,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -4297,7 +4300,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4320,7 +4324,7 @@ c_1_n INT -- row number
) ENGINE=MyISAM DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4332,7 +4336,7 @@ c_2_n INT -- row number
) ENGINE=MyISAM DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -4349,8 +4353,8 @@ c_3_n INT -- row number
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -4408,8 +4412,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
@@ -4467,8 +4471,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t3`
### SET
@@ -4526,14 +4530,14 @@ COMMIT
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
# at #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
@@ -4710,14 +4714,14 @@ COMMIT
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
# at #
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
@@ -4853,7 +4857,14 @@ LOAD DATA INFILE '../../std_data/loaddata5.dat'
INTO TABLE t1 FIELDS TERMINATED BY '' ENCLOSED BY '' (c1,c2)
SET c3 = 'Wow';
affected rows: 3
-info: Records: 3 Deleted: 0 Skipped: 0 Warnings: 0
+info: Records: 3 Deleted: 0 Skipped: 0 Warnings: 6
+Warnings:
+Note 1265 Data truncated for column 'c1' at row 1
+Note 1265 Data truncated for column 'c2' at row 1
+Note 1265 Data truncated for column 'c1' at row 2
+Note 1265 Data truncated for column 'c2' at row 2
+Note 1265 Data truncated for column 'c1' at row 3
+Note 1265 Data truncated for column 'c2' at row 3
#
# Show what we have in the table.
#
@@ -4885,7 +4896,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4913,8 +4925,8 @@ c3 VARCHAR(60)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index 7feb5313246..d1c6ef1f100 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -136,7 +136,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -146,7 +147,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -158,7 +159,7 @@ c2 VARCHAR(20)
) ENGINE=InnoDB DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -169,13 +170,13 @@ c2 VARCHAR(20)
) ENGINE=MyISAM DEFAULT CHARSET latin1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -190,8 +191,8 @@ BEGIN
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -215,8 +216,8 @@ BEGIN
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -226,7 +227,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -234,7 +235,7 @@ SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -247,8 +248,8 @@ TRUNCATE TABLE t1
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
@@ -273,8 +274,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t2`
### WHERE
@@ -308,8 +309,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t2`
### WHERE
@@ -321,13 +322,13 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-9
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -342,8 +343,8 @@ BEGIN
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -367,8 +368,8 @@ BEGIN
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -378,7 +379,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Xid = #
COMMIT/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-10
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-10 ddl
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -386,7 +387,7 @@ SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-11
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-11 ddl
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -399,8 +400,8 @@ TRUNCATE TABLE t2
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
@@ -425,8 +426,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t2`
### WHERE
@@ -460,8 +461,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t2`
### WHERE
@@ -473,7 +474,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-15
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-15 ddl
/*!100001 SET @@session.gtid_seq_no=15*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -481,7 +482,7 @@ SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-16
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-16 ddl
/*!100001 SET @@session.gtid_seq_no=16*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
diff --git a/mysql-test/suite/binlog/r/binlog_old_versions.result b/mysql-test/suite/binlog/r/binlog_old_versions.result
index 594f1101a38..30b64535eb4 100644
--- a/mysql-test/suite/binlog/r/binlog_old_versions.result
+++ b/mysql-test/suite/binlog/r/binlog_old_versions.result
@@ -53,7 +53,7 @@ SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t3;
-==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
+==== Read binlog from telco tree (mysql-5.1-telco-6.1) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
new file mode 100644
index 00000000000..e9a744a748e
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
@@ -0,0 +1,94 @@
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t1 VALUES (1,0);
+/* GTID */ BEGIN;
+/* GTID */ INSERT INTO t1 VALUES (2,0);
+/* GTID */ ALTER TABLE t1 ADD c INT;
+/* GTID */ INSERT INTO t1 VALUES (3,0,0);
+/* GTID */ COMMIT;
+/* GTID */ BEGIN;
+/* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2;
+/* GTID */ CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t2 VALUES (4,10), (5,20);
+/* GTID */ INSERT INTO t1 SELECT a, 2, b FROM t2;
+/* GTID */ DROP TEMPORARY TABLE t2;
+/* GTID */ INSERT INTO t1 VALUES (6, 3, 0);
+/* GTID */ COMMIT;
+/* GTID */ CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ BEGIN;
+/* GTID */ DELETE FROM t1 WHERE a=5;
+/* GTID */ INSERT INTO t3 VALUES (7);
+/* GTID */ INSERT INTO t1 SELECT a, 4, 0 FROM t3;
+/* GTID */ UPDATE t1 SET c=1 WHERE a=7;
+/* GTID */ DROP TEMPORARY TABLE t3;
+/* GTID */ COMMIT;
+/* GTID */ CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ BEGIN;
+/* GTID */ INSERT INTO t1 VALUES (8, 5, 0);
+/* GTID */ ALTER TABLE t4 ADD b INT;
+/* GTID */ INSERT INTO t1 VALUES (9, 5, 1);
+/* GTID */ COMMIT;
+/* GTID */ INSERT INTO t1 VALUES (10, 6, 0);
+/* GTID */ BEGIN;
+/* GTID */ CREATE TEMPORARY TABLE t5 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t1 VALUES (11, 7, 0);
+/* GTID */ COMMIT;
+FLUSH LOGS;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+/* GTID */ ALTER TABLE t1 ADD c INT
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+# server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
+# server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t5`
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
new file mode 100644
index 00000000000..c2876a3e849
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
@@ -0,0 +1,93 @@
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t1 VALUES (1,0);
+/* GTID */ BEGIN;
+/* GTID */ INSERT INTO t1 VALUES (2,0);
+/* GTID */ ALTER TABLE t1 ADD c INT;
+/* GTID */ INSERT INTO t1 VALUES (3,0,0);
+/* GTID */ COMMIT;
+/* GTID */ BEGIN;
+/* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2;
+/* GTID */ CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t2 VALUES (4,10), (5,20);
+/* GTID */ INSERT INTO t1 SELECT a, 2, b FROM t2;
+/* GTID */ DROP TEMPORARY TABLE t2;
+/* GTID */ INSERT INTO t1 VALUES (6, 3, 0);
+/* GTID */ COMMIT;
+/* GTID */ CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ BEGIN;
+/* GTID */ DELETE FROM t1 WHERE a=5;
+/* GTID */ INSERT INTO t3 VALUES (7);
+/* GTID */ INSERT INTO t1 SELECT a, 4, 0 FROM t3;
+/* GTID */ UPDATE t1 SET c=1 WHERE a=7;
+/* GTID */ DROP TEMPORARY TABLE t3;
+/* GTID */ COMMIT;
+/* GTID */ CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ BEGIN;
+/* GTID */ INSERT INTO t1 VALUES (8, 5, 0);
+/* GTID */ ALTER TABLE t4 ADD b INT;
+/* GTID */ INSERT INTO t1 VALUES (9, 5, 1);
+/* GTID */ COMMIT;
+/* GTID */ INSERT INTO t1 VALUES (10, 6, 0);
+/* GTID */ BEGIN;
+/* GTID */ CREATE TEMPORARY TABLE t5 (a INT PRIMARY KEY) ENGINE=InnoDB;
+/* GTID */ INSERT INTO t1 VALUES (11, 7, 0);
+/* GTID */ COMMIT;
+FLUSH LOGS;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+/* GTID */ INSERT INTO t1 VALUES (1,0)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+/* GTID */ INSERT INTO t1 VALUES (2,0)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+/* GTID */ ALTER TABLE t1 ADD c INT
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+/* GTID */ INSERT INTO t1 VALUES (3,0,0)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+BEGIN
+/* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2
+/* GTID */ CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+/* GTID */ INSERT INTO t2 VALUES (4,10), (5,20)
+/* GTID */ INSERT INTO t1 SELECT a, 2, b FROM t2
+DROP TEMPORARY TABLE `t2` /* generated by server */
+/* GTID */ INSERT INTO t1 VALUES (6, 3, 0)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+/* GTID */ CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB
+# server id 1 end_log_pos # GTID #-#-# ddl
+BEGIN
+/* GTID */ DELETE FROM t1 WHERE a=5
+/* GTID */ INSERT INTO t3 VALUES (7)
+/* GTID */ INSERT INTO t1 SELECT a, 4, 0 FROM t3
+/* GTID */ UPDATE t1 SET c=1 WHERE a=7
+DROP TEMPORARY TABLE `t3` /* generated by server */
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+/* GTID */ CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+/* GTID */ INSERT INTO t1 VALUES (8, 5, 0)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+/* GTID */ ALTER TABLE t4 ADD b INT
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+/* GTID */ INSERT INTO t1 VALUES (9, 5, 1)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# trans
+BEGIN
+/* GTID */ INSERT INTO t1 VALUES (10, 6, 0)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+BEGIN
+/* GTID */ CREATE TEMPORARY TABLE t5 (a INT PRIMARY KEY) ENGINE=InnoDB
+/* GTID */ INSERT INTO t1 VALUES (11, 7, 0)
+COMMIT/*!*/;
+# server id 1 end_log_pos # GTID #-#-# ddl
+DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t5`
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index c59344b729e..6070f2da608 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -80,7 +80,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -98,7 +99,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
DROP DATABASE IF EXISTS test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -106,7 +107,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -114,7 +115,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test3
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -122,7 +123,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -130,7 +131,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -143,8 +144,8 @@ CREATE DATABASE test3
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test1`.`t1`
### SET
@@ -167,10 +168,10 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> INSERT INTO test2.t2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -193,10 +194,10 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> INSERT INTO test3.t3 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test3`.`t3`
### SET
@@ -219,15 +220,15 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
-# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> DELETE test1.t1, test2.t2
#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test1`.`t1`
@@ -260,10 +261,10 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> INSERT INTO test2.v2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -286,12 +287,12 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> DELETE xtest1.xt1, test2.t2
#Q> FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
#Q> WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test2`.`t2`
### WHERE
@@ -332,7 +333,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -350,15 +352,15 @@ SET @@session.collation_database=DEFAULT/*!*/;
DROP DATABASE IF EXISTS test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -366,11 +368,11 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
# at #
@@ -379,8 +381,8 @@ CREATE DATABASE test1
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test1`.`t1`
### SET
@@ -429,14 +431,14 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
-# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> DELETE test1.t1, test2.t2
#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+# at #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
### DELETE FROM `test1`.`t1`
### WHERE
@@ -503,7 +505,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -521,7 +524,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
DROP DATABASE IF EXISTS test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -529,7 +532,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -537,7 +540,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test3
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -545,7 +548,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -553,7 +556,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -566,8 +569,8 @@ CREATE DATABASE test3
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test1`.`t1`
### SET
@@ -590,8 +593,8 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -614,8 +617,8 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test3`.`t3`
### SET
@@ -638,11 +641,11 @@ BEGIN
/*!*/;
# at #
# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
-#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test1`.`t1`
@@ -675,8 +678,8 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -699,8 +702,8 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test2`.`t2`
### WHERE
@@ -745,7 +748,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -763,7 +767,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
DROP DATABASE IF EXISTS test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -771,7 +775,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -779,7 +783,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test3
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -787,7 +791,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -795,7 +799,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -808,8 +812,8 @@ CREATE DATABASE test3
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test1`.`t1`
### SET
@@ -832,10 +836,10 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> INSERT INTO test2.t2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -858,10 +862,10 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> INSERT INTO test3.t3 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test3`.`t3`
### SET
@@ -884,15 +888,15 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
-# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> DELETE test1.t1, test2.t2
#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test1`.`t1`
@@ -925,10 +929,10 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> INSERT INTO test2.v2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -951,12 +955,12 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> DELETE xtest1.xt1, test2.t2
#Q> FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
#Q> WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test2`.`t2`
### WHERE
@@ -997,7 +1001,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -1015,15 +1020,15 @@ SET @@session.collation_database=DEFAULT/*!*/;
DROP DATABASE IF EXISTS test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1031,11 +1036,11 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
# at #
@@ -1044,8 +1049,8 @@ CREATE DATABASE test1
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test1`.`t1`
### SET
@@ -1094,14 +1099,14 @@ BEGIN
/*!*/;
# at #
# at #
-# at #
-# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Annotate_rows:
#Q> DELETE test1.t1, test2.t2
#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+# at #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
### DELETE FROM `test1`.`t1`
### WHERE
@@ -1168,7 +1173,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -1186,7 +1192,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
DROP DATABASE IF EXISTS test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-2
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1194,7 +1200,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1202,7 +1208,7 @@ SET TIMESTAMP=1000000000/*!*/;
DROP DATABASE IF EXISTS test3
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1210,7 +1216,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test1
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1218,7 +1224,7 @@ SET TIMESTAMP=1000000000/*!*/;
CREATE DATABASE test2
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -1231,8 +1237,8 @@ CREATE DATABASE test3
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test1`.`t1`
### SET
@@ -1254,8 +1260,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -1277,8 +1283,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test3`.`t3`
### SET
@@ -1300,11 +1306,11 @@ COMMIT
BEGIN
/*!*/;
# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
# at #
# at #
-#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
-#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test1`.`t1`
@@ -1336,8 +1342,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -1359,8 +1365,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test2`.`t2`
### WHERE
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index eb82ac4cc4b..cb6b344e311 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -552,8 +552,6 @@ COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
COERCIBILITY(s1) d3;
DROP TEMPORARY TABLE tmp1;
END
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `bug39182`.`tmp1` /* generated by server */
DROP PROCEDURE p1;
DROP TABLE t1;
DROP DATABASE bug39182;
@@ -806,9 +804,11 @@ SELECT * FROM t1;
c1
1
# Their values should be ON
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks ON
+SHOW SESSION VARIABLES LIKE "unique_checks";
+Variable_name Value
unique_checks ON
SET @@SESSION.foreign_key_checks= OFF;
@@ -824,9 +824,11 @@ c1
1
2
# Their values should be OFF
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
+SHOW SESSION VARIABLES LIKE "unique_checks";
+Variable_name Value
unique_checks OFF
# INSERT INTO t1 VALUES(2)
# foreign_key_checks=1 and unique_checks=1
@@ -842,8 +844,10 @@ c1
1
2
# Their values should be OFF
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
+SHOW SESSION VARIABLES LIKE "unique_checks";
+Variable_name Value
unique_checks OFF
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
index c34ccdf5601..346b7a58179 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
@@ -11499,9 +11499,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -11594,9 +11606,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index c446c0f4861..6b56c006518 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -20,7 +20,7 @@ BEGIN
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
index 01525462782..dce2cc1408c 100644
--- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
@@ -34,14 +34,6 @@ master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-te
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp3` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */
diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index 35607ea7f95..f8f4fa5ec31 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
@@ -438,8 +438,6 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
reset master;
create table t1 (a int) engine=innodb;
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index 926e962731f..7c17d8ca53c 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -40,7 +40,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -50,7 +51,7 @@ use `new_test1`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -64,8 +65,8 @@ CREATE TABLE t1 (a INT, b INT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test1`.`t1`
### SET
@@ -81,7 +82,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -95,8 +96,8 @@ CREATE TABLE t2 (a INT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -115,8 +116,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `new_test1`.`t1`
### WHERE
@@ -128,7 +129,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
use `new_test3`/*!*/;
@@ -142,8 +143,8 @@ CREATE TABLE t3 (a INT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test3`.`t3`
### SET
@@ -162,8 +163,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test1`.`t1`
### SET
@@ -180,8 +181,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test1`.`t1`
### SET
@@ -214,8 +215,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `new_test3`.`t3`
### WHERE
@@ -251,7 +252,8 @@ ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-1
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -261,7 +263,7 @@ use `new_test1`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -275,8 +277,8 @@ CREATE TABLE t1 (a INT, b INT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test1`.`t1`
### SET
@@ -292,7 +294,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-3
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -306,8 +308,8 @@ CREATE TABLE t2 (a INT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test2`.`t2`
### SET
@@ -326,8 +328,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `new_test1`.`t1`
### WHERE
@@ -339,7 +341,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
# at #
use `new_test3`/*!*/;
@@ -353,8 +355,8 @@ CREATE TABLE t3 (a INT)
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test3`.`t3`
### SET
@@ -373,8 +375,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test1`.`t1`
### SET
@@ -391,8 +393,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `new_test1`.`t1`
### SET
@@ -425,8 +427,8 @@ COMMIT
BEGIN
/*!*/;
# at #
-# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
+# at #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `new_test3`.`t3`
### WHERE
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index 824bf3ed2a0..3a6af15e88a 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -618,9 +618,11 @@ SELECT * FROM t1;
c1
1
# Their values should be ON
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks ON
+SHOW SESSION VARIABLES LIKE "unique_checks";
+Variable_name Value
unique_checks ON
SET @@SESSION.foreign_key_checks= OFF;
@@ -636,9 +638,11 @@ c1
1
2
# Their values should be OFF
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
+SHOW SESSION VARIABLES LIKE "unique_checks";
+Variable_name Value
unique_checks OFF
# INSERT INTO t1 VALUES(2)
# foreign_key_checks=1 and unique_checks=1
@@ -654,8 +658,10 @@ c1
1
2
# Their values should be OFF
-SHOW SESSION VARIABLES LIKE "%_checks";
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
+SHOW SESSION VARIABLES LIKE "unique_checks";
+Variable_name Value
unique_checks OFF
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
index c34ccdf5601..346b7a58179 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
@@ -11499,9 +11499,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
@@ -11594,9 +11606,21 @@ CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+Warnings:
+Warning 1364 Field 'c' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index 55db2de4b52..825b9bf05a0 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -22,7 +22,7 @@ use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_variables_log_bin.result b/mysql-test/suite/binlog/r/binlog_variables_log_bin.result
new file mode 100644
index 00000000000..215e14f97df
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_log_bin.result
@@ -0,0 +1,9 @@
+SHOW VARIABLES LIKE 'log_bin%';
+Variable_name log_bin
+Value ON
+Variable_name log_bin_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other
+Variable_name log_bin_index
+Value MYSQLTEST_VARDIR/mysqld.1/data/mysqld-bin.index
+Variable_name log_bin_trust_function_creators
+Value ON
diff --git a/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result b/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result
new file mode 100644
index 00000000000..fb7324ced34
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result
@@ -0,0 +1,9 @@
+SHOW VARIABLES LIKE 'log_bin%';
+Variable_name log_bin
+Value ON
+Variable_name log_bin_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other
+Variable_name log_bin_index
+Value MYSQLTEST_VARDIR/tmp/something.index
+Variable_name log_bin_trust_function_creators
+Value ON
diff --git a/mysql-test/suite/binlog/r/binlog_variables_relay_log.result b/mysql-test/suite/binlog/r/binlog_variables_relay_log.result
new file mode 100644
index 00000000000..59135837c29
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_relay_log.result
@@ -0,0 +1,15 @@
+SHOW VARIABLES LIKE 'relay_log%';
+Variable_name relay_log
+Value other-relay
+Variable_name relay_log_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other-relay
+Variable_name relay_log_index
+Value MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
+Variable_name relay_log_info_file
+Value relay-log.info
+Variable_name relay_log_purge
+Value ON
+Variable_name relay_log_recovery
+Value OFF
+Variable_name relay_log_space_limit
+Value 0
diff --git a/mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result b/mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result
new file mode 100644
index 00000000000..1b18b89d298
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result
@@ -0,0 +1,15 @@
+SHOW VARIABLES LIKE 'relay_log%';
+Variable_name relay_log
+Value other-relay
+Variable_name relay_log_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other-relay
+Variable_name relay_log_index
+Value MYSQLTEST_VARDIR/tmp/something-relay.index
+Variable_name relay_log_info_file
+Value relay-log.info
+Variable_name relay_log_purge
+Value ON
+Variable_name relay_log_recovery
+Value OFF
+Variable_name relay_log_space_limit
+Value 0
diff --git a/mysql-test/suite/binlog/r/mysqladmin.result b/mysql-test/suite/binlog/r/mysqladmin.result
new file mode 100644
index 00000000000..4be6c96d55b
--- /dev/null
+++ b/mysql-test/suite/binlog/r/mysqladmin.result
@@ -0,0 +1,12 @@
+create user adm@localhost identified by 'foobar';
+grant reload on *.* to adm@localhost;
+reset master;
+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 # # flush status
+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 # # flush status
+drop user adm@localhost;
diff --git a/mysql-test/suite/binlog/t/binlog_dmls_on_tmp_tables_readonly.test b/mysql-test/suite/binlog/t/binlog_dmls_on_tmp_tables_readonly.test
index cf3910eb229..0fa35d57745 100644
--- a/mysql-test/suite/binlog/t/binlog_dmls_on_tmp_tables_readonly.test
+++ b/mysql-test/suite/binlog/t/binlog_dmls_on_tmp_tables_readonly.test
@@ -25,6 +25,7 @@ DROP TABLE IF EXISTS t1 ;
--enable_connect_log
--echo # READ_ONLY does nothing to SUPER users
--echo # so we use a non-SUPER one:
+CREATE USER test@localhost;
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
connect (con1,localhost,test,,test);
diff --git a/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test b/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test
new file mode 100644
index 00000000000..0faafa35a1b
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test
@@ -0,0 +1,137 @@
+# Prove basic properties of
+#
+# FLUSH BINARY LOGS DELETE_DOMAIN_ID = (...)
+#
+# The command removes the supplied list of domains from the current
+# @@global.gtid_binlog_state provided the binlog files do not contain
+# events from such domains.
+
+# The test is not format specific. One format is chosen to run it.
+--source include/have_binlog_format_mixed.inc
+
+# Reset binlog state
+RESET MASTER;
+
+# Empty list is accepted
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = ();
+--echo and the command execution is effective thence rotates binlog as usual
+--source include/show_binary_logs.inc
+
+--echo Non-existed domain is warned, the command completes without rotation
+--echo but with a warning
+--let $binlog_pre_flush=query_get_value(SHOW MASTER STATUS, Position, 1)
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
+--let $binlog_start=$binlog_pre_flush
+--source include/show_binary_logs.inc
+
+# Log one event in a specified domain and try to delete the domain
+SET @@SESSION.gtid_domain_id=1;
+SET @@SESSION.server_id=1;
+CREATE TABLE t (a int);
+
+--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+
+# the same error after log rotation
+FLUSH BINARY LOGS;
+--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+
+# the latest binlog does not really contain any events incl ones from 1-domain
+--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--eval PURGE BINARY LOGS TO '$purge_to_binlog';
+# So now it's safe to delete
+--error 0
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+--echo Gtid_list of the current binlog does not contain '1':
+--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
+--source include/show_gtid_list.inc
+--echo But the previous log's Gtid_list may have it which explains a warning from the following command
+--let $binlog_file=$purge_to_binlog
+--source include/show_gtid_list.inc
+
+--echo Already deleted domain in Gtid_list of the earliest log is benign
+--echo but may cause a warning
+--error 0
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
+
+# Few domains delete. The chosen number verifies among others how
+# expected overrun of the static buffers of underlying dynamic arrays is doing.
+--let $domain_cnt=17
+--let $server_in_domain_cnt=3
+--let $domain_list=
+--disable_query_log
+while ($domain_cnt)
+{
+ --let servers=$server_in_domain_cnt
+ --eval SET @@SESSION.gtid_domain_id=$domain_cnt
+ while ($servers)
+ {
+ --eval SET @@SESSION.server_id=10*$domain_cnt + $servers
+ --eval INSERT INTO t SET a=@@SESSION.server_id
+
+ --dec $servers
+ }
+ --let $domain_list= $domain_cnt, $domain_list
+
+ --dec $domain_cnt
+}
+--enable_query_log
+--let $zero=0
+--let $domain_list= $domain_list$zero
+
+--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
+--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($domain_list)
+
+# Now satisfy the safety condtion to purge log files containing $domain list
+FLUSH BINARY LOGS;
+--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--eval PURGE BINARY LOGS TO '$purge_to_binlog'
+--error 0
+--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($domain_list)
+--echo Gtid_list of the current binlog does not contain $domain_list:
+--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
+--source include/show_gtid_list.inc
+
+# Show reaction on @@global.gtid_binlog_state not succeeding
+# earlier state as described by the 1st binlog' Gtid_list.
+# Now let it be out-order gtid logged to a domain unrelated to deletion.
+
+--let $del_d_id=1
+--eval SET @@SESSION.gtid_domain_id=$del_d_id;
+SET @@SESSION.server_id=1;
+SET @@SESSION.gtid_seq_no=1;
+INSERT INTO t SET a=1;
+SET @@SESSION.server_id=2;
+SET @@SESSION.gtid_seq_no=2;
+INSERT INTO t SET a=2;
+
+SET @@SESSION.gtid_domain_id=11;
+SET @@SESSION.server_id=11;
+SET @@SESSION.gtid_seq_no=11;
+INSERT INTO t SET a=11;
+
+SET @gtid_binlog_state_saved=@@GLOBAL.gtid_binlog_state;
+FLUSH BINARY LOGS;
+
+# Inject out of order for domain '11' before
+SET @@SESSION.gtid_domain_id=11;
+SET @@SESSION.server_id=11;
+SET @@SESSION.gtid_seq_no=1;
+INSERT INTO t SET a=1;
+
+SELECT @gtid_binlog_state_saved "as original state", @@GLOBAL.gtid_binlog_state as "out of order for 11 domain state";
+
+# to delete '1', first to purge logs containing its events
+--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--eval PURGE BINARY LOGS TO '$purge_to_binlog'
+
+--echo the following command succeeds with warnings
+--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($del_d_id)
+
+#
+# Cleanup
+#
+
+DROP TABLE t;
+RESET MASTER;
diff --git a/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-test/suite/binlog/t/binlog_grant.test
index 0c9d9a45ec9..8a76b11e707 100644
--- a/mysql-test/suite/binlog/t/binlog_grant.test
+++ b/mysql-test/suite/binlog/t/binlog_grant.test
@@ -58,6 +58,7 @@ drop user mysqltest_1@localhost;
# Testing if REPLICATION CLIENT privilege is enough to execute
# SHOW MASTER LOGS and SHOW BINARY.
+CREATE USER 'mysqltest_1'@'localhost';
GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost';
--connect(rpl,localhost,mysqltest_1,,)
diff --git a/mysql-test/suite/binlog/t/binlog_gtid_delete_domain_debug.test b/mysql-test/suite/binlog/t/binlog_gtid_delete_domain_debug.test
new file mode 100644
index 00000000000..5de549c45bb
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_gtid_delete_domain_debug.test
@@ -0,0 +1,11 @@
+# Check "internal" error branches of
+# FLUSH BINARY LOGS DELETE_DOMAIN_ID = (...)
+# handler.
+--source include/have_debug.inc
+--source include/have_binlog_format_mixed.inc
+
+SET @@SESSION.debug_dbug='+d,inject_binlog_delete_domain_init_error';
+--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
+
+SHOW WARNINGS;
diff --git a/mysql-test/suite/binlog/t/binlog_incident.test b/mysql-test/suite/binlog/t/binlog_incident.test
index 1c526ca5980..c4270a074f0 100644
--- a/mysql-test/suite/binlog/t/binlog_incident.test
+++ b/mysql-test/suite/binlog/t/binlog_incident.test
@@ -1,29 +1 @@
-# The purpose of this test is to provide a reference for how the
-# incident log event is represented in the output from the mysqlbinlog
-# program.
-
-source include/have_log_bin.inc;
-source include/have_debug.inc;
-source include/binlog_start_pos.inc;
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-RESET MASTER;
-
-CREATE TABLE t1 (a INT);
-
-INSERT INTO t1 VALUES (1),(2),(3);
-SELECT * FROM t1;
-
-# This will generate an incident log event and store it in the binary
-# log before the replace statement.
-REPLACE INTO t1 VALUES (4);
-
-DROP TABLE t1;
-FLUSH LOGS;
-
-exec $MYSQL_BINLOG --start-position=$binlog_start_pos $MYSQLD_DATADIR/master-bin.000001 >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
---disable_query_log
-eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
---enable_query_log
-
-remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
+--source extra/binlog_tests/binlog_incident.inc
diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test
index 09e817c0469..1837c683bba 100644
--- a/mysql-test/suite/binlog/t/binlog_index.test
+++ b/mysql-test/suite/binlog/t/binlog_index.test
@@ -1,266 +1 @@
-#
-# testing of purging of binary log files bug#18199/Bug#18453
-#
-source include/have_log_bin.inc;
-source include/not_embedded.inc;
-# Don't test this under valgrind, memory leaks will occur
---source include/not_valgrind.inc
-source include/have_debug.inc;
-# Avoid CrashReporter popup on Mac
---source include/not_crashrep.inc
-call mtr.add_suppression('Attempting backtrace');
-call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
-call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
-call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
-call mtr.add_suppression('Could not open .*');
-call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
-flush tables;
-
-let $old=`select @@debug`;
-
-RESET MASTER;
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $INDEX=$MYSQLD_DATADIR/master-bin.index;
-
-#
-# testing purge binary logs TO
-#
-
-flush logs;
-flush logs;
-flush logs;
-
-source include/show_binary_logs.inc;
-remove_file $MYSQLD_DATADIR/master-bin.000001;
-flush tables;
-
-# there must be a warning with file names
-replace_regex /\.[\\\/]master/master/;
-purge binary logs TO 'master-bin.000004';
-
---echo *** must show a list starting from the 'TO' argument of PURGE ***
-source include/show_binary_logs.inc;
-
-#
-# testing purge binary logs BEFORE
-#
-
-reset master;
-
-flush logs;
-flush logs;
-flush logs;
-remove_file $MYSQLD_DATADIR/master-bin.000001;
-
---echo *** must be a warning master-bin.000001 was not found ***
-let $date=`select NOW() + INTERVAL 1 MINUTE`;
---disable_query_log
-replace_regex /\.[\\\/]master/master/;
-eval purge binary logs BEFORE '$date';
---enable_query_log
-
---echo *** must show one record, of the active binlog, left in the index file after PURGE ***
-source include/show_binary_logs.inc;
-
-#
-# testing a fatal error
-# Turning a binlog file into a directory must be a portable setup
-#
-
-reset master;
-
-flush logs;
-flush logs;
-flush logs;
-
-remove_file $MYSQLD_DATADIR/master-bin.000001;
-mkdir $MYSQLD_DATADIR/master-bin.000001;
-
---error ER_BINLOG_PURGE_FATAL_ERR
-purge binary logs TO 'master-bin.000002';
-replace_regex /\.[\\\/]master/master/;
-show warnings;
-rmdir $MYSQLD_DATADIR/master-bin.000001;
---disable_warnings
-reset master;
---enable_warnings
-
---echo # crash_purge_before_update_index
-flush logs;
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-SET SESSION debug_dbug="+d,crash_purge_before_update_index";
---error 2013
-purge binary logs TO 'master-bin.000002';
-
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-file_exists $MYSQLD_DATADIR/master-bin.000001;
-file_exists $MYSQLD_DATADIR/master-bin.000002;
-file_exists $MYSQLD_DATADIR/master-bin.000003;
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo # crash_purge_non_critical_after_update_index
-flush logs;
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
---error 2013
-purge binary logs TO 'master-bin.000004';
-
---enable_reconnect
---source include/wait_until_connected_again.inc
-
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000001;
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000002;
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000003;
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo # crash_purge_critical_after_update_index
-flush logs;
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
---error 2013
-purge binary logs TO 'master-bin.000006';
-
---enable_reconnect
---source include/wait_until_connected_again.inc
-
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000004;
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000005;
-file_exists $MYSQLD_DATADIR/master-bin.000006;
-file_exists $MYSQLD_DATADIR/master-bin.000007;
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000008;
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo # crash_create_non_critical_before_update_index
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
---error 2013
-flush logs;
-
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-file_exists $MYSQLD_DATADIR/master-bin.000008;
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000009;
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo # crash_create_critical_before_update_index
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
---error 2013
-flush logs;
-
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-file_exists $MYSQLD_DATADIR/master-bin.000009;
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000010;
---error 1
-file_exists $MYSQLD_DATADIR/master-bin.000011;
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo # crash_create_after_update_index
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-SET SESSION debug_dbug="+d,crash_create_after_update_index";
---error 2013
-flush logs;
-
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-file_exists $MYSQLD_DATADIR/master-bin.000010;
-file_exists $MYSQLD_DATADIR/master-bin.000011;
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo #
---echo # This should put the server in unsafe state and stop
---echo # accepting any command. If we inject a fault at this
---echo # point and continue the execution the server crashes.
---echo #
-
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo # fault_injection_registering_index
-SET SESSION debug_dbug="+d,fault_injection_registering_index";
--- replace_regex /\.[\\\/]master/master/
--- error ER_CANT_OPEN_FILE
-flush logs;
-
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---source include/restart_mysqld.inc
-
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---echo # fault_injection_updating_index
-SET SESSION debug_dbug="+d,fault_injection_updating_index";
--- replace_regex /\.[\\\/]master/master/
--- error ER_CANT_OPEN_FILE
-flush logs;
-
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
---source include/restart_mysqld.inc
-
---chmod 0644 $INDEX
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SET @index=LOAD_FILE('$index')
--- replace_regex /\.[\\\/]master/master/
-SELECT @index;
-
-eval SET SESSION debug_dbug="$old";
-
---echo End of tests
+--source extra/binlog_tests/binlog_index.inc
diff --git a/mysql-test/suite/binlog/t/binlog_ioerr.test b/mysql-test/suite/binlog/t/binlog_ioerr.test
index f23fadfc1b4..3155e14e6b0 100644
--- a/mysql-test/suite/binlog/t/binlog_ioerr.test
+++ b/mysql-test/suite/binlog/t/binlog_ioerr.test
@@ -1,30 +1 @@
-source include/have_debug.inc;
-source include/have_innodb.inc;
-source include/have_log_bin.inc;
-source include/have_binlog_format_mixed_or_statement.inc;
-
-CALL mtr.add_suppression("Error writing file 'master-bin'");
-
-RESET MASTER;
-
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
-INSERT INTO t1 VALUES(0);
-SET SESSION debug_dbug='+d,fail_binlog_write_1';
---error ER_ERROR_ON_WRITE
-INSERT INTO t1 VALUES(1);
---error ER_ERROR_ON_WRITE
-INSERT INTO t1 VALUES(2);
-SET SESSION debug_dbug='';
-INSERT INTO t1 VALUES(3);
-SELECT * FROM t1;
-
-# Actually the output from this currently shows a bug.
-# The injected IO error leaves partially written transactions in the binlog in
-# the form of stray "BEGIN" events.
-# These should disappear from the output if binlog error handling is improved
-# (see MySQL Bug#37148 and WL#1790).
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
---replace_column 1 BINLOG 2 POS 5 ENDPOS
-SHOW BINLOG EVENTS;
-
-DROP TABLE t1;
+--source extra/binlog_tests/binlog_ioerr.inc
diff --git a/mysql-test/suite/binlog/t/binlog_mdev717.test b/mysql-test/suite/binlog/t/binlog_mdev717.test
new file mode 100644
index 00000000000..61d3aa715d2
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mdev717.test
@@ -0,0 +1,46 @@
+# MDEV-717 LP:1003679 - Wrong binlog order on concurrent DROP schema and CREATE function.
+
+--source include/have_debug_sync.inc
+--source include/have_log_bin.inc
+RESET MASTER;
+
+connect(con1,localhost,root);
+connection default;
+
+CREATE DATABASE mysqltest;
+SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release";
+--send DROP DATABASE mysqltest;
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR locked";
+SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release";
+--error ER_BAD_DB_ERROR
+CREATE FUNCTION mysqltest.f1() RETURNS INT RETURN 1;
+connection default;
+--reap
+
+CREATE DATABASE mysqltest;
+SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release";
+--send DROP DATABASE mysqltest;
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR locked";
+SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release";
+--error ER_BAD_DB_ERROR
+CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END;
+connection default;
+--reap
+
+CREATE DATABASE mysqltest;
+CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END;
+SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release";
+--send DROP DATABASE mysqltest;
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR locked";
+SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release";
+--error ER_BAD_DB_ERROR
+ALTER EVENT mysqltest.e1 ON SCHEDULE EVERY 20 MINUTE DO BEGIN END;
+connection default;
+--reap
+
+SET DEBUG_SYNC= "RESET";
+--source include/show_binlog_events.inc
+
diff --git a/mysql-test/suite/binlog/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test
deleted file mode 100644
index 90fddd4f3fd..00000000000
--- a/mysql-test/suite/binlog/t/binlog_multi_engine.test
+++ /dev/null
@@ -1,110 +0,0 @@
-# Test to test how logging is done depending on the capabilities of
-# the engines. Unfortunately, we don't have a good row-only logging
-# engine, and NDB does not really cut is since it is also
-# self-logging. I'm using it nevertheless.
-
-source include/have_blackhole.inc;
-source include/have_ndb.inc;
-source include/have_log_bin.inc;
-
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-
-CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
-CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
-CREATE TABLE t1n (e INT, f INT) ENGINE=NDB;
-
-RESET MASTER;
-
-SET SESSION BINLOG_FORMAT=STATEMENT;
-
-INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-
-# Here and below we need to wait when some event appears in binlog
-# to avoid unsrted mixing local events and from NDB
-let $wait_binlog_event= COMMIT;
-source include/wait_for_binlog_event.inc;
-let $event= query_get_value(SHOW BINLOG EVENTS, Info, 9);
---echo The last event before the COMMIT is $event
-
-echo *** Please look in binlog_multi_engine.test if you have a diff here ****;
-START TRANSACTION;
-INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-COMMIT;
-
-let $wait_binlog_event= COMMIT;
-source include/wait_for_binlog_event.inc;
-
-TRUNCATE t1m;
-TRUNCATE t1b;
-TRUNCATE t1n;
-
-let $wait_binlog_event= t1n;
-source include/wait_for_binlog_event.inc;
-
-source include/show_binlog_events.inc;
-
-RESET MASTER;
-
-SET SESSION BINLOG_FORMAT=MIXED;
-
-INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-
-let $wait_binlog_event= COMMIT;
-source include/wait_for_binlog_event.inc;
-let $event= query_get_value(SHOW BINLOG EVENTS, Info, 6);
---echo The last event before the COMMIT is $event
-
-INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-
-let $wait_binlog_event= COMMIT;
-source include/wait_for_binlog_event.inc;
-
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE;
-UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-
-# Not possible to test this since NDB writes its own binlog, which
-# might cause it to be out of sync with the results from MyISAM.
-# This will generate an error once BUG#28722 is fixed.
-
-#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-
-TRUNCATE t1m;
-TRUNCATE t1b;
-TRUNCATE t1n;
-
-source include/show_binlog_events.inc;
-
-RESET MASTER;
-
-SET SESSION BINLOG_FORMAT=ROW;
-
-INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-
-INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-
-error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE;
-UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-
-# Not possible to test this since NDB writes its own binlog, which
-# might cause it to be out of sync with the results from MyISAM.
-# This will generate an error once BUG#28722 is fixed.
-
-#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-
-error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE;
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-
-source include/show_binlog_events.inc;
-
-RESET MASTER;
-
-DROP TABLE t1m, t1b, t1n;
-
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
index 2a210bea0e0..58c4befa8d6 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
@@ -1,26 +1 @@
-# disabled in embedded until tools running is fixed with embedded
---source include/not_embedded.inc
-
--- source include/have_binlog_format_mixed_or_statement.inc
--- source include/have_cp932.inc
--- source include/have_log_bin.inc
-
-RESET MASTER;
-
-# Bug#16217 (mysql client did not know how not switch its internal charset)
-create table t3 (f text character set utf8);
-create table t4 (f text character set cp932);
---exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
---exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');"
-flush logs;
-rename table t3 to t03, t4 to t04;
-let $MYSQLD_DATADIR= `select @@datadir`;
---exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 | $MYSQL --default-character-set=utf8
-# original and recovered data must be equal
-select HEX(f) from t03;
-select HEX(f) from t3;
-select HEX(f) from t04;
-select HEX(f) from t4;
-
-drop table t3, t4, t03, t04;
---echo End of 5.0 tests
+--source extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
index 367314d9643..76d6abf4d18 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
@@ -5,6 +5,7 @@
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/binlog_start_pos.inc
+set sql_mode="";
--disable_warnings
drop table if exists t1;
--enable_warnings
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
index 9609a9af384..0c94d968338 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
@@ -142,7 +142,7 @@ INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
DELETE FROM t1 WHERE c29='2001-02-03 10:20:30';
DROP TABLE t1;
-CREATE TABLE t1 (c30 TIMESTAMP);
+CREATE TABLE t1 (c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
DELETE FROM t1 WHERE c30='2001-02-03 10:20:30';
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_old_versions.test b/mysql-test/suite/binlog/t/binlog_old_versions.test
index 330aac137de..130101541e3 100644
--- a/mysql-test/suite/binlog/t/binlog_old_versions.test
+++ b/mysql-test/suite/binlog/t/binlog_old_versions.test
@@ -11,7 +11,7 @@
# The previous versions we currently test are:
# - version 5.1.17 and earlier trees
# - mysql-5.1-wl2325-xxx trees (AKA alcatel trees)
-# - mysql-5.1-telco-6.1 trees (AKA ndb trees)
+# - mysql-5.1-telco-6.1 trees
# For completeness, we also test mysql-5.1-new_rpl, which is supposed
# to be the "correct" version.
@@ -75,7 +75,7 @@ SELECT COUNT(*) FROM t3;
DROP TABLE t1, t3;
---echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
+--echo ==== Read binlog from telco tree (mysql-5.1-telco-6.1) ====
# Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-telco.001 | $MYSQL --local-infile=1
diff --git a/mysql-test/suite/binlog/t/binlog_parallel_replication_marks_row.test b/mysql-test/suite/binlog/t/binlog_parallel_replication_marks_row.test
new file mode 100644
index 00000000000..82898486089
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_parallel_replication_marks_row.test
@@ -0,0 +1,3 @@
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row.inc
+--source include/binlog_parallel_replication_marks.test
diff --git a/mysql-test/suite/binlog/t/binlog_parallel_replication_marks_stm_mix.test b/mysql-test/suite/binlog/t/binlog_parallel_replication_marks_stm_mix.test
new file mode 100644
index 00000000000..15042b3a07f
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_parallel_replication_marks_stm_mix.test
@@ -0,0 +1,3 @@
+--source include/have_log_bin.inc
+--source include/have_binlog_format_mixed_or_statement.inc
+--source include/binlog_parallel_replication_marks.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_annotate.test b/mysql-test/suite/binlog/t/binlog_row_annotate.test
index a0f72c9222c..569391e68ce 100644
--- a/mysql-test/suite/binlog/t/binlog_row_annotate.test
+++ b/mysql-test/suite/binlog/t/binlog_row_annotate.test
@@ -1,189 +1 @@
-###############################################################################
-# WL47: Store in binlog text of statements that caused RBR events
-# new event: ANNOTATE_ROWS_EVENT
-# new master option: --binlog-annotate-row-events
-# new mysqlbinlog option: --skip-annotate-row-events
-#
-# Intended to test that:
-# *** If the --binlog-annotate-row-events option is switched on on master
-# then Annotate_rows events:
-# - are generated;
-# - are genrated only once for "multi-table-maps" rbr queries;
-# - are not generated when the corresponding queries are filtered away;
-# - are generated when the corresponding queries are filtered away partialy
-# (e.g. in case of multi-delete).
-# *** Annotate_rows events are printed by mysqlbinlog started without
-# --skip-annotate-row-events options both in remote and local cases.
-# *** Annotate_rows events are not printed by mysqlbinlog started with
-# --skip-annotate-row-events options both in remote and local cases.
-###############################################################################
-
---source include/have_log_bin.inc
---source include/have_binlog_format_row.inc
---source include/binlog_start_pos.inc
-
---disable_query_log
-
-# Fix timestamp to avoid varying results
-SET timestamp=1000000000;
-
-# Delete all existing binary logs
-RESET MASTER;
-
---disable_warnings
-DROP DATABASE IF EXISTS test1;
-DROP DATABASE IF EXISTS test2;
-DROP DATABASE IF EXISTS test3;
-DROP DATABASE IF EXISTS xtest1;
-DROP DATABASE IF EXISTS xtest2;
---enable_warnings
-
-CREATE DATABASE test1;
-CREATE TABLE test1.t1(a int);
-
-CREATE DATABASE test2;
-CREATE TABLE test2.t2(a int);
-CREATE VIEW test2.v2 AS SELECT * FROM test2.t2;
-
-CREATE DATABASE test3;
-CREATE TABLE test3.t3(a int);
-
-CREATE DATABASE xtest1;
-CREATE TABLE xtest1.xt1(a int);
-
-CREATE DATABASE xtest2;
-CREATE TABLE xtest2.xt2(a int);
-
-# By default SESSION binlog_annotate_row_events = OFF
-
-INSERT INTO test1.t1 VALUES (1), (2), (3);
-
-SET SESSION binlog_annotate_row_events = ON;
-
-INSERT INTO test2.t2 VALUES (1), (2), (3);
-INSERT INTO test3.t3 VALUES (1), (2), (3);
-
-# This query generates two Table maps but the Annotate
-# event should appear only once before the first Table map
-DELETE test1.t1, test2.t2
- FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
- WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
-
-# This event should be filtered out together with Annotate event
-INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
-
-# This event should pass the filter
-INSERT INTO test2.v2 VALUES (1), (2), (3);
-
-# This event should pass the filter only for test2.t2 part
-DELETE xtest1.xt1, test2.t2
- FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
- WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
-
-# These events should be filtered out together with Annotate events
-INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
-INSERT INTO xtest2.xt2 VALUES (1), (2), (3);
-DELETE xtest1.xt1, xtest2.xt2
- FROM xtest1.xt1 INNER JOIN xtest2.xt2 INNER JOIN test3.t3
- WHERE xtest1.xt1.a=xtest2.xt2.a AND xtest2.xt2.a=test3.t3.a;
-
-FLUSH LOGS;
---enable_query_log
-
---echo #####################################################################################
---echo # The following Annotate_rows events should appear below:
---echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
---echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
---echo # - DELETE test1.t1, test2.t2 FROM <...>
---echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
---echo # - DELETE xtest1.xt1, test2.t2 FROM <...>
---echo #####################################################################################
-
-let $start_pos= `select @binlog_start_pos`;
---replace_column 2 # 5 #
---replace_result $start_pos <start_pos>
---replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
---eval show binlog events in 'master-bin.000001' from $start_pos
-
---echo #
---echo #####################################################################################
---echo # mysqlbinlog
---echo # The following Annotates should appear in this output:
---echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
---echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
---echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
---echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
---echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
---echo #####################################################################################
-
-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 #/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
-
---echo #
---echo #####################################################################################
---echo # mysqlbinlog --database=test1
---echo # The following Annotate should appear in this output:
---echo # - DELETE test1.t1, test2.t2 FROM <...>
---echo #####################################################################################
-
-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 #/
---exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v $MYSQLD_DATADIR/master-bin.000001
-
---echo #
---echo #####################################################################################
---echo # mysqlbinlog --skip-annotate-row-events
---echo # No Annotates should appear in this output
---echo #####################################################################################
-
-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 #/
---exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v $MYSQLD_DATADIR/master-bin.000001
-
---echo #
---echo #####################################################################################
---echo # mysqlbinlog --read-from-remote-server
---echo # The following Annotates should appear in this output:
---echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
---echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
---echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
---echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
---echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
---echo #####################################################################################
-
-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 #/
---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
-
---echo #
---echo #####################################################################################
---echo # mysqlbinlog --read-from-remote-server --database=test1
---echo # The following Annotate should appear in this output:
---echo # - DELETE test1.t1, test2.t2 FROM <...>
---echo #####################################################################################
-
-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 #/
---exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
-
---echo #
---echo #####################################################################################
---echo # mysqlbinlog --read-from-remote-server --skip-annotate-row-events
---echo # No Annotates should appear in this output
---echo #####################################################################################
-
-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 #/
---exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
-
-# Clean-up
-
---disable_query_log
-DROP DATABASE test1;
-DROP DATABASE test2;
-DROP DATABASE test3;
-DROP DATABASE xtest1;
-DROP DATABASE xtest2;
---enable_query_log
-
+--source extra/binlog_tests/binlog_row_annotate.inc
diff --git a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_verbose.test b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_verbose.test
index 42d92e1a44d..98aa7635deb 100644
--- a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_verbose.test
+++ b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_verbose.test
@@ -1,12 +1,8 @@
########################################################
-# Test mysqlbinlog command with Ndb produced Binlog
-# variants
-#
# WHAT
# ====
# This test aims to check that the mysqlbinlog --verbose
-# command can output binlogs in 4 format variants, currently
-# used by Ndb
+# command can output binlogs in 4 format variants.
#
# 1) Updates logged as write_row events
# Only primary key and updated columns included in the
@@ -18,19 +14,6 @@
# event
# 4) Updates logged as update_row events
# All columns included in the event
-#
-# Format variant (1) is the Ndb default.
-# Bug#47323 resulted in binlogs generated in format (1)
-# being incorrectly parsed by the mysqlbinlog --verbose
-# option
-#
-# HOW
-# ===
-# Row-based binlog files in each format have been
-# captured from an Ndb cluster
-# These are output using the mysqlbinlog --verbose
-# tool and the output is checked.
-#
########################################################
# We require binlog_format_row as we're independent of binlog format
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index aaf4697b91f..a23155e6c1d 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -96,10 +96,6 @@
# rpl.rpl_variables_stm tests the small subset of variables that
# actually can be replicated safely in statement mode.
#
-# rpl_ndb.rpl_ndb_binlog_format_errors tests all errors and warnings
-# related to logging format (not just 'Unsafe statement written to the
-# binary log using statement format since BINLOG_FORMAT = STATEMENT').
-
--source include/have_udf.inc
--source include/have_log_bin.inc
--source include/have_binlog_format_statement.inc
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt b/mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt
new file mode 100644
index 00000000000..85d14ea7af9
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt
@@ -0,0 +1 @@
+--log-bin=other
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin.test b/mysql-test/suite/binlog/t/binlog_variables_log_bin.test
new file mode 100644
index 00000000000..d94d565d004
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'log_bin%'
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt
new file mode 100644
index 00000000000..68e580bd205
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt
@@ -0,0 +1,2 @@
+--log-bin=other
+--log-bin-index=$MYSQLTEST_VARDIR/tmp/something.index
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test
new file mode 100644
index 00000000000..d94d565d004
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'log_bin%'
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt b/mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt
new file mode 100644
index 00000000000..a01432d7a17
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt
@@ -0,0 +1 @@
+--relay-log=other-relay
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log.test b/mysql-test/suite/binlog/t/binlog_variables_relay_log.test
new file mode 100644
index 00000000000..1e987901986
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'relay_log%'
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt
new file mode 100644
index 00000000000..eeabaca11a0
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt
@@ -0,0 +1,2 @@
+--relay-log=other-relay
+--relay-log-index=$MYSQLTEST_VARDIR/tmp/something-relay.index
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test
new file mode 100644
index 00000000000..1e987901986
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'relay_log%'
diff --git a/mysql-test/suite/binlog/t/binlog_write_error.test b/mysql-test/suite/binlog/t/binlog_write_error.test
index 78f55c1bb0d..05f8eff6c3a 100644
--- a/mysql-test/suite/binlog/t/binlog_write_error.test
+++ b/mysql-test/suite/binlog/t/binlog_write_error.test
@@ -1,102 +1 @@
-#
-# === Name ===
-#
-# binlog_write_error.test
-#
-# === Description ===
-#
-# This test case check if the error of writing binlog file is properly
-# reported and handled when executing statements.
-#
-# === Related Bugs ===
-#
-# BUG#37148
-#
-
-source include/have_log_bin.inc;
-source include/have_debug.inc;
-source include/have_binlog_format_mixed_or_statement.inc;
-
---echo #
---echo # Initialization
---echo #
-
-disable_warnings;
-DROP TABLE IF EXISTS t1, t2;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP TRIGGER IF EXISTS tr1;
-DROP TRIGGER IF EXISTS tr2;
-DROP VIEW IF EXISTS v1, v2;
-enable_warnings;
-
---echo #
---echo # Test injecting binlog write error when executing queries
---echo #
-
-let $query= CREATE TABLE t1 (a INT);
-source include/binlog_inject_error.inc;
-
-INSERT INTO t1 VALUES (1),(2),(3);
-
-let $query= INSERT INTO t1 VALUES (4),(5),(6);
-source include/binlog_inject_error.inc;
-
-let $query= UPDATE t1 set a=a+1;
-source include/binlog_inject_error.inc;
-
-let $query= DELETE FROM t1;
-source include/binlog_inject_error.inc;
-
-let $query= CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
-source include/binlog_inject_error.inc;
-
-let $query= DROP TRIGGER tr1;
-source include/binlog_inject_error.inc;
-
-let $query= ALTER TABLE t1 ADD (b INT);
-source include/binlog_inject_error.inc;
-
-let $query= CREATE VIEW v1 AS SELECT a FROM t1;
-source include/binlog_inject_error.inc;
-
-let $query= DROP VIEW v1;
-source include/binlog_inject_error.inc;
-
-let $query= CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
-source include/binlog_inject_error.inc;
-
-let $query= DROP PROCEDURE p1;
-source include/binlog_inject_error.inc;
-
-let $query= DROP TABLE t1;
-source include/binlog_inject_error.inc;
-
-let $query= CREATE FUNCTION f1() RETURNS INT return 1;
-source include/binlog_inject_error.inc;
-
-let $query= DROP FUNCTION f1;
-source include/binlog_inject_error.inc;
-
-let $query= CREATE USER user1;
-source include/binlog_inject_error.inc;
-
-let $query= REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
-source include/binlog_inject_error.inc;
-
-let $query= DROP USER user1;
-source include/binlog_inject_error.inc;
-
---echo #
---echo # Cleanup
---echo #
-
-disable_warnings;
-DROP TABLE IF EXISTS t1, t2;
-DROP FUNCTION IF EXISTS f1;
-DROP PROCEDURE IF EXISTS p1;
-DROP TRIGGER IF EXISTS tr1;
-DROP VIEW IF EXISTS v1, v2;
-enable_warnings;
+--source extra/binlog_tests/binlog_write_error.inc
diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test
index 903044ca5bd..0e0b80433ff 100644
--- a/mysql-test/suite/binlog/t/binlog_xa_recover.test
+++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test
@@ -1,275 +1 @@
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
---source include/have_binlog_format_row.inc
-# Valgrind does not work well with test that crashes the server
---source include/not_valgrind.inc
-
-# (We do not need to restore these settings, as we crash the server).
-SET GLOBAL max_binlog_size= 4096;
-SET GLOBAL innodb_flush_log_at_trx_commit= 1;
-RESET MASTER;
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
-# Insert some data to force a couple binlog rotations (3), so we get some
-# normal binlog checkpoints before starting the test.
-INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
-# Wait for the master-bin.000002 binlog checkpoint to appear.
---let $wait_for_all= 0
---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002"
---let $field= Info
---let $condition= = "master-bin.000002"
---source include/wait_show_condition.inc
-INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
---let $wait_for_all= 0
---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
---let $field= Info
---let $condition= = "master-bin.000003"
---source include/wait_show_condition.inc
-INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
---let $wait_for_all= 0
---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
---let $field= Info
---let $condition= = "master-bin.000004"
---source include/wait_show_condition.inc
-
-# Now start a bunch of transactions that span multiple binlog
-# files. Leave then in the state prepared-but-not-committed in the engine
-# and crash the server. Check that crash recovery is able to recover all
-# of them.
-#
-# We use debug_sync to get all the transactions into the prepared state before
-# we commit any of them. This is because the prepare step flushes the InnoDB
-# redo log - including any commits made before, so recovery would become
-# unnecessary, decreasing the value of this test.
-#
-# We arrange to have con1 with a prepared transaction in master-bin.000004,
-# con2 and con3 with a prepared transaction in master-bin.000005, and a new
-# empty master-bin.000006. So the latest binlog checkpoint should be
-# master-bin.000006.
-
-connect(con1,localhost,root,,);
-# First wait after prepare and before write to binlog.
-SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
-# Then complete InnoDB commit in memory (but not commit checkpoint / write to
-# disk), and hang until crash, leaving a transaction to be XA recovered.
-SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
-send INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
-
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
-
-connect(con2,localhost,root,,);
-SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
-SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
-send INSERT INTO t1 VALUES (2, NULL);
-
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
-
-connect(con3,localhost,root,,);
-SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
-SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
-send INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
-
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
-
-connect(con4,localhost,root,,);
-SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
-SET SESSION debug_dbug="+d,crash_commit_after_log";
-send INSERT INTO t1 VALUES (4, NULL);
-
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
-
-SET DEBUG_SYNC= "now SIGNAL con1_cont";
-SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
-SET DEBUG_SYNC= "now SIGNAL con2_cont";
-SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
-SET DEBUG_SYNC= "now SIGNAL con3_cont";
-SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
-
-# Check that everything is committed in binary log.
---source include/show_binary_logs.inc
---let $binlog_file= master-bin.000003
---let $binlog_start= 4
---source include/show_binlog_events.inc
---let $binlog_file= master-bin.000004
---source include/show_binlog_events.inc
---let $binlog_file= master-bin.000005
---source include/show_binlog_events.inc
---let $binlog_file= master-bin.000006
---source include/show_binlog_events.inc
-
-
-# Check that server will not purge too much.
-PURGE BINARY LOGS TO "master-bin.000006";
---source include/show_binary_logs.inc
-
-# Now crash the server with one more transaction in prepared state.
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait-binlog_xa_recover.test
-EOF
---error 0,2006,2013
-SET DEBUG_SYNC= "now SIGNAL con4_cont";
-connection con4;
---error 2006,2013
-reap;
-
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart-group_commit_binlog_pos.test
-EOF
-
-connection default;
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-# Check that all transactions are recovered.
-SELECT a FROM t1 ORDER BY a;
-
---echo Test that with multiple binlog checkpoints, recovery starts from the last one.
-SET GLOBAL max_binlog_size= 4096;
-SET GLOBAL innodb_flush_log_at_trx_commit= 1;
-RESET MASTER;
-
-# Rotate to binlog master-bin.000003 while delaying binlog checkpoints.
-# So we get multiple binlog checkpoints in master-bin.000003.
-# Then complete the checkpoints, crash, and check that we only scan
-# the necessary binlog file (ie. that we use the _last_ checkpoint).
-
-connect(con10,localhost,root,,);
-SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
-send INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
-
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
-
-connect(con11,localhost,root,,);
-SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
-send INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
-
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
-
-connect(con12,localhost,root,,);
-SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
-send INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
-
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
-INSERT INTO t1 VALUES (13, NULL);
-
---source include/show_binary_logs.inc
---let $binlog_file= master-bin.000004
---let $binlog_start= 4
---source include/show_binlog_events.inc
-
-SET DEBUG_SYNC= "now SIGNAL con10_cont";
-connection con10;
-reap;
-connection default;
-
-# We need to sync the test case with the background processing of the
-# commit checkpoint, otherwise we get nondeterministic results.
-SET @old_dbug= @@global.DEBUG_DBUG;
-SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
-
-SET DEBUG_SYNC= "now SIGNAL con12_cont";
-connection con12;
-reap;
-connection default;
-SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
-SET GLOBAL debug_dbug= @old_dbug;
-
-SET DEBUG_SYNC= "now SIGNAL con11_cont";
-connection con11;
-reap;
-
-connection default;
-# Wait for the last (master-bin.000004) binlog checkpoint to appear.
---let $wait_for_all= 0
---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
---let $field= Info
---let $condition= = "master-bin.000004"
---source include/wait_show_condition.inc
-
---echo Checking that master-bin.000004 is the last binlog checkpoint
---source include/show_binlog_events.inc
-
---echo Now crash the server
-# It is not too easy to test XA recovery, as it runs early during server
-# startup, before any connections can be made.
-# What we do is set a DBUG error insert which will crash if XA recovery
-# starts from any other binlog than master-bin.000004 (check the file
-# binlog_xa_recover-master.opt). Then we will fail here if XA recovery
-# would start from the wrong place.
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait-binlog_xa_recover.test
-EOF
-SET SESSION debug_dbug="+d,crash_commit_after_log";
---error 2006,2013
-INSERT INTO t1 VALUES (14, NULL);
-
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart-group_commit_binlog_pos.test
-EOF
-
-connection default;
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-# Check that all transactions are recovered.
-SELECT a FROM t1 ORDER BY a;
-
-
---echo *** Check that recovery works if we crashed early during rotate, before
---echo *** binlog checkpoint event could be written.
-
-SET GLOBAL max_binlog_size= 4096;
-SET GLOBAL innodb_flush_log_at_trx_commit= 1;
-RESET MASTER;
-
-# We need some initial data to reach binlog master-bin.000004. Otherwise
-# crash recovery fails due to the error insert used for previous test.
-INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
-INSERT INTO t1 VALUES (22, REPEAT("x", 4100));
-# Wait for the master-bin.000003 binlog checkpoint to appear.
---let $wait_for_all= 0
---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
---let $field= Info
---let $condition= = "master-bin.000003"
---source include/wait_show_condition.inc
-INSERT INTO t1 VALUES (23, REPEAT("x", 4100));
-# Wait for the last (master-bin.000004) binlog checkpoint to appear.
---let $wait_for_all= 0
---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
---let $field= Info
---let $condition= = "master-bin.000004"
---source include/wait_show_condition.inc
-
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait-binlog_xa_recover.test
-EOF
-SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event";
---error 2006,2013
-INSERT INTO t1 VALUES (24, REPEAT("x", 4100));
-
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart-group_commit_binlog_pos.test
-EOF
-
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-# Check that all transactions are recovered.
-SELECT a FROM t1 ORDER BY a;
-
---source include/show_binary_logs.inc
---let $binlog_file= master-bin.000004
---let $binlog_start= 4
---source include/show_binlog_events.inc
-
-# Cleanup
-connection default;
-DROP TABLE t1;
+--source extra/binlog_tests/binlog_xa_recover.inc
diff --git a/mysql-test/suite/binlog/t/mysqladmin.test b/mysql-test/suite/binlog/t/mysqladmin.test
new file mode 100644
index 00000000000..3c2fbc0a708
--- /dev/null
+++ b/mysql-test/suite/binlog/t/mysqladmin.test
@@ -0,0 +1,12 @@
+source include/have_binlog_format_statement.inc;
+#
+# MDEV-12612 mysqladmin --local flush... to use FLUSH LOCAL
+#
+create user adm@localhost identified by 'foobar';
+grant reload on *.* to adm@localhost;
+reset master;
+exec $MYSQLADMIN -uadm -pfoobar flush-status;
+source include/show_binlog_events.inc;
+exec $MYSQLADMIN --local -uadm -pfoobar flush-status;
+source include/show_binlog_events.inc;
+drop user adm@localhost;
diff --git a/mysql-test/suite/binlog_encryption/binlog_incident.combinations b/mysql-test/suite/binlog_encryption/binlog_incident.combinations
new file mode 100644
index 00000000000..2269ed4a7a1
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_incident.combinations
@@ -0,0 +1,8 @@
+[stmt]
+binlog-format=statement
+
+[mix]
+binlog-format=mixed
+
+[row]
+binlog-format=row
diff --git a/mysql-test/suite/binlog_encryption/binlog_incident.result b/mysql-test/suite/binlog_encryption/binlog_incident.result
new file mode 100644
index 00000000000..7a555743723
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_incident.result
@@ -0,0 +1,13 @@
+RESET MASTER;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+a
+1
+2
+3
+REPLACE INTO t1 VALUES (4);
+DROP TABLE t1;
+FLUSH LOGS;
+Contain RELOAD DATABASE
+1
diff --git a/mysql-test/suite/binlog_encryption/binlog_incident.test b/mysql-test/suite/binlog_encryption/binlog_incident.test
new file mode 100644
index 00000000000..d37ed3d552d
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_incident.test
@@ -0,0 +1,2 @@
+--let $use_remote_mysqlbinlog= 1
+--source extra/binlog_tests/binlog_incident.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_index.result b/mysql-test/suite/binlog_encryption/binlog_index.result
new file mode 100644
index 00000000000..bb5d9ff74f1
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_index.result
@@ -0,0 +1,187 @@
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
+call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
+call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
+call mtr.add_suppression('Could not open .*');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
+flush tables;
+RESET MASTER;
+flush logs;
+flush logs;
+flush logs;
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+master-bin.000003 #
+master-bin.000004 #
+flush tables;
+purge binary logs TO 'master-bin.000004';
+Warnings:
+Warning 1612 Being purged log master-bin.000001 was not found
+*** must show a list starting from the 'TO' argument of PURGE ***
+show binary logs;
+Log_name File_size
+master-bin.000004 #
+reset master;
+flush logs;
+flush logs;
+flush logs;
+*** must be a warning master-bin.000001 was not found ***
+Warnings:
+Warning 1612 Being purged log master-bin.000001 was not found
+*** must show one record, of the active binlog, left in the index file after PURGE ***
+show binary logs;
+Log_name File_size
+master-bin.000004 #
+reset master;
+flush logs;
+flush logs;
+flush logs;
+purge binary logs TO 'master-bin.000002';
+ERROR HY000: Fatal error during log purge
+show warnings;
+Level Code Message
+Warning 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
+Error 1377 Fatal error during log purge
+reset master;
+# crash_purge_before_update_index
+flush logs;
+SET SESSION debug_dbug="+d,crash_purge_before_update_index";
+purge binary logs TO 'master-bin.000002';
+ERROR HY000: Lost connection to MySQL server during query
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000001
+master-bin.000002
+master-bin.000003
+
+# crash_purge_non_critical_after_update_index
+flush logs;
+SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
+purge binary logs TO 'master-bin.000004';
+ERROR HY000: Lost connection to MySQL server during query
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000004
+master-bin.000005
+
+# crash_purge_critical_after_update_index
+flush logs;
+SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
+purge binary logs TO 'master-bin.000006';
+ERROR HY000: Lost connection to MySQL server during query
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+
+# crash_create_non_critical_before_update_index
+SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
+flush logs;
+ERROR HY000: Lost connection to MySQL server during query
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+
+# crash_create_critical_before_update_index
+SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
+flush logs;
+ERROR HY000: Lost connection to MySQL server during query
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+
+# crash_create_after_update_index
+SET SESSION debug_dbug="+d,crash_create_after_update_index";
+flush logs;
+ERROR HY000: Lost connection to MySQL server during query
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+
+#
+# This should put the server in unsafe state and stop
+# accepting any command. If we inject a fault at this
+# point and continue the execution the server crashes.
+#
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+
+# fault_injection_registering_index
+SET SESSION debug_dbug="+d,fault_injection_registering_index";
+flush logs;
+ERROR HY000: Can't open file: 'master-bin.000012' (errno: 1 "Operation not permitted")
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+master-bin.000012
+
+# fault_injection_updating_index
+SET SESSION debug_dbug="+d,fault_injection_updating_index";
+flush logs;
+ERROR HY000: Can't open file: 'master-bin.000013' (errno: 1 "Operation not permitted")
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+master-bin.000012
+
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+master-bin.000012
+master-bin.000013
+
+SET SESSION debug_dbug="";
+End of tests
diff --git a/mysql-test/suite/binlog_encryption/binlog_index.test b/mysql-test/suite/binlog_encryption/binlog_index.test
new file mode 100644
index 00000000000..1837c683bba
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_index.test
@@ -0,0 +1 @@
+--source extra/binlog_tests/binlog_index.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_ioerr.result b/mysql-test/suite/binlog_encryption/binlog_ioerr.result
new file mode 100644
index 00000000000..6b3120b6d89
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_ioerr.result
@@ -0,0 +1,32 @@
+CALL mtr.add_suppression("Error writing file 'master-bin'");
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES(0);
+SET SESSION debug_dbug='+d,fail_binlog_write_1';
+INSERT INTO t1 VALUES(1);
+ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
+INSERT INTO t1 VALUES(2);
+ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
+SET SESSION debug_dbug='';
+INSERT INTO t1 VALUES(3);
+SELECT * FROM t1;
+a
+0
+3
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+BINLOG POS Format_desc 1 ENDPOS Server ver: #, Binlog ver: #
+BINLOG POS Start_encryption 1 ENDPOS
+BINLOG POS Gtid_list 1 ENDPOS []
+BINLOG POS Binlog_checkpoint 1 ENDPOS master-bin.000001
+BINLOG POS Gtid 1 ENDPOS GTID 0-1-1
+BINLOG POS Query 1 ENDPOS use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb
+BINLOG POS Gtid 1 ENDPOS BEGIN GTID 0-1-2
+BINLOG POS Query 1 ENDPOS use `test`; INSERT INTO t1 VALUES(0)
+BINLOG POS Xid 1 ENDPOS COMMIT /* XID */
+BINLOG POS Gtid 1 ENDPOS BEGIN GTID 0-1-3
+BINLOG POS Gtid 1 ENDPOS BEGIN GTID 0-1-4
+BINLOG POS Gtid 1 ENDPOS BEGIN GTID 0-1-5
+BINLOG POS Query 1 ENDPOS use `test`; INSERT INTO t1 VALUES(3)
+BINLOG POS Xid 1 ENDPOS COMMIT /* XID */
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog_encryption/binlog_ioerr.test b/mysql-test/suite/binlog_encryption/binlog_ioerr.test
new file mode 100644
index 00000000000..3155e14e6b0
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_ioerr.test
@@ -0,0 +1 @@
+--source extra/binlog_tests/binlog_ioerr.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932-master.opt b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932-master.opt
new file mode 100644
index 00000000000..bb0cda4519a
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932-master.opt
@@ -0,0 +1 @@
+--max-binlog-size=8192
diff --git a/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.result b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.result
new file mode 100644
index 00000000000..cbf6159516a
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.result
@@ -0,0 +1,19 @@
+RESET MASTER;
+create table t3 (f text character set utf8);
+create table t4 (f text character set cp932);
+flush logs;
+rename table t3 to t03, t4 to t04;
+select HEX(f) from t03;
+HEX(f)
+E382BD
+select HEX(f) from t3;
+HEX(f)
+E382BD
+select HEX(f) from t04;
+HEX(f)
+835C
+select HEX(f) from t4;
+HEX(f)
+835C
+drop table t3, t4, t03, t04;
+End of 5.0 tests
diff --git a/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test
new file mode 100644
index 00000000000..3af0015a486
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test
@@ -0,0 +1,2 @@
+--let $use_remote_mysqlbinlog= 1
+--source extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate-master.opt b/mysql-test/suite/binlog_encryption/binlog_row_annotate-master.opt
new file mode 100644
index 00000000000..344a4ffc014
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate-master.opt
@@ -0,0 +1 @@
+--timezone=GMT-3 --binlog-do-db=test1 --binlog-do-db=test2 --binlog-do-db=test3 --binlog-checksum=NONE
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
new file mode 100644
index 00000000000..41721441a72
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
@@ -0,0 +1,723 @@
+#####################################################################################
+# The following Annotate_rows events should appear below:
+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
+# - INSERT INTO test3.t3 VALUES (1), (2), (3)
+# - DELETE test1.t1, test2.t2 FROM <...>
+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
+# - DELETE xtest1.xt1, test2.t2 FROM <...>
+#####################################################################################
+show binlog events in 'master-bin.000001' from <start_pos>;
+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 0-1-1
+master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
+master-bin.000001 # Gtid 1 # GTID 0-1-2
+master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test2
+master-bin.000001 # Gtid 1 # GTID 0-1-3
+master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test3
+master-bin.000001 # Gtid 1 # GTID 0-1-4
+master-bin.000001 # Query 1 # CREATE DATABASE test1
+master-bin.000001 # Gtid 1 # GTID 0-1-5
+master-bin.000001 # Query 1 # CREATE DATABASE test2
+master-bin.000001 # Gtid 1 # GTID 0-1-6
+master-bin.000001 # Query 1 # CREATE DATABASE test3
+master-bin.000001 # Gtid 1 # BEGIN GTID 0-1-7
+master-bin.000001 # Table_map 1 # table_id: # (test1.t1)
+master-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Gtid 1 # BEGIN GTID 0-1-8
+master-bin.000001 # Annotate_rows 1 # INSERT INTO test2.t2 VALUES (1), (2), (3)
+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
+master-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Gtid 1 # BEGIN GTID 0-1-9
+master-bin.000001 # Annotate_rows 1 # INSERT INTO test3.t3 VALUES (1), (2), (3)
+master-bin.000001 # Table_map 1 # table_id: # (test3.t3)
+master-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Gtid 1 # BEGIN GTID 0-1-10
+master-bin.000001 # Annotate_rows 1 # DELETE test1.t1, test2.t2
+FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
+WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a
+master-bin.000001 # Table_map 1 # table_id: # (test1.t1)
+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
+master-bin.000001 # Delete_rows_v1 1 # table_id: #
+master-bin.000001 # Delete_rows_v1 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Gtid 1 # BEGIN GTID 0-1-11
+master-bin.000001 # Annotate_rows 1 # INSERT INTO test2.v2 VALUES (1), (2), (3)
+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
+master-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Gtid 1 # BEGIN GTID 0-1-12
+master-bin.000001 # Annotate_rows 1 # DELETE xtest1.xt1, test2.t2
+FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
+WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a
+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
+master-bin.000001 # Delete_rows_v1 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
+#
+#####################################################################################
+# mysqlbinlog --read-from-remote-server
+# The following Annotates should appear in this output:
+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
+# - INSERT INTO test3.t3 VALUES (1), (2), (3)
+# - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
+# - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
+#####################################################################################
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
+ROLLBACK/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Gtid list []
+# at #
+#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
+/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
+/*!100001 SET @@session.server_id=1*//*!*/;
+/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=#/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+DROP DATABASE IF EXISTS test1
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
+/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+DROP DATABASE IF EXISTS test2
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
+/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+DROP DATABASE IF EXISTS test3
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
+/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+CREATE DATABASE test1
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
+/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+CREATE DATABASE test2
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
+/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+CREATE DATABASE test3
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
+/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
+/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
+#Q> INSERT INTO test2.t2 VALUES (1), (2), (3)
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
+/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
+#Q> INSERT INTO test3.t3 VALUES (1), (2), (3)
+#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test3`.`t3`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test3`.`t3`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test3`.`t3`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-10
+/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
+#Q> DELETE test1.t1, test2.t2
+#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
+#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-11
+/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
+#Q> INSERT INTO test2.v2 VALUES (1), (2), (3)
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-12
+/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
+#Q> DELETE xtest1.xt1, test2.t2
+#Q> FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
+#Q> WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+#
+#####################################################################################
+# mysqlbinlog --read-from-remote-server --database=test1
+# The following Annotate should appear in this output:
+# - DELETE test1.t1, test2.t2 FROM <...>
+#####################################################################################
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
+ROLLBACK/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Gtid list []
+# at #
+#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
+/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
+/*!100001 SET @@session.server_id=1*//*!*/;
+/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=#/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+DROP DATABASE IF EXISTS test1
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
+/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
+/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
+/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+CREATE DATABASE test1
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
+/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
+/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
+/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
+/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
+/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-10
+/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
+#Q> DELETE test1.t1, test2.t2
+#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
+#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+'/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-11
+/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-12
+/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+#
+#####################################################################################
+# mysqlbinlog --read-from-remote-server --skip-annotate-row-events
+# No Annotates should appear in this output
+#####################################################################################
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
+ROLLBACK/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Gtid list []
+# at #
+#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-1 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
+/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
+/*!100001 SET @@session.server_id=1*//*!*/;
+/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=#/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+DROP DATABASE IF EXISTS test1
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-2 ddl
+/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+DROP DATABASE IF EXISTS test2
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-3 ddl
+/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+DROP DATABASE IF EXISTS test3
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-4 ddl
+/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+CREATE DATABASE test1
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-5 ddl
+/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+CREATE DATABASE test2
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-6 ddl
+/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+CREATE DATABASE test3
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
+/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test1`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
+/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
+/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test3`.`t3`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test3`.`t3`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test3`.`t3`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-10
+/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+# at #
+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test1`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-11
+/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### INSERT INTO `test2`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # GTID 0-1-12
+/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
+# at #
+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### DELETE FROM `test2`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# at #
+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate.test b/mysql-test/suite/binlog_encryption/binlog_row_annotate.test
new file mode 100644
index 00000000000..40aa0dbc6e3
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate.test
@@ -0,0 +1,2 @@
+--let $use_remote_mysqlbinlog= 1
+--source extra/binlog_tests/binlog_row_annotate.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.result b/mysql-test/suite/binlog_encryption/binlog_write_error.result
new file mode 100644
index 00000000000..28cffb3a8e5
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_write_error.result
@@ -0,0 +1,108 @@
+#
+# Initialization
+#
+DROP TABLE IF EXISTS t1, t2;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP TRIGGER IF EXISTS tr1;
+DROP TRIGGER IF EXISTS tr2;
+DROP VIEW IF EXISTS v1, v2;
+#
+# Test injecting binlog write error when executing queries
+#
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+CREATE TABLE t1 (a INT);
+CREATE TABLE t1 (a INT);
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+INSERT INTO t1 VALUES (1),(2),(3);
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+INSERT INTO t1 VALUES (4),(5),(6);
+INSERT INTO t1 VALUES (4),(5),(6);
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+UPDATE t1 set a=a+1;
+UPDATE t1 set a=a+1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+DELETE FROM t1;
+DELETE FROM t1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+DROP TRIGGER tr1;
+DROP TRIGGER tr1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+ALTER TABLE t1 ADD (b INT);
+ALTER TABLE t1 ADD (b INT);
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+CREATE VIEW v1 AS SELECT a FROM t1;
+CREATE VIEW v1 AS SELECT a FROM t1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+DROP VIEW v1;
+DROP VIEW v1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
+CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+DROP PROCEDURE p1;
+DROP PROCEDURE p1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+DROP TABLE t1;
+DROP TABLE t1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+CREATE FUNCTION f1() RETURNS INT return 1;
+CREATE FUNCTION f1() RETURNS INT return 1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+DROP FUNCTION f1;
+DROP FUNCTION f1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+CREATE USER user1;
+CREATE USER user1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+SET GLOBAL debug_dbug='d,injecting_fault_writing';
+DROP USER user1;
+DROP USER user1;
+ERROR HY000: Error writing file 'master-bin' ((errno: #)
+SET GLOBAL debug_dbug='';
+#
+# Cleanup
+#
+DROP TABLE IF EXISTS t1, t2;
+DROP FUNCTION IF EXISTS f1;
+DROP PROCEDURE IF EXISTS p1;
+DROP TRIGGER IF EXISTS tr1;
+DROP VIEW IF EXISTS v1, v2;
diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.test b/mysql-test/suite/binlog_encryption/binlog_write_error.test
new file mode 100644
index 00000000000..05f8eff6c3a
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_write_error.test
@@ -0,0 +1 @@
+--source extra/binlog_tests/binlog_write_error.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt b/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt
new file mode 100644
index 00000000000..3c44f9fad10
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt
@@ -0,0 +1 @@
+--skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004
diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover.result b/mysql-test/suite/binlog_encryption/binlog_xa_recover.result
new file mode 100644
index 00000000000..b78fd47dae6
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover.result
@@ -0,0 +1,216 @@
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
+INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
+INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
+INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
+INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
+SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
+INSERT INTO t1 VALUES (2, NULL);
+SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
+INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
+SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
+SET SESSION debug_dbug="+d,crash_commit_after_log";
+INSERT INTO t1 VALUES (4, NULL);
+SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
+SET DEBUG_SYNC= "now SIGNAL con1_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
+SET DEBUG_SYNC= "now SIGNAL con2_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
+SET DEBUG_SYNC= "now SIGNAL con3_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+master-bin.000003 #
+master-bin.000004 #
+master-bin.000005 #
+master-bin.000006 #
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000003 # Start_encryption # #
+master-bin.000003 # Gtid_list # # [#-#-#]
+master-bin.000003 # Binlog_checkpoint # # master-bin.000002
+master-bin.000003 # Binlog_checkpoint # # master-bin.000003
+master-bin.000003 # Gtid # # BEGIN GTID #-#-#
+master-bin.000003 # Table_map # # table_id: # (test.t1)
+master-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000003 # Xid # # COMMIT /* XID */
+master-bin.000003 # Rotate # # master-bin.000004;pos=POS
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000004 # Start_encryption # #
+master-bin.000004 # Gtid_list # # [#-#-#]
+master-bin.000004 # Binlog_checkpoint # # master-bin.000003
+master-bin.000004 # Binlog_checkpoint # # master-bin.000004
+master-bin.000004 # Gtid # # BEGIN GTID #-#-#
+master-bin.000004 # Table_map # # table_id: # (test.t1)
+master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000004 # Xid # # COMMIT /* XID */
+master-bin.000004 # Rotate # # master-bin.000005;pos=POS
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000005 # Start_encryption # #
+master-bin.000005 # Gtid_list # # [#-#-#]
+master-bin.000005 # Binlog_checkpoint # # master-bin.000004
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Table_map # # table_id: # (test.t1)
+master-bin.000005 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000005 # Xid # # COMMIT /* XID */
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Table_map # # table_id: # (test.t1)
+master-bin.000005 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000005 # Xid # # COMMIT /* XID */
+master-bin.000005 # Rotate # # master-bin.000006;pos=POS
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000006 # Start_encryption # #
+master-bin.000006 # Gtid_list # # [#-#-#]
+master-bin.000006 # Binlog_checkpoint # # master-bin.000004
+PURGE BINARY LOGS TO "master-bin.000006";
+show binary logs;
+Log_name File_size
+master-bin.000004 #
+master-bin.000005 #
+master-bin.000006 #
+SET DEBUG_SYNC= "now SIGNAL con4_cont";
+Got one of the listed errors
+SELECT a FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+100
+101
+102
+Test that with multiple binlog checkpoints, recovery starts from the last one.
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
+INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
+SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
+INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
+SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
+INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
+SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
+INSERT INTO t1 VALUES (13, NULL);
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+master-bin.000003 #
+master-bin.000004 #
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000004 # Start_encryption # #
+master-bin.000004 # Gtid_list # # [#-#-#]
+master-bin.000004 # Binlog_checkpoint # # master-bin.000001
+master-bin.000004 # Gtid # # BEGIN GTID #-#-#
+master-bin.000004 # Table_map # # table_id: # (test.t1)
+master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000004 # Xid # # COMMIT /* XID */
+SET DEBUG_SYNC= "now SIGNAL con10_cont";
+SET @old_dbug= @@global.DEBUG_DBUG;
+SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
+SET DEBUG_SYNC= "now SIGNAL con12_cont";
+SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
+SET GLOBAL debug_dbug= @old_dbug;
+SET DEBUG_SYNC= "now SIGNAL con11_cont";
+Checking that master-bin.000004 is the last binlog checkpoint
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000004 # Start_encryption # #
+master-bin.000004 # Gtid_list # # [#-#-#]
+master-bin.000004 # Binlog_checkpoint # # master-bin.000001
+master-bin.000004 # Gtid # # BEGIN GTID #-#-#
+master-bin.000004 # Table_map # # table_id: # (test.t1)
+master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000004 # Xid # # COMMIT /* XID */
+master-bin.000004 # Binlog_checkpoint # # master-bin.000002
+master-bin.000004 # Binlog_checkpoint # # master-bin.000004
+Now crash the server
+SET SESSION debug_dbug="+d,crash_commit_after_log";
+INSERT INTO t1 VALUES (14, NULL);
+Got one of the listed errors
+SELECT a FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+10
+11
+12
+13
+14
+100
+101
+102
+*** Check that recovery works if we crashed early during rotate, before
+*** binlog checkpoint event could be written.
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
+INSERT INTO t1 VALUES (22, REPEAT("x", 4100));
+INSERT INTO t1 VALUES (23, REPEAT("x", 4100));
+SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event";
+INSERT INTO t1 VALUES (24, REPEAT("x", 4100));
+Got one of the listed errors
+SELECT a FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+10
+11
+12
+13
+14
+21
+22
+23
+24
+100
+101
+102
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+master-bin.000003 #
+master-bin.000004 #
+master-bin.000005 #
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000004 # Start_encryption # #
+master-bin.000004 # Gtid_list # # [#-#-#]
+master-bin.000004 # Binlog_checkpoint # # master-bin.000003
+master-bin.000004 # Binlog_checkpoint # # master-bin.000004
+master-bin.000004 # Gtid # # BEGIN GTID #-#-#
+master-bin.000004 # Table_map # # table_id: # (test.t1)
+master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000004 # Xid # # COMMIT /* XID */
+master-bin.000004 # Rotate # # master-bin.000005;pos=POS
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover.test b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test
new file mode 100644
index 00000000000..0e0b80433ff
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test
@@ -0,0 +1 @@
+--source extra/binlog_tests/binlog_xa_recover.inc
diff --git a/mysql-test/suite/binlog_encryption/disabled.def b/mysql-test/suite/binlog_encryption/disabled.def
new file mode 100644
index 00000000000..b7a26a8343f
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/disabled.def
@@ -0,0 +1,2 @@
+encrypted_master_lost_key : MDEV-11323 - unspecified behavior for IO thread
+rpl_checksum_cache : MDEV-11486 - sporadic failure in IO thread
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master.result b/mysql-test/suite/binlog_encryption/encrypted_master.result
new file mode 100644
index 00000000000..a61b56cf355
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master.result
@@ -0,0 +1,622 @@
+#################
+# Initialization
+#################
+include/rpl_init.inc [topology=1->2]
+connection server_2;
+include/stop_slave_sql.inc
+connection server_1;
+SET @binlog_annotate_row_events.save= @@global.binlog_annotate_row_events;
+SET @binlog_checksum.save= @@global.binlog_checksum;
+SET @master_verify_checksum.save= @@global.master_verify_checksum;
+SET @binlog_row_image.save= @@global.binlog_row_image;
+####################################################
+# Test 1: simple binlog, no checksum, no annotation
+####################################################
+connection server_1;
+SET binlog_annotate_row_events= 0;
+SET GLOBAL binlog_annotate_row_events= 0;
+SET GLOBAL binlog_checksum= NONE;
+SET GLOBAL master_verify_checksum= 0;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+CREATE DATABASE database_name_to_encrypt;
+USE database_name_to_encrypt;
+CREATE USER user_name_to_encrypt;
+GRANT ALL ON database_name_to_encrypt.* TO user_name_to_encrypt;
+SET PASSWORD FOR user_name_to_encrypt = PASSWORD('password_to_encrypt');
+CREATE TABLE innodb_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB,
+virt_column_name_to_encrypt INT AS (int_column_name_to_encrypt % 10) VIRTUAL,
+pers_column_name_to_encrypt INT AS (int_column_name_to_encrypt) PERSISTENT,
+INDEX `index_name_to_encrypt`(`timestamp_column_name_to_encrypt`)
+) ENGINE=InnoDB
+PARTITION BY RANGE (int_column_name_to_encrypt)
+SUBPARTITION BY KEY (int_column_name_to_encrypt)
+SUBPARTITIONS 2 (
+PARTITION partition0_name_to_encrypt VALUES LESS THAN (100),
+PARTITION partition1_name_to_encrypt VALUES LESS THAN (MAXVALUE)
+)
+;
+CREATE TABLE myisam_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+char_column_name_to_encrypt VARCHAR(255),
+datetime_column_name_to_encrypt DATETIME,
+text_column_name_to_encrypt TEXT
+) ENGINE=MyISAM;
+CREATE TABLE aria_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+varchar_column_name_to_encrypt VARCHAR(1024),
+enum_column_name_to_encrypt ENUM(
+'enum_value1_to_encrypt',
+'enum_value2_to_encrypt'
+ ),
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB
+) ENGINE=Aria;
+CREATE TRIGGER trigger_name_to_encrypt
+AFTER INSERT ON myisam_table_name_to_encrypt FOR EACH ROW
+INSERT INTO aria_table_name_to_encrypt (varchar_column_name_to_encrypt)
+VALUES (NEW.char_column_name_to_encrypt);
+CREATE DEFINER=user_name_to_encrypt VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+CREATE FUNCTION func_name_to_encrypt (func_parameter_to_encrypt INT)
+RETURNS VARCHAR(64)
+RETURN 'func_result_to_encrypt';
+CREATE PROCEDURE proc_name_to_encrypt (
+IN proc_in_parameter_to_encrypt CHAR(32),
+OUT proc_out_parameter_to_encrypt INT
+)
+BEGIN
+DECLARE procvar_name_to_encrypt CHAR(64) DEFAULT 'procvar_val_to_encrypt';
+DECLARE cursor_name_to_encrypt CURSOR FOR
+SELECT virt_column_name_to_encrypt FROM innodb_table_name_to_encrypt;
+DECLARE EXIT HANDLER FOR NOT FOUND
+BEGIN
+SET @stmt_var_to_encrypt = CONCAT(
+"SELECT
+ IF (RAND()>0.5,'enum_value2_to_encrypt','enum_value1_to_encrypt')
+ FROM innodb_table_name_to_encrypt
+ INTO OUTFILE '", proc_in_parameter_to_encrypt, "'");
+PREPARE stmt_to_encrypt FROM @stmt_var_to_encrypt;
+EXECUTE stmt_to_encrypt;
+DEALLOCATE PREPARE stmt_to_encrypt;
+END;
+OPEN cursor_name_to_encrypt;
+proc_label_to_encrypt: LOOP
+FETCH cursor_name_to_encrypt INTO procvar_name_to_encrypt;
+END LOOP;
+CLOSE cursor_name_to_encrypt;
+END $$
+CREATE SERVER server_name_to_encrypt
+FOREIGN DATA WRAPPER mysql
+OPTIONS (HOST 'host_name_to_encrypt');
+connect con1,localhost,user_name_to_encrypt,password_to_encrypt,database_name_to_encrypt;
+CREATE TEMPORARY TABLE tmp_table_name_to_encrypt (
+float_column_name_to_encrypt FLOAT,
+binary_column_name_to_encrypt BINARY(64)
+);
+disconnect con1;
+connection server_1;
+CREATE INDEX index_name_to_encrypt
+ON myisam_table_name_to_encrypt (datetime_column_name_to_encrypt);
+ALTER DATABASE database_name_to_encrypt CHARACTER SET utf8;
+ALTER TABLE innodb_table_name_to_encrypt
+MODIFY timestamp_column_name_to_encrypt TIMESTAMP NOT NULL
+DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+;
+ALTER ALGORITHM=MERGE VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+RENAME TABLE innodb_table_name_to_encrypt TO new_table_name_to_encrypt;
+ALTER TABLE new_table_name_to_encrypt RENAME TO innodb_table_name_to_encrypt;
+set @user_var1_to_encrypt= 'dyncol1_val_to_encrypt';
+set @user_var2_to_encrypt= 'dyncol2_name_to_encrypt';
+INSERT INTO view_name_to_encrypt VALUES
+(1, NOW(6), COLUMN_CREATE('dyncol1_name_to_encrypt',@user_var1_to_encrypt), NULL, NULL),
+(2, NOW(6), COLUMN_CREATE(@user_var2_to_encrypt,'dyncol2_val_to_encrypt'), NULL, NULL)
+;
+BEGIN NOT ATOMIC
+DECLARE counter_name_to_encrypt INT DEFAULT 0;
+START TRANSACTION;
+WHILE counter_name_to_encrypt<12 DO
+INSERT INTO innodb_table_name_to_encrypt
+SELECT NULL, NOW(6), blob_column_name_to_encrypt, NULL, NULL
+FROM innodb_table_name_to_encrypt
+ORDER BY int_column_name_to_encrypt;
+SET counter_name_to_encrypt = counter_name_to_encrypt+1;
+END WHILE;
+COMMIT;
+END
+$$
+INSERT INTO myisam_table_name_to_encrypt
+SELECT NULL, 'char_literal_to_encrypt', NULL, 'text_to_encrypt';
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+CALL proc_name_to_encrypt('file_name_to_encrypt',@useless_var_to_encrypt);
+TRUNCATE TABLE aria_table_name_to_encrypt;
+LOAD DATA INFILE 'file_name_to_encrypt' INTO TABLE aria_table_name_to_encrypt
+(enum_column_name_to_encrypt);
+LOAD DATA LOCAL INFILE '<DATADIR>/database_name_to_encrypt/file_name_to_encrypt'
+INTO TABLE aria_table_name_to_encrypt (enum_column_name_to_encrypt);
+UPDATE view_name_to_encrypt SET blob_column_name_to_encrypt =
+COLUMN_CREATE('dyncol1_name_to_encrypt',func_name_to_encrypt(0))
+;
+DELETE FROM aria_table_name_to_encrypt ORDER BY int_column_name_to_encrypt LIMIT 10;
+ANALYZE TABLE myisam_table_name_to_encrypt;
+CHECK TABLE aria_table_name_to_encrypt;
+CHECKSUM TABLE innodb_table_name_to_encrypt, myisam_table_name_to_encrypt;
+RENAME USER user_name_to_encrypt to new_user_name_to_encrypt;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM new_user_name_to_encrypt;
+DROP DATABASE database_name_to_encrypt;
+DROP USER new_user_name_to_encrypt;
+DROP SERVER server_name_to_encrypt;
+####################################################
+# Test 2: binlog with checksum, no annotated events
+####################################################
+connection server_1;
+SET binlog_annotate_row_events= 0;
+SET GLOBAL binlog_annotate_row_events= 0;
+SET GLOBAL binlog_checksum= CRC32;
+SET GLOBAL master_verify_checksum= 1;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+CREATE DATABASE database_name_to_encrypt;
+USE database_name_to_encrypt;
+CREATE USER user_name_to_encrypt;
+GRANT ALL ON database_name_to_encrypt.* TO user_name_to_encrypt;
+SET PASSWORD FOR user_name_to_encrypt = PASSWORD('password_to_encrypt');
+CREATE TABLE innodb_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB,
+virt_column_name_to_encrypt INT AS (int_column_name_to_encrypt % 10) VIRTUAL,
+pers_column_name_to_encrypt INT AS (int_column_name_to_encrypt) PERSISTENT,
+INDEX `index_name_to_encrypt`(`timestamp_column_name_to_encrypt`)
+) ENGINE=InnoDB
+PARTITION BY RANGE (int_column_name_to_encrypt)
+SUBPARTITION BY KEY (int_column_name_to_encrypt)
+SUBPARTITIONS 2 (
+PARTITION partition0_name_to_encrypt VALUES LESS THAN (100),
+PARTITION partition1_name_to_encrypt VALUES LESS THAN (MAXVALUE)
+)
+;
+CREATE TABLE myisam_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+char_column_name_to_encrypt VARCHAR(255),
+datetime_column_name_to_encrypt DATETIME,
+text_column_name_to_encrypt TEXT
+) ENGINE=MyISAM;
+CREATE TABLE aria_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+varchar_column_name_to_encrypt VARCHAR(1024),
+enum_column_name_to_encrypt ENUM(
+'enum_value1_to_encrypt',
+'enum_value2_to_encrypt'
+ ),
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB
+) ENGINE=Aria;
+CREATE TRIGGER trigger_name_to_encrypt
+AFTER INSERT ON myisam_table_name_to_encrypt FOR EACH ROW
+INSERT INTO aria_table_name_to_encrypt (varchar_column_name_to_encrypt)
+VALUES (NEW.char_column_name_to_encrypt);
+CREATE DEFINER=user_name_to_encrypt VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+CREATE FUNCTION func_name_to_encrypt (func_parameter_to_encrypt INT)
+RETURNS VARCHAR(64)
+RETURN 'func_result_to_encrypt';
+CREATE PROCEDURE proc_name_to_encrypt (
+IN proc_in_parameter_to_encrypt CHAR(32),
+OUT proc_out_parameter_to_encrypt INT
+)
+BEGIN
+DECLARE procvar_name_to_encrypt CHAR(64) DEFAULT 'procvar_val_to_encrypt';
+DECLARE cursor_name_to_encrypt CURSOR FOR
+SELECT virt_column_name_to_encrypt FROM innodb_table_name_to_encrypt;
+DECLARE EXIT HANDLER FOR NOT FOUND
+BEGIN
+SET @stmt_var_to_encrypt = CONCAT(
+"SELECT
+ IF (RAND()>0.5,'enum_value2_to_encrypt','enum_value1_to_encrypt')
+ FROM innodb_table_name_to_encrypt
+ INTO OUTFILE '", proc_in_parameter_to_encrypt, "'");
+PREPARE stmt_to_encrypt FROM @stmt_var_to_encrypt;
+EXECUTE stmt_to_encrypt;
+DEALLOCATE PREPARE stmt_to_encrypt;
+END;
+OPEN cursor_name_to_encrypt;
+proc_label_to_encrypt: LOOP
+FETCH cursor_name_to_encrypt INTO procvar_name_to_encrypt;
+END LOOP;
+CLOSE cursor_name_to_encrypt;
+END $$
+CREATE SERVER server_name_to_encrypt
+FOREIGN DATA WRAPPER mysql
+OPTIONS (HOST 'host_name_to_encrypt');
+connect con1,localhost,user_name_to_encrypt,password_to_encrypt,database_name_to_encrypt;
+CREATE TEMPORARY TABLE tmp_table_name_to_encrypt (
+float_column_name_to_encrypt FLOAT,
+binary_column_name_to_encrypt BINARY(64)
+);
+disconnect con1;
+connection server_1;
+CREATE INDEX index_name_to_encrypt
+ON myisam_table_name_to_encrypt (datetime_column_name_to_encrypt);
+ALTER DATABASE database_name_to_encrypt CHARACTER SET utf8;
+ALTER TABLE innodb_table_name_to_encrypt
+MODIFY timestamp_column_name_to_encrypt TIMESTAMP NOT NULL
+DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+;
+ALTER ALGORITHM=MERGE VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+RENAME TABLE innodb_table_name_to_encrypt TO new_table_name_to_encrypt;
+ALTER TABLE new_table_name_to_encrypt RENAME TO innodb_table_name_to_encrypt;
+set @user_var1_to_encrypt= 'dyncol1_val_to_encrypt';
+set @user_var2_to_encrypt= 'dyncol2_name_to_encrypt';
+INSERT INTO view_name_to_encrypt VALUES
+(1, NOW(6), COLUMN_CREATE('dyncol1_name_to_encrypt',@user_var1_to_encrypt), NULL, NULL),
+(2, NOW(6), COLUMN_CREATE(@user_var2_to_encrypt,'dyncol2_val_to_encrypt'), NULL, NULL)
+;
+BEGIN NOT ATOMIC
+DECLARE counter_name_to_encrypt INT DEFAULT 0;
+START TRANSACTION;
+WHILE counter_name_to_encrypt<12 DO
+INSERT INTO innodb_table_name_to_encrypt
+SELECT NULL, NOW(6), blob_column_name_to_encrypt, NULL, NULL
+FROM innodb_table_name_to_encrypt
+ORDER BY int_column_name_to_encrypt;
+SET counter_name_to_encrypt = counter_name_to_encrypt+1;
+END WHILE;
+COMMIT;
+END
+$$
+INSERT INTO myisam_table_name_to_encrypt
+SELECT NULL, 'char_literal_to_encrypt', NULL, 'text_to_encrypt';
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+CALL proc_name_to_encrypt('file_name_to_encrypt',@useless_var_to_encrypt);
+TRUNCATE TABLE aria_table_name_to_encrypt;
+LOAD DATA INFILE 'file_name_to_encrypt' INTO TABLE aria_table_name_to_encrypt
+(enum_column_name_to_encrypt);
+LOAD DATA LOCAL INFILE '<DATADIR>/database_name_to_encrypt/file_name_to_encrypt'
+INTO TABLE aria_table_name_to_encrypt (enum_column_name_to_encrypt);
+UPDATE view_name_to_encrypt SET blob_column_name_to_encrypt =
+COLUMN_CREATE('dyncol1_name_to_encrypt',func_name_to_encrypt(0))
+;
+DELETE FROM aria_table_name_to_encrypt ORDER BY int_column_name_to_encrypt LIMIT 10;
+ANALYZE TABLE myisam_table_name_to_encrypt;
+CHECK TABLE aria_table_name_to_encrypt;
+CHECKSUM TABLE innodb_table_name_to_encrypt, myisam_table_name_to_encrypt;
+RENAME USER user_name_to_encrypt to new_user_name_to_encrypt;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM new_user_name_to_encrypt;
+DROP DATABASE database_name_to_encrypt;
+DROP USER new_user_name_to_encrypt;
+DROP SERVER server_name_to_encrypt;
+####################################################
+# Test 3: binlog with checksum and annotated events
+####################################################
+connection server_1;
+SET binlog_annotate_row_events= 1;
+SET GLOBAL binlog_annotate_row_events= 1;
+SET GLOBAL binlog_checksum= CRC32;
+SET GLOBAL master_verify_checksum= 1;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+CREATE DATABASE database_name_to_encrypt;
+USE database_name_to_encrypt;
+CREATE USER user_name_to_encrypt;
+GRANT ALL ON database_name_to_encrypt.* TO user_name_to_encrypt;
+SET PASSWORD FOR user_name_to_encrypt = PASSWORD('password_to_encrypt');
+CREATE TABLE innodb_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB,
+virt_column_name_to_encrypt INT AS (int_column_name_to_encrypt % 10) VIRTUAL,
+pers_column_name_to_encrypt INT AS (int_column_name_to_encrypt) PERSISTENT,
+INDEX `index_name_to_encrypt`(`timestamp_column_name_to_encrypt`)
+) ENGINE=InnoDB
+PARTITION BY RANGE (int_column_name_to_encrypt)
+SUBPARTITION BY KEY (int_column_name_to_encrypt)
+SUBPARTITIONS 2 (
+PARTITION partition0_name_to_encrypt VALUES LESS THAN (100),
+PARTITION partition1_name_to_encrypt VALUES LESS THAN (MAXVALUE)
+)
+;
+CREATE TABLE myisam_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+char_column_name_to_encrypt VARCHAR(255),
+datetime_column_name_to_encrypt DATETIME,
+text_column_name_to_encrypt TEXT
+) ENGINE=MyISAM;
+CREATE TABLE aria_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+varchar_column_name_to_encrypt VARCHAR(1024),
+enum_column_name_to_encrypt ENUM(
+'enum_value1_to_encrypt',
+'enum_value2_to_encrypt'
+ ),
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB
+) ENGINE=Aria;
+CREATE TRIGGER trigger_name_to_encrypt
+AFTER INSERT ON myisam_table_name_to_encrypt FOR EACH ROW
+INSERT INTO aria_table_name_to_encrypt (varchar_column_name_to_encrypt)
+VALUES (NEW.char_column_name_to_encrypt);
+CREATE DEFINER=user_name_to_encrypt VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+CREATE FUNCTION func_name_to_encrypt (func_parameter_to_encrypt INT)
+RETURNS VARCHAR(64)
+RETURN 'func_result_to_encrypt';
+CREATE PROCEDURE proc_name_to_encrypt (
+IN proc_in_parameter_to_encrypt CHAR(32),
+OUT proc_out_parameter_to_encrypt INT
+)
+BEGIN
+DECLARE procvar_name_to_encrypt CHAR(64) DEFAULT 'procvar_val_to_encrypt';
+DECLARE cursor_name_to_encrypt CURSOR FOR
+SELECT virt_column_name_to_encrypt FROM innodb_table_name_to_encrypt;
+DECLARE EXIT HANDLER FOR NOT FOUND
+BEGIN
+SET @stmt_var_to_encrypt = CONCAT(
+"SELECT
+ IF (RAND()>0.5,'enum_value2_to_encrypt','enum_value1_to_encrypt')
+ FROM innodb_table_name_to_encrypt
+ INTO OUTFILE '", proc_in_parameter_to_encrypt, "'");
+PREPARE stmt_to_encrypt FROM @stmt_var_to_encrypt;
+EXECUTE stmt_to_encrypt;
+DEALLOCATE PREPARE stmt_to_encrypt;
+END;
+OPEN cursor_name_to_encrypt;
+proc_label_to_encrypt: LOOP
+FETCH cursor_name_to_encrypt INTO procvar_name_to_encrypt;
+END LOOP;
+CLOSE cursor_name_to_encrypt;
+END $$
+CREATE SERVER server_name_to_encrypt
+FOREIGN DATA WRAPPER mysql
+OPTIONS (HOST 'host_name_to_encrypt');
+connect con1,localhost,user_name_to_encrypt,password_to_encrypt,database_name_to_encrypt;
+CREATE TEMPORARY TABLE tmp_table_name_to_encrypt (
+float_column_name_to_encrypt FLOAT,
+binary_column_name_to_encrypt BINARY(64)
+);
+disconnect con1;
+connection server_1;
+CREATE INDEX index_name_to_encrypt
+ON myisam_table_name_to_encrypt (datetime_column_name_to_encrypt);
+ALTER DATABASE database_name_to_encrypt CHARACTER SET utf8;
+ALTER TABLE innodb_table_name_to_encrypt
+MODIFY timestamp_column_name_to_encrypt TIMESTAMP NOT NULL
+DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+;
+ALTER ALGORITHM=MERGE VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+RENAME TABLE innodb_table_name_to_encrypt TO new_table_name_to_encrypt;
+ALTER TABLE new_table_name_to_encrypt RENAME TO innodb_table_name_to_encrypt;
+set @user_var1_to_encrypt= 'dyncol1_val_to_encrypt';
+set @user_var2_to_encrypt= 'dyncol2_name_to_encrypt';
+INSERT INTO view_name_to_encrypt VALUES
+(1, NOW(6), COLUMN_CREATE('dyncol1_name_to_encrypt',@user_var1_to_encrypt), NULL, NULL),
+(2, NOW(6), COLUMN_CREATE(@user_var2_to_encrypt,'dyncol2_val_to_encrypt'), NULL, NULL)
+;
+BEGIN NOT ATOMIC
+DECLARE counter_name_to_encrypt INT DEFAULT 0;
+START TRANSACTION;
+WHILE counter_name_to_encrypt<12 DO
+INSERT INTO innodb_table_name_to_encrypt
+SELECT NULL, NOW(6), blob_column_name_to_encrypt, NULL, NULL
+FROM innodb_table_name_to_encrypt
+ORDER BY int_column_name_to_encrypt;
+SET counter_name_to_encrypt = counter_name_to_encrypt+1;
+END WHILE;
+COMMIT;
+END
+$$
+INSERT INTO myisam_table_name_to_encrypt
+SELECT NULL, 'char_literal_to_encrypt', NULL, 'text_to_encrypt';
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+CALL proc_name_to_encrypt('file_name_to_encrypt',@useless_var_to_encrypt);
+TRUNCATE TABLE aria_table_name_to_encrypt;
+LOAD DATA INFILE 'file_name_to_encrypt' INTO TABLE aria_table_name_to_encrypt
+(enum_column_name_to_encrypt);
+LOAD DATA LOCAL INFILE '<DATADIR>/database_name_to_encrypt/file_name_to_encrypt'
+INTO TABLE aria_table_name_to_encrypt (enum_column_name_to_encrypt);
+UPDATE view_name_to_encrypt SET blob_column_name_to_encrypt =
+COLUMN_CREATE('dyncol1_name_to_encrypt',func_name_to_encrypt(0))
+;
+DELETE FROM aria_table_name_to_encrypt ORDER BY int_column_name_to_encrypt LIMIT 10;
+ANALYZE TABLE myisam_table_name_to_encrypt;
+CHECK TABLE aria_table_name_to_encrypt;
+CHECKSUM TABLE innodb_table_name_to_encrypt, myisam_table_name_to_encrypt;
+RENAME USER user_name_to_encrypt to new_user_name_to_encrypt;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM new_user_name_to_encrypt;
+DROP DATABASE database_name_to_encrypt;
+DROP USER new_user_name_to_encrypt;
+DROP SERVER server_name_to_encrypt;
+####################################################
+# Test 4: binlog with annotated events and binlog_row_image=minimal
+####################################################
+connection server_1;
+SET binlog_annotate_row_events= 1;
+SET GLOBAL binlog_annotate_row_events= 1;
+SET GLOBAL binlog_checksum= NONE;
+SET GLOBAL master_verify_checksum= 0;
+SET GLOBAL binlog_row_image= MINIMAL;
+SET binlog_row_image= MINIMAL;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+CREATE DATABASE database_name_to_encrypt;
+USE database_name_to_encrypt;
+CREATE USER user_name_to_encrypt;
+GRANT ALL ON database_name_to_encrypt.* TO user_name_to_encrypt;
+SET PASSWORD FOR user_name_to_encrypt = PASSWORD('password_to_encrypt');
+CREATE TABLE innodb_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB,
+virt_column_name_to_encrypt INT AS (int_column_name_to_encrypt % 10) VIRTUAL,
+pers_column_name_to_encrypt INT AS (int_column_name_to_encrypt) PERSISTENT,
+INDEX `index_name_to_encrypt`(`timestamp_column_name_to_encrypt`)
+) ENGINE=InnoDB
+PARTITION BY RANGE (int_column_name_to_encrypt)
+SUBPARTITION BY KEY (int_column_name_to_encrypt)
+SUBPARTITIONS 2 (
+PARTITION partition0_name_to_encrypt VALUES LESS THAN (100),
+PARTITION partition1_name_to_encrypt VALUES LESS THAN (MAXVALUE)
+)
+;
+CREATE TABLE myisam_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+char_column_name_to_encrypt VARCHAR(255),
+datetime_column_name_to_encrypt DATETIME,
+text_column_name_to_encrypt TEXT
+) ENGINE=MyISAM;
+CREATE TABLE aria_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+varchar_column_name_to_encrypt VARCHAR(1024),
+enum_column_name_to_encrypt ENUM(
+'enum_value1_to_encrypt',
+'enum_value2_to_encrypt'
+ ),
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB
+) ENGINE=Aria;
+CREATE TRIGGER trigger_name_to_encrypt
+AFTER INSERT ON myisam_table_name_to_encrypt FOR EACH ROW
+INSERT INTO aria_table_name_to_encrypt (varchar_column_name_to_encrypt)
+VALUES (NEW.char_column_name_to_encrypt);
+CREATE DEFINER=user_name_to_encrypt VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+CREATE FUNCTION func_name_to_encrypt (func_parameter_to_encrypt INT)
+RETURNS VARCHAR(64)
+RETURN 'func_result_to_encrypt';
+CREATE PROCEDURE proc_name_to_encrypt (
+IN proc_in_parameter_to_encrypt CHAR(32),
+OUT proc_out_parameter_to_encrypt INT
+)
+BEGIN
+DECLARE procvar_name_to_encrypt CHAR(64) DEFAULT 'procvar_val_to_encrypt';
+DECLARE cursor_name_to_encrypt CURSOR FOR
+SELECT virt_column_name_to_encrypt FROM innodb_table_name_to_encrypt;
+DECLARE EXIT HANDLER FOR NOT FOUND
+BEGIN
+SET @stmt_var_to_encrypt = CONCAT(
+"SELECT
+ IF (RAND()>0.5,'enum_value2_to_encrypt','enum_value1_to_encrypt')
+ FROM innodb_table_name_to_encrypt
+ INTO OUTFILE '", proc_in_parameter_to_encrypt, "'");
+PREPARE stmt_to_encrypt FROM @stmt_var_to_encrypt;
+EXECUTE stmt_to_encrypt;
+DEALLOCATE PREPARE stmt_to_encrypt;
+END;
+OPEN cursor_name_to_encrypt;
+proc_label_to_encrypt: LOOP
+FETCH cursor_name_to_encrypt INTO procvar_name_to_encrypt;
+END LOOP;
+CLOSE cursor_name_to_encrypt;
+END $$
+CREATE SERVER server_name_to_encrypt
+FOREIGN DATA WRAPPER mysql
+OPTIONS (HOST 'host_name_to_encrypt');
+connect con1,localhost,user_name_to_encrypt,password_to_encrypt,database_name_to_encrypt;
+CREATE TEMPORARY TABLE tmp_table_name_to_encrypt (
+float_column_name_to_encrypt FLOAT,
+binary_column_name_to_encrypt BINARY(64)
+);
+disconnect con1;
+connection server_1;
+CREATE INDEX index_name_to_encrypt
+ON myisam_table_name_to_encrypt (datetime_column_name_to_encrypt);
+ALTER DATABASE database_name_to_encrypt CHARACTER SET utf8;
+ALTER TABLE innodb_table_name_to_encrypt
+MODIFY timestamp_column_name_to_encrypt TIMESTAMP NOT NULL
+DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+;
+ALTER ALGORITHM=MERGE VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+RENAME TABLE innodb_table_name_to_encrypt TO new_table_name_to_encrypt;
+ALTER TABLE new_table_name_to_encrypt RENAME TO innodb_table_name_to_encrypt;
+set @user_var1_to_encrypt= 'dyncol1_val_to_encrypt';
+set @user_var2_to_encrypt= 'dyncol2_name_to_encrypt';
+INSERT INTO view_name_to_encrypt VALUES
+(1, NOW(6), COLUMN_CREATE('dyncol1_name_to_encrypt',@user_var1_to_encrypt), NULL, NULL),
+(2, NOW(6), COLUMN_CREATE(@user_var2_to_encrypt,'dyncol2_val_to_encrypt'), NULL, NULL)
+;
+BEGIN NOT ATOMIC
+DECLARE counter_name_to_encrypt INT DEFAULT 0;
+START TRANSACTION;
+WHILE counter_name_to_encrypt<12 DO
+INSERT INTO innodb_table_name_to_encrypt
+SELECT NULL, NOW(6), blob_column_name_to_encrypt, NULL, NULL
+FROM innodb_table_name_to_encrypt
+ORDER BY int_column_name_to_encrypt;
+SET counter_name_to_encrypt = counter_name_to_encrypt+1;
+END WHILE;
+COMMIT;
+END
+$$
+INSERT INTO myisam_table_name_to_encrypt
+SELECT NULL, 'char_literal_to_encrypt', NULL, 'text_to_encrypt';
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+CALL proc_name_to_encrypt('file_name_to_encrypt',@useless_var_to_encrypt);
+TRUNCATE TABLE aria_table_name_to_encrypt;
+LOAD DATA INFILE 'file_name_to_encrypt' INTO TABLE aria_table_name_to_encrypt
+(enum_column_name_to_encrypt);
+LOAD DATA LOCAL INFILE '<DATADIR>/database_name_to_encrypt/file_name_to_encrypt'
+INTO TABLE aria_table_name_to_encrypt (enum_column_name_to_encrypt);
+UPDATE view_name_to_encrypt SET blob_column_name_to_encrypt =
+COLUMN_CREATE('dyncol1_name_to_encrypt',func_name_to_encrypt(0))
+;
+DELETE FROM aria_table_name_to_encrypt ORDER BY int_column_name_to_encrypt LIMIT 10;
+ANALYZE TABLE myisam_table_name_to_encrypt;
+CHECK TABLE aria_table_name_to_encrypt;
+CHECKSUM TABLE innodb_table_name_to_encrypt, myisam_table_name_to_encrypt;
+RENAME USER user_name_to_encrypt to new_user_name_to_encrypt;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM new_user_name_to_encrypt;
+DROP DATABASE database_name_to_encrypt;
+DROP USER new_user_name_to_encrypt;
+DROP SERVER server_name_to_encrypt;
+#############################
+# Final checks for the master
+#############################
+NOT FOUND /_to_encrypt/ in master-bin.0*
+NOT FOUND /COMMIT/ in master-bin.0*
+NOT FOUND /TIMESTAMP/ in master-bin.0*
+include/save_master_pos.inc
+#############################
+# Final checks for the slave
+#############################
+connection server_2;
+include/sync_io_with_master.inc
+FOUND /_to_encrypt/ in slave-relay-bin.0*
+FOUND /COMMIT/ in slave-relay-bin.0*
+FOUND /TIMESTAMP/ in slave-relay-bin.0*
+include/start_slave.inc
+include/sync_slave_sql_with_io.inc
+FOUND /_to_encrypt/ in slave-bin.0*
+FOUND /COMMIT/ in slave-bin.0*
+FOUND /TIMESTAMP/ in slave-bin.0*
+##########
+# Cleanup
+##########
+connection server_1;
+SET GLOBAL binlog_annotate_row_events= @binlog_annotate_row_events.save;
+SET GLOBAL binlog_checksum= @binlog_checksum.save;
+SET GLOBAL master_verify_checksum= @master_verify_checksum.save;
+SET GLOBAL binlog_row_image= @binlog_row_image.save;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master.test b/mysql-test/suite/binlog_encryption/encrypted_master.test
new file mode 100644
index 00000000000..5eb0345342d
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master.test
@@ -0,0 +1,183 @@
+#
+# The test checks that basic DDL and DML events are encrypted
+# in the binary log on master.
+# The test is to be run with all binlog formats
+# (combinations for rpl_init.inc take care of that).
+#
+#
+# The test runs with the encrypted master and non-encrypted slave.
+# It generates a sequence of events on master, and checks that
+# - all events are encrypted on master;
+# - slave is able to replicate from the master;
+# - relay logs and binary logs are not encrypted on slave.
+#
+# The same exercise is repeated
+# - without annotated binlog events and without binlog checksums;
+# - with binlog checksums;
+# - with annotated events and binlog checksums;
+# - with annotated events, default checksums and minimal binlog row image
+#
+
+--source encryption_algorithms.inc
+--source include/have_innodb.inc
+--enable_connect_log
+
+--echo #################
+--echo # Initialization
+--echo #################
+
+--disable_connect_log
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+--enable_connect_log
+
+# We stop SQL thread because we want to have
+# all relay logs at the end of the test flow
+
+--connection server_2
+--disable_connect_log
+--source include/stop_slave_sql.inc
+--enable_connect_log
+
+--connection server_1
+
+SET @binlog_annotate_row_events.save= @@global.binlog_annotate_row_events;
+SET @binlog_checksum.save= @@global.binlog_checksum;
+SET @master_verify_checksum.save= @@global.master_verify_checksum;
+SET @binlog_row_image.save= @@global.binlog_row_image;
+
+--echo ####################################################
+--echo # Test 1: simple binlog, no checksum, no annotation
+--echo ####################################################
+
+--connection server_1
+
+SET binlog_annotate_row_events= 0;
+SET GLOBAL binlog_annotate_row_events= 0;
+SET GLOBAL binlog_checksum= NONE;
+SET GLOBAL master_verify_checksum= 0;
+
+--source testdata.inc
+
+--echo ####################################################
+--echo # Test 2: binlog with checksum, no annotated events
+--echo ####################################################
+
+--connection server_1
+
+SET binlog_annotate_row_events= 0;
+SET GLOBAL binlog_annotate_row_events= 0;
+SET GLOBAL binlog_checksum= CRC32;
+SET GLOBAL master_verify_checksum= 1;
+
+--source testdata.inc
+
+--echo ####################################################
+--echo # Test 3: binlog with checksum and annotated events
+--echo ####################################################
+
+--connection server_1
+
+SET binlog_annotate_row_events= 1;
+SET GLOBAL binlog_annotate_row_events= 1;
+SET GLOBAL binlog_checksum= CRC32;
+SET GLOBAL master_verify_checksum= 1;
+
+--source testdata.inc
+
+--echo ####################################################
+--echo # Test 4: binlog with annotated events and binlog_row_image=minimal
+--echo ####################################################
+
+--connection server_1
+
+SET binlog_annotate_row_events= 1;
+SET GLOBAL binlog_annotate_row_events= 1;
+SET GLOBAL binlog_checksum= NONE;
+SET GLOBAL master_verify_checksum= 0;
+SET GLOBAL binlog_row_image= MINIMAL;
+SET binlog_row_image= MINIMAL;
+
+--source testdata.inc
+
+--echo #############################
+--echo # Final checks for the master
+--echo #############################
+
+--let $master_datadir= `SELECT @@datadir`
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= _to_encrypt
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= COMMIT
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= TIMESTAMP
+--source include/search_pattern_in_file.inc
+
+--disable_connect_log
+--source include/save_master_pos.inc
+--enable_connect_log
+
+--echo #############################
+--echo # Final checks for the slave
+--echo #############################
+
+# Wait for the IO thread to write everything to relay logs
+
+--connection server_2
+
+--let $slave_datadir= `SELECT @@datadir`
+
+--disable_connect_log
+--source include/sync_io_with_master.inc
+
+# Check that relay logs are unencrypted
+
+--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
+--let SEARCH_PATTERN= _to_encrypt
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
+--let SEARCH_PATTERN= COMMIT
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
+--let SEARCH_PATTERN= TIMESTAMP
+--source include/search_pattern_in_file.inc
+
+
+# Re-enable SQL thread, let it catch up with IO thread
+# and check slave binary logs
+
+--source include/start_slave.inc
+--source include/sync_slave_sql_with_io.inc
+--enable_connect_log
+
+--let SEARCH_FILE= $slave_datadir/slave-bin.0*
+--let SEARCH_PATTERN= _to_encrypt
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-bin.0*
+--let SEARCH_PATTERN= COMMIT
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-bin.0*
+--let SEARCH_PATTERN= TIMESTAMP
+--source include/search_pattern_in_file.inc
+
+--echo ##########
+--echo # Cleanup
+--echo ##########
+
+--connection server_1
+SET GLOBAL binlog_annotate_row_events= @binlog_annotate_row_events.save;
+SET GLOBAL binlog_checksum= @binlog_checksum.save;
+SET GLOBAL master_verify_checksum= @master_verify_checksum.save;
+SET GLOBAL binlog_row_image= @binlog_row_image.save;
+
+--disable_connect_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_lost_key.result b/mysql-test/suite/binlog_encryption/encrypted_master_lost_key.result
new file mode 100644
index 00000000000..5c934af15e4
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_lost_key.result
@@ -0,0 +1,111 @@
+#################
+# Initialization
+#################
+include/rpl_init.inc [topology=1->2]
+connection server_2;
+include/stop_slave.inc
+#####################################################
+# Pre-test 1: Initial key value
+#####################################################
+connection server_1;
+CREATE TABLE table1_to_encrypt (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table1_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table1_to_encrypt SELECT NULL,NOW(),b FROM table1_to_encrypt;
+SET binlog_format=ROW;
+INSERT INTO table1_to_encrypt SELECT NULL,NOW(),b FROM table1_to_encrypt;
+INSERT INTO table1_to_encrypt SELECT NULL,NOW(),b FROM table1_to_encrypt;
+NOT FOUND /table1_to_encrypt/ in master-bin.0*
+#######################################################
+# Pre-test 2: restart master with a different key value
+#######################################################
+connection default;
+connection server_1;
+CREATE TABLE table2_to_encrypt (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+NOT FOUND /table2_to_encrypt/ in master-bin.0*
+#####################################################
+# Pre-test 3: restart master again with the right key
+#####################################################
+connection default;
+connection server_1;
+CREATE TABLE table3_to_encrypt (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table3_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table3_to_encrypt SELECT NULL,NOW(),b FROM table3_to_encrypt;
+INSERT INTO table3_to_encrypt SELECT NULL,NOW(),b FROM table3_to_encrypt;
+FLUSH BINARY LOGS;
+INSERT INTO table3_to_encrypt SELECT NULL,NOW(),b FROM table3_to_encrypt;
+#####################################################
+# Test 1: Check that if master has an encrypted
+# binary log which it cannot decrypt, it
+# still feeds events to the slave, and SQL
+# thread produces an expected error upon
+# receiving these unreadable events .
+# This behavior is confirmed in MDEV-11323
+#####################################################
+connection server_2;
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1594]
+SHOW TABLES;
+Tables_in_test
+table1_to_encrypt
+SELECT COUNT(*) FROM table1_to_encrypt;
+COUNT(*)
+8
+#####################################################
+# Test 2: check that replication works if it starts
+# from a good binary log
+#####################################################
+connection server_2;
+include/stop_slave.inc
+RESET SLAVE ALL;
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=<MASTER_PORT>, MASTER_USER='root', MASTER_LOG_FILE='master-bin.000003';
+include/start_slave.inc
+SHOW TABLES;
+Tables_in_test
+table3_to_encrypt
+#####################################################
+# Test 3: check that replication works if we purge
+# master logs up to the good one
+#####################################################
+connection server_2;
+connection server_1;
+PURGE BINARY LOGS TO 'master-bin.000003';
+connection server_2;
+include/stop_slave.inc
+RESET SLAVE ALL;
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=<MASTER_PORT>, MASTER_USER='root';
+include/start_slave.inc
+SHOW TABLES;
+Tables_in_test
+table3_to_encrypt
+##########
+# Cleanup
+##########
+connection server_1;
+DROP TABLE table1_to_encrypt, table2_to_encrypt, table3_to_encrypt;
+connection server_2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_lost_key.test b/mysql-test/suite/binlog_encryption/encrypted_master_lost_key.test
new file mode 100644
index 00000000000..7e5fd7859f0
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_lost_key.test
@@ -0,0 +1,205 @@
+#
+# The test checks effects and workarounds for the situation when
+# the key used to encrypt previous binary logs on master has been lost,
+# and master runs with a different one.
+#
+# The test starts with encrypted binlogs on master.
+# It stops replication, generates a few statement and row events
+# on the master, then restarts the server with encrypted binlog,
+# but with a different value for key 1.
+#
+# Then it resumes replication and checks what happens when the master
+# feed the encrypted logs to the slave (slave SQL thread should
+# produce and error).
+#
+# Then the test resets the slave, configures it to start from a "good"
+# master binlog log, for which the master has a key, starts replication
+# and checks that it works.
+#
+# Then it resets the slave again, purges binary logs on master up
+# to the "good" one, starts replication and checks that it works.
+#
+
+--source include/have_binlog_format_mixed.inc
+
+--echo #################
+--echo # Initialization
+--echo #################
+
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+
+--enable_connect_log
+
+# We stop replication because we want it to happen after the switch
+
+--connection server_2
+--disable_connect_log
+--source include/stop_slave.inc
+--enable_connect_log
+
+--echo #####################################################
+--echo # Pre-test 1: Initial key value
+--echo #####################################################
+
+--connection server_1
+
+CREATE TABLE table1_to_encrypt (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table1_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table1_to_encrypt SELECT NULL,NOW(),b FROM table1_to_encrypt;
+SET binlog_format=ROW;
+INSERT INTO table1_to_encrypt SELECT NULL,NOW(),b FROM table1_to_encrypt;
+INSERT INTO table1_to_encrypt SELECT NULL,NOW(),b FROM table1_to_encrypt;
+
+# Make sure that binary logs are encrypted
+
+--let SEARCH_FILE= master-bin.0*
+--let SEARCH_PATTERN= table1_to_encrypt
+--source include/search_pattern_in_file.inc
+
+--echo #######################################################
+--echo # Pre-test 2: restart master with a different key value
+--echo #######################################################
+
+--write_file $MYSQL_TMP_DIR/master_lose_key.key
+1;00000AAAAAAAAAAAAAAAAAAAAAA00000
+EOF
+
+--let $rpl_server_parameters= --file-key-management-filename=$MYSQL_TMP_DIR/master_lose_key.key
+
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+CREATE TABLE table2_to_encrypt (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+
+# Make sure that binary logs are encrypted
+
+--let SEARCH_FILE= master-bin.0*
+--let SEARCH_PATTERN= table2_to_encrypt
+--source include/search_pattern_in_file.inc
+
+--echo #####################################################
+--echo # Pre-test 3: restart master again with the right key
+--echo #####################################################
+
+--let $rpl_server_parameters=
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+--let $good_master_binlog= query_get_value(SHOW MASTER STATUS,File,1)
+
+CREATE TABLE table3_to_encrypt (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table3_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table3_to_encrypt SELECT NULL,NOW(),b FROM table3_to_encrypt;
+INSERT INTO table3_to_encrypt SELECT NULL,NOW(),b FROM table3_to_encrypt;
+FLUSH BINARY LOGS;
+INSERT INTO table3_to_encrypt SELECT NULL,NOW(),b FROM table3_to_encrypt;
+
+--save_master_pos
+
+--echo #####################################################
+--echo # Test 1: Check that if master has an encrypted
+--echo # binary log which it cannot decrypt, it
+--echo # still feeds events to the slave, and SQL
+--echo # thread produces an expected error upon
+--echo # receiving these unreadable events .
+--echo # This behavior is confirmed in MDEV-11323
+--echo #####################################################
+--connection server_2
+
+--disable_connect_log
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+
+START SLAVE SQL_THREAD;
+--let $slave_sql_errno= 1594
+--source include/wait_for_slave_sql_error.inc
+--enable_connect_log
+
+# Here we should see only table1_to_encrypt and its contents,
+# because it was logged with the initial key
+--sorted_result
+SHOW TABLES;
+SELECT COUNT(*) FROM table1_to_encrypt;
+
+--echo #####################################################
+--echo # Test 2: check that replication works if it starts
+--echo # from a good binary log
+--echo #####################################################
+--connection server_2
+
+--disable_connect_log
+--source include/stop_slave.inc
+RESET SLAVE ALL;
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--replace_result $SERVER_MYPORT_1 <MASTER_PORT>
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SERVER_MYPORT_1, MASTER_USER='root', MASTER_LOG_FILE='$good_master_binlog';
+--source include/start_slave.inc
+--enable_connect_log
+--sync_with_master
+
+--sorted_result
+SHOW TABLES;
+
+--echo #####################################################
+--echo # Test 3: check that replication works if we purge
+--echo # master logs up to the good one
+--echo #####################################################
+--connection server_2
+
+--connection server_1
+eval PURGE BINARY LOGS TO '$good_master_binlog';
+
+--connection server_2
+--disable_connect_log
+--source include/stop_slave.inc
+RESET SLAVE ALL;
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--replace_result $SERVER_MYPORT_1 <MASTER_PORT>
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SERVER_MYPORT_1, MASTER_USER='root';
+--source include/start_slave.inc
+--enable_connect_log
+--sync_with_master
+
+--sorted_result
+SHOW TABLES;
+
+--echo ##########
+--echo # Cleanup
+--echo ##########
+
+--connection server_1
+
+DROP TABLE table1_to_encrypt, table2_to_encrypt, table3_to_encrypt;
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--disable_connect_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf
new file mode 100644
index 00000000000..73c9ad655bf
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf
@@ -0,0 +1,5 @@
+!include my.cnf
+
+[mysqld.1]
+encrypt-binlog=0
+skip-file-key-management
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result
new file mode 100644
index 00000000000..f9a063724ca
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result
@@ -0,0 +1,87 @@
+#################
+# Initialization
+#################
+include/rpl_init.inc [topology=1->2]
+connection server_2;
+include/stop_slave.inc
+#####################################################
+# Part 1: unencrypted master
+#####################################################
+connection server_1;
+call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'Could not decrypt binlog: encryption key error;");
+CREATE TABLE table1_no_encryption (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+NOT FOUND /table1_no_encryption/ in master-bin.0*
+#####################################################
+# Part 2: restart master, now with binlog encryption
+#####################################################
+connection default;
+connection server_1;
+CREATE TABLE table2_to_encrypt (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+NOT FOUND /table2_to_encrypt/ in master-bin.0*
+#####################################################
+# Part 3: restart master again without encryption
+#####################################################
+connection default;
+connection server_1;
+CREATE TABLE table3_no_encryption (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+#####################################################
+# Check: resume replication and check how it goes
+#####################################################
+connection server_2;
+start slave;
+connection server_1;
+connection server_2;
+include/wait_for_slave_io_error.inc [errno=1236]
+connection server_2;
+connection server_2;
+connection server_2;
+SHOW TABLES;
+Tables_in_test
+table1_no_encryption
+include/stop_slave.inc
+reset slave;
+##########
+# Cleanup
+##########
+connection server_1;
+reset master;
+SELECT COUNT(*) FROM table1_no_encryption;
+COUNT(*)
+8
+SELECT COUNT(*) FROM table2_to_encrypt;
+COUNT(*)
+8
+SELECT COUNT(*) FROM table3_no_encryption;
+COUNT(*)
+4
+DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
+connection server_2;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test
new file mode 100644
index 00000000000..91231f89307
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test
@@ -0,0 +1,151 @@
+#
+# TODO: write here what the test checks after MDEV-11288 is fixed
+#
+# The test starts with unencrypted master.
+# It stops replication, generates a few statement and row events
+# on the master, then restarts the server with encrypted binlog,
+# generates some more events and restarts it back without encryption
+# (no encryption plugin).
+# Then it resumes replication and checks what happens when the server
+# tries to feed the binary logs (included the encrypted ones)
+# to the slave.
+#
+
+--source include/have_binlog_format_mixed.inc
+
+--echo #################
+--echo # Initialization
+--echo #################
+
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+
+--enable_connect_log
+
+# We stop replication because we want it to happen after the switch
+
+--connection server_2
+--disable_connect_log
+--source include/stop_slave.inc
+--enable_connect_log
+
+--echo #####################################################
+--echo # Part 1: unencrypted master
+--echo #####################################################
+
+--connection server_1
+
+call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'Could not decrypt binlog: encryption key error;");
+
+CREATE TABLE table1_no_encryption (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+
+# Make sure that binary logs are not encrypted
+
+--let SEARCH_FILE= master-bin.0*
+--let SEARCH_PATTERN= table1_no_encryption
+--source include/search_pattern_in_file.inc
+
+# We are storing the position now, because up to this point the slave
+# should be able to synchronize with master
+--save_master_pos
+
+--echo #####################################################
+--echo # Part 2: restart master, now with binlog encryption
+--echo #####################################################
+
+--let $rpl_server_parameters= --encrypt-binlog=1 --plugin-load-add=$FILE_KEY_MANAGEMENT_SO --file-key-management --loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+CREATE TABLE table2_to_encrypt (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+
+# Make sure that binary logs are encrypted
+
+--let SEARCH_FILE= master-bin.0*
+--let SEARCH_PATTERN= table2_to_encrypt
+--source include/search_pattern_in_file.inc
+
+--echo #####################################################
+--echo # Part 3: restart master again without encryption
+--echo #####################################################
+
+--let $rpl_server_parameters= --encrypt-binlog=0
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+CREATE TABLE table3_no_encryption (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+
+--echo #####################################################
+--echo # Check: resume replication and check how it goes
+--echo #####################################################
+
+--connection server_2
+start slave;
+# The slave should be able to synchronize with master up to
+# the previously saved position (when the log was still unencrypted)
+--sync_with_master
+
+--connection server_1
+# Now save the current position and make slave to try to syncrhonize.
+# It shouldn't work, the slave IO thread is expected to abort with an error
+--save_master_pos
+
+--connection server_2
+--let slave_io_errno=1236
+--source include/wait_for_slave_io_error.inc
+
+--sorted_result
+SHOW TABLES;
+
+--disable_connect_log
+--source include/stop_slave.inc
+--enable_connect_log
+reset slave;
+
+--echo ##########
+--echo # Cleanup
+--echo ##########
+
+--connection server_1
+reset master;
+
+SELECT COUNT(*) FROM table1_no_encryption;
+SELECT COUNT(*) FROM table2_to_encrypt;
+SELECT COUNT(*) FROM table3_no_encryption;
+DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
+
+--connection server_2
+--disable_connect_log
+--source include/start_slave.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_slave.cnf b/mysql-test/suite/binlog_encryption/encrypted_slave.cnf
new file mode 100644
index 00000000000..fac94db71df
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_slave.cnf
@@ -0,0 +1,12 @@
+!include my.cnf
+
+[mysqld.1]
+encrypt-binlog=0
+
+[mysqld.2]
+#log-slave-updates
+encrypt-binlog
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+file-key-management
+loose-file-key-management-filename= @ENV.MYSQL_TEST_DIR/std_data/keys.txt
+binlog_checksum=NONE
diff --git a/mysql-test/suite/binlog_encryption/encrypted_slave.result b/mysql-test/suite/binlog_encryption/encrypted_slave.result
new file mode 100644
index 00000000000..c78cd9d1507
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_slave.result
@@ -0,0 +1,175 @@
+#################
+# Initialization
+#################
+include/rpl_init.inc [topology=1->2]
+connection server_2;
+include/stop_slave_sql.inc
+#################
+# Test flow
+#################
+connection server_1;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+CREATE DATABASE database_name_to_encrypt;
+USE database_name_to_encrypt;
+CREATE USER user_name_to_encrypt;
+GRANT ALL ON database_name_to_encrypt.* TO user_name_to_encrypt;
+SET PASSWORD FOR user_name_to_encrypt = PASSWORD('password_to_encrypt');
+CREATE TABLE innodb_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB,
+virt_column_name_to_encrypt INT AS (int_column_name_to_encrypt % 10) VIRTUAL,
+pers_column_name_to_encrypt INT AS (int_column_name_to_encrypt) PERSISTENT,
+INDEX `index_name_to_encrypt`(`timestamp_column_name_to_encrypt`)
+) ENGINE=InnoDB
+PARTITION BY RANGE (int_column_name_to_encrypt)
+SUBPARTITION BY KEY (int_column_name_to_encrypt)
+SUBPARTITIONS 2 (
+PARTITION partition0_name_to_encrypt VALUES LESS THAN (100),
+PARTITION partition1_name_to_encrypt VALUES LESS THAN (MAXVALUE)
+)
+;
+CREATE TABLE myisam_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+char_column_name_to_encrypt VARCHAR(255),
+datetime_column_name_to_encrypt DATETIME,
+text_column_name_to_encrypt TEXT
+) ENGINE=MyISAM;
+CREATE TABLE aria_table_name_to_encrypt (
+int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+varchar_column_name_to_encrypt VARCHAR(1024),
+enum_column_name_to_encrypt ENUM(
+'enum_value1_to_encrypt',
+'enum_value2_to_encrypt'
+ ),
+timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+blob_column_name_to_encrypt BLOB
+) ENGINE=Aria;
+CREATE TRIGGER trigger_name_to_encrypt
+AFTER INSERT ON myisam_table_name_to_encrypt FOR EACH ROW
+INSERT INTO aria_table_name_to_encrypt (varchar_column_name_to_encrypt)
+VALUES (NEW.char_column_name_to_encrypt);
+CREATE DEFINER=user_name_to_encrypt VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+CREATE FUNCTION func_name_to_encrypt (func_parameter_to_encrypt INT)
+RETURNS VARCHAR(64)
+RETURN 'func_result_to_encrypt';
+CREATE PROCEDURE proc_name_to_encrypt (
+IN proc_in_parameter_to_encrypt CHAR(32),
+OUT proc_out_parameter_to_encrypt INT
+)
+BEGIN
+DECLARE procvar_name_to_encrypt CHAR(64) DEFAULT 'procvar_val_to_encrypt';
+DECLARE cursor_name_to_encrypt CURSOR FOR
+SELECT virt_column_name_to_encrypt FROM innodb_table_name_to_encrypt;
+DECLARE EXIT HANDLER FOR NOT FOUND
+BEGIN
+SET @stmt_var_to_encrypt = CONCAT(
+"SELECT
+ IF (RAND()>0.5,'enum_value2_to_encrypt','enum_value1_to_encrypt')
+ FROM innodb_table_name_to_encrypt
+ INTO OUTFILE '", proc_in_parameter_to_encrypt, "'");
+PREPARE stmt_to_encrypt FROM @stmt_var_to_encrypt;
+EXECUTE stmt_to_encrypt;
+DEALLOCATE PREPARE stmt_to_encrypt;
+END;
+OPEN cursor_name_to_encrypt;
+proc_label_to_encrypt: LOOP
+FETCH cursor_name_to_encrypt INTO procvar_name_to_encrypt;
+END LOOP;
+CLOSE cursor_name_to_encrypt;
+END $$
+CREATE SERVER server_name_to_encrypt
+FOREIGN DATA WRAPPER mysql
+OPTIONS (HOST 'host_name_to_encrypt');
+connect con1,localhost,user_name_to_encrypt,password_to_encrypt,database_name_to_encrypt;
+CREATE TEMPORARY TABLE tmp_table_name_to_encrypt (
+float_column_name_to_encrypt FLOAT,
+binary_column_name_to_encrypt BINARY(64)
+);
+disconnect con1;
+connection server_1;
+CREATE INDEX index_name_to_encrypt
+ON myisam_table_name_to_encrypt (datetime_column_name_to_encrypt);
+ALTER DATABASE database_name_to_encrypt CHARACTER SET utf8;
+ALTER TABLE innodb_table_name_to_encrypt
+MODIFY timestamp_column_name_to_encrypt TIMESTAMP NOT NULL
+DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+;
+ALTER ALGORITHM=MERGE VIEW view_name_to_encrypt
+AS SELECT * FROM innodb_table_name_to_encrypt;
+RENAME TABLE innodb_table_name_to_encrypt TO new_table_name_to_encrypt;
+ALTER TABLE new_table_name_to_encrypt RENAME TO innodb_table_name_to_encrypt;
+set @user_var1_to_encrypt= 'dyncol1_val_to_encrypt';
+set @user_var2_to_encrypt= 'dyncol2_name_to_encrypt';
+INSERT INTO view_name_to_encrypt VALUES
+(1, NOW(6), COLUMN_CREATE('dyncol1_name_to_encrypt',@user_var1_to_encrypt), NULL, NULL),
+(2, NOW(6), COLUMN_CREATE(@user_var2_to_encrypt,'dyncol2_val_to_encrypt'), NULL, NULL)
+;
+BEGIN NOT ATOMIC
+DECLARE counter_name_to_encrypt INT DEFAULT 0;
+START TRANSACTION;
+WHILE counter_name_to_encrypt<12 DO
+INSERT INTO innodb_table_name_to_encrypt
+SELECT NULL, NOW(6), blob_column_name_to_encrypt, NULL, NULL
+FROM innodb_table_name_to_encrypt
+ORDER BY int_column_name_to_encrypt;
+SET counter_name_to_encrypt = counter_name_to_encrypt+1;
+END WHILE;
+COMMIT;
+END
+$$
+INSERT INTO myisam_table_name_to_encrypt
+SELECT NULL, 'char_literal_to_encrypt', NULL, 'text_to_encrypt';
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+CALL proc_name_to_encrypt('file_name_to_encrypt',@useless_var_to_encrypt);
+TRUNCATE TABLE aria_table_name_to_encrypt;
+LOAD DATA INFILE 'file_name_to_encrypt' INTO TABLE aria_table_name_to_encrypt
+(enum_column_name_to_encrypt);
+LOAD DATA LOCAL INFILE '<DATADIR>/database_name_to_encrypt/file_name_to_encrypt'
+INTO TABLE aria_table_name_to_encrypt (enum_column_name_to_encrypt);
+UPDATE view_name_to_encrypt SET blob_column_name_to_encrypt =
+COLUMN_CREATE('dyncol1_name_to_encrypt',func_name_to_encrypt(0))
+;
+DELETE FROM aria_table_name_to_encrypt ORDER BY int_column_name_to_encrypt LIMIT 10;
+ANALYZE TABLE myisam_table_name_to_encrypt;
+CHECK TABLE aria_table_name_to_encrypt;
+CHECKSUM TABLE innodb_table_name_to_encrypt, myisam_table_name_to_encrypt;
+RENAME USER user_name_to_encrypt to new_user_name_to_encrypt;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM new_user_name_to_encrypt;
+DROP DATABASE database_name_to_encrypt;
+DROP USER new_user_name_to_encrypt;
+DROP SERVER server_name_to_encrypt;
+#################
+# Master binlog checks
+#################
+FOUND /_to_encrypt/ in master-bin.0*
+FOUND /COMMIT/ in master-bin.0*
+FOUND /TIMESTAMP/ in master-bin.0*
+include/save_master_pos.inc
+#################
+# Relay log checks
+#################
+connection server_2;
+include/sync_io_with_master.inc
+NOT FOUND /_to_encrypt/ in slave-relay-bin.0*
+NOT FOUND /COMMIT/ in slave-relay-bin.0*
+NOT FOUND /TIMESTAMP/ in slave-relay-bin.0*
+#################
+# Slave binlog checks
+#################
+include/start_slave.inc
+include/sync_slave_sql_with_io.inc
+include/sync_io_with_master.inc
+NOT FOUND /_to_encrypt/ in slave-bin.0*
+NOT FOUND /COMMIT/ in slave-bin.0*
+NOT FOUND /TIMESTAMP/ in slave-bin.0*
+##########
+# Cleanup
+##########
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_slave.test b/mysql-test/suite/binlog_encryption/encrypted_slave.test
new file mode 100644
index 00000000000..a69e78cd940
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_slave.test
@@ -0,0 +1,117 @@
+#
+# The test checks that basic DDL and DML events are encrypted
+# in the relay and binary logs on slave.
+# The test is to be run with all binlog formats
+# (combinations for rpl_init.inc take care of that).
+#
+# The test runs with the non-encrypted master and encrypted slave.
+# It generates a sequence of events on master and checks that
+# relay logs and binary logs are encrypted on slave.
+#
+
+--source encryption_algorithms.inc
+--source include/have_innodb.inc
+
+--echo #################
+--echo # Initialization
+--echo #################
+
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+
+--enable_connect_log
+--connection server_2
+
+# We stop SQL thread because we want to have
+# all relay logs at the end of the test flow
+
+--disable_connect_log
+--source include/stop_slave_sql.inc
+--enable_connect_log
+
+--echo #################
+--echo # Test flow
+--echo #################
+
+--connection server_1
+--source testdata.inc
+
+--echo #################
+--echo # Master binlog checks
+--echo #################
+
+--let $master_datadir= `SELECT @@datadir`
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= _to_encrypt
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= COMMIT
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= TIMESTAMP
+--source include/search_pattern_in_file.inc
+
+--disable_connect_log
+--source include/save_master_pos.inc
+--enable_connect_log
+
+--echo #################
+--echo # Relay log checks
+--echo #################
+
+--connection server_2
+--disable_connect_log
+--source include/sync_io_with_master.inc
+--enable_connect_log
+
+--let $slave_datadir= `SELECT @@datadir`
+
+--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
+--let SEARCH_PATTERN= _to_encrypt
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
+--let SEARCH_PATTERN= COMMIT
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
+--let SEARCH_PATTERN= TIMESTAMP
+--source include/search_pattern_in_file.inc
+
+--echo #################
+--echo # Slave binlog checks
+--echo #################
+
+# Re-enable SQL thread, let it catch up with IO thread
+# and check slave binary logs
+
+--disable_connect_log
+--source include/start_slave.inc
+--source include/sync_slave_sql_with_io.inc
+--enable_connect_log
+
+--disable_connect_log
+--source include/sync_io_with_master.inc
+--enable_connect_log
+
+--let SEARCH_FILE= $slave_datadir/slave-bin.0*
+--let SEARCH_PATTERN= _to_encrypt
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-bin.0*
+--let SEARCH_PATTERN= COMMIT
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_FILE= $slave_datadir/slave-bin.0*
+--let SEARCH_PATTERN= TIMESTAMP
+--source include/search_pattern_in_file.inc
+
+--echo ##########
+--echo # Cleanup
+--echo ##########
+
+--disable_connect_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encryption_algorithms.combinations b/mysql-test/suite/binlog_encryption/encryption_algorithms.combinations
new file mode 100644
index 00000000000..6bda5a6b35e
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encryption_algorithms.combinations
@@ -0,0 +1,5 @@
+[ctr]
+loose-file-key-management-encryption-algorithm=aes_ctr
+
+[cbc]
+loose-file-key-management-encryption-algorithm=aes_cbc
diff --git a/mysql-test/suite/binlog_encryption/encryption_algorithms.inc b/mysql-test/suite/binlog_encryption/encryption_algorithms.inc
new file mode 100644
index 00000000000..ca559622b26
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encryption_algorithms.inc
@@ -0,0 +1,2 @@
+# Empty include file just to enable encryption algorithm combinations
+# for those tests which need them
diff --git a/mysql-test/suite/binlog_encryption/encryption_combo.cnf b/mysql-test/suite/binlog_encryption/encryption_combo.cnf
new file mode 100644
index 00000000000..bc4ecbcb47a
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encryption_combo.cnf
@@ -0,0 +1,5 @@
+!include my.cnf
+
+[mysqld.1]
+encrypt-binlog=0
+
diff --git a/mysql-test/suite/binlog_encryption/encryption_combo.result b/mysql-test/suite/binlog_encryption/encryption_combo.result
new file mode 100644
index 00000000000..d921c73440d
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encryption_combo.result
@@ -0,0 +1,78 @@
+#################
+# Initialization
+#################
+include/rpl_init.inc [topology=1->2]
+connection server_2;
+include/stop_slave.inc
+#####################################################
+# Part 1: unencrypted master
+#####################################################
+connection server_1;
+CREATE TABLE table1_no_encryption (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+FOUND /table1_no_encryption/ in master-bin.0*
+#####################################################
+# Part 2: restart master, now with binlog encryption
+#####################################################
+connection default;
+connection server_1;
+CREATE TABLE table2_to_encrypt (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+NOT FOUND /table2_to_encrypt/ in master-bin.0*
+#####################################################
+# Part 3: restart master again without encryption
+#####################################################
+connection default;
+connection server_1;
+CREATE TABLE table3_no_encryption (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+#####################################################
+# Check: resume replication and check that it works
+#####################################################
+connection server_2;
+include/start_slave.inc
+SHOW TABLES;
+Tables_in_test
+table1_no_encryption
+table2_to_encrypt
+table3_no_encryption
+##########
+# Cleanup
+##########
+connection server_1;
+SELECT COUNT(*) FROM table1_no_encryption;
+COUNT(*)
+8
+SELECT COUNT(*) FROM table2_to_encrypt;
+COUNT(*)
+8
+SELECT COUNT(*) FROM table3_no_encryption;
+COUNT(*)
+4
+DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
+connection server_2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encryption_combo.test b/mysql-test/suite/binlog_encryption/encryption_combo.test
new file mode 100644
index 00000000000..a5cf117d4a8
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encryption_combo.test
@@ -0,0 +1,136 @@
+#
+# The test checks that master with decryption capabilities can switch
+# between encrypted and unencrypted logs (with server restart),
+# and can feed the mix of encrypted/unencrypted logs to a slave.
+#
+# The test starts with unencrypted master.
+# It stops replication, generates a few statement and row events
+# on the master, then restarts the server with encrypted binlog,
+# generates some more events and restarts it back with unencrypted binlog.
+# Then it resumes replication and checks that all events
+# are replicated successfully.
+#
+
+--source include/have_binlog_format_mixed.inc
+
+--echo #################
+--echo # Initialization
+--echo #################
+
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+
+--enable_connect_log
+
+# We stop replication because we want it to happen after the switch
+
+--connection server_2
+--disable_connect_log
+--source include/stop_slave.inc
+--enable_connect_log
+
+--echo #####################################################
+--echo # Part 1: unencrypted master
+--echo #####################################################
+
+--connection server_1
+
+CREATE TABLE table1_no_encryption (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+
+# Make sure that binary logs are not encrypted
+
+--let $master_datadir= `SELECT @@datadir`
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= table1_no_encryption
+--source include/search_pattern_in_file.inc
+
+--echo #####################################################
+--echo # Part 2: restart master, now with binlog encryption
+--echo #####################################################
+
+--let $rpl_server_parameters= --encrypt-binlog=1
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+CREATE TABLE table2_to_encrypt (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+
+# Make sure that binary logs are encrypted
+
+--let SEARCH_FILE= $master_datadir/master-bin.0*
+--let SEARCH_PATTERN= table2_to_encrypt
+--source include/search_pattern_in_file.inc
+
+--echo #####################################################
+--echo # Part 3: restart master again without encryption
+--echo #####################################################
+
+--let $rpl_server_parameters= --encrypt-binlog=0
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+CREATE TABLE table3_no_encryption (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+
+--save_master_pos
+
+--echo #####################################################
+--echo # Check: resume replication and check that it works
+--echo #####################################################
+--connection server_2
+
+--disable_connect_log
+--source include/start_slave.inc
+--enable_connect_log
+--sync_with_master
+
+--sorted_result
+SHOW TABLES;
+
+--echo ##########
+--echo # Cleanup
+--echo ##########
+
+--connection server_1
+
+SELECT COUNT(*) FROM table1_no_encryption;
+SELECT COUNT(*) FROM table2_to_encrypt;
+SELECT COUNT(*) FROM table3_no_encryption;
+DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--disable_connect_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/multisource.cnf b/mysql-test/suite/binlog_encryption/multisource.cnf
new file mode 100644
index 00000000000..52db51d9086
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/multisource.cnf
@@ -0,0 +1,17 @@
+!include my.cnf
+
+[mysqld.1]
+log-bin=master-bin
+
+[mysqld.2]
+log-bin=master-bin
+
+[mysqld.3]
+innodb
+log-bin=slave-bin
+server-id=3
+log-warnings=2
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
diff --git a/mysql-test/suite/binlog_encryption/multisource.result b/mysql-test/suite/binlog_encryption/multisource.result
new file mode 100644
index 00000000000..227e88f6d71
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/multisource.result
@@ -0,0 +1,205 @@
+change master 'abc' to relay_log_file='';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+change master 'abc2' to master_host='';
+ERROR HY000: Incorrect arguments to MASTER_HOST
+change master 'master1' to
+master_port=MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+start slave 'master1';
+set default_master_connection = 'master1';
+include/wait_for_slave_to_start.inc
+#
+# 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'
+#
+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;
+insert into t1 (f1) values ('one'),('two');
+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 'master1' 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_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 'master2' to
+master_port=MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+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'
+#
+insert into t1 (f1) values ('three');
+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);
+select * from db1.t1;
+i f1
+1 one
+2 two
+3 three
+select * from db2.t1;
+pk f1
+commit;
+select * from db2.t1;
+pk f1
+1 1
+2 2
+flush logs;
+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;
+#
+# 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'
+#
+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 */
+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
+drop database db1;
+drop database db2;
+include/reset_master_slave.inc
+drop database db1;
+include/reset_master_slave.inc
+drop database db2;
+include/reset_master_slave.inc
diff --git a/mysql-test/suite/binlog_encryption/multisource.test b/mysql-test/suite/binlog_encryption/multisource.test
new file mode 100644
index 00000000000..e37970d6234
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/multisource.test
@@ -0,0 +1,2 @@
+--let $binlog_extra_length= 36
+--source extra/rpl_tests/multisource.inc
diff --git a/mysql-test/suite/binlog_encryption/my.cnf b/mysql-test/suite/binlog_encryption/my.cnf
new file mode 100644
index 00000000000..d787ebe1d4c
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/my.cnf
@@ -0,0 +1,27 @@
+!include include/default_mysqld.cnf
+!include include/default_client.cnf
+
+[mysqld.1]
+innodb
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+loose-file-key-management-filename= @ENV.MYSQLTEST_VARDIR/std_data/keys.txt
+encrypt-binlog
+log-basename= master
+
+[mysqld.2]
+#!use-slave-opt
+innodb
+log-slave-updates
+log-basename= slave
+
+[ENV]
+
+# We will adopt tests with master-slave setup as well as rpl_init setup,
+# so need both sets of variables
+MASTER_MYPORT= @mysqld.1.port
+SERVER_MYPORT_1= @mysqld.1.port
+SERVER_MYSOCK_1= @mysqld.1.socket
+
+SLAVE_MYPORT= @mysqld.2.port
+SERVER_MYPORT_2= @mysqld.2.port
+SERVER_MYSOCK_2= @mysqld.2.socket
diff --git a/mysql-test/suite/binlog_encryption/mysqlbinlog.result b/mysql-test/suite/binlog_encryption/mysqlbinlog.result
new file mode 100644
index 00000000000..71758f7d6e7
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/mysqlbinlog.result
@@ -0,0 +1,6 @@
+RESET MASTER;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+REPLACE INTO t1 VALUES (4);
+DROP TABLE t1;
+FLUSH LOGS;
diff --git a/mysql-test/suite/binlog_encryption/mysqlbinlog.test b/mysql-test/suite/binlog_encryption/mysqlbinlog.test
new file mode 100644
index 00000000000..b80388aaa45
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/mysqlbinlog.test
@@ -0,0 +1,21 @@
+source include/have_log_bin.inc;
+source include/have_debug.inc;
+
+let datadir=`select @@datadir`;
+RESET MASTER;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+REPLACE INTO t1 VALUES (4);
+DROP TABLE t1;
+FLUSH LOGS;
+
+let filename= master-bin.000001;
+let local=$datadir/$filename;
+let remote=--read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot $filename;
+let outfile=$MYSQLTEST_VARDIR/tmp/binlog_enc.sql;
+--error 1
+exec $MYSQL_BINLOG $local > $outfile;
+exec $MYSQL_BINLOG $local --force-read >> $outfile;
+exec $MYSQL_BINLOG $remote >> $outfile;
+remove_file $outfile;
+
diff --git a/mysql-test/suite/binlog_encryption/restart_server.inc b/mysql-test/suite/binlog_encryption/restart_server.inc
new file mode 100644
index 00000000000..6cd0788cf43
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/restart_server.inc
@@ -0,0 +1,35 @@
+#
+# We can not use the common include/restart_mysqld.inc or include/rpl_restart_server.inc,
+# because they have hardcoded connection names (master, master1)
+# which are not initiated by rpl_init.inc.
+# This is the relevant and simplified part of the same set of scripts.
+#
+# ==== Usage ====
+#
+# --let $rpl_server_number= N
+# Number to identify the server that needs to reconnect.
+# 1 is the master server, 2 the slave server
+# [--let $rpl_server_parameters= --flag1 --flag2 ...]
+# --source restart_server.inc
+#
+
+--let $_cur_con= $CURRENT_CONNECTION
+
+--connection default
+--enable_reconnect
+
+--connection $_cur_con
+--enable_reconnect
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
+
+shutdown_server 10;
+
+--source include/wait_until_disconnected.inc
+
+--let $_rpl_start_server_command= restart
+if ($rpl_server_parameters)
+{
+ --let $_rpl_start_server_command= restart:$rpl_server_parameters
+}
+--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
+--source include/wait_until_connected_again.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.cnf b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.cnf
new file mode 100644
index 00000000000..2d3db66ebb5
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.cnf
@@ -0,0 +1,7 @@
+!include my.cnf
+
+[mysqld.1]
+max_binlog_size=4096
+
+[mysqld.2]
+skip-slave-start
diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result
new file mode 100644
index 00000000000..72844fb9de6
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result
@@ -0,0 +1,275 @@
+include/master-slave.inc
+[connection master]
+#######################################################################
+####################### PART 1: MASTER TESTS ##########################
+#######################################################################
+include/stop_slave.inc
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+SET @old_debug= @@global.debug;
+SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data';
+SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data';
+RESET MASTER;
+###################### TEST #1
+FLUSH LOGS;
+# assert: must show two binlogs
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+###################### TEST #2
+RESET MASTER;
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+FLUSH LOGS;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show one binlog
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+SET GLOBAL debug_dbug=@old_debug;
+RESET MASTER;
+###################### TEST #3
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+# assert: must show two binlog
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #4
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show one entry
+SELECT count(*) FROM t2;
+count(*)
+1
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #5
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
+# assert: must show one entry
+SELECT count(*) FROM t2;
+count(*)
+1
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #6
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+INSERT INTO t2 VALUES ('muse');
+COMMIT;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show three entries
+SELECT count(*) FROM t2;
+count(*)
+3
+SET AUTOCOMMIT= 1;
+SET GLOBAL debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #7
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+SELECT count(*) FROM t4;
+count(*)
+0
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show 1 entry
+SELECT count(*) FROM t4;
+count(*)
+1
+### check that the incident event is written to the current log
+SET GLOBAL debug_dbug=@old_debug;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Incident # # #1 (LOST_EVENTS)
+DELETE FROM t4;
+RESET MASTER;
+###################### TEST #8
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+# must show 0 entries
+SELECT count(*) FROM t4;
+count(*)
+0
+SELECT count(*) FROM t2;
+count(*)
+0
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# INFO: Count(*) Before Offending DELETEs
+# assert: must show 1 entry
+SELECT count(*) FROM t4;
+count(*)
+1
+# assert: must show 4 entries
+SELECT count(*) FROM t2;
+count(*)
+4
+DELETE FROM t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+DELETE FROM t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# INFO: Count(*) After Offending DELETEs
+# assert: must show zero entries
+SELECT count(*) FROM t4;
+count(*)
+0
+SELECT count(*) FROM t2;
+count(*)
+0
+SET GLOBAL debug_dbug=@old_debug;
+###################### TEST #9
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+# assert: must show four entries
+SELECT count(*) FROM t2;
+count(*)
+4
+SELECT count(*) FROM t4;
+count(*)
+4
+DELETE FROM t2;
+DELETE FROM t4;
+# assert: must show zero entries
+SELECT count(*) FROM t2;
+count(*)
+0
+SELECT count(*) FROM t4;
+count(*)
+0
+SET SQL_LOG_BIN=1;
+SET GLOBAL debug_dbug=@old_debug;
+###################### TEST #10
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not open .*");
+RESET MASTER;
+SHOW WARNINGS;
+Level Code Message
+SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1 "Operation not permitted")
+SET GLOBAL debug_dbug="-d,fault_injection_registering_index";
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+###################### TEST #11
+include/rpl_restart_server.inc [server_number=1]
+SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.index' (errno: 1 "Operation not permitted")
+SET GLOBAL debug_dbug="-d,fault_injection_openning_index";
+RESET MASTER;
+ERROR HY000: Binlog closed, cannot RESET MASTER
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+include/rpl_restart_server.inc [server_number=1]
+###################### TEST #12
+SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin' (errno: 2 "No such file or directory")
+SET GLOBAL debug_dbug="-d,fault_injection_new_file_rotate_event";
+RESET MASTER;
+ERROR HY000: Binlog closed, cannot RESET MASTER
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+include/rpl_restart_server.inc [server_number=1]
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+include/start_slave.inc
+#######################################################################
+####################### PART 2: SLAVE TESTS ###########################
+#######################################################################
+include/rpl_reset.inc
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+###################### TEST #13
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug_dbug="+d,error_unique_log_filename";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #14
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug_dbug="-d,fault_injection_new_file_rotate_event";
+SET GLOBAL debug_dbug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #15
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug_dbug="-d,fault_injection_registering_index";
+SET GLOBAL debug_dbug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #16
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug_dbug="-d,fault_injection_openning_index";
+SET GLOBAL debug_dbug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+include/stop_slave_sql.inc
+Warnings:
+Note 1255 Slave already has been stopped
+RESET SLAVE;
+RESET MASTER;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
new file mode 100644
index 00000000000..a4611f515c4
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
@@ -0,0 +1,2 @@
+--let $binlog_limit= 5,1
+--source extra/rpl_tests/rpl_binlog_errors.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result
new file mode 100644
index 00000000000..0cc1e4b5057
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result
@@ -0,0 +1,21 @@
+include/master-slave.inc
+[connection master]
+include/stop_slave.inc
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+include/rpl_stop_server.inc [server_number=1]
+include/rpl_start_server.inc [server_number=1]
+show binlog events;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+reset slave;
+start slave;
+include/wait_for_slave_param.inc [Last_IO_Errno]
+Last_IO_Errno = '1236'
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
+reset master;
+stop slave;
+reset slave;
+drop table if exists t;
+reset master;
+End of the tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
new file mode 100644
index 00000000000..6d222cba115
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_cant_read_event_incident.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.cnf b/mysql-test/suite/binlog_encryption/rpl_checksum.cnf
new file mode 100644
index 00000000000..9d7ada8c656
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum.cnf
@@ -0,0 +1,10 @@
+!include my.cnf
+
+[mysqld.1]
+binlog-checksum=CRC32
+
+[mysqld.2]
+binlog-checksum=CRC32
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+loose-file-key-management-filename=@ENV.MYSQLTEST_VARDIR/std_data/keys.txt
+encrypt-binlog
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.result b/mysql-test/suite/binlog_encryption/rpl_checksum.result
new file mode 100644
index 00000000000..b4ea8d9b1ae
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum.result
@@ -0,0 +1,161 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
+call mtr.add_suppression('Replication event checksum verification failed');
+call mtr.add_suppression('Relay log write failure: could not queue event from master');
+call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
+set @master_save_binlog_checksum= @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
+must be CRC32 because of the command line option
+CRC32
+select @@session.binlog_checksum as 'no session var';
+ERROR HY000: Variable 'binlog_checksum' is a GLOBAL variable
+select @@global.master_verify_checksum as 'must be zero because of default';
+must be zero because of default
+0
+select @@session.master_verify_checksum as 'no session var';
+ERROR HY000: Variable 'master_verify_checksum' is a GLOBAL variable
+set @slave_save_binlog_checksum= @@global.binlog_checksum;
+set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
+select @@global.slave_sql_verify_checksum as 'must be one because of default';
+must be one because of default
+1
+select @@session.slave_sql_verify_checksum as 'no session var';
+ERROR HY000: Variable 'slave_sql_verify_checksum' is a GLOBAL variable
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+set @@global.binlog_checksum = NONE;
+select @@global.binlog_checksum;
+@@global.binlog_checksum
+NONE
+*** must be rotations seen ***
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+set @@global.binlog_checksum = default;
+select @@global.binlog_checksum;
+@@global.binlog_checksum
+NONE
+set @@global.binlog_checksum = CRC32;
+select @@global.binlog_checksum;
+@@global.binlog_checksum
+CRC32
+set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 0;
+set @@global.master_verify_checksum = default;
+set @@global.binlog_checksum = ADLER32;
+ERROR 42000: Variable 'binlog_checksum' can't be set to the value of 'ADLER32'
+set @@global.master_verify_checksum = 2;
+ERROR 42000: Variable 'master_verify_checksum' can't be set to the value of '2'
+set @@global.slave_sql_verify_checksum = 0;
+set @@global.slave_sql_verify_checksum = default;
+set @@global.slave_sql_verify_checksum = 2;
+ERROR 42000: Variable 'slave_sql_verify_checksum' can't be set to the value of '2'
+set @@global.binlog_checksum = NONE;
+create table t1 (a int);
+flush logs;
+flush logs;
+flush logs;
+flush logs;
+flush logs;
+flush logs;
+select count(*) as zero from t1;
+zero
+0
+include/stop_slave.inc
+set @@global.binlog_checksum = CRC32;
+insert into t1 values (1) /* will not be applied on slave due to simulation */;
+set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
+start slave;
+include/wait_for_slave_io_error.inc [errno=1236]
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 404, the last event read from 'master-bin.000010' at 4, the last byte read from 'master-bin.000010' at 249.''
+select count(*) as zero from t1;
+zero
+0
+set @@global.debug_dbug='';
+include/start_slave.inc
+set @@global.master_verify_checksum = 1;
+set @@session.debug_dbug='d,simulate_checksum_test_failure';
+show binlog events;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+set @@session.debug_dbug='';
+set @@global.master_verify_checksum = default;
+include/stop_slave.inc
+create table t2 (a int);
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+start slave io_thread;
+include/wait_for_slave_io_error.inc [errno=1595,1913]
+set @@global.debug_dbug='';
+start slave io_thread;
+include/wait_for_slave_param.inc [Read_Master_Log_Pos]
+set @@global.slave_sql_verify_checksum = 1;
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+start slave sql_thread;
+include/wait_for_slave_sql_error.inc [errno=1593]
+Last_SQL_Error = 'Error initializing relay log position: I/O error reading event at position 4'
+set @@global.debug_dbug='';
+include/start_slave.inc
+select count(*) as 'must be zero' from t2;
+must be zero
+0
+stop slave;
+reset slave;
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+flush logs;
+set @@global.binlog_checksum= CRC32;
+reset master;
+flush logs;
+create table t3 (a int, b char(5));
+include/start_slave.inc
+select count(*) as 'must be zero' from t3;
+must be zero
+0
+include/stop_slave.inc
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+flush logs;
+reset master;
+insert into t3 value (1, @@global.binlog_checksum);
+include/start_slave.inc
+flush logs;
+select count(*) as 'must be one' from t3;
+must be one
+1
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+insert into t3 value (1, @@global.binlog_checksum);
+drop table t1, t2, t3;
+set @@global.binlog_checksum = @master_save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+*** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
+CREATE TABLE t4 (a INT PRIMARY KEY);
+INSERT INTO t4 VALUES (1);
+SET sql_log_bin=0;
+CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
+SET sql_log_bin=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET debug_dbug= '+d,binlog_inject_new_name_error';
+FLUSH LOGS;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+SET debug_dbug= @old_dbug;
+INSERT INTO t4 VALUES (2);
+include/wait_for_slave_sql_error.inc [errno=1590]
+Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log'
+FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
+SELECT * FROM t4 ORDER BY a;
+a
+1
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter= 1;
+include/start_slave.inc
+SELECT * FROM t4 ORDER BY a;
+a
+1
+2
+set @@global.binlog_checksum = @slave_save_binlog_checksum;
+set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
+End of tests
+DROP TABLE t4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.test b/mysql-test/suite/binlog_encryption/rpl_checksum.test
new file mode 100644
index 00000000000..8e006b1b6a0
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_checksum.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.result b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.result
new file mode 100644
index 00000000000..9508e94e7f2
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.result
@@ -0,0 +1,119 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
+set @save_binlog_cache_size = @@global.binlog_cache_size;
+set @save_binlog_checksum = @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+set @@global.binlog_cache_size = 4096;
+set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 1;
+include/stop_slave.inc
+include/start_slave.inc
+flush status;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 0
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 0
+drop table if exists t1;
+create table t1 (a int PRIMARY KEY, b CHAR(32)) engine=innodb;
+create procedure test.p_init (n int, size int)
+begin
+while n > 0 do
+select round(RAND() * size) into @act_size;
+set @data = repeat('a', @act_size);
+insert into t1 values(n, @data );
+set n= n-1;
+end while;
+end|
+begin;
+call test.p_init(4000, 32);
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+*** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+include/diff_tables.inc [master:test.t1, slave:test.t1]
+begin;
+delete from t1;
+commit;
+flush status;
+create table t2(a int auto_increment primary key, data VARCHAR(12288)) ENGINE=Innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+*** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+include/diff_tables.inc [master:test.t2, slave:test.t2]
+begin;
+delete from t2;
+commit;
+flush status;
+create table t3(a int auto_increment primary key, data VARCHAR(8192)) engine=innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+*** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+include/diff_tables.inc [master:test.t3, slave:test.t3]
+begin;
+delete from t3;
+commit;
+flush status;
+create procedure test.p1 (n int)
+begin
+while n > 0 do
+case (select (round(rand()*100) % 3) + 1)
+when 1 then
+select round(RAND() * 32) into @act_size;
+set @data = repeat('a', @act_size);
+insert into t1 values(n, @data);
+when 2 then
+begin
+select round(8192 + RAND() * 4096) into @act_size;
+insert into t2 set data=repeat('a', @act_size);
+end;
+when 3 then
+begin
+select round(3686.4000 + RAND() * 819.2000) into @act_size;
+insert into t3 set data= repeat('a', @act_size);
+end;
+end case;
+set n= n-1;
+end while;
+end|
+set autocommit= 0;
+begin;
+call test.p1(1000);
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+*** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+include/diff_tables.inc [master:test.t1, slave:test.t1]
+include/diff_tables.inc [master:test.t2, slave:test.t2]
+include/diff_tables.inc [master:test.t3, slave:test.t3]
+begin;
+delete from t1;
+delete from t2;
+delete from t3;
+commit;
+drop table t1, t2, t3;
+set @@global.binlog_cache_size = @save_binlog_cache_size;
+set @@global.binlog_checksum = @save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+drop procedure test.p_init;
+drop procedure test.p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
new file mode 100644
index 00000000000..56c3e1e1cb5
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_checksum_cache.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.cnf b/mysql-test/suite/binlog_encryption/rpl_corruption.cnf
new file mode 100644
index 00000000000..7f7d0eeb8ea
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_corruption.cnf
@@ -0,0 +1,9 @@
+!include my.cnf
+
+[mysqld.1]
+binlog-checksum=CRC32
+master-verify-checksum=1
+
+[mysqld.2]
+binlog-checksum=CRC32
+slave-sql-verify-checksum=1
diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.result b/mysql-test/suite/binlog_encryption/rpl_corruption.result
new file mode 100644
index 00000000000..51c2c6261b8
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_corruption.result
@@ -0,0 +1,51 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Found invalid event in binary log');
+call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
+call mtr.add_suppression('event read from binlog did not pass crc check');
+call mtr.add_suppression('Replication event checksum verification failed');
+call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
+call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
+SET @old_master_verify_checksum = @@master_verify_checksum;
+# 1. Creating test table/data and set corruption position for testing
+* insert/update/delete rows in table t1 *
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
+include/stop_slave.inc
+# 2. Corruption in master binlog and SHOW BINLOG EVENTS
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
+SHOW BINLOG EVENTS;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
+# 3. Master read a corrupted event from binlog and send the error to slave
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_error.inc [errno=1236]
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
+# 4. Master read a corrupted event from binlog and send it to slave
+SET GLOBAL master_verify_checksum=0;
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_error.inc [errno=1595,1913]
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
+SET GLOBAL debug_dbug= "";
+SET GLOBAL master_verify_checksum=1;
+# 5. Slave. Corruption in network
+SET GLOBAL debug_dbug="+d,corrupt_queue_event";
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_error.inc [errno=1595,1913]
+SET GLOBAL debug_dbug="-d,corrupt_queue_event";
+# 6. Slave. Corruption in relay log
+SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1593]
+SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
+SET GLOBAL debug_dbug= "";
+# 7. Seek diff for tables on master and slave
+include/start_slave.inc
+include/diff_tables.inc [master:test.t1, slave:test.t1]
+# 8. Clean up
+SET GLOBAL debug_dbug= "";
+SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
+DROP TABLE t1;
+SET GLOBAL debug_dbug= "";
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.test b/mysql-test/suite/binlog_encryption/rpl_corruption.test
new file mode 100644
index 00000000000..310b0cef8e8
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_corruption.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_corruption.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.cnf b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.cnf
new file mode 100644
index 00000000000..ae47ef7a1fc
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.cnf
@@ -0,0 +1,24 @@
+!include my.cnf
+
+[mysqld.1]
+log-slave-updates
+
+[mysqld.2]
+init-rpl-role= slave
+master-retry-count= 10
+skip-slave-start
+
+[mysqld.3]
+log-slave-updates
+innodb
+
+[mysqld.4]
+log-slave-updates
+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/binlog_encryption/rpl_gtid_basic.result b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
new file mode 100644
index 00000000000..8562818b623
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
@@ -0,0 +1,481 @@
+include/rpl_init.inc [topology=1->2->3->4]
+*** GTID position should be empty here ***
+SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
+BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "m1");
+INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+INSERT INTO t2 VALUES (1, "i1");
+BEGIN;
+INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
+INSERT INTO t2 VALUES (4, "i4");
+COMMIT;
+*** GTID position should be non-empty here ***
+SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
+BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
+<GTID_POS_SERVER_1>
+*** GTID position should be the same as on server_1 ***
+SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
+BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
+<GTID_POS_SERVER_1>
+SELECT * FROM t1 ORDER BY a;
+a b
+1 m1
+2 m2
+3 m3
+4 m4
+SELECT * FROM t2 ORDER BY a;
+a b
+1 i1
+2 i2
+3 i3
+4 i4
+SELECT * FROM t1 ORDER BY a;
+a b
+1 m1
+2 m2
+3 m3
+4 m4
+SELECT * FROM t2 ORDER BY a;
+a b
+1 i1
+2 i2
+3 i3
+4 i4
+SELECT * FROM t1 ORDER BY a;
+a b
+1 m1
+2 m2
+3 m3
+4 m4
+SELECT * FROM t2 ORDER BY a;
+a b
+1 i1
+2 i2
+3 i3
+4 i4
+*** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
+include/stop_slave.inc
+INSERT INTO t1 VALUES (5, "m1a");
+INSERT INTO t2 VALUES (5, "i1a");
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
+MASTER_USE_GTID=CURRENT_POS;
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 m1
+2 m2
+3 m3
+4 m4
+5 m1a
+SELECT * FROM t2 ORDER BY a;
+a b
+1 i1
+2 i2
+3 i3
+4 i4
+5 i1a
+*** Now move B to D (C is still replicating from B) ***
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
+MASTER_USE_GTID=CURRENT_POS;
+include/start_slave.inc
+UPDATE t2 SET b="j1a" WHERE a=5;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 m1
+2 m2
+3 m3
+4 m4
+5 m1a
+SELECT * FROM t2 ORDER BY a;
+a b
+1 i1
+2 i2
+3 i3
+4 i4
+5 j1a
+*** Now move C to D, after letting it fall a little behind ***
+include/stop_slave.inc
+INSERT INTO t2 VALUES (6, "i6b");
+INSERT INTO t2 VALUES (7, "i7b");
+include/save_master_gtid.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
+MASTER_USE_GTID=CURRENT_POS;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 ORDER BY a;
+a b
+1 i1
+2 i2
+3 i3
+4 i4
+5 j1a
+6 i6b
+7 i7b
+*** Now change everything back to what it was, to make rpl_end.inc happy
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_MYPORT;
+include/start_slave.inc
+include/wait_for_slave_to_start.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_MYPORT;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3;
+include/start_slave.inc
+DROP TABLE t1,t2;
+include/save_master_gtid.inc
+*** A few more checks for BINLOG_GTID_POS function ***
+SELECT BINLOG_GTID_POS();
+ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
+SELECT BINLOG_GTID_POS('a');
+ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
+SELECT BINLOG_GTID_POS('a',1,NULL);
+ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
+SELECT BINLOG_GTID_POS(1,'a');
+BINLOG_GTID_POS(1,'a')
+NULL
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'a'
+SELECT BINLOG_GTID_POS(NULL,NULL);
+BINLOG_GTID_POS(NULL,NULL)
+NULL
+SELECT BINLOG_GTID_POS('',1);
+BINLOG_GTID_POS('',1)
+
+SELECT BINLOG_GTID_POS('a',1);
+BINLOG_GTID_POS('a',1)
+NULL
+SELECT BINLOG_GTID_POS('master-bin.000001',-1);
+BINLOG_GTID_POS('master-bin.000001',-1)
+NULL
+SELECT BINLOG_GTID_POS('master-bin.000001',0);
+BINLOG_GTID_POS('master-bin.000001',0)
+
+SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551615);
+BINLOG_GTID_POS('master-bin.000001',18446744073709551615)
+NULL
+SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551616);
+BINLOG_GTID_POS('master-bin.000001',18446744073709551616)
+NULL
+Warnings:
+Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
+*** Some tests of @@GLOBAL.gtid_binlog_state ***
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+SET @old_state= @@GLOBAL.gtid_binlog_state;
+SET GLOBAL gtid_binlog_state = '';
+ERROR HY000: This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = '';
+FLUSH LOGS;
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000001 # Start_encryption # #
+master-bin.000001 # Gtid_list # # [#-#-#]
+master-bin.000001 # Binlog_checkpoint # # master-bin.000001
+SET GLOBAL gtid_binlog_state = @old_state;
+ERROR HY000: This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = @old_state;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SET gtid_seq_no=100;
+INSERT INTO t1 VALUES (1);
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+a
+1
+Gtid_IO_Pos = '0-1-100'
+*** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+include/stop_slave.inc
+SELECT @@last_gtid;
+@@last_gtid
+
+SET gtid_seq_no=110;
+SELECT @@last_gtid;
+@@last_gtid
+
+BEGIN;
+SELECT @@last_gtid;
+@@last_gtid
+
+INSERT INTO t1 VALUES (2);
+SELECT @@last_gtid;
+@@last_gtid
+
+COMMIT;
+SELECT @@last_gtid;
+@@last_gtid
+0-1-110
+SET @pos= '0-1-110';
+SELECT master_gtid_wait(NULL);
+master_gtid_wait(NULL)
+NULL
+SELECT master_gtid_wait('', NULL);
+master_gtid_wait('', NULL)
+0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 1
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_time';
+Variable_name Value
+Master_gtid_wait_time 0
+SELECT master_gtid_wait(@pos, 0.5);
+master_gtid_wait(@pos, 0.5)
+-1
+SELECT * FROM t1 ORDER BY a;
+a
+SELECT master_gtid_wait(@pos);
+include/start_slave.inc
+master_gtid_wait(@pos)
+0
+SELECT * FROM t1 ORDER BY a;
+a
+2
+include/stop_slave.inc
+SET gtid_domain_id= 1;
+INSERT INTO t1 VALUES (3);
+SET @pos= 'POS';
+SELECT master_gtid_wait(@pos, 0);
+master_gtid_wait(@pos, 0)
+-1
+SELECT * FROM t1 WHERE a >= 3;
+a
+SELECT master_gtid_wait(@pos, -1);
+include/start_slave.inc
+master_gtid_wait(@pos, -1)
+0
+SELECT * FROM t1 WHERE a >= 3;
+a
+3
+SELECT master_gtid_wait('1-1-1', 0);
+master_gtid_wait('1-1-1', 0)
+0
+SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
+SELECT master_gtid_wait('0-1-1000', 0.5);
+SELECT master_gtid_wait('0-1-2000');
+SELECT master_gtid_wait('2-1-10');
+SELECT master_gtid_wait('2-1-6', 1);
+SELECT master_gtid_wait('2-1-5');
+SELECT master_gtid_wait('2-1-10');
+SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
+SELECT master_gtid_wait('2-1-2');
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 3
+SELECT master_gtid_wait('1-1-1');
+master_gtid_wait('1-1-1')
+0
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 4
+SET @a= MASTER_GTID_WAIT_TIME;
+SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
+AS Master_gtid_wait_time_as_expected;
+Master_gtid_wait_time_as_expected
+OK
+SELECT master_gtid_wait('0-1-109');
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 4
+SELECT master_gtid_wait('2-1-2', 0.5);
+master_gtid_wait('2-1-2', 0.5)
+-1
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 1
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 5
+SET @a= MASTER_GTID_WAIT_TIME;
+SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
+Master_gtid_wait_time_as_expected
+OK
+KILL QUERY KILL_ID;
+ERROR 70100: Query execution was interrupted
+SET gtid_domain_id=2;
+SET gtid_seq_no=2;
+INSERT INTO t1 VALUES (4);
+master_gtid_wait('2-1-2')
+0
+KILL CONNECTION KILL_ID;
+Got one of the listed errors
+SET gtid_domain_id=1;
+SET gtid_seq_no=4;
+INSERT INTO t1 VALUES (5);
+SET gtid_domain_id=2;
+SET gtid_seq_no=5;
+INSERT INTO t1 VALUES (6);
+master_gtid_wait('2-1-5,1-1-4,0-1-110')
+0
+master_gtid_wait('2-1-1,1-1-4,0-1-110')
+0
+master_gtid_wait('0-1-1000', 0.5)
+-1
+master_gtid_wait('2-1-6', 1)
+-1
+master_gtid_wait('0-1-109')
+0
+SET gtid_domain_id=2;
+SET gtid_seq_no=10;
+INSERT INTO t1 VALUES (7);
+master_gtid_wait('2-1-10')
+0
+master_gtid_wait('2-1-10')
+0
+*** Test gtid_slave_pos when used with GTID ***
+include/stop_slave.inc
+SET gtid_domain_id=2;
+SET gtid_seq_no=1000;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+SET sql_slave_skip_counter= 1;
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+a
+11
+SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+include/stop_slave.inc
+SET gtid_domain_id=2;
+SET gtid_seq_no=1010;
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+SET sql_slave_skip_counter= 2;
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+a
+11
+13
+SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+include/stop_slave.inc
+SET gtid_domain_id=2;
+SET gtid_seq_no=1020;
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+SET sql_slave_skip_counter= 3;
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+a
+11
+13
+15
+16
+SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+include/stop_slave.inc
+SET gtid_domain_id=2;
+SET gtid_seq_no=1030;
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+SET sql_slave_skip_counter= 5;
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+a
+11
+13
+15
+16
+19
+SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+include/stop_slave.inc
+SET gtid_domain_id=3;
+SET gtid_seq_no=100;
+CREATE TABLE t2 (a INT PRIMARY KEY);
+DROP TABLE t2;
+SET gtid_domain_id=2;
+SET gtid_seq_no=1040;
+INSERT INTO t1 VALUES (20);
+SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
+SET GLOBAL slave_ddl_exec_mode=STRICT;
+SET sql_slave_skip_counter=1;
+START SLAVE UNTIL master_gtid_pos="3-1-100";
+include/sync_with_master_gtid.inc
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
+SET sql_log_bin=1;
+START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1051]
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter=2;
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+a
+20
+SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+status
+Ok
+SET GLOBAL slave_ddl_exec_mode= @saved_mode;
+*** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (31);
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (33);
+include/stop_slave.inc
+INSERT INTO t1 VALUES (34);
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a
+31
+32
+33
+34
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a
+31
+32
+33
+34
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
new file mode 100644
index 00000000000..70be6fbff1f
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_gtid_basic.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_incident.cnf b/mysql-test/suite/binlog_encryption/rpl_incident.cnf
new file mode 100644
index 00000000000..7294976f6e2
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_incident.cnf
@@ -0,0 +1,7 @@
+!include my.cnf
+
+[mysqld.1]
+binlog_checksum=NONE
+
+[mysqld.2]
+binlog_checksum=NONE
diff --git a/mysql-test/suite/binlog_encryption/rpl_incident.result b/mysql-test/suite/binlog_encryption/rpl_incident.result
new file mode 100644
index 00000000000..7cb8168c6a9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_incident.result
@@ -0,0 +1,38 @@
+include/master-slave.inc
+[connection master]
+**** On Master ****
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+a
+1
+2
+3
+SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
+REPLACE INTO t1 VALUES (4);
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
+include/wait_for_slave_sql_error.inc [errno=1590]
+Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: <none>'
+**** On Slave ****
+SELECT * FROM t1;
+a
+1
+2
+3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+include/check_slave_is_running.inc
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_incident.test b/mysql-test/suite/binlog_encryption/rpl_incident.test
new file mode 100644
index 00000000000..9be855e1a8b
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_incident.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_incident.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result
new file mode 100644
index 00000000000..57c0bb129fa
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+stop slave;
+reset slave;
+SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
+start slave;
+include/wait_for_slave_sql_error.inc [errno=1593]
+Last_SQL_Error = 'Failed during slave thread initialization'
+call mtr.add_suppression("Failed during slave.* thread initialization");
+SET GLOBAL debug_dbug= "";
+reset slave;
+SET GLOBAL init_slave= "garbage";
+start slave;
+include/wait_for_slave_sql_error.inc [errno=1064]
+Last_SQL_Error = 'Slave SQL thread aborted. Can't execute init_slave query'
+SET GLOBAL init_slave= "";
+include/stop_slave_io.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
new file mode 100644
index 00000000000..6f515b9390a
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_init_slave_errors.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.result b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.result
new file mode 100644
index 00000000000..16fd3f19c4a
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.result
@@ -0,0 +1,125 @@
+include/master-slave.inc
+[connection master]
+create table t1(a int);
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+select a,count(*) from t1 group by a;
+a count(*)
+1 10000
+drop table t1;
+create table t1(a int);
+insert into t1 values (1), (2), (2), (3);
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int primary key);
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+Warnings:
+Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+drop table t1;
+==== Bug22504 Initialize ====
+[on master]
+SET sql_mode='ignore_space';
+CREATE TABLE t1(a int);
+insert into t1 values (1), (2), (3), (4);
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+[on slave]
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]
+
+Bug #43746:
+"return wrong query string when parse 'load data infile' sql statement"
+
+[master]
+SELECT @@SESSION.sql_mode INTO @old_mode;
+SET sql_mode='ignore_space';
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+SELECT * INTO OUTFILE 'MYSQLD_DATADIR/bug43746.sql' FROM t1;
+TRUNCATE TABLE t1;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+LOAD/* look mum, with comments in weird places! */DATA/* oh hai */LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql'/* we are */INTO/* from the internets */TABLE t1;
+LOAD DATA/*!10000 LOCAL */INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO */ TABLE t1;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO TABLE */ t1;
+LOAD DATA /*!10000 LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE */ t1;
+LOAD DATA/*!10000 LOCAL */INFILE 'MYSQLD_DATADIR/bug43746.sql'/*!10000 INTO*/TABLE t1;
+LOAD DATA/*!10000 LOCAL */INFILE 'MYSQLD_DATADIR/bug43746.sql'/* empty */INTO TABLE t1;
+LOAD DATA/*!10000 LOCAL */INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TABLE t1;
+LOAD/*!999999 special comments that do not expand */DATA/*!999999 code from the future */LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql'/*!999999 have flux capacitor */INTO/*!999999 will travel */TABLE t1;
+SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+[slave]
+
+Bug #59267:
+"LOAD DATA LOCAL INFILE not executed on slave with SBR"
+
+[master]
+SELECT * INTO OUTFILE 'MYSQLD_DATADIR/bug59267.sql' FROM t1;
+TRUNCATE TABLE t1;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
+SELECT 'Master', COUNT(*) FROM t1;
+Master COUNT(*)
+Master 44
+[slave]
+SELECT 'Slave', COUNT(*) FROM t1;
+Slave COUNT(*)
+Slave 44
+[master]
+DROP TABLE t1;
+SET SESSION sql_mode=@old_mode;
+[slave]
+
+Bug #60580/#11902767:
+"statement improperly replicated crashes slave sql thread"
+
+[master]
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
+INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
+INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
+INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
+CREATE TABLE t3 AS SELECT * FROM t2;
+CREATE VIEW v1 AS SELECT * FROM t2
+WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
+SELECT 1 INTO OUTFILE 'MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
+SELECT * FROM t1;
+f1 f2
+NULL NULL
+[slave]
+SELECT * FROM t1;
+f1 f2
+NULL NULL
+[master]
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+[slave]
+include/rpl_end.inc
+# End of 5.1 tests
diff --git a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
new file mode 100644
index 00000000000..8d90afaed27
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_loaddata_local.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_loadfile.result b/mysql-test/suite/binlog_encryption/rpl_loadfile.result
new file mode 100644
index 00000000000..25d50660bde
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_loadfile.result
@@ -0,0 +1,242 @@
+include/master-slave.inc
+[connection master]
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES(1,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
+create procedure test.p1()
+begin
+INSERT INTO test.t1 VALUES(2,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
+end|
+CALL test.p1();
+SELECT * FROM test.t1 ORDER BY blob_column;
+a blob_column
+1 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+2 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+SELECT * FROM test.t1 ORDER BY blob_column;
+a blob_column
+1 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+2 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE test.t1;
+include/rpl_reset.inc
+SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (t text);
+CREATE PROCEDURE p(file varchar(4096))
+BEGIN
+INSERT INTO t1 VALUES (LOAD_FILE(file));
+END|
+include/stop_slave.inc
+CALL p('MYSQLTEST_VARDIR/tmp/bug_39701.data');
+include/start_slave.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+DROP PROCEDURE p;
+include/rpl_end.inc
+#
+# Check that the loaded data is encrypted in the master binlog
+#
+NOT FOUND /xxxxxxxxxxx/ in master-bin.0*
diff --git a/mysql-test/suite/binlog_encryption/rpl_loadfile.test b/mysql-test/suite/binlog_encryption/rpl_loadfile.test
new file mode 100644
index 00000000000..97886ca0f48
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_loadfile.test
@@ -0,0 +1,11 @@
+--source extra/rpl_tests/rpl_loadfile.inc
+
+--let $datadir= `SELECT @@datadir`
+
+--echo #
+--echo # Check that the loaded data is encrypted in the master binlog
+--echo #
+
+--let SEARCH_FILE=$datadir/master-bin.0*
+--let SEARCH_PATTERN= xxxxxxxxxxx
+--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result
new file mode 100644
index 00000000000..80f76169472
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result
@@ -0,0 +1,186 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
+CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
+CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
+########################################################################################
+# 1 - SINGLE STATEMENT
+########################################################################################
+*** Single statement on transactional table ***
+Got one of the listed errors
+*** Single statement on non-transactional table ***
+Got one of the listed errors
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+*** Single statement on both transactional and non-transactional tables. ***
+Got one of the listed errors
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################################
+# 2 - BEGIN - IMPLICIT COMMIT by DDL
+########################################################################################
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+set default_storage_engine=innodb;
+BEGIN;
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
+INSERT INTO t1 (a, data) VALUES (7, 's');;
+INSERT INTO t2 (a, data) VALUES (8, 's');;
+INSERT INTO t1 (a, data) VALUES (9, 's');;
+ALTER TABLE t3 ADD COLUMN d int;
+BEGIN;
+Got one of the listed errors
+Got one of the listed errors
+INSERT INTO t1 (a, data) VALUES (19, 's');;
+INSERT INTO t2 (a, data) VALUES (20, 's');;
+INSERT INTO t1 (a, data) VALUES (21, 's');;
+CREATE TABLE t4 SELECT * FROM t1;
+BEGIN;
+Got one of the listed errors
+Got one of the listed errors
+INSERT INTO t1 (a, data) VALUES (27, 's');;
+INSERT INTO t2 (a, data) VALUES (28, 's');;
+INSERT INTO t1 (a, data) VALUES (29, 's');;
+CREATE TABLE t5 (a int);
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################################
+# 3 - BEGIN - COMMIT
+########################################################################################
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+BEGIN;
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
+COMMIT;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################################
+# 4 - BEGIN - ROLLBACK
+########################################################################################
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+BEGIN;
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################################
+# 5 - PROCEDURE
+########################################################################################
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+CREATE PROCEDURE p1(pd VARCHAR(30000))
+BEGIN
+INSERT INTO t1 (a, data) VALUES (1, pd);
+INSERT INTO t1 (a, data) VALUES (2, pd);
+INSERT INTO t1 (a, data) VALUES (3, pd);
+INSERT INTO t1 (a, data) VALUES (4, pd);
+INSERT INTO t1 (a, data) VALUES (5, 's');
+END//
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+BEGIN;
+Got one of the listed errors
+COMMIT;
+TRUNCATE TABLE t1;
+BEGIN;
+Got one of the listed errors
+ROLLBACK;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################################
+# 6 - XID
+########################################################################################
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+BEGIN;
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
+INSERT INTO t1 (a, data) VALUES (7, 's');;
+INSERT INTO t2 (a, data) VALUES (8, 's');;
+INSERT INTO t1 (a, data) VALUES (9, 's');;
+ROLLBACK TO sv;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+COMMIT;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################################
+# 7 - NON-TRANS TABLE
+########################################################################################
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+BEGIN;
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
+INSERT INTO t1 (a, data) VALUES (8, 's');;
+INSERT INTO t1 (a, data) VALUES (9, 's');;
+INSERT INTO t2 (a, data) VALUES (10, 's');;
+INSERT INTO t1 (a, data) VALUES (11, 's');;
+COMMIT;
+BEGIN;
+Got one of the listed errors
+COMMIT;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+# [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1197]
+SELECT count(*) FROM t1;
+count(*)
+0
+include/show_binlog_events.inc
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
+########################################################################################
+# CLEAN
+########################################################################################
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE t5;
+DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test
new file mode 100644
index 00000000000..8fb7350b815
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test
@@ -0,0 +1,7 @@
+--source include/master-slave.inc
+--source include/not_embedded.inc
+--source include/not_windows.inc
+--source include/have_binlog_format_mixed.inc
+
+--source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_packet.cnf b/mysql-test/suite/binlog_encryption/rpl_packet.cnf
new file mode 100644
index 00000000000..0f01aec7437
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_packet.cnf
@@ -0,0 +1,10 @@
+!include my.cnf
+
+[mysqld.1]
+max_allowed_packet=1024
+net_buffer_length=1024
+
+[mysqld.2]
+max_allowed_packet=1024
+net_buffer_length=1024
+slave_max_allowed_packet=1024
diff --git a/mysql-test/suite/binlog_encryption/rpl_packet.result b/mysql-test/suite/binlog_encryption/rpl_packet.result
new file mode 100644
index 00000000000..07558053287
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_packet.result
@@ -0,0 +1,58 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
+call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
+drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+SET @@global.max_allowed_packet=1024;
+SET @@global.net_buffer_length=1024;
+include/stop_slave.inc
+include/start_slave.inc
+select @@net_buffer_length, @@max_allowed_packet;
+@@net_buffer_length @@max_allowed_packet
+1024 1024
+create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
+select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */;
+count(*)
+1
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running ON
+select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_RUNNING ON
+drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+SET @@global.max_allowed_packet=4096;
+SET @@global.net_buffer_length=4096;
+include/stop_slave.inc
+include/start_slave.inc
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+include/wait_for_slave_io_error.inc [errno=1153]
+Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
+include/stop_slave_sql.inc
+include/rpl_reset.inc
+DROP TABLE t1;
+CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
+INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
+include/wait_for_slave_io_error.inc [errno=1153]
+Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+SET @max_allowed_packet_0= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_1= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_2= @@session.max_allowed_packet;
+==== clean up ====
+DROP TABLE t1;
+SET @@global.max_allowed_packet= 1024;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+SET @@global.net_buffer_length= 1024;
+SET @@global.slave_max_allowed_packet= 1073741824;
+DROP TABLE t1;
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_packet.test b/mysql-test/suite/binlog_encryption/rpl_packet.test
new file mode 100644
index 00000000000..31357cb148e
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_packet.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_packet.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel.result b/mysql-test/suite/binlog_encryption/rpl_parallel.result
new file mode 100644
index 00000000000..34d23e6bf66
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel.result
@@ -0,0 +1,1774 @@
+include/master-slave.inc
+[connection master]
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+SET GLOBAL slave_parallel_threads=10;
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+CHANGE MASTER TO master_use_gtid=slave_pos;
+include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*)))
+OK
+include/stop_slave.inc
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*)))
+OK
+*** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+LOCK TABLE t1 WRITE;
+SET gtid_domain_id=1;
+INSERT INTO t1 VALUES (2);
+SET gtid_domain_id=0;
+INSERT INTO t2 VALUES (2);
+INSERT INTO t2 VALUES (3);
+BEGIN;
+INSERT INTO t2 VALUES (4);
+INSERT INTO t2 VALUES (5);
+COMMIT;
+INSERT INTO t2 VALUES (6);
+SELECT * FROM t2 ORDER by a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t1;
+a
+1
+UNLOCK TABLES;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+*** Test two transactions in different domains committed in opposite order on slave but in a single group commit. ***
+include/stop_slave.inc
+SET sql_log_bin=0;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format='statement';
+SET gtid_domain_id=1;
+INSERT INTO t2 VALUES (foo(10,
+'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1',
+'commit_after_release_LOCK_prepare_ordered SIGNAL ready2'));
+FLUSH LOGS;
+SET sql_log_bin=0;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+IF d1 != '' THEN
+SET debug_sync = d1;
+END IF;
+IF d2 != '' THEN
+SET debug_sync = d2;
+END IF;
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+SET @old_format=@@GLOBAL.binlog_format;
+SET GLOBAL binlog_format=statement;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+SET debug_sync='now WAIT_FOR ready1';
+SET gtid_domain_id=2;
+INSERT INTO t2 VALUES (foo(11,
+'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3',
+'commit_after_release_LOCK_prepare_ordered SIGNAL ready4 WAIT_FOR cont4'));
+SET gtid_domain_id=0;
+SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
+a
+10
+11
+SET debug_sync='now WAIT_FOR ready3';
+SET debug_sync='now SIGNAL cont3';
+SET debug_sync='now WAIT_FOR ready4';
+SET debug_sync='now SIGNAL cont1';
+SET debug_sync='now WAIT_FOR ready2';
+SET debug_sync='now SIGNAL cont4';
+SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
+a
+10
+11
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
+slave-bin.000002 # Gtid # # BEGIN GTID #-#-# cid=#
+slave-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (foo(11,
+'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3',
+'commit_after_release_LOCK_prepare_ordered SIGNAL ready4 WAIT_FOR cont4'))
+slave-bin.000002 # Xid # # COMMIT /* XID */
+slave-bin.000002 # Gtid # # BEGIN GTID #-#-# cid=#
+slave-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (foo(10,
+'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1',
+'commit_after_release_LOCK_prepare_ordered SIGNAL ready2'))
+slave-bin.000002 # Xid # # COMMIT /* XID */
+FLUSH LOGS;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET debug_sync='RESET';
+include/start_slave.inc
+*** Test that group-committed transactions on the master can replicate in parallel on the slave. ***
+SET debug_sync='RESET';
+FLUSH LOGS;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7);
+BEGIN;
+INSERT INTO t3 VALUES (2,102);
+BEGIN;
+INSERT INTO t3 VALUES (4,104);
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (2, foo(12,
+'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
+''));
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (4, foo(14,
+'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
+''));
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (6, foo(16,
+'group_commit_waiting_for_prior SIGNAL slave_queued3',
+''));
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+SET debug_sync='RESET';
+SELECT * FROM t3 ORDER BY a;
+a b
+1 1
+2 12
+3 3
+4 14
+5 5
+6 16
+7 7
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000001
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7)
+master-bin.000002 # Xid # # COMMIT /* XID */
+master-bin.000002 # Gtid # # BEGIN GTID #-#-# cid=#
+master-bin.000002 # Query # # use `test`; INSERT INTO t3 VALUES (2, foo(12,
+'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
+''))
+master-bin.000002 # Xid # # COMMIT /* XID */
+master-bin.000002 # Gtid # # BEGIN GTID #-#-# cid=#
+master-bin.000002 # Query # # use `test`; INSERT INTO t3 VALUES (4, foo(14,
+'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
+''))
+master-bin.000002 # Xid # # COMMIT /* XID */
+master-bin.000002 # Gtid # # BEGIN GTID #-#-# cid=#
+master-bin.000002 # Query # # use `test`; INSERT INTO t3 VALUES (6, foo(16,
+'group_commit_waiting_for_prior SIGNAL slave_queued3',
+''))
+master-bin.000002 # Xid # # COMMIT /* XID */
+SET debug_sync='now WAIT_FOR slave_queued3';
+ROLLBACK;
+SET debug_sync='now WAIT_FOR slave_queued1';
+ROLLBACK;
+SET debug_sync='now WAIT_FOR slave_queued2';
+SET debug_sync='now SIGNAL slave_cont1';
+SELECT * FROM t3 ORDER BY a;
+a b
+1 1
+2 12
+3 3
+4 14
+5 5
+6 16
+7 7
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000003 # Binlog_checkpoint # # slave-bin.000003
+slave-bin.000003 # Gtid # # GTID #-#-#
+slave-bin.000003 # Query # # use `test`; CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+slave-bin.000003 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000003 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7)
+slave-bin.000003 # Xid # # COMMIT /* XID */
+slave-bin.000003 # Gtid # # BEGIN GTID #-#-# cid=#
+slave-bin.000003 # Query # # use `test`; INSERT INTO t3 VALUES (2, foo(12,
+'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
+''))
+slave-bin.000003 # Xid # # COMMIT /* XID */
+slave-bin.000003 # Gtid # # BEGIN GTID #-#-# cid=#
+slave-bin.000003 # Query # # use `test`; INSERT INTO t3 VALUES (4, foo(14,
+'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
+''))
+slave-bin.000003 # Xid # # COMMIT /* XID */
+slave-bin.000003 # Gtid # # BEGIN GTID #-#-# cid=#
+slave-bin.000003 # Query # # use `test`; INSERT INTO t3 VALUES (6, foo(16,
+'group_commit_waiting_for_prior SIGNAL slave_queued3',
+''))
+slave-bin.000003 # Xid # # COMMIT /* XID */
+*** Test STOP SLAVE in parallel mode ***
+include/stop_slave.inc
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET binlog_direct_non_transactional_updates=0;
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
+SET sql_log_bin=1;
+BEGIN;
+INSERT INTO t2 VALUES (20);
+INSERT INTO t1 VALUES (20);
+INSERT INTO t2 VALUES (21);
+INSERT INTO t3 VALUES (20, 20);
+COMMIT;
+INSERT INTO t3 VALUES(21, 21);
+INSERT INTO t3 VALUES(22, 22);
+SET binlog_format=@old_format;
+BEGIN;
+INSERT INTO t2 VALUES (21);
+START SLAVE;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
+STOP SLAVE;
+SET debug_sync='now WAIT_FOR wait_for_done_waiting';
+ROLLBACK;
+SET GLOBAL debug_dbug=@old_dbug;
+SET debug_sync='RESET';
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+a
+20
+SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
+a
+20
+21
+SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
+a b
+20 20
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+a
+20
+SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
+a
+20
+21
+SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
+a b
+20 20
+21 21
+22 22
+include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** Test killing slave threads at various wait points ***
+*** 1. Test killing transaction waiting in commit for previous transaction to commit ***
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (31, foo(31,
+'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+INSERT INTO t3 VALUES (32, foo(32,
+'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+''));
+INSERT INTO t3 VALUES (33, foo(33,
+'group_commit_waiting_for_prior SIGNAL t2_waiting',
+'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+COMMIT;
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (34, foo(34,
+'',
+''));
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+a b
+31 31
+32 32
+33 33
+34 34
+SET debug_sync='RESET';
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Query execution was interrupted");
+CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
+CALL mtr.add_suppression("Slave: Connection was killed");
+SET sql_log_bin=1;
+SET debug_sync='now WAIT_FOR t2_query';
+SET debug_sync='now SIGNAL t2_cont';
+SET debug_sync='now WAIT_FOR t1_ready';
+KILL THD_ID;
+SET debug_sync='now WAIT_FOR t2_killed';
+SET debug_sync='now SIGNAL t1_cont';
+include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
+STOP SLAVE IO_THREAD;
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+a b
+31 31
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+INSERT INTO t3 VALUES (39,0);
+include/start_slave.inc
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+a b
+31 31
+32 32
+33 33
+34 34
+39 0
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+IF d1 != '' THEN
+SET debug_sync = d1;
+END IF;
+IF d2 != '' THEN
+SET debug_sync = d2;
+END IF;
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** 2. Same as (1), but without restarting IO thread after kill of SQL threads ***
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (41, foo(41,
+'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+INSERT INTO t3 VALUES (42, foo(42,
+'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+''));
+INSERT INTO t3 VALUES (43, foo(43,
+'group_commit_waiting_for_prior SIGNAL t2_waiting',
+'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+COMMIT;
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (44, foo(44,
+'',
+''));
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
+a b
+41 41
+42 42
+43 43
+44 44
+SET debug_sync='RESET';
+SET debug_sync='now WAIT_FOR t2_query';
+SET debug_sync='now SIGNAL t2_cont';
+SET debug_sync='now WAIT_FOR t1_ready';
+KILL THD_ID;
+SET debug_sync='now WAIT_FOR t2_killed';
+SET debug_sync='now SIGNAL t1_cont';
+include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+INSERT INTO t3 VALUES (49,0);
+START SLAVE SQL_THREAD;
+SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
+a b
+41 41
+42 42
+43 43
+44 44
+49 0
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+IF d1 != '' THEN
+SET debug_sync = d1;
+END IF;
+IF d2 != '' THEN
+SET debug_sync = d2;
+END IF;
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** 3. Same as (2), but not using gtid mode ***
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=no;
+include/start_slave.inc
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (51, foo(51,
+'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+INSERT INTO t3 VALUES (52, foo(52,
+'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+''));
+INSERT INTO t3 VALUES (53, foo(53,
+'group_commit_waiting_for_prior SIGNAL t2_waiting',
+'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+COMMIT;
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (54, foo(54,
+'',
+''));
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+a b
+51 51
+52 52
+53 53
+54 54
+SET debug_sync='RESET';
+SET debug_sync='now WAIT_FOR t2_query';
+SET debug_sync='now SIGNAL t2_cont';
+SET debug_sync='now WAIT_FOR t1_ready';
+KILL THD_ID;
+SET debug_sync='now WAIT_FOR t2_killed';
+SET debug_sync='now SIGNAL t1_cont';
+include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+a b
+51 51
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+INSERT INTO t3 VALUES (59,0);
+START SLAVE SQL_THREAD;
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+a b
+51 51
+52 52
+53 53
+54 54
+59 0
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+IF d1 != '' THEN
+SET debug_sync = d1;
+END IF;
+IF d2 != '' THEN
+SET debug_sync = d2;
+END IF;
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=4;
+include/start_slave.inc
+*** 4. Test killing thread that is waiting to start transaction until previous transaction commits ***
+SET binlog_format=statement;
+SET gtid_domain_id=2;
+BEGIN;
+INSERT INTO t3 VALUES (70, foo(70,
+'rpl_parallel_start_waiting_for_prior SIGNAL t4_waiting', ''));
+INSERT INTO t3 VALUES (60, foo(60,
+'ha_write_row_end SIGNAL d2_query WAIT_FOR d2_cont2',
+'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+SET debug_sync='now WAIT_FOR d2_query';
+SET gtid_domain_id=1;
+BEGIN;
+INSERT INTO t3 VALUES (61, foo(61,
+'rpl_parallel_start_waiting_for_prior SIGNAL t3_waiting',
+'rpl_parallel_start_waiting_for_prior_killed SIGNAL t3_killed'));
+INSERT INTO t3 VALUES (62, foo(62,
+'ha_write_row_end SIGNAL d1_query WAIT_FOR d1_cont2',
+'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+SET debug_sync='now WAIT_FOR d1_query';
+SET gtid_domain_id=0;
+INSERT INTO t3 VALUES (63, foo(63,
+'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2',
+'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont'));
+SET debug_sync='now WAIT_FOR d0_query';
+SET gtid_domain_id=3;
+BEGIN;
+INSERT INTO t3 VALUES (68, foo(68,
+'rpl_parallel_start_waiting_for_prior SIGNAL t2_waiting', ''));
+INSERT INTO t3 VALUES (69, foo(69,
+'ha_write_row_end SIGNAL d3_query WAIT_FOR d3_cont2',
+'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+SET debug_sync='now WAIT_FOR d3_query';
+SET debug_sync='now SIGNAL d2_cont2';
+SET debug_sync='now WAIT_FOR d2_done';
+SET debug_sync='now SIGNAL d1_cont2';
+SET debug_sync='now WAIT_FOR d1_done';
+SET debug_sync='now SIGNAL d0_cont2';
+SET debug_sync='now WAIT_FOR d0_done';
+SET debug_sync='now SIGNAL d3_cont2';
+SET debug_sync='now WAIT_FOR d3_done';
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (64, foo(64,
+'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', ''));
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2';
+INSERT INTO t3 VALUES (65, foo(65, '', ''));
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+INSERT INTO t3 VALUES (66, foo(66, '', ''));
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4';
+INSERT INTO t3 VALUES (67, foo(67, '', ''));
+SET debug_sync='now WAIT_FOR master_queued4';
+SET debug_sync='now SIGNAL master_cont2';
+SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
+a b
+60 60
+61 61
+62 62
+63 63
+64 64
+65 65
+66 66
+67 67
+68 68
+69 69
+70 70
+SET debug_sync='RESET';
+SET debug_sync='now SIGNAL d0_cont';
+SET debug_sync='now WAIT_FOR t1_waiting';
+SET debug_sync='now SIGNAL d3_cont';
+SET debug_sync='now WAIT_FOR t2_waiting';
+SET debug_sync='now SIGNAL d1_cont';
+SET debug_sync='now WAIT_FOR t3_waiting';
+SET debug_sync='now SIGNAL d2_cont';
+SET debug_sync='now WAIT_FOR t4_waiting';
+KILL THD_ID;
+SET debug_sync='now WAIT_FOR t3_killed';
+SET debug_sync='now SIGNAL t1_cont';
+include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
+STOP SLAVE IO_THREAD;
+SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a;
+a b
+60 60
+61 61
+62 62
+63 63
+64 64
+68 68
+69 69
+70 70
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+UPDATE t3 SET b=b+1 WHERE a=60;
+include/start_slave.inc
+SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
+a b
+60 61
+61 61
+62 62
+63 63
+64 64
+65 65
+66 66
+67 67
+68 68
+69 69
+70 70
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+RETURNS INT DETERMINISTIC
+BEGIN
+IF d1 != '' THEN
+SET debug_sync = d1;
+END IF;
+IF d2 != '' THEN
+SET debug_sync = d2;
+END IF;
+RETURN x;
+END
+||
+SET sql_log_bin=1;
+include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** 5. Test killing thread that is waiting for queue of max length to shorten ***
+SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued;
+SET GLOBAL slave_parallel_max_queued=9000;
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (80, foo(0,
+'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', ''));
+SET debug_sync='now WAIT_FOR query_waiting';
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max";
+SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
+a b
+80 0
+81 10000
+SET debug_sync='now WAIT_FOR wait_queue_ready';
+KILL THD_ID;
+SET debug_sync='now WAIT_FOR wait_queue_killed';
+SET debug_sync='now SIGNAL query_cont';
+include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
+STOP SLAVE IO_THREAD;
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_max_queued= @old_max_queued;
+INSERT INTO t3 VALUES (82,0);
+SET binlog_format=@old_format;
+SET debug_sync='RESET';
+include/start_slave.inc
+SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
+a b
+80 0
+81 10000
+82 0
+include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-5788 Incorrect free of rgi->deferred_events in parallel replication ***
+include/stop_slave.inc
+SET GLOBAL replicate_ignore_table="test.t3";
+SET GLOBAL slave_parallel_threads=2;
+include/start_slave.inc
+INSERT INTO t3 VALUES (100, rand());
+INSERT INTO t3 VALUES (101, rand());
+INSERT INTO t3 VALUES (102, rand());
+INSERT INTO t3 VALUES (103, rand());
+INSERT INTO t3 VALUES (104, rand());
+INSERT INTO t3 VALUES (105, rand());
+include/stop_slave.inc
+SET GLOBAL replicate_ignore_table="";
+include/start_slave.inc
+INSERT INTO t3 VALUES (106, rand());
+INSERT INTO t3 VALUES (107, rand());
+SELECT * FROM t3 WHERE a >= 100 ORDER BY a;
+a b
+106 #
+107 #
+*** MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction ***
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+INSERT INTO t3 VALUES (110, 1);
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+a b
+110 1
+SET sql_log_bin=0;
+INSERT INTO t3 VALUES (111, 666);
+SET sql_log_bin=1;
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+INSERT INTO t3 VALUES (111, 2);
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+INSERT INTO t3 VALUES (112, 3);
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+SET debug_sync='RESET';
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/wait_for_slave_sql_to_stop.inc
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+a b
+110 1
+111 666
+SET sql_log_bin=0;
+DELETE FROM t3 WHERE a=111 AND b=666;
+SET sql_log_bin=1;
+START SLAVE SQL_THREAD;
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+a b
+110 1
+111 2
+112 3
+***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts ***
+include/stop_slave.inc
+CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+UPDATE t4 SET b=NULL WHERE a=6;
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+DELETE FROM t4 WHERE b <= 3;
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+SET debug_sync='RESET';
+include/start_slave.inc
+include/stop_slave.inc
+SELECT * FROM t4 ORDER BY a;
+a b
+1 NULL
+3 NULL
+4 4
+5 NULL
+6 NULL
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+INSERT INTO t4 VALUES (7, NULL);
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+DELETE FROM t4 WHERE b <= 3;
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+SET debug_sync='RESET';
+include/start_slave.inc
+include/stop_slave.inc
+SELECT * FROM t4 ORDER BY a;
+a b
+1 NULL
+3 NULL
+4 4
+5 NULL
+6 6
+7 NULL
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+UPDATE t4 SET b=NULL WHERE a=6;
+SET debug_sync='now WAIT_FOR master_queued1';
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format='statement';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+DELETE FROM t4 WHERE b <= 1;
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+SET @old_format=@@GLOBAL.binlog_format;
+SET debug_sync='RESET';
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,disable_thd_need_ordering_with";
+include/start_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SELECT * FROM t4 ORDER BY a;
+a b
+1 NULL
+2 2
+3 NULL
+4 4
+5 NULL
+6 NULL
+SET @last_gtid= 'GTID';
+SELECT IF(@@gtid_slave_pos LIKE CONCAT('%',@last_gtid,'%'), "GTID found ok",
+CONCAT("GTID ", @last_gtid, " not found in gtid_slave_pos=", @@gtid_slave_pos))
+AS result;
+result
+GTID found ok
+SELECT "ROW FOUND" AS `Is the row found?`
+ FROM mysql.gtid_slave_pos
+WHERE CONCAT(domain_id, "-", server_id, "-", seq_no) = @last_gtid;
+Is the row found?
+ROW FOUND
+*** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication ***
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET DEBUG_SYNC= 'RESET';
+include/start_slave.inc
+CREATE TABLE t5 (a INT PRIMARY KEY, b INT);
+INSERT INTO t5 VALUES (1,1);
+INSERT INTO t5 VALUES (2,2), (3,8);
+INSERT INTO t5 VALUES (4,16);
+test_check
+OK
+test_check
+OK
+FLUSH LOGS;
+test_check
+OK
+test_check
+OK
+*** MDEV_6435: Incorrect error handling when query binlogged partially on master with "killed" error ***
+CREATE TABLE t6 (a INT) ENGINE=MyISAM;
+CREATE TRIGGER tr AFTER INSERT ON t6 FOR EACH ROW SET @a = 1;
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+SET debug_sync='sp_head_execute_before_loop SIGNAL ready WAIT_FOR cont';
+INSERT INTO t6 VALUES (1), (2), (3);
+SET debug_sync='now WAIT_FOR ready';
+KILL QUERY CONID;
+SET debug_sync='now SIGNAL cont';
+ERROR 70100: Query execution was interrupted
+SET binlog_format= @old_format;
+SET debug_sync='RESET';
+SET debug_sync='RESET';
+include/wait_for_slave_sql_error.inc [errno=1317]
+STOP SLAVE IO_THREAD;
+SET GLOBAL gtid_slave_pos= 'AFTER_ERROR_GTID_POS';
+include/start_slave.inc
+INSERT INTO t6 VALUES (4);
+SELECT * FROM t6 ORDER BY a;
+a
+1
+4
+SELECT * FROM t6 ORDER BY a;
+a
+4
+*** MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0 ***
+INSERT INTO t2 VALUES (31);
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads= 0;
+include/start_slave.inc
+SET sql_log_bin= 0;
+INSERT INTO t2 VALUES (32);
+SET sql_log_bin= 1;
+INSERT INTO t2 VALUES (32);
+FLUSH LOGS;
+INSERT INTO t2 VALUES (33);
+INSERT INTO t2 VALUES (34);
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+a
+31
+32
+33
+34
+include/save_master_gtid.inc
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
+SET GLOBAL slave_parallel_threads=10;
+START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1062]
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1062]
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+a
+31
+32
+SET sql_slave_skip_counter= 1;
+ERROR HY000: When using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position.
+include/stop_slave_io.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+a
+31
+32
+33
+34
+*** MDEV-6775: Wrong binlog order in parallel replication ***
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (3,NULL), (4,4), (5, NULL), (6, 6);
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,inject_binlog_commit_before_get_LOCK_log";
+SET @old_format=@@GLOBAL.binlog_format;
+SET GLOBAL binlog_format=ROW;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+UPDATE t4 SET b=NULL WHERE a=6;
+SET debug_sync='now WAIT_FOR master_queued1';
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+DELETE FROM t4 WHERE b <= 3;
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+SET binlog_format= @old_format;
+SET binlog_format= @old_format;
+SET debug_sync='RESET';
+SELECT * FROM t4 ORDER BY a;
+a b
+1 NULL
+3 NULL
+4 4
+5 NULL
+6 NULL
+include/start_slave.inc
+SET debug_sync= 'now WAIT_FOR waiting';
+SELECT * FROM t4 ORDER BY a;
+a b
+1 NULL
+3 NULL
+4 4
+5 NULL
+6 NULL
+SET debug_sync= 'now SIGNAL cont';
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL binlog_format= @old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave ***
+INSERT INTO t2 VALUES (40);
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=no;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100";
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+INSERT INTO t2 VALUES (41);
+INSERT INTO t2 VALUES (42);
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+DELETE FROM t2 WHERE a=40;
+SET binlog_format= @old_format;
+INSERT INTO t2 VALUES (43);
+INSERT INTO t2 VALUES (44);
+FLUSH LOGS;
+INSERT INTO t2 VALUES (45);
+SET gtid_seq_no=100;
+INSERT INTO t2 VALUES (46);
+BEGIN;
+SELECT * FROM t2 WHERE a=40 FOR UPDATE;
+a
+40
+include/start_slave.inc
+SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100';
+STOP SLAVE;
+SET debug_sync= 'now WAIT_FOR wait_for_done_waiting';
+ROLLBACK;
+include/wait_for_slave_sql_to_stop.inc
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+a
+41
+42
+include/start_slave.inc
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+a
+41
+42
+43
+44
+45
+46
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET DEBUG_SYNC= 'RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+include/start_slave.inc
+*** MDEV-7326 Server deadlock in connection with parallel replication ***
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=3;
+SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
+include/start_slave.inc
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format= STATEMENT;
+INSERT INTO t1 VALUES (foo(50,
+"rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
+"rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+INSERT INTO t2 VALUES (foo(50,
+"rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
+"rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+INSERT INTO t1 VALUES (foo(51,
+"rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
+"rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
+SET DEBUG_SYNC= "now SIGNAL t1_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+INSERT INTO t1 VALUES (52);
+SET BINLOG_FORMAT= @old_format;
+SELECT * FROM t2 WHERE a>=50 ORDER BY a;
+a
+50
+SELECT * FROM t1 WHERE a>=50 ORDER BY a;
+a
+50
+51
+52
+SET DEBUG_SYNC= "now SIGNAL prep_cont";
+SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
+SET DEBUG_SYNC= "now SIGNAL t2_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
+SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+SELECT * FROM t2 WHERE a>=50 ORDER BY a;
+a
+50
+SELECT * FROM t1 WHERE a>=50 ORDER BY a;
+a
+50
+51
+52
+SET DEBUG_SYNC="reset";
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-7326 Server deadlock in connection with parallel replication ***
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=3;
+SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
+include/start_slave.inc
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format= STATEMENT;
+INSERT INTO t1 VALUES (foo(60,
+"rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
+"rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+INSERT INTO t2 VALUES (foo(60,
+"rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
+"rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+INSERT INTO t1 VALUES (foo(61,
+"rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
+"rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+SET debug_sync='now WAIT_FOR master_queued1';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+INSERT INTO t6 VALUES (62);
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+SET debug_sync='RESET';
+SET BINLOG_FORMAT= @old_format;
+SELECT * FROM t2 WHERE a>=60 ORDER BY a;
+a
+60
+SELECT * FROM t1 WHERE a>=60 ORDER BY a;
+a
+60
+61
+SELECT * FROM t6 WHERE a>=60 ORDER BY a;
+a
+62
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
+SET DEBUG_SYNC= "now SIGNAL t1_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+SET DEBUG_SYNC= "now SIGNAL prep_cont";
+SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
+SET DEBUG_SYNC= "now SIGNAL t2_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
+SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+SELECT * FROM t2 WHERE a>=60 ORDER BY a;
+a
+60
+SELECT * FROM t1 WHERE a>=60 ORDER BY a;
+a
+60
+61
+SELECT * FROM t6 WHERE a>=60 ORDER BY a;
+a
+62
+SET DEBUG_SYNC="reset";
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
+INSERT INTO t2 VALUES (101);
+INSERT INTO t2 VALUES (102);
+INSERT INTO t2 VALUES (103);
+INSERT INTO t2 VALUES (104);
+INSERT INTO t2 VALUES (105);
+SET gtid_seq_no=1000;
+INSERT INTO t2 VALUES (106);
+INSERT INTO t2 VALUES (107);
+INSERT INTO t2 VALUES (108);
+INSERT INTO t2 VALUES (109);
+INSERT INTO t2 VALUES (110);
+INSERT INTO t2 VALUES (111);
+INSERT INTO t2 VALUES (112);
+INSERT INTO t2 VALUES (113);
+INSERT INTO t2 VALUES (114);
+INSERT INTO t2 VALUES (115);
+INSERT INTO t2 VALUES (116);
+INSERT INTO t2 VALUES (117);
+INSERT INTO t2 VALUES (118);
+INSERT INTO t2 VALUES (119);
+INSERT INTO t2 VALUES (120);
+INSERT INTO t2 VALUES (121);
+INSERT INTO t2 VALUES (122);
+INSERT INTO t2 VALUES (123);
+INSERT INTO t2 VALUES (124);
+INSERT INTO t2 VALUES (125);
+INSERT INTO t2 VALUES (126);
+INSERT INTO t2 VALUES (127);
+INSERT INTO t2 VALUES (128);
+INSERT INTO t2 VALUES (129);
+INSERT INTO t2 VALUES (130);
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
+a
+101
+102
+103
+104
+105
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-6676 - test syntax of @@slave_parallel_mode ***
+Parallel_Mode = 'conservative'
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='aggressive';
+Parallel_Mode = 'aggressive'
+SET GLOBAL slave_parallel_mode='conservative';
+Parallel_Mode = 'conservative'
+*** MDEV-6676 - test that empty parallel_mode does not replicate in parallel ***
+INSERT INTO t2 VALUES (1040);
+include/save_master_gtid.inc
+SET GLOBAL slave_parallel_mode='none';
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply";
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+a
+1040
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+*** MDEV-6676 - test disabling domain-based parallel replication ***
+SET gtid_domain_id = 1;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+DELETE FROM t2 WHERE a >= 1041;
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+SET gtid_domain_id = 0;
+include/save_master_gtid.inc
+SET GLOBAL slave_parallel_mode=minimal;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+a
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='conservative';
+include/start_slave.inc
+*** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging ***
+*** MDEV-7882: Excessive transaction retry in parallel replication ***
+CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=40;
+SELECT @old_retries:=@@GLOBAL.slave_transaction_retries;
+@old_retries:=@@GLOBAL.slave_transaction_retries
+10
+SET GLOBAL slave_transaction_retries= 5;
+INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
+SET @old_dbug= @@SESSION.debug_dbug;
+SET @commit_id= 42;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+INSERT INTO t8 VALUES (1,1);
+INSERT INTO t8 VALUES (2,2);
+INSERT INTO t8 VALUES (3,3);
+INSERT INTO t8 VALUES (4,4);
+INSERT INTO t8 VALUES (5,5);
+INSERT INTO t8 VALUES (6,6);
+INSERT INTO t8 VALUES (7,7);
+INSERT INTO t8 VALUES (8,8);
+UPDATE t7 SET b=9 WHERE a=3;
+UPDATE t7 SET b=10 WHERE a=3;
+UPDATE t7 SET b=11 WHERE a=3;
+INSERT INTO t8 VALUES (12,12);
+INSERT INTO t8 VALUES (13,13);
+UPDATE t7 SET b=14 WHERE a=3;
+UPDATE t7 SET b=15 WHERE a=3;
+INSERT INTO t8 VALUES (16,16);
+UPDATE t7 SET b=17 WHERE a=3;
+INSERT INTO t8 VALUES (18,18);
+INSERT INTO t8 VALUES (19,19);
+UPDATE t7 SET b=20 WHERE a=3;
+INSERT INTO t8 VALUES (21,21);
+UPDATE t7 SET b=22 WHERE a=3;
+INSERT INTO t8 VALUES (23,24);
+INSERT INTO t8 VALUES (24,24);
+UPDATE t7 SET b=25 WHERE a=3;
+INSERT INTO t8 VALUES (26,26);
+UPDATE t7 SET b=27 WHERE a=3;
+BEGIN;
+INSERT INTO t8 VALUES (28,28);
+INSERT INTO t8 VALUES (29,28), (30,28);
+INSERT INTO t8 VALUES (31,28);
+INSERT INTO t8 VALUES (32,28);
+INSERT INTO t8 VALUES (33,28);
+INSERT INTO t8 VALUES (34,28);
+INSERT INTO t8 VALUES (35,28);
+INSERT INTO t8 VALUES (36,28);
+INSERT INTO t8 VALUES (37,28);
+INSERT INTO t8 VALUES (38,28);
+INSERT INTO t8 VALUES (39,28);
+INSERT INTO t8 VALUES (40,28);
+INSERT INTO t8 VALUES (41,28);
+INSERT INTO t8 VALUES (42,28);
+COMMIT;
+SET @commit_id=43;
+INSERT INTO t8 VALUES (43,43);
+INSERT INTO t8 VALUES (44,44);
+UPDATE t7 SET b=45 WHERE a=3;
+INSERT INTO t8 VALUES (46,46);
+INSERT INTO t8 VALUES (47,47);
+UPDATE t7 SET b=48 WHERE a=3;
+INSERT INTO t8 VALUES (49,49);
+INSERT INTO t8 VALUES (50,50);
+SET @commit_id=44;
+INSERT INTO t8 VALUES (51,51);
+INSERT INTO t8 VALUES (52,52);
+UPDATE t7 SET b=53 WHERE a=3;
+INSERT INTO t8 VALUES (54,54);
+INSERT INTO t8 VALUES (55,55);
+UPDATE t7 SET b=56 WHERE a=3;
+INSERT INTO t8 VALUES (57,57);
+UPDATE t7 SET b=58 WHERE a=3;
+INSERT INTO t8 VALUES (58,58);
+INSERT INTO t8 VALUES (59,59);
+INSERT INTO t8 VALUES (60,60);
+INSERT INTO t8 VALUES (61,61);
+UPDATE t7 SET b=62 WHERE a=3;
+INSERT INTO t8 VALUES (63,63);
+INSERT INTO t8 VALUES (64,64);
+INSERT INTO t8 VALUES (65,65);
+INSERT INTO t8 VALUES (66,66);
+UPDATE t7 SET b=67 WHERE a=3;
+INSERT INTO t8 VALUES (68,68);
+UPDATE t7 SET b=69 WHERE a=3;
+UPDATE t7 SET b=70 WHERE a=3;
+UPDATE t7 SET b=71 WHERE a=3;
+INSERT INTO t8 VALUES (72,72);
+UPDATE t7 SET b=73 WHERE a=3;
+UPDATE t7 SET b=74 WHERE a=3;
+UPDATE t7 SET b=75 WHERE a=3;
+UPDATE t7 SET b=76 WHERE a=3;
+INSERT INTO t8 VALUES (77,77);
+UPDATE t7 SET b=78 WHERE a=3;
+INSERT INTO t8 VALUES (79,79);
+UPDATE t7 SET b=80 WHERE a=3;
+INSERT INTO t8 VALUES (81,81);
+UPDATE t7 SET b=82 WHERE a=3;
+INSERT INTO t8 VALUES (83,83);
+UPDATE t7 SET b=84 WHERE a=3;
+SET @commit_id=45;
+INSERT INTO t8 VALUES (85,85);
+UPDATE t7 SET b=86 WHERE a=3;
+INSERT INTO t8 VALUES (87,87);
+SET @commit_id=46;
+INSERT INTO t8 VALUES (88,88);
+INSERT INTO t8 VALUES (89,89);
+INSERT INTO t8 VALUES (90,90);
+SET SESSION debug_dbug=@old_dbug;
+INSERT INTO t8 VALUES (91,91);
+INSERT INTO t8 VALUES (92,92);
+INSERT INTO t8 VALUES (93,93);
+INSERT INTO t8 VALUES (94,94);
+INSERT INTO t8 VALUES (95,95);
+INSERT INTO t8 VALUES (96,96);
+INSERT INTO t8 VALUES (97,97);
+INSERT INTO t8 VALUES (98,98);
+INSERT INTO t8 VALUES (99,99);
+SELECT * FROM t7 ORDER BY a;
+a b
+1 1
+2 2
+3 86
+4 4
+5 5
+SELECT * FROM t8 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+12 12
+13 13
+16 16
+18 18
+19 19
+21 21
+23 24
+24 24
+26 26
+28 28
+29 28
+30 28
+31 28
+32 28
+33 28
+34 28
+35 28
+36 28
+37 28
+38 28
+39 28
+40 28
+41 28
+42 28
+43 43
+44 44
+46 46
+47 47
+49 49
+50 50
+51 51
+52 52
+54 54
+55 55
+57 57
+58 58
+59 59
+60 60
+61 61
+63 63
+64 64
+65 65
+66 66
+68 68
+72 72
+77 77
+79 79
+81 81
+83 83
+85 85
+87 87
+88 88
+89 89
+90 90
+91 91
+92 92
+93 93
+94 94
+95 95
+96 96
+97 97
+98 98
+99 99
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t7 ORDER BY a;
+a b
+1 1
+2 2
+3 86
+4 4
+5 5
+SELECT * FROM t8 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+12 12
+13 13
+16 16
+18 18
+19 19
+21 21
+23 24
+24 24
+26 26
+28 28
+29 28
+30 28
+31 28
+32 28
+33 28
+34 28
+35 28
+36 28
+37 28
+38 28
+39 28
+40 28
+41 28
+42 28
+43 43
+44 44
+46 46
+47 47
+49 49
+50 50
+51 51
+52 52
+54 54
+55 55
+57 57
+58 58
+59 59
+60 60
+61 61
+63 63
+64 64
+65 65
+66 66
+68 68
+72 72
+77 77
+79 79
+81 81
+83 83
+85 85
+87 87
+88 88
+89 89
+90 90
+91 91
+92 92
+93 93
+94 94
+95 95
+96 96
+97 97
+98 98
+99 99
+include/stop_slave.inc
+SET GLOBAL slave_transaction_retries= @old_retries;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10000;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+INSERT INTO t3 VALUES (120, 0);
+SET @commit_id= 10001;
+INSERT INTO t3 VALUES (121, 0);
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+a b
+120 0
+121 0
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+a b
+120 0
+121 0
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+include/start_slave.inc
+*** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @old_server_id= @@SESSION.server_id;
+SET SESSION server_id= 100;
+SET @commit_id= 10010;
+ALTER TABLE t1 COMMENT "Hulubulu!";
+SET SESSION server_id= @old_server_id;
+INSERT INTO t3 VALUES (130, 0);
+SET @commit_id= 10011;
+INSERT INTO t3 VALUES (131, 0);
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+a b
+130 0
+131 0
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+a b
+130 0
+131 0
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+include/start_slave.inc
+*** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) ***
+INSERT INTO t3 VALUES (201,0), (202,0);
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_mdev8031';
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10200;
+INSERT INTO t3 VALUES (203, 1);
+INSERT INTO t3 VALUES (204, 1);
+INSERT INTO t3 VALUES (205, 1);
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=205;
+UPDATE t3 SET b=b+1 WHERE a=205;
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 3
+202 4
+203 4
+204 4
+205 3
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 3
+202 4
+203 4
+204 4
+205 3
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+include/start_slave.inc
+*** Check getting deadlock killed inside open_binlog() during retry. ***
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
+SET @old_max= @@GLOBAL.max_relay_log_size;
+SET GLOBAL max_relay_log_size= 4096;
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10210;
+Omit long queries that cause relaylog rotations and transaction retries...
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 6
+202 8
+203 7
+204 7
+205 5
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 6
+202 8
+203 7
+204 7
+205 5
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debg;
+SET GLOBAL max_relay_log_size= @old_max;
+include/start_slave.inc
+*** MDEV-8302: Duplicate key with parallel replication ***
+include/stop_slave.inc
+/* Inject a small sleep which makes the race easier to hit. */
+SET @old_dbug=@@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,inject_mdev8302";
+INSERT INTO t7 VALUES (100,1), (101,2), (102,3), (103,4), (104,5);
+SET @old_dbug= @@SESSION.debug_dbug;
+SET @commit_id= 20000;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t7 ORDER BY a;
+a b
+1 1
+2 2
+3 86
+4 4
+5 5
+100 5
+101 1
+102 2
+103 3
+104 4
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t7 ORDER BY a;
+a b
+1 1
+2 2
+3 86
+4 4
+5 5
+100 5
+101 1
+102 2
+103 3
+104 4
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+include/start_slave.inc
+*** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
+BEGIN;
+INSERT INTO t2 VALUES (2000);
+INSERT INTO t1 VALUES (2000);
+INSERT INTO t2 VALUES (2001);
+ROLLBACK;
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
+a
+2000
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
+a
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
+a
+2000
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
+a
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+SET DEBUG_SYNC= 'RESET';
+DROP function foo;
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
+SET DEBUG_SYNC= 'RESET';
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel.test b/mysql-test/suite/binlog_encryption/rpl_parallel.test
new file mode 100644
index 00000000000..b7c4bb429a4
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_parallel.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.cnf b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.cnf
new file mode 100644
index 00000000000..b8e22e97ae9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.cnf
@@ -0,0 +1,6 @@
+!include my.cnf
+
+[mysqld.2]
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+loose-file-key-management-filename=@ENV.MYSQLTEST_VARDIR/std_data/keys.txt
+encrypt-binlog
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.result b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.result
new file mode 100644
index 00000000000..d454fa41111
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.result
@@ -0,0 +1,12 @@
+include/master-slave.inc
+[connection master]
+[connection slave]
+SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
+SHOW BINLOG EVENTS;
+[connection slave1]
+SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
+FLUSH LOGS;
+SET DEBUG_SYNC= 'now SIGNAL end';
+[connection slave]
+SET DEBUG_SYNC= 'RESET';
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
new file mode 100644
index 00000000000..9e93b0b56e9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_relayrotate-slave.opt b/mysql-test/suite/binlog_encryption/rpl_relayrotate-slave.opt
new file mode 100644
index 00000000000..1665aec291d
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_relayrotate-slave.opt
@@ -0,0 +1,5 @@
+--max_relay_log_size=16384
+--log-warnings
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--loose-file-key-management-filename=$MYSQLTEST_VARDIR/std_data/keys.txt
+--encrypt-binlog
diff --git a/mysql-test/suite/binlog_encryption/rpl_relayrotate.result b/mysql-test/suite/binlog_encryption/rpl_relayrotate.result
new file mode 100644
index 00000000000..ea00aee0085
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_relayrotate.result
@@ -0,0 +1,13 @@
+include/master-slave.inc
+[connection master]
+stop slave;
+create table t1 (a int) engine=innodb;
+reset slave;
+start slave;
+stop slave;
+start slave;
+select max(a) from t1;
+max(a)
+8000
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_relayrotate.test b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
new file mode 100644
index 00000000000..5e3bcdcd711
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_relayrotate.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result
new file mode 100644
index 00000000000..06eb56a40c5
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result
@@ -0,0 +1,465 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Read semi-sync reply");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+#
+# Uninstall semi-sync plugins on master and slave
+#
+include/stop_slave.inc
+reset slave;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+reset master;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+#
+# Main test of semi-sync replication start here
+#
+[ on master ]
+set global rpl_semi_sync_master_timeout= 60000;
+[ default state of semi-sync on master should be OFF ]
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+[ enable semi-sync on master ]
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ status of semi-sync on master should be ON even without any semi-sync slaves ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+#
+# BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+# BUG#45673 Semisynch reports correct operation even if no slave is connected
+#
+[ status of semi-sync on master should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+reset master;
+[ on slave ]
+[ default state of semi-sync on slave should be OFF ]
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+[ enable semi-sync on slave ]
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+[ initial master state after the semi-sync slave connected ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+create table t1(a int) engine = ENGINE_TYPE;
+[ master state after CREATE TABLE statement ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 1
+select CONNECTIONS_NORMAL_SLAVE - CONNECTIONS_NORMAL_SLAVE as 'Should be 0';
+Should be 0
+0
+[ insert records to table ]
+insert t1 values (10);
+insert t1 values (9);
+insert t1 values (8);
+insert t1 values (7);
+insert t1 values (6);
+insert t1 values (5);
+insert t1 values (4);
+insert t1 values (3);
+insert t1 values (2);
+insert t1 values (1);
+[ master status after inserts ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 11
+[ on slave ]
+[ slave status after replicated inserts ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+10
+select min(a) from t1;
+min(a)
+1
+select max(a) from t1;
+max(a)
+10
+
+# BUG#50157
+# semi-sync replication crashes when replicating a transaction which
+# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
+[ on master ]
+SET SESSION AUTOCOMMIT= 0;
+CREATE TABLE t2(c1 INT) ENGINE=innodb;
+BEGIN;
+
+# Even though it is in a transaction, this statement is binlogged into binlog
+# file immediately.
+CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
+
+# These statements will not be binlogged until the transaction is committed
+INSERT INTO t2 VALUES(11);
+INSERT INTO t2 VALUES(22);
+COMMIT;
+DROP TABLE t2, t3;
+SET SESSION AUTOCOMMIT= 1;
+#
+# Test semi-sync master will switch OFF after one transaction
+# timeout waiting for slave reply.
+#
+include/stop_slave.inc
+[ on master ]
+set global rpl_semi_sync_master_timeout= 5000;
+[ master status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+[ semi-sync replication of these transactions will fail ]
+insert into t1 values (500);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 1
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+delete from t1 where a=10;
+delete from t1 where a=9;
+delete from t1 where a=8;
+delete from t1 where a=7;
+delete from t1 where a=6;
+delete from t1 where a=5;
+delete from t1 where a=4;
+delete from t1 where a=3;
+delete from t1 where a=2;
+delete from t1 where a=1;
+insert into t1 values (100);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+#
+# Test semi-sync status on master will be ON again when slave catches up
+#
+[ on slave ]
+[ slave status should be OFF ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+[ slave status should be ON ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+2
+select min(a) from t1;
+min(a)
+100
+select max(a) from t1;
+max(a)
+500
+[ on master ]
+[ master status should be ON again after slave catches up ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+#
+# Test disable/enable master semi-sync on the fly.
+#
+drop table t1;
+[ on slave ]
+include/stop_slave.inc
+#
+# Flush status
+#
+[ Semi-sync master status variables before FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 15
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+[ Semi-sync master status variables after FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on master ]
+show master logs;
+Log_name master-bin.000001
+File_size #
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ disable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ enable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+#
+# Test RESET MASTER/SLAVE
+#
+[ on slave ]
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+drop table t1;
+show status like 'Rpl_relay%';
+Variable_name Value
+[ test reset master ]
+[ on master]
+reset master;
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on slave ]
+include/stop_slave.inc
+reset slave;
+kill query _tid;
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+[ on slave ]
+select * from t1;
+a
+1
+2
+3
+[ on master ]
+[ master semi-sync status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 3
+#
+# Start semi-sync replication without SUPER privilege
+#
+include/stop_slave.inc
+reset slave;
+[ on master ]
+reset master;
+kill query _tid;
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+set sql_log_bin=1;
+[ on slave ]
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+change master to master_user='rpl',master_password='rpl_password';
+include/start_slave.inc
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+[ on master ]
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+insert into t1 values (4);
+insert into t1 values (5);
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 2
+#
+# Test semi-sync slave connect to non-semi-sync master
+#
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ on master ]
+kill query _tid;
+[ Semi-sync status on master should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+set global rpl_semi_sync_master_enabled= 0;
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (8);
+[ master semi-sync clients should be 1, status should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ on slave ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+include/stop_slave.inc
+[ on master ]
+set global rpl_semi_sync_master_enabled= 0;
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (10);
+#
+# Test non-semi-sync slave connect to semi-sync master
+#
+set global rpl_semi_sync_master_timeout= 5000;
+set global rpl_semi_sync_master_enabled= 1;
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ uninstall semi-sync slave plugin ]
+set global rpl_semi_sync_slave_enabled= 0;
+[ reinstall semi-sync slave plugin and disable semi-sync ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+#
+# Clean up
+#
+include/stop_slave.inc
+set global rpl_semi_sync_slave_enabled= 0;
+set global rpl_semi_sync_master_enabled= 0;
+change master to master_user='root',master_password='';
+include/start_slave.inc
+drop table t1;
+drop user rpl@127.0.0.1;
+flush privileges;
+set global rpl_semi_sync_master_timeout= default;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.test b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
new file mode 100644
index 00000000000..d5f80619aeb
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_semi_sync.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.cnf b/mysql-test/suite/binlog_encryption/rpl_skip_replication.cnf
new file mode 100644
index 00000000000..b8e22e97ae9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.cnf
@@ -0,0 +1,6 @@
+!include my.cnf
+
+[mysqld.2]
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+loose-file-key-management-filename=@ENV.MYSQLTEST_VARDIR/std_data/keys.txt
+encrypt-binlog
diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.result b/mysql-test/suite/binlog_encryption/rpl_skip_replication.result
new file mode 100644
index 00000000000..586a104239a
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.result
@@ -0,0 +1,252 @@
+include/master-slave.inc
+[connection master]
+CREATE USER 'nonsuperuser'@'127.0.0.1';
+GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
+SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+DROP USER'nonsuperuser'@'127.0.0.1';
+SELECT @@global.replicate_events_marked_for_skip;
+@@global.replicate_events_marked_for_skip
+REPLICATE
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
+SELECT @@global.replicate_events_marked_for_skip;
+@@global.replicate_events_marked_for_skip
+REPLICATE
+STOP SLAVE;
+SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
+ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@global.replicate_events_marked_for_skip;
+@@global.replicate_events_marked_for_skip
+REPLICATE
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+SELECT @@global.replicate_events_marked_for_skip;
+@@global.replicate_events_marked_for_skip
+FILTER_ON_MASTER
+START SLAVE;
+SELECT @@skip_replication;
+@@skip_replication
+0
+SET GLOBAL skip_replication=1;
+ERROR HY000: Variable 'skip_replication' is a SESSION variable and can't be used with SET GLOBAL
+SELECT @@skip_replication;
+@@skip_replication
+0
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb;
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t2(a) VALUES (1);
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (2);
+INSERT INTO t2(a) VALUES (2);
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+SELECT * FROM t1;
+a b
+1 NULL
+SELECT * FROM t2;
+a b
+1 NULL
+DROP TABLE t3;
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (3);
+INSERT INTO t2(a) VALUES (3);
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+SELECT * FROM t1;
+a b
+1 NULL
+SELECT * FROM t2;
+a b
+1 NULL
+DROP TABLE t3;
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t3(a) VALUES(2);
+SELECT * FROM t3;
+a b
+2 NULL
+DROP TABLE t3;
+TRUNCATE t1;
+RESET MASTER;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,0);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,0);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,0);
+SELECT * FROM t1 ORDER by a;
+a b
+1 0
+2 0
+3 0
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+TRUNCATE t1;
+SELECT * FROM t1 ORDER by a;
+a b
+1 0
+2 0
+3 0
+START SLAVE;
+SELECT * FROM t1 ORDER by a;
+a b
+1 0
+3 0
+TRUNCATE t1;
+STOP SLAVE;
+SET GLOBAL sql_slave_skip_counter=6;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= statement;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,5);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,5);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,5);
+INSERT INTO t1 VALUES (4,5);
+SET binlog_format= @old_binlog_format;
+SELECT * FROM t1;
+a b
+4 5
+include/stop_slave.inc
+SET @old_slave_binlog_format= @@global.binlog_format;
+SET GLOBAL binlog_format= row;
+include/start_slave.inc
+TRUNCATE t1;
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= row;
+BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAA371saA==';
+BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA=';
+BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
+SET binlog_format= @old_binlog_format;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 8
+2 8
+SELECT * FROM t1 ORDER by a;
+a b
+2 8
+include/stop_slave.inc
+SET GLOBAL binlog_format= @old_slave_binlog_format;
+include/start_slave.inc
+SET skip_replication=0;
+BEGIN;
+SET skip_replication=0;
+ERROR HY000: Cannot modify @@session.skip_replication inside a transaction
+SET skip_replication=1;
+ERROR HY000: Cannot modify @@session.skip_replication inside a transaction
+ROLLBACK;
+SET skip_replication=1;
+BEGIN;
+SET skip_replication=0;
+ERROR HY000: Cannot modify @@session.skip_replication inside a transaction
+SET skip_replication=1;
+ERROR HY000: Cannot modify @@session.skip_replication inside a transaction
+COMMIT;
+SET autocommit=0;
+INSERT INTO t2(a) VALUES(100);
+SET skip_replication=1;
+ERROR HY000: Cannot modify @@session.skip_replication inside a transaction
+ROLLBACK;
+SET autocommit=1;
+SET skip_replication=1;
+CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END|
+CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END|
+CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END|
+SELECT foo(0);
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+SELECT baz(0);
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+SET @a= foo(1);
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+SET @a= baz(1);
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+UPDATE t2 SET b=foo(0);
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+UPDATE t2 SET b=baz(0);
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+INSERT INTO t1 VALUES (101, foo(1));
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+INSERT INTO t1 VALUES (101, baz(0));
+ERROR HY000: Cannot modify @@session.skip_replication inside a stored function or trigger
+SELECT @@skip_replication;
+@@skip_replication
+1
+CALL bar(0);
+SELECT @@skip_replication;
+@@skip_replication
+0
+CALL bar(1);
+SELECT @@skip_replication;
+@@skip_replication
+1
+DROP FUNCTION foo;
+DROP PROCEDURE bar;
+DROP FUNCTION baz;
+SET skip_replication= 0;
+TRUNCATE t1;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+START SLAVE IO_THREAD;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+include/save_master_pos.inc
+include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+SELECT * FROM t1;
+a b
+2 NULL
+SET skip_replication= 0;
+TRUNCATE t1;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE IO_THREAD;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+include/save_master_pos.inc
+include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 NULL
+2 NULL
+SET skip_replication=0;
+DROP TABLE t1,t2;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.test b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
new file mode 100644
index 00000000000..e7b52f2fadb
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
@@ -0,0 +1,2 @@
+--let $use_remote_mysqlbinlog= 1
+--source extra/rpl_tests/rpl_skip_replication.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_special_charset.opt b/mysql-test/suite/binlog_encryption/rpl_special_charset.opt
new file mode 100644
index 00000000000..b071fb20845
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_special_charset.opt
@@ -0,0 +1 @@
+--character-set-server=utf16
diff --git a/mysql-test/suite/binlog_encryption/rpl_special_charset.result b/mysql-test/suite/binlog_encryption/rpl_special_charset.result
new file mode 100644
index 00000000000..6efe81bf6cb
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_special_charset.result
@@ -0,0 +1,8 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("'utf16' can not be used as client character set");
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_special_charset.test b/mysql-test/suite/binlog_encryption/rpl_special_charset.test
new file mode 100644
index 00000000000..6f196005711
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_special_charset.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_special_charset.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_sporadic_master-master.opt b/mysql-test/suite/binlog_encryption/rpl_sporadic_master-master.opt
new file mode 100644
index 00000000000..5f038b69bb7
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_sporadic_master-master.opt
@@ -0,0 +1 @@
+--debug-sporadic-binlog-dump-fail --debug-max-binlog-dump-events=2
diff --git a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.result b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.result
new file mode 100644
index 00000000000..1ec94964acf
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.result
@@ -0,0 +1,23 @@
+include/master-slave.inc
+[connection master]
+create table t2(n int);
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (NULL),(NULL);
+truncate table t1;
+insert into t1 values (4),(NULL);
+include/stop_slave.inc
+include/start_slave.inc
+insert into t1 values (NULL),(NULL);
+flush logs;
+truncate table t1;
+insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
+select * from t1 ORDER BY n;
+n
+10
+11
+12
+13
+14
+15
+drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
new file mode 100644
index 00000000000..0a756982047
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_sporadic_master.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_ssl.result b/mysql-test/suite/binlog_encryption/rpl_ssl.result
new file mode 100644
index 00000000000..f02fa4e7b9f
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_ssl.result
@@ -0,0 +1,47 @@
+include/master-slave.inc
+[connection master]
+create user replssl@localhost;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+stop slave;
+change master to
+master_user='replssl',
+master_password='',
+master_ssl=1,
+master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem',
+master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem',
+master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
+start slave;
+insert into t1 values(1);
+select * from t1;
+t
+1
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
+STOP SLAVE;
+select * from t1;
+t
+1
+insert into t1 values (NULL);
+include/wait_for_slave_to_start.inc
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
+drop user replssl@localhost;
+drop table t1;
+include/stop_slave.inc
+CHANGE MASTER TO
+master_user = 'root',
+master_ssl = 0,
+master_ssl_ca = '',
+master_ssl_cert = '',
+master_ssl_key = '';
+End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_ssl.test b/mysql-test/suite/binlog_encryption/rpl_ssl.test
new file mode 100644
index 00000000000..883b367e9f2
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_ssl.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_ssl.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space-slave.opt b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space-slave.opt
new file mode 100644
index 00000000000..f780540aba8
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space-slave.opt
@@ -0,0 +1 @@
+--relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
diff --git a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.result b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.result
new file mode 100644
index 00000000000..7820f1ef97f
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.result
@@ -0,0 +1,5 @@
+include/master-slave.inc
+[connection master]
+include/assert.inc [Assert that relay log space is close to the limit]
+include/diff_tables.inc [master:test.t1,slave:test.t1]
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
new file mode 100644
index 00000000000..f72300ee2de
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_stm_relay_ign_space.inc
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
new file mode 100644
index 00000000000..7fcb0601ebf
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result
@@ -0,0 +1,428 @@
+include/master-slave.inc
+[connection master]
+drop database if exists mysqltest1;
+create database mysqltest1;
+use mysqltest1;
+set @my_binlog_format= @@global.binlog_format;
+set session binlog_format=mixed;
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format MIXED
+set session binlog_format=statement;
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+set session binlog_format=row;
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+set global binlog_format=DEFAULT;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+set global binlog_format=MIXED;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format MIXED
+set global binlog_format=STATEMENT;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+set global binlog_format=ROW;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+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(),?)';
+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_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values(concat("for_4_",UUID()));
+insert into t1 select "yesterday_5_";
+create temporary table tmp(a char(100));
+insert into tmp values("see_6_");
+set binlog_format=statement;
+ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
+insert into t1 select * from tmp;
+drop temporary table tmp;
+set binlog_format=statement;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+ROW STATEMENT
+set global binlog_format=statement;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+STATEMENT STATEMENT
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_7_";
+insert into t1 values("work_8_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_9_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values("for_10_");
+insert into t1 select "yesterday_11_";
+set binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+STATEMENT STATEMENT
+set global binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+STATEMENT STATEMENT
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_12_";
+insert into t1 values("work_13_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_14_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values("for_15_");
+insert into t1 select "yesterday_16_";
+set global binlog_format=mixed;
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+MIXED STATEMENT
+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(),?)';
+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_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values(concat("for_20_",UUID()));
+insert into t1 select "yesterday_21_";
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_22_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values(concat("for_23_",UUID()));
+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 t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
+Warnings:
+Warning 1292 Incorrect datetime value: '3'
+insert into t5 select UUID() 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 select "yesterday_27_";
+end|
+create procedure foo2()
+begin
+insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values("work_29_");
+insert into t1 values(concat("for_30_",UUID()));
+set session binlog_format=row; # accepted for stored procs
+insert into t1 values("more work_31_");
+set session binlog_format=mixed;
+end|
+create function foo3() returns bigint unsigned
+begin
+set session binlog_format=row; # rejected for stored funcs
+insert into t1 values("alarm");
+return 100;
+end|
+create procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end|
+call foo();
+call foo2();
+call foo4("hello");
+call foo4(UUID());
+call foo4("world");
+select foo3();
+ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
+select * from t1 where a="alarm";
+a
+drop function foo3;
+create function foo3() returns bigint unsigned
+begin
+insert into t1 values("foo3_32_");
+call foo();
+return 100;
+end|
+insert into t2 select foo3();
+prepare stmt1 from 'insert into t2 select foo3()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+create function foo4() returns bigint unsigned
+begin
+insert into t2 select foo3();
+return 100;
+end|
+select foo4();
+foo4()
+100
+prepare stmt1 from 'select foo4()';
+execute stmt1;
+foo4()
+100
+execute stmt1;
+foo4()
+100
+deallocate prepare stmt1;
+create function foo5() returns bigint unsigned
+begin
+insert into t2 select UUID();
+return 100;
+end|
+select foo5();
+foo5()
+100
+prepare stmt1 from 'select foo5()';
+execute stmt1;
+foo5()
+100
+execute stmt1;
+foo5()
+100
+deallocate prepare stmt1;
+create function foo6(x varchar(100)) returns bigint unsigned
+begin
+insert into t2 select x;
+return 100;
+end|
+select foo6("foo6_1_");
+foo6("foo6_1_")
+100
+select foo6(concat("foo6_2_",UUID()));
+foo6(concat("foo6_2_",UUID()))
+100
+prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+execute stmt1;
+foo6(concat("foo6_3_",UUID()))
+100
+execute stmt1;
+foo6(concat("foo6_3_",UUID()))
+100
+deallocate prepare stmt1;
+create view v1 as select uuid();
+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');
+prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+create trigger t11_bi before insert on t11 for each row
+begin
+set NEW.data = concat(NEW.data,UUID());
+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("delay_6_");
+insert delayed into t2 values(rand());
+set @a=2.345;
+insert delayed into t2 values(@a);
+create table t20 select * from t1;
+create table t21 select * from t2;
+create table t22 select * from t3;
+drop table t1,t2,t3;
+create table t1 (a int primary key auto_increment, b varchar(100));
+create table t2 (a int primary key auto_increment, b varchar(100));
+create table t3 (b varchar(100));
+create function f (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+insert into t2 values(null,x);
+return 1;
+end|
+select f("try_41_");
+f("try_41_")
+1
+use mysqltest1;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+select f("try_42_");
+f("try_42_")
+1
+insert into t2 values(3,null),(4,null);
+delete from t2 where a>=3;
+prepare stmt1 from 'select f(?)';
+set @string="try_43_";
+insert into t1 values(null,"try_44_");
+execute stmt1 using @string;
+f(?)
+1
+deallocate prepare stmt1;
+create table t12 select * from t1;
+drop table t1;
+create table t1 (a int, b varchar(100), key(a));
+select f("try_45_");
+f("try_45_")
+1
+create table t13 select * from t1;
+drop table t1;
+create table t1 (a int primary key auto_increment, b varchar(100));
+drop function f;
+create table t14 (unique (a)) select * from t2;
+truncate table t2;
+create function f1 (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+return 1;
+end|
+create function f2 (x varchar(100)) returns int deterministic
+begin
+insert into t2 values(null,x);
+return 1;
+end|
+select f1("try_46_"),f2("try_47_");
+f1("try_46_") f2("try_47_")
+1 1
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+select f1("try_48_"),f2("try_49_");
+f1("try_48_") f2("try_49_")
+1 1
+insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
+drop function f2;
+create function f2 (x varchar(100)) returns int deterministic
+begin
+declare y int;
+insert into t1 values(null,x);
+set y = (select count(*) from t2);
+return y;
+end|
+select f1("try_53_"),f2("try_54_");
+f1("try_53_") f2("try_54_")
+1 3
+drop function f2;
+create trigger t1_bi before insert on t1 for each row
+begin
+insert into t2 values(null,"try_55_");
+end|
+insert into t1 values(null,"try_56_");
+alter table t1 modify a int, drop primary key;
+insert into t1 values(null,"try_57_");
+CREATE TEMPORARY TABLE t15 SELECT UUID();
+create table t16 like t15;
+INSERT INTO t16 SELECT * FROM t15;
+insert into t16 values("try_65_");
+drop table t15;
+insert into t16 values("try_66_");
+select count(*) from t1;
+count(*)
+7
+select count(*) from t2;
+count(*)
+5
+select count(*) from t3;
+count(*)
+1
+select count(*) from t4;
+count(*)
+29
+select count(*) from t5;
+count(*)
+58
+select count(*) from t11;
+count(*)
+8
+select count(*) from t20;
+count(*)
+66
+select count(*) from t21;
+count(*)
+19
+select count(*) from t22;
+count(*)
+2
+select count(*) from t12;
+count(*)
+4
+select count(*) from t13;
+count(*)
+1
+select count(*) from t14;
+count(*)
+4
+select count(*) from t16;
+count(*)
+3
+DROP TABLE IF EXISTS t11;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+CREATE TABLE t11 (song VARCHAR(255));
+LOCK TABLES t11 WRITE;
+SET SESSION BINLOG_FORMAT=ROW;
+INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
+UNLOCK TABLES;
+SELECT * FROM t11;
+song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
+song Careful With That Axe, Eugene
+USE mysqltest1;
+SELECT * FROM t11;
+song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
+song Careful With That Axe, Eugene
+DROP TABLE IF EXISTS t12;
+SET SESSION BINLOG_FORMAT=MIXED;
+CREATE TABLE t12 (data LONG);
+LOCK TABLES t12 WRITE;
+INSERT INTO t12 VALUES(UUID());
+UNLOCK TABLES;
+CREATE FUNCTION my_user()
+RETURNS CHAR(64)
+BEGIN
+DECLARE user CHAR(64);
+SELECT USER() INTO user;
+RETURN user;
+END $$
+CREATE FUNCTION my_current_user()
+RETURNS CHAR(64)
+BEGIN
+DECLARE user CHAR(64);
+SELECT CURRENT_USER() INTO user;
+RETURN user;
+END $$
+DROP TABLE IF EXISTS t13;
+CREATE TABLE t13 (data CHAR(64));
+INSERT INTO t13 VALUES (USER());
+INSERT INTO t13 VALUES (my_user());
+INSERT INTO t13 VALUES (CURRENT_USER());
+INSERT INTO t13 VALUES (my_current_user());
+drop database mysqltest1;
+set global binlog_format =@my_binlog_format;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
new file mode 100644
index 00000000000..cd826c6be1e
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_switch_stm_row_mixed.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync-master.opt b/mysql-test/suite/binlog_encryption/rpl_sync-master.opt
new file mode 100644
index 00000000000..04b06bfa0f2
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_sync-master.opt
@@ -0,0 +1,2 @@
+--default-storage-engine=MyISAM
+--loose-innodb-file-per-table=0
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt b/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
new file mode 100644
index 00000000000..2e8be18dbd7
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
@@ -0,0 +1,2 @@
+--sync-relay-log-info=1 --relay-log-recovery=1 --loose-innodb_file_format_check=1 --default-storage-engine=MyISAM --loose-innodb-file-per-table=0
+--skip-core-file --skip-slave-start
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync.result b/mysql-test/suite/binlog_encryption/rpl_sync.result
new file mode 100644
index 00000000000..84c100970e4
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_sync.result
@@ -0,0 +1,41 @@
+=====Configuring the enviroment=======;
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+flush tables;
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
+insert into t1(a) values(1);
+insert into t1(a) values(2);
+insert into t1(a) values(3);
+=====Inserting data on the master but without the SQL Thread being running=======;
+include/stop_slave_sql.inc
+insert into t1(a) values(4);
+insert into t1(a) values(5);
+insert into t1(a) values(6);
+=====Removing relay log files and crashing/recoverying the slave=======;
+include/stop_slave_io.inc
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+FLUSH LOGS;
+ERROR HY000: Lost connection to MySQL server during query
+include/rpl_reconnect.inc
+=====Dumping and comparing tables=======;
+include/start_slave.inc
+include/diff_tables.inc [master:t1,slave:t1]
+=====Corrupting the master.info=======;
+include/stop_slave.inc
+FLUSH LOGS;
+insert into t1(a) values(7);
+insert into t1(a) values(8);
+insert into t1(a) values(9);
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+FLUSH LOGS;
+ERROR HY000: Lost connection to MySQL server during query
+include/rpl_reconnect.inc
+=====Dumping and comparing tables=======;
+include/start_slave.inc
+include/diff_tables.inc [master:t1,slave:t1]
+=====Clean up=======;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync.test b/mysql-test/suite/binlog_encryption/rpl_sync.test
new file mode 100644
index 00000000000..189dd8220ef
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_sync.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_sync.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.cnf b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.cnf
new file mode 100644
index 00000000000..b8e22e97ae9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.cnf
@@ -0,0 +1,6 @@
+!include my.cnf
+
+[mysqld.2]
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+loose-file-key-management-filename=@ENV.MYSQLTEST_VARDIR/std_data/keys.txt
+encrypt-binlog
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.result b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.result
new file mode 100644
index 00000000000..2e9116ced2d
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.result
@@ -0,0 +1,83 @@
+include/master-slave.inc
+[connection master]
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+1
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+1
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
new file mode 100644
index 00000000000..99a70e011c4
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.cnf b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.cnf
new file mode 100644
index 00000000000..b8e22e97ae9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.cnf
@@ -0,0 +1,6 @@
+!include my.cnf
+
+[mysqld.2]
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+loose-file-key-management-filename=@ENV.MYSQLTEST_VARDIR/std_data/keys.txt
+encrypt-binlog
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.result b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.result
new file mode 100644
index 00000000000..74c287578d7
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+SET @@global.mysql56_temporal_format=false;;
+SET @@global.mysql56_temporal_format=true;;
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+0
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+1
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 33 33
+t2 1 41 41
+t3 1 50 50
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
new file mode 100644
index 00000000000..1df4a48f0a9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
@@ -0,0 +1,6 @@
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+--let $force_master_mysql56_temporal_format=false;
+--let $force_slave_mysql56_temporal_format=true;
+
+--source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.cnf b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.cnf
new file mode 100644
index 00000000000..b8e22e97ae9
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.cnf
@@ -0,0 +1,6 @@
+!include my.cnf
+
+[mysqld.2]
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+loose-file-key-management-filename=@ENV.MYSQLTEST_VARDIR/std_data/keys.txt
+encrypt-binlog
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.result b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.result
new file mode 100644
index 00000000000..cc22e00aeb1
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+SET @@global.mysql56_temporal_format=true;;
+SET @@global.mysql56_temporal_format=false;;
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+1
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+0
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 33 33
+t2 1 41 41
+t3 1 50 50
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
new file mode 100644
index 00000000000..f7436ed6fef
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
@@ -0,0 +1,4 @@
+--let $force_master_mysql56_temporal_format=true;
+--let $force_slave_mysql56_temporal_format=false;
+
+--source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_typeconv.result b/mysql-test/suite/binlog_encryption/rpl_typeconv.result
new file mode 100644
index 00000000000..813c105c7dc
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_typeconv.result
@@ -0,0 +1,540 @@
+include/master-slave.inc
+[connection master]
+set @saved_slave_type_conversions = @@global.slave_type_conversions;
+CREATE TABLE type_conversions (
+TestNo INT AUTO_INCREMENT PRIMARY KEY,
+Source TEXT,
+Target TEXT,
+Flags TEXT,
+On_Master TEXT,
+On_Slave TEXT,
+Expected TEXT,
+Compare INT,
+Error TEXT);
+SELECT @@global.slave_type_conversions;
+@@global.slave_type_conversions
+
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+SELECT @@global.slave_type_conversions;
+@@global.slave_type_conversions
+
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+@@global.slave_type_conversions
+ALL_NON_LOSSY
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+SELECT @@global.slave_type_conversions;
+@@global.slave_type_conversions
+ALL_LOSSY
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+@@global.slave_type_conversions
+ALL_LOSSY,ALL_NON_LOSSY
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT';
+ERROR 42000: Variable 'slave_type_conversions' can't be set to the value of 'NONEXISTING_BIT'
+SELECT @@global.slave_type_conversions;
+@@global.slave_type_conversions
+ALL_LOSSY,ALL_NON_LOSSY
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
+include/rpl_reset.inc
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
+include/rpl_reset.inc
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
+include/rpl_reset.inc
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
+include/rpl_reset.inc
+**** Result of conversions ****
+Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
+TINYBLOB TINYBLOB <Correct value>
+TINYBLOB BLOB <Correct error>
+TINYBLOB MEDIUMBLOB <Correct error>
+TINYBLOB LONGBLOB <Correct error>
+BLOB TINYBLOB <Correct error>
+BLOB BLOB <Correct value>
+BLOB MEDIUMBLOB <Correct error>
+BLOB LONGBLOB <Correct error>
+MEDIUMBLOB TINYBLOB <Correct error>
+MEDIUMBLOB BLOB <Correct error>
+MEDIUMBLOB MEDIUMBLOB <Correct value>
+MEDIUMBLOB LONGBLOB <Correct error>
+LONGBLOB TINYBLOB <Correct error>
+LONGBLOB BLOB <Correct error>
+LONGBLOB MEDIUMBLOB <Correct error>
+LONGBLOB LONGBLOB <Correct value>
+GEOMETRY BLOB <Correct error>
+BLOB GEOMETRY <Correct error>
+GEOMETRY GEOMETRY <Correct value>
+BIT(1) BIT(1) <Correct value>
+DATE DATE <Correct value>
+ENUM('master',' ENUM('master',' <Correct value>
+CHAR(10) ENUM('master',' <Correct error>
+CHAR(10) SET('master','s <Correct error>
+ENUM('master',' CHAR(10) <Correct error>
+SET('master','s CHAR(10) <Correct error>
+SET('master','s SET('master','s <Correct value>
+SET('master','s SET('master','s <Correct value>
+SET('0','1','2' SET('0','1','2' <Correct value>
+SET('0','1','2' SET('0','1','2' <Correct error>
+SET('0','1','2' SET('0','1','2' <Correct error>
+SET('0','1','2' SET('0','1','2' <Correct error>
+TINYINT TINYINT <Correct value>
+TINYINT SMALLINT <Correct error>
+TINYINT MEDIUMINT <Correct error>
+TINYINT INT <Correct error>
+TINYINT BIGINT <Correct error>
+SMALLINT TINYINT <Correct error>
+SMALLINT TINYINT <Correct error>
+SMALLINT TINYINT UNSIGNE <Correct error>
+SMALLINT SMALLINT <Correct value>
+SMALLINT MEDIUMINT <Correct error>
+SMALLINT INT <Correct error>
+SMALLINT BIGINT <Correct error>
+MEDIUMINT TINYINT <Correct error>
+MEDIUMINT TINYINT <Correct error>
+MEDIUMINT TINYINT UNSIGNE <Correct error>
+MEDIUMINT SMALLINT <Correct error>
+MEDIUMINT MEDIUMINT <Correct value>
+MEDIUMINT INT <Correct error>
+MEDIUMINT BIGINT <Correct error>
+INT TINYINT <Correct error>
+INT TINYINT <Correct error>
+INT TINYINT UNSIGNE <Correct error>
+INT SMALLINT <Correct error>
+INT MEDIUMINT <Correct error>
+INT INT <Correct value>
+INT BIGINT <Correct error>
+BIGINT TINYINT <Correct error>
+BIGINT SMALLINT <Correct error>
+BIGINT MEDIUMINT <Correct error>
+BIGINT INT <Correct error>
+BIGINT BIGINT <Correct value>
+CHAR(20) CHAR(20) <Correct value>
+CHAR(20) CHAR(30) <Correct error>
+CHAR(20) CHAR(10) <Correct error>
+CHAR(20) VARCHAR(20) <Correct error>
+CHAR(20) VARCHAR(30) <Correct error>
+CHAR(20) VARCHAR(10) <Correct error>
+CHAR(20) TINYTEXT <Correct error>
+CHAR(20) TEXT <Correct error>
+CHAR(20) MEDIUMTEXT <Correct error>
+CHAR(20) LONGTEXT <Correct error>
+VARCHAR(20) VARCHAR(20) <Correct value>
+VARCHAR(20) VARCHAR(30) <Correct error>
+VARCHAR(20) VARCHAR(10) <Correct error>
+VARCHAR(20) CHAR(30) <Correct error>
+VARCHAR(20) CHAR(10) <Correct error>
+VARCHAR(20) TINYTEXT <Correct error>
+VARCHAR(20) TEXT <Correct error>
+VARCHAR(20) MEDIUMTEXT <Correct error>
+VARCHAR(20) LONGTEXT <Correct error>
+VARCHAR(500) VARCHAR(500) <Correct value>
+VARCHAR(500) VARCHAR(510) <Correct error>
+VARCHAR(500) VARCHAR(255) <Correct error>
+VARCHAR(500) TINYTEXT <Correct error>
+VARCHAR(500) TEXT <Correct error>
+VARCHAR(500) MEDIUMTEXT <Correct error>
+VARCHAR(500) LONGTEXT <Correct error>
+TINYTEXT VARCHAR(500) <Correct error>
+TEXT VARCHAR(500) <Correct error>
+MEDIUMTEXT VARCHAR(500) <Correct error>
+LONGTEXT VARCHAR(500) <Correct error>
+TINYTEXT CHAR(255) <Correct error>
+TINYTEXT CHAR(250) <Correct error>
+TEXT CHAR(255) <Correct error>
+MEDIUMTEXT CHAR(255) <Correct error>
+LONGTEXT CHAR(255) <Correct error>
+TINYTEXT TINYTEXT <Correct value>
+TINYTEXT TEXT <Correct error>
+TEXT TINYTEXT <Correct error>
+DECIMAL(10,5) DECIMAL(10,5) <Correct value>
+DECIMAL(10,5) DECIMAL(10,6) <Correct error>
+DECIMAL(10,5) DECIMAL(11,5) <Correct error>
+DECIMAL(10,5) DECIMAL(11,6) <Correct error>
+DECIMAL(10,5) DECIMAL(10,4) <Correct error>
+DECIMAL(10,5) DECIMAL(9,5) <Correct error>
+DECIMAL(10,5) DECIMAL(9,4) <Correct error>
+FLOAT DECIMAL(10,5) <Correct error>
+DOUBLE DECIMAL(10,5) <Correct error>
+DECIMAL(10,5) FLOAT <Correct error>
+DECIMAL(10,5) DOUBLE <Correct error>
+FLOAT FLOAT <Correct value>
+DOUBLE DOUBLE <Correct value>
+FLOAT DOUBLE <Correct error>
+DOUBLE FLOAT <Correct error>
+BIT(5) BIT(5) <Correct value>
+BIT(5) BIT(6) <Correct error>
+BIT(6) BIT(5) <Correct error>
+BIT(5) BIT(12) <Correct error>
+BIT(12) BIT(5) <Correct error>
+TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
+BLOB TINYBLOB ALL_NON_LOSSY <Correct error>
+BLOB BLOB ALL_NON_LOSSY <Correct value>
+BLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+BLOB LONGBLOB ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB BLOB ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
+LONGBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
+GEOMETRY BLOB ALL_NON_LOSSY <Correct error>
+BLOB GEOMETRY ALL_NON_LOSSY <Correct error>
+GEOMETRY GEOMETRY ALL_NON_LOSSY <Correct value>
+BIT(1) BIT(1) ALL_NON_LOSSY <Correct value>
+DATE DATE ALL_NON_LOSSY <Correct value>
+ENUM('master',' ENUM('master',' ALL_NON_LOSSY <Correct value>
+CHAR(10) ENUM('master',' ALL_NON_LOSSY <Correct error>
+CHAR(10) SET('master','s ALL_NON_LOSSY <Correct error>
+ENUM('master',' CHAR(10) ALL_NON_LOSSY <Correct error>
+SET('master','s CHAR(10) ALL_NON_LOSSY <Correct error>
+SET('master','s SET('master','s ALL_NON_LOSSY <Correct value>
+SET('master','s SET('master','s ALL_NON_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct error>
+SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct error>
+TINYINT TINYINT ALL_NON_LOSSY <Correct value>
+TINYINT SMALLINT ALL_NON_LOSSY <Correct value>
+TINYINT MEDIUMINT ALL_NON_LOSSY <Correct value>
+TINYINT INT ALL_NON_LOSSY <Correct value>
+TINYINT BIGINT ALL_NON_LOSSY <Correct value>
+SMALLINT TINYINT ALL_NON_LOSSY <Correct error>
+SMALLINT TINYINT ALL_NON_LOSSY <Correct error>
+SMALLINT TINYINT UNSIGNE ALL_NON_LOSSY <Correct error>
+SMALLINT SMALLINT ALL_NON_LOSSY <Correct value>
+SMALLINT MEDIUMINT ALL_NON_LOSSY <Correct value>
+SMALLINT INT ALL_NON_LOSSY <Correct value>
+SMALLINT BIGINT ALL_NON_LOSSY <Correct value>
+MEDIUMINT TINYINT ALL_NON_LOSSY <Correct error>
+MEDIUMINT TINYINT ALL_NON_LOSSY <Correct error>
+MEDIUMINT TINYINT UNSIGNE ALL_NON_LOSSY <Correct error>
+MEDIUMINT SMALLINT ALL_NON_LOSSY <Correct error>
+MEDIUMINT MEDIUMINT ALL_NON_LOSSY <Correct value>
+MEDIUMINT INT ALL_NON_LOSSY <Correct value>
+MEDIUMINT BIGINT ALL_NON_LOSSY <Correct value>
+INT TINYINT ALL_NON_LOSSY <Correct error>
+INT TINYINT ALL_NON_LOSSY <Correct error>
+INT TINYINT UNSIGNE ALL_NON_LOSSY <Correct error>
+INT SMALLINT ALL_NON_LOSSY <Correct error>
+INT MEDIUMINT ALL_NON_LOSSY <Correct error>
+INT INT ALL_NON_LOSSY <Correct value>
+INT BIGINT ALL_NON_LOSSY <Correct value>
+BIGINT TINYINT ALL_NON_LOSSY <Correct error>
+BIGINT SMALLINT ALL_NON_LOSSY <Correct error>
+BIGINT MEDIUMINT ALL_NON_LOSSY <Correct error>
+BIGINT INT ALL_NON_LOSSY <Correct error>
+BIGINT BIGINT ALL_NON_LOSSY <Correct value>
+CHAR(20) CHAR(20) ALL_NON_LOSSY <Correct value>
+CHAR(20) CHAR(30) ALL_NON_LOSSY <Correct value>
+CHAR(20) CHAR(10) ALL_NON_LOSSY <Correct error>
+CHAR(20) VARCHAR(20) ALL_NON_LOSSY <Correct value>
+CHAR(20) VARCHAR(30) ALL_NON_LOSSY <Correct value>
+CHAR(20) VARCHAR(10) ALL_NON_LOSSY <Correct error>
+CHAR(20) TINYTEXT ALL_NON_LOSSY <Correct value>
+CHAR(20) TEXT ALL_NON_LOSSY <Correct value>
+CHAR(20) MEDIUMTEXT ALL_NON_LOSSY <Correct value>
+CHAR(20) LONGTEXT ALL_NON_LOSSY <Correct value>
+VARCHAR(20) VARCHAR(20) ALL_NON_LOSSY <Correct value>
+VARCHAR(20) VARCHAR(30) ALL_NON_LOSSY <Correct value>
+VARCHAR(20) VARCHAR(10) ALL_NON_LOSSY <Correct error>
+VARCHAR(20) CHAR(30) ALL_NON_LOSSY <Correct value>
+VARCHAR(20) CHAR(10) ALL_NON_LOSSY <Correct error>
+VARCHAR(20) TINYTEXT ALL_NON_LOSSY <Correct value>
+VARCHAR(20) TEXT ALL_NON_LOSSY <Correct value>
+VARCHAR(20) MEDIUMTEXT ALL_NON_LOSSY <Correct value>
+VARCHAR(20) LONGTEXT ALL_NON_LOSSY <Correct value>
+VARCHAR(500) VARCHAR(500) ALL_NON_LOSSY <Correct value>
+VARCHAR(500) VARCHAR(510) ALL_NON_LOSSY <Correct value>
+VARCHAR(500) VARCHAR(255) ALL_NON_LOSSY <Correct error>
+VARCHAR(500) TINYTEXT ALL_NON_LOSSY <Correct error>
+VARCHAR(500) TEXT ALL_NON_LOSSY <Correct value>
+VARCHAR(500) MEDIUMTEXT ALL_NON_LOSSY <Correct value>
+VARCHAR(500) LONGTEXT ALL_NON_LOSSY <Correct value>
+TINYTEXT VARCHAR(500) ALL_NON_LOSSY <Correct value>
+TEXT VARCHAR(500) ALL_NON_LOSSY <Correct error>
+MEDIUMTEXT VARCHAR(500) ALL_NON_LOSSY <Correct error>
+LONGTEXT VARCHAR(500) ALL_NON_LOSSY <Correct error>
+TINYTEXT CHAR(255) ALL_NON_LOSSY <Correct value>
+TINYTEXT CHAR(250) ALL_NON_LOSSY <Correct error>
+TEXT CHAR(255) ALL_NON_LOSSY <Correct error>
+MEDIUMTEXT CHAR(255) ALL_NON_LOSSY <Correct error>
+LONGTEXT CHAR(255) ALL_NON_LOSSY <Correct error>
+TINYTEXT TINYTEXT ALL_NON_LOSSY <Correct value>
+TINYTEXT TEXT ALL_NON_LOSSY <Correct value>
+TEXT TINYTEXT ALL_NON_LOSSY <Correct error>
+DECIMAL(10,5) DECIMAL(10,5) ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(10,6) ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(11,5) ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(11,6) ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(10,4) ALL_NON_LOSSY <Correct error>
+DECIMAL(10,5) DECIMAL(9,5) ALL_NON_LOSSY <Correct error>
+DECIMAL(10,5) DECIMAL(9,4) ALL_NON_LOSSY <Correct error>
+FLOAT DECIMAL(10,5) ALL_NON_LOSSY <Correct error>
+DOUBLE DECIMAL(10,5) ALL_NON_LOSSY <Correct error>
+DECIMAL(10,5) FLOAT ALL_NON_LOSSY <Correct error>
+DECIMAL(10,5) DOUBLE ALL_NON_LOSSY <Correct error>
+FLOAT FLOAT ALL_NON_LOSSY <Correct value>
+DOUBLE DOUBLE ALL_NON_LOSSY <Correct value>
+FLOAT DOUBLE ALL_NON_LOSSY <Correct value>
+DOUBLE FLOAT ALL_NON_LOSSY <Correct error>
+BIT(5) BIT(5) ALL_NON_LOSSY <Correct value>
+BIT(5) BIT(6) ALL_NON_LOSSY <Correct value>
+BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
+BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
+BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
+TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
+TINYBLOB BLOB ALL_LOSSY <Correct error>
+TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
+TINYBLOB LONGBLOB ALL_LOSSY <Correct error>
+BLOB TINYBLOB ALL_LOSSY <Correct value>
+BLOB BLOB ALL_LOSSY <Correct value>
+BLOB MEDIUMBLOB ALL_LOSSY <Correct error>
+BLOB LONGBLOB ALL_LOSSY <Correct error>
+MEDIUMBLOB TINYBLOB ALL_LOSSY <Correct value>
+MEDIUMBLOB BLOB ALL_LOSSY <Correct value>
+MEDIUMBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
+MEDIUMBLOB LONGBLOB ALL_LOSSY <Correct error>
+LONGBLOB TINYBLOB ALL_LOSSY <Correct value>
+LONGBLOB BLOB ALL_LOSSY <Correct value>
+LONGBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
+LONGBLOB LONGBLOB ALL_LOSSY <Correct value>
+GEOMETRY BLOB ALL_LOSSY <Correct error>
+BLOB GEOMETRY ALL_LOSSY <Correct error>
+GEOMETRY GEOMETRY ALL_LOSSY <Correct value>
+BIT(1) BIT(1) ALL_LOSSY <Correct value>
+DATE DATE ALL_LOSSY <Correct value>
+ENUM('master',' ENUM('master',' ALL_LOSSY <Correct value>
+CHAR(10) ENUM('master',' ALL_LOSSY <Correct error>
+CHAR(10) SET('master','s ALL_LOSSY <Correct error>
+ENUM('master',' CHAR(10) ALL_LOSSY <Correct error>
+SET('master','s CHAR(10) ALL_LOSSY <Correct error>
+SET('master','s SET('master','s ALL_LOSSY <Correct value>
+SET('master','s SET('master','s ALL_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct error>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
+TINYINT TINYINT ALL_LOSSY <Correct value>
+TINYINT SMALLINT ALL_LOSSY <Correct error>
+TINYINT MEDIUMINT ALL_LOSSY <Correct error>
+TINYINT INT ALL_LOSSY <Correct error>
+TINYINT BIGINT ALL_LOSSY <Correct error>
+SMALLINT TINYINT ALL_LOSSY <Correct value>
+SMALLINT TINYINT ALL_LOSSY <Correct value>
+SMALLINT TINYINT UNSIGNE ALL_LOSSY <Correct value>
+SMALLINT SMALLINT ALL_LOSSY <Correct value>
+SMALLINT MEDIUMINT ALL_LOSSY <Correct error>
+SMALLINT INT ALL_LOSSY <Correct error>
+SMALLINT BIGINT ALL_LOSSY <Correct error>
+MEDIUMINT TINYINT ALL_LOSSY <Correct value>
+MEDIUMINT TINYINT ALL_LOSSY <Correct value>
+MEDIUMINT TINYINT UNSIGNE ALL_LOSSY <Correct value>
+MEDIUMINT SMALLINT ALL_LOSSY <Correct value>
+MEDIUMINT MEDIUMINT ALL_LOSSY <Correct value>
+MEDIUMINT INT ALL_LOSSY <Correct error>
+MEDIUMINT BIGINT ALL_LOSSY <Correct error>
+INT TINYINT ALL_LOSSY <Correct value>
+INT TINYINT ALL_LOSSY <Correct value>
+INT TINYINT UNSIGNE ALL_LOSSY <Correct value>
+INT SMALLINT ALL_LOSSY <Correct value>
+INT MEDIUMINT ALL_LOSSY <Correct value>
+INT INT ALL_LOSSY <Correct value>
+INT BIGINT ALL_LOSSY <Correct error>
+BIGINT TINYINT ALL_LOSSY <Correct value>
+BIGINT SMALLINT ALL_LOSSY <Correct value>
+BIGINT MEDIUMINT ALL_LOSSY <Correct value>
+BIGINT INT ALL_LOSSY <Correct value>
+BIGINT BIGINT ALL_LOSSY <Correct value>
+CHAR(20) CHAR(20) ALL_LOSSY <Correct value>
+CHAR(20) CHAR(30) ALL_LOSSY <Correct error>
+CHAR(20) CHAR(10) ALL_LOSSY <Correct value>
+CHAR(20) VARCHAR(20) ALL_LOSSY <Correct error>
+CHAR(20) VARCHAR(30) ALL_LOSSY <Correct error>
+CHAR(20) VARCHAR(10) ALL_LOSSY <Correct value>
+CHAR(20) TINYTEXT ALL_LOSSY <Correct error>
+CHAR(20) TEXT ALL_LOSSY <Correct error>
+CHAR(20) MEDIUMTEXT ALL_LOSSY <Correct error>
+CHAR(20) LONGTEXT ALL_LOSSY <Correct error>
+VARCHAR(20) VARCHAR(20) ALL_LOSSY <Correct value>
+VARCHAR(20) VARCHAR(30) ALL_LOSSY <Correct error>
+VARCHAR(20) VARCHAR(10) ALL_LOSSY <Correct value>
+VARCHAR(20) CHAR(30) ALL_LOSSY <Correct error>
+VARCHAR(20) CHAR(10) ALL_LOSSY <Correct value>
+VARCHAR(20) TINYTEXT ALL_LOSSY <Correct error>
+VARCHAR(20) TEXT ALL_LOSSY <Correct error>
+VARCHAR(20) MEDIUMTEXT ALL_LOSSY <Correct error>
+VARCHAR(20) LONGTEXT ALL_LOSSY <Correct error>
+VARCHAR(500) VARCHAR(500) ALL_LOSSY <Correct value>
+VARCHAR(500) VARCHAR(510) ALL_LOSSY <Correct error>
+VARCHAR(500) VARCHAR(255) ALL_LOSSY <Correct value>
+VARCHAR(500) TINYTEXT ALL_LOSSY <Correct value>
+VARCHAR(500) TEXT ALL_LOSSY <Correct error>
+VARCHAR(500) MEDIUMTEXT ALL_LOSSY <Correct error>
+VARCHAR(500) LONGTEXT ALL_LOSSY <Correct error>
+TINYTEXT VARCHAR(500) ALL_LOSSY <Correct error>
+TEXT VARCHAR(500) ALL_LOSSY <Correct value>
+MEDIUMTEXT VARCHAR(500) ALL_LOSSY <Correct value>
+LONGTEXT VARCHAR(500) ALL_LOSSY <Correct value>
+TINYTEXT CHAR(255) ALL_LOSSY <Correct error>
+TINYTEXT CHAR(250) ALL_LOSSY <Correct value>
+TEXT CHAR(255) ALL_LOSSY <Correct value>
+MEDIUMTEXT CHAR(255) ALL_LOSSY <Correct value>
+LONGTEXT CHAR(255) ALL_LOSSY <Correct value>
+TINYTEXT TINYTEXT ALL_LOSSY <Correct value>
+TINYTEXT TEXT ALL_LOSSY <Correct error>
+TEXT TINYTEXT ALL_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(10,5) ALL_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(10,6) ALL_LOSSY <Correct error>
+DECIMAL(10,5) DECIMAL(11,5) ALL_LOSSY <Correct error>
+DECIMAL(10,5) DECIMAL(11,6) ALL_LOSSY <Correct error>
+DECIMAL(10,5) DECIMAL(10,4) ALL_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(9,5) ALL_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(9,4) ALL_LOSSY <Correct value>
+FLOAT DECIMAL(10,5) ALL_LOSSY <Correct value>
+DOUBLE DECIMAL(10,5) ALL_LOSSY <Correct value>
+DECIMAL(10,5) FLOAT ALL_LOSSY <Correct value>
+DECIMAL(10,5) DOUBLE ALL_LOSSY <Correct value>
+FLOAT FLOAT ALL_LOSSY <Correct value>
+DOUBLE DOUBLE ALL_LOSSY <Correct value>
+FLOAT DOUBLE ALL_LOSSY <Correct error>
+DOUBLE FLOAT ALL_LOSSY <Correct value>
+BIT(5) BIT(5) ALL_LOSSY <Correct value>
+BIT(5) BIT(6) ALL_LOSSY <Correct error>
+BIT(6) BIT(5) ALL_LOSSY <Correct value>
+BIT(5) BIT(12) ALL_LOSSY <Correct error>
+BIT(12) BIT(5) ALL_LOSSY <Correct value>
+TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+GEOMETRY BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct error>
+BLOB GEOMETRY ALL_LOSSY,ALL_NON_LOSSY <Correct error>
+GEOMETRY GEOMETRY ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIT(1) BIT(1) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DATE DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+ENUM('master',' ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(10) ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY <Correct error>
+CHAR(10) SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct error>
+ENUM('master',' CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct error>
+SET('master','s CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct error>
+SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SMALLINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SMALLINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SMALLINT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SMALLINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SMALLINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SMALLINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+SMALLINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMINT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+INT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+INT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+INT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+INT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+INT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+INT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+INT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIGINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIGINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIGINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIGINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIGINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) CHAR(20) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) CHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) VARCHAR(20) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) VARCHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) VARCHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+CHAR(20) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) VARCHAR(20) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) VARCHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) VARCHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) CHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(20) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(500) VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(500) VARCHAR(510) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(500) VARCHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(500) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(500) TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(500) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+VARCHAR(500) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYTEXT CHAR(250) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYTEXT TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYTEXT TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TEXT TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(10,6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(11,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(11,6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(10,4) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(9,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DECIMAL(9,4) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+FLOAT DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DOUBLE DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) FLOAT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DECIMAL(10,5) DOUBLE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+FLOAT FLOAT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DOUBLE DOUBLE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+FLOAT DOUBLE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DOUBLE FLOAT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIT(5) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIT(5) BIT(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+DROP TABLE type_conversions;
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
+DROP TABLE t1;
+set global slave_type_conversions = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_typeconv.test b/mysql-test/suite/binlog_encryption/rpl_typeconv.test
new file mode 100644
index 00000000000..4dbfc27d088
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/rpl_typeconv.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_typeconv.inc
diff --git a/mysql-test/suite/binlog_encryption/suite.pm b/mysql-test/suite/binlog_encryption/suite.pm
new file mode 100644
index 00000000000..f1d5e3aaea7
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/suite.pm
@@ -0,0 +1,18 @@
+package My::Suite::BinlogEncryption;
+
+@ISA = qw(My::Suite);
+
+return "No file key management plugin" unless defined $ENV{FILE_KEY_MANAGEMENT_SO};
+
+sub skip_combinations {
+ my @combinations;
+
+ $skip{'encryption_algorithms.combinations'} = [ 'ctr' ]
+ unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
+ and $1 ge "1.0.1";
+
+ %skip;
+}
+
+bless { };
+
diff --git a/mysql-test/suite/binlog_encryption/testdata.inc b/mysql-test/suite/binlog_encryption/testdata.inc
new file mode 100644
index 00000000000..f9499112e91
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/testdata.inc
@@ -0,0 +1,207 @@
+#
+# This include file creates some basic events which should go to the binary log.
+# What happens to the binary log depends on the test which calls the file,
+# and should be checked from the test.
+#
+# Names are intentionally long and ugly, to make grepping more reliable.
+#
+# Some of events are considered unsafe for SBR (not necessarily correctly,
+# but here isn't the place to check the logic), so we just suppress the warning.
+#
+# For those few queries which produce result sets (e.g. ANALYZE, CHECKSUM etc.),
+# we don't care about the result, so it will not be printed to the output.
+
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+#
+# Some DDL
+#
+
+CREATE DATABASE database_name_to_encrypt;
+USE database_name_to_encrypt;
+
+CREATE USER user_name_to_encrypt;
+GRANT ALL ON database_name_to_encrypt.* TO user_name_to_encrypt;
+SET PASSWORD FOR user_name_to_encrypt = PASSWORD('password_to_encrypt');
+
+CREATE TABLE innodb_table_name_to_encrypt (
+ int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+ timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+ blob_column_name_to_encrypt BLOB,
+ virt_column_name_to_encrypt INT AS (int_column_name_to_encrypt % 10) VIRTUAL,
+ pers_column_name_to_encrypt INT AS (int_column_name_to_encrypt) PERSISTENT,
+ INDEX `index_name_to_encrypt`(`timestamp_column_name_to_encrypt`)
+) ENGINE=InnoDB
+ PARTITION BY RANGE (int_column_name_to_encrypt)
+ SUBPARTITION BY KEY (int_column_name_to_encrypt)
+ SUBPARTITIONS 2 (
+ PARTITION partition0_name_to_encrypt VALUES LESS THAN (100),
+ PARTITION partition1_name_to_encrypt VALUES LESS THAN (MAXVALUE)
+ )
+;
+
+CREATE TABLE myisam_table_name_to_encrypt (
+ int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+ char_column_name_to_encrypt VARCHAR(255),
+ datetime_column_name_to_encrypt DATETIME,
+ text_column_name_to_encrypt TEXT
+) ENGINE=MyISAM;
+
+CREATE TABLE aria_table_name_to_encrypt (
+ int_column_name_to_encrypt INT AUTO_INCREMENT PRIMARY KEY,
+ varchar_column_name_to_encrypt VARCHAR(1024),
+ enum_column_name_to_encrypt ENUM(
+ 'enum_value1_to_encrypt',
+ 'enum_value2_to_encrypt'
+ ),
+ timestamp_column_name_to_encrypt TIMESTAMP(6) NULL,
+ blob_column_name_to_encrypt BLOB
+) ENGINE=Aria;
+
+CREATE TRIGGER trigger_name_to_encrypt
+ AFTER INSERT ON myisam_table_name_to_encrypt FOR EACH ROW
+ INSERT INTO aria_table_name_to_encrypt (varchar_column_name_to_encrypt)
+ VALUES (NEW.char_column_name_to_encrypt);
+
+CREATE DEFINER=user_name_to_encrypt VIEW view_name_to_encrypt
+ AS SELECT * FROM innodb_table_name_to_encrypt;
+
+CREATE FUNCTION func_name_to_encrypt (func_parameter_to_encrypt INT)
+ RETURNS VARCHAR(64)
+ RETURN 'func_result_to_encrypt';
+
+--delimiter $$
+CREATE PROCEDURE proc_name_to_encrypt (
+ IN proc_in_parameter_to_encrypt CHAR(32),
+ OUT proc_out_parameter_to_encrypt INT
+)
+BEGIN
+ DECLARE procvar_name_to_encrypt CHAR(64) DEFAULT 'procvar_val_to_encrypt';
+ DECLARE cursor_name_to_encrypt CURSOR FOR
+ SELECT virt_column_name_to_encrypt FROM innodb_table_name_to_encrypt;
+ DECLARE EXIT HANDLER FOR NOT FOUND
+ BEGIN
+ SET @stmt_var_to_encrypt = CONCAT(
+ "SELECT
+ IF (RAND()>0.5,'enum_value2_to_encrypt','enum_value1_to_encrypt')
+ FROM innodb_table_name_to_encrypt
+ INTO OUTFILE '", proc_in_parameter_to_encrypt, "'");
+ PREPARE stmt_to_encrypt FROM @stmt_var_to_encrypt;
+ EXECUTE stmt_to_encrypt;
+ DEALLOCATE PREPARE stmt_to_encrypt;
+ END;
+ OPEN cursor_name_to_encrypt;
+ proc_label_to_encrypt: LOOP
+ FETCH cursor_name_to_encrypt INTO procvar_name_to_encrypt;
+ END LOOP;
+ CLOSE cursor_name_to_encrypt;
+END $$
+--delimiter ;
+
+CREATE SERVER server_name_to_encrypt
+ FOREIGN DATA WRAPPER mysql
+ OPTIONS (HOST 'host_name_to_encrypt');
+
+--let $_cur_con= $CURRENT_CONNECTION
+--connect (con1,localhost,user_name_to_encrypt,password_to_encrypt,database_name_to_encrypt)
+CREATE TEMPORARY TABLE tmp_table_name_to_encrypt (
+ float_column_name_to_encrypt FLOAT,
+ binary_column_name_to_encrypt BINARY(64)
+);
+--disconnect con1
+--connection $_cur_con
+
+CREATE INDEX index_name_to_encrypt
+ ON myisam_table_name_to_encrypt (datetime_column_name_to_encrypt);
+
+ALTER DATABASE database_name_to_encrypt CHARACTER SET utf8;
+
+ALTER TABLE innodb_table_name_to_encrypt
+ MODIFY timestamp_column_name_to_encrypt TIMESTAMP NOT NULL
+ DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+;
+
+ALTER ALGORITHM=MERGE VIEW view_name_to_encrypt
+ AS SELECT * FROM innodb_table_name_to_encrypt;
+
+RENAME TABLE innodb_table_name_to_encrypt TO new_table_name_to_encrypt;
+ALTER TABLE new_table_name_to_encrypt RENAME TO innodb_table_name_to_encrypt;
+
+#
+# Some DML
+#
+
+--disable_warnings
+
+set @user_var1_to_encrypt= 'dyncol1_val_to_encrypt';
+set @user_var2_to_encrypt= 'dyncol2_name_to_encrypt';
+
+INSERT INTO view_name_to_encrypt VALUES
+ (1, NOW(6), COLUMN_CREATE('dyncol1_name_to_encrypt',@user_var1_to_encrypt), NULL, NULL),
+ (2, NOW(6), COLUMN_CREATE(@user_var2_to_encrypt,'dyncol2_val_to_encrypt'), NULL, NULL)
+;
+--delimiter $$
+BEGIN NOT ATOMIC
+ DECLARE counter_name_to_encrypt INT DEFAULT 0;
+ START TRANSACTION;
+ WHILE counter_name_to_encrypt<12 DO
+ INSERT INTO innodb_table_name_to_encrypt
+ SELECT NULL, NOW(6), blob_column_name_to_encrypt, NULL, NULL
+ FROM innodb_table_name_to_encrypt
+ ORDER BY int_column_name_to_encrypt;
+ SET counter_name_to_encrypt = counter_name_to_encrypt+1;
+ END WHILE;
+ COMMIT;
+ END
+$$
+--delimiter ;
+
+INSERT INTO myisam_table_name_to_encrypt
+ SELECT NULL, 'char_literal_to_encrypt', NULL, 'text_to_encrypt';
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+ SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+ SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+INSERT INTO myisam_table_name_to_encrypt (char_column_name_to_encrypt)
+ SELECT char_column_name_to_encrypt FROM myisam_table_name_to_encrypt;
+
+CALL proc_name_to_encrypt('file_name_to_encrypt',@useless_var_to_encrypt);
+
+TRUNCATE TABLE aria_table_name_to_encrypt;
+
+LOAD DATA INFILE 'file_name_to_encrypt' INTO TABLE aria_table_name_to_encrypt
+ (enum_column_name_to_encrypt);
+
+--let datadir= `SELECT @@datadir`
+--replace_result $datadir <DATADIR>
+eval LOAD DATA LOCAL INFILE '$datadir/database_name_to_encrypt/file_name_to_encrypt'
+ INTO TABLE aria_table_name_to_encrypt (enum_column_name_to_encrypt);
+--remove_file $datadir/database_name_to_encrypt/file_name_to_encrypt
+
+UPDATE view_name_to_encrypt SET blob_column_name_to_encrypt =
+ COLUMN_CREATE('dyncol1_name_to_encrypt',func_name_to_encrypt(0))
+;
+
+DELETE FROM aria_table_name_to_encrypt ORDER BY int_column_name_to_encrypt LIMIT 10;
+
+--enable_warnings
+
+#
+# Other statements
+#
+
+--disable_result_log
+ANALYZE TABLE myisam_table_name_to_encrypt;
+CHECK TABLE aria_table_name_to_encrypt;
+CHECKSUM TABLE innodb_table_name_to_encrypt, myisam_table_name_to_encrypt;
+--enable_result_log
+RENAME USER user_name_to_encrypt to new_user_name_to_encrypt;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM new_user_name_to_encrypt;
+
+#
+# Cleanup
+#
+
+DROP DATABASE database_name_to_encrypt;
+DROP USER new_user_name_to_encrypt;
+DROP SERVER server_name_to_encrypt;
diff --git a/mysql-test/suite/binlog_encryption/testdata.opt b/mysql-test/suite/binlog_encryption/testdata.opt
new file mode 100644
index 00000000000..b0c5b9c8188
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/testdata.opt
@@ -0,0 +1 @@
+--partition
diff --git a/mysql-test/suite/csv/csv.result b/mysql-test/suite/csv/csv.result
index 8d497f52b31..5f1b380f96b 100644
--- a/mysql-test/suite/csv/csv.result
+++ b/mysql-test/suite/csv/csv.result
@@ -5493,3 +5493,57 @@ RENAME TABLE t1 TO t2;
SELECT * FROM t2;
a
DROP TABLE t2;
+#
+# MDEV-8664 - plugins.show_all_plugins --embedded fails in buildbot
+#
+CREATE TABLE t1(c1 TEXT NOT NULL, c2 TEXT NOT NULL) ENGINE=CSV IETF_QUOTES=yes;
+INSERT INTO t1 VALUES("a\"b,c","d");
+INSERT INTO t1 VALUES("d","a\"b,c");
+INSERT INTO t1 VALUES(",\"a","e");
+INSERT INTO t1 VALUES("e",",\"a");
+INSERT INTO t1 VALUES("\"","f");
+INSERT INTO t1 VALUES("f","\"");
+INSERT INTO t1 VALUES(",","g");
+INSERT INTO t1 VALUES("g",",");
+SELECT * FROM t1;
+c1 c2
+a"b,c d
+d a"b,c
+,"a e
+e ,"a
+" f
+f "
+, g
+g ,
+CSV file contents:
+"a""b,c","d"
+"d","a""b,c"
+",""a","e"
+"e",",""a"
+"""","f"
+"f",""""
+",","g"
+"g",","
+DROP TABLE t1;
+CREATE TABLE t1(c1 TEXT NOT NULL, c2 TEXT NOT NULL) ENGINE=CSV IETF_QUOTES=yes;
+Replacing t1.CSV
+SELECT * FROM t1;
+c1 c2
+a b
+a b
+a"b,c d
+d ,"a
+a", e
+e "
+, f
+ALTER TABLE t1 IETF_QUOTES=no;
+SELECT * FROM t1;
+c1 c2
+a b
+a b
+a"b,c d
+d ,"a
+a", e
+e "
+, f
+DROP TABLE t1;
diff --git a/mysql-test/suite/csv/csv.test b/mysql-test/suite/csv/csv.test
index 90617d06599..f274eea3236 100644
--- a/mysql-test/suite/csv/csv.test
+++ b/mysql-test/suite/csv/csv.test
@@ -1926,3 +1926,46 @@ move_file $MYSQLD_DATADIR/test/t1.CSV $MYSQLD_DATADIR/test/t2.CSV;
RENAME TABLE t1 TO t2;
SELECT * FROM t2;
DROP TABLE t2;
+
+--echo #
+--echo # MDEV-8664 - plugins.show_all_plugins --embedded fails in buildbot
+--echo #
+CREATE TABLE t1(c1 TEXT NOT NULL, c2 TEXT NOT NULL) ENGINE=CSV IETF_QUOTES=yes;
+
+INSERT INTO t1 VALUES("a\"b,c","d");
+INSERT INTO t1 VALUES("d","a\"b,c");
+INSERT INTO t1 VALUES(",\"a","e");
+INSERT INTO t1 VALUES("e",",\"a");
+INSERT INTO t1 VALUES("\"","f");
+INSERT INTO t1 VALUES("f","\"");
+INSERT INTO t1 VALUES(",","g");
+INSERT INTO t1 VALUES("g",",");
+
+SELECT * FROM t1;
+
+--echo CSV file contents:
+--cat_file $MYSQLD_DATADIR/test/t1.CSV
+
+DROP TABLE t1;
+
+CREATE TABLE t1(c1 TEXT NOT NULL, c2 TEXT NOT NULL) ENGINE=CSV IETF_QUOTES=yes;
+
+--echo Replacing t1.CSV
+--remove_file $MYSQLD_DATADIR/test/t1.CSV
+--write_file $MYSQLD_DATADIR/test/t1.CSV
+a,b
+"a","b"
+"a""b,c","d"
+"d",",""a"
+"a"",",e
+e,""""
+",",f
+EOF
+
+SELECT * FROM t1;
+
+ALTER TABLE t1 IETF_QUOTES=no;
+
+SELECT * FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/disabled.def b/mysql-test/suite/encryption/disabled.def
new file mode 100644
index 00000000000..abbb82d51f6
--- /dev/null
+++ b/mysql-test/suite/encryption/disabled.def
@@ -0,0 +1,15 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+
+innodb_scrub : MDEV-8139 scrubbing does not work reliably
+innodb_scrub_background : MDEV-8139 scrubbing does not work reliably
+
diff --git a/mysql-test/suite/encryption/include/have_example_key_management_plugin.inc b/mysql-test/suite/encryption/include/have_example_key_management_plugin.inc
new file mode 100644
index 00000000000..a87d3256ee0
--- /dev/null
+++ b/mysql-test/suite/encryption/include/have_example_key_management_plugin.inc
@@ -0,0 +1,4 @@
+if (!$EXAMPLE_KEY_MANAGEMENT_SO)
+{
+ --skip Needs example_key_management
+}
diff --git a/mysql-test/suite/encryption/include/have_example_key_management_plugin.opt b/mysql-test/suite/encryption/include/have_example_key_management_plugin.opt
new file mode 100644
index 00000000000..ce7f1ddef7e
--- /dev/null
+++ b/mysql-test/suite/encryption/include/have_example_key_management_plugin.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$EXAMPLE_KEY_MANAGEMENT_SO
+--loose-example-key-management
diff --git a/mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations b/mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations
new file mode 100644
index 00000000000..4f6317cdf67
--- /dev/null
+++ b/mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations
@@ -0,0 +1,11 @@
+[cbc]
+plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+loose-file-key-management
+loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+file-key-management-encryption-algorithm=aes_cbc
+
+[ctr]
+plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+loose-file-key-management
+loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+file-key-management-encryption-algorithm=aes_ctr
diff --git a/mysql-test/suite/encryption/include/have_file_key_management_plugin.inc b/mysql-test/suite/encryption/include/have_file_key_management_plugin.inc
new file mode 100644
index 00000000000..06fbb510d6b
--- /dev/null
+++ b/mysql-test/suite/encryption/include/have_file_key_management_plugin.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'file_key_management' AND PLUGIN_STATUS='ACTIVE'`)
+{
+ --skip Test requires file_key_management plugin
+}
diff --git a/mysql-test/suite/encryption/include/innodb-util.pl b/mysql-test/suite/encryption/include/innodb-util.pl
new file mode 100644
index 00000000000..241545dac18
--- /dev/null
+++ b/mysql-test/suite/encryption/include/innodb-util.pl
@@ -0,0 +1,126 @@
+#
+# Utility functions to copy files for WL#5522
+#
+# All the tables must be in the same database, you can call it like so:
+# ib_backup_tablespaces("test", "t1", "blah", ...).
+
+use File::Copy;
+use File::Spec;
+
+sub ib_normalize_path {
+ my ($path) = @_;
+}
+
+sub ib_backup_tablespace {
+ my ($db, $table) = @_;
+ my $datadir = $ENV{'MYSQLD_DATADIR'};
+ my $cfg_file = sprintf("%s.cfg", $table);
+ my $ibd_file = sprintf("%s.ibd", $table);
+ my $tmpd = $ENV{'MYSQLTEST_VARDIR'} . "/tmp";
+
+ my @args = (File::Spec->catfile($datadir, $db, $ibd_file),
+ File::Spec->catfile($tmpd, $ibd_file));
+
+ copy(@args) or die "copy @args failed: $!";
+
+ my @args = (File::Spec->catfile($datadir, $db, $cfg_file),
+ File::Spec->catfile($tmpd, $cfg_file));
+
+ copy(@args) or die "copy @args failed: $!";
+}
+
+sub ib_cleanup {
+ my ($db, $table) = @_;
+ my $datadir = $ENV{'MYSQLD_DATADIR'};
+ my $cfg_file = sprintf("%s.cfg", $table);
+
+ print "unlink: $cfg_file\n";
+
+ # These may or may not exist
+ unlink(File::Spec->catfile($datadir, $db, $cfg_file));
+}
+
+sub ib_unlink_tablespace {
+ my ($db, $table) = @_;
+ my $datadir = $ENV{'MYSQLD_DATADIR'};
+ my $ibd_file = sprintf("%s.ibd", $table);
+
+ print "unlink: $ibd_file\n";
+ # This may or may not exist
+ unlink(File::Spec->catfile($datadir, $db, $ibd_file));
+
+ ib_cleanup($db, $table);
+}
+
+sub ib_backup_tablespaces {
+ my ($db, @tables) = @_;
+
+ foreach my $table (@tables) {
+ print "backup: $table\n";
+ ib_backup_tablespace($db, $table);
+ }
+}
+
+sub ib_discard_tablespace { }
+
+sub ib_discard_tablespaces { }
+
+sub ib_restore_cfg_file {
+ my ($tmpd, $datadir, $db, $table) = @_;
+ my $cfg_file = sprintf("%s.cfg", $table);
+
+ my @args = (File::Spec->catfile($tmpd, $cfg_file),
+ File::Spec->catfile($datadir, "$db", $cfg_file));
+
+ copy(@args) or die "copy @args failed: $!";
+}
+
+sub ib_restore_ibd_file {
+ my ($tmpd, $datadir, $db, $table) = @_;
+ my $ibd_file = sprintf("%s.ibd", $table);
+
+ my @args = (File::Spec->catfile($tmpd, $ibd_file),
+ File::Spec->catfile($datadir, $db, $ibd_file));
+
+ copy(@args) or die "copy @args failed: $!";
+}
+
+sub ib_restore_tablespace {
+ my ($db, $table) = @_;
+ my $datadir = $ENV{'MYSQLD_DATADIR'};
+ my $tmpd = $ENV{'MYSQLTEST_VARDIR'} . "/tmp";
+
+ ib_restore_cfg_file($tmpd, $datadir, $db, $table);
+ ib_restore_ibd_file($tmpd, $datadir, $db, $table);
+}
+
+sub ib_restore_tablespaces {
+ my ($db, @tables) = @_;
+
+ foreach my $table (@tables) {
+ print "restore: $table .ibd and .cfg files\n";
+ ib_restore_tablespace($db, $table);
+ }
+}
+
+sub ib_restore_cfg_files {
+ my ($db, @tables) = @_;
+ my $datadir = $ENV{'MYSQLD_DATADIR'};
+ my $tmpd = $ENV{'MYSQLTEST_VARDIR'} . "/tmp";
+
+ foreach my $table (@tables) {
+ print "restore: $table .cfg file\n";
+ ib_restore_cfg_file($tmpd, $datadir, $db, $table);
+ }
+}
+
+sub ib_restore_ibd_files {
+ my ($db, @tables) = @_;
+ my $datadir = $ENV{'MYSQLD_DATADIR'};
+ my $tmpd = $ENV{'MYSQLTEST_VARDIR'} . "/tmp";
+
+ foreach my $table (@tables) {
+ print "restore: $table .ibd file\n";
+ ib_restore_ibd_file($tmpd, $datadir, $db, $table);
+ }
+}
diff --git a/mysql-test/suite/encryption/r/aria_tiny.result b/mysql-test/suite/encryption/r/aria_tiny.result
new file mode 100644
index 00000000000..b0f8bac7c32
--- /dev/null
+++ b/mysql-test/suite/encryption/r/aria_tiny.result
@@ -0,0 +1,5 @@
+set global aria_encrypt_tables = 1;
+create table t1 (i int, key(i)) engine=aria;
+insert into t1 values (1);
+drop table t1;
+set global aria_encrypt_tables = 0;
diff --git a/mysql-test/suite/encryption/r/create_or_replace.result b/mysql-test/suite/encryption/r/create_or_replace.result
new file mode 100644
index 00000000000..54d41972e7c
--- /dev/null
+++ b/mysql-test/suite/encryption/r/create_or_replace.result
@@ -0,0 +1,21 @@
+SET default_storage_engine = InnoDB;
+CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
+CREATE TABLE t2 AS SELECT * FROM t1;
+drop table t1,t2;
+SET GLOBAL innodb_encryption_threads = 0;
+SET GLOBAL innodb_encryption_threads = 4;
+CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
+INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);
+CREATE TABLE `table1_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int,key (`col_int_key` ), primary key (pk)) engine=innodb;
+CREATE TABLE `table0_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
+INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
+INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
+INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
+INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
+drop table if exists create_or_replace_t, table1_int_autoinc, table0_int_autoinc, table10_int_autoinc;
+SET GLOBAL innodb_encrypt_tables = OFF;
+SET GLOBAL innodb_encryption_threads = 4;
+# Wait max 10 min for key encryption threads to decrypt all spaces
+# Success!
+SET GLOBAL innodb_encryption_threads = 0;
+SET GLOBAL innodb_encrypt_tables = OFF;
diff --git a/mysql-test/suite/encryption/r/debug_key_management.result b/mysql-test/suite/encryption/r/debug_key_management.result
new file mode 100644
index 00000000000..02e05b4d221
--- /dev/null
+++ b/mysql-test/suite/encryption/r/debug_key_management.result
@@ -0,0 +1,17 @@
+set global innodb_encrypt_tables=ON;
+show variables like 'innodb_encrypt%';
+Variable_name Value
+innodb_encrypt_log ON
+innodb_encrypt_tables ON
+innodb_encryption_rotate_key_age 2
+innodb_encryption_rotation_iops 100
+innodb_encryption_threads 4
+select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 1;
+count(*)
+0
+set global debug_key_management_version=10;
+select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 10;
+count(*)
+0
+set global innodb_encrypt_tables=OFF;
+set global debug_key_management_version=1;
diff --git a/mysql-test/suite/encryption/r/encrypt_and_grep.result b/mysql-test/suite/encryption/r/encrypt_and_grep.result
new file mode 100644
index 00000000000..e11d8183ec4
--- /dev/null
+++ b/mysql-test/suite/encryption/r/encrypt_and_grep.result
@@ -0,0 +1,74 @@
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_file_format = `Barracuda`;
+create table t1 (a varchar(255)) engine=innodb encrypted=yes;
+create table t2 (a varchar(255)) engine=innodb;
+show warnings;
+Level Code Message
+create table t3 (a varchar(255)) engine=innodb encrypted=no;
+insert t1 values (repeat('foobarsecret', 22));
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+insert t2 values (repeat('tempsecret', 22));
+insert t3 values (repeat('dummysecret', 22));
+# Wait max 10 min for key encryption threads to encrypt all spaces
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+test/t3
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+test/t1
+test/t2
+./ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobarsecret/ in t1.ibd
+# t2 ... on expecting NOT FOUND
+NOT FOUND /tempsecret/ in t2.ibd
+# t3 no on expecting FOUND
+FOUND /dummysecret/ in t3.ibd
+# ibdata1 expecting NOT FOUND
+NOT FOUND /foobarsecret/ in ibdata1
+# Now turn off encryption and wait for threads to decrypt everything
+SET GLOBAL innodb_encrypt_tables = off;
+# Wait max 10 min for key encryption threads to decrypt all spaces
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+test/t2
+test/t3
+./ibdata1
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+test/t1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobarsecret/ in t1.ibd
+# t2 ... default expecting FOUND
+FOUND /tempsecret/ in t2.ibd
+# t3 no on expecting FOUND
+FOUND /dummysecret/ in t3.ibd
+# ibdata1 expecting NOT FOUND
+NOT FOUND /foobarsecret/ in ibdata1
+# Now turn on encryption and wait for threads to encrypt all spaces
+SET GLOBAL innodb_encrypt_tables = on;
+# Wait max 10 min for key encryption threads to encrypt all spaces
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+test/t3
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+test/t1
+test/t2
+./ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobarsecret/ in t1.ibd
+# t2 ... on expecting NOT FOUND
+NOT FOUND /tempsecret/ in t2.ibd
+# t3 no on expecting FOUND
+FOUND /dummysecret/ in t3.ibd
+# ibdata1 expecting NOT FOUND
+NOT FOUND /foobarsecret/ in ibdata1
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/encryption/r/encryption_force.result b/mysql-test/suite/encryption/r/encryption_force.result
new file mode 100644
index 00000000000..9d42b360e7c
--- /dev/null
+++ b/mysql-test/suite/encryption/r/encryption_force.result
@@ -0,0 +1,60 @@
+select @@innodb_encrypt_tables;
+@@innodb_encrypt_tables
+FORCE
+create table t1 (a int) engine=innodb encrypted=yes;
+create table t2 (a int) engine=innodb encrypted=default;
+create table t3 (a int) engine=innodb encrypted=no;
+ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options")
+create table t4 (a int) engine=innodb encrypted=yes partition by hash(a) partitions 2;
+create table t5 (a int) engine=innodb encrypted=no partition by hash(a) partitions 2;
+ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
+set global innodb_encrypt_tables='ON';
+create table t3 (a int) engine=innodb encrypted=no;
+set global innodb_encrypt_tables='FORCE';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=no
+show create table t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 2 */
+alter table t1 encrypted=no;
+ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED'
+alter table t2 encrypted=yes;
+alter table t3 encrypted=default;
+alter table t4 encrypted=no;
+ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
+drop table t2;
+drop table t3;
+drop table t4;
diff --git a/mysql-test/suite/encryption/r/filekeys_emptyfile.result b/mysql-test/suite/encryption/r/filekeys_emptyfile.result
new file mode 100644
index 00000000000..f94f11d9f08
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_emptyfile.result
@@ -0,0 +1,10 @@
+call mtr.add_suppression("System key id 1 is missing at");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /System key id 1 is missing at/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+# Test checks if opening an empty filekeys does not crash the server.
diff --git a/mysql-test/suite/encryption/r/filekeys_encfile.result b/mysql-test/suite/encryption/r/filekeys_encfile.result
new file mode 100644
index 00000000000..6d5baa1b7ff
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_encfile.result
@@ -0,0 +1,38 @@
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=1
+insert t1 values (12345, repeat('1234567890', 20));
+alter table t1 encryption_key_id=2;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
+alter table t1 encryption_key_id=3;
+ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
+alter table t1 encryption_key_id=33;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=33
+alter table t1 encryption_key_id=4;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
+drop table t1;
diff --git a/mysql-test/suite/encryption/r/filekeys_encfile_bad.result b/mysql-test/suite/encryption/r/filekeys_encfile_bad.result
new file mode 100644
index 00000000000..6261bd459b8
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_encfile_bad.result
@@ -0,0 +1,9 @@
+call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
diff --git a/mysql-test/suite/encryption/r/filekeys_encfile_badfile.result b/mysql-test/suite/encryption/r/filekeys_encfile_badfile.result
new file mode 100644
index 00000000000..98e2266f3f2
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_encfile_badfile.result
@@ -0,0 +1,9 @@
+call mtr.add_suppression("File 'bad' not found");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /File 'bad' not found/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
diff --git a/mysql-test/suite/encryption/r/filekeys_encfile_file.result b/mysql-test/suite/encryption/r/filekeys_encfile_file.result
new file mode 100644
index 00000000000..6d5baa1b7ff
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_encfile_file.result
@@ -0,0 +1,38 @@
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=1
+insert t1 values (12345, repeat('1234567890', 20));
+alter table t1 encryption_key_id=2;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
+alter table t1 encryption_key_id=3;
+ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
+alter table t1 encryption_key_id=33;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=33
+alter table t1 encryption_key_id=4;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
+drop table t1;
diff --git a/mysql-test/suite/encryption/r/filekeys_encfile_no.result b/mysql-test/suite/encryption/r/filekeys_encfile_no.result
new file mode 100644
index 00000000000..6261bd459b8
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_encfile_no.result
@@ -0,0 +1,9 @@
+call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
diff --git a/mysql-test/suite/encryption/r/filekeys_nofile.result b/mysql-test/suite/encryption/r/filekeys_nofile.result
new file mode 100644
index 00000000000..690f2e61df0
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_nofile.result
@@ -0,0 +1,9 @@
+call mtr.add_suppression("file-key-management-filename is not set");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /file-key-management-filename is not set/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
diff --git a/mysql-test/suite/encryption/r/filekeys_syntax.result b/mysql-test/suite/encryption/r/filekeys_syntax.result
new file mode 100644
index 00000000000..a64d21eedbe
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_syntax.result
@@ -0,0 +1,149 @@
+call mtr.add_suppression("File '.*keys.txt' not found");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /File '.*keys.txt' not found/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+install soname 'file_key_management';
+ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 2
+call mtr.add_suppression("File '.*keys.txt' not found");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /File '.*keys.txt' not found/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+call mtr.add_suppression("Invalid key id");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key id/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+install soname 'file_key_management';
+ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 10
+call mtr.add_suppression("Invalid key id");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key id/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+call mtr.add_suppression("Invalid key id");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key id/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+install soname 'file_key_management';
+ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 47
+call mtr.add_suppression("Invalid key id");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key id/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+call mtr.add_suppression("Invalid key");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+install soname 'file_key_management';
+ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 33
+call mtr.add_suppression("Invalid key");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+call mtr.add_suppression("Invalid key");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+install soname 'file_key_management';
+ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 2
+call mtr.add_suppression("Invalid key");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Invalid key/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+call mtr.add_suppression("Syntax error");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Syntax error/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+install soname 'file_key_management';
+ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 1
+call mtr.add_suppression("Syntax error");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Syntax error/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+call mtr.add_suppression("Syntax error");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Syntax error/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+install soname 'file_key_management';
+ERROR HY000: System key id 1 is missing at MYSQL_TMP_DIR/keys.txt line 1, column 1
+call mtr.add_suppression("Syntax error");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Syntax error/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+call mtr.add_suppression("System key id 1");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /System key id 1/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
diff --git a/mysql-test/suite/encryption/r/filekeys_tooshort.result b/mysql-test/suite/encryption/r/filekeys_tooshort.result
new file mode 100644
index 00000000000..efa66097563
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_tooshort.result
@@ -0,0 +1,10 @@
+call mtr.add_suppression("Cannot decrypt .*tooshort.enc. Not encrypted");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Cannot decrypt .*tooshort.enc. Not encrypted/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+# Test checks if opening an too short filekeys does not crash the server.
diff --git a/mysql-test/suite/encryption/r/filekeys_unencfile.result b/mysql-test/suite/encryption/r/filekeys_unencfile.result
new file mode 100644
index 00000000000..1b9c092a713
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_unencfile.result
@@ -0,0 +1,9 @@
+call mtr.add_suppression("Cannot decrypt .*keys.txt. Not encrypted");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /Cannot decrypt .*keys.txt. Not encrypted/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
diff --git a/mysql-test/suite/encryption/r/innochecksum.result b/mysql-test/suite/encryption/r/innochecksum.result
new file mode 100644
index 00000000000..6ea54f3d053
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innochecksum.result
@@ -0,0 +1,45 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+# Create and populate a tables
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=NO;
+CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
+CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
+# Write file to make mysql-test-run.pl expect the "crash", but don't
+# start it until it's told to
+# We give 30 seconds to do a clean shutdown because we do not want
+# to redo apply the pages of t1.ibd at the time of recovery.
+# We want SQL to initiate the first access to t1.ibd.
+# Wait until disconnected.
+# Run innochecksum on t1
+# Run innochecksum on t2
+# Run innochecksum on t3
+# Run innochecksum on t4
+# Run innochecksum on t4
+# Run innochecksum on t5
+# Run innochecksum on t6
+# Backup tables before corrupting
+# Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+# Run innochecksum on t2
+# Run innochecksum on t3
+# no encryption corrupting the field should not have effect
+# Run innochecksum on t6
+# no encryption corrupting the field should not have effect
+# Restore the original tables
+# Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION+4 (post encryption checksum)
+# Run innochecksum on t2
+# Run innochecksum on t3
+# Run innochecksum on t6
+# no encryption corrupting the field should not have effect
+# Restore the original tables
+# Corrupt FIL_DATA+10 (data)
+# Run innochecksum on t2
+# Run innochecksum on t3
+# Run innochecksum on t6
+# Restore the original tables
+# Write file to make mysql-test-run.pl start up the server again
+# Cleanup
+DROP TABLE t1, t2, t3, t4, t5, t6;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
new file mode 100644
index 00000000000..4e4fd89d1ae
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -0,0 +1,116 @@
+call mtr.add_suppression("InnoDB: The page .*");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* ");
+call mtr.add_suppression("Plugin 'file_key_management' .*");
+call mtr.add_suppression("mysqld: File .*");
+
+# Start server with keys2.txt
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
+INSERT INTO t1 VALUES ('foobar');
+ALTER TABLE t1 ADD COLUMN c2 INT;
+INSERT INTO t1 VALUES ('foobar',2);
+SELECT * FROM t1;
+c c2
+foobar NULL
+foobar 2
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+c c2
+INSERT INTO t1 VALUES ('foobar',1);
+INSERT INTO t1 VALUES ('foobar',2);
+FLUSH TABLE WITH READ LOCK;
+SELECT * FROM t1;
+c c2
+foobar 1
+foobar 2
+
+# Restart server with keysbad3.txt
+SELECT * FROM t1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Warning 192 Table "test"."t1" in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+DROP TABLE t1;
+SHOW WARNINGS;
+Level Code Message
+# Start server with keys3.txt
+SET GLOBAL innodb_default_encryption_key_id=5;
+CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES;
+INSERT INTO t2 VALUES ('foobar',1,2);
+
+# Restart server with keys2.txt
+SELECT * FROM t2;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table test/t2 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SELECT * FROM t2 where id = 1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SELECT * FROM t2 where b = 1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+INSERT INTO t2 VALUES ('tmp',3,3);
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+DELETE FROM t2 where b = 3;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+DELETE FROM t2 where id = 3;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+UPDATE t2 set b = b +1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+OPTIMIZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 optimize Warning Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t2 optimize Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+test.t2 optimize error Corrupt
+SHOW WARNINGS;
+Level Code Message
+ALTER TABLE t2 ADD COLUMN d INT;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze Warning Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t2 analyze Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+test.t2 analyze error Corrupt
+SHOW WARNINGS;
+Level Code Message
+TRUNCATE TABLE t2;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t2" in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+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
new file mode 100644
index 00000000000..94ed922a0ec
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -0,0 +1,59 @@
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1new cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*");
+call mtr.add_suppression("InnoDB: Table \'\"test\".\"t1\"\' tablespace is set as discarded.");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+SELECT * FROM t1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Warning 192 Table "test"."t1" in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+ALTER TABLE t1 engine=InnoDB;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table "test"."t1" in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize Warning Table "test"."t1" in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t1 optimize Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+test.t1 optimize error Corrupt
+SHOW WARNINGS;
+Level Code Message
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check Warning Table "test"."t1" in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t1 check Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+test.t1 check error Corrupt
+SHOW WARNINGS;
+Level Code Message
+FLUSH TABLES t1 FOR EXPORT;
+backup: t1
+UNLOCK TABLES;
+ALTER TABLE t1 DISCARD TABLESPACE;
+Warnings:
+Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Warning 1812 Tablespace is missing for table 't1'
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+Warnings:
+Warning 1814 Tablespace has been discarded for table 't1'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `f` varchar(8) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
+RENAME TABLE t1 TO t1new;
+ALTER TABLE t1new RENAME TO t2new;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+DROP TABLE t1new;
+DROP TABLE t1, t1new;
+ERROR 42S02: Unknown table 'test.t1,test.t1new'
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change3.result b/mysql-test/suite/encryption/r/innodb-bad-key-change3.result
new file mode 100644
index 00000000000..c83fc5b5fcb
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change3.result
@@ -0,0 +1,43 @@
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `f` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
+INSERT INTO t1 VALUES (1,'foobar'),(2,'barfoo');
+FLUSH TABLE t1 FOR EXPORT;
+# List before copying files
+t1.cfg
+t1.frm
+t1.ibd
+backup: t1
+UNLOCK TABLES;
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+ALTER TABLE t1 IMPORT TABLESPACE;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `f` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
+SELECT * FROM t1;
+ERROR HY000: Tablespace has been discarded for table 't1'
+# Tablespaces should be still encrypted
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+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
new file mode 100644
index 00000000000..227b8cc3deb
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -0,0 +1,24 @@
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: Cannot open table .*");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize Warning Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t1 optimize Warning Table "test"."t1" in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t1 optimize Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+test.t1 optimize error Corrupt
+SHOW WARNINGS;
+Level Code Message
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check Warning Table "test"."t1" in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t1 check Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+test.t1 check error Corrupt
+SHOW WARNINGS;
+Level Code Message
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff
new file mode 100644
index 00000000000..cd66df7440b
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff
@@ -0,0 +1,38 @@
+--- suite/encryption/r/innodb-checksum-algorithm.result
++++ suite/encryption/r/innodb-checksum-algorithm,32k.reject
+@@ -13,9 +13,9 @@
+ SET GLOBAL innodb_default_encryption_key_id=4;
+ SET GLOBAL innodb_checksum_algorithm=crc32;
+ create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=yes;
++ROW_FORMAT=DYNAMIC encrypted=yes;
+ create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=no;
++ROW_FORMAT=DYNAMIC encrypted=no;
+ create table te_crc32(a serial, b blob, index(b(10))) engine=innodb
+ encrypted=yes;
+ create table t_crc32(a serial, b blob, index(b(10))) engine=innodb
+@@ -222,9 +222,9 @@
+ t_crc32, tpe_crc32, tp_crc32;
+ SET GLOBAL innodb_checksum_algorithm=innodb;
+ create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=yes;
++ROW_FORMAT=DYNAMIC encrypted=yes;
+ create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=no;
++ROW_FORMAT=DYNAMIC encrypted=no;
+ create table te_innodb(a serial, b blob, index(b(10))) engine=innodb
+ encrypted=yes;
+ create table t_innodb(a serial, b blob, index(b(10))) engine=innodb
+@@ -431,9 +431,9 @@
+ t_innodb, tpe_innodb, tp_innodb;
+ SET GLOBAL innodb_checksum_algorithm=none;
+ create table tce_none(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=yes;
++ROW_FORMAT=DYNAMIC encrypted=yes;
+ create table tc_none(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=no;
++ROW_FORMAT=DYNAMIC encrypted=no;
+ create table te_none(a serial, b blob, index(b(10))) engine=innodb
+ encrypted=yes;
+ create table t_none(a serial, b blob, index(b(10))) engine=innodb
diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff
new file mode 100644
index 00000000000..523074297da
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff
@@ -0,0 +1,38 @@
+--- suite/encryption/r/innodb-checksum-algorithm.result
++++ suite/encryption/r/innodb-checksum-algorithm,64k.reject
+@@ -13,9 +13,9 @@
+ SET GLOBAL innodb_default_encryption_key_id=4;
+ SET GLOBAL innodb_checksum_algorithm=crc32;
+ create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=yes;
++ROW_FORMAT=DYNAMIC encrypted=yes;
+ create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=no;
++ROW_FORMAT=DYNAMIC encrypted=no;
+ create table te_crc32(a serial, b blob, index(b(10))) engine=innodb
+ encrypted=yes;
+ create table t_crc32(a serial, b blob, index(b(10))) engine=innodb
+@@ -222,9 +222,9 @@
+ t_crc32, tpe_crc32, tp_crc32;
+ SET GLOBAL innodb_checksum_algorithm=innodb;
+ create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=yes;
++ROW_FORMAT=DYNAMIC encrypted=yes;
+ create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=no;
++ROW_FORMAT=DYNAMIC encrypted=no;
+ create table te_innodb(a serial, b blob, index(b(10))) engine=innodb
+ encrypted=yes;
+ create table t_innodb(a serial, b blob, index(b(10))) engine=innodb
+@@ -431,9 +431,9 @@
+ t_innodb, tpe_innodb, tp_innodb;
+ SET GLOBAL innodb_checksum_algorithm=none;
+ create table tce_none(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=yes;
++ROW_FORMAT=DYNAMIC encrypted=yes;
+ create table tc_none(a serial, b blob, index(b(10))) engine=innodb
+-ROW_FORMAT=COMPRESSED encrypted=no;
++ROW_FORMAT=DYNAMIC encrypted=no;
+ create table te_none(a serial, b blob, index(b(10))) engine=innodb
+ encrypted=yes;
+ create table t_none(a serial, b blob, index(b(10))) engine=innodb
diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result
new file mode 100644
index 00000000000..a853f3869a9
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result
@@ -0,0 +1,646 @@
+SET @saved_file_format = @@global.innodb_file_format;
+SET @saved_file_per_table = @@global.innodb_file_per_table;
+SET @saved_checksum_algorithm = @@global.innodb_checksum_algorithm;
+SET @saved_encrypt_tables = @@global.innodb_encrypt_tables;
+SET @saved_encryption_threads = @@global.innodb_encryption_threads;
+SET @saved_encryption_key_id = @@global.innodb_default_encryption_key_id;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encrypt_tables = ON;
+SET GLOBAL innodb_encryption_threads = 4;
+call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_(crc32|none|innodb)\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"(innodb|none|crc32)\"");
+SET GLOBAL innodb_checksum_algorithm = innodb;
+SET GLOBAL innodb_default_encryption_key_id=4;
+SET GLOBAL innodb_checksum_algorithm=crc32;
+create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb
+ROW_FORMAT=COMPRESSED encrypted=yes;
+create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb
+ROW_FORMAT=COMPRESSED encrypted=no;
+create table te_crc32(a serial, b blob, index(b(10))) engine=innodb
+encrypted=yes;
+create table t_crc32(a serial, b blob, index(b(10))) engine=innodb
+encrypted=no;
+create table tpe_crc32(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=yes;
+create table tp_crc32(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=no;
+begin;
+insert into tce_crc32(b) values (repeat('secret',20));
+insert into tc_crc32(b) values (repeat('secret',20));
+insert into te_crc32(b) values (repeat('secret',20));
+insert into t_crc32(b) values (repeat('secret',20));
+insert into tpe_crc32(b) values (repeat('secret',20));
+insert into tp_crc32(b) values (repeat('secret',20));
+commit;
+FLUSH TABLES tce_crc32, tc_crc32, te_crc32,
+t_crc32, tpe_crc32, tp_crc32 FOR EXPORT;
+backup: tce_crc32
+backup: tc_crc32
+backup: te_crc32
+backup: t_crc32
+backup: tpe_crc32
+backup: tp_crc32
+t_crc32.cfg
+t_crc32.frm
+t_crc32.ibd
+tc_crc32.cfg
+tc_crc32.frm
+tc_crc32.ibd
+tce_crc32.cfg
+tce_crc32.frm
+tce_crc32.ibd
+te_crc32.cfg
+te_crc32.frm
+te_crc32.ibd
+tp_crc32.cfg
+tp_crc32.frm
+tp_crc32.ibd
+tpe_crc32.cfg
+tpe_crc32.frm
+tpe_crc32.ibd
+UNLOCK TABLES;
+SET GLOBAL innodb_checksum_algorithm=strict_crc32;
+ALTER TABLE tce_crc32 DISCARD TABLESPACE;
+ALTER TABLE tc_crc32 DISCARD TABLESPACE;
+ALTER TABLE te_crc32 DISCARD TABLESPACE;
+ALTER TABLE t_crc32 DISCARD TABLESPACE;
+ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
+ALTER TABLE tp_crc32 DISCARD TABLESPACE;
+restore: tce_crc32 .ibd and .cfg files
+restore: tc_crc32 .ibd and .cfg files
+restore: te_crc32 .ibd and .cfg files
+restore: t_crc32 .ibd and .cfg files
+restore: tpe_crc32 .ibd and .cfg files
+restore: tp_crc32 .ibd and .cfg files
+ALTER TABLE tce_crc32 IMPORT TABLESPACE;
+update tce_crc32 set b=substr(b,1);
+ALTER TABLE tc_crc32 IMPORT TABLESPACE;
+update tc_crc32 set b=substr(b,1);
+ALTER TABLE te_crc32 IMPORT TABLESPACE;
+update te_crc32 set b=substr(b,1);
+ALTER TABLE t_crc32 IMPORT TABLESPACE;
+update t_crc32 set b=substr(b,1);
+ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
+update tpe_crc32 set b=substr(b,1);
+ALTER TABLE tp_crc32 IMPORT TABLESPACE;
+update tp_crc32 set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=crc32;
+ALTER TABLE tce_crc32 DISCARD TABLESPACE;
+ALTER TABLE tc_crc32 DISCARD TABLESPACE;
+ALTER TABLE te_crc32 DISCARD TABLESPACE;
+ALTER TABLE t_crc32 DISCARD TABLESPACE;
+ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
+ALTER TABLE tp_crc32 DISCARD TABLESPACE;
+restore: tce_crc32 .ibd and .cfg files
+restore: tc_crc32 .ibd and .cfg files
+restore: te_crc32 .ibd and .cfg files
+restore: t_crc32 .ibd and .cfg files
+restore: tpe_crc32 .ibd and .cfg files
+restore: tp_crc32 .ibd and .cfg files
+ALTER TABLE tce_crc32 IMPORT TABLESPACE;
+update tce_crc32 set b=substr(b,1);
+ALTER TABLE tc_crc32 IMPORT TABLESPACE;
+update tc_crc32 set b=substr(b,1);
+ALTER TABLE te_crc32 IMPORT TABLESPACE;
+update te_crc32 set b=substr(b,1);
+ALTER TABLE t_crc32 IMPORT TABLESPACE;
+update t_crc32 set b=substr(b,1);
+ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
+update tpe_crc32 set b=substr(b,1);
+ALTER TABLE tp_crc32 IMPORT TABLESPACE;
+update tp_crc32 set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=strict_innodb;
+ALTER TABLE tce_crc32 DISCARD TABLESPACE;
+ALTER TABLE tc_crc32 DISCARD TABLESPACE;
+ALTER TABLE te_crc32 DISCARD TABLESPACE;
+ALTER TABLE t_crc32 DISCARD TABLESPACE;
+ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
+ALTER TABLE tp_crc32 DISCARD TABLESPACE;
+restore: tce_crc32 .ibd and .cfg files
+restore: tc_crc32 .ibd and .cfg files
+restore: te_crc32 .ibd and .cfg files
+restore: t_crc32 .ibd and .cfg files
+restore: tpe_crc32 .ibd and .cfg files
+restore: tp_crc32 .ibd and .cfg files
+ALTER TABLE tce_crc32 IMPORT TABLESPACE;
+update tce_crc32 set b=substr(b,1);
+ALTER TABLE tc_crc32 IMPORT TABLESPACE;
+update tc_crc32 set b=substr(b,1);
+ALTER TABLE te_crc32 IMPORT TABLESPACE;
+update te_crc32 set b=substr(b,1);
+ALTER TABLE t_crc32 IMPORT TABLESPACE;
+update t_crc32 set b=substr(b,1);
+ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
+update tpe_crc32 set b=substr(b,1);
+ALTER TABLE tp_crc32 IMPORT TABLESPACE;
+update tp_crc32 set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=innodb;
+ALTER TABLE tce_crc32 DISCARD TABLESPACE;
+ALTER TABLE tc_crc32 DISCARD TABLESPACE;
+ALTER TABLE te_crc32 DISCARD TABLESPACE;
+ALTER TABLE t_crc32 DISCARD TABLESPACE;
+ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
+ALTER TABLE tp_crc32 DISCARD TABLESPACE;
+restore: tce_crc32 .ibd and .cfg files
+restore: tc_crc32 .ibd and .cfg files
+restore: te_crc32 .ibd and .cfg files
+restore: t_crc32 .ibd and .cfg files
+restore: tpe_crc32 .ibd and .cfg files
+restore: tp_crc32 .ibd and .cfg files
+ALTER TABLE tce_crc32 IMPORT TABLESPACE;
+update tce_crc32 set b=substr(b,1);
+ALTER TABLE tc_crc32 IMPORT TABLESPACE;
+update tc_crc32 set b=substr(b,1);
+ALTER TABLE te_crc32 IMPORT TABLESPACE;
+update te_crc32 set b=substr(b,1);
+ALTER TABLE t_crc32 IMPORT TABLESPACE;
+update t_crc32 set b=substr(b,1);
+ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
+update tpe_crc32 set b=substr(b,1);
+ALTER TABLE tp_crc32 IMPORT TABLESPACE;
+update tp_crc32 set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=strict_none;
+ALTER TABLE tce_crc32 DISCARD TABLESPACE;
+ALTER TABLE tc_crc32 DISCARD TABLESPACE;
+ALTER TABLE te_crc32 DISCARD TABLESPACE;
+ALTER TABLE t_crc32 DISCARD TABLESPACE;
+ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
+ALTER TABLE tp_crc32 DISCARD TABLESPACE;
+restore: tce_crc32 .ibd and .cfg files
+restore: tc_crc32 .ibd and .cfg files
+restore: te_crc32 .ibd and .cfg files
+restore: t_crc32 .ibd and .cfg files
+restore: tpe_crc32 .ibd and .cfg files
+restore: tp_crc32 .ibd and .cfg files
+ALTER TABLE tce_crc32 IMPORT TABLESPACE;
+update tce_crc32 set b=substr(b,1);
+ALTER TABLE tc_crc32 IMPORT TABLESPACE;
+update tc_crc32 set b=substr(b,1);
+ALTER TABLE te_crc32 IMPORT TABLESPACE;
+update te_crc32 set b=substr(b,1);
+ALTER TABLE t_crc32 IMPORT TABLESPACE;
+update t_crc32 set b=substr(b,1);
+ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
+update tpe_crc32 set b=substr(b,1);
+ALTER TABLE tp_crc32 IMPORT TABLESPACE;
+update tp_crc32 set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=none;
+ALTER TABLE tce_crc32 DISCARD TABLESPACE;
+ALTER TABLE tc_crc32 DISCARD TABLESPACE;
+ALTER TABLE te_crc32 DISCARD TABLESPACE;
+ALTER TABLE t_crc32 DISCARD TABLESPACE;
+ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
+ALTER TABLE tp_crc32 DISCARD TABLESPACE;
+restore: tce_crc32 .ibd and .cfg files
+restore: tc_crc32 .ibd and .cfg files
+restore: te_crc32 .ibd and .cfg files
+restore: t_crc32 .ibd and .cfg files
+restore: tpe_crc32 .ibd and .cfg files
+restore: tp_crc32 .ibd and .cfg files
+ALTER TABLE tce_crc32 IMPORT TABLESPACE;
+update tce_crc32 set b=substr(b,1);
+ALTER TABLE tc_crc32 IMPORT TABLESPACE;
+update tc_crc32 set b=substr(b,1);
+ALTER TABLE te_crc32 IMPORT TABLESPACE;
+update te_crc32 set b=substr(b,1);
+ALTER TABLE t_crc32 IMPORT TABLESPACE;
+update t_crc32 set b=substr(b,1);
+ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
+update tpe_crc32 set b=substr(b,1);
+ALTER TABLE tp_crc32 IMPORT TABLESPACE;
+update tp_crc32 set b=substr(b,1);
+CHECK TABLE tce_crc32, tc_crc32, te_crc32,
+t_crc32, tpe_crc32, tp_crc32;
+Table Op Msg_type Msg_text
+test.tce_crc32 check status OK
+test.tc_crc32 check status OK
+test.te_crc32 check status OK
+test.t_crc32 check status OK
+test.tpe_crc32 check status OK
+test.tp_crc32 check status OK
+DROP TABLE tce_crc32, tc_crc32, te_crc32,
+t_crc32, tpe_crc32, tp_crc32;
+SET GLOBAL innodb_checksum_algorithm=innodb;
+create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb
+ROW_FORMAT=COMPRESSED encrypted=yes;
+create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb
+ROW_FORMAT=COMPRESSED encrypted=no;
+create table te_innodb(a serial, b blob, index(b(10))) engine=innodb
+encrypted=yes;
+create table t_innodb(a serial, b blob, index(b(10))) engine=innodb
+encrypted=no;
+create table tpe_innodb(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=yes;
+create table tp_innodb(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=no;
+begin;
+insert into tce_innodb(b) values (repeat('secret',20));
+insert into tc_innodb(b) values (repeat('secret',20));
+insert into te_innodb(b) values (repeat('secret',20));
+insert into t_innodb(b) values (repeat('secret',20));
+insert into tpe_innodb(b) values (repeat('secret',20));
+insert into tp_innodb(b) values (repeat('secret',20));
+commit;
+FLUSH TABLES tce_innodb, tc_innodb, te_innodb,
+t_innodb, tpe_innodb, tp_innodb FOR EXPORT;
+backup: tce_innodb
+backup: tc_innodb
+backup: te_innodb
+backup: t_innodb
+backup: tpe_innodb
+backup: tp_innodb
+t_innodb.cfg
+t_innodb.frm
+t_innodb.ibd
+tc_innodb.cfg
+tc_innodb.frm
+tc_innodb.ibd
+tce_innodb.cfg
+tce_innodb.frm
+tce_innodb.ibd
+te_innodb.cfg
+te_innodb.frm
+te_innodb.ibd
+tp_innodb.cfg
+tp_innodb.frm
+tp_innodb.ibd
+tpe_innodb.cfg
+tpe_innodb.frm
+tpe_innodb.ibd
+UNLOCK TABLES;
+SET GLOBAL innodb_checksum_algorithm=strict_crc32;
+ALTER TABLE tce_innodb DISCARD TABLESPACE;
+ALTER TABLE tc_innodb DISCARD TABLESPACE;
+ALTER TABLE te_innodb DISCARD TABLESPACE;
+ALTER TABLE t_innodb DISCARD TABLESPACE;
+ALTER TABLE tpe_innodb DISCARD TABLESPACE;
+ALTER TABLE tp_innodb DISCARD TABLESPACE;
+restore: tce_innodb .ibd and .cfg files
+restore: tc_innodb .ibd and .cfg files
+restore: te_innodb .ibd and .cfg files
+restore: t_innodb .ibd and .cfg files
+restore: tpe_innodb .ibd and .cfg files
+restore: tp_innodb .ibd and .cfg files
+ALTER TABLE tce_innodb IMPORT TABLESPACE;
+update tce_innodb set b=substr(b,1);
+ALTER TABLE tc_innodb IMPORT TABLESPACE;
+update tc_innodb set b=substr(b,1);
+ALTER TABLE te_innodb IMPORT TABLESPACE;
+update te_innodb set b=substr(b,1);
+ALTER TABLE t_innodb IMPORT TABLESPACE;
+update t_innodb set b=substr(b,1);
+ALTER TABLE tpe_innodb IMPORT TABLESPACE;
+update tpe_innodb set b=substr(b,1);
+ALTER TABLE tp_innodb IMPORT TABLESPACE;
+update tp_innodb set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=crc32;
+ALTER TABLE tce_innodb DISCARD TABLESPACE;
+ALTER TABLE tc_innodb DISCARD TABLESPACE;
+ALTER TABLE te_innodb DISCARD TABLESPACE;
+ALTER TABLE t_innodb DISCARD TABLESPACE;
+ALTER TABLE tpe_innodb DISCARD TABLESPACE;
+ALTER TABLE tp_innodb DISCARD TABLESPACE;
+restore: tce_innodb .ibd and .cfg files
+restore: tc_innodb .ibd and .cfg files
+restore: te_innodb .ibd and .cfg files
+restore: t_innodb .ibd and .cfg files
+restore: tpe_innodb .ibd and .cfg files
+restore: tp_innodb .ibd and .cfg files
+ALTER TABLE tce_innodb IMPORT TABLESPACE;
+update tce_innodb set b=substr(b,1);
+ALTER TABLE tc_innodb IMPORT TABLESPACE;
+update tc_innodb set b=substr(b,1);
+ALTER TABLE te_innodb IMPORT TABLESPACE;
+update te_innodb set b=substr(b,1);
+ALTER TABLE t_innodb IMPORT TABLESPACE;
+update t_innodb set b=substr(b,1);
+ALTER TABLE tpe_innodb IMPORT TABLESPACE;
+update tpe_innodb set b=substr(b,1);
+ALTER TABLE tp_innodb IMPORT TABLESPACE;
+update tp_innodb set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=strict_innodb;
+ALTER TABLE tce_innodb DISCARD TABLESPACE;
+ALTER TABLE tc_innodb DISCARD TABLESPACE;
+ALTER TABLE te_innodb DISCARD TABLESPACE;
+ALTER TABLE t_innodb DISCARD TABLESPACE;
+ALTER TABLE tpe_innodb DISCARD TABLESPACE;
+ALTER TABLE tp_innodb DISCARD TABLESPACE;
+restore: tce_innodb .ibd and .cfg files
+restore: tc_innodb .ibd and .cfg files
+restore: te_innodb .ibd and .cfg files
+restore: t_innodb .ibd and .cfg files
+restore: tpe_innodb .ibd and .cfg files
+restore: tp_innodb .ibd and .cfg files
+ALTER TABLE tce_innodb IMPORT TABLESPACE;
+update tce_innodb set b=substr(b,1);
+ALTER TABLE tc_innodb IMPORT TABLESPACE;
+update tc_innodb set b=substr(b,1);
+ALTER TABLE te_innodb IMPORT TABLESPACE;
+update te_innodb set b=substr(b,1);
+ALTER TABLE t_innodb IMPORT TABLESPACE;
+update t_innodb set b=substr(b,1);
+ALTER TABLE tpe_innodb IMPORT TABLESPACE;
+update tpe_innodb set b=substr(b,1);
+ALTER TABLE tp_innodb IMPORT TABLESPACE;
+update tp_innodb set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=innodb;
+ALTER TABLE tce_innodb DISCARD TABLESPACE;
+ALTER TABLE tc_innodb DISCARD TABLESPACE;
+ALTER TABLE te_innodb DISCARD TABLESPACE;
+ALTER TABLE t_innodb DISCARD TABLESPACE;
+ALTER TABLE tpe_innodb DISCARD TABLESPACE;
+ALTER TABLE tp_innodb DISCARD TABLESPACE;
+restore: tce_innodb .ibd and .cfg files
+restore: tc_innodb .ibd and .cfg files
+restore: te_innodb .ibd and .cfg files
+restore: t_innodb .ibd and .cfg files
+restore: tpe_innodb .ibd and .cfg files
+restore: tp_innodb .ibd and .cfg files
+ALTER TABLE tce_innodb IMPORT TABLESPACE;
+update tce_innodb set b=substr(b,1);
+ALTER TABLE tc_innodb IMPORT TABLESPACE;
+update tc_innodb set b=substr(b,1);
+ALTER TABLE te_innodb IMPORT TABLESPACE;
+update te_innodb set b=substr(b,1);
+ALTER TABLE t_innodb IMPORT TABLESPACE;
+update t_innodb set b=substr(b,1);
+ALTER TABLE tpe_innodb IMPORT TABLESPACE;
+update tpe_innodb set b=substr(b,1);
+ALTER TABLE tp_innodb IMPORT TABLESPACE;
+update tp_innodb set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=strict_none;
+ALTER TABLE tce_innodb DISCARD TABLESPACE;
+ALTER TABLE tc_innodb DISCARD TABLESPACE;
+ALTER TABLE te_innodb DISCARD TABLESPACE;
+ALTER TABLE t_innodb DISCARD TABLESPACE;
+ALTER TABLE tpe_innodb DISCARD TABLESPACE;
+ALTER TABLE tp_innodb DISCARD TABLESPACE;
+restore: tce_innodb .ibd and .cfg files
+restore: tc_innodb .ibd and .cfg files
+restore: te_innodb .ibd and .cfg files
+restore: t_innodb .ibd and .cfg files
+restore: tpe_innodb .ibd and .cfg files
+restore: tp_innodb .ibd and .cfg files
+ALTER TABLE tce_innodb IMPORT TABLESPACE;
+update tce_innodb set b=substr(b,1);
+ALTER TABLE tc_innodb IMPORT TABLESPACE;
+update tc_innodb set b=substr(b,1);
+ALTER TABLE te_innodb IMPORT TABLESPACE;
+update te_innodb set b=substr(b,1);
+ALTER TABLE t_innodb IMPORT TABLESPACE;
+update t_innodb set b=substr(b,1);
+ALTER TABLE tpe_innodb IMPORT TABLESPACE;
+update tpe_innodb set b=substr(b,1);
+ALTER TABLE tp_innodb IMPORT TABLESPACE;
+update tp_innodb set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=none;
+ALTER TABLE tce_innodb DISCARD TABLESPACE;
+ALTER TABLE tc_innodb DISCARD TABLESPACE;
+ALTER TABLE te_innodb DISCARD TABLESPACE;
+ALTER TABLE t_innodb DISCARD TABLESPACE;
+ALTER TABLE tpe_innodb DISCARD TABLESPACE;
+ALTER TABLE tp_innodb DISCARD TABLESPACE;
+restore: tce_innodb .ibd and .cfg files
+restore: tc_innodb .ibd and .cfg files
+restore: te_innodb .ibd and .cfg files
+restore: t_innodb .ibd and .cfg files
+restore: tpe_innodb .ibd and .cfg files
+restore: tp_innodb .ibd and .cfg files
+ALTER TABLE tce_innodb IMPORT TABLESPACE;
+update tce_innodb set b=substr(b,1);
+ALTER TABLE tc_innodb IMPORT TABLESPACE;
+update tc_innodb set b=substr(b,1);
+ALTER TABLE te_innodb IMPORT TABLESPACE;
+update te_innodb set b=substr(b,1);
+ALTER TABLE t_innodb IMPORT TABLESPACE;
+update t_innodb set b=substr(b,1);
+ALTER TABLE tpe_innodb IMPORT TABLESPACE;
+update tpe_innodb set b=substr(b,1);
+ALTER TABLE tp_innodb IMPORT TABLESPACE;
+update tp_innodb set b=substr(b,1);
+CHECK TABLE tce_innodb, tc_innodb, te_innodb,
+t_innodb, tpe_innodb, tp_innodb;
+Table Op Msg_type Msg_text
+test.tce_innodb check status OK
+test.tc_innodb check status OK
+test.te_innodb check status OK
+test.t_innodb check status OK
+test.tpe_innodb check status OK
+test.tp_innodb check status OK
+DROP TABLE tce_innodb, tc_innodb, te_innodb,
+t_innodb, tpe_innodb, tp_innodb;
+SET GLOBAL innodb_checksum_algorithm=none;
+create table tce_none(a serial, b blob, index(b(10))) engine=innodb
+ROW_FORMAT=COMPRESSED encrypted=yes;
+create table tc_none(a serial, b blob, index(b(10))) engine=innodb
+ROW_FORMAT=COMPRESSED encrypted=no;
+create table te_none(a serial, b blob, index(b(10))) engine=innodb
+encrypted=yes;
+create table t_none(a serial, b blob, index(b(10))) engine=innodb
+encrypted=no;
+create table tpe_none(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=yes;
+create table tp_none(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=no;
+begin;
+insert into tce_none(b) values (repeat('secret',20));
+insert into tc_none(b) values (repeat('secret',20));
+insert into te_none(b) values (repeat('secret',20));
+insert into t_none(b) values (repeat('secret',20));
+insert into tpe_none(b) values (repeat('secret',20));
+insert into tp_none(b) values (repeat('secret',20));
+commit;
+FLUSH TABLES tce_none, tc_none, te_none,
+t_none, tpe_none, tp_none FOR EXPORT;
+backup: tce_none
+backup: tc_none
+backup: te_none
+backup: t_none
+backup: tpe_none
+backup: tp_none
+t_none.cfg
+t_none.frm
+t_none.ibd
+tc_none.cfg
+tc_none.frm
+tc_none.ibd
+tce_none.cfg
+tce_none.frm
+tce_none.ibd
+te_none.cfg
+te_none.frm
+te_none.ibd
+tp_none.cfg
+tp_none.frm
+tp_none.ibd
+tpe_none.cfg
+tpe_none.frm
+tpe_none.ibd
+UNLOCK TABLES;
+SET GLOBAL innodb_checksum_algorithm=strict_crc32;
+ALTER TABLE tce_none DISCARD TABLESPACE;
+ALTER TABLE tc_none DISCARD TABLESPACE;
+ALTER TABLE te_none DISCARD TABLESPACE;
+ALTER TABLE t_none DISCARD TABLESPACE;
+ALTER TABLE tpe_none DISCARD TABLESPACE;
+ALTER TABLE tp_none DISCARD TABLESPACE;
+restore: tce_none .ibd and .cfg files
+restore: tc_none .ibd and .cfg files
+restore: te_none .ibd and .cfg files
+restore: t_none .ibd and .cfg files
+restore: tpe_none .ibd and .cfg files
+restore: tp_none .ibd and .cfg files
+ALTER TABLE tce_none IMPORT TABLESPACE;
+update tce_none set b=substr(b,1);
+ALTER TABLE tc_none IMPORT TABLESPACE;
+update tc_none set b=substr(b,1);
+ALTER TABLE te_none IMPORT TABLESPACE;
+update te_none set b=substr(b,1);
+ALTER TABLE t_none IMPORT TABLESPACE;
+update t_none set b=substr(b,1);
+ALTER TABLE tpe_none IMPORT TABLESPACE;
+update tpe_none set b=substr(b,1);
+ALTER TABLE tp_none IMPORT TABLESPACE;
+update tp_none set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=crc32;
+ALTER TABLE tce_none DISCARD TABLESPACE;
+ALTER TABLE tc_none DISCARD TABLESPACE;
+ALTER TABLE te_none DISCARD TABLESPACE;
+ALTER TABLE t_none DISCARD TABLESPACE;
+ALTER TABLE tpe_none DISCARD TABLESPACE;
+ALTER TABLE tp_none DISCARD TABLESPACE;
+restore: tce_none .ibd and .cfg files
+restore: tc_none .ibd and .cfg files
+restore: te_none .ibd and .cfg files
+restore: t_none .ibd and .cfg files
+restore: tpe_none .ibd and .cfg files
+restore: tp_none .ibd and .cfg files
+ALTER TABLE tce_none IMPORT TABLESPACE;
+update tce_none set b=substr(b,1);
+ALTER TABLE tc_none IMPORT TABLESPACE;
+update tc_none set b=substr(b,1);
+ALTER TABLE te_none IMPORT TABLESPACE;
+update te_none set b=substr(b,1);
+ALTER TABLE t_none IMPORT TABLESPACE;
+update t_none set b=substr(b,1);
+ALTER TABLE tpe_none IMPORT TABLESPACE;
+update tpe_none set b=substr(b,1);
+ALTER TABLE tp_none IMPORT TABLESPACE;
+update tp_none set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=strict_innodb;
+ALTER TABLE tce_none DISCARD TABLESPACE;
+ALTER TABLE tc_none DISCARD TABLESPACE;
+ALTER TABLE te_none DISCARD TABLESPACE;
+ALTER TABLE t_none DISCARD TABLESPACE;
+ALTER TABLE tpe_none DISCARD TABLESPACE;
+ALTER TABLE tp_none DISCARD TABLESPACE;
+restore: tce_none .ibd and .cfg files
+restore: tc_none .ibd and .cfg files
+restore: te_none .ibd and .cfg files
+restore: t_none .ibd and .cfg files
+restore: tpe_none .ibd and .cfg files
+restore: tp_none .ibd and .cfg files
+ALTER TABLE tce_none IMPORT TABLESPACE;
+update tce_none set b=substr(b,1);
+ALTER TABLE tc_none IMPORT TABLESPACE;
+update tc_none set b=substr(b,1);
+ALTER TABLE te_none IMPORT TABLESPACE;
+update te_none set b=substr(b,1);
+ALTER TABLE t_none IMPORT TABLESPACE;
+update t_none set b=substr(b,1);
+ALTER TABLE tpe_none IMPORT TABLESPACE;
+update tpe_none set b=substr(b,1);
+ALTER TABLE tp_none IMPORT TABLESPACE;
+update tp_none set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=innodb;
+ALTER TABLE tce_none DISCARD TABLESPACE;
+ALTER TABLE tc_none DISCARD TABLESPACE;
+ALTER TABLE te_none DISCARD TABLESPACE;
+ALTER TABLE t_none DISCARD TABLESPACE;
+ALTER TABLE tpe_none DISCARD TABLESPACE;
+ALTER TABLE tp_none DISCARD TABLESPACE;
+restore: tce_none .ibd and .cfg files
+restore: tc_none .ibd and .cfg files
+restore: te_none .ibd and .cfg files
+restore: t_none .ibd and .cfg files
+restore: tpe_none .ibd and .cfg files
+restore: tp_none .ibd and .cfg files
+ALTER TABLE tce_none IMPORT TABLESPACE;
+update tce_none set b=substr(b,1);
+ALTER TABLE tc_none IMPORT TABLESPACE;
+update tc_none set b=substr(b,1);
+ALTER TABLE te_none IMPORT TABLESPACE;
+update te_none set b=substr(b,1);
+ALTER TABLE t_none IMPORT TABLESPACE;
+update t_none set b=substr(b,1);
+ALTER TABLE tpe_none IMPORT TABLESPACE;
+update tpe_none set b=substr(b,1);
+ALTER TABLE tp_none IMPORT TABLESPACE;
+update tp_none set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=strict_none;
+ALTER TABLE tce_none DISCARD TABLESPACE;
+ALTER TABLE tc_none DISCARD TABLESPACE;
+ALTER TABLE te_none DISCARD TABLESPACE;
+ALTER TABLE t_none DISCARD TABLESPACE;
+ALTER TABLE tpe_none DISCARD TABLESPACE;
+ALTER TABLE tp_none DISCARD TABLESPACE;
+restore: tce_none .ibd and .cfg files
+restore: tc_none .ibd and .cfg files
+restore: te_none .ibd and .cfg files
+restore: t_none .ibd and .cfg files
+restore: tpe_none .ibd and .cfg files
+restore: tp_none .ibd and .cfg files
+ALTER TABLE tce_none IMPORT TABLESPACE;
+update tce_none set b=substr(b,1);
+ALTER TABLE tc_none IMPORT TABLESPACE;
+update tc_none set b=substr(b,1);
+ALTER TABLE te_none IMPORT TABLESPACE;
+update te_none set b=substr(b,1);
+ALTER TABLE t_none IMPORT TABLESPACE;
+update t_none set b=substr(b,1);
+ALTER TABLE tpe_none IMPORT TABLESPACE;
+update tpe_none set b=substr(b,1);
+ALTER TABLE tp_none IMPORT TABLESPACE;
+update tp_none set b=substr(b,1);
+SET GLOBAL innodb_checksum_algorithm=none;
+ALTER TABLE tce_none DISCARD TABLESPACE;
+ALTER TABLE tc_none DISCARD TABLESPACE;
+ALTER TABLE te_none DISCARD TABLESPACE;
+ALTER TABLE t_none DISCARD TABLESPACE;
+ALTER TABLE tpe_none DISCARD TABLESPACE;
+ALTER TABLE tp_none DISCARD TABLESPACE;
+restore: tce_none .ibd and .cfg files
+restore: tc_none .ibd and .cfg files
+restore: te_none .ibd and .cfg files
+restore: t_none .ibd and .cfg files
+restore: tpe_none .ibd and .cfg files
+restore: tp_none .ibd and .cfg files
+ALTER TABLE tce_none IMPORT TABLESPACE;
+update tce_none set b=substr(b,1);
+ALTER TABLE tc_none IMPORT TABLESPACE;
+update tc_none set b=substr(b,1);
+ALTER TABLE te_none IMPORT TABLESPACE;
+update te_none set b=substr(b,1);
+ALTER TABLE t_none IMPORT TABLESPACE;
+update t_none set b=substr(b,1);
+ALTER TABLE tpe_none IMPORT TABLESPACE;
+update tpe_none set b=substr(b,1);
+ALTER TABLE tp_none IMPORT TABLESPACE;
+update tp_none set b=substr(b,1);
+CHECK TABLE tce_none, tc_none, te_none,
+t_none, tpe_none, tp_none;
+Table Op Msg_type Msg_text
+test.tce_none check status OK
+test.tc_none check status OK
+test.te_none check status OK
+test.t_none check status OK
+test.tpe_none check status OK
+test.tp_none check status OK
+DROP TABLE tce_none, tc_none, te_none,
+t_none, tpe_none, tp_none;
+SET GLOBAL innodb_file_format = @saved_file_format;
+SET GLOBAL innodb_file_per_table = @saved_file_per_table;
+SET GLOBAL innodb_checksum_algorithm = @saved_checksum_algorithm;
+SET GLOBAL innodb_encrypt_tables = @saved_encrypt_tables;
+SET GLOBAL innodb_encryption_threads = @saved_encryption_threads;
+SET GLOBAL innodb_default_encryption_key_id = @saved_encryption_key_id;
diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
new file mode 100644
index 00000000000..15c2a410948
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
@@ -0,0 +1,23 @@
+call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*");
+call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted.");
+call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]");
+# Restart mysqld --file-key-management-filename=keys2.txt
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set GLOBAL innodb_default_encryption_key_id=4;
+create table t1(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed;
+create table t2(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
+create table t3(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=no;
+insert into t1 values (1, repeat('secret',6000));
+insert into t2 values (1, repeat('secret',6000));
+insert into t3 values (1, repeat('secret',6000));
+# Restart mysqld --file-key-management-filename=keys3.txt
+select count(*) from t1 FORCE INDEX (b) where b like 'secret%';
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+select count(*) from t2 FORCE INDEX (b) where b like 'secret%';
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+select count(*) from t3 FORCE INDEX (b) where b like 'secret%';
+count(*)
+1
+# Restart mysqld --file-key-management-filename=keys2.txt
+drop table t1,t2,t3;
diff --git a/mysql-test/suite/encryption/r/innodb-discard-import-change.result b/mysql-test/suite/encryption/r/innodb-discard-import-change.result
new file mode 100644
index 00000000000..7071f9eaf20
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-discard-import-change.result
@@ -0,0 +1,105 @@
+call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+create table t1(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
+create table t2(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+create table t3(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes;
+create table t4(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes encrypted=yes encryption_key_id=4;
+create table t5(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb;
+insert into t1 values (NULL, 'verysecretmessage');
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t2 select * from t1;
+insert into t3 select * from t1;
+insert into t4 select * from t1;
+insert into t5 select * from t1;
+FLUSH TABLE t1,t2,t3,t4,t5 FOR EXPORT;
+backup: t1
+backup: t2
+backup: t3
+backup: t4
+backup: t5
+t1.cfg
+t1.frm
+t1.ibd
+t2.cfg
+t2.frm
+t2.ibd
+t3.cfg
+t3.frm
+t3.ibd
+t4.cfg
+t4.frm
+t4.ibd
+t5.cfg
+t5.frm
+t5.ibd
+UNLOCK TABLES;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+ALTER TABLE t5 DISCARD TABLESPACE;
+DROP TABLE t1;
+DROP TABLE t3;
+DROP TABLE t4;
+DROP TABLE t5;
+create table t6(a int) engine=innodb;
+create table t5(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb;
+create table t3(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes;
+create table t1(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
+create table t4(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes encrypted=yes encryption_key_id=4;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+ALTER TABLE t5 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+restore: t2 .ibd and .cfg files
+restore: t3 .ibd and .cfg files
+restore: t4 .ibd and .cfg files
+restore: t5 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` char(200) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=377 DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+256
+ALTER TABLE t2 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+256
+ALTER TABLE t3 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+256
+ALTER TABLE t4 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t4;
+COUNT(*)
+256
+ALTER TABLE t5 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t5;
+COUNT(*)
+256
+# t1 encrypted expecting NOT FOUND
+NOT FOUND /verysecretmessage/ in t1.ibd
+# t2 encrypted expecting NOT FOUND
+NOT FOUND /verysecretmessage/ in t2.ibd
+# t3 page compressed expecting NOT FOUND
+NOT FOUND /verysecretmessage/ in t3.ibd
+# t4 page compressed and encrypted expecting NOT FOUND
+NOT FOUND /verysecretmessage/ in t4.ibd
+# t5 normal expecting FOUND
+FOUND /verysecretmessage/ in t5.ibd
+DROP TABLE t1,t2,t3,t4,t5,t6;
diff --git a/mysql-test/suite/encryption/r/innodb-discard-import.result b/mysql-test/suite/encryption/r/innodb-discard-import.result
new file mode 100644
index 00000000000..06f4abab9f4
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-discard-import.result
@@ -0,0 +1,136 @@
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
+show warnings;
+Level Code Message
+create table t2(c1 bigint not null, b char(200)) engine=innodb page_compressed=1 encrypted=yes encryption_key_id=4;
+show warnings;
+Level Code Message
+create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
+show warnings;
+Level Code Message
+create table t4(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
+show warnings;
+Level Code Message
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into t1 values(current_num, repeat('foobar',30));
+insert into t2 values(current_num, repeat('barfoo',30));
+insert into t3 values(current_num, repeat('tmpres',30));
+insert into t4 values(current_num, repeat('mysql',30));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+select count(*) from t1;
+count(*)
+2000
+select count(*) from t2;
+count(*)
+2000
+select count(*) from t3;
+count(*)
+2000
+select count(*) from t4;
+count(*)
+2000
+FLUSH TABLE t1,t2,t3,t4 FOR EXPORT;
+# List before copying files
+t1.cfg
+t1.frm
+t1.ibd
+t2.cfg
+t2.frm
+t2.ibd
+t3.cfg
+t3.frm
+t3.ibd
+t4.cfg
+t4.frm
+t4.ibd
+backup: t1
+backup: t2
+backup: t3
+backup: t4
+t1.cfg
+t1.frm
+t1.ibd
+t2.cfg
+t2.frm
+t2.ibd
+t3.cfg
+t3.frm
+t3.ibd
+t4.cfg
+t4.frm
+t4.ibd
+UNLOCK TABLES;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+restore: t2 .ibd and .cfg files
+restore: t3 .ibd and .cfg files
+restore: t4 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2000
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `encrypted`=yes `encryption_key_id`=4
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+2000
+ALTER TABLE t3 IMPORT TABLESPACE;
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=4
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+2000
+ALTER TABLE t4 IMPORT TABLESPACE;
+SHOW CREATE TABLE t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1
+SELECT COUNT(*) FROM t4;
+COUNT(*)
+2000
+# tables should be still either encrypted and/or compressed
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+# t2 yes on expecting NOT FOUND
+NOT FOUND /barfoo/ in t2.ibd
+# t3 yes on expecting NOT FOUND
+NOT FOUND /tmpres/ in t3.ibd
+# t4 yes on expecting NOT FOUND
+NOT FOUND /mysql/ in t4.ibd
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/suite/encryption/r/innodb-encr-threads.result b/mysql-test/suite/encryption/r/innodb-encr-threads.result
new file mode 100644
index 00000000000..0178635afb7
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-encr-threads.result
@@ -0,0 +1,7 @@
+create table t1 (i int) engine=innodb;
+set global innodb_encryption_threads = 1;
+set global innodb_encryption_rotate_key_age = 2;
+insert t1 values (1);
+drop table t1;
+set global innodb_encryption_threads = 0;
+set global innodb_encryption_rotate_key_age = 1;
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-alter.result b/mysql-test/suite/encryption/r/innodb-encryption-alter.result
new file mode 100644
index 00000000000..9ff0f492034
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-encryption-alter.result
@@ -0,0 +1,52 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encrypt_tables = ON;
+SET GLOBAL innodb_encryption_threads = 4;
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=4;
+Warnings:
+Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 4 when encryption is disabled
+DROP TABLE t1;
+set innodb_default_encryption_key_id = 99;
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+SHOW WARNINGS;
+Level Code Message
+Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available
+Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+SHOW WARNINGS;
+Level Code Message
+Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available
+Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+set innodb_default_encryption_key_id = 4;
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `c` varchar(256) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `c` varchar(256) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTION_KEY_ID`=4
+CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
+Warnings:
+Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 1 when encryption is disabled
+ALTER TABLE t1 ENCRYPTION_KEY_ID=99;
+ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
+SHOW WARNINGS;
+Level Code Message
+Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available
+Error 1478 Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
+set innodb_default_encryption_key_id = 1;
+drop table t1,t2;
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
new file mode 100644
index 00000000000..dd2b025553e
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
@@ -0,0 +1,26 @@
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t5 cannot be decrypted.");
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
+create table t5 (
+`intcol1` int(32) DEFAULT NULL,
+`intcol2` int(32) DEFAULT NULL,
+`charcol1` varchar(128) DEFAULT NULL,
+`charcol2` varchar(128) DEFAULT NULL,
+`charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+insert into t5 values (1,2,'maria','db','encryption');
+CREATE TABLE `t1` (
+`intcol1` int(32) DEFAULT NULL,
+`intcol2` int(32) DEFAULT NULL,
+`charcol1` varchar(128) DEFAULT NULL,
+`charcol2` varchar(128) DEFAULT NULL,
+`charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB;
+insert into t1 values (1,2,'maria','db','encryption');
+alter table t1 encrypted='yes' `encryption_key_id`=1;
+select * from t1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+select * from t5;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+drop table t1;
+drop table t5;
diff --git a/mysql-test/suite/encryption/r/innodb-first-page-read.result b/mysql-test/suite/encryption/r/innodb-first-page-read.result
new file mode 100644
index 00000000000..6df80e8223d
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-first-page-read.result
@@ -0,0 +1,98 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+FLUSH STATUS;
+create database innodb_test;
+use innodb_test;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed;
+create table innodb_compressed1(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=1;
+create table innodb_compressed2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=2;
+create table innodb_compressed4(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=4;
+create table innodb_compressed8(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=8;
+create table innodb_compressed16(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=16;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
+create table innodb_pagecomp(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes;
+create table innodb_pagecomp1(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=1;
+create table innodb_pagecomp2(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=2;
+create table innodb_pagecomp3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=3;
+create table innodb_pagecomp4(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=4;
+create table innodb_pagecomp5(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=5;
+create table innodb_pagecomp6(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=6;
+create table innodb_pagecomp7(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=7;
+create table innodb_pagecomp8(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=8;
+create table innodb_pagecomp9(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=9;
+create table innodb_datadir1(c1 bigint not null, b char(200)) engine=innodb DATA DIRECTORY='MYSQL_TMP_DIR';
+create table innodb_datadir2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed DATA DIRECTORY='MYSQL_TMP_DIR';
+create table innodb_datadir3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes DATA DIRECTORY='MYSQL_TMP_DIR';
+begin;
+insert into innodb_normal values (1,'secret');
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_compressed1 select * from innodb_normal;
+insert into innodb_compressed2 select * from innodb_normal;
+insert into innodb_compressed4 select * from innodb_normal;
+insert into innodb_compressed8 select * from innodb_normal;
+insert into innodb_compressed16 select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+insert into innodb_pagecomp select * from innodb_normal;
+insert into innodb_pagecomp1 select * from innodb_normal;
+insert into innodb_pagecomp2 select * from innodb_normal;
+insert into innodb_pagecomp3 select * from innodb_normal;
+insert into innodb_pagecomp4 select * from innodb_normal;
+insert into innodb_pagecomp5 select * from innodb_normal;
+insert into innodb_pagecomp6 select * from innodb_normal;
+insert into innodb_pagecomp7 select * from innodb_normal;
+insert into innodb_pagecomp8 select * from innodb_normal;
+insert into innodb_pagecomp9 select * from innodb_normal;
+insert into innodb_datadir1 select * from innodb_normal;
+insert into innodb_datadir2 select * from innodb_normal;
+insert into innodb_datadir3 select * from innodb_normal;
+commit;
+FLUSH STATUS;
+# Restart server and see how many page 0's are read
+# result should actual number of tables except remote tables could be read twice
+# i.e. < 23 + 3*2 = 29
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+use innodb_test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+use test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+set global innodb_encrypt_tables=OFF;
+# wait until tables are decrypted
+# result should be actual number of tables except remote tables could be read twice
+# i.e. < 23 + 3*2 = 29
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+use innodb_test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+use test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+FLUSH STATUS;
+# restart and see number read page 0
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+use innodb_test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+use test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+VARIABLE_VALUE <= 29
+1
+drop database innodb_test;
+FLUSH STATUS;
diff --git a/mysql-test/suite/encryption/r/innodb-force-corrupt.result b/mysql-test/suite/encryption/r/innodb-force-corrupt.result
new file mode 100644
index 00000000000..3f3a2afb02d
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-force-corrupt.result
@@ -0,0 +1,29 @@
+CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed .*");
+CALL mtr.add_suppression("InnoDB: Corruption: Block in space_id .*");
+CALL mtr.add_suppression("InnoDB: However key management plugin or used key_version .*");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+# Create and populate tables to be corrupted
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT,c char(200)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT,c char(200)) ENGINE=InnoDB row_format=compressed encrypted=yes;
+CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT, c char(200)) ENGINE=InnoDB page_compressed=yes encrypted=yes;
+BEGIN;
+INSERT INTO t1 (b,c) VALUES ('corrupt me','secret');
+INSERT INTO t1 (b,c) VALUES ('corrupt me','moresecretmoresecret');
+INSERT INTO t2 select * from t1;
+INSERT INTO t3 select * from t1;
+COMMIT;
+# Backup tables before corrupting
+# Corrupt tables
+SELECT * FROM t1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SELECT * FROM t2;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SELECT * FROM t3;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+# Restore the original tables
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
new file mode 100644
index 00000000000..6c09e015a1e
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
@@ -0,0 +1,62 @@
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+create database enctests;
+use enctests;
+create table t1(a int not null primary key, b char(200)) engine=innodb;
+create table t2(a int not null primary key, b char(200)) engine=innodb row_format=compressed;
+create table t3(a int not null primary key, b char(200)) engine=innodb page_compressed=yes;
+create table t4(a int not null primary key, b char(200)) engine=innodb encrypted=yes;
+create table t5(a int not null primary key, b char(200)) engine=innodb encrypted=yes row_format=compressed;
+create table t6(a int not null primary key, b char(200)) engine=innodb encrypted=yes page_compressed=yes;
+create table t7(a int not null primary key, b char(200)) engine=innodb encrypted=no;
+create table t8(a int not null primary key, b char(200)) engine=innodb encrypted=no row_format=compressed;
+create table t9(a int not null primary key, b char(200)) engine=innodb encrypted=no page_compressed=yes;
+insert into t1 values (1, 'secredmessage');
+insert into t2 values (1, 'secredmessage');
+insert into t3 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc');
+insert into t4 values (1, 'secredmessage');
+insert into t5 values (1, 'secredmessage');
+insert into t6 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc');
+insert into t7 values (1, 'publicmessage');
+insert into t8 values (1, 'publicmessage');
+insert into t9 values (1, 'pugliccompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc');
+# should list tables t1-t6
+SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'enctests%';
+NAME ENCRYPTION_SCHEME CURRENT_KEY_ID
+enctests/t1 1 1
+enctests/t2 1 1
+enctests/t3 1 1
+enctests/t4 1 1
+enctests/t5 1 1
+enctests/t6 1 1
+# should list tables t7-t9
+SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 and NAME LIKE 'enctests%';
+NAME ENCRYPTION_SCHEME CURRENT_KEY_ID
+enctests/t7 0 1
+enctests/t8 0 1
+enctests/t9 0 1
+SET GLOBAL innodb_encrypt_tables=OFF;
+ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'OFF'
+SET GLOBAL innodb_encrypt_tables=ON;
+ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'ON'
+# t1 default on expecting NOT FOUND
+NOT FOUND /secred/ in t1.ibd
+# t2 default on expecting NOT FOUND
+NOT FOUND /secred/ in t2.ibd
+# t3 default on expecting NOT FOUND
+NOT FOUND /secred/ in t3.ibd
+# t4 on expecting NOT FOUND
+NOT FOUND /secred/ in t4.ibd
+# t5 on expecting NOT FOUND
+NOT FOUND /secred/ in t5.ibd
+# t6 on expecting NOT FOUND
+NOT FOUND /secred/ in t6.ibd
+# t7 off expecting FOUND
+FOUND /public/ in t7.ibd
+# t8 row compressed expecting NOT FOUND
+FOUND /public/ in t8.ibd
+# t9 page compressed expecting NOT FOUND
+NOT FOUND /public/ in t9.ibd
+drop database enctests;
diff --git a/mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result b/mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result
new file mode 100644
index 00000000000..5310fb6ace2
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result
@@ -0,0 +1,19 @@
+call mtr.add_suppression("InnoDB: New log files created, LSN=.*");
+call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");
+call mtr.add_suppression("InnoDB: Error: Table .*");
+CREATE TABLE t1 (
+pk bigint auto_increment,
+col_int int,
+col_int_key int,
+col_char char(12),
+col_char_key char(12),
+primary key (pk),
+key (`col_int_key` ),
+key (`col_char_key` )
+) ENGINE=InnoDB;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (NULL,1,1,'foo','foo'),(NULL,2,2,'bar','bar'),(NULL,3,3,'baz','baz'),(NULL,4,4,'qux','qux');
+INSERT INTO t2
+SELECT NULL, a1.col_int, a1.col_int_key, a1.col_char, a1.col_char_key
+FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5, t1 a6, t1 a7, t1 a8, t1 a9, t1 a10;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/r/innodb-log-encrypt.result b/mysql-test/suite/encryption/r/innodb-log-encrypt.result
new file mode 100644
index 00000000000..98fc277e513
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-log-encrypt.result
@@ -0,0 +1,55 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table t1(c1 bigint not null, b char(200), c varchar(200)) engine=innodb encrypted=yes encryption_key_id=1;
+show warnings;
+Level Code Message
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('privatejanprivate',10));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+begin;
+call innodb_insert_proc(2000);
+commit;
+update t1 set c1 = c1 +1;
+select count(*) from t1;
+count(*)
+2000
+# Kill the server
+# ibdata1 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in t1.ibd
+# log0 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in ib_logfile0
+# log1 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in ib_logfile1
+# Restart mysqld --innodb_encrypt_log=0
+insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+# ibdata1 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in t1.ibd
+# log0 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in ib_logfile0
+# log1 yes on expecting NOT FOUND
+NOT FOUND /privatejanprivate/ in ib_logfile1
+# ibdata1 yes on expecting NOT FOUND
+NOT FOUND /publicmessage/ in ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /publicmessage/ in t1.ibd
+# log0 no on expecting FOUND/NOTFOUND depending where insert goes
+FOUND /publicmessage/ in ib_logfile0
+# log1 no on expecting FOUND/NOTFOUND depending where insert goes
+NOT FOUND /publicmessage/ in ib_logfile1
+drop procedure innodb_insert_proc;
+drop table t1;
diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result
new file mode 100644
index 00000000000..2f2cc025973
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-missing-key.result
@@ -0,0 +1,54 @@
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+
+# Start server with keys2.txt
+CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19;
+CREATE TABLE t2(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+CREATE TABLE t3(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=NO;
+INSERT INTO t1(b) VALUES ('thisissecredmessage');
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t3 SELECT * FROM t1;
+
+# Restart server with keys3.txt
+set global innodb_encryption_rotate_key_age = 1;
+use test;
+CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+SELECT SLEEP(5);
+SLEEP(5)
+0
+SELECT COUNT(1) FROM t3;
+COUNT(1)
+2048
+SELECT COUNT(1) FROM t2;
+COUNT(1)
+2048
+SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SELECT COUNT(1) FROM t1 where b = 'ab';
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+SELECT COUNT(1) FROM t1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+
+# Start server with keys2.txt
+SELECT COUNT(1) FROM t1;
+COUNT(1)
+2048
+SELECT COUNT(1) FROM t2;
+COUNT(1)
+2048
+SELECT COUNT(1) FROM t3;
+COUNT(1)
+2048
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption-32k.result b/mysql-test/suite/encryption/r/innodb-page_encryption-32k.result
new file mode 100644
index 00000000000..6aa98a2fc68
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption-32k.result
@@ -0,0 +1,125 @@
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=3
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into innodb_normal values(current_num, substring(MD5(RAND()), -150));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+5000
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+5000
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+Warnings:
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
+drop table innodb_redundant;
diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption.result b/mysql-test/suite/encryption/r/innodb-page_encryption.result
new file mode 100644
index 00000000000..c4814983af4
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption.result
@@ -0,0 +1,277 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+show warnings;
+Level Code Message
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
+show warnings;
+Level Code Message
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
+show warnings;
+Level Code Message
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
+ERROR HY000: Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options")
+show warnings;
+Level Code Message
+Warning 140 InnoDB: ENCRYPTION_KEY_ID 3 not available
+Error 1005 Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
+show warnings;
+Level Code Message
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
+show warnings;
+Level Code Message
+set innodb_default_encryption_key_id = 5;
+create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb encrypted=yes;
+show create table innodb_defkey;
+Table Create Table
+innodb_defkey CREATE TABLE `innodb_defkey` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `ENCRYPTION_KEY_ID`=5
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=2
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+insert into innodb_defkey select * from innodb_normal;
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+update innodb_defkey set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compressed where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_defkey where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_defkey t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+update innodb_defkey set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compressed where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_defkey where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_defkey t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+show create table innodb_defkey;
+Table Create Table
+innodb_defkey CREATE TABLE `innodb_defkey` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `ENCRYPTION_KEY_ID`=5
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compressed where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_compressed;
+drop table innodb_dynamic;
+drop table innodb_redundant;
+drop table innodb_defkey;
diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result b/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result
new file mode 100644
index 00000000000..857a50d9831
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result
@@ -0,0 +1,73 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
+show warnings;
+Level Code Message
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1 page_compressed=1;
+show warnings;
+Level Code Message
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=2 page_compressed=1;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1 `page_compressed`=1
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=2 `page_compressed`=1
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into innodb_normal values(current_num, substring(MD5(RAND()), -128));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+begin;
+call innodb_insert_proc(2000);
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+commit;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+alter table innodb_normal engine=innodb page_compressed=DEFAULT;
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result b/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result
new file mode 100644
index 00000000000..411cf9aae9b
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result
@@ -0,0 +1,128 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+show warnings;
+Level Code Message
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
+show warnings;
+Level Code Message
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
+show warnings;
+Level Code Message
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
+show warnings;
+Level Code Message
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
+show warnings;
+Level Code Message
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=2
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+begin;
+call innodb_insert_proc(2000);
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+commit;
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value > 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value > 0
+1
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value > 0
+1
+SET GLOBAL innodb_encrypt_tables=OFF;
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_compressed;
+drop table innodb_dynamic;
+drop table innodb_redundant;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ENCRYPTION_KEY_ID=2 ENCRYPTED=YES;
+INSERT INTO t1 VALUES (1),(2);
+# Restarting server...
+SELECT * FROM t1;
+pk
+1
+2
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-read-only.result b/mysql-test/suite/encryption/r/innodb-read-only.result
new file mode 100644
index 00000000000..5d063e129e2
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-read-only.result
@@ -0,0 +1,3 @@
+# Wait max 10 min for key encryption threads to encrypt all spaces
+# Success!
+# All done
diff --git a/mysql-test/suite/encryption/r/innodb-redo-badkey.result b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
new file mode 100644
index 00000000000..e12dad6d0d7
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
@@ -0,0 +1,45 @@
+call mtr.add_suppression("InnoDB: Block in space_id .* in file .* encrypted.");
+call mtr.add_suppression("Plugin 'file_key_management' .*");
+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: Read operation failed for tablespace .*");
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
+call mtr.add_suppression("InnoDB: Recovery read page .*");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE .*");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted .*");
+call mtr.add_suppression("InnoDB: ############### CORRUPT LOG RECORD FOUND ##################");
+# Restart mysqld --file-key-management-filename=keys2.txt
+# Wait max 10 min for key encryption threads to encrypt all spaces
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
+create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed;
+create table t3(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=4;
+create table t4(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb;
+begin;
+insert into t2 select * from t1;
+insert into t3 select * from t1;
+insert into t4 select * from t1;
+commit;
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+begin;
+update t1 set c = repeat('secret3', 20);
+update t2 set c = repeat('secret4', 20);
+update t3 set c = repeat('secret4', 20);
+update t4 set c = repeat('secret4', 20);
+insert into t1 (c,b) values (repeat('secret5',20), repeat('secret6',6000));
+insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
+insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
+insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
+COMMIT;
+# Kill the server
+# restart
+# Kill the server
+# Restart mysqld --innodb-force-recovery=1
+# Kill the server
+# Restart mysqld --file-key-management-filename=keys2.txt
+drop table t1, t2,t3,t4;
diff --git a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
new file mode 100644
index 00000000000..dcbe1f5a395
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
@@ -0,0 +1,37 @@
+call mtr.add_suppression("InnoDB: Block in space_id .*");
+call mtr.add_suppression("mysqld: File .*");
+call mtr.add_suppression("Plugin 'file_key_management' .*");
+call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
+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: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+# Restart mysqld --file-key-management-filename=keys2.txt
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
+create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed;
+create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
+create table t4(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb;
+begin;
+insert into t2 select * from t1;
+insert into t3 select * from t1;
+insert into t4 select * from t1;
+commit;
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+begin;
+update t1 set c = repeat('secret3', 20);
+update t2 set c = repeat('secret4', 20);
+update t3 set c = repeat('secret4', 20);
+update t4 set c = repeat('secret4', 20);
+insert into t1 (c,b) values (repeat('secret5',20), repeat('secret6',6000));
+insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
+insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
+insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
+COMMIT;
+# Kill the server
+# restart
+# Restart mysqld --file-key-management-filename=keys2.txt
+drop table t1, t2,t3,t4;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result
new file mode 100644
index 00000000000..ec92825ac8e
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result
@@ -0,0 +1,184 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = on;
+set global innodb_compression_algorithm = 1;
+create table innodb_normal (c1 int, b char(20)) engine=innodb;
+show warnings;
+Level Code Message
+create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed1;
+Table Create Table
+innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1
+create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed2;
+Table Create Table
+innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2
+create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed3;
+Table Create Table
+innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3
+create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed4;
+Table Create Table
+innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4
+create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed5;
+Table Create Table
+innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5
+create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed6;
+Table Create Table
+innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6
+create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed7;
+Table Create Table
+innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7
+create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed8;
+Table Create Table
+innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
+show warnings;
+Level Code Message
+show create table innodb_page_compressed9;
+Table Create Table
+innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into innodb_normal values(current_num,'testing..');
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+begin;
+call innodb_insert_proc(2000);
+insert into innodb_page_compressed1 select * from innodb_normal;
+insert into innodb_page_compressed2 select * from innodb_normal;
+insert into innodb_page_compressed3 select * from innodb_normal;
+insert into innodb_page_compressed4 select * from innodb_normal;
+insert into innodb_page_compressed5 select * from innodb_normal;
+insert into innodb_page_compressed6 select * from innodb_normal;
+insert into innodb_page_compressed7 select * from innodb_normal;
+insert into innodb_page_compressed8 select * from innodb_normal;
+insert into innodb_page_compressed9 select * from innodb_normal;
+commit;
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+2000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+2000
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value > 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+variable_value > 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+variable_value >= 0
+1
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = off;
+update innodb_page_compressed1 set c1 = c1 + 1;
+update innodb_page_compressed2 set c1 = c1 + 1;
+update innodb_page_compressed3 set c1 = c1 + 1;
+update innodb_page_compressed4 set c1 = c1 + 1;
+update innodb_page_compressed5 set c1 = c1 + 1;
+update innodb_page_compressed6 set c1 = c1 + 1;
+update innodb_page_compressed7 set c1 = c1 + 1;
+update innodb_page_compressed8 set c1 = c1 + 1;
+update innodb_page_compressed9 set c1 = c1 + 1;
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value > 0
+1
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+variable_value > 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+variable_value >= 0
+1
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption.result b/mysql-test/suite/encryption/r/innodb_encryption.result
new file mode 100644
index 00000000000..5909674c21c
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption.result
@@ -0,0 +1,69 @@
+SET @start_global_value = @@global.innodb_encryption_threads;
+SHOW VARIABLES LIKE 'innodb_encrypt%';
+Variable_name Value
+innodb_encrypt_log ON
+innodb_encrypt_tables ON
+innodb_encryption_rotate_key_age 15
+innodb_encryption_rotation_iops 100
+innodb_encryption_threads 4
+SET GLOBAL innodb_encrypt_tables = ON;
+# Wait max 10 min for key encryption threads to encrypt all spaces
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+./ibdata1
+# Success!
+# Now turn off encryption and wait for threads to decrypt everything
+SET GLOBAL innodb_encrypt_tables = off;
+# Wait max 10 min for key encryption threads to encrypt all spaces
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+./ibdata1
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+# Success!
+# Shutdown innodb_encryption_threads
+SET GLOBAL innodb_encryption_threads=0;
+# Turn on encryption
+# since threads are off tables should remain unencrypted
+SET GLOBAL innodb_encrypt_tables = on;
+# Wait 15s to check that nothing gets encrypted
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+./ibdata1
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+# Success!
+# Startup innodb_encryption_threads
+SET GLOBAL innodb_encryption_threads=@start_global_value;
+# Wait max 10 min for key encryption threads to encrypt all spaces
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+./ibdata1
+# Success!
+# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
+SHOW VARIABLES LIKE 'innodb_encrypt%';
+Variable_name Value
+innodb_encrypt_log ON
+innodb_encrypt_tables OFF
+innodb_encryption_rotate_key_age 15
+innodb_encryption_rotation_iops 100
+innodb_encryption_threads 0
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+mysql/innodb_table_stats
+mysql/innodb_index_stats
+./ibdata1
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
new file mode 100644
index 00000000000..d08a6e943f4
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
@@ -0,0 +1,123 @@
+call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
+CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB row_format=compressed encrypted=yes;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into t1 values (current_num,repeat('foobar',42));
+insert into t2 values (current_num,repeat('temp', 42));
+insert into t3 values (current_num,repeat('barfoo',42));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(10000);
+commit;
+set autocommit=1;
+# Wait max 10 min for key encryption threads to encrypt all spaces
+# tablespaces should be now encrypted
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+# t2 ... on expecting NOT FOUND
+NOT FOUND /temp/ in t2.ibd
+# t3 ... on expecting NOT FOUND
+NOT FOUND /barfoo/ in t3.ibd
+t1.frm
+t1.ibd
+t2.frm
+t2.ibd
+t3.frm
+t3.ibd
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
+backup: t1
+backup: t2
+backup: t3
+t1.cfg
+t1.frm
+t1.ibd
+t2.cfg
+t2.frm
+t2.ibd
+t3.cfg
+t3.frm
+t3.ibd
+UNLOCK TABLES;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+restore: t2 .ibd and .cfg files
+restore: t3 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SELECT COUNT(1) FROM t1;
+COUNT(1)
+10000
+ALTER TABLE t2 IMPORT TABLESPACE;
+SELECT COUNT(1) FROM t2;
+COUNT(1)
+10000
+ALTER TABLE t3 IMPORT TABLESPACE;
+SELECT COUNT(1) FROM t3;
+COUNT(1)
+10000
+# tablespaces should remain encrypted after import
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+# t2 ... on expecting NOT FOUND
+NOT FOUND /temp/ in t2.ibd
+# t3 ... on expecting NOT FOUND
+NOT FOUND /barfoo/ in t3.ibd
+ALTER TABLE t1 ENGINE InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+ALTER TABLE t2 ENGINE InnoDB;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t3 ENGINE InnoDB;
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes
+# Restarting server
+# Done restarting server
+# Verify that tables are still usable
+SELECT COUNT(1) FROM t1;
+COUNT(1)
+10000
+SELECT COUNT(1) FROM t2;
+COUNT(1)
+10000
+SELECT COUNT(1) FROM t3;
+COUNT(1)
+10000
+# Tablespaces should be encrypted after restart
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+# t2 ... on expecting NOT FOUND
+NOT FOUND /temp/ in t2.ibd
+# t3 ... on expecting NOT FOUND
+NOT FOUND /barfoo/ in t3.ibd
+# Wait max 10 min for key encryption threads to encrypt all spaces
+# Success!
+# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result b/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result
new file mode 100644
index 00000000000..ab958004eab
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result
@@ -0,0 +1,67 @@
+call mtr.add_suppression("trying to do an operation on a dropped tablespace .*");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encrypt_tables = OFF;
+SET GLOBAL innodb_encryption_threads = 4;
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `c` varchar(256) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
+CREATE TABLE t3 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO;
+CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+INSERT INTO t2 select * from t1;
+INSERT INTO t3 select * from t1;
+INSERT INTO t4 select * from t1;
+SET GLOBAL innodb_encrypt_tables = on;
+# Wait max 10 min for key encryption threads to encrypt required all spaces
+# Success!
+SELECT COUNT(1) FROM t1;
+COUNT(1)
+400
+SELECT COUNT(1) FROM t2;
+COUNT(1)
+400
+SELECT COUNT(1) FROM t3;
+COUNT(1)
+400
+SELECT COUNT(1) FROM t4;
+COUNT(1)
+400
+SET GLOBAL innodb_encrypt_tables = off;
+# Wait max 10 min for key encryption threads to decrypt all required spaces
+# Success!
+SET GLOBAL innodb_encrypt_tables = ON;
+set GLOBAL innodb_default_encryption_key_id=4;
+CREATE TABLE t5 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+SHOW CREATE TABLE t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `c` varchar(256) DEFAULT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t5 select * from t1;
+# Wait max 10 min for key encryption threads to encrypt required all spaces
+# Success!
+SELECT COUNT(1) FROM t1;
+COUNT(1)
+400
+SELECT COUNT(1) FROM t2;
+COUNT(1)
+400
+SELECT COUNT(1) FROM t3;
+COUNT(1)
+400
+SELECT COUNT(1) FROM t4;
+COUNT(1)
+400
+SELECT COUNT(1) FROM t5;
+COUNT(1)
+400
+drop table t1,t2,t3,t4, t5;
+set GLOBAL innodb_default_encryption_key_id=1;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_is.result b/mysql-test/suite/encryption/r/innodb_encryption_is.result
new file mode 100644
index 00000000000..5bbcbbe6bb6
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_is.result
@@ -0,0 +1,14 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
+INSERT INTO t1 VALUES ('foobar');
+INSERT INTO t2 VALUES ('foobar');
+SELECT NAME, ENCRYPTION_SCHEME, MIN_KEY_VERSION, CURRENT_KEY_VERSION,
+CURRENT_KEY_ID
+FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+WHERE NAME LIKE '%t1' OR NAME LIKE '%t2';
+NAME ENCRYPTION_SCHEME MIN_KEY_VERSION CURRENT_KEY_VERSION CURRENT_KEY_ID
+test/t1 1 1 1 1
+test/t2 1 1 1 2
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_row_compressed.result b/mysql-test/suite/encryption/r/innodb_encryption_row_compressed.result
new file mode 100644
index 00000000000..355271ef9ca
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_row_compressed.result
@@ -0,0 +1,153 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table innodb_compressed1(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed encrypted=yes;
+create table innodb_compressed2(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=1 encrypted=yes;
+create table innodb_compressed3(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=2 encrypted=yes;
+create table innodb_compressed4(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=4 encrypted=yes;
+insert into innodb_compressed1 values (1, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (2, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (3, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (4, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (5, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (6, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (7, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (8, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (9, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (10, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed2 select * from innodb_compressed1;
+insert into innodb_compressed3 select * from innodb_compressed1;
+insert into innodb_compressed4 select * from innodb_compressed1;
+# t1 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed1.ibd
+# t2 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed2.ibd
+# t3 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed3.ibd
+# t4 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed4.ibd
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+select * from innodb_compressed1 where d = 20;
+c1 d a b
+1 20 private evenmoreprivate
+2 20 private evenmoreprivate
+8 20 private evenmoreprivate
+9 20 private evenmoreprivate
+10 20 private evenmoreprivate
+select * from innodb_compressed1 where d = 30;
+c1 d a b
+3 30 private evenmoreprivate
+4 30 private evenmoreprivate
+5 30 private evenmoreprivate
+6 30 private evenmoreprivate
+7 30 private evenmoreprivate
+select * from innodb_compressed2 where d = 20;
+c1 d a b
+1 20 private evenmoreprivate
+2 20 private evenmoreprivate
+8 20 private evenmoreprivate
+9 20 private evenmoreprivate
+10 20 private evenmoreprivate
+select * from innodb_compressed2 where d = 30;
+c1 d a b
+3 30 private evenmoreprivate
+4 30 private evenmoreprivate
+5 30 private evenmoreprivate
+6 30 private evenmoreprivate
+7 30 private evenmoreprivate
+select * from innodb_compressed3 where d = 20;
+c1 d a b
+1 20 private evenmoreprivate
+2 20 private evenmoreprivate
+8 20 private evenmoreprivate
+9 20 private evenmoreprivate
+10 20 private evenmoreprivate
+select * from innodb_compressed3 where d = 30;
+c1 d a b
+3 30 private evenmoreprivate
+4 30 private evenmoreprivate
+5 30 private evenmoreprivate
+6 30 private evenmoreprivate
+7 30 private evenmoreprivate
+select * from innodb_compressed4 where d = 20;
+c1 d a b
+1 20 private evenmoreprivate
+2 20 private evenmoreprivate
+8 20 private evenmoreprivate
+9 20 private evenmoreprivate
+10 20 private evenmoreprivate
+select * from innodb_compressed4 where d = 30;
+c1 d a b
+3 30 private evenmoreprivate
+4 30 private evenmoreprivate
+5 30 private evenmoreprivate
+6 30 private evenmoreprivate
+7 30 private evenmoreprivate
+update innodb_compressed1 set d = d + 10 where d = 30;
+update innodb_compressed2 set d = d + 10 where d = 30;
+update innodb_compressed3 set d = d + 10 where d = 30;
+update innodb_compressed4 set d = d + 10 where d = 30;
+insert into innodb_compressed1 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed2 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed3 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed4 values (20, 60, 'newprivate', 'newevenmoreprivate');
+# t1 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed1.ibd
+# t2 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed2.ibd
+# t3 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed3.ibd
+# t4 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed4.ibd
+select * from innodb_compressed1 where d = 40;
+c1 d a b
+3 40 private evenmoreprivate
+4 40 private evenmoreprivate
+5 40 private evenmoreprivate
+6 40 private evenmoreprivate
+7 40 private evenmoreprivate
+select * from innodb_compressed1 where d = 60;
+c1 d a b
+20 60 newprivate newevenmoreprivate
+select * from innodb_compressed2 where d = 40;
+c1 d a b
+3 40 private evenmoreprivate
+4 40 private evenmoreprivate
+5 40 private evenmoreprivate
+6 40 private evenmoreprivate
+7 40 private evenmoreprivate
+select * from innodb_compressed2 where d = 60;
+c1 d a b
+20 60 newprivate newevenmoreprivate
+select * from innodb_compressed3 where d = 40;
+c1 d a b
+3 40 private evenmoreprivate
+4 40 private evenmoreprivate
+5 40 private evenmoreprivate
+6 40 private evenmoreprivate
+7 40 private evenmoreprivate
+select * from innodb_compressed3 where d = 60;
+c1 d a b
+20 60 newprivate newevenmoreprivate
+select * from innodb_compressed4 where d = 40;
+c1 d a b
+3 40 private evenmoreprivate
+4 40 private evenmoreprivate
+5 40 private evenmoreprivate
+6 40 private evenmoreprivate
+7 40 private evenmoreprivate
+select * from innodb_compressed4 where d = 60;
+c1 d a b
+20 60 newprivate newevenmoreprivate
+# t1 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed1.ibd
+# t2 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed2.ibd
+# t3 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed3.ibd
+# t4 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed4.ibd
+drop table innodb_compressed1;
+drop table innodb_compressed2;
+drop table innodb_compressed3;
+drop table innodb_compressed4;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_tables.result b/mysql-test/suite/encryption/r/innodb_encryption_tables.result
new file mode 100644
index 00000000000..640e2be87a2
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_tables.result
@@ -0,0 +1,161 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_normal;
+count(*)
+2000
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compressed where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+variable_value >= 0
+1
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_normal;
+count(*)
+2000
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compressed where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_redundant where c1 < 1500000;
+count(*)
+2000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+2000
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+variable_value >= 0
+1
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
+drop table innodb_compressed;
+drop table innodb_redundant;
diff --git a/mysql-test/suite/encryption/r/innodb_first_page.result b/mysql-test/suite/encryption/r/innodb_first_page.result
new file mode 100644
index 00000000000..c2bbdb5695b
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_first_page.result
@@ -0,0 +1,5 @@
+call mtr.add_suppression("InnoDB: New log files created, LSN");
+call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+shutdown;
+create table t1 (a int);
+drop table t1;
diff --git a/mysql-test/suite/encryption/r/innodb_lotoftables.result b/mysql-test/suite/encryption/r/innodb_lotoftables.result
new file mode 100644
index 00000000000..c8b6e1a368e
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_lotoftables.result
@@ -0,0 +1,1235 @@
+SET GLOBAL innodb_fast_shutdown=0;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SHOW VARIABLES LIKE 'innodb_encrypt%';
+Variable_name Value
+innodb_encrypt_log OFF
+innodb_encrypt_tables OFF
+innodb_encryption_rotate_key_age 1
+innodb_encryption_rotation_iops 100
+innodb_encryption_threads 0
+create database innodb_encrypted_1;
+use innodb_encrypted_1;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+set autocommit=0;
+set autocommit=1;
+commit work;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+# should be empty
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE NAME LIKE 'innodb_encrypted%';
+NAME
+create database innodb_encrypted_2;
+use innodb_encrypted_2;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+set autocommit=0;
+commit work;
+set autocommit=1;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+# should contain 100 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_2/t_1
+innodb_encrypted_2/t_10
+innodb_encrypted_2/t_100
+innodb_encrypted_2/t_11
+innodb_encrypted_2/t_12
+innodb_encrypted_2/t_13
+innodb_encrypted_2/t_14
+innodb_encrypted_2/t_15
+innodb_encrypted_2/t_16
+innodb_encrypted_2/t_17
+innodb_encrypted_2/t_18
+innodb_encrypted_2/t_19
+innodb_encrypted_2/t_2
+innodb_encrypted_2/t_20
+innodb_encrypted_2/t_21
+innodb_encrypted_2/t_22
+innodb_encrypted_2/t_23
+innodb_encrypted_2/t_24
+innodb_encrypted_2/t_25
+innodb_encrypted_2/t_26
+innodb_encrypted_2/t_27
+innodb_encrypted_2/t_28
+innodb_encrypted_2/t_29
+innodb_encrypted_2/t_3
+innodb_encrypted_2/t_30
+innodb_encrypted_2/t_31
+innodb_encrypted_2/t_32
+innodb_encrypted_2/t_33
+innodb_encrypted_2/t_34
+innodb_encrypted_2/t_35
+innodb_encrypted_2/t_36
+innodb_encrypted_2/t_37
+innodb_encrypted_2/t_38
+innodb_encrypted_2/t_39
+innodb_encrypted_2/t_4
+innodb_encrypted_2/t_40
+innodb_encrypted_2/t_41
+innodb_encrypted_2/t_42
+innodb_encrypted_2/t_43
+innodb_encrypted_2/t_44
+innodb_encrypted_2/t_45
+innodb_encrypted_2/t_46
+innodb_encrypted_2/t_47
+innodb_encrypted_2/t_48
+innodb_encrypted_2/t_49
+innodb_encrypted_2/t_5
+innodb_encrypted_2/t_50
+innodb_encrypted_2/t_51
+innodb_encrypted_2/t_52
+innodb_encrypted_2/t_53
+innodb_encrypted_2/t_54
+innodb_encrypted_2/t_55
+innodb_encrypted_2/t_56
+innodb_encrypted_2/t_57
+innodb_encrypted_2/t_58
+innodb_encrypted_2/t_59
+innodb_encrypted_2/t_6
+innodb_encrypted_2/t_60
+innodb_encrypted_2/t_61
+innodb_encrypted_2/t_62
+innodb_encrypted_2/t_63
+innodb_encrypted_2/t_64
+innodb_encrypted_2/t_65
+innodb_encrypted_2/t_66
+innodb_encrypted_2/t_67
+innodb_encrypted_2/t_68
+innodb_encrypted_2/t_69
+innodb_encrypted_2/t_7
+innodb_encrypted_2/t_70
+innodb_encrypted_2/t_71
+innodb_encrypted_2/t_72
+innodb_encrypted_2/t_73
+innodb_encrypted_2/t_74
+innodb_encrypted_2/t_75
+innodb_encrypted_2/t_76
+innodb_encrypted_2/t_77
+innodb_encrypted_2/t_78
+innodb_encrypted_2/t_79
+innodb_encrypted_2/t_8
+innodb_encrypted_2/t_80
+innodb_encrypted_2/t_81
+innodb_encrypted_2/t_82
+innodb_encrypted_2/t_83
+innodb_encrypted_2/t_84
+innodb_encrypted_2/t_85
+innodb_encrypted_2/t_86
+innodb_encrypted_2/t_87
+innodb_encrypted_2/t_88
+innodb_encrypted_2/t_89
+innodb_encrypted_2/t_9
+innodb_encrypted_2/t_90
+innodb_encrypted_2/t_91
+innodb_encrypted_2/t_92
+innodb_encrypted_2/t_93
+innodb_encrypted_2/t_94
+innodb_encrypted_2/t_95
+innodb_encrypted_2/t_96
+innodb_encrypted_2/t_97
+innodb_encrypted_2/t_98
+innodb_encrypted_2/t_99
+# should contain 0 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+create database innodb_encrypted_3;
+use innodb_encrypted_3;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+set autocommit=0;
+commit work;
+set autocommit=1;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+# should contain 100 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_2/t_1
+innodb_encrypted_2/t_10
+innodb_encrypted_2/t_100
+innodb_encrypted_2/t_11
+innodb_encrypted_2/t_12
+innodb_encrypted_2/t_13
+innodb_encrypted_2/t_14
+innodb_encrypted_2/t_15
+innodb_encrypted_2/t_16
+innodb_encrypted_2/t_17
+innodb_encrypted_2/t_18
+innodb_encrypted_2/t_19
+innodb_encrypted_2/t_2
+innodb_encrypted_2/t_20
+innodb_encrypted_2/t_21
+innodb_encrypted_2/t_22
+innodb_encrypted_2/t_23
+innodb_encrypted_2/t_24
+innodb_encrypted_2/t_25
+innodb_encrypted_2/t_26
+innodb_encrypted_2/t_27
+innodb_encrypted_2/t_28
+innodb_encrypted_2/t_29
+innodb_encrypted_2/t_3
+innodb_encrypted_2/t_30
+innodb_encrypted_2/t_31
+innodb_encrypted_2/t_32
+innodb_encrypted_2/t_33
+innodb_encrypted_2/t_34
+innodb_encrypted_2/t_35
+innodb_encrypted_2/t_36
+innodb_encrypted_2/t_37
+innodb_encrypted_2/t_38
+innodb_encrypted_2/t_39
+innodb_encrypted_2/t_4
+innodb_encrypted_2/t_40
+innodb_encrypted_2/t_41
+innodb_encrypted_2/t_42
+innodb_encrypted_2/t_43
+innodb_encrypted_2/t_44
+innodb_encrypted_2/t_45
+innodb_encrypted_2/t_46
+innodb_encrypted_2/t_47
+innodb_encrypted_2/t_48
+innodb_encrypted_2/t_49
+innodb_encrypted_2/t_5
+innodb_encrypted_2/t_50
+innodb_encrypted_2/t_51
+innodb_encrypted_2/t_52
+innodb_encrypted_2/t_53
+innodb_encrypted_2/t_54
+innodb_encrypted_2/t_55
+innodb_encrypted_2/t_56
+innodb_encrypted_2/t_57
+innodb_encrypted_2/t_58
+innodb_encrypted_2/t_59
+innodb_encrypted_2/t_6
+innodb_encrypted_2/t_60
+innodb_encrypted_2/t_61
+innodb_encrypted_2/t_62
+innodb_encrypted_2/t_63
+innodb_encrypted_2/t_64
+innodb_encrypted_2/t_65
+innodb_encrypted_2/t_66
+innodb_encrypted_2/t_67
+innodb_encrypted_2/t_68
+innodb_encrypted_2/t_69
+innodb_encrypted_2/t_7
+innodb_encrypted_2/t_70
+innodb_encrypted_2/t_71
+innodb_encrypted_2/t_72
+innodb_encrypted_2/t_73
+innodb_encrypted_2/t_74
+innodb_encrypted_2/t_75
+innodb_encrypted_2/t_76
+innodb_encrypted_2/t_77
+innodb_encrypted_2/t_78
+innodb_encrypted_2/t_79
+innodb_encrypted_2/t_8
+innodb_encrypted_2/t_80
+innodb_encrypted_2/t_81
+innodb_encrypted_2/t_82
+innodb_encrypted_2/t_83
+innodb_encrypted_2/t_84
+innodb_encrypted_2/t_85
+innodb_encrypted_2/t_86
+innodb_encrypted_2/t_87
+innodb_encrypted_2/t_88
+innodb_encrypted_2/t_89
+innodb_encrypted_2/t_9
+innodb_encrypted_2/t_90
+innodb_encrypted_2/t_91
+innodb_encrypted_2/t_92
+innodb_encrypted_2/t_93
+innodb_encrypted_2/t_94
+innodb_encrypted_2/t_95
+innodb_encrypted_2/t_96
+innodb_encrypted_2/t_97
+innodb_encrypted_2/t_98
+innodb_encrypted_2/t_99
+# should contain 100 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_3/t_1
+innodb_encrypted_3/t_10
+innodb_encrypted_3/t_100
+innodb_encrypted_3/t_11
+innodb_encrypted_3/t_12
+innodb_encrypted_3/t_13
+innodb_encrypted_3/t_14
+innodb_encrypted_3/t_15
+innodb_encrypted_3/t_16
+innodb_encrypted_3/t_17
+innodb_encrypted_3/t_18
+innodb_encrypted_3/t_19
+innodb_encrypted_3/t_2
+innodb_encrypted_3/t_20
+innodb_encrypted_3/t_21
+innodb_encrypted_3/t_22
+innodb_encrypted_3/t_23
+innodb_encrypted_3/t_24
+innodb_encrypted_3/t_25
+innodb_encrypted_3/t_26
+innodb_encrypted_3/t_27
+innodb_encrypted_3/t_28
+innodb_encrypted_3/t_29
+innodb_encrypted_3/t_3
+innodb_encrypted_3/t_30
+innodb_encrypted_3/t_31
+innodb_encrypted_3/t_32
+innodb_encrypted_3/t_33
+innodb_encrypted_3/t_34
+innodb_encrypted_3/t_35
+innodb_encrypted_3/t_36
+innodb_encrypted_3/t_37
+innodb_encrypted_3/t_38
+innodb_encrypted_3/t_39
+innodb_encrypted_3/t_4
+innodb_encrypted_3/t_40
+innodb_encrypted_3/t_41
+innodb_encrypted_3/t_42
+innodb_encrypted_3/t_43
+innodb_encrypted_3/t_44
+innodb_encrypted_3/t_45
+innodb_encrypted_3/t_46
+innodb_encrypted_3/t_47
+innodb_encrypted_3/t_48
+innodb_encrypted_3/t_49
+innodb_encrypted_3/t_5
+innodb_encrypted_3/t_50
+innodb_encrypted_3/t_51
+innodb_encrypted_3/t_52
+innodb_encrypted_3/t_53
+innodb_encrypted_3/t_54
+innodb_encrypted_3/t_55
+innodb_encrypted_3/t_56
+innodb_encrypted_3/t_57
+innodb_encrypted_3/t_58
+innodb_encrypted_3/t_59
+innodb_encrypted_3/t_6
+innodb_encrypted_3/t_60
+innodb_encrypted_3/t_61
+innodb_encrypted_3/t_62
+innodb_encrypted_3/t_63
+innodb_encrypted_3/t_64
+innodb_encrypted_3/t_65
+innodb_encrypted_3/t_66
+innodb_encrypted_3/t_67
+innodb_encrypted_3/t_68
+innodb_encrypted_3/t_69
+innodb_encrypted_3/t_7
+innodb_encrypted_3/t_70
+innodb_encrypted_3/t_71
+innodb_encrypted_3/t_72
+innodb_encrypted_3/t_73
+innodb_encrypted_3/t_74
+innodb_encrypted_3/t_75
+innodb_encrypted_3/t_76
+innodb_encrypted_3/t_77
+innodb_encrypted_3/t_78
+innodb_encrypted_3/t_79
+innodb_encrypted_3/t_8
+innodb_encrypted_3/t_80
+innodb_encrypted_3/t_81
+innodb_encrypted_3/t_82
+innodb_encrypted_3/t_83
+innodb_encrypted_3/t_84
+innodb_encrypted_3/t_85
+innodb_encrypted_3/t_86
+innodb_encrypted_3/t_87
+innodb_encrypted_3/t_88
+innodb_encrypted_3/t_89
+innodb_encrypted_3/t_9
+innodb_encrypted_3/t_90
+innodb_encrypted_3/t_91
+innodb_encrypted_3/t_92
+innodb_encrypted_3/t_93
+innodb_encrypted_3/t_94
+innodb_encrypted_3/t_95
+innodb_encrypted_3/t_96
+innodb_encrypted_3/t_97
+innodb_encrypted_3/t_98
+innodb_encrypted_3/t_99
+use test;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_2/t_1
+innodb_encrypted_2/t_10
+innodb_encrypted_2/t_100
+innodb_encrypted_2/t_11
+innodb_encrypted_2/t_12
+innodb_encrypted_2/t_13
+innodb_encrypted_2/t_14
+innodb_encrypted_2/t_15
+innodb_encrypted_2/t_16
+innodb_encrypted_2/t_17
+innodb_encrypted_2/t_18
+innodb_encrypted_2/t_19
+innodb_encrypted_2/t_2
+innodb_encrypted_2/t_20
+innodb_encrypted_2/t_21
+innodb_encrypted_2/t_22
+innodb_encrypted_2/t_23
+innodb_encrypted_2/t_24
+innodb_encrypted_2/t_25
+innodb_encrypted_2/t_26
+innodb_encrypted_2/t_27
+innodb_encrypted_2/t_28
+innodb_encrypted_2/t_29
+innodb_encrypted_2/t_3
+innodb_encrypted_2/t_30
+innodb_encrypted_2/t_31
+innodb_encrypted_2/t_32
+innodb_encrypted_2/t_33
+innodb_encrypted_2/t_34
+innodb_encrypted_2/t_35
+innodb_encrypted_2/t_36
+innodb_encrypted_2/t_37
+innodb_encrypted_2/t_38
+innodb_encrypted_2/t_39
+innodb_encrypted_2/t_4
+innodb_encrypted_2/t_40
+innodb_encrypted_2/t_41
+innodb_encrypted_2/t_42
+innodb_encrypted_2/t_43
+innodb_encrypted_2/t_44
+innodb_encrypted_2/t_45
+innodb_encrypted_2/t_46
+innodb_encrypted_2/t_47
+innodb_encrypted_2/t_48
+innodb_encrypted_2/t_49
+innodb_encrypted_2/t_5
+innodb_encrypted_2/t_50
+innodb_encrypted_2/t_51
+innodb_encrypted_2/t_52
+innodb_encrypted_2/t_53
+innodb_encrypted_2/t_54
+innodb_encrypted_2/t_55
+innodb_encrypted_2/t_56
+innodb_encrypted_2/t_57
+innodb_encrypted_2/t_58
+innodb_encrypted_2/t_59
+innodb_encrypted_2/t_6
+innodb_encrypted_2/t_60
+innodb_encrypted_2/t_61
+innodb_encrypted_2/t_62
+innodb_encrypted_2/t_63
+innodb_encrypted_2/t_64
+innodb_encrypted_2/t_65
+innodb_encrypted_2/t_66
+innodb_encrypted_2/t_67
+innodb_encrypted_2/t_68
+innodb_encrypted_2/t_69
+innodb_encrypted_2/t_7
+innodb_encrypted_2/t_70
+innodb_encrypted_2/t_71
+innodb_encrypted_2/t_72
+innodb_encrypted_2/t_73
+innodb_encrypted_2/t_74
+innodb_encrypted_2/t_75
+innodb_encrypted_2/t_76
+innodb_encrypted_2/t_77
+innodb_encrypted_2/t_78
+innodb_encrypted_2/t_79
+innodb_encrypted_2/t_8
+innodb_encrypted_2/t_80
+innodb_encrypted_2/t_81
+innodb_encrypted_2/t_82
+innodb_encrypted_2/t_83
+innodb_encrypted_2/t_84
+innodb_encrypted_2/t_85
+innodb_encrypted_2/t_86
+innodb_encrypted_2/t_87
+innodb_encrypted_2/t_88
+innodb_encrypted_2/t_89
+innodb_encrypted_2/t_9
+innodb_encrypted_2/t_90
+innodb_encrypted_2/t_91
+innodb_encrypted_2/t_92
+innodb_encrypted_2/t_93
+innodb_encrypted_2/t_94
+innodb_encrypted_2/t_95
+innodb_encrypted_2/t_96
+innodb_encrypted_2/t_97
+innodb_encrypted_2/t_98
+innodb_encrypted_2/t_99
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_3/t_1
+innodb_encrypted_3/t_10
+innodb_encrypted_3/t_100
+innodb_encrypted_3/t_11
+innodb_encrypted_3/t_12
+innodb_encrypted_3/t_13
+innodb_encrypted_3/t_14
+innodb_encrypted_3/t_15
+innodb_encrypted_3/t_16
+innodb_encrypted_3/t_17
+innodb_encrypted_3/t_18
+innodb_encrypted_3/t_19
+innodb_encrypted_3/t_2
+innodb_encrypted_3/t_20
+innodb_encrypted_3/t_21
+innodb_encrypted_3/t_22
+innodb_encrypted_3/t_23
+innodb_encrypted_3/t_24
+innodb_encrypted_3/t_25
+innodb_encrypted_3/t_26
+innodb_encrypted_3/t_27
+innodb_encrypted_3/t_28
+innodb_encrypted_3/t_29
+innodb_encrypted_3/t_3
+innodb_encrypted_3/t_30
+innodb_encrypted_3/t_31
+innodb_encrypted_3/t_32
+innodb_encrypted_3/t_33
+innodb_encrypted_3/t_34
+innodb_encrypted_3/t_35
+innodb_encrypted_3/t_36
+innodb_encrypted_3/t_37
+innodb_encrypted_3/t_38
+innodb_encrypted_3/t_39
+innodb_encrypted_3/t_4
+innodb_encrypted_3/t_40
+innodb_encrypted_3/t_41
+innodb_encrypted_3/t_42
+innodb_encrypted_3/t_43
+innodb_encrypted_3/t_44
+innodb_encrypted_3/t_45
+innodb_encrypted_3/t_46
+innodb_encrypted_3/t_47
+innodb_encrypted_3/t_48
+innodb_encrypted_3/t_49
+innodb_encrypted_3/t_5
+innodb_encrypted_3/t_50
+innodb_encrypted_3/t_51
+innodb_encrypted_3/t_52
+innodb_encrypted_3/t_53
+innodb_encrypted_3/t_54
+innodb_encrypted_3/t_55
+innodb_encrypted_3/t_56
+innodb_encrypted_3/t_57
+innodb_encrypted_3/t_58
+innodb_encrypted_3/t_59
+innodb_encrypted_3/t_6
+innodb_encrypted_3/t_60
+innodb_encrypted_3/t_61
+innodb_encrypted_3/t_62
+innodb_encrypted_3/t_63
+innodb_encrypted_3/t_64
+innodb_encrypted_3/t_65
+innodb_encrypted_3/t_66
+innodb_encrypted_3/t_67
+innodb_encrypted_3/t_68
+innodb_encrypted_3/t_69
+innodb_encrypted_3/t_7
+innodb_encrypted_3/t_70
+innodb_encrypted_3/t_71
+innodb_encrypted_3/t_72
+innodb_encrypted_3/t_73
+innodb_encrypted_3/t_74
+innodb_encrypted_3/t_75
+innodb_encrypted_3/t_76
+innodb_encrypted_3/t_77
+innodb_encrypted_3/t_78
+innodb_encrypted_3/t_79
+innodb_encrypted_3/t_8
+innodb_encrypted_3/t_80
+innodb_encrypted_3/t_81
+innodb_encrypted_3/t_82
+innodb_encrypted_3/t_83
+innodb_encrypted_3/t_84
+innodb_encrypted_3/t_85
+innodb_encrypted_3/t_86
+innodb_encrypted_3/t_87
+innodb_encrypted_3/t_88
+innodb_encrypted_3/t_89
+innodb_encrypted_3/t_9
+innodb_encrypted_3/t_90
+innodb_encrypted_3/t_91
+innodb_encrypted_3/t_92
+innodb_encrypted_3/t_93
+innodb_encrypted_3/t_94
+innodb_encrypted_3/t_95
+innodb_encrypted_3/t_96
+innodb_encrypted_3/t_97
+innodb_encrypted_3/t_98
+innodb_encrypted_3/t_99
+SET GLOBAL innodb_encrypt_tables = on;
+SET GLOBAL innodb_encryption_threads=4;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_2/t_1
+innodb_encrypted_2/t_10
+innodb_encrypted_2/t_100
+innodb_encrypted_2/t_11
+innodb_encrypted_2/t_12
+innodb_encrypted_2/t_13
+innodb_encrypted_2/t_14
+innodb_encrypted_2/t_15
+innodb_encrypted_2/t_16
+innodb_encrypted_2/t_17
+innodb_encrypted_2/t_18
+innodb_encrypted_2/t_19
+innodb_encrypted_2/t_2
+innodb_encrypted_2/t_20
+innodb_encrypted_2/t_21
+innodb_encrypted_2/t_22
+innodb_encrypted_2/t_23
+innodb_encrypted_2/t_24
+innodb_encrypted_2/t_25
+innodb_encrypted_2/t_26
+innodb_encrypted_2/t_27
+innodb_encrypted_2/t_28
+innodb_encrypted_2/t_29
+innodb_encrypted_2/t_3
+innodb_encrypted_2/t_30
+innodb_encrypted_2/t_31
+innodb_encrypted_2/t_32
+innodb_encrypted_2/t_33
+innodb_encrypted_2/t_34
+innodb_encrypted_2/t_35
+innodb_encrypted_2/t_36
+innodb_encrypted_2/t_37
+innodb_encrypted_2/t_38
+innodb_encrypted_2/t_39
+innodb_encrypted_2/t_4
+innodb_encrypted_2/t_40
+innodb_encrypted_2/t_41
+innodb_encrypted_2/t_42
+innodb_encrypted_2/t_43
+innodb_encrypted_2/t_44
+innodb_encrypted_2/t_45
+innodb_encrypted_2/t_46
+innodb_encrypted_2/t_47
+innodb_encrypted_2/t_48
+innodb_encrypted_2/t_49
+innodb_encrypted_2/t_5
+innodb_encrypted_2/t_50
+innodb_encrypted_2/t_51
+innodb_encrypted_2/t_52
+innodb_encrypted_2/t_53
+innodb_encrypted_2/t_54
+innodb_encrypted_2/t_55
+innodb_encrypted_2/t_56
+innodb_encrypted_2/t_57
+innodb_encrypted_2/t_58
+innodb_encrypted_2/t_59
+innodb_encrypted_2/t_6
+innodb_encrypted_2/t_60
+innodb_encrypted_2/t_61
+innodb_encrypted_2/t_62
+innodb_encrypted_2/t_63
+innodb_encrypted_2/t_64
+innodb_encrypted_2/t_65
+innodb_encrypted_2/t_66
+innodb_encrypted_2/t_67
+innodb_encrypted_2/t_68
+innodb_encrypted_2/t_69
+innodb_encrypted_2/t_7
+innodb_encrypted_2/t_70
+innodb_encrypted_2/t_71
+innodb_encrypted_2/t_72
+innodb_encrypted_2/t_73
+innodb_encrypted_2/t_74
+innodb_encrypted_2/t_75
+innodb_encrypted_2/t_76
+innodb_encrypted_2/t_77
+innodb_encrypted_2/t_78
+innodb_encrypted_2/t_79
+innodb_encrypted_2/t_8
+innodb_encrypted_2/t_80
+innodb_encrypted_2/t_81
+innodb_encrypted_2/t_82
+innodb_encrypted_2/t_83
+innodb_encrypted_2/t_84
+innodb_encrypted_2/t_85
+innodb_encrypted_2/t_86
+innodb_encrypted_2/t_87
+innodb_encrypted_2/t_88
+innodb_encrypted_2/t_89
+innodb_encrypted_2/t_9
+innodb_encrypted_2/t_90
+innodb_encrypted_2/t_91
+innodb_encrypted_2/t_92
+innodb_encrypted_2/t_93
+innodb_encrypted_2/t_94
+innodb_encrypted_2/t_95
+innodb_encrypted_2/t_96
+innodb_encrypted_2/t_97
+innodb_encrypted_2/t_98
+innodb_encrypted_2/t_99
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_3/t_1
+innodb_encrypted_3/t_10
+innodb_encrypted_3/t_100
+innodb_encrypted_3/t_11
+innodb_encrypted_3/t_12
+innodb_encrypted_3/t_13
+innodb_encrypted_3/t_14
+innodb_encrypted_3/t_15
+innodb_encrypted_3/t_16
+innodb_encrypted_3/t_17
+innodb_encrypted_3/t_18
+innodb_encrypted_3/t_19
+innodb_encrypted_3/t_2
+innodb_encrypted_3/t_20
+innodb_encrypted_3/t_21
+innodb_encrypted_3/t_22
+innodb_encrypted_3/t_23
+innodb_encrypted_3/t_24
+innodb_encrypted_3/t_25
+innodb_encrypted_3/t_26
+innodb_encrypted_3/t_27
+innodb_encrypted_3/t_28
+innodb_encrypted_3/t_29
+innodb_encrypted_3/t_3
+innodb_encrypted_3/t_30
+innodb_encrypted_3/t_31
+innodb_encrypted_3/t_32
+innodb_encrypted_3/t_33
+innodb_encrypted_3/t_34
+innodb_encrypted_3/t_35
+innodb_encrypted_3/t_36
+innodb_encrypted_3/t_37
+innodb_encrypted_3/t_38
+innodb_encrypted_3/t_39
+innodb_encrypted_3/t_4
+innodb_encrypted_3/t_40
+innodb_encrypted_3/t_41
+innodb_encrypted_3/t_42
+innodb_encrypted_3/t_43
+innodb_encrypted_3/t_44
+innodb_encrypted_3/t_45
+innodb_encrypted_3/t_46
+innodb_encrypted_3/t_47
+innodb_encrypted_3/t_48
+innodb_encrypted_3/t_49
+innodb_encrypted_3/t_5
+innodb_encrypted_3/t_50
+innodb_encrypted_3/t_51
+innodb_encrypted_3/t_52
+innodb_encrypted_3/t_53
+innodb_encrypted_3/t_54
+innodb_encrypted_3/t_55
+innodb_encrypted_3/t_56
+innodb_encrypted_3/t_57
+innodb_encrypted_3/t_58
+innodb_encrypted_3/t_59
+innodb_encrypted_3/t_6
+innodb_encrypted_3/t_60
+innodb_encrypted_3/t_61
+innodb_encrypted_3/t_62
+innodb_encrypted_3/t_63
+innodb_encrypted_3/t_64
+innodb_encrypted_3/t_65
+innodb_encrypted_3/t_66
+innodb_encrypted_3/t_67
+innodb_encrypted_3/t_68
+innodb_encrypted_3/t_69
+innodb_encrypted_3/t_7
+innodb_encrypted_3/t_70
+innodb_encrypted_3/t_71
+innodb_encrypted_3/t_72
+innodb_encrypted_3/t_73
+innodb_encrypted_3/t_74
+innodb_encrypted_3/t_75
+innodb_encrypted_3/t_76
+innodb_encrypted_3/t_77
+innodb_encrypted_3/t_78
+innodb_encrypted_3/t_79
+innodb_encrypted_3/t_8
+innodb_encrypted_3/t_80
+innodb_encrypted_3/t_81
+innodb_encrypted_3/t_82
+innodb_encrypted_3/t_83
+innodb_encrypted_3/t_84
+innodb_encrypted_3/t_85
+innodb_encrypted_3/t_86
+innodb_encrypted_3/t_87
+innodb_encrypted_3/t_88
+innodb_encrypted_3/t_89
+innodb_encrypted_3/t_9
+innodb_encrypted_3/t_90
+innodb_encrypted_3/t_91
+innodb_encrypted_3/t_92
+innodb_encrypted_3/t_93
+innodb_encrypted_3/t_94
+innodb_encrypted_3/t_95
+innodb_encrypted_3/t_96
+innodb_encrypted_3/t_97
+innodb_encrypted_3/t_98
+innodb_encrypted_3/t_99
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+# Success!
+# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
+# Restart Success!
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+use test;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+use innodb_encrypted_1;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+use innodb_encrypted_2;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+use innodb_encrypted_3;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+use innodb_encrypted_1;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 3
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 103
+use innodb_encrypted_2;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 103
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 203
+use innodb_encrypted_3;
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 203
+show status like 'innodb_pages0_read%';
+Variable_name Value
+Innodb_pages0_read 303
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_3/t_1
+innodb_encrypted_3/t_10
+innodb_encrypted_3/t_100
+innodb_encrypted_3/t_11
+innodb_encrypted_3/t_12
+innodb_encrypted_3/t_13
+innodb_encrypted_3/t_14
+innodb_encrypted_3/t_15
+innodb_encrypted_3/t_16
+innodb_encrypted_3/t_17
+innodb_encrypted_3/t_18
+innodb_encrypted_3/t_19
+innodb_encrypted_3/t_2
+innodb_encrypted_3/t_20
+innodb_encrypted_3/t_21
+innodb_encrypted_3/t_22
+innodb_encrypted_3/t_23
+innodb_encrypted_3/t_24
+innodb_encrypted_3/t_25
+innodb_encrypted_3/t_26
+innodb_encrypted_3/t_27
+innodb_encrypted_3/t_28
+innodb_encrypted_3/t_29
+innodb_encrypted_3/t_3
+innodb_encrypted_3/t_30
+innodb_encrypted_3/t_31
+innodb_encrypted_3/t_32
+innodb_encrypted_3/t_33
+innodb_encrypted_3/t_34
+innodb_encrypted_3/t_35
+innodb_encrypted_3/t_36
+innodb_encrypted_3/t_37
+innodb_encrypted_3/t_38
+innodb_encrypted_3/t_39
+innodb_encrypted_3/t_4
+innodb_encrypted_3/t_40
+innodb_encrypted_3/t_41
+innodb_encrypted_3/t_42
+innodb_encrypted_3/t_43
+innodb_encrypted_3/t_44
+innodb_encrypted_3/t_45
+innodb_encrypted_3/t_46
+innodb_encrypted_3/t_47
+innodb_encrypted_3/t_48
+innodb_encrypted_3/t_49
+innodb_encrypted_3/t_5
+innodb_encrypted_3/t_50
+innodb_encrypted_3/t_51
+innodb_encrypted_3/t_52
+innodb_encrypted_3/t_53
+innodb_encrypted_3/t_54
+innodb_encrypted_3/t_55
+innodb_encrypted_3/t_56
+innodb_encrypted_3/t_57
+innodb_encrypted_3/t_58
+innodb_encrypted_3/t_59
+innodb_encrypted_3/t_6
+innodb_encrypted_3/t_60
+innodb_encrypted_3/t_61
+innodb_encrypted_3/t_62
+innodb_encrypted_3/t_63
+innodb_encrypted_3/t_64
+innodb_encrypted_3/t_65
+innodb_encrypted_3/t_66
+innodb_encrypted_3/t_67
+innodb_encrypted_3/t_68
+innodb_encrypted_3/t_69
+innodb_encrypted_3/t_7
+innodb_encrypted_3/t_70
+innodb_encrypted_3/t_71
+innodb_encrypted_3/t_72
+innodb_encrypted_3/t_73
+innodb_encrypted_3/t_74
+innodb_encrypted_3/t_75
+innodb_encrypted_3/t_76
+innodb_encrypted_3/t_77
+innodb_encrypted_3/t_78
+innodb_encrypted_3/t_79
+innodb_encrypted_3/t_8
+innodb_encrypted_3/t_80
+innodb_encrypted_3/t_81
+innodb_encrypted_3/t_82
+innodb_encrypted_3/t_83
+innodb_encrypted_3/t_84
+innodb_encrypted_3/t_85
+innodb_encrypted_3/t_86
+innodb_encrypted_3/t_87
+innodb_encrypted_3/t_88
+innodb_encrypted_3/t_89
+innodb_encrypted_3/t_9
+innodb_encrypted_3/t_90
+innodb_encrypted_3/t_91
+innodb_encrypted_3/t_92
+innodb_encrypted_3/t_93
+innodb_encrypted_3/t_94
+innodb_encrypted_3/t_95
+innodb_encrypted_3/t_96
+innodb_encrypted_3/t_97
+innodb_encrypted_3/t_98
+innodb_encrypted_3/t_99
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_2/t_1
+innodb_encrypted_2/t_10
+innodb_encrypted_2/t_100
+innodb_encrypted_2/t_11
+innodb_encrypted_2/t_12
+innodb_encrypted_2/t_13
+innodb_encrypted_2/t_14
+innodb_encrypted_2/t_15
+innodb_encrypted_2/t_16
+innodb_encrypted_2/t_17
+innodb_encrypted_2/t_18
+innodb_encrypted_2/t_19
+innodb_encrypted_2/t_2
+innodb_encrypted_2/t_20
+innodb_encrypted_2/t_21
+innodb_encrypted_2/t_22
+innodb_encrypted_2/t_23
+innodb_encrypted_2/t_24
+innodb_encrypted_2/t_25
+innodb_encrypted_2/t_26
+innodb_encrypted_2/t_27
+innodb_encrypted_2/t_28
+innodb_encrypted_2/t_29
+innodb_encrypted_2/t_3
+innodb_encrypted_2/t_30
+innodb_encrypted_2/t_31
+innodb_encrypted_2/t_32
+innodb_encrypted_2/t_33
+innodb_encrypted_2/t_34
+innodb_encrypted_2/t_35
+innodb_encrypted_2/t_36
+innodb_encrypted_2/t_37
+innodb_encrypted_2/t_38
+innodb_encrypted_2/t_39
+innodb_encrypted_2/t_4
+innodb_encrypted_2/t_40
+innodb_encrypted_2/t_41
+innodb_encrypted_2/t_42
+innodb_encrypted_2/t_43
+innodb_encrypted_2/t_44
+innodb_encrypted_2/t_45
+innodb_encrypted_2/t_46
+innodb_encrypted_2/t_47
+innodb_encrypted_2/t_48
+innodb_encrypted_2/t_49
+innodb_encrypted_2/t_5
+innodb_encrypted_2/t_50
+innodb_encrypted_2/t_51
+innodb_encrypted_2/t_52
+innodb_encrypted_2/t_53
+innodb_encrypted_2/t_54
+innodb_encrypted_2/t_55
+innodb_encrypted_2/t_56
+innodb_encrypted_2/t_57
+innodb_encrypted_2/t_58
+innodb_encrypted_2/t_59
+innodb_encrypted_2/t_6
+innodb_encrypted_2/t_60
+innodb_encrypted_2/t_61
+innodb_encrypted_2/t_62
+innodb_encrypted_2/t_63
+innodb_encrypted_2/t_64
+innodb_encrypted_2/t_65
+innodb_encrypted_2/t_66
+innodb_encrypted_2/t_67
+innodb_encrypted_2/t_68
+innodb_encrypted_2/t_69
+innodb_encrypted_2/t_7
+innodb_encrypted_2/t_70
+innodb_encrypted_2/t_71
+innodb_encrypted_2/t_72
+innodb_encrypted_2/t_73
+innodb_encrypted_2/t_74
+innodb_encrypted_2/t_75
+innodb_encrypted_2/t_76
+innodb_encrypted_2/t_77
+innodb_encrypted_2/t_78
+innodb_encrypted_2/t_79
+innodb_encrypted_2/t_8
+innodb_encrypted_2/t_80
+innodb_encrypted_2/t_81
+innodb_encrypted_2/t_82
+innodb_encrypted_2/t_83
+innodb_encrypted_2/t_84
+innodb_encrypted_2/t_85
+innodb_encrypted_2/t_86
+innodb_encrypted_2/t_87
+innodb_encrypted_2/t_88
+innodb_encrypted_2/t_89
+innodb_encrypted_2/t_9
+innodb_encrypted_2/t_90
+innodb_encrypted_2/t_91
+innodb_encrypted_2/t_92
+innodb_encrypted_2/t_93
+innodb_encrypted_2/t_94
+innodb_encrypted_2/t_95
+innodb_encrypted_2/t_96
+innodb_encrypted_2/t_97
+innodb_encrypted_2/t_98
+innodb_encrypted_2/t_99
+SET GLOBAL innodb_encrypt_tables = off;
+SET GLOBAL innodb_encryption_threads=4;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_2/t_1
+innodb_encrypted_2/t_10
+innodb_encrypted_2/t_100
+innodb_encrypted_2/t_11
+innodb_encrypted_2/t_12
+innodb_encrypted_2/t_13
+innodb_encrypted_2/t_14
+innodb_encrypted_2/t_15
+innodb_encrypted_2/t_16
+innodb_encrypted_2/t_17
+innodb_encrypted_2/t_18
+innodb_encrypted_2/t_19
+innodb_encrypted_2/t_2
+innodb_encrypted_2/t_20
+innodb_encrypted_2/t_21
+innodb_encrypted_2/t_22
+innodb_encrypted_2/t_23
+innodb_encrypted_2/t_24
+innodb_encrypted_2/t_25
+innodb_encrypted_2/t_26
+innodb_encrypted_2/t_27
+innodb_encrypted_2/t_28
+innodb_encrypted_2/t_29
+innodb_encrypted_2/t_3
+innodb_encrypted_2/t_30
+innodb_encrypted_2/t_31
+innodb_encrypted_2/t_32
+innodb_encrypted_2/t_33
+innodb_encrypted_2/t_34
+innodb_encrypted_2/t_35
+innodb_encrypted_2/t_36
+innodb_encrypted_2/t_37
+innodb_encrypted_2/t_38
+innodb_encrypted_2/t_39
+innodb_encrypted_2/t_4
+innodb_encrypted_2/t_40
+innodb_encrypted_2/t_41
+innodb_encrypted_2/t_42
+innodb_encrypted_2/t_43
+innodb_encrypted_2/t_44
+innodb_encrypted_2/t_45
+innodb_encrypted_2/t_46
+innodb_encrypted_2/t_47
+innodb_encrypted_2/t_48
+innodb_encrypted_2/t_49
+innodb_encrypted_2/t_5
+innodb_encrypted_2/t_50
+innodb_encrypted_2/t_51
+innodb_encrypted_2/t_52
+innodb_encrypted_2/t_53
+innodb_encrypted_2/t_54
+innodb_encrypted_2/t_55
+innodb_encrypted_2/t_56
+innodb_encrypted_2/t_57
+innodb_encrypted_2/t_58
+innodb_encrypted_2/t_59
+innodb_encrypted_2/t_6
+innodb_encrypted_2/t_60
+innodb_encrypted_2/t_61
+innodb_encrypted_2/t_62
+innodb_encrypted_2/t_63
+innodb_encrypted_2/t_64
+innodb_encrypted_2/t_65
+innodb_encrypted_2/t_66
+innodb_encrypted_2/t_67
+innodb_encrypted_2/t_68
+innodb_encrypted_2/t_69
+innodb_encrypted_2/t_7
+innodb_encrypted_2/t_70
+innodb_encrypted_2/t_71
+innodb_encrypted_2/t_72
+innodb_encrypted_2/t_73
+innodb_encrypted_2/t_74
+innodb_encrypted_2/t_75
+innodb_encrypted_2/t_76
+innodb_encrypted_2/t_77
+innodb_encrypted_2/t_78
+innodb_encrypted_2/t_79
+innodb_encrypted_2/t_8
+innodb_encrypted_2/t_80
+innodb_encrypted_2/t_81
+innodb_encrypted_2/t_82
+innodb_encrypted_2/t_83
+innodb_encrypted_2/t_84
+innodb_encrypted_2/t_85
+innodb_encrypted_2/t_86
+innodb_encrypted_2/t_87
+innodb_encrypted_2/t_88
+innodb_encrypted_2/t_89
+innodb_encrypted_2/t_9
+innodb_encrypted_2/t_90
+innodb_encrypted_2/t_91
+innodb_encrypted_2/t_92
+innodb_encrypted_2/t_93
+innodb_encrypted_2/t_94
+innodb_encrypted_2/t_95
+innodb_encrypted_2/t_96
+innodb_encrypted_2/t_97
+innodb_encrypted_2/t_98
+innodb_encrypted_2/t_99
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+NAME
+innodb_encrypted_3/t_1
+innodb_encrypted_3/t_10
+innodb_encrypted_3/t_100
+innodb_encrypted_3/t_11
+innodb_encrypted_3/t_12
+innodb_encrypted_3/t_13
+innodb_encrypted_3/t_14
+innodb_encrypted_3/t_15
+innodb_encrypted_3/t_16
+innodb_encrypted_3/t_17
+innodb_encrypted_3/t_18
+innodb_encrypted_3/t_19
+innodb_encrypted_3/t_2
+innodb_encrypted_3/t_20
+innodb_encrypted_3/t_21
+innodb_encrypted_3/t_22
+innodb_encrypted_3/t_23
+innodb_encrypted_3/t_24
+innodb_encrypted_3/t_25
+innodb_encrypted_3/t_26
+innodb_encrypted_3/t_27
+innodb_encrypted_3/t_28
+innodb_encrypted_3/t_29
+innodb_encrypted_3/t_3
+innodb_encrypted_3/t_30
+innodb_encrypted_3/t_31
+innodb_encrypted_3/t_32
+innodb_encrypted_3/t_33
+innodb_encrypted_3/t_34
+innodb_encrypted_3/t_35
+innodb_encrypted_3/t_36
+innodb_encrypted_3/t_37
+innodb_encrypted_3/t_38
+innodb_encrypted_3/t_39
+innodb_encrypted_3/t_4
+innodb_encrypted_3/t_40
+innodb_encrypted_3/t_41
+innodb_encrypted_3/t_42
+innodb_encrypted_3/t_43
+innodb_encrypted_3/t_44
+innodb_encrypted_3/t_45
+innodb_encrypted_3/t_46
+innodb_encrypted_3/t_47
+innodb_encrypted_3/t_48
+innodb_encrypted_3/t_49
+innodb_encrypted_3/t_5
+innodb_encrypted_3/t_50
+innodb_encrypted_3/t_51
+innodb_encrypted_3/t_52
+innodb_encrypted_3/t_53
+innodb_encrypted_3/t_54
+innodb_encrypted_3/t_55
+innodb_encrypted_3/t_56
+innodb_encrypted_3/t_57
+innodb_encrypted_3/t_58
+innodb_encrypted_3/t_59
+innodb_encrypted_3/t_6
+innodb_encrypted_3/t_60
+innodb_encrypted_3/t_61
+innodb_encrypted_3/t_62
+innodb_encrypted_3/t_63
+innodb_encrypted_3/t_64
+innodb_encrypted_3/t_65
+innodb_encrypted_3/t_66
+innodb_encrypted_3/t_67
+innodb_encrypted_3/t_68
+innodb_encrypted_3/t_69
+innodb_encrypted_3/t_7
+innodb_encrypted_3/t_70
+innodb_encrypted_3/t_71
+innodb_encrypted_3/t_72
+innodb_encrypted_3/t_73
+innodb_encrypted_3/t_74
+innodb_encrypted_3/t_75
+innodb_encrypted_3/t_76
+innodb_encrypted_3/t_77
+innodb_encrypted_3/t_78
+innodb_encrypted_3/t_79
+innodb_encrypted_3/t_8
+innodb_encrypted_3/t_80
+innodb_encrypted_3/t_81
+innodb_encrypted_3/t_82
+innodb_encrypted_3/t_83
+innodb_encrypted_3/t_84
+innodb_encrypted_3/t_85
+innodb_encrypted_3/t_86
+innodb_encrypted_3/t_87
+innodb_encrypted_3/t_88
+innodb_encrypted_3/t_89
+innodb_encrypted_3/t_9
+innodb_encrypted_3/t_90
+innodb_encrypted_3/t_91
+innodb_encrypted_3/t_92
+innodb_encrypted_3/t_93
+innodb_encrypted_3/t_94
+innodb_encrypted_3/t_95
+innodb_encrypted_3/t_96
+innodb_encrypted_3/t_97
+innodb_encrypted_3/t_98
+innodb_encrypted_3/t_99
+use test;
+drop database innodb_encrypted_1;
+drop database innodb_encrypted_2;
+drop database innodb_encrypted_3;
diff --git a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
new file mode 100644
index 00000000000..2494514ad7a
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
@@ -0,0 +1,141 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
+CREATE TABLE t3 (id INT, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t4 (id INT, a VARCHAR(255)) engine=InnoDB;
+CREATE TABLE t5 (id INT NOT NULL PRIMARY KEY, a TEXT(500), b VARCHAR(255), FULLTEXT(b)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t6 (id INT, a TEXT(500), b VARCHAR(255), FULLTEXT(b)) ENGINE=InnoDB;
+CREATE TABLE t7 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB row_format=compressed encrypted=yes;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into t1 values (current_num,repeat('foobar',12));
+insert into t2 values (current_num,repeat('tempsecret', 12));
+insert into t3 values (current_num,repeat('barfoo',42));
+insert into t4 values (current_num,repeat('repeat',42));
+insert into t5 values (current_num,substring('A BC DEF GHIJ KLM NOPQRS TUV WXYZ 012 3456789', rand()*36+1, 100), repeat('author new',22));
+insert into t6 values (current_num,substring('A BC DEF GHIJ KLM NOPQRS TUV WXYZ 012 3456789', rand()*36+1, 100), repeat('mangled old',22));
+insert into t7 values (current_num,repeat('mysql',42));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(1500);
+commit;
+set autocommit=1;
+# Wait max 10 min for key encryption threads to encrypt all spaces
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+# t2 ... on expecting NOT FOUND
+NOT FOUND /tempsecret/ in t2.ibd
+# t3 ... on expecting NOT FOUND
+NOT FOUND /barfoo/ in t3.ibd
+# t4 ... on expecting NOT FOUND
+NOT FOUND /repeat/ in t4.ibd
+# t5 ... on expecting NOT FOUND
+NOT FOUND /author/ in t5.ibd
+# t6 ... on expecting NOT FOUND
+NOT FOUND /mangled/ in t6.ibd
+# t7 ... on expecting NOT FOUND
+NOT FOUND /mysql/ in t7.ibd
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+ALTER TABLE t1 ADD COLUMN b int default 2;
+ALTER TABLE t2 ADD COLUMN b int default 2;
+ALTER TABLE t7 ADD COLUMN b int default 2;
+ALTER TABLE t1 ADD KEY a(a), ADD KEY b(b);
+ALTER TABLE t2 ADD KEY a(a), ADD KEY b(b);
+ALTER TABLE t3 ADD COLUMN c int default 5;
+ALTER TABLE t4 ADD COLUMN c int default 5;
+ALTER TABLE t3 ADD KEY (a), ADD KEY c(c);
+ALTER TABLE t4 ADD KEY (a), ADD KEY c(c);
+ALTER TABLE t5 ADD FULLTEXT(a);
+ALTER TABLE t6 ADD FULLTEXT(a);
+ALTER TABLE t7 ADD KEY a(a), ADD key b(b);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ `b` int(11) DEFAULT '2',
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ KEY `b` (`b`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ `b` int(11) DEFAULT '2',
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ KEY `b` (`b`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `id` int(11) DEFAULT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ `c` int(11) DEFAULT '5',
+ KEY `a` (`a`),
+ KEY `c` (`c`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+SHOW CREATE TABLE t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `id` int(11) DEFAULT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ `c` int(11) DEFAULT '5',
+ KEY `a` (`a`),
+ KEY `c` (`c`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `id` int(11) NOT NULL,
+ `a` text,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ FULLTEXT KEY `b` (`b`),
+ FULLTEXT KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
+SHOW CREATE TABLE t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `id` int(11) DEFAULT NULL,
+ `a` text,
+ `b` varchar(255) DEFAULT NULL,
+ FULLTEXT KEY `b` (`b`),
+ FULLTEXT KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t7;
+Table Create Table
+t7 CREATE TABLE `t7` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ `b` int(11) DEFAULT '2',
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ KEY `b` (`b`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+# t2 ... on expecting NOT FOUND
+NOT FOUND /tempsecret/ in t2.ibd
+# t3 ... on expecting NOT FOUND
+NOT FOUND /barfoo/ in t3.ibd
+# t4 ... on expecting NOT FOUND
+NOT FOUND /repeat/ in t4.ibd
+# t5 ... on expecting NOT FOUND
+NOT FOUND /author/ in t5.ibd
+# t6 ... on expecting NOT FOUND
+NOT FOUND /mangled/ in t6.ibd
+# t7 ... on expecting NOT FOUND
+NOT FOUND /mysql/ in t7.ibd
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1, t2, t3, t4, t5, t6, t7;
diff --git a/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result b/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result
new file mode 100644
index 00000000000..43fb7368654
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result
@@ -0,0 +1,153 @@
+# Restart mysqld --loose-file-key-management-filename=keys2.txt
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+show warnings;
+Level Code Message
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=2;
+show warnings;
+Level Code Message
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=3;
+show warnings;
+Level Code Message
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=4;
+show warnings;
+Level Code Message
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=5;
+show warnings;
+Level Code Message
+insert into innodb_normal values (1,'test1'),(2,'foo'),(3,'bar'),(4,'mariadb');
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+alter table innodb_compact engine=innodb encryption_key_id = 6;
+alter table innodb_compressed engine=innodb encryption_key_id = 6;
+alter table innodb_dynamic engine=innodb encryption_key_id = 6;
+alter table innodb_redundant engine=innodb encryption_key_id = 6;
+select * from innodb_normal;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_compact;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_compressed;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_dynamic;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_redundant;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+# Restart mysqld --loose-file-key-management-filename=keys3.txt
+select * from innodb_normal;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_compact;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_compressed;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_dynamic;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_redundant;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+alter table innodb_compact engine=innodb encryption_key_id = 2;
+alter table innodb_compressed engine=innodb encryption_key_id = 3;
+alter table innodb_dynamic engine=innodb encryption_key_id = 4;
+alter table innodb_redundant engine=innodb encryption_key_id = 5;
+select * from innodb_normal;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_compact;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_compressed;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_dynamic;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+select * from innodb_redundant;
+c1 b
+1 test1
+2 foo
+3 bar
+4 mariadb
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+variable_value >= 0
+1
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+variable_value >= 0
+1
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_compressed;
+drop table innodb_dynamic;
+drop table innodb_redundant;
diff --git a/mysql-test/suite/encryption/r/innodb_scrub.result b/mysql-test/suite/encryption/r/innodb_scrub.result
new file mode 100644
index 00000000000..6e8febc762d
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_scrub.result
@@ -0,0 +1,138 @@
+create table snapshot_status engine = myisam
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+# MDEV-8139 Fix scrubbing tests
+# FIXME: Add index(b) to each table; ensure that undo logs are scrubbed.
+create table delete_3 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compressed;
+delete from delete_3;
+create table delete_rollback_delete_3 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compressed;
+begin;
+delete from delete_rollback_delete_3;
+rollback;
+delete from delete_rollback_delete_3;
+create table insert_rollback_3 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compressed;
+begin;
+rollback;
+create table delete_2 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compact;
+delete from delete_2;
+create table delete_rollback_delete_2 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compact;
+begin;
+delete from delete_rollback_delete_2;
+rollback;
+delete from delete_rollback_delete_2;
+create table insert_rollback_2 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compact;
+begin;
+rollback;
+create table delete_1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=redundant;
+delete from delete_1;
+create table delete_rollback_delete_1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=redundant;
+begin;
+delete from delete_rollback_delete_1;
+rollback;
+delete from delete_rollback_delete_1;
+create table insert_rollback_1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=redundant;
+begin;
+rollback;
+create table delete_0 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=dynamic;
+delete from delete_0;
+create table delete_rollback_delete_0 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=dynamic;
+begin;
+delete from delete_rollback_delete_0;
+rollback;
+delete from delete_rollback_delete_0;
+create table insert_rollback_0 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=dynamic;
+begin;
+rollback;
+SET GLOBAL innodb_fast_shutdown=0;
+# delete_3.ibd
+# delete_rollback_delete_3.ibd
+# insert_rollback_3.ibd
+# delete_2.ibd
+# delete_rollback_delete_2.ibd
+# insert_rollback_2.ibd
+# delete_1.ibd
+# delete_rollback_delete_1.ibd
+# insert_rollback_1.ibd
+# delete_0.ibd
+# delete_rollback_delete_0.ibd
+# insert_rollback_0.ibd
+check table delete_3, delete_rollback_delete_3, insert_rollback_3;
+Table Op Msg_type Msg_text
+test.delete_3 check status OK
+test.delete_rollback_delete_3 check status OK
+test.insert_rollback_3 check status OK
+drop table delete_3, delete_rollback_delete_3, insert_rollback_3;
+check table delete_2, delete_rollback_delete_2, insert_rollback_2;
+Table Op Msg_type Msg_text
+test.delete_2 check status OK
+test.delete_rollback_delete_2 check status OK
+test.insert_rollback_2 check status OK
+drop table delete_2, delete_rollback_delete_2, insert_rollback_2;
+check table delete_1, delete_rollback_delete_1, insert_rollback_1;
+Table Op Msg_type Msg_text
+test.delete_1 check status OK
+test.delete_rollback_delete_1 check status OK
+test.insert_rollback_1 check status OK
+drop table delete_1, delete_rollback_delete_1, insert_rollback_1;
+check table delete_0, delete_rollback_delete_0, insert_rollback_0;
+Table Op Msg_type Msg_text
+test.delete_0 check status OK
+test.delete_rollback_delete_0 check status OK
+test.insert_rollback_0 check status OK
+drop table delete_0, delete_rollback_delete_0, insert_rollback_0;
+show variables like 'innodb_%scrub_data%';
+Variable_name Value
+innodb_background_scrub_data_check_interval 3600
+innodb_background_scrub_data_compressed OFF
+innodb_background_scrub_data_interval 604800
+innodb_background_scrub_data_uncompressed OFF
+innodb_immediate_scrub_data_uncompressed ON
+# verify that this test have not caused any background scrubbing
+select ss.variable_name, gs.variable_value - ss.variable_value as variable_value
+from snapshot_status ss,
+information_schema.global_status gs
+where ss.variable_name = gs.variable_name;
+variable_name variable_value
+INNODB_SCRUB_BACKGROUND_PAGE_REORGANIZATIONS 0
+INNODB_SCRUB_BACKGROUND_PAGE_SPLITS 0
+INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_MISSING_INDEX 0
+INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_OUT_OF_FILESPACE 0
+INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNDERFLOW 0
+INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNKNOWN 0
+drop table snapshot_status;
diff --git a/mysql-test/suite/encryption/r/innodb_scrub_background.result b/mysql-test/suite/encryption/r/innodb_scrub_background.result
new file mode 100644
index 00000000000..6a2f263d0a1
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_scrub_background.result
@@ -0,0 +1,160 @@
+#
+# immediate scrubbing is off
+# background scrubbing is on
+#
+show variables like 'innodb_%scrub_data%';
+Variable_name Value
+innodb_background_scrub_data_check_interval 3600
+innodb_background_scrub_data_compressed ON
+innodb_background_scrub_data_interval 604800
+innodb_background_scrub_data_uncompressed ON
+innodb_immediate_scrub_data_uncompressed OFF
+# make sure spaces are checked quickly
+SET GLOBAL innodb_background_scrub_data_check_interval=1;
+create table delete_3 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=compressed;
+# Populate table with rows
+delete from delete_3;
+create table delete_rollback_delete_3 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=compressed;
+# Populate table with rows
+begin;
+delete from delete_rollback_delete_3;
+rollback;
+delete from delete_rollback_delete_3;
+create table insert_rollback_3 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=compressed;
+# Populate table with rows
+begin;
+rollback;
+create table delete_2 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=compact;
+# Populate table with rows
+delete from delete_2;
+create table delete_rollback_delete_2 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=compact;
+# Populate table with rows
+begin;
+delete from delete_rollback_delete_2;
+rollback;
+delete from delete_rollback_delete_2;
+create table insert_rollback_2 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=compact;
+# Populate table with rows
+begin;
+rollback;
+create table delete_1 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=redundant;
+# Populate table with rows
+delete from delete_1;
+create table delete_rollback_delete_1 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=redundant;
+# Populate table with rows
+begin;
+delete from delete_rollback_delete_1;
+rollback;
+delete from delete_rollback_delete_1;
+create table insert_rollback_1 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=redundant;
+# Populate table with rows
+begin;
+rollback;
+create table delete_0 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=dynamic;
+# Populate table with rows
+delete from delete_0;
+create table delete_rollback_delete_0 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=dynamic;
+# Populate table with rows
+begin;
+delete from delete_rollback_delete_0;
+rollback;
+delete from delete_rollback_delete_0;
+create table insert_rollback_0 (
+a int auto_increment primary key,
+b varchar(256),
+c text,
+index(b)) engine = innodb row_format=dynamic;
+# Populate table with rows
+begin;
+rollback;
+# start scrubbing threads
+SET GLOBAL innodb_encryption_threads=5;
+# Wait max 10 min for scrubbing
+SET GLOBAL innodb_fast_shutdown=0;
+# delete_3.ibd
+# delete_rollback_delete_3.ibd
+# insert_rollback_3.ibd
+# delete_2.ibd
+# delete_rollback_delete_2.ibd
+# insert_rollback_2.ibd
+# delete_1.ibd
+# delete_rollback_delete_1.ibd
+# insert_rollback_1.ibd
+# delete_0.ibd
+# delete_rollback_delete_0.ibd
+# insert_rollback_0.ibd
+check table delete_3, delete_rollback_delete_3, insert_rollback_3;
+Table Op Msg_type Msg_text
+test.delete_3 check status OK
+test.delete_rollback_delete_3 check status OK
+test.insert_rollback_3 check status OK
+drop table delete_3, delete_rollback_delete_3, insert_rollback_3;
+check table delete_2, delete_rollback_delete_2, insert_rollback_2;
+Table Op Msg_type Msg_text
+test.delete_2 check status OK
+test.delete_rollback_delete_2 check status OK
+test.insert_rollback_2 check status OK
+drop table delete_2, delete_rollback_delete_2, insert_rollback_2;
+check table delete_1, delete_rollback_delete_1, insert_rollback_1;
+Table Op Msg_type Msg_text
+test.delete_1 check status OK
+test.delete_rollback_delete_1 check status OK
+test.insert_rollback_1 check status OK
+drop table delete_1, delete_rollback_delete_1, insert_rollback_1;
+check table delete_0, delete_rollback_delete_0, insert_rollback_0;
+Table Op Msg_type Msg_text
+test.delete_0 check status OK
+test.delete_rollback_delete_0 check status OK
+test.insert_rollback_0 check status OK
+drop table delete_0, delete_rollback_delete_0, insert_rollback_0;
+show variables like 'innodb_%scrub_data%';
+Variable_name Value
+innodb_background_scrub_data_check_interval 3600
+innodb_background_scrub_data_compressed ON
+innodb_background_scrub_data_interval 604800
+innodb_background_scrub_data_uncompressed ON
+innodb_immediate_scrub_data_uncompressed OFF
diff --git a/mysql-test/suite/encryption/r/second_plugin-12863.result b/mysql-test/suite/encryption/r/second_plugin-12863.result
new file mode 100644
index 00000000000..8775b1b8fb3
--- /dev/null
+++ b/mysql-test/suite/encryption/r/second_plugin-12863.result
@@ -0,0 +1,7 @@
+call mtr.add_suppression('debug.key.management');
+install soname 'debug_key_management';
+ERROR HY000: Can't initialize function 'debug_key_management'; Plugin initialization function failed.
+create table t1 (a varchar(255)) engine=innodb encrypted=yes;
+create table t2 (a varchar(255)) engine=innodb;
+create table t3 (a varchar(255)) engine=innodb encrypted=no;
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/encryption/r/tempfiles.result b/mysql-test/suite/encryption/r/tempfiles.result
new file mode 100644
index 00000000000..a0b7596dd5a
--- /dev/null
+++ b/mysql-test/suite/encryption/r/tempfiles.result
@@ -0,0 +1,46 @@
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(1),(2);
+DELETE FROM t1 WHERE a=1;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
+insert into t1 (v) select concat(char(ascii('a')+s2.seq),repeat(' ',s1.seq))
+from seq_0_to_9 as s1, seq_0_to_26 as s2;
+update t1 set c=v, t=v;
+select sql_big_result t,count(t) from t1 group by t limit 10;
+t count(t)
+a 10
+b 10
+c 10
+d 10
+e 10
+f 10
+g 10
+h 10
+i 10
+j 10
+drop table t1;
+set global binlog_cache_size=8192;
+create table t1 (a text) engine=innodb;
+start transaction;
+insert t1 select repeat(seq, 1000) from seq_1_to_15;
+commit;
+start transaction;
+insert t1 select repeat(seq, 1000) from seq_1_to_8;
+commit;
+drop table t1;
+create table t1 (a text) engine=innodb;
+start transaction;
+insert t1 select repeat(seq, 1000) from seq_1_to_15;
+savepoint foo;
+insert t1 select repeat(seq, 1000) from seq_16_to_30;
+rollback to savepoint foo;
+insert t1 select repeat(seq, 1000) from seq_31_to_40;
+commit;
+drop table t1;
+set global binlog_cache_size=default;
diff --git a/mysql-test/suite/encryption/suite.pm b/mysql-test/suite/encryption/suite.pm
new file mode 100644
index 00000000000..bfd7ec71649
--- /dev/null
+++ b/mysql-test/suite/encryption/suite.pm
@@ -0,0 +1,16 @@
+package My::Suite::Encryption;
+
+@ISA = qw(My::Suite);
+
+sub skip_combinations {
+ my @combinations;
+
+ $skip{'include/have_file_key_management_plugin.combinations'} = [ 'ctr' ]
+ unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
+ and $1 ge "1.0.1";
+
+ %skip;
+}
+
+bless { };
+
diff --git a/mysql-test/suite/encryption/t/aria_tiny.test b/mysql-test/suite/encryption/t/aria_tiny.test
new file mode 100644
index 00000000000..cad63ed16f1
--- /dev/null
+++ b/mysql-test/suite/encryption/t/aria_tiny.test
@@ -0,0 +1,12 @@
+#
+# MDEV-8022 Assertion `rc == 0' failed in ma_encrypt on dropping an encrypted Aria table
+#
+
+--source include/have_file_key_management_plugin.inc
+
+set global aria_encrypt_tables = 1;
+create table t1 (i int, key(i)) engine=aria;
+insert into t1 values (1);
+drop table t1;
+set global aria_encrypt_tables = 0;
+
diff --git a/mysql-test/suite/encryption/t/create_or_replace.opt b/mysql-test/suite/encryption/t/create_or_replace.opt
new file mode 100644
index 00000000000..7d3f2da7971
--- /dev/null
+++ b/mysql-test/suite/encryption/t/create_or_replace.opt
@@ -0,0 +1 @@
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/create_or_replace.test b/mysql-test/suite/encryption/t/create_or_replace.test
new file mode 100644
index 00000000000..3b2970e5162
--- /dev/null
+++ b/mysql-test/suite/encryption/t/create_or_replace.test
@@ -0,0 +1,142 @@
+--source include/have_innodb.inc
+--source include/have_file_key_management_plugin.inc
+--source include/not_embedded.inc
+# This is needed for longer testcase timeout at least P7/P8
+--source include/big_test.inc
+
+#
+# MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
+#
+SET default_storage_engine = InnoDB;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
+CREATE TABLE t2 AS SELECT * FROM t1;
+
+--disable_abort_on_error
+--disable_warnings
+--disable_query_log
+
+let $i = 40;
+while ($i)
+{
+SET GLOBAL innodb_encrypt_tables = ON;
+SET GLOBAL innodb_encryption_threads = 1;
+CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
+CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
+SET GLOBAL innodb_encryption_rotation_iops = 100;
+SET GLOBAL innodb_encrypt_tables = OFF;
+CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
+CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
+dec $i;
+}
+
+--enable_abort_on_error
+--enable_warnings
+--enable_query_log
+
+drop table t1,t2;
+SET GLOBAL innodb_encryption_threads = 0;
+
+#
+# MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
+#
+
+SET GLOBAL innodb_encryption_threads = 4;
+
+CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
+INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);
+
+CREATE TABLE `table1_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int,key (`col_int_key` ), primary key (pk)) engine=innodb;
+
+CREATE TABLE `table0_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
+
+INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
+INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
+INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
+INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
+
+--connect (con1,localhost,root,,test)
+--connect (con2,localhost,root,,test)
+
+--disable_abort_on_error
+--disable_warnings
+--disable_query_log
+
+let $i = 500;
+while ($i)
+{
+connection con1;
+send SET GLOBAL innodb_encrypt_tables = ON;
+connection default;
+CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table1_int_autoinc`;
+connection con2;
+send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table10_int_autoinc`;
+connection default;
+send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table0_int_autoinc`;
+connection con1;
+--reap;
+send SET GLOBAL innodb_encrypt_tables = OFF;
+connection con2;
+--reap;
+connection default;
+--reap;
+send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table1_int_autoinc`;
+connection con2;
+send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table10_int_autoinc`;
+connection con1;
+--reap;
+send SET GLOBAL innodb_encrypt_tables = ON;
+connection default;
+--reap;
+send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table1_int_autoinc`;
+connection con2;
+--reap;
+CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table10_int_autoinc`;
+CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table0_int_autoinc`;
+connection con1;
+--reap;
+connection default;
+--reap;
+dec $i;
+}
+
+--enable_query_log
+connection default;
+drop table if exists create_or_replace_t, table1_int_autoinc, table0_int_autoinc, table10_int_autoinc;
+--disconnect con1
+--disconnect con2
+--enable_abort_on_error
+--enable_warnings
+
+SET GLOBAL innodb_encrypt_tables = OFF;
+SET GLOBAL innodb_encryption_threads = 4;
+
+--echo # Wait max 10 min for key encryption threads to decrypt all spaces
+let $cnt=600;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
+ if ($success)
+ {
+ let $cnt=0;
+ }
+ if (!$success)
+ {
+ real_sleep 1;
+ dec $cnt;
+ }
+}
+if (!$success)
+{
+ SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
+ SHOW STATUS LIKE 'innodb_encryption%';
+ -- die Timeout waiting for encryption threads
+}
+--echo # Success!
+
+SET GLOBAL innodb_encryption_threads = 0;
+SET GLOBAL innodb_encrypt_tables = OFF;
+
+# Make sure that all dirty pages are flushed
+
+-- source include/restart_mysqld.inc
diff --git a/mysql-test/suite/encryption/t/debug_key_management.opt b/mysql-test/suite/encryption/t/debug_key_management.opt
new file mode 100644
index 00000000000..5c283bbeda2
--- /dev/null
+++ b/mysql-test/suite/encryption/t/debug_key_management.opt
@@ -0,0 +1,5 @@
+--innodb-encrypt-log=ON
+--innodb-encryption-rotate-key-age=2
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
+--plugin-load-add=$DEBUG_KEY_MANAGEMENT_SO
diff --git a/mysql-test/suite/encryption/t/debug_key_management.test b/mysql-test/suite/encryption/t/debug_key_management.test
new file mode 100644
index 00000000000..22b213c6135
--- /dev/null
+++ b/mysql-test/suite/encryption/t/debug_key_management.test
@@ -0,0 +1,26 @@
+-- source include/have_innodb.inc
+if (`select count(*) = 0 from information_schema.plugins
+ where plugin_name = 'debug_key_management' and plugin_status='active'`)
+{
+ --skip Needs debug_key_management
+}
+
+set global innodb_encrypt_tables=ON;
+show variables like 'innodb_encrypt%';
+
+--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'`
+let $wait_condition= select count(*) = $tables_count from information_schema.innodb_tablespaces_encryption where current_key_version=1;
+--source include/wait_condition.inc
+
+select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 1;
+set global debug_key_management_version=10;
+
+let $wait_condition= select count(*) = $tables_count from information_schema.innodb_tablespaces_encryption where current_key_version=10;
+--source include/wait_condition.inc
+
+select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 10;
+# Note that we expect that key_version is increasing so disable encryption before reset
+
+set global innodb_encrypt_tables=OFF;
+set global debug_key_management_version=1;
+
diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.opt b/mysql-test/suite/encryption/t/encrypt_and_grep.opt
new file mode 100644
index 00000000000..c50ec719307
--- /dev/null
+++ b/mysql-test/suite/encryption/t/encrypt_and_grep.opt
@@ -0,0 +1,7 @@
+--innodb-encrypt-tables=ON
+--innodb-encrypt-log=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
+
+
diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test
new file mode 100644
index 00000000000..9395f467539
--- /dev/null
+++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test
@@ -0,0 +1,127 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+#
+# MDEV-8138: strange results from encrypt-and-grep test
+#
+--let $MYSQLD_DATADIR=`select @@datadir`
+--let ib1_IBD = $MYSQLD_DATADIR/ibdata1
+--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
+--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
+--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
+--let SEARCH_RANGE = 10000000
+
+--disable_warnings
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_file_format = `Barracuda`;
+--enable_warnings
+
+create table t1 (a varchar(255)) engine=innodb encrypted=yes;
+create table t2 (a varchar(255)) engine=innodb;
+show warnings;
+create table t3 (a varchar(255)) engine=innodb encrypted=no;
+
+insert t1 values (repeat('foobarsecret', 22));
+insert t2 values (repeat('tempsecret', 22));
+insert t3 values (repeat('dummysecret', 22));
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--source include/shutdown_mysqld.inc
+
+--let SEARCH_PATTERN=foobarsecret
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=tempsecret
+--echo # t2 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=dummysecret
+--echo # t3 no on expecting FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=foobarsecret
+--echo # ibdata1 expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+
+-- source include/start_mysqld.inc
+
+--echo # Now turn off encryption and wait for threads to decrypt everything
+
+SET GLOBAL innodb_encrypt_tables = off;
+
+--echo # Wait max 10 min for key encryption threads to decrypt all spaces
+--let $wait_timeout= 600
+--let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'`
+--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND CURRENT_KEY_VERSION = 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--source include/shutdown_mysqld.inc
+
+--let SEARCH_PATTERN=foobarsecret
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=tempsecret
+--echo # t2 ... default expecting FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=dummysecret
+--echo # t3 no on expecting FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=foobarsecret
+--echo # ibdata1 expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+
+
+-- source include/start_mysqld.inc
+
+--echo # Now turn on encryption and wait for threads to encrypt all spaces
+SET GLOBAL innodb_encrypt_tables = on;
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--source include/shutdown_mysqld.inc
+
+--let SEARCH_PATTERN=foobarsecret
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=tempsecret
+--echo # t2 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=dummysecret
+--echo # t3 no on expecting FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=foobarsecret
+--echo # ibdata1 expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+
+-- source include/start_mysqld.inc
+
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/encryption/t/encryption_force.opt b/mysql-test/suite/encryption/t/encryption_force.opt
new file mode 100644
index 00000000000..c9e532878e1
--- /dev/null
+++ b/mysql-test/suite/encryption/t/encryption_force.opt
@@ -0,0 +1,2 @@
+--innodb-encrypt-tables=FORCE
+--innodb-encrypt-log=ON
diff --git a/mysql-test/suite/encryption/t/encryption_force.test b/mysql-test/suite/encryption/t/encryption_force.test
new file mode 100644
index 00000000000..3c6f039184b
--- /dev/null
+++ b/mysql-test/suite/encryption/t/encryption_force.test
@@ -0,0 +1,39 @@
+-- source include/have_innodb.inc
+-- source include/have_partition.inc
+-- source include/have_example_key_management_plugin.inc
+
+select @@innodb_encrypt_tables;
+
+create table t1 (a int) engine=innodb encrypted=yes;
+create table t2 (a int) engine=innodb encrypted=default;
+--error ER_CANT_CREATE_TABLE
+create table t3 (a int) engine=innodb encrypted=no;
+
+create table t4 (a int) engine=innodb encrypted=yes partition by hash(a) partitions 2;
+--error ER_CANT_CREATE_TABLE
+create table t5 (a int) engine=innodb encrypted=no partition by hash(a) partitions 2;
+
+set global innodb_encrypt_tables='ON';
+create table t3 (a int) engine=innodb encrypted=no;
+set global innodb_encrypt_tables='FORCE';
+
+show create table t1;
+show create table t2;
+show create table t3;
+show create table t4;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+alter table t1 encrypted=no;
+alter table t2 encrypted=yes;
+alter table t3 encrypted=default;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+alter table t4 encrypted=no;
+
+show create table t1;
+show create table t2;
+show create table t3;
+
+drop table t1;
+drop table t2;
+drop table t3;
+drop table t4;
diff --git a/mysql-test/suite/encryption/t/filekeys-data.enc b/mysql-test/suite/encryption/t/filekeys-data.enc
new file mode 100644
index 00000000000..a8adb2f939c
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys-data.enc
Binary files differ
diff --git a/mysql-test/suite/encryption/t/filekeys-data.key b/mysql-test/suite/encryption/t/filekeys-data.key
new file mode 100644
index 00000000000..85fcd1fbb81
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys-data.key
@@ -0,0 +1,2 @@
+secret
+
diff --git a/mysql-test/suite/encryption/t/filekeys-tooshort.enc b/mysql-test/suite/encryption/t/filekeys-tooshort.enc
new file mode 100644
index 00000000000..9849236c7f4
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys-tooshort.enc
@@ -0,0 +1 @@
+Salted__ \ No newline at end of file
diff --git a/mysql-test/suite/encryption/t/filekeys_badtest.inc b/mysql-test/suite/encryption/t/filekeys_badtest.inc
new file mode 100644
index 00000000000..7c0858af20a
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_badtest.inc
@@ -0,0 +1,18 @@
+-- source include/not_embedded.inc
+-- source include/have_xtradb.inc
+-- source filekeys_plugin.inc
+
+--eval call mtr.add_suppression("$SEARCH_PATTERN")
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let SEARCH_RANGE= -10000
+--source include/search_pattern_in_file.inc
+
+--error ER_CANT_CREATE_TABLE
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+
+select plugin_status from information_schema.plugins
+ where plugin_name = 'file_key_management';
+
diff --git a/mysql-test/suite/encryption/t/filekeys_emptyfile.opt b/mysql-test/suite/encryption/t/filekeys_emptyfile.opt
new file mode 100644
index 00000000000..7c5f6d05dde
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_emptyfile.opt
@@ -0,0 +1 @@
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/empty_file
diff --git a/mysql-test/suite/encryption/t/filekeys_emptyfile.test b/mysql-test/suite/encryption/t/filekeys_emptyfile.test
new file mode 100644
index 00000000000..39f2ccf260a
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_emptyfile.test
@@ -0,0 +1,4 @@
+let SEARCH_PATTERN=System key id 1 is missing at;
+source filekeys_badtest.inc;
+
+--echo # Test checks if opening an empty filekeys does not crash the server.
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile.opt b/mysql-test/suite/encryption/t/filekeys_encfile.opt
new file mode 100644
index 00000000000..651cc0f4cbe
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile.opt
@@ -0,0 +1,2 @@
+--loose-file-key-management-filekey=secret
+--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile.test b/mysql-test/suite/encryption/t/filekeys_encfile.test
new file mode 100644
index 00000000000..a0611a38ec4
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile.test
@@ -0,0 +1 @@
+source filekeys_goodtest.inc;
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_bad.opt b/mysql-test/suite/encryption/t/filekeys_encfile_bad.opt
new file mode 100644
index 00000000000..6ece8c6b08d
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_bad.opt
@@ -0,0 +1,2 @@
+--loose-file-key-management-filekey=bad
+--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_bad.test b/mysql-test/suite/encryption/t/filekeys_encfile_bad.test
new file mode 100644
index 00000000000..51ab14c5608
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_bad.test
@@ -0,0 +1,2 @@
+let SEARCH_PATTERN=Cannot decrypt .*filekeys-data.enc. Wrong key;
+source filekeys_badtest.inc;
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_badfile.opt b/mysql-test/suite/encryption/t/filekeys_encfile_badfile.opt
new file mode 100644
index 00000000000..374a41395b8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_badfile.opt
@@ -0,0 +1,2 @@
+--loose-file-key-management-filekey=FILE:bad
+--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_badfile.test b/mysql-test/suite/encryption/t/filekeys_encfile_badfile.test
new file mode 100644
index 00000000000..e0b07ac62b1
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_badfile.test
@@ -0,0 +1,2 @@
+let SEARCH_PATTERN=File 'bad' not found;
+source filekeys_badtest.inc;
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_file.opt b/mysql-test/suite/encryption/t/filekeys_encfile_file.opt
new file mode 100644
index 00000000000..df2d3d526d7
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_file.opt
@@ -0,0 +1,2 @@
+--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/t/filekeys-data.key
+--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_file.test b/mysql-test/suite/encryption/t/filekeys_encfile_file.test
new file mode 100644
index 00000000000..a0611a38ec4
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_file.test
@@ -0,0 +1 @@
+source filekeys_goodtest.inc;
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_no.opt b/mysql-test/suite/encryption/t/filekeys_encfile_no.opt
new file mode 100644
index 00000000000..68264e5c261
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_no.opt
@@ -0,0 +1 @@
+--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
diff --git a/mysql-test/suite/encryption/t/filekeys_encfile_no.test b/mysql-test/suite/encryption/t/filekeys_encfile_no.test
new file mode 100644
index 00000000000..51ab14c5608
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_encfile_no.test
@@ -0,0 +1,2 @@
+let SEARCH_PATTERN=Cannot decrypt .*filekeys-data.enc. Wrong key;
+source filekeys_badtest.inc;
diff --git a/mysql-test/suite/encryption/t/filekeys_goodtest.inc b/mysql-test/suite/encryption/t/filekeys_goodtest.inc
new file mode 100644
index 00000000000..5317eeb3d12
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_goodtest.inc
@@ -0,0 +1,18 @@
+-- source include/have_xtradb.inc
+-- source filekeys_plugin.inc
+
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+show create table t1;
+insert t1 values (12345, repeat('1234567890', 20));
+
+alter table t1 encryption_key_id=2;
+show create table t1;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+alter table t1 encryption_key_id=3;
+show create table t1;
+alter table t1 encryption_key_id=33;
+show create table t1;
+alter table t1 encryption_key_id=4;
+show create table t1;
+
+drop table t1;
diff --git a/mysql-test/suite/encryption/t/filekeys_nofile.test b/mysql-test/suite/encryption/t/filekeys_nofile.test
new file mode 100644
index 00000000000..46f5cd462d7
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_nofile.test
@@ -0,0 +1,2 @@
+let SEARCH_PATTERN=file-key-management-filename is not set;
+source filekeys_badtest.inc;
diff --git a/mysql-test/suite/encryption/t/filekeys_plugin.inc b/mysql-test/suite/encryption/t/filekeys_plugin.inc
new file mode 100644
index 00000000000..a9bde3b06e6
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_plugin.inc
@@ -0,0 +1,4 @@
+if (!$FILE_KEY_MANAGEMENT_SO)
+{
+ --skip Needs dynamic file_key_management plugin
+}
diff --git a/mysql-test/suite/encryption/t/filekeys_plugin.opt b/mysql-test/suite/encryption/t/filekeys_plugin.opt
new file mode 100644
index 00000000000..b42e6266e66
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_plugin.opt
@@ -0,0 +1 @@
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
diff --git a/mysql-test/suite/encryption/t/filekeys_plugin_exists.inc b/mysql-test/suite/encryption/t/filekeys_plugin_exists.inc
new file mode 100644
index 00000000000..a9bde3b06e6
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_plugin_exists.inc
@@ -0,0 +1,4 @@
+if (!$FILE_KEY_MANAGEMENT_SO)
+{
+ --skip Needs dynamic file_key_management plugin
+}
diff --git a/mysql-test/suite/encryption/t/filekeys_syntax.opt b/mysql-test/suite/encryption/t/filekeys_syntax.opt
new file mode 100644
index 00000000000..4be6601bbac
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_syntax.opt
@@ -0,0 +1 @@
+--loose-file-key-management-filename=$MYSQL_TMP_DIR/keys.txt
diff --git a/mysql-test/suite/encryption/t/filekeys_syntax.test b/mysql-test/suite/encryption/t/filekeys_syntax.test
new file mode 100644
index 00000000000..61db6ad716e
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_syntax.test
@@ -0,0 +1,109 @@
+#
+# first test - missing key file
+#
+let SEARCH_PATTERN=File '.*keys.txt' not found;
+source filekeys_badtest.inc;
+
+#
+# key id= 0
+#
+write_file $MYSQL_TMP_DIR/keys.txt;
+1;11111111111111111111111111111111
+0;00000000000000000000000000000000
+2;22222222222222222222222222222222
+EOF
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error 2
+install soname 'file_key_management';
+source filekeys_badtest.inc;
+let SEARCH_PATTERN=Invalid key id;
+source filekeys_badtest.inc;
+
+#
+# id too big
+#
+remove_file $MYSQL_TMP_DIR/keys.txt;
+write_file $MYSQL_TMP_DIR/keys.txt;
+1;11111111111111111111111111111111
+4294967299;00000000000000000000000000000000
+2;22222222222222222222222222222222
+EOF
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error 2
+install soname 'file_key_management';
+source filekeys_badtest.inc;
+let SEARCH_PATTERN=Invalid key id;
+source filekeys_badtest.inc;
+#
+# wrong key length (not 16, 24, 23 bytes)
+#
+remove_file $MYSQL_TMP_DIR/keys.txt;
+write_file $MYSQL_TMP_DIR/keys.txt;
+1;11111111111111111111111111111111
+3;00000000000000000000000000000000111122223333
+2;22222222222222222222222222222222
+EOF
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error 2
+install soname 'file_key_management';
+source filekeys_badtest.inc;
+let SEARCH_PATTERN=Invalid key;
+source filekeys_badtest.inc;
+#
+# wrong key length (not an even number of digits)
+#
+remove_file $MYSQL_TMP_DIR/keys.txt;
+write_file $MYSQL_TMP_DIR/keys.txt;
+1;11111111111111111111111111111111
+3;0000000000000000000000000000000
+2;22222222222222222222222222222222
+EOF
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error 2
+install soname 'file_key_management';
+source filekeys_badtest.inc;
+let SEARCH_PATTERN=Invalid key;
+source filekeys_badtest.inc;
+#
+# no semicolon
+#
+remove_file $MYSQL_TMP_DIR/keys.txt;
+write_file $MYSQL_TMP_DIR/keys.txt;
+1;11111111111111111111111111111111
+3:0000000000000000000000000000000
+2;22222222222222222222222222222222
+EOF
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error 2
+install soname 'file_key_management';
+source filekeys_badtest.inc;
+let SEARCH_PATTERN=Syntax error;
+source filekeys_badtest.inc;
+#
+# another syntax error
+#
+remove_file $MYSQL_TMP_DIR/keys.txt;
+write_file $MYSQL_TMP_DIR/keys.txt;
+1;11111111111111111111111111111111
+syntax error
+2;22222222222222222222222222222222
+EOF
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error 2
+install soname 'file_key_management';
+source filekeys_badtest.inc;
+let SEARCH_PATTERN=Syntax error;
+source filekeys_badtest.inc;
+#
+# no key id 1
+#
+remove_file $MYSQL_TMP_DIR/keys.txt;
+write_file $MYSQL_TMP_DIR/keys.txt;
+3;22222222222222222222222222222222
+EOF
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error 2
+install soname 'file_key_management';
+source filekeys_badtest.inc;
+let SEARCH_PATTERN=System key id 1;
+source filekeys_badtest.inc;
diff --git a/mysql-test/suite/encryption/t/filekeys_tooshort.opt b/mysql-test/suite/encryption/t/filekeys_tooshort.opt
new file mode 100644
index 00000000000..8999becc78d
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_tooshort.opt
@@ -0,0 +1,3 @@
+--loose-file-key-management-filekey=secret
+--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-tooshort.enc
+
diff --git a/mysql-test/suite/encryption/t/filekeys_tooshort.test b/mysql-test/suite/encryption/t/filekeys_tooshort.test
new file mode 100644
index 00000000000..b0e89675100
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_tooshort.test
@@ -0,0 +1,4 @@
+let SEARCH_PATTERN=Cannot decrypt .*tooshort.enc. Not encrypted;
+source filekeys_badtest.inc;
+
+--echo # Test checks if opening an too short filekeys does not crash the server.
diff --git a/mysql-test/suite/encryption/t/filekeys_unencfile.opt b/mysql-test/suite/encryption/t/filekeys_unencfile.opt
new file mode 100644
index 00000000000..b7e207c07d4
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_unencfile.opt
@@ -0,0 +1,2 @@
+--loose-file-key-management-filekey=bad
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
diff --git a/mysql-test/suite/encryption/t/filekeys_unencfile.test b/mysql-test/suite/encryption/t/filekeys_unencfile.test
new file mode 100644
index 00000000000..2567c29f5ec
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_unencfile.test
@@ -0,0 +1,2 @@
+let SEARCH_PATTERN=Cannot decrypt .*keys.txt. Not encrypted;
+source filekeys_badtest.inc;
diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test
new file mode 100644
index 00000000000..f1c1b65d418
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innochecksum.test
@@ -0,0 +1,285 @@
+#
+# MDEV-8773: InnoDB innochecksum does not work with encrypted or page compressed tables
+#
+
+# Don't test under embedded as we restart server
+-- source include/not_embedded.inc
+# Require InnoDB
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+-- source include/innodb_page_size_small.inc
+
+if (!$INNOCHECKSUM) {
+ --echo Need innochecksum binary
+ --die Need innochecksum binary
+}
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# zlib
+set global innodb_compression_algorithm = 1;
+--enable_warnings
+
+--echo # Create and populate a tables
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=NO;
+CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
+CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
+
+--disable_query_log
+--let $i = 1000
+begin;
+while ($i)
+{
+ INSERT INTO t1 (b) VALUES (REPEAT('abcdefghijklmnopqrstuvwxyz', 100));
+ dec $i;
+}
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t3 SELECT * FROM t1;
+INSERT INTO t4 SELECT * FROM t1;
+INSERT INTO t5 SELECT * FROM t1;
+INSERT INTO t6 SELECT * FROM t1;
+commit;
+--enable_query_log
+
+let $MYSQLD_DATADIR=`select @@datadir`;
+let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
+let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd;
+let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd;
+let t4_IBD = $MYSQLD_DATADIR/test/t4.ibd;
+let t5_IBD = $MYSQLD_DATADIR/test/t5.ibd;
+let t6_IBD = $MYSQLD_DATADIR/test/t6.ibd;
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+
+--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
+--echo # start it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # We give 30 seconds to do a clean shutdown because we do not want
+--echo # to redo apply the pages of t1.ibd at the time of recovery.
+--echo # We want SQL to initiate the first access to t1.ibd.
+shutdown_server 30;
+
+--echo # Wait until disconnected.
+--source include/wait_until_disconnected.inc
+
+--echo # Run innochecksum on t1
+-- disable_result_log
+--exec $INNOCHECKSUM $t1_IBD
+
+--echo # Run innochecksum on t2
+
+--exec $INNOCHECKSUM $t2_IBD
+
+--echo # Run innochecksum on t3
+
+--exec $INNOCHECKSUM $t3_IBD
+
+--echo # Run innochecksum on t4
+
+--exec $INNOCHECKSUM $t4_IBD
+
+--echo # Run innochecksum on t4
+
+--exec $INNOCHECKSUM $t4_IBD
+
+--echo # Run innochecksum on t5
+
+--exec $INNOCHECKSUM $t5_IBD
+
+--echo # Run innochecksum on t6
+
+--exec $INNOCHECKSUM $t6_IBD
+
+--enable_result_log
+
+--echo # Backup tables before corrupting
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd.backup
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t2.ibd.backup
+--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_DATADIR/test/t3.ibd.backup
+--copy_file $MYSQLD_DATADIR/test/t4.ibd $MYSQLD_DATADIR/test/t4.ibd.backup
+--copy_file $MYSQLD_DATADIR/test/t5.ibd $MYSQLD_DATADIR/test/t5.ibd.backup
+--copy_file $MYSQLD_DATADIR/test/t6.ibd $MYSQLD_DATADIR/test/t6.ibd.backup
+
+#
+# MDEV-11939: innochecksum mistakes a file for an encrypted one
+#
+
+--echo # Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+
+perl;
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t1.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t2.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t3.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t6.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+EOF
+
+-- disable_result_log
+--error 1
+--exec $INNOCHECKSUM $t1_IBD
+
+--echo # Run innochecksum on t2
+
+--error 1
+--exec $INNOCHECKSUM $t2_IBD
+
+--echo # Run innochecksum on t3
+--echo # no encryption corrupting the field should not have effect
+--exec $INNOCHECKSUM $t3_IBD
+
+--echo # Run innochecksum on t6
+--echo # no encryption corrupting the field should not have effect
+--exec $INNOCHECKSUM $t6_IBD
+
+--enable_result_log
+
+--echo # Restore the original tables
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t2.ibd
+--remove_file $MYSQLD_DATADIR/test/t3.ibd
+--remove_file $MYSQLD_DATADIR/test/t4.ibd
+--remove_file $MYSQLD_DATADIR/test/t5.ibd
+--remove_file $MYSQLD_DATADIR/test/t6.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
+--copy_file $MYSQLD_DATADIR/test/t2.ibd.backup $MYSQLD_DATADIR/test/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/t3.ibd.backup $MYSQLD_DATADIR/test/t3.ibd
+--copy_file $MYSQLD_DATADIR/test/t4.ibd.backup $MYSQLD_DATADIR/test/t4.ibd
+--copy_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd
+--copy_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd
+
+--echo # Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION+4 (post encryption checksum)
+
+perl;
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t1.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t2.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t3.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t6.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+EOF
+
+-- disable_result_log
+--error 1
+--exec $INNOCHECKSUM $t1_IBD
+
+--echo # Run innochecksum on t2
+--error 1
+--exec $INNOCHECKSUM $t2_IBD
+
+--echo # Run innochecksum on t3
+--error 1
+--exec $INNOCHECKSUM $t3_IBD
+
+--echo # Run innochecksum on t6
+--echo # no encryption corrupting the field should not have effect
+--exec $INNOCHECKSUM $t6_IBD
+
+--enable_result_log
+
+--echo # Restore the original tables
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t2.ibd
+--remove_file $MYSQLD_DATADIR/test/t3.ibd
+--remove_file $MYSQLD_DATADIR/test/t4.ibd
+--remove_file $MYSQLD_DATADIR/test/t5.ibd
+--remove_file $MYSQLD_DATADIR/test/t6.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
+--copy_file $MYSQLD_DATADIR/test/t2.ibd.backup $MYSQLD_DATADIR/test/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/t3.ibd.backup $MYSQLD_DATADIR/test/t3.ibd
+--copy_file $MYSQLD_DATADIR/test/t4.ibd.backup $MYSQLD_DATADIR/test/t4.ibd
+--copy_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd
+--copy_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd
+
+--echo # Corrupt FIL_DATA+10 (data)
+
+perl;
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t1.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t2.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t3.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t6.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+EOF
+
+-- disable_result_log
+--error 1
+--exec $INNOCHECKSUM $t1_IBD
+
+--echo # Run innochecksum on t2
+--error 1
+--exec $INNOCHECKSUM $t2_IBD
+
+--echo # Run innochecksum on t3
+--error 1
+--exec $INNOCHECKSUM $t3_IBD
+
+--echo # Run innochecksum on t6
+--error 1
+--exec $INNOCHECKSUM $t6_IBD
+
+--enable_result_log
+
+--echo # Restore the original tables
+--move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
+--move_file $MYSQLD_DATADIR/test/t2.ibd.backup $MYSQLD_DATADIR/test/t2.ibd
+--move_file $MYSQLD_DATADIR/test/t3.ibd.backup $MYSQLD_DATADIR/test/t3.ibd
+--move_file $MYSQLD_DATADIR/test/t4.ibd.backup $MYSQLD_DATADIR/test/t4.ibd
+--move_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd
+--move_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd
+
+--echo # Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo # Cleanup
+DROP TABLE t1, t2, t3, t4, t5, t6;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
new file mode 100644
index 00000000000..66546872c25
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -0,0 +1,123 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+#
+# MDEV-8588: Assertion failure in file ha_innodb.cc line 21140 if at least one encrypted
+# table exists and encryption service is not available.
+#
+
+call mtr.add_suppression("InnoDB: The page .*");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* ");
+call mtr.add_suppression("Plugin 'file_key_management' .*");
+call mtr.add_suppression("mysqld: File .*");
+
+--echo
+--echo # Start server with keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
+INSERT INTO t1 VALUES ('foobar');
+ALTER TABLE t1 ADD COLUMN c2 INT;
+INSERT INTO t1 VALUES ('foobar',2);
+SELECT * FROM t1;
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+INSERT INTO t1 VALUES ('foobar',1);
+INSERT INTO t1 VALUES ('foobar',2);
+FLUSH TABLE WITH READ LOCK;
+SELECT * FROM t1;
+
+--echo
+--echo # Restart server with keysbad3.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
+-- source include/restart_mysqld.inc
+
+--error ER_GET_ERRMSG
+SELECT * FROM t1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
+-- source include/restart_mysqld.inc
+
+--replace_regex /tablespace [0-9]*/tablespace /
+DROP TABLE t1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+#
+# MDEV-8591: Database page corruption on disk or a failed space, Assertion failure in file buf0buf.cc
+# line 2856 on querying a table using wrong default encryption key
+#
+
+--echo # Start server with keys3.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+-- source include/restart_mysqld.inc
+
+SET GLOBAL innodb_default_encryption_key_id=5;
+CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES;
+INSERT INTO t2 VALUES ('foobar',1,2);
+
+--echo
+--echo # Restart server with keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+--error ER_GET_ERRMSG
+SELECT * FROM t2;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+SELECT * FROM t2 where id = 1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+SELECT * FROM t2 where b = 1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--replace_regex /tablespace [0-9]*/tablespace /
+--error ER_GET_ERRMSG
+INSERT INTO t2 VALUES ('tmp',3,3);
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+DELETE FROM t2 where b = 3;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+DELETE FROM t2 where id = 3;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+UPDATE t2 set b = b +1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+OPTIMIZE TABLE t2;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+ALTER TABLE t2 ADD COLUMN d INT;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+ANALYZE TABLE t2;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+TRUNCATE TABLE t2;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+DROP TABLE t2;
+
+--echo
+--echo # Start server with keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
new file mode 100644
index 00000000000..52ee442c725
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -0,0 +1,103 @@
+--source include/have_innodb.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+-- source filekeys_plugin_exists.inc
+#
+# MDEV-8750: Server crashes in page_cur_is_after_last on altering table using a wrong encryption key
+# MDEV-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keys
+# 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: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1new cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+# 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\"\' tablespace is set as discarded.");
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+--source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+--source include/restart_mysqld.inc
+
+--error ER_GET_ERRMSG
+SELECT * FROM t1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+ALTER TABLE t1 engine=InnoDB;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+OPTIMIZE TABLE t1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+CHECK TABLE t1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+--source include/restart_mysqld.inc
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+let MYSQLD_TMPDIR = `SELECT @@tmpdir`;
+
+FLUSH TABLES t1 FOR EXPORT;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+UNLOCK TABLES;
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+--source include/restart_mysqld.inc
+
+# Discard should pass even with incorrect keys
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+ALTER TABLE t1 DISCARD TABLESPACE;
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+--source include/restart_mysqld.inc
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+--source include/restart_mysqld.inc
+
+# Rename table should pass even with incorrect keys
+RENAME TABLE t1 TO t1new;
+
+# Alter table rename is not allowed with incorrect keys
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+--error ER_GET_ERRMSG
+ALTER TABLE t1new RENAME TO t2new;
+
+# Drop should pass even with incorrect keys
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+DROP TABLE t1new;
+
+#
+# Reset environment
+#
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+
+
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1, t1new;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change3.test b/mysql-test/suite/encryption/t/innodb-bad-key-change3.test
new file mode 100644
index 00000000000..f6204e1ddfe
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change3.test
@@ -0,0 +1,121 @@
+--source include/have_innodb.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+-- source include/not_valgrind.inc
+# Avoid CrashReporter popup on Mac
+-- source include/not_crashrep.inc
+-- source filekeys_plugin_exists.inc
+#
+# MDEV-8772: Assertion failure in file ha_innodb.cc line 20027 when importing page compressed and encrypted tablespace using incorrect keys
+#
+
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
+--let $MYSQLD_DATADIR = `SELECT @@datadir`
+--let SEARCH_RANGE = 10000000
+--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/keys1.txt
+1;770A8A65DA156D24EE2A093277530142
+4;770A8A65DA156D24EE2A093277530143
+EOF
+
+--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+--enable_warnings
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+SHOW WARNINGS;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1,'foobar'),(2,'barfoo');
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+FLUSH TABLE t1 FOR EXPORT;
+--echo # List before copying files
+--list_files $MYSQLD_DATADIR/test
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+UNLOCK TABLES;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/keys2.txt
+1;770A8A65DA156D24EE2A093277530142
+4;770A8A65DA156D24EE2A093277530144
+EOF
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+--error ER_GET_ERRMSG
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+--error ER_TABLESPACE_DISCARDED
+SELECT * FROM t1;
+--sleep 5
+--echo # Tablespaces should be still encrypted
+-- let SEARCH_FILE=$t1_IBD
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+--write_file $MYSQLTEST_VARDIR/keys1.txt
+1;770A8A65DA156D24EE2A093277530142
+4;770A8A65DA156D24EE2A093277530143
+EOF
+
+--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+DROP TABLE t1;
+
+# reset system
+--disable_warnings
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
+--enable_warnings
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+--remove_file $MYSQLTEST_VARDIR/keys2.txt
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt
new file mode 100644
index 00000000000..6426bac41a0
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt
@@ -0,0 +1,4 @@
+--loose-innodb-buffer-pool-stats
+--loose-innodb-buffer-page
+--loose-innodb-buffer-page-lru
+--innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
new file mode 100644
index 00000000000..14d88614f55
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -0,0 +1,43 @@
+--source include/have_innodb.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+-- source filekeys_plugin_exists.inc
+#
+# MDEV-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keys
+# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
+#
+
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: Cannot open table .*");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+# Suppression for builds where file_key_management plugin is linked statically
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*");
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+--source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+--source include/restart_mysqld.inc
+
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+OPTIMIZE TABLE t1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+CHECK TABLE t1;
+--replace_regex /tablespace [0-9]*/tablespace / /key_id [0-9]*/key_id /
+SHOW WARNINGS;
+
+--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+--source include/restart_mysqld.inc
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test
new file mode 100644
index 00000000000..d0caed05006
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test
@@ -0,0 +1,123 @@
+-- source include/innodb_page_size.inc
+-- source include/have_file_key_management_plugin.inc
+
+SET @saved_file_format = @@global.innodb_file_format;
+SET @saved_file_per_table = @@global.innodb_file_per_table;
+SET @saved_checksum_algorithm = @@global.innodb_checksum_algorithm;
+SET @saved_encrypt_tables = @@global.innodb_encrypt_tables;
+SET @saved_encryption_threads = @@global.innodb_encryption_threads;
+SET @saved_encryption_key_id = @@global.innodb_default_encryption_key_id;
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encrypt_tables = ON;
+SET GLOBAL innodb_encryption_threads = 4;
+
+call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_(crc32|none|innodb)\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"(innodb|none|crc32)\"");
+
+SET GLOBAL innodb_checksum_algorithm = innodb;
+SET GLOBAL innodb_default_encryption_key_id=4;
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+
+# ROW_FORMAT=COMPRESSED is unavailable with innodb_page_size=32k or 64k
+let $row_format_compressed= `select case when @@global.innodb_page_size>16384
+then 'ROW_FORMAT=DYNAMIC' else 'ROW_FORMAT=COMPRESSED' end`;
+
+let $from = 3;
+while ($from)
+{
+dec $from;
+let checksum = `select case $from
+ when 0 then 'none'
+ when 1 then 'innodb'
+ when 2 then 'crc32'
+ end`;
+eval SET GLOBAL innodb_checksum_algorithm=$checksum;
+
+eval create table tce_$checksum(a serial, b blob, index(b(10))) engine=innodb
+$row_format_compressed encrypted=yes;
+eval create table tc_$checksum(a serial, b blob, index(b(10))) engine=innodb
+$row_format_compressed encrypted=no;
+eval create table te_$checksum(a serial, b blob, index(b(10))) engine=innodb
+encrypted=yes;
+eval create table t_$checksum(a serial, b blob, index(b(10))) engine=innodb
+encrypted=no;
+eval create table tpe_$checksum(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=yes;
+eval create table tp_$checksum(a serial, b blob, index(b(10))) engine=innodb
+page_compressed=yes encrypted=no;
+
+begin;
+eval insert into tce_$checksum(b) values (repeat('secret',20));
+eval insert into tc_$checksum(b) values (repeat('secret',20));
+eval insert into te_$checksum(b) values (repeat('secret',20));
+eval insert into t_$checksum(b) values (repeat('secret',20));
+eval insert into tpe_$checksum(b) values (repeat('secret',20));
+eval insert into tp_$checksum(b) values (repeat('secret',20));
+commit;
+
+eval FLUSH TABLES tce_$checksum, tc_$checksum, te_$checksum,
+t_$checksum, tpe_$checksum, tp_$checksum FOR EXPORT;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+my @tables = ("tce_", "tc_", "te_", "t_", "tpe_", "tp_");
+ib_backup_tablespaces("test", map{ $_ . $ENV{checksum} } @tables);
+EOF
+--list_files $MYSQLD_DATADIR/test
+UNLOCK TABLES;
+
+let $to = 6;
+while ($to)
+{
+dec $to;
+let $tocksum = `select case $to
+ when 0 then 'none'
+ when 1 then 'strict_none'
+ when 2 then 'innodb'
+ when 3 then 'strict_innodb'
+ when 4 then 'crc32'
+ when 5 then 'strict_crc32'
+ end`;
+
+eval SET GLOBAL innodb_checksum_algorithm=$tocksum;
+
+eval ALTER TABLE tce_$checksum DISCARD TABLESPACE;
+eval ALTER TABLE tc_$checksum DISCARD TABLESPACE;
+eval ALTER TABLE te_$checksum DISCARD TABLESPACE;
+eval ALTER TABLE t_$checksum DISCARD TABLESPACE;
+eval ALTER TABLE tpe_$checksum DISCARD TABLESPACE;
+eval ALTER TABLE tp_$checksum DISCARD TABLESPACE;
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+my @tables = ("tce_", "tc_", "te_", "t_", "tpe_", "tp_");
+ib_restore_tablespaces("test", map{ $_ . $ENV{checksum} } @tables);
+EOF
+
+eval ALTER TABLE tce_$checksum IMPORT TABLESPACE;
+eval update tce_$checksum set b=substr(b,1);
+eval ALTER TABLE tc_$checksum IMPORT TABLESPACE;
+eval update tc_$checksum set b=substr(b,1);
+eval ALTER TABLE te_$checksum IMPORT TABLESPACE;
+eval update te_$checksum set b=substr(b,1);
+eval ALTER TABLE t_$checksum IMPORT TABLESPACE;
+eval update t_$checksum set b=substr(b,1);
+eval ALTER TABLE tpe_$checksum IMPORT TABLESPACE;
+eval update tpe_$checksum set b=substr(b,1);
+eval ALTER TABLE tp_$checksum IMPORT TABLESPACE;
+eval update tp_$checksum set b=substr(b,1);
+}
+
+eval CHECK TABLE tce_$checksum, tc_$checksum, te_$checksum,
+t_$checksum, tpe_$checksum, tp_$checksum;
+eval DROP TABLE tce_$checksum, tc_$checksum, te_$checksum,
+t_$checksum, tpe_$checksum, tp_$checksum;
+}
+
+SET GLOBAL innodb_file_format = @saved_file_format;
+SET GLOBAL innodb_file_per_table = @saved_file_per_table;
+SET GLOBAL innodb_checksum_algorithm = @saved_checksum_algorithm;
+SET GLOBAL innodb_encrypt_tables = @saved_encrypt_tables;
+SET GLOBAL innodb_encryption_threads = @saved_encryption_threads;
+SET GLOBAL innodb_default_encryption_key_id = @saved_encryption_key_id;
diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations
new file mode 100644
index 00000000000..e096b023b52
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations
@@ -0,0 +1,12 @@
+[crc32]
+loose-innodb-tablespaces-encryption
+loose-innodb-encrypt-tables=on
+loose-innodb-encryption-threads=4
+max_allowed_packet=64K
+loose-innodb-checksum-algorithm=crc32
+[none]
+loose-innodb-tablespaces-encryption
+loose-innodb-encrypt-tables=on
+loose-innodb-encryption-threads=4
+max_allowed_packet=64K
+loose-innodb-checksum-algorithm=none
diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
new file mode 100644
index 00000000000..cb69f22f745
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
@@ -0,0 +1,43 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*");
+call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted.");
+call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]");
+
+--echo # Restart mysqld --file-key-management-filename=keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+set GLOBAL innodb_default_encryption_key_id=4;
+create table t1(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed;
+create table t2(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
+create table t3(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=no;
+
+insert into t1 values (1, repeat('secret',6000));
+insert into t2 values (1, repeat('secret',6000));
+insert into t3 values (1, repeat('secret',6000));
+
+--echo # Restart mysqld --file-key-management-filename=keys3.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+-- source include/restart_mysqld.inc
+
+--error 1296
+select count(*) from t1 FORCE INDEX (b) where b like 'secret%';
+--error 1296
+select count(*) from t2 FORCE INDEX (b) where b like 'secret%';
+select count(*) from t3 FORCE INDEX (b) where b like 'secret%';
+
+--echo # Restart mysqld --file-key-management-filename=keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+drop table t1,t2,t3;
diff --git a/mysql-test/suite/encryption/t/innodb-discard-import-change.test b/mysql-test/suite/encryption/t/innodb-discard-import-change.test
new file mode 100644
index 00000000000..a278a8fba29
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-discard-import-change.test
@@ -0,0 +1,131 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+#
+# MDEV-11656: 'Data structure corruption' IMPORT TABLESPACE doesn't work for encrypted InnoDB tables if space_id changed
+#
+
+call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $innodb_compression_algo = `SELECT @@innodb_compression_algorithm`;
+--enable_query_log
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+--enable_warnings
+
+create table t1(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
+create table t2(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+create table t3(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes;
+create table t4(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes encrypted=yes encryption_key_id=4;
+create table t5(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb;
+
+insert into t1 values (NULL, 'verysecretmessage');
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t2 select * from t1;
+insert into t3 select * from t1;
+insert into t4 select * from t1;
+insert into t5 select * from t1;
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+FLUSH TABLE t1,t2,t3,t4,t5 FOR EXPORT;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1","t2","t3","t4","t5");
+EOF
+--list_files $MYSQLD_DATADIR/test
+UNLOCK TABLES;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+ALTER TABLE t5 DISCARD TABLESPACE;
+
+#
+# Now intentionally change space_id for t1,t3,t4,t5
+#
+DROP TABLE t1;
+DROP TABLE t3;
+DROP TABLE t4;
+DROP TABLE t5;
+
+create table t6(a int) engine=innodb;
+create table t5(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb;
+create table t3(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes;
+create table t1(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
+create table t4(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb page_compressed=yes encrypted=yes encryption_key_id=4;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+ALTER TABLE t5 DISCARD TABLESPACE;
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1","t2","t3","t4","t5");
+ib_restore_tablespaces("test", "t1","t2","t3","t4","t5");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) FROM t1;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t2;
+ALTER TABLE t3 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t3;
+ALTER TABLE t4 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t4;
+ALTER TABLE t5 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t5;
+
+#
+# Verify
+#
+--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
+--let $MYSQLD_DATADIR = `SELECT @@datadir`
+--let SEARCH_RANGE = 10000000
+--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
+--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
+--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
+--let t4_IBD = $MYSQLD_DATADIR/test/t4.ibd
+--let t5_IBD = $MYSQLD_DATADIR/test/t5.ibd
+--let SEARCH_PATTERN=verysecretmessage
+--echo # t1 encrypted expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t2 encrypted expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 page compressed expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t4 page compressed and encrypted expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t5 normal expecting FOUND
+-- let SEARCH_FILE=$t5_IBD
+-- source include/search_pattern_in_file.inc
+
+DROP TABLE t1,t2,t3,t4,t5,t6;
+
+# reset system
+--disable_warnings
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
+--enable_query_log
+--enable_warnings
+
diff --git a/mysql-test/suite/encryption/t/innodb-discard-import.test b/mysql-test/suite/encryption/t/innodb-discard-import.test
new file mode 100644
index 00000000000..9feaacc41e5
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-discard-import.test
@@ -0,0 +1,135 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+-- source include/not_valgrind.inc
+# Avoid CrashReporter popup on Mac
+-- source include/not_crashrep.inc
+
+#
+# MDEV-8770: Incorrect error message when importing page compressed tablespace
+#
+
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $innodb_compression_algo = `SELECT @@innodb_compression_algorithm`;
+--enable_query_log
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+--enable_warnings
+
+--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
+--let $MYSQLD_DATADIR = `SELECT @@datadir`
+--let SEARCH_RANGE = 10000000
+--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
+--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
+--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
+--let t4_IBD = $MYSQLD_DATADIR/test/t4.ibd
+
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
+show warnings;
+create table t2(c1 bigint not null, b char(200)) engine=innodb page_compressed=1 encrypted=yes encryption_key_id=4;
+show warnings;
+create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
+show warnings;
+create table t4(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
+show warnings;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into t1 values(current_num, repeat('foobar',30));
+ insert into t2 values(current_num, repeat('barfoo',30));
+ insert into t3 values(current_num, repeat('tmpres',30));
+ insert into t4 values(current_num, repeat('mysql',30));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+
+select count(*) from t1;
+select count(*) from t2;
+select count(*) from t3;
+select count(*) from t4;
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+FLUSH TABLE t1,t2,t3,t4 FOR EXPORT;
+--echo # List before copying files
+--list_files $MYSQLD_DATADIR/test
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1","t2","t3","t4");
+EOF
+--list_files $MYSQLD_DATADIR/test
+
+UNLOCK TABLES;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1","t2","t3","t4");
+ib_restore_tablespaces("test", "t1","t2","t3","t4");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) FROM t1;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+SELECT COUNT(*) FROM t2;
+ALTER TABLE t3 IMPORT TABLESPACE;
+SHOW CREATE TABLE t3;
+SELECT COUNT(*) FROM t3;
+ALTER TABLE t4 IMPORT TABLESPACE;
+SHOW CREATE TABLE t4;
+SELECT COUNT(*) FROM t4;
+
+--echo # tables should be still either encrypted and/or compressed
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=barfoo
+--echo # t2 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=tmpres
+--echo # t3 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mysql
+--echo # t4 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1,t2,t3,t4;
+
+# reset system
+--disable_warnings
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
+--enable_query_log
+--enable_warnings
diff --git a/mysql-test/suite/encryption/t/innodb-encr-threads.test b/mysql-test/suite/encryption/t/innodb-encr-threads.test
new file mode 100644
index 00000000000..1a90a31870b
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-encr-threads.test
@@ -0,0 +1,14 @@
+--source include/have_innodb.inc
+--source include/have_file_key_management_plugin.inc
+
+#
+# MDEV-8159 InnoDB: Failing assertion: key_state->key_id
+#
+create table t1 (i int) engine=innodb;
+set global innodb_encryption_threads = 1;
+set global innodb_encryption_rotate_key_age = 2;
+insert t1 values (1);
+drop table t1;
+set global innodb_encryption_threads = 0;
+set global innodb_encryption_rotate_key_age = 1;
+
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-alter.test b/mysql-test/suite/encryption/t/innodb-encryption-alter.test
new file mode 100644
index 00000000000..9420fb74a4c
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-encryption-alter.test
@@ -0,0 +1,96 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+
+#
+# MDEV-8817: Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID
+#
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $encrypt_tables = `SELECT @@innodb_encrypt_tables`;
+let $threads = `SELECT @@innodb_encryption_threads`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encrypt_tables = ON;
+SET GLOBAL innodb_encryption_threads = 4;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=4;
+DROP TABLE t1;
+set innodb_default_encryption_key_id = 99;
+--error 1005
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+SHOW WARNINGS;
+--error 1005
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
+SHOW WARNINGS;
+set innodb_default_encryption_key_id = 4;
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+ALTER TABLE t1 ENCRYPTION_KEY_ID=99;
+SHOW WARNINGS;
+set innodb_default_encryption_key_id = 1;
+
+
+--disable_warnings
+--disable_query_log
+let $i = 400;
+while ($i)
+{
+INSERT INTO t1 values(NULL, substring(MD5(RAND()), -128));
+dec $i;
+}
+commit;
+INSERT INTO t2 select * from t1;
+
+--disable_abort_on_error
+
+--connect (con1,localhost,root,,test)
+--connect (con2,localhost,root,,test)
+
+let $i = 50;
+while ($i)
+{
+connection con1;
+send ALTER TABLE t1 ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
+connection con2;
+send ALTER TABLE t1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+connection default;
+send ALTER TABLE t2 ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
+connection con1;
+--reap;
+ALTER TABLE t1 ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
+connection con2;
+--reap
+ALTER TABLE t1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+connection default;
+--reap
+ALTER TABLE t2 ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+ALTER TABLE t1 ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
+dec $i;
+}
+
+connection default;
+--disconnect con1
+--disconnect con2
+
+--enable_abort_on_error
+--enable_warnings
+--enable_query_log
+
+drop table t1,t2;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables;
+EVAL SET GLOBAL innodb_encryption_threads = $threads;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
new file mode 100644
index 00000000000..38f36076c73
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
@@ -0,0 +1,52 @@
+-- source include/have_innodb.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+-- source filekeys_plugin_exists.inc
+
+#
+# MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
+#
+
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t5 cannot be decrypted.");
+
+# Suppression for builds where file_key_management plugin is linked statically
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
+
+--let $restart_parameters=--innodb-encrypt-tables=ON --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+--source include/restart_mysqld.inc
+
+create table t5 (
+ `intcol1` int(32) DEFAULT NULL,
+ `intcol2` int(32) DEFAULT NULL,
+ `charcol1` varchar(128) DEFAULT NULL,
+ `charcol2` varchar(128) DEFAULT NULL,
+ `charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+insert into t5 values (1,2,'maria','db','encryption');
+
+CREATE TABLE `t1` (
+ `intcol1` int(32) DEFAULT NULL,
+ `intcol2` int(32) DEFAULT NULL,
+ `charcol1` varchar(128) DEFAULT NULL,
+ `charcol2` varchar(128) DEFAULT NULL,
+ `charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB;
+
+insert into t1 values (1,2,'maria','db','encryption');
+alter table t1 encrypted='yes' `encryption_key_id`=1;
+
+--let $restart_parameters=--innodb-encrypt-tables=OFF
+--source include/restart_mysqld.inc
+
+--error 1296
+select * from t1;
+--error 1296
+select * from t5;
+
+--let $restart_parameters=--innodb-encrypt-tables=ON --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+--source include/restart_mysqld.inc
+
+drop table t1;
+drop table t5;
diff --git a/mysql-test/suite/encryption/t/innodb-first-page-read.opt b/mysql-test/suite/encryption/t/innodb-first-page-read.opt
new file mode 100644
index 00000000000..38d69691ed6
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-first-page-read.opt
@@ -0,0 +1,5 @@
+--innodb-encrypt-tables=ON
+--innodb-encrypt-log=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb-first-page-read.test b/mysql-test/suite/encryption/t/innodb-first-page-read.test
new file mode 100644
index 00000000000..d661e4565d2
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-first-page-read.test
@@ -0,0 +1,109 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+FLUSH STATUS;
+
+create database innodb_test;
+use innodb_test;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed;
+create table innodb_compressed1(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=1;
+create table innodb_compressed2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=2;
+create table innodb_compressed4(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=4;
+create table innodb_compressed8(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=8;
+create table innodb_compressed16(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=16;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
+create table innodb_pagecomp(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes;
+create table innodb_pagecomp1(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=1;
+create table innodb_pagecomp2(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=2;
+create table innodb_pagecomp3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=3;
+create table innodb_pagecomp4(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=4;
+create table innodb_pagecomp5(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=5;
+create table innodb_pagecomp6(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=6;
+create table innodb_pagecomp7(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=7;
+create table innodb_pagecomp8(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=8;
+create table innodb_pagecomp9(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=9;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval create table innodb_datadir1(c1 bigint not null, b char(200)) engine=innodb DATA DIRECTORY='$MYSQL_TMP_DIR';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval create table innodb_datadir2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed DATA DIRECTORY='$MYSQL_TMP_DIR';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval create table innodb_datadir3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes DATA DIRECTORY='$MYSQL_TMP_DIR';
+
+begin;
+insert into innodb_normal values (1,'secret');
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_compressed1 select * from innodb_normal;
+insert into innodb_compressed2 select * from innodb_normal;
+insert into innodb_compressed4 select * from innodb_normal;
+insert into innodb_compressed8 select * from innodb_normal;
+insert into innodb_compressed16 select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+insert into innodb_pagecomp select * from innodb_normal;
+insert into innodb_pagecomp1 select * from innodb_normal;
+insert into innodb_pagecomp2 select * from innodb_normal;
+insert into innodb_pagecomp3 select * from innodb_normal;
+insert into innodb_pagecomp4 select * from innodb_normal;
+insert into innodb_pagecomp5 select * from innodb_normal;
+insert into innodb_pagecomp6 select * from innodb_normal;
+insert into innodb_pagecomp7 select * from innodb_normal;
+insert into innodb_pagecomp8 select * from innodb_normal;
+insert into innodb_pagecomp9 select * from innodb_normal;
+insert into innodb_datadir1 select * from innodb_normal;
+insert into innodb_datadir2 select * from innodb_normal;
+insert into innodb_datadir3 select * from innodb_normal;
+commit;
+
+FLUSH STATUS;
+
+--echo # Restart server and see how many page 0's are read
+--source include/restart_mysqld.inc
+
+--echo # result should actual number of tables except remote tables could be read twice
+--echo # i.e. < 23 + 3*2 = 29
+
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+use innodb_test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+use test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+
+set global innodb_encrypt_tables=OFF;
+
+--echo # wait until tables are decrypted
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
+--source include/wait_condition.inc
+
+--echo # result should be actual number of tables except remote tables could be read twice
+--echo # i.e. < 23 + 3*2 = 29
+
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+use innodb_test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+use test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+
+FLUSH STATUS;
+
+--echo # restart and see number read page 0
+-- source include/restart_mysqld.inc
+
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+use innodb_test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+use test;
+SELECT VARIABLE_VALUE <= 29 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'innodb_pages0_read';
+
+drop database innodb_test;
+FLUSH STATUS;
diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.test b/mysql-test/suite/encryption/t/innodb-force-corrupt.test
new file mode 100644
index 00000000000..dd4ee51b1eb
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.test
@@ -0,0 +1,92 @@
+#
+# MDEV-11759: Encryption code in MariaDB 10.1/10.2 causes compatibility problems
+#
+
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# Don't test under embedded
+-- source include/not_embedded.inc
+
+CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed .*");
+CALL mtr.add_suppression("InnoDB: Corruption: Block in space_id .*");
+CALL mtr.add_suppression("InnoDB: However key management plugin or used key_version .*");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+--enable_warnings
+
+--echo # Create and populate tables to be corrupted
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT,c char(200)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT,c char(200)) ENGINE=InnoDB row_format=compressed encrypted=yes;
+CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT, c char(200)) ENGINE=InnoDB page_compressed=yes encrypted=yes;
+
+BEGIN;
+INSERT INTO t1 (b,c) VALUES ('corrupt me','secret');
+--disable_query_log
+--let $i = 100
+while ($i)
+{
+ INSERT INTO t1 (b,c) VALUES (REPEAT('abcabcabc', 100),'secretsecret');
+ dec $i;
+}
+--enable_query_log
+
+INSERT INTO t1 (b,c) VALUES ('corrupt me','moresecretmoresecret');
+INSERT INTO t2 select * from t1;
+INSERT INTO t3 select * from t1;
+COMMIT;
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+
+--source include/shutdown_mysqld.inc
+
+--echo # Backup tables before corrupting
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd.backup
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t2.ibd.backup
+--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_DATADIR/test/t3.ibd.backup
+
+--echo # Corrupt tables
+
+perl;
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t1.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t2.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t3.ibd") or die "open";
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
+print FILE pack("H*", "c00lcafedeadb017");
+close FILE or die "close";
+EOF
+
+--source include/start_mysqld.inc
+
+--error ER_GET_ERRMSG
+SELECT * FROM t1;
+--error ER_GET_ERRMSG
+SELECT * FROM t2;
+--error ER_GET_ERRMSG
+SELECT * FROM t3;
+
+--source include/shutdown_mysqld.inc
+
+--echo # Restore the original tables
+--move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
+--move_file $MYSQLD_DATADIR/test/t2.ibd.backup $MYSQLD_DATADIR/test/t2.ibd
+--move_file $MYSQLD_DATADIR/test/t3.ibd.backup $MYSQLD_DATADIR/test/t3.ibd
+
+--source include/start_mysqld.inc
+
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.opt b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.opt
new file mode 100644
index 00000000000..03a0028d371
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.opt
@@ -0,0 +1,5 @@
+--innodb-encrypt-tables
+--innodb-encrypt-log
+--innodb-encryption-rotate-key-age=0
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
new file mode 100644
index 00000000000..574e0c3becc
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
@@ -0,0 +1,88 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# not embedded because of restarts
+-- source include/not_embedded.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+
+--disable_query_log
+--disable_warnings
+let $encryption = `SELECT @@innodb_encrypt_tables`;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# zlib
+set global innodb_compression_algorithm = 1;
+--enable_warnings
+--enable_query_log
+
+create database enctests;
+use enctests;
+create table t1(a int not null primary key, b char(200)) engine=innodb;
+create table t2(a int not null primary key, b char(200)) engine=innodb row_format=compressed;
+create table t3(a int not null primary key, b char(200)) engine=innodb page_compressed=yes;
+create table t4(a int not null primary key, b char(200)) engine=innodb encrypted=yes;
+create table t5(a int not null primary key, b char(200)) engine=innodb encrypted=yes row_format=compressed;
+create table t6(a int not null primary key, b char(200)) engine=innodb encrypted=yes page_compressed=yes;
+create table t7(a int not null primary key, b char(200)) engine=innodb encrypted=no;
+create table t8(a int not null primary key, b char(200)) engine=innodb encrypted=no row_format=compressed;
+create table t9(a int not null primary key, b char(200)) engine=innodb encrypted=no page_compressed=yes;
+
+insert into t1 values (1, 'secredmessage');
+insert into t2 values (1, 'secredmessage');
+insert into t3 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc');
+insert into t4 values (1, 'secredmessage');
+insert into t5 values (1, 'secredmessage');
+insert into t6 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc');
+insert into t7 values (1, 'publicmessage');
+insert into t8 values (1, 'publicmessage');
+insert into t9 values (1, 'pugliccompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc');
+
+--echo # should list tables t1-t6
+SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'enctests%';
+--echo # should list tables t7-t9
+SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 and NAME LIKE 'enctests%';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_encrypt_tables=OFF;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_encrypt_tables=ON;
+
+--let $MYSQLD_DATADIR=`select @@datadir`
+
+-- source include/shutdown_mysqld.inc
+
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=secred
+--echo # t1 default on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t1.ibd
+-- source include/search_pattern_in_file.inc
+--echo # t2 default on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t2.ibd
+-- source include/search_pattern_in_file.inc
+--echo # t3 default on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t3.ibd
+-- source include/search_pattern_in_file.inc
+--echo # t4 on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t4.ibd
+-- source include/search_pattern_in_file.inc
+--echo # t5 on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t5.ibd
+-- source include/search_pattern_in_file.inc
+--echo # t6 on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t6.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=public
+--echo # t7 off expecting FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t7.ibd
+-- source include/search_pattern_in_file.inc
+--echo # t8 row compressed expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t8.ibd
+-- source include/search_pattern_in_file.inc
+--echo # t9 page compressed expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t9.ibd
+-- source include/search_pattern_in_file.inc
+
+-- source include/start_mysqld.inc
+
+drop database enctests;
diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt
new file mode 100644
index 00000000000..e76aa060879
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt
@@ -0,0 +1,6 @@
+--innodb-encrypt-log=ON
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--loose-file-key-management
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
+--file-key-management-encryption-algorithm=aes_cbc
+--innodb-buffer-pool-size=128M
diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test
new file mode 100644
index 00000000000..cb9a69d036b
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test
@@ -0,0 +1,41 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+# test takes very long time on debug build
+-- source include/not_debug.inc
+-- source include/big_test.inc
+-- source filekeys_plugin.inc
+
+call mtr.add_suppression("InnoDB: New log files created, LSN=.*");
+call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");
+call mtr.add_suppression("InnoDB: Error: Table .*");
+
+#
+# MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables
+#
+
+CREATE TABLE t1 (
+ pk bigint auto_increment,
+ col_int int,
+ col_int_key int,
+ col_char char(12),
+ col_char_key char(12),
+ primary key (pk),
+ key (`col_int_key` ),
+ key (`col_char_key` )
+) ENGINE=InnoDB;
+CREATE TABLE t2 LIKE t1;
+
+INSERT INTO t1 VALUES (NULL,1,1,'foo','foo'),(NULL,2,2,'bar','bar'),(NULL,3,3,'baz','baz'),(NULL,4,4,'qux','qux');
+INSERT INTO t2
+ SELECT NULL, a1.col_int, a1.col_int_key, a1.col_char, a1.col_char_key
+ FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5, t1 a6, t1 a7, t1 a8, t1 a9, t1 a10;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server 0
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt.opt b/mysql-test/suite/encryption/t/innodb-log-encrypt.opt
new file mode 100644
index 00000000000..24046fe779a
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt.opt
@@ -0,0 +1,6 @@
+--innodb-encrypt-log=ON
+--innodb-encrypt-tables=FORCE
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--loose-file-key-management
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
+--file-key-management-encryption-algorithm=aes_cbc
diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt.test b/mysql-test/suite/encryption/t/innodb-log-encrypt.test
new file mode 100644
index 00000000000..0555f9d49aa
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt.test
@@ -0,0 +1,97 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source filekeys_plugin.inc
+
+#
+# MDEV-9011: Redo log encryption does not work
+#
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table t1(c1 bigint not null, b char(200), c varchar(200)) engine=innodb encrypted=yes encryption_key_id=1;
+show warnings;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('privatejanprivate',10));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+begin;
+call innodb_insert_proc(2000);
+commit;
+
+update t1 set c1 = c1 +1;
+select count(*) from t1;
+
+--let $MYSQLD_DATADIR=`select @@datadir`
+--let ib1_IBD = $MYSQLD_DATADIR/ibdata1
+--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
+--let log0 = $MYSQLD_DATADIR/ib_logfile0
+--let log1 = $MYSQLD_DATADIR/ib_logfile1
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=privatejanprivate
+
+-- source include/kill_mysqld.inc
+
+--echo # ibdata1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # log0 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$log0
+-- source include/search_pattern_in_file.inc
+--echo # log1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$log1
+-- source include/search_pattern_in_file.inc
+
+--echo # Restart mysqld --innodb_encrypt_log=0
+-- let $restart_parameters=--innodb_encrypt_log=0
+-- source include/start_mysqld.inc
+
+insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+
+--let SEARCH_PATTERN=privatejanprivate
+--echo # ibdata1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # log0 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$log0
+-- source include/search_pattern_in_file.inc
+--echo # log1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$log1
+-- source include/search_pattern_in_file.inc
+
+--let SEARCH_PATTERN=publicmessage
+--echo # ibdata1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # log0 no on expecting FOUND/NOTFOUND depending where insert goes
+-- let SEARCH_FILE=$log0
+-- source include/search_pattern_in_file.inc
+--echo # log1 no on expecting FOUND/NOTFOUND depending where insert goes
+-- let SEARCH_FILE=$log1
+-- source include/search_pattern_in_file.inc
+
+drop procedure innodb_insert_proc;
+drop table t1;
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.opt b/mysql-test/suite/encryption/t/innodb-missing-key.opt
new file mode 100644
index 00000000000..02691695cbd
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.opt
@@ -0,0 +1,5 @@
+--innodb-encrypt-tables
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
+
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test
new file mode 100644
index 00000000000..07a2b16211c
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.test
@@ -0,0 +1,66 @@
+--source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+#
+# MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing
+#
+
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+
+--echo
+--echo # Start server with keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19;
+CREATE TABLE t2(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+CREATE TABLE t3(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=NO;
+INSERT INTO t1(b) VALUES ('thisissecredmessage');
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t3 SELECT * FROM t1;
+
+--echo
+--echo # Restart server with keys3.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+-- source include/restart_mysqld.inc
+
+set global innodb_encryption_rotate_key_age = 1;
+use test;
+CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+SELECT SLEEP(5);
+SELECT COUNT(1) FROM t3;
+SELECT COUNT(1) FROM t2;
+--error 1296
+SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
+--error 1296
+SELECT COUNT(1) FROM t1 where b = 'ab';
+--error 1296
+SELECT COUNT(1) FROM t1;
+
+--echo
+--echo # Start server with keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+SELECT COUNT(1) FROM t1;
+SELECT COUNT(1) FROM t2;
+SELECT COUNT(1) FROM t3;
+
+DROP TABLE t1, t2, t3;
+
+
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption-32k.opt b/mysql-test/suite/encryption/t/innodb-page_encryption-32k.opt
new file mode 100644
index 00000000000..a9021f6de15
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption-32k.opt
@@ -0,0 +1,2 @@
+--default_storage_engine=InnoDB
+--innodb-buffer-pool-size=24M
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption-32k.test b/mysql-test/suite/encryption/t/innodb-page_encryption-32k.test
new file mode 100644
index 00000000000..325f0a86521
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption-32k.test
@@ -0,0 +1,96 @@
+--source include/no_valgrind_without_big.inc
+--source include/not_embedded.inc
+# Tests for setting innodb-page-size=32k;
+--source include/have_innodb.inc
+--source include/have_innodb_32k.inc
+--source include/have_file_key_management_plugin.inc
+
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+
+--disable_query_log
+# These values can change during the test
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
+
+show create table innodb_compact;
+show create table innodb_dynamic;
+show create table innodb_redundant;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into innodb_normal values(current_num, substring(MD5(RAND()), -150));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+
+--source include/restart_mysqld.inc
+
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compact;
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_dynamic;
+alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_redundant;
+
+--source include/restart_mysqld.inc
+
+show create table innodb_compact;
+show create table innodb_dynamic;
+show create table innodb_redundant;
+
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
+drop table innodb_redundant;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption.test b/mysql-test/suite/encryption/t/innodb-page_encryption.test
new file mode 100644
index 00000000000..463df756933
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption.test
@@ -0,0 +1,169 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+show warnings;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
+show warnings;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
+show warnings;
+--error ER_CANT_CREATE_TABLE
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
+show warnings;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
+show warnings;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
+show warnings;
+
+set innodb_default_encryption_key_id = 5;
+create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb encrypted=yes;
+show create table innodb_defkey;
+
+show create table innodb_compact;
+show create table innodb_compressed;
+show create table innodb_dynamic;
+show create table innodb_redundant;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+insert into innodb_defkey select * from innodb_normal;
+
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+update innodb_defkey set c1 = c1 + 1;
+
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_compressed where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+select count(*) from innodb_defkey where c1 < 1500000;
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_defkey t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+
+# Note there that these variables are updated only when real I/O is done, thus they are not reliable
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+update innodb_defkey set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_compressed where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+select count(*) from innodb_defkey where c1 < 1500000;
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_defkey t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compact;
+alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compressed;
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_dynamic;
+alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_redundant;
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+show create table innodb_compact;
+show create table innodb_compressed;
+show create table innodb_dynamic;
+show create table innodb_redundant;
+show create table innodb_defkey;
+
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_compressed where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_compressed;
+drop table innodb_dynamic;
+drop table innodb_redundant;
+drop table innodb_defkey;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test b/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test
new file mode 100644
index 00000000000..fc11aa1676d
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test
@@ -0,0 +1,81 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+-- source include/not_embedded.inc
+
+--disable_query_log
+let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# zlib
+set global innodb_compression_algorithm = 1;
+--enable_warnings
+
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
+show warnings;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1 page_compressed=1;
+show warnings;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=2 page_compressed=1;
+show warnings;
+
+show create table innodb_normal;
+show create table innodb_compact;
+show create table innodb_dynamic;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into innodb_normal values(current_num, substring(MD5(RAND()), -128));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+begin;
+call innodb_insert_proc(2000);
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+commit;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
+--source include/wait_condition.inc
+
+--let $restart_parameters=--innodb-encrypt-tables=OFF
+--source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# zlib
+set global innodb_compression_algorithm = 1;
+--enable_warnings
+
+alter table innodb_normal engine=innodb page_compressed=DEFAULT;
+show create table innodb_normal;
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
+show create table innodb_compact;
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
+show create table innodb_dynamic;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_DECOMPRESSED';
+--source include/wait_condition.inc
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.opt b/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.opt
new file mode 100644
index 00000000000..d09b26a375e
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.opt
@@ -0,0 +1,3 @@
+--innodb-encrypt-log=ON
+--innodb-encrypt-tables=ON
+
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test b/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test
new file mode 100644
index 00000000000..79dc447e352
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test
@@ -0,0 +1,113 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_file_key_management_plugin.inc
+
+#call mtr.add_suppression("KeyID 0 not found or with error. Check the key and the log.*");
+#call mtr.add_suppression("Disabling redo log encryp.*");
+#call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key version.*");
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+show warnings;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
+show warnings;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
+show warnings;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
+show warnings;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
+show warnings;
+
+show create table innodb_compact;
+show create table innodb_compressed;
+show create table innodb_dynamic;
+show create table innodb_redundant;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+begin;
+call innodb_insert_proc(2000);
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+commit;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_ENCRYPTED';
+--source include/wait_condition.inc
+
+# Note there that these variables are updated only when real I/O is done, thus they are not reliable
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+--source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+update innodb_normal set c1 = c1 +1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_ENCRYPTED';
+--source include/wait_condition.inc
+
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+SET GLOBAL innodb_encrypt_tables=OFF;
+alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compact;
+alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_compressed;
+alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_dynamic;
+alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
+show create table innodb_redundant;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_DECRYPTED';
+--source include/wait_condition.inc
+
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_compressed;
+drop table innodb_dynamic;
+drop table innodb_redundant;
+#
+# MDEV-8143: InnoDB: Database page corruption on disk or a failed file read
+#
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ENCRYPTION_KEY_ID=2 ENCRYPTED=YES;
+INSERT INTO t1 VALUES (1),(2);
+
+--echo # Restarting server...
+--source include/restart_mysqld.inc
+
+SELECT * FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/innodb-read-only.opt b/mysql-test/suite/encryption/t/innodb-read-only.opt
new file mode 100644
index 00000000000..acedb1a17bb
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-read-only.opt
@@ -0,0 +1,3 @@
+--innodb-encrypt-tables=1
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb-read-only.test b/mysql-test/suite/encryption/t/innodb-read-only.test
new file mode 100644
index 00000000000..10ec87467b6
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-read-only.test
@@ -0,0 +1,34 @@
+--source suite/encryption/include/have_file_key_management_plugin.inc
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+let $cnt=600;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0`;
+ if ($success)
+ {
+ let $cnt=0;
+ }
+ if (!$success)
+ {
+ real_sleep 1;
+ dec $cnt;
+ }
+}
+if (!$success)
+{
+ SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
+ SHOW STATUS LIKE 'innodb_encryption%';
+ -- die Timeout waiting for encryption threads
+}
+--echo # Success!
+
+#
+# MDEV-11835: InnoDB: Failing assertion: free_slot != NULL on
+# restarting server with encryption and read-only
+#
+--let $restart_parameters= --innodb-read-only=1 --innodb-encrypt-tables=1
+--source include/restart_mysqld.inc
+--echo # All done
diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.opt b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
new file mode 100644
index 00000000000..343128e8803
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
@@ -0,0 +1,5 @@
+--innodb-change-buffering=all
+--innodb-encrypt-tables=on
+--innodb-tablespaces-encryption
+--innodb-encryption-threads=2
+--innodb-default-encryption-key-id=4
diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.test b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
new file mode 100644
index 00000000000..159646541c7
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
@@ -0,0 +1,100 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Block in space_id .* in file .* encrypted.");
+call mtr.add_suppression("Plugin 'file_key_management' .*");
+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: Read operation failed for tablespace .*");
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
+call mtr.add_suppression("InnoDB: Recovery read page .*");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE .*");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted .*");
+call mtr.add_suppression("InnoDB: ############### CORRUPT LOG RECORD FOUND ##################");
+
+--echo # Restart mysqld --file-key-management-filename=keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
+--source include/wait_condition.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
+create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed;
+create table t3(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=4;
+create table t4(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb;
+
+begin;
+--disable_query_log
+--let $i = 20
+begin;
+while ($i)
+{
+ insert into t1(c,b) values (repeat('secret1',20), repeat('secret2',6000));
+ dec $i;
+}
+--enable_query_log
+
+insert into t2 select * from t1;
+insert into t3 select * from t1;
+insert into t4 select * from t1;
+commit;
+
+--source ../../suite/innodb/include/no_checkpoint_start.inc
+
+#
+# We test redo log page read at recv_read_page using
+# incorrect keys from std_data/keys.txt. If checkpoint
+# happens we will skip this test. If no checkpoint
+# happens, InnoDB refuses to start as used
+# encryption key is incorrect.
+#
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+begin;
+update t1 set c = repeat('secret3', 20);
+update t2 set c = repeat('secret4', 20);
+update t3 set c = repeat('secret4', 20);
+update t4 set c = repeat('secret4', 20);
+insert into t1 (c,b) values (repeat('secret5',20), repeat('secret6',6000));
+insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
+insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
+insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
+COMMIT;
+let $cleanup= drop table t1,t2,t3,t4;
+--let CLEANUP_IF_CHECKPOINT= $cleanup;
+--source ../../suite/innodb/include/no_checkpoint_end.inc
+
+--echo # restart
+--error 1
+-- source include/start_mysqld.inc
+--source include/kill_mysqld.inc
+
+#
+# Now test with innodb-force-recovery=1 i.e. ignore corrupt pages
+#
+
+--echo # Restart mysqld --innodb-force-recovery=1
+-- let $restart_parameters=--innodb-force-recovery=1
+--error 1
+-- source include/start_mysqld.inc
+
+--source include/kill_mysqld.inc
+
+--echo # Restart mysqld --file-key-management-filename=keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/start_mysqld.inc
+
+drop table t1, t2,t3,t4;
diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.opt b/mysql-test/suite/encryption/t/innodb-redo-nokeys.opt
new file mode 100644
index 00000000000..21afc19fc5d
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.opt
@@ -0,0 +1,3 @@
+--innodb-change-buffering=none
+--innodb-encrypt-tables=on
+--innodb-default-encryption-key-id=20
diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
new file mode 100644
index 00000000000..e55e2ade153
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
@@ -0,0 +1,80 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Block in space_id .*");
+call mtr.add_suppression("mysqld: File .*");
+call mtr.add_suppression("Plugin 'file_key_management' .*");
+call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
+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: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted.");
+call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted.");
+
+--echo # Restart mysqld --file-key-management-filename=keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
+create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed;
+create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
+create table t4(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb;
+
+begin;
+--disable_query_log
+--let $i = 20
+begin;
+while ($i)
+{
+ insert into t1(c,b) values (repeat('secret1',20), repeat('secret2',6000));
+ dec $i;
+}
+--enable_query_log
+
+insert into t2 select * from t1;
+insert into t3 select * from t1;
+insert into t4 select * from t1;
+commit;
+
+--source ../../suite/innodb/include/no_checkpoint_start.inc
+#
+# We test redo log page read at recv_read_page using
+# keys that are not in std_data/keys.txt. If checkpoint
+# happens we will skip this test. If no checkpoint
+# happens, InnoDB refuses to start as used
+# encryption key is not found.
+#
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+begin;
+update t1 set c = repeat('secret3', 20);
+update t2 set c = repeat('secret4', 20);
+update t3 set c = repeat('secret4', 20);
+update t4 set c = repeat('secret4', 20);
+insert into t1 (c,b) values (repeat('secret5',20), repeat('secret6',6000));
+insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
+insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
+insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
+COMMIT;
+let $cleanup= drop table t1,t2,t3,t4;
+--let CLEANUP_IF_CHECKPOINT= $cleanup;
+--source ../../suite/innodb/include/no_checkpoint_end.inc
+
+--echo # restart
+-- source include/start_mysqld.inc
+#
+# In above server does start but InnoDB refuses to start
+# thus we need to restart server with correct key file
+#
+--echo # Restart mysqld --file-key-management-filename=keys2.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+drop table t1, t2,t3,t4;
diff --git a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.opt b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.opt
new file mode 100644
index 00000000000..0b7319dcef5
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.opt
@@ -0,0 +1,7 @@
+--aria-encrypt-tables=ON
+--encrypt-tmp-disk-tables=ON
+--innodb-encrypt-tables=ON
+--innodb-encrypt-log=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test
new file mode 100644
index 00000000000..ea6bd65d605
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test
@@ -0,0 +1,136 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+
+--disable_query_log
+let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`;
+let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`;
+--enable_query_log
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = on;
+--enable_warnings
+
+# zlib
+set global innodb_compression_algorithm = 1;
+
+create table innodb_normal (c1 int, b char(20)) engine=innodb;
+show warnings;
+create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
+show warnings;
+show create table innodb_page_compressed1;
+create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
+show warnings;
+show create table innodb_page_compressed2;
+create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
+show warnings;
+show create table innodb_page_compressed3;
+create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
+show warnings;
+show create table innodb_page_compressed4;
+create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
+show warnings;
+show create table innodb_page_compressed5;
+create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
+show warnings;
+show create table innodb_page_compressed6;
+create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
+show warnings;
+show create table innodb_page_compressed7;
+create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
+show warnings;
+show create table innodb_page_compressed8;
+create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
+show warnings;
+show create table innodb_page_compressed9;
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into innodb_normal values(current_num,'testing..');
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+begin;
+call innodb_insert_proc(2000);
+insert into innodb_page_compressed1 select * from innodb_normal;
+insert into innodb_page_compressed2 select * from innodb_normal;
+insert into innodb_page_compressed3 select * from innodb_normal;
+insert into innodb_page_compressed4 select * from innodb_normal;
+insert into innodb_page_compressed5 select * from innodb_normal;
+insert into innodb_page_compressed6 select * from innodb_normal;
+insert into innodb_page_compressed7 select * from innodb_normal;
+insert into innodb_page_compressed8 select * from innodb_normal;
+insert into innodb_page_compressed9 select * from innodb_normal;
+commit;
+
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
+--source include/wait_condition.inc
+
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = off;
+
+update innodb_page_compressed1 set c1 = c1 + 1;
+update innodb_page_compressed2 set c1 = c1 + 1;
+update innodb_page_compressed3 set c1 = c1 + 1;
+update innodb_page_compressed4 set c1 = c1 + 1;
+update innodb_page_compressed5 set c1 = c1 + 1;
+update innodb_page_compressed6 set c1 = c1 + 1;
+update innodb_page_compressed7 set c1 = c1 + 1;
+update innodb_page_compressed8 set c1 = c1 + 1;
+update innodb_page_compressed9 set c1 = c1 + 1;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_DECRYPTED';
+--source include/wait_condition.inc
+
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_encrypt_tables = $innodb_encrypt_tables_orig;
+EVAL SET GLOBAL innodb_encryption_threads = $innodb_encryption_threads_orig;
+--enable_query_log
+
diff --git a/mysql-test/suite/encryption/t/innodb_encryption.opt b/mysql-test/suite/encryption/t/innodb_encryption.opt
new file mode 100644
index 00000000000..0f3634acf1c
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption.opt
@@ -0,0 +1,8 @@
+--aria-encrypt-tables
+--encrypt-tmp-disk-tables
+--innodb-encrypt-tables
+--innodb-encrypt-log
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
+
diff --git a/mysql-test/suite/encryption/t/innodb_encryption.test b/mysql-test/suite/encryption/t/innodb_encryption.test
new file mode 100644
index 00000000000..d183a2914bd
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption.test
@@ -0,0 +1,78 @@
+#
+#
+#
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/innodb_undo_tablespaces.inc
+
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+SET @start_global_value = @@global.innodb_encryption_threads;
+
+SHOW VARIABLES LIKE 'innodb_encrypt%';
+
+SET GLOBAL innodb_encrypt_tables = ON;
+
+--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'`
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--echo # Success!
+
+--echo # Now turn off encryption and wait for threads to decrypt everything
+SET GLOBAL innodb_encrypt_tables = off;
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--echo # Success!
+
+--echo # Shutdown innodb_encryption_threads
+SET GLOBAL innodb_encryption_threads=0;
+
+--echo # Turn on encryption
+--echo # since threads are off tables should remain unencrypted
+SET GLOBAL innodb_encrypt_tables = on;
+
+--echo # Wait 15s to check that nothing gets encrypted
+--let $wait_timeout= 15
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--echo # Success!
+
+--echo # Startup innodb_encryption_threads
+SET GLOBAL innodb_encryption_threads=@start_global_value;
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--echo # Success!
+--echo # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
+-- let $restart_parameters=--innodb_encrypt_tables=0 --innodb_encryption_threads=0
+-- source include/restart_mysqld.inc
+
+SHOW VARIABLES LIKE 'innodb_encrypt%';
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.opt b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.opt
new file mode 100644
index 00000000000..bcff011eb82
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.opt
@@ -0,0 +1,8 @@
+--innodb-encrypt-tables=ON
+--innodb-encrypt-log=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
+--innodb-max-dirty-pages-pct=0.001
+
+
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
new file mode 100644
index 00000000000..192233a535f
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
@@ -0,0 +1,163 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_valgrind.inc
+-- source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
+
+let $MYSQLD_TMPDIR = `SELECT @@tmpdir`;
+let $MYSQLD_DATADIR = `SELECT @@datadir`;
+
+--let SEARCH_RANGE = 10000000
+--let $id = `SELECT RAND()`
+--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
+--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
+--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
+CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB row_format=compressed encrypted=yes;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into t1 values (current_num,repeat('foobar',42));
+ insert into t2 values (current_num,repeat('temp', 42));
+ insert into t3 values (current_num,repeat('barfoo',42));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(10000);
+commit;
+set autocommit=1;
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
+--source include/wait_condition.inc
+
+--sleep 5
+--echo # tablespaces should be now encrypted
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=temp
+--echo # t2 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=barfoo
+--echo # t3 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+--list_files $MYSQLD_DATADIR/test
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1","t2","t3");
+EOF
+--list_files $MYSQLD_DATADIR/test
+UNLOCK TABLES;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1","t2","t3");
+ib_restore_tablespaces("test", "t1","t2","t3");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+SELECT COUNT(1) FROM t1;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SELECT COUNT(1) FROM t2;
+ALTER TABLE t3 IMPORT TABLESPACE;
+SELECT COUNT(1) FROM t3;
+
+--sleep 5
+--echo # tablespaces should remain encrypted after import
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=temp
+--echo # t2 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 ... on expecting NOT FOUND
+--let SEARCH_PATTERN=barfoo
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+
+ALTER TABLE t1 ENGINE InnoDB;
+SHOW CREATE TABLE t1;
+ALTER TABLE t2 ENGINE InnoDB;
+SHOW CREATE TABLE t2;
+ALTER TABLE t3 ENGINE InnoDB;
+SHOW CREATE TABLE t3;
+
+--echo # Restarting server
+-- source include/restart_mysqld.inc
+--echo # Done restarting server
+
+--echo # Verify that tables are still usable
+SELECT COUNT(1) FROM t1;
+SELECT COUNT(1) FROM t2;
+SELECT COUNT(1) FROM t3;
+
+--sleep 5
+--echo # Tablespaces should be encrypted after restart
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=temp
+--echo # t2 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 ... on expecting NOT FOUND
+--let SEARCH_PATTERN=barfoo
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
+--source include/wait_condition.inc
+
+--echo # Success!
+--echo # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
+-- let $restart_parameters=--innodb_encrypt_tables=0 --innodb_encryption_threads=0
+-- source include/restart_mysqld.inc
+
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1, t2, t3;
+
+# reset system
+--disable_warnings
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
+--enable_warnings
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_filekeys.opt b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.opt
new file mode 100644
index 00000000000..7d3f2da7971
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.opt
@@ -0,0 +1 @@
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test
new file mode 100644
index 00000000000..8f0986071f1
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test
@@ -0,0 +1,145 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+call mtr.add_suppression("trying to do an operation on a dropped tablespace .*");
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $encrypt_tables = `SELECT @@innodb_encrypt_tables`;
+let $threads = `SELECT @@innodb_encryption_threads`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_encrypt_tables = OFF;
+SET GLOBAL innodb_encryption_threads = 4;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
+CREATE TABLE t3 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO;
+CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+
+--disable_warnings
+--disable_query_log
+set autocommit=0;
+let $i = 400;
+while ($i)
+{
+INSERT INTO t1 values(NULL, substring(MD5(RAND()), -128));
+dec $i;
+}
+commit;
+set autocommit=1;
+--enable_warnings
+--enable_query_log
+
+INSERT INTO t2 select * from t1;
+INSERT INTO t3 select * from t1;
+INSERT INTO t4 select * from t1;
+
+SET GLOBAL innodb_encrypt_tables = on;
+
+--echo # Wait max 10 min for key encryption threads to encrypt required all spaces
+let $cnt=600;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0`;
+ if ($success)
+ {
+ let $cnt=0;
+ }
+ if (!$success)
+ {
+ real_sleep 1;
+ dec $cnt;
+ }
+}
+if (!$success)
+{
+ SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
+ SHOW STATUS LIKE 'innodb_encryption%';
+ -- die Timeout waiting for encryption threads
+}
+--echo # Success!
+
+SELECT COUNT(1) FROM t1;
+SELECT COUNT(1) FROM t2;
+SELECT COUNT(1) FROM t3;
+SELECT COUNT(1) FROM t4;
+
+SET GLOBAL innodb_encrypt_tables = off;
+
+--echo # Wait max 10 min for key encryption threads to decrypt all required spaces
+let $cnt=600;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
+ if ($success)
+ {
+ let $cnt=0;
+ }
+ if (!$success)
+ {
+ real_sleep 1;
+ dec $cnt;
+ }
+}
+if (!$success)
+{
+ SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
+ SHOW STATUS LIKE 'innodb_encryption%';
+ -- die Timeout waiting for encryption threads
+}
+--echo # Success!
+
+SET GLOBAL innodb_encrypt_tables = ON;
+set GLOBAL innodb_default_encryption_key_id=4;
+CREATE TABLE t5 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
+SHOW CREATE TABLE t5;
+INSERT INTO t5 select * from t1;
+
+--echo # Wait max 10 min for key encryption threads to encrypt required all spaces
+let $cnt=600;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0`;
+ if ($success)
+ {
+ let $cnt=0;
+ }
+ if (!$success)
+ {
+ real_sleep 1;
+ dec $cnt;
+ }
+}
+if (!$success)
+{
+ SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
+ SHOW STATUS LIKE 'innodb_encryption%';
+ -- die Timeout waiting for encryption threads
+}
+--echo # Success!
+
+SELECT COUNT(1) FROM t1;
+SELECT COUNT(1) FROM t2;
+SELECT COUNT(1) FROM t3;
+SELECT COUNT(1) FROM t4;
+SELECT COUNT(1) FROM t5;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables;
+EVAL SET GLOBAL innodb_encryption_threads = $threads;
+--enable_query_log
+
+drop table t1,t2,t3,t4, t5;
+
+set GLOBAL innodb_default_encryption_key_id=1;
+
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_is.opt b/mysql-test/suite/encryption/t/innodb_encryption_is.opt
new file mode 100644
index 00000000000..26c706840e8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_is.opt
@@ -0,0 +1 @@
+--loose-innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_is.test b/mysql-test/suite/encryption/t/innodb_encryption_is.test
new file mode 100644
index 00000000000..333bb84c634
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_is.test
@@ -0,0 +1,31 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
+INSERT INTO t1 VALUES ('foobar');
+INSERT INTO t2 VALUES ('foobar');
+
+#
+# MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+#
+SELECT NAME, ENCRYPTION_SCHEME, MIN_KEY_VERSION, CURRENT_KEY_VERSION,
+CURRENT_KEY_ID
+FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+WHERE NAME LIKE '%t1' OR NAME LIKE '%t2';
+
+DROP TABLE t1, t2;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.opt b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.opt
new file mode 100644
index 00000000000..7ebf81a07f3
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.opt
@@ -0,0 +1,4 @@
+--innodb-encrypt-tables=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.test b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.test
new file mode 100644
index 00000000000..0a28c1690a2
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.test
@@ -0,0 +1,125 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+-- source include/not_embedded.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table innodb_compressed1(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed encrypted=yes;
+create table innodb_compressed2(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=1 encrypted=yes;
+create table innodb_compressed3(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=2 encrypted=yes;
+create table innodb_compressed4(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=4 encrypted=yes;
+
+insert into innodb_compressed1 values (1, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (2, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (3, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (4, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (5, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (6, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (7, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (8, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (9, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (10, 20, 'private', 'evenmoreprivate');
+
+insert into innodb_compressed2 select * from innodb_compressed1;
+insert into innodb_compressed3 select * from innodb_compressed1;
+insert into innodb_compressed4 select * from innodb_compressed1;
+
+--source include/restart_mysqld.inc
+
+--let $MYSQLD_DATADIR=`select @@datadir`
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_compressed1.ibd
+--let t2_IBD = $MYSQLD_DATADIR/test/innodb_compressed2.ibd
+--let t3_IBD = $MYSQLD_DATADIR/test/innodb_compressed3.ibd
+--let t4_IBD = $MYSQLD_DATADIR/test/innodb_compressed4.ibd
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=private
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t2 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t4 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+select * from innodb_compressed1 where d = 20;
+select * from innodb_compressed1 where d = 30;
+select * from innodb_compressed2 where d = 20;
+select * from innodb_compressed2 where d = 30;
+select * from innodb_compressed3 where d = 20;
+select * from innodb_compressed3 where d = 30;
+select * from innodb_compressed4 where d = 20;
+select * from innodb_compressed4 where d = 30;
+
+update innodb_compressed1 set d = d + 10 where d = 30;
+update innodb_compressed2 set d = d + 10 where d = 30;
+update innodb_compressed3 set d = d + 10 where d = 30;
+update innodb_compressed4 set d = d + 10 where d = 30;
+
+insert into innodb_compressed1 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed2 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed3 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed4 values (20, 60, 'newprivate', 'newevenmoreprivate');
+
+--let SEARCH_PATTERN=private
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t2 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t4 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+
+--source include/restart_mysqld.inc
+
+select * from innodb_compressed1 where d = 40;
+select * from innodb_compressed1 where d = 60;
+select * from innodb_compressed2 where d = 40;
+select * from innodb_compressed2 where d = 60;
+select * from innodb_compressed3 where d = 40;
+select * from innodb_compressed3 where d = 60;
+select * from innodb_compressed4 where d = 40;
+select * from innodb_compressed4 where d = 60;
+
+--let SEARCH_PATTERN=private
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t2 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t4 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+
+drop table innodb_compressed1;
+drop table innodb_compressed2;
+drop table innodb_compressed3;
+drop table innodb_compressed4;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_tables.opt b/mysql-test/suite/encryption/t/innodb_encryption_tables.opt
new file mode 100644
index 00000000000..0b7319dcef5
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_tables.opt
@@ -0,0 +1,7 @@
+--aria-encrypt-tables=ON
+--encrypt-tmp-disk-tables=ON
+--innodb-encrypt-tables=ON
+--innodb-encrypt-log=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_tables.test b/mysql-test/suite/encryption/t/innodb_encryption_tables.test
new file mode 100644
index 00000000000..f806b776800
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_tables.test
@@ -0,0 +1,114 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_embedded.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
+
+show warnings;
+
+show create table innodb_normal;
+show create table innodb_compact;
+show create table innodb_dynamic;
+show create table innodb_compressed;
+show create table innodb_redundant;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_normal;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_compressed where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+update innodb_compressed set c1 = c1 + 1;
+update innodb_redundant set c1 = c1 + 1;
+select count(*) from innodb_normal;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+select count(*) from innodb_compressed where c1 < 1500000;
+select count(*) from innodb_redundant where c1 < 1500000;
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_compressed t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+select count(*) from innodb_redundant t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
+drop table innodb_compressed;
+drop table innodb_redundant;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb_first_page.opt b/mysql-test/suite/encryption/t/innodb_first_page.opt
new file mode 100644
index 00000000000..1a9099a649d
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_first_page.opt
@@ -0,0 +1,2 @@
+--innodb-encrypt-tables
+--innodb-encrypt-log
diff --git a/mysql-test/suite/encryption/t/innodb_first_page.test b/mysql-test/suite/encryption/t/innodb_first_page.test
new file mode 100644
index 00000000000..a0c563b1854
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_first_page.test
@@ -0,0 +1,32 @@
+#
+# MDEV-8021 "InnoDB: Tablespace id 4 encrypted but encryption service not available. Can't continue opening tablespace" on server restart when there are encrypted tables
+#
+
+--source include/have_innodb.inc
+--source include/have_file_key_management_plugin.inc
+
+call mtr.add_suppression("InnoDB: New log files created, LSN");
+call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+
+let datadir=`select @@datadir`;
+
+--exec echo wait > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+shutdown;
+
+--source include/wait_until_disconnected.inc
+
+--remove_file $datadir/ib_logfile0
+--remove_file $datadir/ib_logfile1
+--remove_file $datadir/ibdata1
+
+--exec echo restart > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+create table t1 (a int);
+
+--source include/restart_mysqld.inc
+
+drop table t1;
diff --git a/mysql-test/suite/encryption/t/innodb_lotoftables.opt b/mysql-test/suite/encryption/t/innodb_lotoftables.opt
new file mode 100644
index 00000000000..ffb5a2957f8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_lotoftables.opt
@@ -0,0 +1,3 @@
+--innodb-tablespaces-encryption
+--innodb-encrypt-tables=off
+--innodb-encryption-threads=0
diff --git a/mysql-test/suite/encryption/t/innodb_lotoftables.test b/mysql-test/suite/encryption/t/innodb_lotoftables.test
new file mode 100644
index 00000000000..e204de3bb7b
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_lotoftables.test
@@ -0,0 +1,240 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/big_test.inc
+
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $innodb_encryption_threads_orig = `SELECT @@global.innodb_encryption_threads`;
+--enable_query_log
+
+# empty the change buffer and the undo logs to avoid extra reads
+SET GLOBAL innodb_fast_shutdown=0;
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+SHOW VARIABLES LIKE 'innodb_encrypt%';
+
+#
+# This will create 100 tables where that could be
+# encrypted an unencrypt
+#
+create database innodb_encrypted_1;
+use innodb_encrypted_1;
+show status like 'innodb_pages0_read%';
+set autocommit=0;
+let $tables = 100;
+
+--disable_query_log
+while ($tables)
+{
+ eval create table t_$tables (a int not null primary key, b varchar(200)) engine=innodb
+ stats_persistent=0;
+ commit;
+ let $rows = 100;
+ while($rows)
+ {
+ eval insert into t_$tables values ($rows, substring(MD5(RAND()), -64));
+ dec $rows;
+ }
+ commit;
+ dec $tables;
+}
+--enable_query_log
+
+set autocommit=1;
+commit work;
+show status like 'innodb_pages0_read%';
+#
+# Verify
+#
+--echo # should be empty
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE NAME LIKE 'innodb_encrypted%';
+
+#
+# This will create 100 tables that are encrypted always
+#
+create database innodb_encrypted_2;
+use innodb_encrypted_2;
+show status like 'innodb_pages0_read%';
+set autocommit=0;
+
+--disable_query_log
+let $tables = 100;
+while ($tables)
+{
+ eval create table t_$tables (a int not null primary key, b varchar(200)) engine=innodb
+ stats_persistent=0 encrypted=yes;
+ commit;
+ let $rows = 100;
+ while($rows)
+ {
+ eval insert into t_$tables values ($rows, substring(MD5(RAND()), -64));
+ dec $rows;
+ }
+ commit;
+ dec $tables;
+}
+--enable_query_log
+
+commit work;
+set autocommit=1;
+show status like 'innodb_pages0_read%';
+#
+# Verify
+#
+--echo # should contain 100 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+--echo # should contain 0 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+
+#
+# This will create 100 tables that are not encrypted
+#
+create database innodb_encrypted_3;
+use innodb_encrypted_3;
+show status like 'innodb_pages0_read%';
+set autocommit=0;
+
+--disable_query_log
+let $tables = 100;
+while ($tables)
+{
+ eval create table t_$tables (a int not null primary key, b varchar(200)) engine=innodb
+ stats_persistent=0 encrypted=no;
+ commit;
+ let $rows = 100;
+ while($rows)
+ {
+ eval insert into t_$tables values ($rows, substring(MD5(RAND()), -64));
+ dec $rows;
+ }
+ commit;
+ dec $tables;
+}
+--enable_query_log
+
+commit work;
+set autocommit=1;
+show status like 'innodb_pages0_read%';
+#
+# Verify
+#
+--echo # should contain 100 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+--echo # should contain 100 tables
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+
+use test;
+show status like 'innodb_pages0_read%';
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+
+SET GLOBAL innodb_encrypt_tables = on;
+SET GLOBAL innodb_encryption_threads=4;
+
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+show status like 'innodb_pages0_read%';
+
+--echo # Success!
+--echo # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
+-- let $restart_parameters=--innodb_encrypt_tables=0 --innodb_encryption_threads=0
+-- source include/restart_mysqld.inc
+
+--echo # Restart Success!
+show status like 'innodb_pages0_read%';
+
+show status like 'innodb_pages0_read%';
+use test;
+show status like 'innodb_pages0_read%';
+use innodb_encrypted_1;
+show status like 'innodb_pages0_read%';
+use innodb_encrypted_2;
+show status like 'innodb_pages0_read%';
+use innodb_encrypted_3;
+show status like 'innodb_pages0_read%';
+
+use innodb_encrypted_1;
+show status like 'innodb_pages0_read%';
+--disable_result_log
+--disable_query_log
+let $tables = 100;
+while ($tables)
+{
+ eval select * from t_$tables;
+ dec $tables;
+}
+--enable_query_log
+--enable_result_log
+
+show status like 'innodb_pages0_read%';
+
+use innodb_encrypted_2;
+show status like 'innodb_pages0_read%';
+
+--disable_result_log
+--disable_query_log
+let $tables = 100;
+while ($tables)
+{
+ eval select * from t_$tables;
+ dec $tables;
+}
+--enable_query_log
+--enable_result_log
+
+show status like 'innodb_pages0_read%';
+
+use innodb_encrypted_3;
+show status like 'innodb_pages0_read%';
+--disable_result_log
+--disable_query_log
+let $tables = 100;
+while ($tables)
+{
+ eval select * from t_$tables;
+ dec $tables;
+}
+--enable_query_log
+--enable_result_log
+
+show status like 'innodb_pages0_read%';
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+
+SET GLOBAL innodb_encrypt_tables = off;
+SET GLOBAL innodb_encryption_threads=4;
+
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
+
+#
+# Cleanup
+#
+use test;
+drop database innodb_encrypted_1;
+drop database innodb_encrypted_2;
+drop database innodb_encrypted_3;
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_encryption_threads = $innodb_encryption_threads_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.opt b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.opt
new file mode 100644
index 00000000000..38d69691ed6
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.opt
@@ -0,0 +1,5 @@
+--innodb-encrypt-tables=ON
+--innodb-encrypt-log=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
new file mode 100644
index 00000000000..3e308bec247
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
@@ -0,0 +1,143 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# test uses restart
+-- source include/not_embedded.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
+CREATE TABLE t3 (id INT, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t4 (id INT, a VARCHAR(255)) engine=InnoDB;
+CREATE TABLE t5 (id INT NOT NULL PRIMARY KEY, a TEXT(500), b VARCHAR(255), FULLTEXT(b)) ENGINE=InnoDB encrypted=yes;
+CREATE TABLE t6 (id INT, a TEXT(500), b VARCHAR(255), FULLTEXT(b)) ENGINE=InnoDB;
+CREATE TABLE t7 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB row_format=compressed encrypted=yes;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into t1 values (current_num,repeat('foobar',12));
+ insert into t2 values (current_num,repeat('tempsecret', 12));
+ insert into t3 values (current_num,repeat('barfoo',42));
+ insert into t4 values (current_num,repeat('repeat',42));
+ insert into t5 values (current_num,substring('A BC DEF GHIJ KLM NOPQRS TUV WXYZ 012 3456789', rand()*36+1, 100), repeat('author new',22));
+ insert into t6 values (current_num,substring('A BC DEF GHIJ KLM NOPQRS TUV WXYZ 012 3456789', rand()*36+1, 100), repeat('mangled old',22));
+ insert into t7 values (current_num,repeat('mysql',42));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(1500);
+commit;
+set autocommit=1;
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
+--source include/wait_condition.inc
+--let $MYSQLD_DATADIR=`select @@datadir`
+
+--source include/shutdown_mysqld.inc
+
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t1.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=tempsecret
+--echo # t2 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t2.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=barfoo
+--echo # t3 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t3.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=repeat
+--echo # t4 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t4.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=author
+--echo # t5 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t5.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mangled
+--echo # t6 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t6.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mysql
+--echo # t7 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t7.ibd
+-- source include/search_pattern_in_file.inc
+
+-- source include/start_mysqld.inc
+
+--disable_warnings
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--enable_warnings
+
+ALTER TABLE t1 ADD COLUMN b int default 2;
+ALTER TABLE t2 ADD COLUMN b int default 2;
+ALTER TABLE t7 ADD COLUMN b int default 2;
+ALTER TABLE t1 ADD KEY a(a), ADD KEY b(b);
+ALTER TABLE t2 ADD KEY a(a), ADD KEY b(b);
+ALTER TABLE t3 ADD COLUMN c int default 5;
+ALTER TABLE t4 ADD COLUMN c int default 5;
+ALTER TABLE t3 ADD KEY (a), ADD KEY c(c);
+ALTER TABLE t4 ADD KEY (a), ADD KEY c(c);
+ALTER TABLE t5 ADD FULLTEXT(a);
+ALTER TABLE t6 ADD FULLTEXT(a);
+ALTER TABLE t7 ADD KEY a(a), ADD key b(b);
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+SHOW CREATE TABLE t3;
+SHOW CREATE TABLE t4;
+SHOW CREATE TABLE t5;
+SHOW CREATE TABLE t6;
+SHOW CREATE TABLE t7;
+
+--source include/shutdown_mysqld.inc
+
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t1.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=tempsecret
+--echo # t2 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t2.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=barfoo
+--echo # t3 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t3.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=repeat
+--echo # t4 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t4.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=author
+--echo # t5 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t5.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mangled
+--echo # t6 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t6.ibd
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mysql
+--echo # t7 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t7.ibd
+-- source include/search_pattern_in_file.inc
+
+-- source include/start_mysqld.inc
+
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1, t2, t3, t4, t5, t6, t7;
diff --git a/mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test b/mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test
new file mode 100644
index 00000000000..7cbf005ed32
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test
@@ -0,0 +1,96 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+--echo # Restart mysqld --loose-file-key-management-filename=keys2.txt
+-- let $restart_parameters=--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
+-- source include/restart_mysqld.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+show warnings;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=2;
+show warnings;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=3;
+show warnings;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=4;
+show warnings;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=5;
+show warnings;
+
+insert into innodb_normal values (1,'test1'),(2,'foo'),(3,'bar'),(4,'mariadb');
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+insert into innodb_redundant select * from innodb_normal;
+
+# Note there that these variables are updated only when real I/O is done, thus they are not reliable
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+alter table innodb_compact engine=innodb encryption_key_id = 6;
+alter table innodb_compressed engine=innodb encryption_key_id = 6;
+alter table innodb_dynamic engine=innodb encryption_key_id = 6;
+alter table innodb_redundant engine=innodb encryption_key_id = 6;
+
+select * from innodb_normal;
+select * from innodb_compact;
+select * from innodb_compressed;
+select * from innodb_dynamic;
+select * from innodb_redundant;
+
+# Note there that these variables are updated only when real I/O is done, thus they are not reliable
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+--echo # Restart mysqld --loose-file-key-management-filename=keys3.txt
+-- let $restart_parameters=--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
+-- source include/restart_mysqld.inc
+
+select * from innodb_normal;
+select * from innodb_compact;
+select * from innodb_compressed;
+select * from innodb_dynamic;
+select * from innodb_redundant;
+
+# Note there that these variables are updated only when real I/O is done, thus they are not reliable
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+alter table innodb_compact engine=innodb encryption_key_id = 2;
+alter table innodb_compressed engine=innodb encryption_key_id = 3;
+alter table innodb_dynamic engine=innodb encryption_key_id = 4;
+alter table innodb_redundant engine=innodb encryption_key_id = 5;
+
+select * from innodb_normal;
+select * from innodb_compact;
+select * from innodb_compressed;
+select * from innodb_dynamic;
+select * from innodb_redundant;
+
+# Note there that these variables are updated only when real I/O is done, thus they are not reliable
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
+
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_compressed;
+drop table innodb_dynamic;
+drop table innodb_redundant;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb_scrub.opt b/mysql-test/suite/encryption/t/innodb_scrub.opt
new file mode 100644
index 00000000000..3adb645c589
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub.opt
@@ -0,0 +1,9 @@
+--innodb-background-scrub-data-compressed=OFF
+--innodb-background-scrub-data-uncompressed=OFF
+--innodb-encrypt-tables=OFF
+--innodb-encryption-threads=0
+--innodb-file-format=Barracuda
+--innodb-file-per-table=1
+--innodb-immediate-scrub-data-uncompressed=ON
+--loose-innodb-debug-force-scrubbing=ON
+--innodb-tablespaces-scrubbing
diff --git a/mysql-test/suite/encryption/t/innodb_scrub.test b/mysql-test/suite/encryption/t/innodb_scrub.test
new file mode 100644
index 00000000000..6cb48530f86
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub.test
@@ -0,0 +1,147 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_example_key_management_plugin.inc
+
+let $MYSQLD_DATADIR=`select @@datadir`;
+let INNODB_PAGE_SIZE= `select @@innodb_page_size`;
+
+create table snapshot_status engine = myisam
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+
+let $rowcount=500;
+let $maxformatno= 4;
+let $formatno= $maxformatno;
+
+--echo # MDEV-8139 Fix scrubbing tests
+--echo # FIXME: Add index(b) to each table; ensure that undo logs are scrubbed.
+let $tableformat= (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text) engine = innodb row_format;
+
+while ($formatno)
+{
+dec $formatno;
+let $format = `select case $formatno
+ when 0 then 'dynamic'
+ when 1 then 'redundant'
+ when 2 then 'compact'
+ when 3 then 'compressed'
+ end`;
+
+let $t= delete_$formatno;
+eval create table $t $tableformat=$format;
+
+let $numinserts = $rowcount;
+--disable_query_log
+begin;
+while ($numinserts)
+{
+ dec $numinserts;
+ eval insert into $t(b,c) values ('repairman', repeat('unicycle', 1000));
+}
+commit;
+--enable_query_log
+
+eval delete from $t;
+
+let $t= delete_rollback_delete_$formatno;
+eval create table $t $tableformat=$format;
+
+let $numinserts = $rowcount;
+--disable_query_log
+begin;
+while ($numinserts)
+{
+ dec $numinserts;
+ eval insert into $t(b,c) values ('breakhuman', repeat('bicycle', 1000));
+}
+commit;
+--enable_query_log
+
+begin;
+eval delete from $t;
+rollback;
+eval delete from $t;
+
+let $t= insert_rollback_$formatno;
+
+eval create table $t $tableformat=$format;
+
+let $numinserts = $rowcount;
+begin;
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ eval insert into $t(b,c) values ('wonderwoman', repeat('tricycle', 1000));
+}
+--enable_query_log
+
+rollback;
+}
+
+SET GLOBAL innodb_fast_shutdown=0;
+-- source include/shutdown_mysqld.inc
+
+let SEARCH_ABORT= FOUND;
+let SEARCH_PATTERN= (un|b|tr)icycle|(repair|breakhu|wonderwo)man;
+let SEARCH_RANGE= 12582912;
+let SEARCH_FILE= $MYSQLD_DATADIR/ibdata1;
+
+# We may randomly find copies of unscrubbed pages in the doublewrite buffer.
+# Let us scrub the doublewrite buffer ourselves.
+perl;
+use Fcntl 'SEEK_SET';
+my $page_size = $ENV{INNODB_PAGE_SIZE};
+open(FILE, "+<", "$ENV{SEARCH_FILE}") or die "cannot open: $!\n";
+seek(FILE, $page_size * 64, SEEK_SET) or die "cannot seek: $!\n";
+print(FILE chr(0) x ($page_size * 128)) or die "cannot write: $!\n";
+close FILE or die "cannot close: $!\n";;
+EOF
+
+-- source include/search_pattern_in_file.inc
+
+let $formatno= $maxformatno;
+while ($formatno)
+{
+dec $formatno;
+
+let $t= delete_$formatno.ibd;
+let SEARCH_FILE= $MYSQLD_DATADIR/test/$t;
+-- echo # $t
+-- source include/search_pattern_in_file.inc
+let $t= delete_rollback_delete_$formatno.ibd;
+let SEARCH_FILE= $MYSQLD_DATADIR/test/$t;
+-- echo # $t
+-- source include/search_pattern_in_file.inc
+let $t= insert_rollback_$formatno.ibd;
+let SEARCH_FILE= $MYSQLD_DATADIR/test/$t;
+-- echo # $t
+-- source include/search_pattern_in_file.inc
+}
+
+-- source include/start_mysqld.inc
+
+let $formatno= $maxformatno;
+while ($formatno)
+{
+dec $formatno;
+
+let $t= delete_$formatno, delete_rollback_delete_$formatno, insert_rollback_$formatno;
+
+eval check table $t;
+eval drop table $t;
+}
+
+show variables like 'innodb_%scrub_data%';
+
+--echo # verify that this test have not caused any background scrubbing
+--sorted_result
+select ss.variable_name, gs.variable_value - ss.variable_value as variable_value
+from snapshot_status ss,
+ information_schema.global_status gs
+where ss.variable_name = gs.variable_name;
+
+drop table snapshot_status;
diff --git a/mysql-test/suite/encryption/t/innodb_scrub_background.opt b/mysql-test/suite/encryption/t/innodb_scrub_background.opt
new file mode 100644
index 00000000000..1cc525b2402
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub_background.opt
@@ -0,0 +1,9 @@
+--innodb-file-per-table=1
+--innodb-file-format=Barracuda
+--innodb-immediate-scrub-data-uncompressed=OFF
+--innodb-background-scrub-data-uncompressed=ON
+--innodb-background-scrub-data-compressed=ON
+--loose-innodb-debug-force-scrubbing=ON
+--innodb-encryption-threads=0
+--innodb-encrypt-tables=OFF
+--innodb-tablespaces-scrubbing
diff --git a/mysql-test/suite/encryption/t/innodb_scrub_background.test b/mysql-test/suite/encryption/t/innodb_scrub_background.test
new file mode 100644
index 00000000000..c705ee51006
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub_background.test
@@ -0,0 +1,170 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_example_key_management_plugin.inc
+
+let $MYSQLD_DATADIR=`select @@datadir`;
+let INNODB_PAGE_SIZE= `select @@innodb_page_size`;
+
+--echo #
+--echo # immediate scrubbing is off
+--echo # background scrubbing is on
+--echo #
+show variables like 'innodb_%scrub_data%';
+
+-- echo # make sure spaces are checked quickly
+SET GLOBAL innodb_background_scrub_data_check_interval=1;
+
+let $rowcount=500;
+let $maxformatno= 4;
+let $formatno= $maxformatno;
+
+let $tableformat= (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text,
+ index(b)) engine = innodb row_format;
+
+while ($formatno)
+{
+dec $formatno;
+let $format = `select case $formatno
+ when 0 then 'dynamic'
+ when 1 then 'redundant'
+ when 2 then 'compact'
+ when 3 then 'compressed'
+ end`;
+
+let $t= delete_$formatno;
+eval create table $t $tableformat=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+begin;
+while ($numinserts)
+{
+ dec $numinserts;
+ eval insert into $t(b,c) values ('unicycle', repeat('wonderwoman', 1000));
+}
+commit;
+--enable_query_log
+
+eval delete from $t;
+
+let $t= delete_rollback_delete_$formatno;
+
+eval create table $t $tableformat=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+begin;
+while ($numinserts)
+{
+ dec $numinserts;
+ eval insert into $t(b,c) values ('bicycle', repeat('repairman', 1000));
+}
+commit;
+--enable_query_log
+
+begin;
+eval delete from $t;
+rollback;
+eval delete from $t;
+
+let $t= insert_rollback_$formatno;
+
+eval create table $t $tableformat=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+begin;
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ eval insert into $t(b,c) values ('tricycle', repeat('superhuman', 1000));
+}
+--enable_query_log
+
+rollback;
+}
+
+-- echo # start scrubbing threads
+SET GLOBAL innodb_encryption_threads=5;
+-- echo # Wait max 10 min for scrubbing
+let $cnt=600;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING WHERE LAST_SCRUB_COMPLETED IS NULL AND ( NAME in ('test/t1', 'test/t2', 'test/t3') OR SPACE = 0 )`;
+ if ($success)
+ {
+ let $cnt=0;
+ }
+ if (!$success)
+ {
+ real_sleep 1;
+ dec $cnt;
+ }
+}
+if (!$success)
+{
+ SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING;
+ SHOW STATUS LIKE 'innodb_%scrub%';
+ -- die Timeout waiting for background threads
+}
+
+SET GLOBAL innodb_fast_shutdown=0;
+-- source include/shutdown_mysqld.inc
+
+let SEARCH_ABORT= FOUND;
+let SEARCH_PATTERN= (un|b|tr)icycle|(repair|breakhu|wonderwo)man;
+let SEARCH_RANGE= 12582912;
+let SEARCH_FILE= $MYSQLD_DATADIR/ibdata1;
+
+# We may randomly find copies of unscrubbed pages in the doublewrite buffer.
+# Let us scrub the doublewrite buffer ourselves.
+perl;
+use Fcntl 'SEEK_SET';
+my $page_size = $ENV{INNODB_PAGE_SIZE};
+open(FILE, "+<", "$ENV{SEARCH_FILE}") or die "cannot open: $!\n";
+seek(FILE, $page_size * 64, SEEK_SET) or die "cannot seek: $!\n";
+print(FILE chr(0) x ($page_size * 128)) or die "cannot write: $!\n";
+close FILE or die "cannot close: $!\n";;
+EOF
+
+-- source include/search_pattern_in_file.inc
+
+let $formatno= $maxformatno;
+while ($formatno)
+{
+dec $formatno;
+
+let $t= delete_$formatno.ibd;
+let SEARCH_FILE= $MYSQLD_DATADIR/test/$t;
+-- echo # $t
+-- source include/search_pattern_in_file.inc
+let $t= delete_rollback_delete_$formatno.ibd;
+let SEARCH_FILE= $MYSQLD_DATADIR/test/$t;
+-- echo # $t
+-- source include/search_pattern_in_file.inc
+let $t= insert_rollback_$formatno.ibd;
+let SEARCH_FILE= $MYSQLD_DATADIR/test/$t;
+-- echo # $t
+-- source include/search_pattern_in_file.inc
+}
+
+-- source include/start_mysqld.inc
+
+let $formatno= $maxformatno;
+while ($formatno)
+{
+dec $formatno;
+
+let $t= delete_$formatno, delete_rollback_delete_$formatno, insert_rollback_$formatno;
+
+eval check table $t;
+eval drop table $t;
+}
+
+show variables like 'innodb_%scrub_data%';
diff --git a/mysql-test/suite/encryption/t/second_plugin-12863.test b/mysql-test/suite/encryption/t/second_plugin-12863.test
new file mode 100644
index 00000000000..c04fccf9716
--- /dev/null
+++ b/mysql-test/suite/encryption/t/second_plugin-12863.test
@@ -0,0 +1,16 @@
+#
+# MDEV-12863 No table can be created after second encryption plugin attempted to load
+#
+--source include/have_innodb.inc
+--source include/have_file_key_management_plugin.inc
+
+call mtr.add_suppression('debug.key.management');
+
+--error 1123
+install soname 'debug_key_management';
+
+create table t1 (a varchar(255)) engine=innodb encrypted=yes;
+create table t2 (a varchar(255)) engine=innodb;
+create table t3 (a varchar(255)) engine=innodb encrypted=no;
+
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/encryption/t/tempfiles.test b/mysql-test/suite/encryption/t/tempfiles.test
new file mode 100644
index 00000000000..34dcbdf5963
--- /dev/null
+++ b/mysql-test/suite/encryption/t/tempfiles.test
@@ -0,0 +1,74 @@
+#
+# Various test cases for IO_CACHE tempfiles (file==-1) encryption
+#
+source include/have_file_key_management_plugin.inc;
+source include/have_sequence.inc;
+
+# Row binlog format to fill binlog cache faster
+source include/have_binlog_format_row.inc;
+
+# Nothing XtraDB specific in this test, it just needs *some* transactional
+# engine. But there's no need to run it twice for InnoDB and XtraDB.
+source include/have_xtradb.inc;
+
+#
+# MyISAM messing around with IO_CACHE::file
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(1),(2);
+DELETE FROM t1 WHERE a=1;
+OPTIMIZE TABLE t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+#
+# filesort, my_b_pread, seeks in READ_CACHE
+#
+create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
+insert into t1 (v) select concat(char(ascii('a')+s2.seq),repeat(' ',s1.seq))
+ from seq_0_to_9 as s1, seq_0_to_26 as s2;
+update t1 set c=v, t=v;
+select sql_big_result t,count(t) from t1 group by t limit 10;
+drop table t1;
+
+set global binlog_cache_size=8192;
+
+connect con1, localhost, root;
+
+#
+# Test the last half-filled block:
+# first write 3 blocks, then reinit the file and write one full and one
+# partial block. reading the second time must stop in the middle of the
+# second block, and NOT read till EOF.
+#
+create table t1 (a text) engine=innodb;
+start transaction;
+insert t1 select repeat(seq, 1000) from seq_1_to_15;
+commit;
+start transaction;
+insert t1 select repeat(seq, 1000) from seq_1_to_8;
+commit;
+drop table t1;
+
+disconnect con1;
+connect con2, localhost, root;
+
+#
+# Test reinit_io_cache(WRITE_CACHE) with non-zero seek_offset:
+# Start a transaction, write until the cache goes to disk,
+# create a savepoint, write more blocks to disk, rollback to savepoint.
+#
+create table t1 (a text) engine=innodb;
+start transaction;
+insert t1 select repeat(seq, 1000) from seq_1_to_15;
+savepoint foo;
+insert t1 select repeat(seq, 1000) from seq_16_to_30;
+rollback to savepoint foo;
+insert t1 select repeat(seq, 1000) from seq_31_to_40;
+commit;
+drop table t1;
+
+disconnect con2;
+connection default;
+
+set global binlog_cache_size=default;
diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result
index 02805c41cf7..ee127d76bcc 100644
--- a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result
+++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result
@@ -84,6 +84,7 @@ utf8_vietnamese_ci utf8 215 # #
utf8_general_mysql500_ci utf8 223 # #
utf8_croatian_ci utf8 576 # #
utf8_myanmar_ci utf8 577 # #
+utf8_thai_520_w2 utf8 578 # #
ucs2_general_ci ucs2 35 Yes # #
ucs2_bin ucs2 90 # #
ucs2_unicode_ci ucs2 128 # #
@@ -113,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # #
ucs2_general_mysql500_ci ucs2 159 # #
ucs2_croatian_ci ucs2 640 # #
ucs2_myanmar_ci ucs2 641 # #
+ucs2_thai_520_w2 ucs2 642 # #
cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # #
keybcs2_general_ci keybcs2 37 Yes # #
@@ -155,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # #
utf8mb4_vietnamese_ci utf8mb4 247 # #
utf8mb4_croatian_ci utf8mb4 608 # #
utf8mb4_myanmar_ci utf8mb4 609 # #
+utf8mb4_thai_520_w2 utf8mb4 610 # #
cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # #
@@ -188,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # #
utf16_vietnamese_ci utf16 124 # #
utf16_croatian_ci utf16 672 # #
utf16_myanmar_ci utf16 673 # #
+utf16_thai_520_w2 utf16 674 # #
utf16le_general_ci utf16le 56 Yes # #
utf16le_bin utf16le 62 # #
cp1256_general_ci cp1256 57 Yes # #
@@ -223,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # #
utf32_vietnamese_ci utf32 183 # #
utf32_croatian_ci utf32 736 # #
utf32_myanmar_ci utf32 737 # #
+utf32_thai_520_w2 utf32 738 # #
binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # #
diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result
index 501bd95cf55..46921fcaa8c 100644
--- a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result
+++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result
@@ -84,6 +84,7 @@ utf8_vietnamese_ci utf8 215 # #
utf8_general_mysql500_ci utf8 223 # #
utf8_croatian_ci utf8 576 # #
utf8_myanmar_ci utf8 577 # #
+utf8_thai_520_w2 utf8 578 # #
ucs2_general_ci ucs2 35 Yes # #
ucs2_bin ucs2 90 # #
ucs2_unicode_ci ucs2 128 # #
@@ -113,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # #
ucs2_general_mysql500_ci ucs2 159 # #
ucs2_croatian_ci ucs2 640 # #
ucs2_myanmar_ci ucs2 641 # #
+ucs2_thai_520_w2 ucs2 642 # #
cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # #
keybcs2_general_ci keybcs2 37 Yes # #
@@ -155,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # #
utf8mb4_vietnamese_ci utf8mb4 247 # #
utf8mb4_croatian_ci utf8mb4 608 # #
utf8mb4_myanmar_ci utf8mb4 609 # #
+utf8mb4_thai_520_w2 utf8mb4 610 # #
cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # #
@@ -188,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # #
utf16_vietnamese_ci utf16 124 # #
utf16_croatian_ci utf16 672 # #
utf16_myanmar_ci utf16 673 # #
+utf16_thai_520_w2 utf16 674 # #
utf16le_general_ci utf16le 56 Yes # #
utf16le_bin utf16le 62 # #
cp1256_general_ci cp1256 57 Yes # #
@@ -223,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # #
utf32_vietnamese_ci utf32 183 # #
utf32_croatian_ci utf32 736 # #
utf32_myanmar_ci utf32 737 # #
+utf32_thai_520_w2 utf32 738 # #
binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # #
diff --git a/mysql-test/suite/engines/funcs/r/jp_comment_older_compatibility1.result b/mysql-test/suite/engines/funcs/r/jp_comment_older_compatibility1.result
index 137825aba0a..f6bb433d68b 100644
--- a/mysql-test/suite/engines/funcs/r/jp_comment_older_compatibility1.result
+++ b/mysql-test/suite/engines/funcs/r/jp_comment_older_compatibility1.result
@@ -13,7 +13,7 @@ column_comment char_length(column_comment)
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL DEFAULT '0' COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
+ `c1` int(11) NOT NULL COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
`c12` int(11) DEFAULT NULL,
`c13` datetime DEFAULT NULL,
`c14` char(10) DEFAULT NULL,
@@ -40,7 +40,7 @@ column_comment char_length(column_comment)
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL DEFAULT '0' COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
+ `c1` int(11) NOT NULL COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
`c12` int(11) DEFAULT NULL,
`c13` datetime DEFAULT NULL,
`c14` char(10) DEFAULT NULL,
@@ -68,7 +68,7 @@ column_comment char_length(column_comment)
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL DEFAULT '0' COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
+ `c1` int(11) NOT NULL COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
`c12` int(11) DEFAULT NULL,
`c13` datetime DEFAULT NULL,
`c14` char(10) DEFAULT NULL,
@@ -96,7 +96,7 @@ column_comment char_length(column_comment)
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL DEFAULT '0' COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
+ `c1` int(11) NOT NULL COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
`c12` int(11) DEFAULT NULL,
`c13` datetime DEFAULT NULL,
`c14` char(10) DEFAULT NULL,
@@ -123,7 +123,7 @@ column_comment char_length(column_comment)
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL DEFAULT '0' COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
+ `c1` int(11) NOT NULL COMMENT '‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±‚ ‚¢‚¤‚¦‚¨‚©‚«‚­‚¯‚±',
`c12` int(11) DEFAULT NULL,
`c13` datetime DEFAULT NULL,
`c14` char(10) DEFAULT NULL,
diff --git a/mysql-test/suite/engines/funcs/t/rpl_bit.test b/mysql-test/suite/engines/funcs/t/rpl_bit.test
index 07b0778296c..7f85313ae4c 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_bit.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_bit.test
@@ -6,7 +6,6 @@
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
##########
-- source include/master-slave.inc
diff --git a/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test b/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test
index 6b23f1a0d03..adf1526a657 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test
@@ -2,8 +2,6 @@
# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
# still checks that it has the same error as on the master.
##########################################################################
-# 2006-02-07 JBM Added error code 1022 for NDB Engine + ORDER BY
-##########################################################################
-- source include/master-slave.inc
diff --git a/mysql-test/suite/engines/funcs/t/rpl_loadfile.test b/mysql-test/suite/engines/funcs/t/rpl_loadfile.test
index 97ee89a6d95..26235d89016 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_loadfile.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_loadfile.test
@@ -6,7 +6,6 @@
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
##########
# Includes
@@ -42,9 +41,6 @@ CALL test.p1();
--enable_warnings
SELECT * FROM test.t1 ORDER BY blob_column;
save_master_pos;
-# Need to allow some time when NDB engine is used for
-# the injector thread to have time to populate binlog
-sleep 10;
sync_slave_with_master;
connection slave;
SELECT * FROM test.t1 ORDER BY blob_column;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test
index 3a762b19756..22deee6b5f3 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test
@@ -1,7 +1,6 @@
##########
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
##########
#
diff --git a/mysql-test/suite/engines/funcs/t/rpl_ps.test b/mysql-test/suite/engines/funcs/t/rpl_ps.test
index b8792722192..09c7b779f65 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_ps.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_ps.test
@@ -2,8 +2,6 @@
# Test of replicating user variables
#
###########################################################
-# 2006-02-08 By JBM added order by for use w/ NDB engine
-###########################################################
source include/master-slave.inc;
#save_master_pos;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test
index 30d2688c3fb..f4e6239c679 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test
@@ -1,5 +1,4 @@
-- source include/have_binlog_format_mixed.inc
--- source include/not_ndb_default.inc
-- source include/master-slave.inc
# Test that the slave temporarily switches to ROW when seeing row
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test b/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test
index ea4b958ae4c..3e057d48ec9 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test
@@ -4,7 +4,6 @@
# Test of manual relay log rotation with FLUSH LOGS.
# Requires statement logging
-source include/not_ndb_default.inc;
source include/have_binlog_format_row.inc;
source extra/rpl_tests/rpl_max_relay_size.test;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test
index 054fa02f514..d8a5aacc5e6 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test
@@ -6,8 +6,6 @@
# Test: Tests SPs with cursors, flow logic, and alter sp. In addition the #
# tests SPs with insert and update operations. #
#############################################################################
-# 2006-02-08 By JBM added ORDER BY for use with NDB engine
-#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test
index 2a4b1e5e605..505ed582ba9 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test
@@ -5,8 +5,6 @@
#############################################################################
#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12168 #
#############################################################################
-# 2006-02-08 By JBM : Added order by for ndb engine use
-#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_until.test b/mysql-test/suite/engines/funcs/t/rpl_row_until.test
index 7c1715b760e..ef48212660d 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_until.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_until.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_view01.test b/mysql-test/suite/engines/funcs/t/rpl_row_view01.test
index 634e3c30cc6..1ccfcb4eb27 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_view01.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_view01.test
@@ -5,8 +5,6 @@
#############################################################################
#TEST: row based replication of views #
#############################################################################
-# 2006-02-08 By JBM added order by and sleep for use with ndb engine
-#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
@@ -43,11 +41,6 @@ CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL
SELECT * FROM mysqltest1.v2;
SELECT * FROM mysqltest1.v1;
-# Had to add a sleep for use with NDB
-# engine. Injector thread would have not
-# populated biblog and data would not be on
-# the slave.
-sleep 10;
sync_slave_with_master;
SELECT * FROM mysqltest1.v2;
SELECT * FROM mysqltest1.v1;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt b/mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt
index dafe3e46cca..4145dc4b219 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt
+++ b/mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt
@@ -1 +1 @@
---slave-skip-error=1053,1062,1582
+--slave-skip-errors=1053,1062,1582
diff --git a/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test b/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test
index c9c77f47d8d..94ce539291d 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test
@@ -1,7 +1,6 @@
##########################################
# Change Author: JBM
# Change Date: 2006-05-02
-# Change: Added Order By for NDB testing
##########################################
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
diff --git a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
index b9df07101fb..396ba4073e4 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/master-slave.inc
connection default;
diff --git a/mysql-test/suite/engines/iuds/r/insert_number.result b/mysql-test/suite/engines/iuds/r/insert_number.result
index ab56b82807c..904a9697dc3 100644
--- a/mysql-test/suite/engines/iuds/r/insert_number.result
+++ b/mysql-test/suite/engines/iuds/r/insert_number.result
@@ -1374,6 +1374,8 @@ INSERT INTO t4 VALUES(0,32,33,34,35,36,37,38);
INSERT INTO t5 VALUES(0,-32,-32,33,34,35,36,37);
INSERT INTO t4(c1,c3,c4) VALUES(NULL,104,LAST_INSERT_ID());
INSERT INTO t5(c1,c3,c4) VALUES(NULL,-104,LAST_INSERT_ID());
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t4 VALUES('','',17,18,19,20,21,22);
Warnings:
Warning 1366 Incorrect integer value: '' for column 'c1' at row 1
@@ -2389,6 +2391,7 @@ DROP TABLE t6,t7,t8;
INSERT INTO t2 SET c3=5,c4=6;
Warnings:
Warning 1364 Field 'c1' doesn't have a default value
+Warning 1364 Field 'c6' doesn't have a default value
SET SQL_MODE=STRICT_ALL_TABLES;
INSERT INTO t2 SET c3=5,c4=6;
ERROR HY000: Field 'c1' doesn't have a default value
@@ -6977,6 +6980,8 @@ INSERT INTO t4 VALUES(0,32,33,34,35,36,37,38);
INSERT INTO t5 VALUES(0,-32,-32,33,34,35,36,37);
INSERT INTO t4(c1,c3,c4) VALUES(NULL,104,LAST_INSERT_ID());
INSERT INTO t5(c1,c3,c4) VALUES(NULL,-104,LAST_INSERT_ID());
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t4 VALUES('','',17,18,19,20,21,22);
Warnings:
Warning 1366 Incorrect integer value: '' for column 'c1' at row 1
@@ -7981,6 +7986,7 @@ DROP TABLE t6,t7,t8;
INSERT INTO t2 SET c3=5,c4=6;
Warnings:
Warning 1364 Field 'c1' doesn't have a default value
+Warning 1364 Field 'c6' doesn't have a default value
SET SQL_MODE=STRICT_ALL_TABLES;
INSERT INTO t2 SET c3=5,c4=6;
ERROR HY000: Field 'c1' doesn't have a default value
@@ -12674,6 +12680,8 @@ INSERT INTO t4 VALUES(0,32,33,34,35,36,37,38);
INSERT INTO t5 VALUES(0,-32,-32,33,34,35,36,37);
INSERT INTO t4(c1,c3,c4) VALUES(NULL,104,LAST_INSERT_ID());
INSERT INTO t5(c1,c3,c4) VALUES(NULL,-104,LAST_INSERT_ID());
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t4 VALUES('','',17,18,19,20,21,22);
Warnings:
Warning 1366 Incorrect integer value: '' for column 'c1' at row 1
@@ -13678,6 +13686,7 @@ DROP TABLE t6,t7,t8;
INSERT INTO t2 SET c3=5,c4=6;
Warnings:
Warning 1364 Field 'c1' doesn't have a default value
+Warning 1364 Field 'c6' doesn't have a default value
SET SQL_MODE=STRICT_ALL_TABLES;
INSERT INTO t2 SET c3=5,c4=6;
ERROR HY000: Field 'c1' doesn't have a default value
@@ -18476,6 +18485,8 @@ INSERT INTO t4 VALUES(0,32,33,34,35,36,37,38);
INSERT INTO t5 VALUES(0,-32,-32,33,34,35,36,37);
INSERT INTO t4(c1,c3,c4) VALUES(NULL,104,LAST_INSERT_ID());
INSERT INTO t5(c1,c3,c4) VALUES(NULL,-104,LAST_INSERT_ID());
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t4 VALUES('','',17,18,19,20,21,22);
Warnings:
Warning 1366 Incorrect integer value: '' for column 'c1' at row 1
@@ -19480,6 +19491,7 @@ DROP TABLE t6,t7,t8;
INSERT INTO t2 SET c3=5,c4=6;
Warnings:
Warning 1364 Field 'c1' doesn't have a default value
+Warning 1364 Field 'c6' doesn't have a default value
SET SQL_MODE=STRICT_ALL_TABLES;
INSERT INTO t2 SET c3=5,c4=6;
ERROR HY000: Field 'c1' doesn't have a default value
@@ -24383,6 +24395,8 @@ INSERT INTO t4 VALUES(0,32,33,34,35,36,37,38);
INSERT INTO t5 VALUES(0,-32,-32,33,34,35,36,37);
INSERT INTO t4(c1,c3,c4) VALUES(NULL,104,LAST_INSERT_ID());
INSERT INTO t5(c1,c3,c4) VALUES(NULL,-104,LAST_INSERT_ID());
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t4 VALUES('','',17,18,19,20,21,22);
Warnings:
Warning 1366 Incorrect integer value: '' for column 'c1' at row 1
@@ -25387,6 +25401,7 @@ DROP TABLE t6,t7,t8;
INSERT INTO t2 SET c3=5,c4=6;
Warnings:
Warning 1364 Field 'c1' doesn't have a default value
+Warning 1364 Field 'c6' doesn't have a default value
SET SQL_MODE=STRICT_ALL_TABLES;
INSERT INTO t2 SET c3=5,c4=6;
ERROR HY000: Field 'c1' doesn't have a default value
@@ -30290,6 +30305,8 @@ INSERT INTO t4 VALUES(0,32,33,34,35,36,37,38);
INSERT INTO t5 VALUES(0,-32,-32,33,34,35,36,37);
INSERT INTO t4(c1,c3,c4) VALUES(NULL,104,LAST_INSERT_ID());
INSERT INTO t5(c1,c3,c4) VALUES(NULL,-104,LAST_INSERT_ID());
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t4 VALUES('','',17,18,19,20,21,22);
Warnings:
Warning 1366 Incorrect integer value: '' for column 'c1' at row 1
@@ -31294,6 +31311,7 @@ DROP TABLE t6,t7,t8;
INSERT INTO t2 SET c3=5,c4=6;
Warnings:
Warning 1364 Field 'c1' doesn't have a default value
+Warning 1364 Field 'c6' doesn't have a default value
SET SQL_MODE=STRICT_ALL_TABLES;
INSERT INTO t2 SET c3=5,c4=6;
ERROR HY000: Field 'c1' doesn't have a default value
diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result
index 91dfd249083..aa472c45d82 100644
--- a/mysql-test/suite/engines/iuds/r/insert_year.result
+++ b/mysql-test/suite/engines/iuds/r/insert_year.result
@@ -36,6 +36,8 @@ Warning 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1(c1) VALUES('5');
INSERT INTO t2(c1) VALUES('5');
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t3(c1) VALUES('5');
INSERT INTO t4(c1,c2) VALUES('0','000');
INSERT INTO t2 VALUES(1900,2156,'08-01-06','08/01/07');
@@ -3218,6 +3220,8 @@ TRUNCATE TABLE t5;
DROP TABLE t5;
INSERT INTO t1 SET c1='00';
INSERT INTO t2 SET c1=69;
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t3 SET c1=70;
INSERT INTO t4 SET c2=99;
Warnings:
@@ -3291,6 +3295,8 @@ Warning 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1(c1) VALUES('5');
INSERT INTO t2(c1) VALUES('5');
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t3(c1) VALUES('5');
INSERT INTO t4(c1,c2) VALUES('0','000');
INSERT INTO t2 VALUES(1900,2156,'08-01-06','08/01/07');
@@ -6183,6 +6189,8 @@ TRUNCATE TABLE t5;
DROP TABLE t5;
INSERT INTO t1 SET c1='00';
INSERT INTO t2 SET c1=69;
+Warnings:
+Warning 1364 Field 'c2' doesn't have a default value
INSERT INTO t3 SET c1=70;
INSERT INTO t4 SET c2=99;
Warnings:
diff --git a/mysql-test/suite/engines/iuds/r/update_decimal.result b/mysql-test/suite/engines/iuds/r/update_decimal.result
index e6331cee557..eb482c6181b 100644
--- a/mysql-test/suite/engines/iuds/r/update_decimal.result
+++ b/mysql-test/suite/engines/iuds/r/update_decimal.result
@@ -348,7 +348,7 @@ c3
9999999999
UPDATE t1 SET c2="1 e 1" WHERE c4=2;
Warnings:
-Note 1265 Data truncated for column 'c2' at row 2
+Warning 1265 Data truncated for column 'c2' at row 2
SELECT c2 FROM t1;
c2
-100.00000
@@ -1099,7 +1099,7 @@ INSERT INTO t3 VALUES ('11111.11111','4444444444',1),('55555.55555','5555555555'
UPDATE t2,t3 SET t3.c1='22222.22222' WHERE t2.c1=t3.c1 AND t2.c3=t3.c3;
UPDATE t1 SET c3='asdf' WHERE c1='11111.11111';
Warnings:
-Warning 1265 Data truncated for column 'c3' at row 1
+Warning 1366 Incorrect double value: 'asdf' for column 'c3' at row 1
SELECT c3 FROM t1;
c3
0
diff --git a/mysql-test/suite/engines/iuds/t/type_bit_iuds.test b/mysql-test/suite/engines/iuds/t/type_bit_iuds.test
index 628457cb9cd..88418decfad 100644
--- a/mysql-test/suite/engines/iuds/t/type_bit_iuds.test
+++ b/mysql-test/suite/engines/iuds/t/type_bit_iuds.test
@@ -71,7 +71,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -235,7 +234,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -359,7 +357,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -523,7 +520,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -647,7 +643,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -811,7 +806,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -935,7 +929,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -1099,7 +1092,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -1223,7 +1215,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -1387,7 +1378,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -1511,7 +1501,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -1675,7 +1664,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -1799,7 +1787,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -1963,7 +1950,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -2087,7 +2073,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -2251,7 +2236,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -2375,7 +2359,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -2539,7 +2522,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -2663,7 +2645,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -2827,7 +2808,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -2951,7 +2931,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -3115,7 +3094,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -3239,7 +3217,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -3403,7 +3380,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -3527,7 +3503,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -3691,7 +3666,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -3815,7 +3789,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -3979,7 +3952,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -4103,7 +4075,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -4267,7 +4238,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -4391,7 +4361,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -4555,7 +4524,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -4679,7 +4647,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -4843,7 +4810,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -4967,7 +4933,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -5131,7 +5096,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -5255,7 +5219,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -5419,7 +5382,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -5543,7 +5505,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -5707,7 +5668,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -5831,7 +5791,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -5995,7 +5954,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -6119,7 +6077,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -6283,7 +6240,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -6407,7 +6363,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -6571,7 +6526,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -6695,7 +6649,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -6859,7 +6812,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -6983,7 +6935,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -7147,7 +7098,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -7271,7 +7221,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -7435,7 +7384,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -7559,7 +7507,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -7723,7 +7670,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -7847,7 +7793,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -8011,7 +7956,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -8135,7 +8079,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -8299,7 +8242,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -8423,7 +8365,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -8587,7 +8528,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -8711,7 +8651,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -8875,7 +8814,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -8999,7 +8937,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -9163,7 +9100,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -9287,7 +9223,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -9451,7 +9386,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -9575,7 +9509,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -9739,7 +9672,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -9863,7 +9795,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -10027,7 +9958,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -10151,7 +10081,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -10315,7 +10244,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -10439,7 +10367,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -10603,7 +10530,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -10727,7 +10653,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -10891,7 +10816,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -11015,7 +10939,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -11179,7 +11102,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -11303,7 +11225,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -11467,7 +11388,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -11591,7 +11511,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -11755,7 +11674,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -11879,7 +11797,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -12043,7 +11960,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -12167,7 +12083,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -12331,7 +12246,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -12455,7 +12369,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -12619,7 +12532,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -12743,7 +12655,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -12907,7 +12818,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -13031,7 +12941,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -13195,7 +13104,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -13319,7 +13227,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -13483,7 +13390,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -13607,7 +13513,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -13771,7 +13676,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -13896,7 +13800,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -14060,7 +13963,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -14185,7 +14087,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -14349,7 +14250,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -14474,7 +14374,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -14638,7 +14537,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -14763,7 +14661,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -14927,7 +14824,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -15052,7 +14948,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -15216,7 +15111,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -15341,7 +15235,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -15505,7 +15398,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -15630,7 +15522,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -15794,7 +15685,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -15919,7 +15809,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -16083,7 +15972,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -16208,7 +16096,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(0) NOT NULL PRIMARY KEY, c2 BIT(0));
CREATE TABLE t6(c1 BIT(0), c2 BIT(0));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -16372,7 +16259,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -16497,7 +16383,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(1) NOT NULL PRIMARY KEY, c2 BIT(1));
CREATE TABLE t6(c1 BIT(1), c2 BIT(1));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -16661,7 +16546,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -16786,7 +16670,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(2) NOT NULL PRIMARY KEY, c2 BIT(2));
CREATE TABLE t6(c1 BIT(2), c2 BIT(2));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -16950,7 +16833,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -17075,7 +16957,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(4) NOT NULL PRIMARY KEY, c2 BIT(4));
CREATE TABLE t6(c1 BIT(4), c2 BIT(4));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -17239,7 +17120,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -17364,7 +17244,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(8) NOT NULL PRIMARY KEY, c2 BIT(8));
CREATE TABLE t6(c1 BIT(8), c2 BIT(8));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -17528,7 +17407,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -17653,7 +17531,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(16) NOT NULL PRIMARY KEY, c2 BIT(16));
CREATE TABLE t6(c1 BIT(16), c2 BIT(16));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -17817,7 +17694,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -17942,7 +17818,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(32) NOT NULL PRIMARY KEY, c2 BIT(32));
CREATE TABLE t6(c1 BIT(32), c2 BIT(32));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -18106,7 +17981,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
@@ -18231,7 +18105,6 @@ CREATE TABLE t4(i INT, b BIT NOT NULL);
ALTER TABLE t4 ADD PRIMARY KEY (i);
CREATE TABLE t5(c1 BIT(64) NOT NULL PRIMARY KEY, c2 BIT(64));
CREATE TABLE t6(c1 BIT(64), c2 BIT(64));
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
--sorted_result
@@ -18395,7 +18268,6 @@ UPDATE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
TRUNCATE t5;
TRUNCATE t6;
-#Borrowed from suite/ndb/t/ndb_bitfield.test
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
INSERT INTO t6 VALUES (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135),(null,23),(1,null),(null,null);
diff --git a/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl b/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl
index 1164b471bd3..f277bce018e 100755
--- a/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl
+++ b/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl
@@ -108,7 +108,7 @@ $engine_options="";
add_engine_help();
}
-# From this point forward there is no difference between the build in InnDB and the plugin
+# From this point forward there is no difference between the build in InnoDB and the plugin
$opt_engine='InnoDB' if ($opt_engine eq 'InnoDB_plugin');
# checking that custom files for that engine exist
@@ -141,7 +141,6 @@ $cmd="MTR_VERSION=1 " .
"--mysqld=--log-output=file " .
"--mysqld=--sql-mode=no_engine_substitution " .
"--skip-im " .
- "--skip-ndb " .
$engine_options .
" > ".$runlog." 2>&1";
diff --git a/mysql-test/suite/federated/assisted_discovery.result b/mysql-test/suite/federated/assisted_discovery.result
index 7a351b9df6f..5ad37397b3c 100644
--- a/mysql-test/suite/federated/assisted_discovery.result
+++ b/mysql-test/suite/federated/assisted_discovery.result
@@ -31,6 +31,38 @@ id group a\\b a\\ name
1 1 2 NULL foo
2 1 2 NULL fee
DROP TABLE t1;
+create table t1 (
+a bigint(20) not null auto_increment,
+b bigint(20) not null,
+c tinyint(4) not null,
+d varchar(4096) not null,
+primary key (a),
+key (b,c,d(255))
+);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` bigint(20) NOT NULL,
+ `c` tinyint(4) NOT NULL,
+ `d` varchar(4096) NOT NULL,
+ PRIMARY KEY (`a`),
+ KEY `b` (`b`,`c`,`d`(255))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create table t1 engine=federated
+connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` bigint(20) NOT NULL,
+ `c` tinyint(4) NOT NULL,
+ `d` varchar(4096) NOT NULL,
+ PRIMARY KEY (`a`),
+ KEY `b` (`b`,`c`,`d`(255))
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'
+drop table t1;
+drop table t1;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/suite/federated/assisted_discovery.test b/mysql-test/suite/federated/assisted_discovery.test
index 9f3abe74ecc..fa83a2a8e19 100644
--- a/mysql-test/suite/federated/assisted_discovery.test
+++ b/mysql-test/suite/federated/assisted_discovery.test
@@ -30,5 +30,29 @@ connection slave;
SELECT * FROM t1;
DROP TABLE t1;
+#
+#
+#
+create table t1 (
+ a bigint(20) not null auto_increment,
+ b bigint(20) not null,
+ c tinyint(4) not null,
+ d varchar(4096) not null,
+ primary key (a),
+ key (b,c,d(255))
+);
+show create table t1;
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table t1 engine=federated
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+show create table t1;
+drop table t1;
+
+connection slave;
+drop table t1;
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/federated/federated_bug_35333.result b/mysql-test/suite/federated/federated_bug_35333.result
index 05e4bab8ec5..38a3a51ef28 100644
--- a/mysql-test/suite/federated/federated_bug_35333.result
+++ b/mysql-test/suite/federated/federated_bug_35333.result
@@ -29,7 +29,7 @@ Warnings:
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
DROP TABLE t1;
Warnings:
-Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
+Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
#
# Cleanup
#
diff --git a/mysql-test/suite/federated/federated_server.result b/mysql-test/suite/federated/federated_server.result
index 3855964e2ba..2f04f1443ba 100644
--- a/mysql-test/suite/federated/federated_server.result
+++ b/mysql-test/suite/federated/federated_server.result
@@ -246,7 +246,7 @@ drop user guest_usage@localhost;
drop user guest_select@localhost;
drop table federated.t1;
drop server 's1';
-create server 's1' foreign data wrapper 'mysql' options (port 3306);
+create server 's1' foreign data wrapper 'mysql' options (host 'foo');
alter server 's1' options
(host 'localhost', database '', user '',
password '', socket '', owner '', port 3306);
diff --git a/mysql-test/suite/federated/federated_server.test b/mysql-test/suite/federated/federated_server.test
index c47a1acf2a3..3d491b1dfdf 100644
--- a/mysql-test/suite/federated/federated_server.test
+++ b/mysql-test/suite/federated/federated_server.test
@@ -292,7 +292,7 @@ drop server 's1';
#
# Bug#30671 - ALTER SERVER causes the server to crash
#
-create server 's1' foreign data wrapper 'mysql' options (port 3306);
+create server 's1' foreign data wrapper 'mysql' options (host 'foo');
alter server 's1' options
(host 'localhost', database '', user '',
password '', socket '', owner '', port 3306);
diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result
index 7dfcfd9f359..4d5d94443f3 100644
--- a/mysql-test/suite/federated/federatedx.result
+++ b/mysql-test/suite/federated/federatedx.result
@@ -1689,6 +1689,11 @@ a b c
19 23 437
delete from federated.t1;
load data infile '../../std_data/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b);
+Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'b' at row 1
+Note 1265 Data truncated for column 'a' at row 2
+Note 1265 Data truncated for column 'b' at row 2
select * from federated.t1 order by a;
a b c
3 4 12
@@ -1810,6 +1815,7 @@ length(a)
5000
drop table t1;
drop table t1;
+set sql_mode="";
DROP TABLE IF EXISTS federated.test;
CREATE TABLE federated.test (
`i` int(11) NOT NULL,
@@ -1818,6 +1824,7 @@ CREATE TABLE federated.test (
PRIMARY KEY (`i`,`j`),
UNIQUE KEY `i` (`i`,`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+set sql_mode=default;
DROP TABLE IF EXISTS federated.test1;
DROP TABLE IF EXISTS federated.test2;
create table federated.test1 (
@@ -2143,7 +2150,7 @@ DROP TABLE t1;
#Switch to Connection Slave
DROP TABLE t1;
End of 5.0 tests
-create server 's1' foreign data wrapper 'mysql' options (port 3306);
+create server 's1' foreign data wrapper 'mysql' options (host 'foo');
drop server 's1';
#
# Bug #32426: FEDERATED query returns corrupt results for ORDER BY on a TEXT
diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test
index 5e405dd8d09..29d1eaddc26 100644
--- a/mysql-test/suite/federated/federatedx.test
+++ b/mysql-test/suite/federated/federatedx.test
@@ -1506,8 +1506,7 @@ DROP TABLE federated.test;
# and lost changes to NEW variables.
# Since for federated engine only operation which is affected by wrong
# fields mark-up is handler::write_row() this file constains coverage
-# for ON INSERT triggers only. Tests for other types of triggers reside
-# in ndb_trigger.test.
+# for ON INSERT triggers only.
#
connection slave;
--disable_warnings
@@ -1634,6 +1633,7 @@ drop table t1;
#
connection slave;
+set sql_mode="";
--disable_warnings
DROP TABLE IF EXISTS federated.test;
CREATE TABLE federated.test (
@@ -1644,6 +1644,7 @@ CREATE TABLE federated.test (
UNIQUE KEY `i` (`i`,`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--enable_warnings
+set sql_mode=default;
connection master;
--disable_warnings
@@ -1967,7 +1968,7 @@ connection default;
--echo End of 5.0 tests
-create server 's1' foreign data wrapper 'mysql' options (port 3306);
+create server 's1' foreign data wrapper 'mysql' options (host 'foo');
drop server 's1';
diff --git a/mysql-test/suite/federated/net_thd_crash-12725.result b/mysql-test/suite/federated/net_thd_crash-12725.result
new file mode 100644
index 00000000000..8c85b7a7594
--- /dev/null
+++ b/mysql-test/suite/federated/net_thd_crash-12725.result
@@ -0,0 +1,10 @@
+SET GLOBAL query_cache_size= 16*1024*1024;
+SET GLOBAL query_cache_type= 1;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
+ALTER TABLE t2 DISABLE KEYS;
+ERROR HY000: Storage engine FEDERATED of the table `test`.`t2` doesn't have this option
+CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
+SET GLOBAL query_cache_size= default;
+SET GLOBAL query_cache_type= default;
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/federated/net_thd_crash-12725.test b/mysql-test/suite/federated/net_thd_crash-12725.test
new file mode 100644
index 00000000000..e94001cde01
--- /dev/null
+++ b/mysql-test/suite/federated/net_thd_crash-12725.test
@@ -0,0 +1,17 @@
+#
+# MDEV-12725 select on federated table crashes server
+#
+#
+SET GLOBAL query_cache_size= 16*1024*1024;
+SET GLOBAL query_cache_type= 1;
+CREATE TABLE t1 (i INT);
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
+--error ER_ILLEGAL_HA
+ALTER TABLE t2 DISABLE KEYS;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
+source include/restart_mysqld.inc;
+SET GLOBAL query_cache_size= default;
+SET GLOBAL query_cache_type= default;
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/federated/net_thd_crash-12951.result b/mysql-test/suite/federated/net_thd_crash-12951.result
new file mode 100644
index 00000000000..573ac96efff
--- /dev/null
+++ b/mysql-test/suite/federated/net_thd_crash-12951.result
@@ -0,0 +1,11 @@
+set global query_cache_size= 16*1024*1024;
+set global query_cache_type= 1;
+create table t1 (i int) engine=innodb;
+create table t2 (i int) engine=federated
+CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
+select * from t2;
+i
+drop table t2;
+drop table t1;
+set global query_cache_type= default;
+set global query_cache_size= default;
diff --git a/mysql-test/suite/federated/net_thd_crash-12951.test b/mysql-test/suite/federated/net_thd_crash-12951.test
new file mode 100644
index 00000000000..81cd826686e
--- /dev/null
+++ b/mysql-test/suite/federated/net_thd_crash-12951.test
@@ -0,0 +1,23 @@
+#
+# MDEV-12951 Server crash [mysqld got exception 0xc0000005]
+#
+
+--source include/have_innodb.inc
+
+set global query_cache_size= 16*1024*1024;
+set global query_cache_type= 1;
+
+create table t1 (i int) engine=innodb;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval create table t2 (i int) engine=federated
+ CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
+
+select * from t2;
+
+source include/restart_mysqld.inc;
+
+drop table t2;
+drop table t1;
+
+set global query_cache_type= default;
+set global query_cache_size= default;
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_load.inc b/mysql-test/suite/funcs_1/datadict/datadict_load.inc
index e3013249faf..9e3b87660f8 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_load.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_load.inc
@@ -61,15 +61,11 @@ let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host NOT In ("loca
eval SET @ENGINE_INNODB = IF( '$engine_type' = 'innodb', 1, 0);
eval SET @ENGINE_MEMORY = IF( '$engine_type' = 'memory', 1, 0);
eval SET @ENGINE_MYISAM = IF( '$engine_type' = 'myisam', 1, 0);
-eval SET @ENGINE_NDB = IF( '$engine_type' = 'ndb', 1, 0);
--enable_query_log
let $engine_myisam= `SELECT @ENGINE_MYISAM = 1`;
let $engine_innodb= `SELECT @ENGINE_INNODB = 1`;
let $engine_memory= `SELECT @ENGINE_MEMORY = 1`;
-let $engine_ndb= `SELECT @ENGINE_NDB = 1`;
-# Note: The NDB variant with their own tb1 - tb4 tables is not ready for use.
-let $engine_ndb= 0;
--disable_warnings
DROP DATABASE IF EXISTS test1;
@@ -107,15 +103,5 @@ if ($engine_myisam)
--source suite/funcs_1/include/myisam_tb2.inc
}
-if ($engine_ndb)
-{
- --source suite/funcs_1/include/ndb_tb1.inc
- --source suite/funcs_1/include/ndb_tb2.inc
- --source suite/funcs_1/include/ndb_tb3.inc
- --source suite/funcs_1/include/ndb_tb4.inc
- USE test1;
- --source suite/funcs_1/include/ndb_tb2.inc
-}
-
USE test;
--source suite/funcs_1/include/sp_tb.inc
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_priv.inc b/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
index 178a8f18c74..c69d7b004be 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
@@ -48,9 +48,9 @@ eval INSERT INTO $table SELECT * FROM test.t_$table;
eval DROP TABLE test.t_$table;
--error ER_VIEW_NONUPD_CHECK
-eval CREATE VIEW test.v_$table ($columns) AS SELECT * FROM $table WITH CHECK OPTION;
+eval CREATE VIEW test.v_$table ($columns) AS SELECT $columns FROM $table WITH CHECK OPTION;
-eval CREATE VIEW test.v_$table ($columns) AS SELECT * FROM $table;
+eval CREATE VIEW test.v_$table ($columns) AS SELECT $columns FROM $table;
# !!! This query returns a wrong error due to a bug in the code of mwl106
# !!! Uncomment it when the bug is fixed
diff --git a/mysql-test/suite/funcs_1/datadict/is_routines.inc b/mysql-test/suite/funcs_1/datadict/is_routines.inc
index 5ef88e2dffc..ecbb1b8c0da 100644
--- a/mysql-test/suite/funcs_1/datadict/is_routines.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_routines.inc
@@ -18,6 +18,7 @@
# 2008-06-11 mleich Move t/is_routines.test to this file and
# create variants for embedded/non embedded server.
#
+set sql_mode="";
let $engine_type = MEMORY;
let $other_engine_type = MyISAM;
diff --git a/mysql-test/suite/funcs_1/datadict/is_triggers.inc b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
index 5597bc816fc..6c618e533b2 100644
--- a/mysql-test/suite/funcs_1/datadict/is_triggers.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
@@ -19,6 +19,7 @@
# 2008-06-11 mleich Move t/is_triggers.test to this file and
# create variants for embedded/non embedded server.
#
+set global sql_mode="";
let $engine_type = MEMORY;
let $other_engine_type = MyISAM;
@@ -257,3 +258,4 @@ ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers;
# Cleanup
DROP DATABASE db_datadict;
+set global sql_mode=default;
diff --git a/mysql-test/suite/funcs_1/datadict/is_views.inc b/mysql-test/suite/funcs_1/datadict/is_views.inc
index 0ba1aaff3f2..716d50f5794 100644
--- a/mysql-test/suite/funcs_1/datadict/is_views.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_views.inc
@@ -165,8 +165,13 @@ CREATE USER 'testuser1'@'localhost';
SELECT * FROM information_schema.views
WHERE table_name LIKE 't1_%';
CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table;
+CREATE ALGORITHM=MERGE VIEW test.t1_view1 AS SELECT f1 FROM test.t1_table;
+CREATE ALGORITHM=TEMPTABLE VIEW test.t1_view2 AS SELECT f1 FROM test.t1_table;
SELECT * FROM information_schema.views
WHERE table_name LIKE 't1_%';
+DROP VIEW test.t1_view1;
+DROP VIEW test.t1_view2;
+
#
# Check modification of DEFINER, SECURITY_TYPE, IS_UPDATABLE, VIEW_DEFINITION,
# CHECK_OPTION
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
index d70402b9cec..cd060e7a370 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
@@ -46,7 +46,6 @@
# ----> MyISAM #
# - There is no impact of the GLOBAL(server) or SESSION default #
# storage engine setting on the engine used for I_S tables. #
-# That means we cannot get NDB or InnoDB instead. #
# #
# Creation: #
# 2007-08 hhunger Implement this test as part of #
@@ -66,7 +65,7 @@
let $table= processlist;
#
# columns of the information_schema table e.g. to use in a select.
-let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID;
+let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY;
#
# Where clause for an update.
let $update_where= WHERE id=1 ;
@@ -159,9 +158,9 @@ WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1
eval SHOW CREATE TABLE $table;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
eval SELECT * FROM $table $select_where ORDER BY id;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
eval SELECT $columns FROM $table $select_where ORDER BY id;
--source suite/funcs_1/datadict/datadict_priv.inc
--real_sleep 0.3
@@ -179,9 +178,9 @@ connection con100;
eval SHOW CREATE TABLE $table;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
eval SELECT * FROM $table $select_where ORDER BY id;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
eval SELECT $columns FROM $table $select_where ORDER BY id;
--source suite/funcs_1/datadict/datadict_priv.inc
--real_sleep 0.3
@@ -205,7 +204,7 @@ connection con100;
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -217,7 +216,7 @@ connect (con101,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -227,6 +226,7 @@ SELECT * FROM information_schema.processlist;
--echo connection default (user=root)
--echo ####################################################################################
connection default;
+create user ''@'localhost';
GRANT PROCESS ON *.* TO ''@'localhost';
--real_sleep 0.3
@@ -239,7 +239,7 @@ connect (anonymous1,localhost,"''",,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -261,7 +261,7 @@ connect (con102,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -287,7 +287,7 @@ if ($fixed_bug_30395)
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
}
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -308,7 +308,7 @@ connect (con103,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -330,7 +330,7 @@ connect (con104,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -377,7 +377,7 @@ connect (con200,localhost,ddicttestuser2,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -398,7 +398,7 @@ connect (con201,localhost,ddicttestuser2,ddictpass,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -421,7 +421,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -445,7 +445,7 @@ connect (con108,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
index f5d736a8402..6e76cedde2e 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
@@ -20,7 +20,6 @@
# The column PROCESSLIST.INFO is of data type LONGTEXT ----> MyISAM #
# - There is no impact of the GLOBAL(server) or SESSION default storage #
# engine setting on the engine used for I_S tables. #
-# That means we cannot get NDB or InnoDB instead. #
# 3. The SHOW (FULL) PROCESSLIST command are for comparison. #
# The main test target is INFORMATION_SCHEMA.PROCESSLIST ! #
# 4. Attention: #
@@ -93,7 +92,7 @@ echo
# - INFO must contain the corresponding SHOW/SELECT PROCESSLIST
#
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SHOW FULL PROCESSLIST;
@@ -166,7 +165,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE COMMAND = 'Sleep' AND USER = 'test_user';
--source include/wait_condition.inc
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -211,7 +210,7 @@ echo
# ----- switch to connection con1 (user = test_user) -----
;
connection con1;
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -245,7 +244,7 @@ echo
;
connection con2;
# Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -305,7 +304,7 @@ WHERE ID = @test_user_con2_id AND Command IN('Query','Execute')
AND State = 'User sleep' AND INFO IS NOT NULL ;
--source include/wait_condition.inc
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -376,7 +375,7 @@ let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
#
# Expect to see the state 'Waiting for table metadata lock' for the third
# connection because the SELECT collides with the WRITE TABLE LOCK.
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
UNLOCK TABLES;
#
@@ -435,7 +434,7 @@ echo
# SHOW FULL PROCESSLIST Complete statement
# SHOW PROCESSLIST statement truncated after 100 char
;
---replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID>
+--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
SHOW FULL PROCESSLIST;
diff --git a/mysql-test/suite/funcs_1/datadict/tables2.inc b/mysql-test/suite/funcs_1/datadict/tables2.inc
index 0d110dd22d9..1dc00e5b0f7 100644
--- a/mysql-test/suite/funcs_1/datadict/tables2.inc
+++ b/mysql-test/suite/funcs_1/datadict/tables2.inc
@@ -21,13 +21,11 @@
# 20 CREATE_OPTIONS
# 21 TABLE_COMMENT User defined comment
# + InnoDB
-# + NDB: "number_of_replicas: <number>" appended
# + InnoDB: "InnoDB free: <number_kB> kB" appended
# <number_kB> depends on tablespace history!
# The LEFT/INSTR/IF/LENGTH stuff should remove these
# storage engine specific part.
let $innodb_pattern = 'InnoDB free';
-let $ndb_pattern = 'number_of_replicas';
--vertical_results
# We do not unify the engine name here, because the rowformat is
# specific to the engine.
@@ -36,11 +34,9 @@ let $ndb_pattern = 'number_of_replicas';
eval
SELECT *,
LEFT( table_comment,
- IF(INSTR(table_comment,$innodb_pattern) = 0
- AND INSTR(table_comment,$ndb_pattern) = 0,
+ IF(INSTR(table_comment,$innodb_pattern) = 0,
LENGTH(table_comment),
- INSTR(table_comment,$innodb_pattern)
- + INSTR(table_comment,$ndb_pattern) - 1))
+ INSTR(table_comment,$innodb_pattern) - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/include/innodb_tb4.inc b/mysql-test/suite/funcs_1/include/innodb_tb4.inc
index 104b0e763be..b3e94fce80e 100644
--- a/mysql-test/suite/funcs_1/include/innodb_tb4.inc
+++ b/mysql-test/suite/funcs_1/include/innodb_tb4.inc
@@ -49,7 +49,7 @@ f217 float(53) unsigned zerofill,
f218 date,
f219 time,
f220 datetime,
-f221 timestamp,
+f221 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
f222 year,
f223 year(3),
f224 year(4),
diff --git a/mysql-test/suite/funcs_1/include/memory_tb4.inc b/mysql-test/suite/funcs_1/include/memory_tb4.inc
index d3bab92af3d..3a4fc861f28 100644
--- a/mysql-test/suite/funcs_1/include/memory_tb4.inc
+++ b/mysql-test/suite/funcs_1/include/memory_tb4.inc
@@ -49,7 +49,7 @@ f217 float(53) unsigned zerofill,
f218 date,
f219 time,
f220 datetime,
-f221 timestamp,
+f221 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
f222 year,
f223 year(3),
f224 year(4),
diff --git a/mysql-test/suite/funcs_1/include/myisam_tb4.inc b/mysql-test/suite/funcs_1/include/myisam_tb4.inc
index 23fa9af45bb..da934e6d658 100644
--- a/mysql-test/suite/funcs_1/include/myisam_tb4.inc
+++ b/mysql-test/suite/funcs_1/include/myisam_tb4.inc
@@ -49,7 +49,7 @@ f217 float(53) unsigned zerofill,
f218 date,
f219 time,
f220 datetime,
-f221 timestamp,
+f221 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
f222 year,
f223 year(3),
f224 year(4),
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb1.inc b/mysql-test/suite/funcs_1/include/ndb_tb1.inc
deleted file mode 100644
index fd2db538b4c..00000000000
--- a/mysql-test/suite/funcs_1/include/ndb_tb1.inc
+++ /dev/null
@@ -1,70 +0,0 @@
-##### suite/funcs_1/include/ndb_tb1.inc
-
---disable_warnings
-drop table if exists tb1 ;
---enable_warnings
-create table tb1 (
-f1 char(0),
-f2 char(0) binary,
-f3 char(0) ascii,
-f4 tinytext unicode,
-f5 text,
-f6 mediumtext,
-f7 longtext,
-f8 tinyblob,
-f9 blob,
-f10 mediumblob,
-f11 longblob,
-f12 binary,
-f13 tinyint,
-f14 tinyint unsigned,
-f15 tinyint zerofill,
-f16 tinyint unsigned zerofill,
-f17 smallint,
-f18 smallint unsigned,
-f19 smallint zerofill,
-f20 smallint unsigned zerofill,
-f21 mediumint,
-f22 mediumint unsigned,
-f23 mediumint zerofill,
-f24 mediumint unsigned zerofill,
-f25 int,
-f26 int unsigned,
-f27 int zerofill,
-f28 int unsigned zerofill,
-f29 bigint,
-f30 bigint unsigned,
-f31 bigint zerofill,
-f32 bigint unsigned zerofill,
-f33 decimal,
-f34 decimal unsigned,
-f35 decimal zerofill,
-f36 decimal unsigned zerofill not null DEFAULT 9.9,
-f37 decimal (0) not null DEFAULT 9.9,
-f38 decimal (64) not null DEFAULT 9.9,
-f39 decimal (0) unsigned not null DEFAULT 9.9,
-f40 decimal (64) unsigned not null DEFAULT 9.9,
-f41 decimal (0) zerofill not null DEFAULT 9.9,
-f42 decimal (64) zerofill not null DEFAULT 9.9,
-f43 decimal (0) unsigned zerofill not null DEFAULT 9.9,
-f44 decimal (64) unsigned zerofill not null DEFAULT 9.9,
-f45 decimal (0,0) not null DEFAULT 9.9,
-f46 decimal (63,30) not null DEFAULT 9.9,
-f47 decimal (0,0) unsigned not null DEFAULT 9.9,
-f48 decimal (63,30) unsigned not null DEFAULT 9.9,
-f49 decimal (0,0) zerofill not null DEFAULT 9.9,
-f50 decimal (63,30) zerofill not null DEFAULT 9.9,
-f51 decimal (0,0) unsigned zerofill not null DEFAULT 9.9,
-f52 decimal (63,30) unsigned zerofill not null DEFAULT 9.9,
-f53 numeric not null DEFAULT 99,
-f54 numeric unsigned not null DEFAULT 99,
-f55 numeric zerofill not null DEFAULT 99,
-f56 numeric unsigned zerofill not null DEFAULT 99,
-f57 numeric (0) not null DEFAULT 99,
-f58 numeric (64) not null DEFAULT 99
-) engine = ndb;
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval
-load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb1.txt'
-into table tb1 ;
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb2.inc b/mysql-test/suite/funcs_1/include/ndb_tb2.inc
deleted file mode 100644
index 3a8d647b65f..00000000000
--- a/mysql-test/suite/funcs_1/include/ndb_tb2.inc
+++ /dev/null
@@ -1,63 +0,0 @@
-##### suite/funcs_1/include/ndb_tb2.inc
-
---disable_warnings
-drop table if exists tb2 ;
---enable_warnings
-create table tb2 (
-f59 numeric (0) unsigned,
-f60 numeric (64) unsigned,
-f61 numeric (0) zerofill,
-f62 numeric (64) zerofill,
-f63 numeric (0) unsigned zerofill,
-f64 numeric (64) unsigned zerofill,
-f65 numeric (0,0),
-f66 numeric (63,30),
-f67 numeric (0,0) unsigned,
-f68 numeric (63,30) unsigned,
-f69 numeric (0,0) zerofill,
-f70 numeric (63,30) zerofill,
-f71 numeric (0,0) unsigned zerofill,
-f72 numeric (63,30) unsigned zerofill,
-f73 real,
-f74 real unsigned,
-f75 real zerofill,
-f76 real unsigned zerofill,
-f77 double default 7.7,
-f78 double unsigned default 7.7,
-f79 double zerofill default 7.7,
-f80 double unsigned zerofill default 8.8,
-f81 float not null default 8.8,
-f82 float unsigned not null default 8.8,
-f83 float zerofill not null default 8.8,
-f84 float unsigned zerofill not null default 8.8,
-f85 float(0) not null default 8.8,
-f86 float(23) not null default 8.8,
-f87 float(0) unsigned not null default 8.8,
-f88 float(23) unsigned not null default 8.8,
-f89 float(0) zerofill not null default 8.8,
-f90 float(23) zerofill not null default 8.8,
-f91 float(0) unsigned zerofill not null default 8.8,
-f92 float(23) unsigned zerofill not null default 8.8,
-f93 float(24) not null default 8.8,
-f94 float(53) not null default 8.8,
-f95 float(24) unsigned not null default 8.8,
-f96 float(53) unsigned not null default 8.8,
-f97 float(24) zerofill not null default 8.8,
-f98 float(53) zerofill not null default 8.8,
-f99 float(24) unsigned zerofill not null default 8.8,
-f100 float(53) unsigned zerofill not null default 8.8,
-f101 date not null default '2000-01-01',
-f102 time not null default 20,
-f103 datetime not null default '2/2/2',
-f104 timestamp not null default 20001231235959,
-f105 year not null default 2000,
-f106 year(3) not null default 2000,
-f107 year(4) not null default 2000,
-f108 enum("1enum","2enum") not null default "1enum",
-f109 set("1set","2set") not null default "1set"
-) engine = ndb;
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval
-load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb2.txt'
-into table tb2 ;
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb3.inc b/mysql-test/suite/funcs_1/include/ndb_tb3.inc
deleted file mode 100644
index 6ade99bd1a2..00000000000
--- a/mysql-test/suite/funcs_1/include/ndb_tb3.inc
+++ /dev/null
@@ -1,70 +0,0 @@
-##### suite/funcs_1/include/ndb_tb3.inc
-
---disable_warnings
-drop table if exists tb3 ;
---enable_warnings
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 tinytext,
-f122 text,
-f123 mediumtext,
-f124 longtext unicode,
-f125 tinyblob,
-f126 blob,
-f127 mediumblob,
-f128 longblob,
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = ndb;
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval
-load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb3.txt'
-into table tb3;
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb4.inc b/mysql-test/suite/funcs_1/include/ndb_tb4.inc
deleted file mode 100644
index 3eaae90179a..00000000000
--- a/mysql-test/suite/funcs_1/include/ndb_tb4.inc
+++ /dev/null
@@ -1,70 +0,0 @@
-##### suite/funcs_1/include/ndb_tb4.inc
-
---disable_warnings
-drop table if exists tb4;
---enable_warnings
-create table tb4 (
-f176 numeric (0) unsigned not null DEFAULT 9,
-f177 numeric (64) unsigned not null DEFAULT 9,
-f178 numeric (0) zerofill not null DEFAULT 9,
-f179 numeric (64) zerofill not null DEFAULT 9,
-f180 numeric (0) unsigned zerofill not null DEFAULT 9,
-f181 numeric (64) unsigned zerofill not null DEFAULT 9,
-f182 numeric (0,0) not null DEFAULT 9,
-f183 numeric (63,30) not null DEFAULT 9,
-f184 numeric (0,0) unsigned not null DEFAULT 9,
-f185 numeric (63,30) unsigned not null DEFAULT 9,
-f186 numeric (0,0) zerofill not null DEFAULT 9,
-f187 numeric (63,30) zerofill not null DEFAULT 9,
-f188 numeric (0,0) unsigned zerofill not null DEFAULT 9,
-f189 numeric (63,30) unsigned zerofill not null DEFAULT 9,
-f190 real not null DEFAULT 88.8,
-f191 real unsigned not null DEFAULT 88.8,
-f192 real zerofill not null DEFAULT 88.8,
-f193 real unsigned zerofill not null DEFAULT 88.8,
-f194 double not null DEFAULT 55.5,
-f195 double unsigned not null DEFAULT 55.5,
-f196 double zerofill not null DEFAULT 55.5,
-f197 double unsigned zerofill not null DEFAULT 55.5,
-f198 float,
-f199 float unsigned,
-f200 float zerofill,
-f201 float unsigned zerofill,
-f202 float(0),
-f203 float(23),
-f204 float(0) unsigned,
-f205 float(23) unsigned,
-f206 float(0) zerofill,
-f207 float(23) zerofill,
-f208 float(0) unsigned zerofill,
-f209 float(23) unsigned zerofill,
-f210 float(24),
-f211 float(53),
-f212 float(24) unsigned,
-f213 float(53) unsigned,
-f214 float(24) zerofill,
-f215 float(53) zerofill,
-f216 float(24) unsigned zerofill,
-f217 float(53) unsigned zerofill,
-f218 date,
-f219 time,
-f220 datetime,
-f221 timestamp,
-f222 year,
-f223 year(3),
-f224 year(4),
-f225 enum("1enum","2enum"),
-f226 set("1set","2set"),
-f235 char(0) unicode,
-f236 char(90),
-f237 char(255) ascii,
-f238 varchar(0),
-f239 varchar(3000) binary,
-f240 varchar(2000) unicode,
-f241 char(100) unicode
-) engine = ndb;
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval
-load data infile '$MYSQLTEST_VARDIR/std_data/funcs_1/ndb_tb4.txt'
-into table tb4 ;
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 f4cbc188e69..357c8200f34 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -13,8 +13,8 @@ ALTER TABLE t1_values ADD my_binary_30 BINARY(30);
ALTER TABLE t1_values ADD my_varbinary_1000 VARBINARY(1000);
ALTER TABLE t1_values ADD my_datetime DATETIME;
ALTER TABLE t1_values ADD my_date DATE;
-ALTER TABLE t1_values ADD ts_dummy TIMESTAMP;
-ALTER TABLE t1_values ADD my_timestamp TIMESTAMP;
+ALTER TABLE t1_values ADD ts_dummy TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+ALTER TABLE t1_values ADD my_timestamp TIMESTAMP NOT NULL DEFAULT '2001-01-01 10:20:30';
ALTER TABLE t1_values ADD my_time TIME;
ALTER TABLE t1_values ADD my_year YEAR;
ALTER TABLE t1_values ADD my_bigint BIGINT;
@@ -1276,7 +1276,7 @@ SELECT IFNULL(my_timestamp,'IS_NULL'),
my_timestamp, id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL order by id;
IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -1288,7 +1288,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL) order by id;
IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -1595,7 +1595,7 @@ SELECT IF(my_timestamp IS NULL, 'IS NULL',
WHERE select_id = 124 OR select_id IS NULL order by id;
IF(my_timestamp IS NULL, 'IS NULL',
'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
+IS NOT NULL 2001-01-01 10:20:30 1
IS NOT NULL 1970-01-01 14:00:01 2
IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
@@ -1609,7 +1609,7 @@ WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 124 OR select_id IS NULL) order by id;
IF(my_timestamp IS NULL, 'IS NULL',
'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
+IS NOT NULL 2001-01-01 10:20:30 1
IS NOT NULL 1970-01-01 14:00:01 2
IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
@@ -1936,7 +1936,7 @@ SELECT IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE'),
my_timestamp, id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL order by id;
IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
+IS TRUE 2001-01-01 10:20:30 1
IS TRUE 1970-01-01 14:00:01 2
IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
@@ -1948,7 +1948,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL) order by id;
IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
+IS TRUE 2001-01-01 10:20:30 1
IS TRUE 1970-01-01 14:00:01 2
IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
@@ -2098,8 +2098,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
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 if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2113,8 +2114,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
DROP VIEW v1;
@@ -2166,8 +2168,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2181,8 +2184,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2198,6 +2202,7 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' '
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
@@ -2213,6 +2218,7 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' '
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2281,6 +2287,8 @@ NULL NULL 1
<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
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 convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2293,6 +2301,8 @@ NULL NULL 1
<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
DROP VIEW v1;
@@ -2307,6 +2317,8 @@ NULL NULL 1
<--------30 characters-------> <--------30 characters-------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
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 convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2319,6 +2331,8 @@ NULL NULL 1
<--------30 characters-------> <--------30 characters-------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
DROP VIEW v1;
@@ -2488,7 +2502,7 @@ SELECT CAST(my_timestamp AS UNSIGNED INTEGER),
my_timestamp, id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2500,7 +2514,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL) order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2866,7 +2880,7 @@ SELECT CAST(my_timestamp AS SIGNED INTEGER),
my_timestamp, id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2878,7 +2892,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL) order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -3224,7 +3238,7 @@ SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL order by id;
CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
-0.00 0000-00-00 00:00:00 1
+20010101102030.00 2001-01-01 10:20:30 1
19700101140001.00 1970-01-01 14:00:01 2
20380101025959.00 2038-01-01 02:59:59 3
20040229235959.00 2004-02-29 23:59:59 4
@@ -3236,7 +3250,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
-0.00 0000-00-00 00:00:00 1
+20010101102030.00 2001-01-01 10:20:30 1
19700101140001.00 1970-01-01 14:00:01 2
20380101025959.00 2038-01-01 02:59:59 3
20040229235959.00 2004-02-29 23:59:59 4
@@ -3616,7 +3630,7 @@ SELECT CAST(my_timestamp AS TIME),
my_timestamp, id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL order by id;
CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
+10:20:30 2001-01-01 10:20:30 1
14:00:01 1970-01-01 14:00:01 2
02:59:59 2038-01-01 02:59:59 3
23:59:59 2004-02-29 23:59:59 4
@@ -3628,7 +3642,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL) order by id;
CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
+10:20:30 2001-01-01 10:20:30 1
14:00:01 1970-01-01 14:00:01 2
02:59:59 2038-01-01 02:59:59 3
23:59:59 2004-02-29 23:59:59 4
@@ -3729,14 +3743,14 @@ my_bigint, id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL order by id;
CAST(my_bigint AS TIME) my_bigint id
NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
+-838:59:59 -9223372036854775808 2
+838:59:59 9223372036854775807 3
00:00:00 0 4
-00:00:01 -1 5
00:17:58 1758 24
Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
+Warning 1292 Incorrect time value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect time value: '9223372036854775807' for column 'my_bigint' 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_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3745,14 +3759,14 @@ WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL) order by id;
CAST(my_bigint AS TIME) my_bigint id
NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
+-838:59:59 -9223372036854775808 2
+838:59:59 9223372036854775807 3
00:00:00 0 4
-00:00:01 -1 5
00:17:58 1758 24
Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
+Warning 1292 Incorrect time value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect time value: '9223372036854775807' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -3962,7 +3976,7 @@ SELECT CAST(my_timestamp AS DATETIME),
my_timestamp, id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL order by id;
CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -3974,7 +3988,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4081,15 +4095,14 @@ CAST(my_bigint AS DATETIME) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 00:00:00 0 4
NULL -1 5
NULL 200506271758 18
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 3
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 5
+Warning 1292 Incorrect datetime value: '200506271758' for column 'my_bigint' at row 18
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_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -4100,15 +4113,14 @@ CAST(my_bigint AS DATETIME) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 00:00:00 0 4
NULL -1 5
NULL 200506271758 18
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '200506271758' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -4324,7 +4336,7 @@ SELECT CAST(my_timestamp AS DATE),
my_timestamp, id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL order by id;
CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
+2001-01-01 2001-01-01 10:20:30 1
1970-01-01 1970-01-01 14:00:01 2
2038-01-01 2038-01-01 02:59:59 3
2004-02-29 2004-02-29 23:59:59 4
@@ -4336,7 +4348,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
+2001-01-01 2001-01-01 10:20:30 1
1970-01-01 1970-01-01 14:00:01 2
2038-01-01 2038-01-01 02:59:59 3
2004-02-29 2004-02-29 23:59:59 4
@@ -4441,14 +4453,13 @@ CAST(my_bigint AS DATE) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 0 4
NULL -1 5
2005-06-27 20050627 12
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 3
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 5
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_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -4459,14 +4470,13 @@ CAST(my_bigint AS DATE) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 0 4
NULL -1 5
2005-06-27 20050627 12
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -4682,7 +4692,7 @@ SELECT CAST(my_timestamp AS CHAR),
my_timestamp, id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL order by id;
CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4694,7 +4704,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL) order by id;
CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4994,7 +5004,7 @@ SELECT CAST(my_timestamp AS BINARY),
my_timestamp, id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL order by id;
CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -5006,7 +5016,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL) order by id;
CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
index fa8fb6c1eb2..1131477869a 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
@@ -1,3 +1,5 @@
+set sql_mode="";
+set GLOBAL sql_mode="";
--source suite/funcs_1/storedproc/load_sp_tb.inc
--------------------------------------------------------------------------------
@@ -388,6 +390,7 @@ DROP USER 'user_2'@'localhost';
--------------------------------------------------------------------------------
DROP DATABASE IF EXISTS db_storedproc;
DROP DATABASE IF EXISTS db_storedproc_1;
+set GLOBAL sql_mode=default;
. +++ END OF SCRIPT +++
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
index 0dfc1f51b76..de63339ee95 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
@@ -1,3 +1,4 @@
+set sql_mode="";
--source suite/funcs_1/storedproc/load_sp_tb.inc
--------------------------------------------------------------------------------
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 db92ea56444..5edef4cf3af 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -1,3 +1,4 @@
+set sql_mode="";
USE test;
drop table if exists tb3;
create table tb3 (
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
index cf93657885c..6d8bba4714b 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -449,8 +449,8 @@ create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
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 7f01975db16..c51347d5fa8 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
@@ -1,3 +1,5 @@
+set sql_mode="";
+set GLOBAL sql_mode="";
USE test;
drop table if exists tb3;
create table tb3 (
@@ -468,3 +470,4 @@ drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
+set GLOBAL sql_mode=default;
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 f9454edce4b..20354088a0f 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
@@ -1,3 +1,5 @@
+set sql_mode="";
+set GLOBAL sql_mode="";
USE test;
drop table if exists tb3;
create table tb3 (
@@ -521,3 +523,4 @@ drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
+set GLOBAL sql_mode=default;
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 986506b4e71..e6a10592424 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_09.result
@@ -189,8 +189,6 @@ Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
Warnings:
Warning 1048 Column 'f136' cannot be null
-Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
-where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
@@ -198,7 +196,7 @@ a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-a NULL Test 3.5.9.4-trig 0 999 NULL
+a NULL Test 3.5.9.4-trig NULL 999 NULL
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index e7523922154..59eec5b0220 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -22032,7 +22032,7 @@ Testcase 3.3.2.1 - 3.3.2.6 alternative implementation
--------------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
-CREATE TABLE t1 ( f1 BIGINT, f2 CHAR(20), f3 NUMERIC(7,4),
+CREATE TABLE t1 ( f1 BIGINT DEFAULT 0, f2 CHAR(20), f3 NUMERIC(7,4),
f4 CHAR, PRIMARY KEY(f1));
CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
INSERT INTO v1 SET f1 = 1;
diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result
index e3d66a1ed6c..0da7a2bde60 100644
--- a/mysql-test/suite/funcs_1/r/is_columns.result
+++ b/mysql-test/suite/funcs_1/r/is_columns.result
@@ -97,6 +97,9 @@ COLUMN_COMMENT varchar(1024) NO
SELECT table_catalog, table_schema, table_name, column_name
FROM information_schema.columns WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name column_name
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
###############################################################################
# Testcase 3.2.6.2 + 3.2.6.3: INFORMATION_SCHEMA.COLUMNS accessible information
###############################################################################
@@ -125,10 +128,10 @@ def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish
def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
def db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references
def db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI auto_increment select,insert,update,references
-def db_datadict t2 f1 1 NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references
+def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references
def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
def db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def db_datadict t2 f4 4 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI select,insert,update,references
+def db_datadict t2 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI select,insert,update,references
def db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references
def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references
SHOW COLUMNS FROM db_datadict.t1;
@@ -139,10 +142,10 @@ f3 date YES NULL
f4 int(11) NO PRI NULL auto_increment
SHOW COLUMNS FROM db_datadict.t2;
Field Type Null Key Default Extra
-f1 char(10) NO PRI
+f1 char(10) NO PRI NULL
f2 text YES NULL
f3 date YES NULL
-f4 int(11) NO PRI 0
+f4 int(11) NO PRI NULL
SHOW COLUMNS FROM db_datadict.v1;
Field Type Null Key Default Extra
f1 int(1) NO 0
@@ -169,13 +172,13 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-def db_datadict t2 f1 1 NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI insert
+def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI insert
def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text insert
SHOW COLUMNS FROM db_datadict.t1;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 't1'
SHOW COLUMNS FROM db_datadict.t2;
Field Type Null Key Default Extra
-f1 char(10) NO PRI
+f1 char(10) NO PRI NULL
f2 text YES NULL
SHOW COLUMNS FROM db_datadict.v1;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'v1'
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 085017fb529..fd8989c7667 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
@@ -250,7 +250,7 @@ f217 float(53) unsigned zerofill,
f218 date,
f219 time,
f220 datetime,
-f221 timestamp,
+f221 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
f222 year,
f223 year(3),
f224 year(4),
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 8f2f81a4616..e992b79321e 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -17,6 +17,7 @@ def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NU
def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
def information_schema APPLICABLE_ROLES GRANTEE 1 NO varchar 190 570 NULL NULL NULL utf8 utf8_general_ci varchar(190) select
+def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select
def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select
def information_schema APPLICABLE_ROLES ROLE_NAME 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select
def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
@@ -36,6 +37,7 @@ def information_schema CLIENT_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NUL
def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
+def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema CLIENT_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
@@ -45,6 +47,7 @@ def information_schema CLIENT_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0
def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
+def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
@@ -150,10 +153,23 @@ def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19
def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select
def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
+def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select
+def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select
+def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GEOMETRY_COLUMNS MAX_PPR 12 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select
+def information_schema GEOMETRY_COLUMNS SRID 13 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select
+def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select
def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
-def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
-def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema INDEX_STATISTICS INDEX_NAME 3 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) select
def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema INDEX_STATISTICS TABLE_NAME 2 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) select
@@ -242,12 +258,14 @@ def information_schema PROCESSLIST EXAMINED_ROWS 14 0 NO int NULL NULL 10 0 NULL
def information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select
def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select
+def information_schema PROCESSLIST INFO_BINARY 16 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select
def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select
def information_schema PROCESSLIST MEMORY_USED 13 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select
def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select
def information_schema PROCESSLIST QUERY_ID 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select
def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PROCESSLIST TID 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select
def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select
def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select
def information_schema PROCESSLIST USER 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select
@@ -304,9 +322,13 @@ def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NUL
def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
-def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
-def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
+def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) select
+def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select
+def information_schema SPATIAL_REF_SYS SRTEXT 4 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(1) select
def information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -323,11 +345,25 @@ def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NUL
def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
+def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select
+def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select
+def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select
+def information_schema SYSTEM_VARIABLES READ_ONLY 13 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
+def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
+def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
-def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
@@ -408,6 +444,7 @@ def information_schema USER_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NULL
def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
+def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
@@ -417,8 +454,10 @@ def information_schema USER_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0 N
def information_schema USER_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select
+def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema USER_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select
+def information_schema VIEWS ALGORITHM 11 NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select
def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select
def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
@@ -443,6 +482,7 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
+1.0000 blob NULL NULL
1.0000 longtext utf8 utf8_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
@@ -472,6 +512,7 @@ NULL datetime NULL NULL
NULL decimal NULL NULL
NULL double NULL NULL
NULL int NULL NULL
+NULL smallint NULL NULL
NULL tinyint NULL NULL
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
@@ -506,6 +547,7 @@ COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH C
3.0000 information_schema APPLICABLE_ROLES GRANTEE varchar 190 570 utf8 utf8_general_ci varchar(190)
3.0000 information_schema APPLICABLE_ROLES ROLE_NAME varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 information_schema APPLICABLE_ROLES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
+3.0000 information_schema APPLICABLE_ROLES IS_DEFAULT varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
@@ -533,6 +575,8 @@ NULL information_schema CLIENT_STATISTICS DENIED_CONNECTIONS bigint NULL NULL NU
NULL information_schema CLIENT_STATISTICS LOST_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
NULL information_schema CLIENT_STATISTICS ACCESS_DENIED bigint NULL NULL NULL NULL bigint(21)
NULL information_schema CLIENT_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL bigint(21)
+NULL information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) unsigned
+NULL information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED bigint NULL NULL NULL NULL bigint(21)
3.0000 information_schema COLLATIONS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
@@ -637,10 +681,23 @@ NULL information_schema FILES CHECK_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
+3.0000 information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS F_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
+3.0000 information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS G_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN varchar 64 192 utf8 utf8_general_ci varchar(64)
+NULL information_schema GEOMETRY_COLUMNS STORAGE_TYPE tinyint NULL NULL NULL NULL tinyint(2)
+NULL information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE int NULL NULL NULL NULL int(7)
+NULL information_schema GEOMETRY_COLUMNS COORD_DIMENSION tinyint NULL NULL NULL NULL tinyint(2)
+NULL information_schema GEOMETRY_COLUMNS MAX_PPR tinyint NULL NULL NULL NULL tinyint(2)
+NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL smallint(5)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema INDEX_STATISTICS TABLE_SCHEMA varchar 192 576 utf8 utf8_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
@@ -738,6 +795,8 @@ NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal
NULL information_schema PROCESSLIST MEMORY_USED int NULL NULL NULL NULL int(7)
NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7)
NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(4)
+1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob
+NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -791,9 +850,13 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smallint(5)
+3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
+NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5)
+3.0000 information_schema SPATIAL_REF_SYS SRTEXT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -810,6 +873,20 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_SCOPE varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
+3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
+3.0000 information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE varchar 21 63 utf8 utf8_general_ci varchar(21)
+1.0000 information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema SYSTEM_VARIABLES READ_ONLY varchar 3 9 utf8 utf8_general_ci varchar(3)
+3.0000 information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -829,7 +906,7 @@ NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema TABLES CREATE_OPTIONS varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -906,6 +983,8 @@ NULL information_schema USER_STATISTICS DENIED_CONNECTIONS bigint NULL NULL NULL
NULL information_schema USER_STATISTICS LOST_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
NULL information_schema USER_STATISTICS ACCESS_DENIED bigint NULL NULL NULL NULL bigint(21)
NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL bigint(21)
+NULL information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) unsigned
+NULL information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED bigint NULL NULL NULL NULL bigint(21)
3.0000 information_schema VIEWS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema VIEWS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema VIEWS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -916,3 +995,4 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema VIEWS ALGORITHM varchar 10 30 utf8 utf8_general_ci varchar(10)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index f46f1c0ce62..87eecaf41e9 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -17,6 +17,7 @@ def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NU
def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
def information_schema APPLICABLE_ROLES GRANTEE 1 NO varchar 190 570 NULL NULL NULL utf8 utf8_general_ci varchar(190)
+def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3)
def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3)
def information_schema APPLICABLE_ROLES ROLE_NAME 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128)
def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
@@ -36,6 +37,7 @@ def information_schema CLIENT_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NUL
def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
+def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema CLIENT_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
@@ -45,6 +47,7 @@ def information_schema CLIENT_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0
def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
+def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
@@ -150,10 +153,23 @@ def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19
def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4)
def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
+def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
+def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
+def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GEOMETRY_COLUMNS MAX_PPR 12 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
+def information_schema GEOMETRY_COLUMNS SRID 13 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5)
+def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
-def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
-def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
def information_schema INDEX_STATISTICS INDEX_NAME 3 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192)
def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema INDEX_STATISTICS TABLE_NAME 2 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192)
@@ -242,12 +258,14 @@ def information_schema PROCESSLIST EXAMINED_ROWS 14 0 NO int NULL NULL 10 0 NULL
def information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4)
def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext
+def information_schema PROCESSLIST INFO_BINARY 16 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob
def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
def information_schema PROCESSLIST MEMORY_USED 13 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3)
def information_schema PROCESSLIST QUERY_ID 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4)
def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST TID 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4)
def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3)
def information_schema PROCESSLIST USER 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128)
@@ -304,9 +322,13 @@ def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NUL
def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
-def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
-def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
+def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5)
+def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5)
+def information_schema SPATIAL_REF_SYS SRTEXT 4 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(1)
def information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
@@ -323,11 +345,25 @@ def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NUL
def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
+def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21)
+def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21)
+def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21)
+def information_schema SYSTEM_VARIABLES READ_ONLY 13 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
+def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
+def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
-def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255)
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
@@ -408,6 +444,7 @@ def information_schema USER_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NULL
def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
+def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
@@ -417,8 +454,10 @@ def information_schema USER_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0 N
def information_schema USER_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(11)
+def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema USER_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128)
+def information_schema VIEWS ALGORITHM 11 NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10)
def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8)
def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
@@ -443,6 +482,7 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
+1.0000 blob NULL NULL
1.0000 longtext utf8 utf8_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
@@ -472,6 +512,7 @@ NULL datetime NULL NULL
NULL decimal NULL NULL
NULL double NULL NULL
NULL int NULL NULL
+NULL smallint NULL NULL
NULL tinyint NULL NULL
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
@@ -506,6 +547,7 @@ COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH C
3.0000 information_schema APPLICABLE_ROLES GRANTEE varchar 190 570 utf8 utf8_general_ci varchar(190)
3.0000 information_schema APPLICABLE_ROLES ROLE_NAME varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 information_schema APPLICABLE_ROLES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
+3.0000 information_schema APPLICABLE_ROLES IS_DEFAULT varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
@@ -533,6 +575,8 @@ NULL information_schema CLIENT_STATISTICS DENIED_CONNECTIONS bigint NULL NULL NU
NULL information_schema CLIENT_STATISTICS LOST_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
NULL information_schema CLIENT_STATISTICS ACCESS_DENIED bigint NULL NULL NULL NULL bigint(21)
NULL information_schema CLIENT_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL bigint(21)
+NULL information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) unsigned
+NULL information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED bigint NULL NULL NULL NULL bigint(21)
3.0000 information_schema COLLATIONS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
@@ -637,10 +681,23 @@ NULL information_schema FILES CHECK_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
+3.0000 information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS F_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
+3.0000 information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS G_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN varchar 64 192 utf8 utf8_general_ci varchar(64)
+NULL information_schema GEOMETRY_COLUMNS STORAGE_TYPE tinyint NULL NULL NULL NULL tinyint(2)
+NULL information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE int NULL NULL NULL NULL int(7)
+NULL information_schema GEOMETRY_COLUMNS COORD_DIMENSION tinyint NULL NULL NULL NULL tinyint(2)
+NULL information_schema GEOMETRY_COLUMNS MAX_PPR tinyint NULL NULL NULL NULL tinyint(2)
+NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL smallint(5)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema INDEX_STATISTICS TABLE_SCHEMA varchar 192 576 utf8 utf8_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
@@ -738,6 +795,8 @@ NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal
NULL information_schema PROCESSLIST MEMORY_USED int NULL NULL NULL NULL int(7)
NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7)
NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(4)
+1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob
+NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -791,9 +850,13 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smallint(5)
+3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
+NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5)
+3.0000 information_schema SPATIAL_REF_SYS SRTEXT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -810,6 +873,20 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_SCOPE varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SYSTEM_VARIABLES VARIABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
+3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
+3.0000 information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE varchar 21 63 utf8 utf8_general_ci varchar(21)
+1.0000 information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema SYSTEM_VARIABLES READ_ONLY varchar 3 9 utf8 utf8_general_ci varchar(3)
+3.0000 information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -829,7 +906,7 @@ NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema TABLES CREATE_OPTIONS varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -906,6 +983,8 @@ NULL information_schema USER_STATISTICS DENIED_CONNECTIONS bigint NULL NULL NULL
NULL information_schema USER_STATISTICS LOST_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
NULL information_schema USER_STATISTICS ACCESS_DENIED bigint NULL NULL NULL NULL bigint(21)
NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL bigint(21)
+NULL information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) unsigned
+NULL information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED bigint NULL NULL NULL NULL bigint(21)
3.0000 information_schema VIEWS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema VIEWS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema VIEWS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -916,3 +995,4 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema VIEWS ALGORITHM varchar 10 30 utf8 utf8_general_ci varchar(10)
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 7521a9857a6..674abfaefab 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result
@@ -240,7 +240,7 @@ f217 float(53) unsigned zerofill,
f218 date,
f219 time,
f220 datetime,
-f221 timestamp,
+f221 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
f222 year,
f223 year(3),
f224 year(4),
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 6c2586cc3c1..6ce5f1bd8a0 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
@@ -262,7 +262,7 @@ f217 float(53) unsigned zerofill,
f218 date,
f219 time,
f220 datetime,
-f221 timestamp,
+f221 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
f222 year,
f223 year(3),
f224 year(4),
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 150469a4a2f..d89459a88ac 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
@@ -262,7 +262,7 @@ f217 float(53) unsigned zerofill,
f218 date,
f219 time,
f220 datetime,
-f221 timestamp,
+f221 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
f222 year,
f223 year(3),
f224 year(4),
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 a0617727a16..3aab87c5ce2 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -117,6 +117,20 @@ def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_
def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI select,insert,update,references
def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
+def mysql innodb_index_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
+def mysql innodb_index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
+def mysql innodb_index_stats last_update 4 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql innodb_index_stats sample_size 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql innodb_index_stats stat_description 8 NULL NO varchar 1024 3072 NULL NULL NULL utf8 utf8_bin varchar(1024) select,insert,update,references
+def mysql innodb_index_stats stat_name 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
+def mysql innodb_index_stats stat_value 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql innodb_index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
+def mysql innodb_table_stats clustered_index_size 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql innodb_table_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
+def mysql innodb_table_stats last_update 3 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql innodb_table_stats n_rows 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql innodb_table_stats sum_of_other_index_sizes 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql innodb_table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references
def mysql plugin dl 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
def mysql plugin name 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) PRI select,insert,update,references
def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references
@@ -172,6 +186,7 @@ def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) select,insert,update,references
def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) select,insert,update,references
+def mysql slow_log rows_affected 13 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
@@ -213,6 +228,7 @@ def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL NULL utf8 utf8_
def mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user default_role 45 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) select,insert,update,references
def mysql user Delete_priv 7 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Drop_priv 9 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Event_priv 30 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
@@ -226,6 +242,7 @@ def mysql user is_role 44 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum
def mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user max_connections 39 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references
def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references
+def mysql user max_statement_time 46 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) select,insert,update,references
def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references
def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
def mysql user Password 3 NO char 41 41 NULL NULL NULL latin1 latin1_bin char(41) select,insert,update,references
@@ -435,6 +452,20 @@ NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5)
3.0000 mysql index_stats index_name varchar 64 192 utf8 utf8_bin varchar(64)
NULL mysql index_stats prefix_arity int NULL NULL NULL NULL int(11) unsigned
NULL mysql index_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
+3.0000 mysql innodb_index_stats database_name varchar 64 192 utf8 utf8_bin varchar(64)
+3.0000 mysql innodb_index_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
+3.0000 mysql innodb_index_stats index_name varchar 64 192 utf8 utf8_bin varchar(64)
+NULL mysql innodb_index_stats last_update timestamp NULL NULL NULL NULL timestamp
+3.0000 mysql innodb_index_stats stat_name varchar 64 192 utf8 utf8_bin varchar(64)
+NULL mysql innodb_index_stats stat_value bigint NULL NULL NULL NULL bigint(20) unsigned
+NULL mysql innodb_index_stats sample_size bigint NULL NULL NULL NULL bigint(20) unsigned
+3.0000 mysql innodb_index_stats stat_description varchar 1024 3072 utf8 utf8_bin varchar(1024)
+3.0000 mysql innodb_table_stats database_name varchar 64 192 utf8 utf8_bin varchar(64)
+3.0000 mysql innodb_table_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
+NULL mysql innodb_table_stats last_update timestamp NULL NULL NULL NULL timestamp
+NULL mysql innodb_table_stats n_rows bigint NULL NULL NULL NULL bigint(20) unsigned
+NULL mysql innodb_table_stats clustered_index_size bigint NULL NULL NULL NULL bigint(20) unsigned
+NULL mysql innodb_table_stats sum_of_other_index_sizes bigint NULL NULL NULL NULL bigint(20) unsigned
3.0000 mysql plugin name varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 mysql plugin dl varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64)
@@ -497,6 +528,7 @@ NULL mysql slow_log insert_id int NULL NULL NULL NULL int(11)
NULL mysql slow_log server_id int NULL NULL NULL NULL int(10) unsigned
1.0000 mysql slow_log sql_text mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
NULL mysql slow_log thread_id bigint NULL NULL NULL NULL bigint(21) unsigned
+NULL mysql slow_log rows_affected int NULL NULL NULL NULL int(11)
3.0000 mysql tables_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql tables_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql tables_priv User char 80 240 utf8 utf8_bin char(80)
@@ -566,3 +598,5 @@ NULL mysql user max_user_connections int NULL NULL NULL NULL int(11)
1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text
3.0000 mysql user password_expired enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user is_role enum 1 3 utf8 utf8_general_ci enum('N','Y')
+3.0000 mysql user default_role char 80 240 utf8 utf8_bin char(80)
+NULL mysql user max_statement_time decimal NULL NULL NULL NULL decimal(12,6)
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 54f63a557e6..a69896c9b51 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
@@ -172,6 +172,7 @@ def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6)
def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6)
+def mysql slow_log rows_affected 13 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned
@@ -213,6 +214,7 @@ def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL NULL utf8 utf8_
def mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user default_role 45 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80)
def mysql user Delete_priv 7 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Drop_priv 9 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Event_priv 30 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
@@ -226,6 +228,7 @@ def mysql user is_role 44 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum
def mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user max_connections 39 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned
def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned
+def mysql user max_statement_time 46 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6)
def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned
def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql user Password 3 NO char 41 41 NULL NULL NULL latin1 latin1_bin char(41)
@@ -248,6 +251,9 @@ def mysql user Update_priv 6 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci e
def mysql user User 2 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI
def mysql user x509_issuer 35 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob
def mysql user x509_subject 36 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -269,6 +275,9 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 text utf8 utf8_bin
1.0000 mediumtext utf8 utf8_general_ci
1.0000 text utf8 utf8_general_ci
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
@@ -286,6 +295,9 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
3.0000 enum utf8 utf8_general_ci
3.0000 set utf8 utf8_general_ci
3.0000 varchar utf8 utf8_general_ci
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
@@ -304,6 +316,9 @@ NULL smallint NULL NULL
NULL time NULL NULL
NULL timestamp NULL NULL
NULL tinyint NULL NULL
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
@@ -497,6 +512,7 @@ NULL mysql slow_log insert_id int NULL NULL NULL NULL int(11)
NULL mysql slow_log server_id int NULL NULL NULL NULL int(10) unsigned
1.0000 mysql slow_log sql_text mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
NULL mysql slow_log thread_id bigint NULL NULL NULL NULL bigint(21) unsigned
+NULL mysql slow_log rows_affected int NULL NULL NULL NULL int(11)
3.0000 mysql tables_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql tables_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql tables_priv User char 80 240 utf8 utf8_bin char(80)
@@ -566,3 +582,8 @@ NULL mysql user max_user_connections int NULL NULL NULL NULL int(11)
1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text
3.0000 mysql user password_expired enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user is_role enum 1 3 utf8 utf8_general_ci enum('N','Y')
+3.0000 mysql user default_role char 80 240 utf8 utf8_bin char(80)
+NULL mysql user max_statement_time decimal NULL NULL NULL NULL decimal(12,6)
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
diff --git a/mysql-test/suite/funcs_1/r/is_engines_innodb,innodb_plugin.rdiff b/mysql-test/suite/funcs_1/r/is_engines_innodb,innodb_plugin.rdiff
deleted file mode 100644
index 6dcdfb85e3c..00000000000
--- a/mysql-test/suite/funcs_1/r/is_engines_innodb,innodb_plugin.rdiff
+++ /dev/null
@@ -1,11 +0,0 @@
---- suite/funcs_1/r/is_engines_innodb.result 2011-10-21 23:35:26.000000000 +0200
-+++ suite/funcs_1/r/is_engines_innodb.reject 2012-02-07 12:44:19.000000000 +0100
-@@ -2,7 +2,7 @@
- WHERE ENGINE = 'InnoDB';
- ENGINE InnoDB
- SUPPORT YES
--COMMENT Percona-XtraDB, Supports transactions, row-level locking, and foreign keys
-+COMMENT Supports transactions, row-level locking, and foreign keys
- TRANSACTIONS YES
- XA YES
- SAVEPOINTS YES
diff --git a/mysql-test/suite/funcs_1/r/is_engines_innodb.result b/mysql-test/suite/funcs_1/r/is_engines_innodb.result
index 5713b417cd1..b8c6399fe94 100644
--- a/mysql-test/suite/funcs_1/r/is_engines_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_engines_innodb.result
@@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'InnoDB';
ENGINE InnoDB
SUPPORT YES
-COMMENT Supports transactions, row-level locking, and foreign keys
+COMMENT Supports transactions, row-level locking, foreign keys and encryption for tables
TRANSACTIONS YES
XA YES
SAVEPOINTS YES
diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result
index a062e2d7b8f..525b5c92a68 100644
--- a/mysql-test/suite/funcs_1/r/is_routines.result
+++ b/mysql-test/suite/funcs_1/r/is_routines.result
@@ -1,3 +1,4 @@
+set sql_mode="";
SHOW TABLES FROM information_schema LIKE 'ROUTINES';
Tables_in_information_schema (ROUTINES)
ROUTINES
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index e800d9b63fd..7161b80792b 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -151,6 +151,9 @@ def mysql time_zone_transition_type mysql PRIMARY
def mysql time_zone_transition_type mysql PRIMARY
def mysql user mysql PRIMARY
def mysql user mysql PRIMARY
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
####################################################################################
# Testcase 3.2.14.2 + 3.2.14.3: INFORMATION_SCHEMA.STATISTICS accessible information
####################################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 1b4ad503b29..53fb95680e9 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -47,7 +47,7 @@ UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
-CREATE_OPTIONS varchar(255) YES NULL
+CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
SHOW CREATE TABLE information_schema.TABLES;
Table Create Table
@@ -71,7 +71,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
- `CREATE_OPTIONS` varchar(255) DEFAULT NULL,
+ `CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TABLES;
@@ -95,7 +95,7 @@ UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
-CREATE_OPTIONS varchar(255) YES NULL
+CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
SELECT table_catalog, table_schema, table_name
FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
diff --git a/mysql-test/suite/funcs_1/r/is_tables_innodb.result b/mysql-test/suite/funcs_1/r/is_tables_innodb.result
index bc984b1b6fe..204ee893fd8 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_innodb.result
@@ -7,11 +7,9 @@ CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -99,11 +97,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result
index 5ecac2f296f..daa3ce83ba2 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is.result
@@ -2,11 +2,9 @@ DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -292,6 +290,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME GEOMETRY_COLUMNS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_STATUS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -637,6 +658,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SPATIAL_REF_SYS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -660,6 +704,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SYSTEM_VARIABLES
+TABLE_TYPE SYSTEM VIEW
+ENGINE MYISAM_OR_MARIA
+VERSION 10
+ROW_FORMAT DYNAMIC_OR_PAGE
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -871,11 +938,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -1161,6 +1226,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME GEOMETRY_COLUMNS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_STATUS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1506,6 +1594,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SPATIAL_REF_SYS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1529,6 +1640,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SYSTEM_VARIABLES
+TABLE_TYPE SYSTEM VIEW
+ENGINE MYISAM_OR_MARIA
+VERSION 10
+ROW_FORMAT DYNAMIC_OR_PAGE
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
index 5ecac2f296f..daa3ce83ba2 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
@@ -2,11 +2,9 @@ DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -292,6 +290,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME GEOMETRY_COLUMNS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_STATUS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -637,6 +658,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SPATIAL_REF_SYS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -660,6 +704,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SYSTEM_VARIABLES
+TABLE_TYPE SYSTEM VIEW
+ENGINE MYISAM_OR_MARIA
+VERSION 10
+ROW_FORMAT DYNAMIC_OR_PAGE
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -871,11 +938,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -1161,6 +1226,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME GEOMETRY_COLUMNS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_STATUS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1506,6 +1594,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SPATIAL_REF_SYS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1529,6 +1640,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SYSTEM_VARIABLES
+TABLE_TYPE SYSTEM VIEW
+ENGINE MYISAM_OR_MARIA
+VERSION 10
+ROW_FORMAT DYNAMIC_OR_PAGE
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
diff --git a/mysql-test/suite/funcs_1/r/is_tables_memory.result b/mysql-test/suite/funcs_1/r/is_tables_memory.result
index 961fb98d573..acf6636cd38 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_memory.result
@@ -8,11 +8,9 @@ CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -100,11 +98,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam.result b/mysql-test/suite/funcs_1/r/is_tables_myisam.result
index 1afb80ca3d7..5ef3fbaafab 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_myisam.result
@@ -8,11 +8,9 @@ CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -100,11 +98,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
index ddf98bbded8..3ffa2662313 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
@@ -8,11 +8,9 @@ CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -100,11 +98,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
index 1eeaba15838..430c7fe2580 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -2,11 +2,9 @@ DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -708,11 +706,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
index 6c0b0db07eb..f1a6cc327b7 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
@@ -2,11 +2,9 @@ DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
@@ -708,11 +706,9 @@ GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
+IF(INSTR(table_comment,'InnoDB free') = 0,
LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
+INSTR(table_comment,'InnoDB free') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index 53bb54aa0f2..d6b5f3a42bf 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers.result
@@ -1,3 +1,4 @@
+set global sql_mode="";
SHOW TABLES FROM information_schema LIKE 'TRIGGERS';
Tables_in_information_schema (TRIGGERS)
TRIGGERS
@@ -228,3 +229,4 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP DATABASE db_datadict;
+set global sql_mode=default;
diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result
index 030d7152121..dfbe50ad862 100644
--- a/mysql-test/suite/funcs_1/r/is_user_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result
@@ -131,6 +131,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -175,6 +177,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -219,6 +223,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
#
# Add GRANT OPTION db_datadict.* to testuser1;
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
@@ -287,6 +293,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -331,6 +339,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -375,6 +385,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -429,6 +441,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -473,6 +487,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -517,6 +533,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -593,6 +611,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -637,6 +657,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -681,6 +703,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
#
# Here <SELECT YES> is shown correctly for testuser1;
@@ -749,6 +773,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -793,6 +819,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -837,6 +865,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -891,6 +921,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -935,6 +967,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -979,6 +1013,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
@@ -1085,6 +1121,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -1129,6 +1167,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -1173,6 +1213,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1274,6 +1316,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -1318,6 +1362,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -1362,6 +1408,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1416,6 +1464,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -1460,6 +1510,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -1504,6 +1556,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -1565,6 +1619,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -1609,6 +1665,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -1653,6 +1711,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -1729,6 +1789,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser2
Password
@@ -1773,6 +1835,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
Host localhost
User testuser3
Password
@@ -1817,6 +1881,8 @@ plugin
authentication_string
password_expired N
is_role N
+default_role
+max_statement_time 0.000000
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result
index ebb0e1ac091..12a46aeacce 100644
--- a/mysql-test/suite/funcs_1/r/is_views.result
+++ b/mysql-test/suite/funcs_1/r/is_views.result
@@ -38,6 +38,7 @@ DEFINER varchar(189) NO
SECURITY_TYPE varchar(7) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
+ALGORITHM varchar(10) NO
SHOW CREATE TABLE information_schema.VIEWS;
Table Create Table
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
@@ -50,7 +51,8 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` (
`DEFINER` varchar(189) NOT NULL DEFAULT '',
`SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
- `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT ''
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `ALGORITHM` varchar(10) NOT NULL DEFAULT ''
) DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.VIEWS;
Field Type Null Key Default Extra
@@ -64,6 +66,7 @@ DEFINER varchar(189) NO
SECURITY_TYPE varchar(7) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
+ALGORITHM varchar(10) NO
SELECT table_catalog, table_schema, table_name
FROM information_schema.views WHERE table_catalog IS NOT NULL;
table_catalog table_schema table_name
@@ -87,24 +90,24 @@ GRANT SELECT ON db_datadict.v_granted_to_1 TO 'testuser1'@'localhost';
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost';
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def db_datadict v_granted_glob select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
-def db_datadict v_granted_to_1 select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def db_datadict v_granted_glob select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def db_datadict v_granted_to_1 select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
# Establish connection testuser2 (user=testuser2)
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
-def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
# Establish connection test_no_views (user=test_no_views)
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
# Switch to connection default and close all other connections
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
@@ -123,12 +126,18 @@ DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
SELECT * FROM information_schema.views
WHERE table_name LIKE 't1_%';
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table;
+CREATE ALGORITHM=MERGE VIEW test.t1_view1 AS SELECT f1 FROM test.t1_table;
+CREATE ALGORITHM=TEMPTABLE VIEW test.t1_view2 AS SELECT f1 FROM test.t1_table;
SELECT * FROM information_schema.views
WHERE table_name LIKE 't1_%';
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-def test t1_view select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
+def test t1_view select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+def test t1_view1 select `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci MERGE
+def test t1_view2 select `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci TEMPTABLE
+DROP VIEW test.t1_view1;
+DROP VIEW test.t1_view2;
SELECT table_name,definer FROM information_schema.views
WHERE table_name = 't1_view';
table_name definer
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 623fb38ef50..df57c83164e 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -14,8 +14,8 @@ ALTER TABLE t1_values ADD my_binary_30 BINARY(30);
ALTER TABLE t1_values ADD my_varbinary_1000 VARBINARY(1000);
ALTER TABLE t1_values ADD my_datetime DATETIME;
ALTER TABLE t1_values ADD my_date DATE;
-ALTER TABLE t1_values ADD ts_dummy TIMESTAMP;
-ALTER TABLE t1_values ADD my_timestamp TIMESTAMP;
+ALTER TABLE t1_values ADD ts_dummy TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+ALTER TABLE t1_values ADD my_timestamp TIMESTAMP NOT NULL DEFAULT '2001-01-01 10:20:30';
ALTER TABLE t1_values ADD my_time TIME;
ALTER TABLE t1_values ADD my_year YEAR;
ALTER TABLE t1_values ADD my_bigint BIGINT;
@@ -1277,7 +1277,7 @@ SELECT IFNULL(my_timestamp,'IS_NULL'),
my_timestamp, id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL order by id;
IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -1289,7 +1289,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL) order by id;
IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -1596,7 +1596,7 @@ SELECT IF(my_timestamp IS NULL, 'IS NULL',
WHERE select_id = 124 OR select_id IS NULL order by id;
IF(my_timestamp IS NULL, 'IS NULL',
'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
+IS NOT NULL 2001-01-01 10:20:30 1
IS NOT NULL 1970-01-01 14:00:01 2
IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
@@ -1610,7 +1610,7 @@ WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 124 OR select_id IS NULL) order by id;
IF(my_timestamp IS NULL, 'IS NULL',
'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
+IS NOT NULL 2001-01-01 10:20:30 1
IS NOT NULL 1970-01-01 14:00:01 2
IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
@@ -1937,7 +1937,7 @@ SELECT IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE'),
my_timestamp, id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL order by id;
IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
+IS TRUE 2001-01-01 10:20:30 1
IS TRUE 1970-01-01 14:00:01 2
IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
@@ -1949,7 +1949,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL) order by id;
IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
+IS TRUE 2001-01-01 10:20:30 1
IS TRUE 1970-01-01 14:00:01 2
IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
@@ -2099,8 +2099,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
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 if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2114,8 +2115,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
DROP VIEW v1;
@@ -2167,8 +2169,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2182,8 +2185,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2199,6 +2203,7 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' '
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
@@ -2214,6 +2219,7 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' '
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2282,6 +2288,8 @@ NULL NULL 1
<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
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 convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2294,6 +2302,8 @@ NULL NULL 1
<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
DROP VIEW v1;
@@ -2308,6 +2318,8 @@ NULL NULL 1
<--------30 characters-------> <--------30 characters-------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
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 convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2320,6 +2332,8 @@ NULL NULL 1
<--------30 characters-------> <--------30 characters-------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
DROP VIEW v1;
@@ -2489,7 +2503,7 @@ SELECT CAST(my_timestamp AS UNSIGNED INTEGER),
my_timestamp, id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2501,7 +2515,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL) order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2867,7 +2881,7 @@ SELECT CAST(my_timestamp AS SIGNED INTEGER),
my_timestamp, id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2879,7 +2893,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL) order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -3225,7 +3239,7 @@ SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL order by id;
CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
-0.00 0000-00-00 00:00:00 1
+20010101102030.00 2001-01-01 10:20:30 1
19700101140001.00 1970-01-01 14:00:01 2
20380101025959.00 2038-01-01 02:59:59 3
20040229235959.00 2004-02-29 23:59:59 4
@@ -3237,7 +3251,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
-0.00 0000-00-00 00:00:00 1
+20010101102030.00 2001-01-01 10:20:30 1
19700101140001.00 1970-01-01 14:00:01 2
20380101025959.00 2038-01-01 02:59:59 3
20040229235959.00 2004-02-29 23:59:59 4
@@ -3617,7 +3631,7 @@ SELECT CAST(my_timestamp AS TIME),
my_timestamp, id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL order by id;
CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
+10:20:30 2001-01-01 10:20:30 1
14:00:01 1970-01-01 14:00:01 2
02:59:59 2038-01-01 02:59:59 3
23:59:59 2004-02-29 23:59:59 4
@@ -3629,7 +3643,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL) order by id;
CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
+10:20:30 2001-01-01 10:20:30 1
14:00:01 1970-01-01 14:00:01 2
02:59:59 2038-01-01 02:59:59 3
23:59:59 2004-02-29 23:59:59 4
@@ -3730,14 +3744,14 @@ my_bigint, id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL order by id;
CAST(my_bigint AS TIME) my_bigint id
NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
+-838:59:59 -9223372036854775808 2
+838:59:59 9223372036854775807 3
00:00:00 0 4
-00:00:01 -1 5
00:17:58 1758 24
Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
+Warning 1292 Incorrect time value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect time value: '9223372036854775807' for column 'my_bigint' 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_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3746,14 +3760,14 @@ WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL) order by id;
CAST(my_bigint AS TIME) my_bigint id
NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
+-838:59:59 -9223372036854775808 2
+838:59:59 9223372036854775807 3
00:00:00 0 4
-00:00:01 -1 5
00:17:58 1758 24
Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
+Warning 1292 Incorrect time value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect time value: '9223372036854775807' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -3963,7 +3977,7 @@ SELECT CAST(my_timestamp AS DATETIME),
my_timestamp, id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL order by id;
CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -3975,7 +3989,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4082,15 +4096,14 @@ CAST(my_bigint AS DATETIME) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 00:00:00 0 4
NULL -1 5
NULL 200506271758 18
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 3
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 5
+Warning 1292 Incorrect datetime value: '200506271758' for column 'my_bigint' at row 6
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_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -4101,15 +4114,14 @@ CAST(my_bigint AS DATETIME) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 00:00:00 0 4
NULL -1 5
NULL 200506271758 18
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '200506271758' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -4325,7 +4337,7 @@ SELECT CAST(my_timestamp AS DATE),
my_timestamp, id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL order by id;
CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
+2001-01-01 2001-01-01 10:20:30 1
1970-01-01 1970-01-01 14:00:01 2
2038-01-01 2038-01-01 02:59:59 3
2004-02-29 2004-02-29 23:59:59 4
@@ -4337,7 +4349,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
+2001-01-01 2001-01-01 10:20:30 1
1970-01-01 1970-01-01 14:00:01 2
2038-01-01 2038-01-01 02:59:59 3
2004-02-29 2004-02-29 23:59:59 4
@@ -4442,14 +4454,13 @@ CAST(my_bigint AS DATE) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 0 4
NULL -1 5
2005-06-27 20050627 12
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 3
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 5
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_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -4460,14 +4471,13 @@ CAST(my_bigint AS DATE) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 0 4
NULL -1 5
2005-06-27 20050627 12
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -4683,7 +4693,7 @@ SELECT CAST(my_timestamp AS CHAR),
my_timestamp, id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL order by id;
CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4695,7 +4705,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL) order by id;
CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4995,7 +5005,7 @@ SELECT CAST(my_timestamp AS BINARY),
my_timestamp, id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL order by id;
CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -5007,7 +5017,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL) order by id;
CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
index f08165b21f8..c38481bac50 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
@@ -1,4 +1,5 @@
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+set GLOBAL sql_mode="";
--source suite/funcs_1/storedproc/load_sp_tb.inc
--------------------------------------------------------------------------------
@@ -389,6 +390,7 @@ DROP USER 'user_2'@'localhost';
--------------------------------------------------------------------------------
DROP DATABASE IF EXISTS db_storedproc;
DROP DATABASE IF EXISTS db_storedproc_1;
+set GLOBAL sql_mode=default;
. +++ END OF SCRIPT +++
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
index 5f05f7c0af5..cfa839b382c 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -450,8 +450,8 @@ create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
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 2146c74b72e..7f3277f55e1 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
@@ -1,4 +1,5 @@
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+set GLOBAL sql_mode="";
USE test;
drop table if exists tb3;
create table tb3 (
@@ -469,3 +470,4 @@ drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
+set GLOBAL sql_mode=default;
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 d19507e5f4d..4632cfe269c 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result
@@ -1,4 +1,5 @@
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+set GLOBAL sql_mode="";
USE test;
drop table if exists tb3;
create table tb3 (
@@ -522,3 +523,4 @@ drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
+set GLOBAL sql_mode=default;
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 0795c3be36f..5394aa01bf6 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_09.result
@@ -190,8 +190,6 @@ Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
Warnings:
Warning 1048 Column 'f136' cannot be null
-Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
-where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
@@ -199,7 +197,7 @@ a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-a NULL Test 3.5.9.4-trig 0 999 NULL
+a NULL Test 3.5.9.4-trig NULL 999 NULL
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index 9f8ec11a7d8..995787aba84 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -22034,7 +22034,7 @@ Testcase 3.3.2.1 - 3.3.2.6 alternative implementation
--------------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
-CREATE TABLE t1 ( f1 BIGINT, f2 CHAR(20), f3 NUMERIC(7,4),
+CREATE TABLE t1 ( f1 BIGINT DEFAULT 0, f2 CHAR(20), f3 NUMERIC(7,4),
f4 CHAR, PRIMARY KEY(f1));
CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
INSERT INTO v1 SET f1 = 1;
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 623fb38ef50..df57c83164e 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -14,8 +14,8 @@ ALTER TABLE t1_values ADD my_binary_30 BINARY(30);
ALTER TABLE t1_values ADD my_varbinary_1000 VARBINARY(1000);
ALTER TABLE t1_values ADD my_datetime DATETIME;
ALTER TABLE t1_values ADD my_date DATE;
-ALTER TABLE t1_values ADD ts_dummy TIMESTAMP;
-ALTER TABLE t1_values ADD my_timestamp TIMESTAMP;
+ALTER TABLE t1_values ADD ts_dummy TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+ALTER TABLE t1_values ADD my_timestamp TIMESTAMP NOT NULL DEFAULT '2001-01-01 10:20:30';
ALTER TABLE t1_values ADD my_time TIME;
ALTER TABLE t1_values ADD my_year YEAR;
ALTER TABLE t1_values ADD my_bigint BIGINT;
@@ -1277,7 +1277,7 @@ SELECT IFNULL(my_timestamp,'IS_NULL'),
my_timestamp, id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL order by id;
IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -1289,7 +1289,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL) order by id;
IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -1596,7 +1596,7 @@ SELECT IF(my_timestamp IS NULL, 'IS NULL',
WHERE select_id = 124 OR select_id IS NULL order by id;
IF(my_timestamp IS NULL, 'IS NULL',
'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
+IS NOT NULL 2001-01-01 10:20:30 1
IS NOT NULL 1970-01-01 14:00:01 2
IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
@@ -1610,7 +1610,7 @@ WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 124 OR select_id IS NULL) order by id;
IF(my_timestamp IS NULL, 'IS NULL',
'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
+IS NOT NULL 2001-01-01 10:20:30 1
IS NOT NULL 1970-01-01 14:00:01 2
IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
@@ -1937,7 +1937,7 @@ SELECT IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE'),
my_timestamp, id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL order by id;
IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
+IS TRUE 2001-01-01 10:20:30 1
IS TRUE 1970-01-01 14:00:01 2
IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
@@ -1949,7 +1949,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL) order by id;
IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
+IS TRUE 2001-01-01 10:20:30 1
IS TRUE 1970-01-01 14:00:01 2
IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
@@ -2099,8 +2099,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
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 if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2114,8 +2115,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
DROP VIEW v1;
@@ -2167,8 +2169,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2182,8 +2185,9 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2199,6 +2203,7 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' '
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
@@ -2214,6 +2219,7 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ' '
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2282,6 +2288,8 @@ NULL NULL 1
<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
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 convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2294,6 +2302,8 @@ NULL NULL 1
<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
DROP VIEW v1;
@@ -2308,6 +2318,8 @@ NULL NULL 1
<--------30 characters-------> <--------30 characters-------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
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 convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2320,6 +2332,8 @@ NULL NULL 1
<--------30 characters-------> <--------30 characters-------> 3
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
+Warnings:
+Warning 1977 Cannot convert 'latin1' character 0xC3 to 'koi8r'
DROP VIEW v1;
@@ -2489,7 +2503,7 @@ SELECT CAST(my_timestamp AS UNSIGNED INTEGER),
my_timestamp, id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2501,7 +2515,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL) order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2867,7 +2881,7 @@ SELECT CAST(my_timestamp AS SIGNED INTEGER),
my_timestamp, id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -2879,7 +2893,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL) order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
-0 0000-00-00 00:00:00 1
+20010101102030 2001-01-01 10:20:30 1
19700101140001 1970-01-01 14:00:01 2
20380101025959 2038-01-01 02:59:59 3
20040229235959 2004-02-29 23:59:59 4
@@ -3225,7 +3239,7 @@ SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL order by id;
CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
-0.00 0000-00-00 00:00:00 1
+20010101102030.00 2001-01-01 10:20:30 1
19700101140001.00 1970-01-01 14:00:01 2
20380101025959.00 2038-01-01 02:59:59 3
20040229235959.00 2004-02-29 23:59:59 4
@@ -3237,7 +3251,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
-0.00 0000-00-00 00:00:00 1
+20010101102030.00 2001-01-01 10:20:30 1
19700101140001.00 1970-01-01 14:00:01 2
20380101025959.00 2038-01-01 02:59:59 3
20040229235959.00 2004-02-29 23:59:59 4
@@ -3617,7 +3631,7 @@ SELECT CAST(my_timestamp AS TIME),
my_timestamp, id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL order by id;
CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
+10:20:30 2001-01-01 10:20:30 1
14:00:01 1970-01-01 14:00:01 2
02:59:59 2038-01-01 02:59:59 3
23:59:59 2004-02-29 23:59:59 4
@@ -3629,7 +3643,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL) order by id;
CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
+10:20:30 2001-01-01 10:20:30 1
14:00:01 1970-01-01 14:00:01 2
02:59:59 2038-01-01 02:59:59 3
23:59:59 2004-02-29 23:59:59 4
@@ -3730,14 +3744,14 @@ my_bigint, id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL order by id;
CAST(my_bigint AS TIME) my_bigint id
NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
+-838:59:59 -9223372036854775808 2
+838:59:59 9223372036854775807 3
00:00:00 0 4
-00:00:01 -1 5
00:17:58 1758 24
Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
+Warning 1292 Incorrect time value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect time value: '9223372036854775807' for column 'my_bigint' 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_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3746,14 +3760,14 @@ WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL) order by id;
CAST(my_bigint AS TIME) my_bigint id
NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
+-838:59:59 -9223372036854775808 2
+838:59:59 9223372036854775807 3
00:00:00 0 4
-00:00:01 -1 5
00:17:58 1758 24
Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
+Warning 1292 Incorrect time value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect time value: '9223372036854775807' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -3963,7 +3977,7 @@ SELECT CAST(my_timestamp AS DATETIME),
my_timestamp, id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL order by id;
CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -3975,7 +3989,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4082,15 +4096,14 @@ CAST(my_bigint AS DATETIME) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 00:00:00 0 4
NULL -1 5
NULL 200506271758 18
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 3
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 5
+Warning 1292 Incorrect datetime value: '200506271758' for column 'my_bigint' at row 6
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_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -4101,15 +4114,14 @@ CAST(my_bigint AS DATETIME) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 00:00:00 0 4
NULL -1 5
NULL 200506271758 18
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '200506271758' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -4325,7 +4337,7 @@ SELECT CAST(my_timestamp AS DATE),
my_timestamp, id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL order by id;
CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
+2001-01-01 2001-01-01 10:20:30 1
1970-01-01 1970-01-01 14:00:01 2
2038-01-01 2038-01-01 02:59:59 3
2004-02-29 2004-02-29 23:59:59 4
@@ -4337,7 +4349,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL) order by id;
CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
+2001-01-01 2001-01-01 10:20:30 1
1970-01-01 1970-01-01 14:00:01 2
2038-01-01 2038-01-01 02:59:59 3
2004-02-29 2004-02-29 23:59:59 4
@@ -4442,14 +4454,13 @@ CAST(my_bigint AS DATE) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 0 4
NULL -1 5
2005-06-27 20050627 12
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 2
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 3
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 5
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_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -4460,14 +4471,13 @@ CAST(my_bigint AS DATE) my_bigint id
NULL NULL 1
NULL -9223372036854775808 2
NULL 9223372036854775807 3
-NULL 0 4
+0000-00-00 0 4
NULL -1 5
2005-06-27 20050627 12
Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
+Warning 1292 Incorrect datetime value: '-9223372036854775808' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '9223372036854775807' for column 'my_bigint' at row 1
+Warning 1292 Incorrect datetime value: '-1' for column 'my_bigint' at row 1
DROP VIEW v1;
@@ -4683,7 +4693,7 @@ SELECT CAST(my_timestamp AS CHAR),
my_timestamp, id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL order by id;
CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4695,7 +4705,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL) order by id;
CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -4995,7 +5005,7 @@ SELECT CAST(my_timestamp AS BINARY),
my_timestamp, id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL order by id;
CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
@@ -5007,7 +5017,7 @@ SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL) order by id;
CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
+2001-01-01 10:20:30 2001-01-01 10:20:30 1
1970-01-01 14:00:01 1970-01-01 14:00:01 2
2038-01-01 02:59:59 2038-01-01 02:59:59 3
2004-02-29 23:59:59 2004-02-29 23:59:59 4
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
index f08165b21f8..c38481bac50 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
@@ -1,4 +1,5 @@
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+set GLOBAL sql_mode="";
--source suite/funcs_1/storedproc/load_sp_tb.inc
--------------------------------------------------------------------------------
@@ -389,6 +390,7 @@ DROP USER 'user_2'@'localhost';
--------------------------------------------------------------------------------
DROP DATABASE IF EXISTS db_storedproc;
DROP DATABASE IF EXISTS db_storedproc_1;
+set GLOBAL sql_mode=default;
. +++ END OF SCRIPT +++
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
index c34525a52f8..fd796dd4550 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -450,8 +450,8 @@ create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
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 2146c74b72e..7f3277f55e1 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
@@ -1,4 +1,5 @@
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+set GLOBAL sql_mode="";
USE test;
drop table if exists tb3;
create table tb3 (
@@ -469,3 +470,4 @@ drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
+set GLOBAL sql_mode=default;
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 d19507e5f4d..4632cfe269c 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
@@ -1,4 +1,5 @@
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+set GLOBAL sql_mode="";
USE test;
drop table if exists tb3;
create table tb3 (
@@ -522,3 +523,4 @@ drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
+set GLOBAL sql_mode=default;
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 0795c3be36f..5394aa01bf6 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_09.result
@@ -190,8 +190,6 @@ Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
Warnings:
Warning 1048 Column 'f136' cannot be null
-Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
-where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
@@ -199,7 +197,7 @@ a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-a NULL Test 3.5.9.4-trig 0 999 NULL
+a NULL Test 3.5.9.4-trig NULL 999 NULL
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result
index 9f5adc15b7f..0e0bede7257 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views-big.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result
@@ -23736,7 +23736,7 @@ Testcase 3.3.2.1 - 3.3.2.6 alternative implementation
--------------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
-CREATE TABLE t1 ( f1 BIGINT, f2 CHAR(20), f3 NUMERIC(7,4),
+CREATE TABLE t1 ( f1 BIGINT DEFAULT 0, f2 CHAR(20), f3 NUMERIC(7,4),
f4 CHAR, PRIMARY KEY(f1));
CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
INSERT INTO v1 SET f1 = 1;
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index 50599fd42b0..ee7468ff5ba 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -36,28 +36,30 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID root HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID root HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID root HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
+ID root HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -112,25 +114,27 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
@@ -181,8 +185,8 @@ SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
@@ -196,14 +200,15 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
####################################################################################
+create user ''@'localhost';
GRANT PROCESS ON *.* TO ''@'localhost';
####################################################################################
5.1 Establish connection (anonymous1,localhost,'',,information_schema)
@@ -220,11 +225,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -244,10 +249,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -262,9 +267,9 @@ SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -284,11 +289,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -310,12 +315,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -364,18 +369,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -393,9 +398,9 @@ Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -422,15 +427,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -458,16 +463,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index 63d2aa4d03e..c3c6780a09c 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -36,28 +36,30 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
+ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -112,25 +114,27 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
@@ -181,8 +185,8 @@ SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
@@ -196,14 +200,15 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
####################################################################################
+create user ''@'localhost';
GRANT PROCESS ON *.* TO ''@'localhost';
####################################################################################
5.1 Establish connection (anonymous1,localhost,'',,information_schema)
@@ -220,11 +225,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -244,10 +249,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -262,9 +267,9 @@ SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -284,11 +289,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -310,12 +315,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -364,18 +369,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -393,9 +398,9 @@ Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -422,15 +427,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -458,16 +463,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL TID
####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
index 37618673bbf..acf81d090d1 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
@@ -26,14 +26,16 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
# Ensure that the information about the own connection is correct.
#--------------------------------------------------------------------------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> root <HOST_NAME> test Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> root <HOST_NAME> test Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> test Query <TIME> init SHOW FULL PROCESSLIST <TIME_MS>
@@ -79,9 +81,9 @@ Has TIME a reasonable value?
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema Query <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Query <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -113,8 +115,8 @@ Expect 1
# ----- switch to connection con1 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -130,9 +132,9 @@ Id User Host db Command Time State Info Progress
# ----- switch to connection con2 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
@@ -156,10 +158,10 @@ SELECT sleep(10), 17;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT sleep(10), 17 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -203,10 +205,10 @@ SELECT COUNT(*) FROM test.t1;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT COUNT(*) FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
# ----- switch to connection con2 (user = test_user) -----
@@ -237,10 +239,10 @@ SELECT count(*),'BEGIN-This is the representative of a very long statement.This
# SHOW PROCESSLIST statement truncated after 100 char
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SHOW FULL PROCESSLIST 0.000
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
index 98fef45cd37..8e5ef80fcf7 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
@@ -26,14 +26,16 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
`MEMORY_USED` int(7) NOT NULL DEFAULT '0',
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
- `QUERY_ID` bigint(4) NOT NULL DEFAULT '0'
+ `QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
+ `INFO_BINARY` blob,
+ `TID` bigint(4) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
# Ensure that the information about the own connection is correct.
#--------------------------------------------------------------------------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> root <HOST_NAME> test Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> root <HOST_NAME> test Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> test Query <TIME> init SHOW FULL PROCESSLIST <TIME_MS>
@@ -79,9 +81,9 @@ Has TIME a reasonable value?
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema Execute <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Execute <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -113,8 +115,8 @@ Expect 1
# ----- switch to connection con1 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -130,9 +132,9 @@ Id User Host db Command Time State Info Progress
# ----- switch to connection con2 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
@@ -156,10 +158,10 @@ SELECT sleep(10), 17;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT sleep(10), 17 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -203,10 +205,10 @@ SELECT COUNT(*) FROM test.t1;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT COUNT(*) FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
# ----- switch to connection con2 (user = test_user) -----
@@ -237,10 +239,10 @@ SELECT count(*),'BEGIN-This is the representative of a very long statement.This
# SHOW PROCESSLIST statement truncated after 100 char
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
-<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SHOW FULL PROCESSLIST 0.000
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 4ec9bfbd512..f0e1ee74e0b 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -1,3 +1,4 @@
+set sql_mode="";
--source suite/funcs_1/storedproc/load_sp_tb.inc
--------------------------------------------------------------------------------
@@ -142,7 +143,7 @@ BEGIN
SET @v1 = f1;
SELECT @v1;
END//
-ERROR 42000: Too big precision 256 specified for ''. Maximum is 65.
+ERROR 42000: Too big precision 256 specified for 'f1'. Maximum is 65.
DROP PROCEDURE IF EXISTS sp1//
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
@@ -152,7 +153,7 @@ BEGIN
SET @v1 = f1;
SELECT @v1;
END//
-ERROR 42000: Too big precision 66 specified for ''. Maximum is 65.
+ERROR 42000: Too big precision 66 specified for 'f1'. Maximum is 65.
DROP PROCEDURE IF EXISTS sp1//
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
@@ -1407,12 +1408,12 @@ BEGIN
SELECT f1;
END//
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
+Note 1291 Column 'f1' has duplicated value 'value1' in ENUM
CALL sp1( "value1" );
f1
value1
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
+Note 1291 Column 'f1' has duplicated value 'value1' in ENUM
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
@@ -1423,12 +1424,12 @@ BEGIN
SELECT f1;
END//
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
+Note 1291 Column 'f1' has duplicated value 'value1' in SET
CALL sp1( "value1, value1" );
f1
value1
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
+Note 1291 Column 'f1' has duplicated value 'value1' in SET
Warning 1265 Data truncated for column 'f1' at row 1
SHOW PROCEDURE STATUS WHERE db = 'db_storedproc';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
@@ -1440,12 +1441,12 @@ BEGIN
SELECT f1;
END//
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
+Note 1291 Column 'f1' has duplicated value 'value1' in ENUM
CALL sp1( "value1" );
f1
value1
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
+Note 1291 Column 'f1' has duplicated value 'value1' in ENUM
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
@@ -1548,7 +1549,7 @@ BEGIN
SET f1 = 1000000 + f1;
RETURN f1;
END//
-ERROR 42000: Too big scale 31 specified for ''. Maximum is 30.
+ERROR 42000: Too big scale 31 specified for 'f1'. Maximum is 30.
SELECT fn1( 1.3326e+8 );
ERROR 42000: FUNCTION db_storedproc.fn1 does not exist
CREATE FUNCTION fn1( f1 DECIMAL(63, 30) ) RETURNS DECIMAL(63, 30)
@@ -1570,7 +1571,7 @@ BEGIN
RETURN f1;
END//
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
+Note 1291 Column 'f1' has duplicated value 'value1' in ENUM
SELECT fn1( "value1" );
fn1( "value1" )
1.000000000000000000000000000000
@@ -1584,7 +1585,7 @@ BEGIN
RETURN f1;
END//
Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
+Note 1291 Column 'f1' has duplicated value 'value1' in SET
SELECT fn1( "value1, value1" );
fn1( "value1, value1" )
1.000000000000000000000000000000
@@ -2262,7 +2263,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE if()
SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'if()
+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 '()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE ignore()
SELECT * from t1 where f2=f1;
@@ -3119,10 +3120,7 @@ return f1;
DROP FUNCTION IF EXISTS fn1;
CREATE FUNCTION fn1(f1 char binary ) returns char binary
return f1;
-ERROR 42000: This version of MariaDB doesn't yet support 'return value collation'
DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION db_storedproc.fn1 does not exist
CREATE FUNCTION fn1(f1 char ascii ) returns char ascii
return f1;
DROP FUNCTION IF EXISTS fn1;
@@ -5836,7 +5834,7 @@ fetch cur1 into e;
SELECT x, y, z, a, b, c, d, e;
close cur1;
END//
-ERROR 42000: Too big scale 255 specified for ''. Maximum is 30.
+ERROR 42000: Too big scale 255 specified for 'b'. Maximum is 30.
CALL sp6();
ERROR 42000: PROCEDURE db_storedproc.sp6 does not exist
DROP PROCEDURE IF EXISTS sp6;
@@ -13872,7 +13870,7 @@ CALL sp1();
xx
0
Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
+Warning 1366 Incorrect double value: 'asd' for column 'xx' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
index 3e5ca055ae1..c4f8496fd06 100644
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
@@ -4,6 +4,8 @@
# privileges.
--source include/not_embedded.inc
+set GLOBAL sql_mode="";
+
--source suite/funcs_1/storedproc/load_sp_tb.inc
# ==============================================================================
@@ -451,6 +453,7 @@ DROP USER 'user_2'@'localhost';
# USE the same .inc to cleanup before and after the test
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
+set GLOBAL sql_mode=default;
# ==============================================================================
--echo
--echo . +++ END OF SCRIPT +++
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
index ce061da2299..7bfc3153a61 100644
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
@@ -4,6 +4,7 @@
--source include/have_innodb.inc
# 2. Set $engine_type
+set sql_mode="";
let $engine_type= innodb;
--source suite/funcs_1/storedproc/storedproc_06.inc
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
index c8c289c5f49..39c983ad2a0 100644
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
@@ -4,6 +4,7 @@
--source include/have_innodb.inc
# 2. Set $engine_type
+set sql_mode="";
let $engine_type= innodb;
--source suite/funcs_1/storedproc/storedproc_08.inc
diff --git a/mysql-test/suite/funcs_1/t/innodb_trig_03.test b/mysql-test/suite/funcs_1/t/innodb_trig_03.test
index 2a611c97fbf..f2a8fa3c1d9 100644
--- a/mysql-test/suite/funcs_1/t/innodb_trig_03.test
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_03.test
@@ -5,6 +5,7 @@
# 1. Check if InnoDB is available
--source include/have_innodb.inc
# 2. Set $engine_type
+set sql_mode="";
let $engine_type= innodb;
--source suite/funcs_1/triggers/triggers_03.inc
diff --git a/mysql-test/suite/funcs_1/t/innodb_trig_0407.test b/mysql-test/suite/funcs_1/t/innodb_trig_0407.test
index d8081770f4b..dddb000cf18 100644
--- a/mysql-test/suite/funcs_1/t/innodb_trig_0407.test
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_0407.test
@@ -5,6 +5,7 @@
# 1. Check if InnoDB is available
--source include/have_innodb.inc
# 2. Set $engine_type
+set sql_mode="";
let $engine_type= innodb;
--source suite/funcs_1/triggers/triggers_0407.inc
diff --git a/mysql-test/suite/funcs_1/t/innodb_trig_08.test b/mysql-test/suite/funcs_1/t/innodb_trig_08.test
index ba48b977ba2..c870c1a7895 100644
--- a/mysql-test/suite/funcs_1/t/innodb_trig_08.test
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_08.test
@@ -5,6 +5,7 @@
# 1. Check if InnoDB is available
--source include/have_innodb.inc
# 2. Set $engine_type
+set sql_mode="";
let $engine_type= innodb;
--source suite/funcs_1/triggers/triggers_08.inc
diff --git a/mysql-test/suite/funcs_1/t/is_columns_mysql.test b/mysql-test/suite/funcs_1/t/is_columns_mysql.test
index a844e18f5be..0566241bd20 100644
--- a/mysql-test/suite/funcs_1/t/is_columns_mysql.test
+++ b/mysql-test/suite/funcs_1/t/is_columns_mysql.test
@@ -13,6 +13,7 @@
#
--source include/not_embedded.inc
+--source include/have_innodb.inc
let $my_where = WHERE table_schema = 'mysql';
--source suite/funcs_1/datadict/columns.inc
diff --git a/mysql-test/suite/funcs_1/t/storedproc.test b/mysql-test/suite/funcs_1/t/storedproc.test
index 69406a57a00..ca9dfcbbe2d 100644
--- a/mysql-test/suite/funcs_1/t/storedproc.test
+++ b/mysql-test/suite/funcs_1/t/storedproc.test
@@ -9,6 +9,7 @@
# - restore global sort_buffer_size after some subtest
#
############################################################################
+set sql_mode="";
# Bug#37746 - Arithmetic range ("int") is smaller than expected
# This code is in place to ensure this test is only skipped
@@ -2155,7 +2156,6 @@ CREATE FUNCTION fn1(f1 char ) returns char
return f1;
DROP FUNCTION IF EXISTS fn1;
---error ER_NOT_SUPPORTED_YET
CREATE FUNCTION fn1(f1 char binary ) returns char binary
return f1;
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_0407.inc b/mysql-test/suite/funcs_1/triggers/triggers_0407.inc
index 2bc9dd66478..907260a00f0 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_0407.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_0407.inc
@@ -3,6 +3,7 @@
# Trigger Tests
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
+set GLOBAL sql_mode="";
USE test;
--source suite/funcs_1/include/tb3.inc
@@ -622,3 +623,6 @@ let $message= Testcase 3.5.7.17 (see Testcase 3.5.1.1);
drop user test_super@localhost;
DROP TABLE test.tb3;
+
+
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_08.inc b/mysql-test/suite/funcs_1/triggers/triggers_08.inc
index 996a5aa69ae..0aeb46896a6 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_08.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_08.inc
@@ -4,6 +4,7 @@
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
# WL#4084: enable disabled parts, 2007-11-15 hhunger
+set GLOBAL sql_mode="";
USE test;
--source suite/funcs_1/include/tb3.inc
@@ -557,3 +558,4 @@ let $message= Testcase 3.5.8.7;
drop user test_super@localhost;
DROP TABLE test.tb3;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_09.inc b/mysql-test/suite/funcs_1/triggers/triggers_09.inc
index 47277afb63c..e9e6af92994 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_09.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_09.inc
@@ -186,9 +186,6 @@ let $message= Testcase 3.5.9.4:;
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
- Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
- where f122='Test 3.5.9.4';
-
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
index a5388dc80c3..dd8b2a87cd8 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
@@ -410,8 +410,6 @@ let $message= Testcase y.y.y.5: Rollback of nested trigger references;
set autocommit=0;
start transaction;
-# Bug#32656 NDB: Duplicate key error aborts transaction in handler.
-# Doesn't talk back to SQL
--error ER_WARN_DATA_OUT_OF_RANGE
insert into t1 values (1);
commit;
diff --git a/mysql-test/suite/funcs_1/views/func_view.inc b/mysql-test/suite/funcs_1/views/func_view.inc
index 1f0b0ac52a7..64ba69a02bd 100644
--- a/mysql-test/suite/funcs_1/views/func_view.inc
+++ b/mysql-test/suite/funcs_1/views/func_view.inc
@@ -209,8 +209,8 @@ ALTER TABLE t1_values ADD my_binary_30 BINARY(30);
ALTER TABLE t1_values ADD my_varbinary_1000 VARBINARY(1000);
ALTER TABLE t1_values ADD my_datetime DATETIME;
ALTER TABLE t1_values ADD my_date DATE;
-ALTER TABLE t1_values ADD ts_dummy TIMESTAMP;
-ALTER TABLE t1_values ADD my_timestamp TIMESTAMP;
+ALTER TABLE t1_values ADD ts_dummy TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+ALTER TABLE t1_values ADD my_timestamp TIMESTAMP NOT NULL DEFAULT '2001-01-01 10:20:30';
ALTER TABLE t1_values ADD my_time TIME;
ALTER TABLE t1_values ADD my_year YEAR;
ALTER TABLE t1_values ADD my_bigint BIGINT;
diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc
index 1743bace705..bb9bbdb06d0 100644
--- a/mysql-test/suite/funcs_1/views/views_master.inc
+++ b/mysql-test/suite/funcs_1/views/views_master.inc
@@ -1,9 +1,6 @@
#### suite/funcs_1/views/views_master.test
#
# Last Change:
-# 2007-10-05 mleich
-# 1. Fix for Bug#31237 Test "ndb_views" fails because of differing order ...
-# 2. Cleanup of test
# 2007-11-15 hhunger WL#4084: Review and fix all disabled tests ...
let $message= ! Attention: The file with the expected results is not
@@ -2945,10 +2942,6 @@ eval EXPLAIN SELECT * FROM test3.v$toplevel;
#++++++++++++++++++++++++++++++++++++++++++++++
let $message= FIXME - Setting join_limit to 28 - hangs for higher values;
--source include/show_msg.inc
-# OBN - Reduced from 30 in 5.1.21 to avoid hitting the ndbcluster limit
-# of "ERROR HY000: Got temporary error 4006 'Connect failure
-# - out of connection objects (increase MaxNoOfConcurrentTransactions)'
-# from NDBCLUSTER " to early;
#SET @join_limit = 61;
SET @join_limit = 28; # OBN - see above
SET @max_level = @join_limit - 1;
@@ -3322,7 +3315,7 @@ DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
--enable_warnings
-CREATE TABLE t1 ( f1 BIGINT, f2 CHAR(20), f3 NUMERIC(7,4),
+CREATE TABLE t1 ( f1 BIGINT DEFAULT 0, f2 CHAR(20), f3 NUMERIC(7,4),
f4 CHAR, PRIMARY KEY(f1));
# VIEW including the base table PRIMARY KEY, but not all base table columns (f4)
@@ -3918,7 +3911,7 @@ SELECT * FROM v1 order by f1, report;
#
# 3. Length of one base table column is reduced
# We have to mangle within warnings the row numbers, because they are not
-# deterministic in case of NDB.
+# always deterministic in engines
--replace_regex /at row [0-9]/at row <some number>/
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(8);
INSERT INTO t1 SET f1 = 3, f4 = '<-- 10 -->', report = 't1 3';
diff --git a/mysql-test/suite/funcs_2/charset/charset_master.test b/mysql-test/suite/funcs_2/charset/charset_master.test
index dd02d7491cc..63cd5eb303d 100644
--- a/mysql-test/suite/funcs_2/charset/charset_master.test
+++ b/mysql-test/suite/funcs_2/charset/charset_master.test
@@ -2,7 +2,7 @@
# Author: Serge Kozlov #
# Date: 2005-09-21 #
# Purpose: used by ../t/*_charset.test #
-# Require: set $engine_type= [NDB,MyISAM,InnoDB,etc] before calling #
+# Require: set $engine_type= [MyISAM,InnoDB,etc] before calling #
# #
# Last modification: Matthias Leich #
# Date: 2008-07-02 #
@@ -696,4 +696,4 @@ let $coll= utf8_unicode_ci;
}
DROP database test;
-CREATE database test; \ No newline at end of file
+CREATE database test;
diff --git a/mysql-test/suite/funcs_2/include/check_charset.inc b/mysql-test/suite/funcs_2/include/check_charset.inc
index df4a58d0eeb..0242d4390ac 100644
--- a/mysql-test/suite/funcs_2/include/check_charset.inc
+++ b/mysql-test/suite/funcs_2/include/check_charset.inc
@@ -22,13 +22,15 @@ SHOW TABLE STATUS LIKE 't1';
--disable_warnings
--disable_query_log
+ALTER TABLE test.t1 ADD code VARCHAR(16) NOT NULL;
let $1= 221;
while ($1)
{
- eval INSERT INTO test.t1 VALUES(CHAR(254-$1));
+ eval INSERT INTO test.t1 VALUES(CHAR(254-$1), HEX(254-$1));
dec $1;
}
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
+DELETE FROM test.t1 WHERE a='?' AND code<>'3F';
--enable_query_log
--enable_warnings
diff --git a/mysql-test/suite/funcs_2/readme.txt b/mysql-test/suite/funcs_2/readme.txt
index 53ce41cc845..b7861a8780d 100644
--- a/mysql-test/suite/funcs_2/readme.txt
+++ b/mysql-test/suite/funcs_2/readme.txt
@@ -9,11 +9,6 @@ for MySQL 5.0 only. All cases separated by 4 test scenarios (by engines):
- innodb_charset.test;
- memory_charset.test;
- myisam_charset.test;
- - ndb_charset.test;
-Note: if you use standard binary distributions or compile from source tree
-without cluster support then ndb_charset.test will be skipped. Use
-BUILD/compile-*****-max shellscript for compilation with ndb support or
-download MAX package.
Before running the suite under Windows/cygwin make sure that all files
inside it converted to unix text format.
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
new file mode 100644
index 00000000000..b67dea0f2f4
--- /dev/null
+++ b/mysql-test/suite/galera/disabled.def
@@ -0,0 +1,61 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : MDEV-<xxxx> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+MW-336 : MDEV-13549 Galera test failures
+galera_gra_log : MDEV-13549 Galera test failures
+galera_flush_local : MDEV-13549 Galera test failures
+galera_flush : MDEV-13549 Galera test failures
+MW-329 : MDEV-13549 Galera test failures
+galera_account_management : MariaDB 10.0 does not support ALTER USER
+galera_binlog_row_image : MariaDB 10.0 does not support binlog_row_image
+galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
+GAL-419 : MDEV-13549 Galera test failures
+galera_toi_ddl_fk_insert : MDEV-13549 Galera test failures
+galera_var_notify_cmd : MDEV-13549 Galera test failures
+galera_var_slave_threads : MDEV-13549 Galera test failures
+mysql-wsrep#90 : MDEV-13549 Galera test failures
+galera_as_master_gtid : Requires MySQL GTID
+galera_as_master_gtid_change_master : Requires MySQL GTID
+galera_as_slave_replication_bundle : MDEV-13549 Galera test failures
+galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
+galera_gcs_fragment : MDEV-13549 Galera test failures
+galera_gcache_recover : MDEV-13549 Galera test failures
+galera_gcache_recover_full_gcache : MDEV-13549 Galera test failures
+galera_gcache_recover_manytrx : MDEV-13549 Galera test failures
+galera_ist_mysqldump : MDEV-13549 Galera test failures
+mysql-wsrep#31 : MDEV-13549 Galera test failures
+galera_migrate : MariaDB 10.0 does not support START SLAVE USER
+galera_concurrent_ctas : MDEV-13549 Galera test failures
+galera_bf_abort_for_update : MDEV-13549 Galera test failures
+galera_wsrep_desync_wsrep_on : MDEV-13549 Galera test failures
+galera_ssl_upgrade : MDEV-13549 Galera test failures
+mysql-wsrep#33 : MDEV-13549 Galera test failures
+galera_var_auto_inc_control_on : MDEV-13549 Galera test failures
+MW-44 : MDEV-13549 Galera test failures
+galera_var_retry_autocommit : MDEV-13549 Galera test failures
+pxc-421 : MDEV-13549 Galera test failures
+lp1376747-2 : MDEV-13549 Galera test failures
+lp1376747 : MDEV-13549 Galera test failures
+galera_toi_ddl_nonconflicting : MDEV-13549 Galera test failures
+galera_parallel_simple : MDEV-13549 Galera test failures
+galera_admin : MDEV-13549 Galera test failures
+galera_var_max_ws_rows : MDEV-13549 Galera test failures 10.1
+MW-286 : MDEV-13549 Galera test failures 10.1
+galera_as_master: MDEV-13549 Galera test failures 10.1
+galera_pc_ignore_sb : MDEV-13549 Galera test failures 10.1
+galera_lock_table : MDEV-13549 Galera test failures 10.1
+MW-284 : MDEV-13549 Galera test failures 10.1
+galera_as_slave : MDEV-13549 Galera test failures 10.1
+MW-328C: MDEV-13549 Galera test failures 10.1
+MW-328A: MDEV-13549 Galera test failures 10.1
+MW-328B: MDEV-13549 Galera test failures 10.1
+MW-328: MDEV-13549 Galera test failures 10.1
+galera_suspend_slave: MDEV-13549 Galera test failures 10.1 \ No newline at end of file
diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf
new file mode 100644
index 00000000000..b24f3603894
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2nodes.cnf
@@ -0,0 +1,46 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+wsrep-on=1
+binlog-format=row
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+# enforce read-committed characteristics across the cluster
+wsrep-sync-wait=15
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 15
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
diff --git a/mysql-test/suite/galera/galera_2nodes_as_master.cnf b/mysql-test/suite/galera/galera_2nodes_as_master.cnf
new file mode 100644
index 00000000000..33bfc475721
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2nodes_as_master.cnf
@@ -0,0 +1,70 @@
+#
+# This file creates a setup with a 2-node Galera cluster (master) and one
+# standalone MariaDB server, to be used as a slave.
+#
+
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+log-bin=mysqld-bin
+binlog-format=row
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+server-id=1
+log_slave_updates
+
+wsrep-on=1
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
+wsrep_cluster_address=gcomm://
+wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+wsrep_node_address=127.0.0.1
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+server-id=2
+log_slave_updates
+
+wsrep-on=1
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+wsrep_node_address=127.0.0.1
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+
+[mysqld.3]
+server-id=3
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf
new file mode 100644
index 00000000000..f68fe524904
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf
@@ -0,0 +1,83 @@
+
+#
+# Let's understand the topology.
+# * Independent Master with server-id = 1
+# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3
+# node#1 act as slave to Independent Master with server-id = 1
+# * Independent Slave with server-id = 4 replicating from galera node#2
+#
+
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+log-slave-updates
+log-bin=mysqld-bin
+binlog-format=row
+gtid-mode=on
+enforce-gtid-consistency=true
+
+[mysqld.1]
+server-id=1
+
+[mysqld.2]
+server-id=2
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 15
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.3]
+server-id=3
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 15
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.4]
+server-id=4
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf
new file mode 100644
index 00000000000..d5490280ab2
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf
@@ -0,0 +1,87 @@
+#
+# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave
+#
+
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+default-storage-engine=InnoDB
+
+[mysqld.1]
+server-id=1
+binlog-format=row
+log-bin=mysqld-bin
+log_slave_updates
+gtid-mode=on
+enforce-gtid-consistency=true
+event-scheduler=1
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 15
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.2]
+server-id=2
+binlog-format=row
+log-bin=mysqld-bin
+log_slave_updates
+gtid-mode=on
+enforce-gtid-consistency=true
+event-scheduler=1
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 15
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.3]
+server-id=3
+replicate-ignore-db=test
+replicate-wild-ignore-table=test.%
+log-bin=mysqld-bin
+log_slave_updates
+gtid-mode=on
+enforce-gtid-consistency=true
+event-scheduler=1
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
diff --git a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
new file mode 100644
index 00000000000..4d9e39d2aae
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
@@ -0,0 +1,77 @@
+#
+# This .cnf file creates a setup with 1 standard MariaDB server, followed by a 2-node Galera cluster
+#
+
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+binlog-format=row
+
+[mysqld.1]
+log-bin
+server-id=1
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+wsrep-on=1
+
+log-bin
+log-slave-updates
+
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+server-id=2
+
+[mysqld.3]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+wsrep-on=1
+
+log-bin
+log-slave-updates
+
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+server-id=3
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
diff --git a/mysql-test/suite/galera/galera_3nodes_as_slave.cnf b/mysql-test/suite/galera/galera_3nodes_as_slave.cnf
new file mode 100644
index 00000000000..ac1ca34e242
--- /dev/null
+++ b/mysql-test/suite/galera/galera_3nodes_as_slave.cnf
@@ -0,0 +1,97 @@
+#
+# This .cnf file creates a setup with 1 standard MariaDB server, followed by a 3-node Galera cluster
+#
+
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+log-bin
+binlog-format=row
+
+[mysqld.1]
+server-id=1
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+log-slave-updates
+
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S;evs.max_install_timeouts=1;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+server-id=2
+
+[mysqld.3]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+log-slave-updates
+
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout=PT15S;evs.max_install_timeouts=1;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+server-id=3
+
+[mysqld.4]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+log-slave-updates
+
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.install_timeout=PT15S;evs.max_install_timeouts=1;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+server-id=4
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+NODE_GALERAPORT_4= @mysqld.4.#galera_port
+
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
+NODE_SSTPORT_4= @mysqld.4.#sst_port
diff --git a/mysql-test/suite/galera/galera_4nodes.cnf b/mysql-test/suite/galera/galera_4nodes.cnf
new file mode 100644
index 00000000000..1c195afd54b
--- /dev/null
+++ b/mysql-test/suite/galera/galera_4nodes.cnf
@@ -0,0 +1,74 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+binlog-format=row
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep-on=1
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+
+[mysqld.3]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
+
+
+[mysqld.4]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+NODE_GALERAPORT_4= @mysqld.4.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
+NODE_SSTPORT_4= @mysqld.4.#sst_port
diff --git a/mysql-test/suite/galera/include/auto_increment_offset_restore.inc b/mysql-test/suite/galera/include/auto_increment_offset_restore.inc
new file mode 100644
index 00000000000..1248ed100ca
--- /dev/null
+++ b/mysql-test/suite/galera/include/auto_increment_offset_restore.inc
@@ -0,0 +1,41 @@
+# See auto_increment_offset_restore.inc for details.
+
+if (!$node_1)
+{
+ --die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc
+}
+
+if (!$node_2)
+{
+ --die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc
+}
+
+if (!$auto_increment_offset_node_1)
+{
+ --die ERROR IN TEST: $auto_increment_offset_node_1 must be set before sourcing auto_increment_offset_save.inc
+}
+
+if (!$auto_increment_offset_node_2)
+{
+ --die ERROR IN TEST: $auto_increment_offset_node_2 must be set before sourcing auto_increment_offset_save.inc
+}
+
+# Restore original auto_increment_offset values.
+--disable_query_log
+--connection $node_1
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
+--connection $node_2
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
+
+if ($node_3)
+{
+--connection $node_3
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_3;
+}
+
+if ($node_4)
+{
+--connection $node_4
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_4;
+}
+--enable_query_log
diff --git a/mysql-test/suite/galera/include/auto_increment_offset_save.inc b/mysql-test/suite/galera/include/auto_increment_offset_save.inc
new file mode 100644
index 00000000000..216c689ec8c
--- /dev/null
+++ b/mysql-test/suite/galera/include/auto_increment_offset_save.inc
@@ -0,0 +1,45 @@
+# This file can be used to save the @@global.auto_increment_offset value at
+# the beginning of any test that intends to restart any of the participating
+# nodes. This is required as the node may get auto-assigned a different
+# auto_increment_offset value on restart, which could cause MTR's internal
+# post-check to fail. auto_increment_offset_restore.inc can be used at the
+# end of the test to restore these saved values.
+
+# Parameters
+# ----------
+# $node_1
+# Connection handle for 1st node
+# $node_2
+# Connection handle for 2nd node
+# $node_3 (optional)
+# Connection handle for 3rd node
+# $node_4 (optional)
+# Connection handle for 4th node
+
+if (!$node_1)
+{
+ --die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc
+}
+
+if (!$node_2)
+{
+ --die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc
+}
+
+--connection $node_1
+let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
+--connection $node_2
+let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
+
+if ($node_3)
+{
+ --connection $node_3
+ let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`;
+}
+
+if ($node_4)
+{
+ --connection $node_4
+ let $auto_increment_offset_node_4 = `SELECT @@global.auto_increment_offset`;
+}
+
diff --git a/mysql-test/suite/galera/include/galera_have_debug_sync.inc b/mysql-test/suite/galera/include/galera_have_debug_sync.inc
new file mode 100644
index 00000000000..7c0156052d8
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_have_debug_sync.inc
@@ -0,0 +1,9 @@
+--disable_query_log
+
+--let $galera_have_debug_sync = `SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'`
+
+--if (!$galera_have_debug_sync) {
+ --skip "Test requires Galera debug library with debug_sync functionality"
+}
+
+--enable_query_log
diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc
new file mode 100644
index 00000000000..761a1a89fd3
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_load_provider.inc
@@ -0,0 +1,10 @@
+--echo Loading wsrep provider ...
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--source include/wait_until_ready.inc
diff --git a/mysql-test/suite/galera/include/galera_reset_cluster_address.inc b/mysql-test/suite/galera/include/galera_reset_cluster_address.inc
new file mode 100644
index 00000000000..02937ec8ea3
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_reset_cluster_address.inc
@@ -0,0 +1,12 @@
+--echo Resetting wsrep_cluster_address
+
+--let $wsrep_cluster_size_orig = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'`
+
+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
+
+--source include/wait_until_connected_again.inc
+
+# Wait for wsrep_cluster_size to go back to its original value
+
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_cluster_size_orig FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/include/galera_resume.inc b/mysql-test/suite/galera/include/galera_resume.inc
new file mode 100644
index 00000000000..232cb46479e
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_resume.inc
@@ -0,0 +1,9 @@
+--echo Resuming node ...
+--perl
+ my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'};
+ my $mysqld_pid = `cat $pid_filename`;
+ chomp($mysqld_pid);
+ system("kill -18 $mysqld_pid");
+ exit(0);
+EOF
+
diff --git a/mysql-test/suite/galera/include/galera_sst_restore.inc b/mysql-test/suite/galera/include/galera_sst_restore.inc
new file mode 100644
index 00000000000..a08b148c31a
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_sst_restore.inc
@@ -0,0 +1,29 @@
+#
+# Restore the various options used for SST to their original values
+# so that MTR's end-of-test checks are happy.
+#
+
+--connection node_1
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+
+--disable_query_log
+--eval SET GLOBAL wsrep_sst_auth = '$wsrep_sst_auth_orig';
+--enable_query_log
+
+--error 0,ER_CANNOT_USER
+DROP USER sst;
+
+--connection node_2
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
+CALL mtr.add_suppression("InnoDB: New log files created");
+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+CALL mtr.add_suppression("Can't open and lock time zone table");
+CALL mtr.add_suppression("Can't open and lock privilege tables");
+CALL mtr.add_suppression("Info table is not ready to be used");
+CALL mtr.add_suppression("Native table .* has the wrong structure");
+
+--disable_query_log
+--eval SET GLOBAL wsrep_sst_method = '$wsrep_sst_method_orig';
+--eval SET GLOBAL wsrep_sst_receive_address = '$wsrep_sst_receive_address_orig';
+--enable_query_log
diff --git a/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc b/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc
new file mode 100644
index 00000000000..cbd2c1c817a
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc
@@ -0,0 +1,24 @@
+#
+# Set all the variables required for the SST to be performed via mysqldump
+#
+
+--echo Setting SST method to mysqldump ...
+
+--connection node_1
+# We need a user with a password to perform SST, otherwise we hit LP #1378253
+CREATE USER 'sst';
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+
+--let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth`
+SET GLOBAL wsrep_sst_auth = 'sst:';
+
+--connection node_2
+--source include/wait_until_connected_again.inc
+--let $wsrep_sst_method_orig = `SELECT @@wsrep_sst_method`
+--let $wsrep_sst_receive_address_orig = `SELECT @@wsrep_sst_receive_address`
+
+--disable_query_log
+# Set wsrep_sst_receive_address to the SQL port
+--eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.2:$NODE_MYPORT_2';
+--enable_query_log
+SET GLOBAL wsrep_sst_method = 'mysqldump';
diff --git a/mysql-test/suite/galera/include/galera_st_clean_slave.inc b/mysql-test/suite/galera/include/galera_st_clean_slave.inc
new file mode 100644
index 00000000000..81ba54aa6f5
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_st_clean_slave.inc
@@ -0,0 +1,113 @@
+--echo Performing State Transfer on a server that starts from a clean var directory
+--echo This is accomplished by shutting down node #2 and removing its var directory before restarting it
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--echo Cleaning var directory ...
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+
+--connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+
+--connection node_2
+--echo Starting server ...
+--source include/start_mysqld.inc
+--source include/wait_until_ready.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+
+--connection node_1
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+
+--connection node_1a_galera_st_clean_slave
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_1
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
new file mode 100644
index 00000000000..c8869746bd1
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
@@ -0,0 +1,105 @@
+--echo Performing State Transfer on a server that has been temporarily disconnected
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+
+--source suite/galera/include/galera_unload_provider.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+
+--connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+
+--connection node_2
+--source suite/galera/include/galera_load_provider.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+
+--connection node_1
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+
+--connection node_1a_galera_st_disconnect_slave
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_1
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-test/suite/galera/include/galera_st_kill_slave.inc
new file mode 100644
index 00000000000..bae37755c65
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_st_kill_slave.inc
@@ -0,0 +1,108 @@
+--echo Performing State Transfer on a server that has been killed and restarted
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+
+--source include/kill_galera.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+
+--connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+--source include/wait_until_ready.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+
+--connection node_1
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+
+--connection node_1a_galera_st_kill_slave
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_1
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
new file mode 100644
index 00000000000..b8dd0fda987
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
@@ -0,0 +1,123 @@
+--echo Performing State Transfer on a server that has been killed and restarted
+--echo while a DDL was in progress on it
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+
+--connection node_2
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+
+# Suspend the applier as it applies the ALTER TABLE
+--let $debug_orig = `SELECT @@debug_dbug`
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_2
+SET wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now'
+--source include/wait_condition.inc
+
+--source include/kill_galera.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+
+--connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--connection node_2
+--echo Starting server ...
+--source include/start_mysqld.inc
+--source include/wait_until_ready.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+
+--connection node_1
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+
+--connection node_1a_galera_st_kill_slave_ddl
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
new file mode 100644
index 00000000000..1a65ef1bd94
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
@@ -0,0 +1,105 @@
+--echo Performing State Transfer on a server that has been shut down cleanly and restarted
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+
+--connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+
+--connection node_2
+--echo Starting server ...
+--source include/start_mysqld.inc
+--source include/wait_until_ready.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+
+--connection node_1
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+
+--connection node_1a_galera_st_shutdown_slave
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_1
+SELECT COUNT(*) = 35 FROM t1;
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_unload_provider.inc
new file mode 100644
index 00000000000..edc7eb31e0e
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_unload_provider.inc
@@ -0,0 +1,7 @@
+--echo Unloading wsrep provider ...
+
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+--let $wsrep_provider_orig = `SELECT @@wsrep_provider`
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+
+SET GLOBAL wsrep_provider = 'none';
diff --git a/mysql-test/suite/galera/include/galera_wsrep_recover.inc b/mysql-test/suite/galera/include/galera_wsrep_recover.inc
new file mode 100644
index 00000000000..090ffe5f5df
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_wsrep_recover.inc
@@ -0,0 +1,23 @@
+--echo Performing --wsrep-recover ...
+--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --innodb --wsrep-recover > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1
+
+--perl
+ use strict;
+ my $wsrep_start_position_str = "grep 'WSREP: Recovered position:' $ENV{MYSQL_TMP_DIR}/galera_wsrep_recover.log | sed 's/.*WSREP\:\ Recovered\ position://' | sed 's/^[ \t]*//'";
+ my $wsrep_start_position = `grep 'WSREP: Recovered position:' $ENV{MYSQL_TMP_DIR}/galera_wsrep_recover.log | sed 's/.*WSREP\:\ Recovered\ position://' | sed 's/^[ \t]*//'`;
+ chomp($wsrep_start_position);
+
+ die if $wsrep_start_position eq '';
+
+ open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/galera_wsrep_start_position.inc") or die;
+ print FILE "--let \$galera_wsrep_start_position = $wsrep_start_position\n";
+ close FILE;
+EOF
+
+--source $MYSQL_TMP_DIR/galera_wsrep_start_position.inc
+
+if ($galera_wsrep_start_position == '') {
+ --die "Could not obtain wsrep_start_position."
+}
+
+--remove_file $MYSQL_TMP_DIR/galera_wsrep_start_position.inc
diff --git a/mysql-test/suite/galera/include/kill_galera.inc b/mysql-test/suite/galera/include/kill_galera.inc
new file mode 100644
index 00000000000..c61bad8e19d
--- /dev/null
+++ b/mysql-test/suite/galera/include/kill_galera.inc
@@ -0,0 +1,21 @@
+--echo Killing server ...
+
+# Write file to make mysql-test-run.pl expect the crash, but don't start it
+--source include/wait_until_connected_again.inc
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--exec echo "wait" > $_expect_file_name
+
+# Kill the connected server
+--disable_reconnect
+--let KILL_NODE_PIDFILE = `SELECT @@pid_file`
+
+--perl
+ my $pid_filename = $ENV{'KILL_NODE_PIDFILE'};
+ my $mysqld_pid = `cat $pid_filename`;
+ chomp($mysqld_pid);
+ system("kill -9 $mysqld_pid");
+ exit(0);
+EOF
+
+--source include/wait_until_disconnected.inc
diff --git a/mysql-test/suite/galera/include/print_gtid.inc b/mysql-test/suite/galera/include/print_gtid.inc
new file mode 100644
index 00000000000..e6bd627e5ad
--- /dev/null
+++ b/mysql-test/suite/galera/include/print_gtid.inc
@@ -0,0 +1,11 @@
+--echo list of GTID variables :
+--disable_query_log
+query_vertical
+SELECT @@global.gtid_domain_id AS gtid_domain_id,
+ @@global.gtid_binlog_pos AS gtid_binlog_pos,
+ @@global.gtid_binlog_state AS gtid_binlog_state,
+ @@global.gtid_current_pos AS gtid_current_pos,
+ @@global.gtid_slave_pos AS gtid_slave_pos,
+ @@global.wsrep_gtid_domain_id AS wsrep_gtid_domain_id,
+ @@global.wsrep_gtid_mode AS wsrep_gtid_mode;
+--enable_query_log
diff --git a/mysql-test/suite/galera/include/shutdown_mysqld.inc b/mysql-test/suite/galera/include/shutdown_mysqld.inc
new file mode 100644
index 00000000000..54bba1318e7
--- /dev/null
+++ b/mysql-test/suite/galera/include/shutdown_mysqld.inc
@@ -0,0 +1,18 @@
+# This is the first half of include/restart_mysqld.inc.
+if ($rpl_inited)
+{
+ if (!$allow_rpl_inited)
+ {
+ --die ERROR IN TEST: When using the replication test framework (master-slave.inc, rpl_init.inc etc), use rpl_restart_server.inc instead of restart_mysqld.inc. If you know what you are doing and you really have to use restart_mysqld.inc, set allow_rpl_inited=1 before you source restart_mysqld.inc
+ }
+}
+
+# Write file to make mysql-test-run.pl expect the "crash", but don't start it
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--exec echo "wait" > $_expect_file_name
+
+# Send shutdown to the connected server
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
diff --git a/mysql-test/suite/galera/include/start_mysqld.inc b/mysql-test/suite/galera/include/start_mysqld.inc
new file mode 100644
index 00000000000..4ee3d17810c
--- /dev/null
+++ b/mysql-test/suite/galera/include/start_mysqld.inc
@@ -0,0 +1,22 @@
+# Include this script only after using shutdown_mysqld.inc
+# where $_expect_file_name was initialized.
+# Write file to make mysql-test-run.pl start up the server again
+
+if ($galera_wsrep_start_position != '') {
+ --echo Using --wsrep-start-position when starting mysqld ...
+ --exec echo "restart:$start_mysqld_params --wsrep-start-position=$galera_wsrep_start_position" > $_expect_file_name
+ --let $galera_wsrep_start_position = 0
+}
+
+if ($galera_wsrep_start_position == '') {
+ --exec echo "restart:$start_mysqld_params" > $_expect_file_name
+}
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--disable_reconnect
diff --git a/mysql-test/suite/galera/my.cnf b/mysql-test/suite/galera/my.cnf
new file mode 100644
index 00000000000..ca163a540d9
--- /dev/null
+++ b/mysql-test/suite/galera/my.cnf
@@ -0,0 +1 @@
+!include galera_2nodes.cnf
diff --git a/mysql-test/suite/galera/r/GAL-382.result b/mysql-test/suite/galera/r/GAL-382.result
new file mode 100644
index 00000000000..0c7365f3005
--- /dev/null
+++ b/mysql-test/suite/galera/r/GAL-382.result
@@ -0,0 +1,6 @@
+create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb;
+insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
+create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb;
+replace into t2 (i, j, k) select /*!99997 */ i, k, j from t1;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/GAL-401.result b/mysql-test/suite/galera/r/GAL-401.result
new file mode 100644
index 00000000000..03509cb0e29
--- /dev/null
+++ b/mysql-test/suite/galera/r/GAL-401.result
@@ -0,0 +1,23 @@
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+SET @@global.wsrep_desync = 1;
+SET SESSION wsrep_dirty_reads=1;
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SET wsrep_dirty_reads=0;
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET @@global.wsrep_desync = 0;
+SET SESSION wsrep_sync_wait=15;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` char(1) DEFAULT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
diff --git a/mysql-test/suite/galera/r/GAL-419.result b/mysql-test/suite/galera/r/GAL-419.result
new file mode 100644
index 00000000000..410c91b4f98
--- /dev/null
+++ b/mysql-test/suite/galera/r/GAL-419.result
@@ -0,0 +1,4 @@
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
diff --git a/mysql-test/suite/galera/r/GAL-480.result b/mysql-test/suite/galera/r/GAL-480.result
new file mode 100644
index 00000000000..b762e07423e
--- /dev/null
+++ b/mysql-test/suite/galera/r/GAL-480.result
@@ -0,0 +1,39 @@
+CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB;
+FLUSH TABLE t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t1 DROP COLUMN f1;
+SET SESSION wsrep_osu_method='RSU';
+ALTER TABLE t1 ADD COLUMN f1 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f1;
+ALTER TABLE t1 ADD COLUMN f2 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f2;
+ALTER TABLE t1 ADD COLUMN f3 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f3;
+ALTER TABLE t1 ADD COLUMN f4 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f4;
+ALTER TABLE t1 ADD COLUMN f5 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f5;
+ALTER TABLE t1 ADD COLUMN f6 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f6;
+ALTER TABLE t1 ADD COLUMN f7 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f7;
+ALTER TABLE t1 ADD COLUMN f8 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f8;
+ALTER TABLE t1 ADD COLUMN f9 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f9;
+ALTER TABLE t1 ADD COLUMN f10 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f10;
+ALTER TABLE t1 ADD COLUMN f11 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f11;
+ALTER TABLE t1 ADD COLUMN f12 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f12;
+ALTER TABLE t1 ADD COLUMN f13 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f13;
+ALTER TABLE t1 ADD COLUMN f14 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f14;
+ALTER TABLE t1 ADD COLUMN f15 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f15;
+ALTER TABLE t1 ADD COLUMN f16 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f16;
+SET SESSION wsrep_osu_method='TOI';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-252.result b/mysql-test/suite/galera/r/MW-252.result
new file mode 100644
index 00000000000..c422edcb82a
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-252.result
@@ -0,0 +1,7 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+FLUSH TABLES WITH READ LOCK;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+UNLOCK TABLES;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-258.result b/mysql-test/suite/galera/r/MW-258.result
new file mode 100644
index 00000000000..1b4d4ae0de8
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-258.result
@@ -0,0 +1,34 @@
+CREATE TABLE t1 (f1 INTEGER);
+LOCK TABLE t1 WRITE;
+value prior to RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync OFF
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+ALTER TABLE t1 ADD COLUMN f3 INTEGER;;
+value during RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 2
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync OFF
+UNLOCK TABLES;
+value after RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync OFF
+SET GLOBAL wsrep_desync=0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-259.result b/mysql-test/suite/galera/r/MW-259.result
new file mode 100644
index 00000000000..df76e959de5
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-259.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=1;;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+DROP TABLE t1;
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/galera/r/MW-284.result b/mysql-test/suite/galera/r/MW-284.result
new file mode 100644
index 00000000000..9d1c3e5660d
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-284.result
@@ -0,0 +1,16 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+SET global wsrep_sync_wait=0;
+START SLAVE;
+include/wait_for_slave_param.inc [Slave_IO_Running]
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+include/wait_for_slave_to_start.inc
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+SET global wsrep_sync_wait=15;
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression('failed registering on master');
+CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
diff --git a/mysql-test/suite/galera/r/MW-285.result b/mysql-test/suite/galera/r/MW-285.result
new file mode 100644
index 00000000000..8c5a21fcbee
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-285.result
@@ -0,0 +1,19 @@
+CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY,
+parent1_id INT,
+parent2_id INT,
+FOREIGN KEY (parent1_id) REFERENCES parent1(id),
+FOREIGN KEY (parent1_id) REFERENCES parent2(id)
+) ENGINE=InnoDB;
+INSERT INTO parent1 VALUES (1);
+INSERT INTO parent2 VALUES (1);
+INSERT INTO child VALUES (1,1,1);
+INSERT INTO child VALUES (2,1,1);
+SET foreign_key_checks=OFF;
+DROP TABLE parent1;
+UPDATE child SET parent1_id=2 WHERE id=1;
+DROP TABLE child;
+DROP TABLE parent2;
+SET foreign_key_checks=ON;
diff --git a/mysql-test/suite/galera/r/MW-286.result b/mysql-test/suite/galera/r/MW-286.result
new file mode 100644
index 00000000000..adc996c1cbe
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-286.result
@@ -0,0 +1,13 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+SET GLOBAL wsrep_desync = TRUE;
+SET wsrep_on = FALSE;
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+ERROR 70100: Query execution was interrupted
+SET wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/MW-292.result b/mysql-test/suite/galera/r/MW-292.result
new file mode 100644
index 00000000000..f038f880efa
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-292.result
@@ -0,0 +1,30 @@
+CREATE TABLE rand_table (f1 FLOAT);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+f1 f2
+2 a
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+COMMIT;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+SELECT TIMEDIFF(SYSDATE(), NOW()) < 2;
+TIMEDIFF(SYSDATE(), NOW()) < 2
+1
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+SELECT COUNT(DISTINCT f1) = 10 FROM rand_table;
+COUNT(DISTINCT f1) = 10
+1
+wsrep_local_replays
+1
+DROP TABLE t1;
+DROP TABLE rand_table;
diff --git a/mysql-test/suite/galera/r/MW-309.result b/mysql-test/suite/galera/r/MW-309.result
new file mode 100644
index 00000000000..3dd49a041ee
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-309.result
@@ -0,0 +1,22 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+SET GLOBAL wsrep_max_ws_rows = 2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SHOW STATUS LIKE '%wsrep%';
+SET GLOBAL wsrep_max_ws_rows = 0;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-313.result b/mysql-test/suite/galera/r/MW-313.result
new file mode 100644
index 00000000000..dc605ffc370
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-313.result
@@ -0,0 +1,32 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+SET GLOBAL wsrep_max_ws_rows = 2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SHOW STATUS LIKE '%wsrep%';
+INSERT INTO t1 SELECT * FROM t1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES (1);
+INSERT INTO t1 (f1) VALUES (2),(3),(4);
+ERROR HY000: wsrep_max_ws_rows exceeded
+ROLLBACK;
+START TRANSACTION;
+DELETE FROM t1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+DROP TABLE t1;
+SET GLOBAL wsrep_max_ws_rows = 0;
diff --git a/mysql-test/suite/galera/r/MW-328A.result b/mysql-test/suite/galera/r/MW-328A.result
new file mode 100644
index 00000000000..daed2469f11
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-328A.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+CREATE PROCEDURE proc_update ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+END WHILE;
+END|
+CALL proc_update();;
+SET SESSION wsrep_retry_autocommit = 0;
+have_successes
+1
+have_deadlocks
+1
+Got one of the listed errors
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-test/suite/galera/r/MW-328B.result b/mysql-test/suite/galera/r/MW-328B.result
new file mode 100644
index 00000000000..780988938f6
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-328B.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+CREATE PROCEDURE proc_update ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+END WHILE;
+END|
+CALL proc_update();;
+SET SESSION wsrep_retry_autocommit = 0;
+Got one of the listed errors
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-test/suite/galera/r/MW-328C.result b/mysql-test/suite/galera/r/MW-328C.result
new file mode 100644
index 00000000000..5cd74f05171
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-328C.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+CREATE PROCEDURE proc_update ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+END WHILE;
+END|
+CALL proc_update();;
+SET SESSION wsrep_retry_autocommit = 10000;
+Got one of the listed errors
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-test/suite/galera/r/MW-328D.result b/mysql-test/suite/galera/r/MW-328D.result
new file mode 100644
index 00000000000..f6d055def93
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-328D.result
@@ -0,0 +1,15 @@
+CREATE TABLE t1 (i INT) ENGINE = InnoDB;
+INSERT INTO t1 (i) VALUES(1);
+CREATE TABLE t2 (i INT) ENGINE = InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
+i
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;;
+DELETE FROM t1 WHERE i = 1;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera/r/MW-328E.result b/mysql-test/suite/galera/r/MW-328E.result
new file mode 100644
index 00000000000..5829559fa4d
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-328E.result
@@ -0,0 +1,15 @@
+create table t1 (i int primary key, j int) engine=innodb;
+create table t2 (i int primary key, j int) engine=innodb;
+insert into t1 values (1,0);
+insert into t2 values (2,0);
+set autocommit=off;
+start transaction;
+update t1 set j=1 where i=1;
+set autocommit=off;
+start transaction;
+begin;
+update t2 set j=1 where i=2;
+insert into t1 select * from t2;;
+insert into t2 select * from t1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera/r/MW-329.result b/mysql-test/suite/galera/r/MW-329.result
new file mode 100644
index 00000000000..a79ba598d69
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-329.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1),(65535);
+FLUSH STATUS;
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
+VARIABLE_VALUE = 0
+1
+CREATE PROCEDURE proc_insert ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 ));
+END WHILE;
+END|
+CALL proc_insert();;
+SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
+VARIABLE_VALUE > 0
+1
+DROP PROCEDURE proc_insert;
+DROP TABLE t1;
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-test/suite/galera/r/MW-336.result b/mysql-test/suite/galera/r/MW-336.result
new file mode 100644
index 00000000000..9bdb61c1a9c
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-336.result
@@ -0,0 +1,42 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 1;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_slave_threads = 10;
+SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 11
+1
+SET GLOBAL wsrep_slave_threads = 20;
+SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 21
+1
+SET GLOBAL wsrep_slave_threads = 1;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 0;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (20);
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 2
+1
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-357.result b/mysql-test/suite/galera/r/MW-357.result
new file mode 100644
index 00000000000..d249d5997f7
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-357.result
@@ -0,0 +1,6 @@
+SET GLOBAL wsrep_slave_threads = 0;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-369.result b/mysql-test/suite/galera/r/MW-369.result
new file mode 100644
index 00000000000..516904d1b2a
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-369.result
@@ -0,0 +1,155 @@
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+DELETE FROM p WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO c VALUES (1, 1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id
+1 1
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE c SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SELECT * FROM p;
+f1 f2
+1 1
+2 0
+SELECT * FROM c;
+f1 p_id f2
+1 1 1
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM c WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SELECT * FROM p;
+f1 f2
+1 1
+2 0
+SELECT * FROM c;
+f1 p_id
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER UNIQUE KEY) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f2)) ;
+INSERT INTO p VALUES (1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO c VALUES (1, 0);;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+1 0
+SELECT * FROM c;
+f1 p_id
+1 0
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+ON DELETE CASCADE) ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+DELETE FROM p WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE c SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id f2
+1 1 1
+DROP TABLE c;
+DROP TABLE p;
diff --git a/mysql-test/suite/galera/r/MW-388.result b/mysql-test/suite/galera/r/MW-388.result
new file mode 100644
index 00000000000..59d4d4a2bf3
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-388.result
@@ -0,0 +1,46 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) Engine=InnoDB;
+CREATE PROCEDURE insert_proc ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+BEGIN
+GET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;
+END;
+INSERT INTO t1 VALUES (1, 'node 1'),(2, 'node 1');
+INSERT INTO t1 VALUES (3, 'node 1');
+END|
+SET GLOBAL wsrep_slave_threads = 2;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+INSERT INTO t1 VALUES (1, 'node 2');;
+SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
+CALL insert_proc ();;
+SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+SELECT @errno = 1213;
+@errno = 1213
+0
+SELECT * FROM t1;
+f1 f2
+1 node 2
+3 node 1
+SELECT * FROM t1;
+f1 f2
+1 node 2
+3 node 1
+SET GLOBAL wsrep_slave_threads = DEFAULT;
+DROP TABLE t1;
+DROP PROCEDURE insert_proc;
+SET GLOBAL debug = NULL;
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET debug_sync='RESET';
+SELECT @@debug_sync;
+@@debug_sync
+ON - current signal: ''
diff --git a/mysql-test/suite/galera/r/MW-402.result b/mysql-test/suite/galera/r/MW-402.result
new file mode 100644
index 00000000000..fdcf6e324b5
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-402.result
@@ -0,0 +1,192 @@
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON DELETE CASCADE);
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE c SET f2=1 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM p WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+2 0
+SELECT * FROM c;
+f1 p_id f2
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE c SET f2=2 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE p set f1=11 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+2 0
+11 0
+SELECT * FROM c;
+f1 p_id f2
+1 11 0
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE c SET p_id=2 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE p set f1=11 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+2 0
+11 0
+SELECT * FROM c;
+f1 p_id f2
+1 11 0
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p set f1=21 WHERE f1 = 11;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE c SET p_id=2 where f1=1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+2 0
+11 0
+SELECT * FROM c;
+f1 p_id f2
+1 2 0
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ON DELETE CASCADE,
+CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1));
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+INSERT INTO c VALUES (1, 1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p2 SET f2=2 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM p1 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SELECT * FROM p1;
+f1 f2
+SELECT * FROM p2;
+f1 f2
+1 2
+SELECT * FROM c;
+f1 p1_id p2_id f2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ON DELETE CASCADE,
+CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ON DELETE CASCADE);
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+INSERT INTO c VALUES (1, 1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+DELETE FROM p2 WHERE f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM p1 WHERE f1=1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p1;
+f1 f2
+SELECT * FROM p2;
+f1 f2
+1 0
+SELECT * FROM c;
+f1 p1_id p2_id f2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
diff --git a/mysql-test/suite/galera/r/MW-44.result b/mysql-test/suite/galera/r/MW-44.result
new file mode 100644
index 00000000000..28a6f1ac8dd
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-44.result
@@ -0,0 +1,14 @@
+TRUNCATE TABLE mysql.general_log;
+TRUNCATE TABLE mysql.general_log;
+SET SESSION wsrep_osu_method=TOI;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_osu_method=RSU;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET SESSION wsrep_osu_method=TOI;
+SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
+COUNT(*) = 0
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-86-wait1.result b/mysql-test/suite/galera/r/MW-86-wait1.result
new file mode 100644
index 00000000000..a38255eff8f
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-86-wait1.result
@@ -0,0 +1,48 @@
+SELECT @@debug_sync;
+@@debug_sync
+ON - current signal: ''
+SET SESSION wsrep_sync_wait = 1;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+CREATE TABLE t_wait1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t_wait1 VALUES (1);
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+SHOW BINARY LOGS;
+SHOW BINLOG EVENTS;
+SHOW COLUMNS FROM t1;
+SHOW CREATE EVENT e1;
+SHOW CREATE FUNCTION f1;
+SHOW CREATE PROCEDURE p1;
+SHOW CREATE TABLE t1;
+SHOW CREATE TRIGGER tr1;
+SHOW CREATE VIEW v1;
+SHOW DATABASES;
+SHOW ENGINE InnoDB STATUS;
+SHOW FUNCTION CODE f1;
+SHOW FUNCTION STATUS;
+SHOW GRANTS FOR 'root'@'localhost';
+SHOW INDEX FROM t1;
+SHOW OPEN TABLES;
+SHOW PROCEDURE CODE p1;
+SHOW PROCEDURE STATUS;
+SHOW PRIVILEGES;
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW TABLE STATUS;
+SHOW TABLES;
+SHOW TRIGGERS;
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+SHOW WARNINGS;
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb";
+SET SESSION wsrep_sync_wait = default;
+DROP TABLE t_wait1;
+SET GLOBAL debug = NULL;
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET debug_sync='RESET';
+SELECT @@debug_sync;
+@@debug_sync
+ON - current signal: ''
diff --git a/mysql-test/suite/galera/r/MW-86-wait8.result b/mysql-test/suite/galera/r/MW-86-wait8.result
new file mode 100644
index 00000000000..04c93e9a9f2
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-86-wait8.result
@@ -0,0 +1,50 @@
+SELECT @@debug_sync;
+@@debug_sync
+ON - current signal: ''
+SET SESSION wsrep_sync_wait = 8;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+CREATE TABLE t_wait8 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t_wait8 VALUES (1);
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT0.1S";
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+SHOW BINARY LOGS;
+SHOW BINLOG EVENTS;
+SHOW COLUMNS FROM t1;
+SHOW CREATE DATABASE db1;
+SHOW CREATE EVENT e1;
+SHOW CREATE FUNCTION f1;
+SHOW CREATE PROCEDURE p1;
+SHOW CREATE TABLE t1;
+SHOW CREATE TRIGGER tr1;
+SHOW CREATE VIEW v1;
+SHOW DATABASES;
+SHOW ENGINE InnoDB STATUS;
+SHOW FUNCTION CODE f1;
+SHOW FUNCTION STATUS;
+SHOW GRANTS FOR 'root'@'localhost';
+SHOW INDEX FROM t1;
+SHOW OPEN TABLES;
+SHOW PROCEDURE CODE p1;
+SHOW PROCEDURE STATUS;
+SHOW PRIVILEGES;
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW TABLE STATUS;
+SHOW TABLES;
+SHOW TRIGGERS;
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+SHOW WARNINGS;
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+SET SESSION wsrep_sync_wait = default;
+DROP TABLE t_wait8;
+SET GLOBAL debug = NULL;
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET debug_sync='RESET';
+SELECT @@debug_sync;
+@@debug_sync
+ON - current signal: ''
diff --git a/mysql-test/suite/galera/r/basic.result b/mysql-test/suite/galera/r/basic.result
new file mode 100644
index 00000000000..d4efe348b61
--- /dev/null
+++ b/mysql-test/suite/galera/r/basic.result
@@ -0,0 +1,30 @@
+USE test;
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+SELECT * FROM t1;
+c1
+1
+2
+3
+4
+5
+
+# On node_1
+SELECT * FROM test.t1;
+c1
+1
+2
+3
+4
+5
+
+# On node_2
+SELECT * FROM test.t1;
+c1
+1
+2
+3
+4
+5
+DROP TABLE t1;
+# End of test
diff --git a/mysql-test/suite/galera/r/binlog_checksum.result b/mysql-test/suite/galera/r/binlog_checksum.result
new file mode 100644
index 00000000000..5c1981fc17f
--- /dev/null
+++ b/mysql-test/suite/galera/r/binlog_checksum.result
@@ -0,0 +1,36 @@
+# On node_1
+SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
+SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
+# On node_2
+SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
+SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
+USE test;
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+SELECT * FROM t1;
+c1
+1
+2
+3
+4
+5
+SELECT * FROM test.t1;
+c1
+1
+2
+3
+4
+5
+
+# On node_2
+SELECT * FROM test.t1;
+c1
+1
+2
+3
+4
+5
+DROP TABLE t1;
+SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
+SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
+# End of test
diff --git a/mysql-test/suite/galera/r/create.result b/mysql-test/suite/galera/r/create.result
new file mode 100644
index 00000000000..99b8022393d
--- /dev/null
+++ b/mysql-test/suite/galera/r/create.result
@@ -0,0 +1,84 @@
+#
+# MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
+#
+SET @wsrep_forced_binlog_format_saved=@@GLOBAL.wsrep_forced_binlog_format;
+SET @@GLOBAL.wsrep_forced_binlog_format=STATEMENT;
+SHOW VARIABLES LIKE '%log%bin%';
+Variable_name Value
+log_bin OFF
+log_bin_basename
+log_bin_index
+log_bin_trust_function_creators ON
+sql_log_bin ON
+USE test;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TEMPORARY TABLE `t1_temp` AS SELECT * FROM `t1` WHERE i = 1;
+SELECT * FROM t1;
+i
+1
+SELECT * FROM t1_temp;
+i
+1
+DROP TABLE t1;
+SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
+#
+# MDEV-7673: CREATE TABLE SELECT fails on Galera cluster
+#
+CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i;
+SELECT * FROM t1;
+i
+1
+SELECT * FROM t1;
+i
+1
+DROP TABLE t1;
+#
+# MDEV-8166 : Adding index on new table from select crashes Galera
+# cluster
+#
+CREATE TABLE t1(i int(11) NOT NULL DEFAULT '0') ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t1(i) VALUES (1), (2), (3);
+CREATE TABLE t2 (i INT) SELECT i FROM t1;
+ALTER TABLE t2 ADD INDEX idx(i);
+SELECT * FROM t2;
+i
+1
+2
+3
+SELECT * FROM t2;
+i
+1
+2
+3
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `i` int(11) DEFAULT NULL,
+ KEY `idx` (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+#
+# MDEV-9853: WSREP says it cannot get fake InnoDB transaction ID
+# followed by segmentation fault
+#
+CREATE TABLE `t1`(`c1` INT) ENGINE=INNODB;
+SET autocommit=0;
+CREATE TABLE `t2` (`c1` INT) ENGINE=INNODB SELECT * FROM t1;
+COMMIT;
+SET autocommit=1;
+DROP TABLE t1, t2;
+#
+# MDEV-10235: Deadlock in CREATE TABLE ... AS SELECT .. if result set
+# is empty in Galera
+#
+CREATE TABLE t1(c1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2 AS SELECT * FROM t1 WHERE c1=2;
+SELECT * FROM t1;
+c1
+1
+SELECT * FROM t2;
+c1
+DROP TABLE t1, t2;
+# End of tests
diff --git a/mysql-test/suite/galera/r/enforce_storage_engine.result b/mysql-test/suite/galera/r/enforce_storage_engine.result
new file mode 100644
index 00000000000..a3513fc2789
--- /dev/null
+++ b/mysql-test/suite/galera/r/enforce_storage_engine.result
@@ -0,0 +1,22 @@
+#
+# MDEV-8831 : enforce_storage_engine doesn't block table creation on
+# other nodes (galera cluster)
+#
+SET @@enforce_storage_engine=INNODB;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(i INT) ENGINE=MYISAM;
+ERROR 42000: Unknown storage engine 'MyISAM'
+INSERT INTO t1 VALUES(1);
+SHOW TABLES;
+Tables_in_test
+t1
+SELECT COUNT(*)=1 FROM t1;
+COUNT(*)=1
+1
+CREATE TABLE t2(i INT) ENGINE=MYISAM;
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+DROP TABLE t1, t2;
+# End of tests
diff --git a/mysql-test/suite/galera/r/enforce_storage_engine2.result b/mysql-test/suite/galera/r/enforce_storage_engine2.result
new file mode 100644
index 00000000000..053c37d6854
--- /dev/null
+++ b/mysql-test/suite/galera/r/enforce_storage_engine2.result
@@ -0,0 +1,24 @@
+#
+# MDEV-9312: storage engine not enforced during galera cluster
+# replication
+#
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(i INT) ENGINE=MYISAM;
+Warnings:
+Note 1266 Using storage engine InnoDB for table 't2'
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+# End of tests
diff --git a/mysql-test/suite/galera/r/ev51914.result b/mysql-test/suite/galera/r/ev51914.result
new file mode 100644
index 00000000000..4b9f7ace0da
--- /dev/null
+++ b/mysql-test/suite/galera/r/ev51914.result
@@ -0,0 +1,162 @@
+SAVEPOINT in a stored function should be forbidden
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+SAVEPOINT s;
+RETURN 1;
+END|
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+ROLLBACK TO SAVEPOINT in a stored function should be forbidden
+CREATE FUNCTION f2 () RETURNS INT BEGIN
+ROLLBACK TO SAVEPOINT s;
+RETURN 1;
+END|
+BEGIN;
+SAVEPOINT s;
+SELECT f2();
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP FUNCTION f2;
+BEGIN;
+SAVEPOINT S;
+ROLLBACK TO SAVEPOINT S;
+COMMIT;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 values (110), (111), (112), (113), (114);
+Direct SAVEPOINT in a trigger should be forbidden
+CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (1);
+DROP TRIGGER i1_t1;
+CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (2);
+DROP TRIGGER i2_t1;
+INSERT INTO t1 VALUES (3);
+CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u1_t1;
+CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u2_t1;
+CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+SAVEPOINT in a compound statement in a trigger should be forbidden
+CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+SAVEPOINT s;
+END|
+INSERT INTO t1 VALUES (5);
+DROP TRIGGER i3_t1;
+SAVEPOINT in a PS call in a trigger should be forbidden
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+PREPARE set_savepoint FROM "SAVEPOINT s";
+EXECUTE set_savepoint;
+DEALLOCATE PREPARE set_savepoint;
+END|
+ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+SAVEPOINT in SP called from a trigger should be forbidden
+CREATE PROCEDURE p1() BEGIN
+SAVEPOINT s;
+END|
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+INSERT INTO t1 VALUES (6);
+DROP TRIGGER i5_t1;
+SAVEPOINT in a SP called from a PS called from a trigger be forbidden
+PREPARE call_p1 FROM "CALL p1";
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
+ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+SAVEPOINT in a function called from a trigger should be forbidden
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+SAVEPOINT s;
+RETURN 1;
+END|
+CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
+INSERT INTO t1 VALUES (7);
+DROP TRIGGER i7_t1;
+SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
+CREATE PROCEDURE p2() BEGIN
+CALL p1();
+END|
+CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
+INSERT INTO t1 VALUES (8);
+DROP TRIGGER i8_t1;
+SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
+CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+CREATE PROCEDURE p3() BEGIN
+INSERT INTO t1 VALUES (9);
+END|
+CALL p3();
+DROP TRIGGER i9_t1;
+ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
+BEGIN;
+SAVEPOINT s;
+INSERT INTO t1 VALUES (5);
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP TRIGGER i4_t1;
+ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
+CREATE PROCEDURE p4() BEGIN
+ROLLBACK TO SAVEPOINT s;
+END|
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
+BEGIN;
+SAVEPOINT s;
+INSERT INTO t1 VALUES (6);
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP TRIGGER i5_t1;
+SAVEPOINT in a SP next to a trigger should work
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
+CREATE PROCEDURE p5() BEGIN
+SAVEPOINT s;
+INSERT INTO t1 VALUES (10);
+ROLLBACK TO SAVEPOINT s;
+END|
+BEGIN;
+CALL p5();
+COMMIT;
+DROP TRIGGER i6_t1;
+create trigger t1 before insert on t1 for each row
+begin
+insert into t2 values (NULL);
+end|
+INSERT INTO t1 VALUES (201), (202), (203);
+SELECT * FROM t1;
+a
+5
+6
+7
+8
+9
+201
+202
+203
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+3
+SELECT * FROM t1;
+a
+5
+6
+7
+8
+9
+201
+202
+203
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+3
+DEALLOCATE PREPARE call_p1;
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+DROP FUNCTION f1;
diff --git a/mysql-test/suite/galera/r/fk.result b/mysql-test/suite/galera/r/fk.result
new file mode 100644
index 00000000000..d6a3a25b01a
--- /dev/null
+++ b/mysql-test/suite/galera/r/fk.result
@@ -0,0 +1,96 @@
+USE test;
+
+# On node_1
+CREATE TABLE networks (
+`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+`status` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
+`admin_state_up` tinyint(1) DEFAULT NULL,
+`shared` tinyint(1) DEFAULT NULL,
+PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE TABLE ports (
+`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+`network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+`mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
+`admin_state_up` tinyint(1) NOT NULL,
+`status` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
+`device_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+`device_owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+PRIMARY KEY (`id`),
+KEY `network_id` (`network_id`),
+CONSTRAINT `ports_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE TABLE subnets (
+`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+`network_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
+`ip_version` int(11) NOT NULL,
+`cidr` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
+`gateway_ip` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
+`enable_dhcp` tinyint(1) DEFAULT NULL,
+`shared` tinyint(1) DEFAULT NULL,
+`ipv6_ra_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
+`ipv6_address_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
+PRIMARY KEY (`id`),
+KEY `network_id` (`network_id`),
+CONSTRAINT `subnets_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE TABLE `ipallocations` (
+`port_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
+`ip_address` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
+`subnet_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+`network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+PRIMARY KEY (`ip_address`,`subnet_id`,`network_id`),
+KEY `port_id` (`port_id`),
+KEY `subnet_id` (`subnet_id`),
+KEY `network_id` (`network_id`),
+CONSTRAINT `ipallocations_ibfk_1` FOREIGN KEY (`port_id`) REFERENCES `ports` (`id`) ON DELETE CASCADE,
+CONSTRAINT `ipallocations_ibfk_2` FOREIGN KEY (`subnet_id`) REFERENCES `subnets` (`id`) ON DELETE CASCADE,
+CONSTRAINT `ipallocations_ibfk_3` FOREIGN KEY (`network_id`) REFERENCES `networks` (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+INSERT INTO networks VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','MyNet','ACTIVE',0,0);
+INSERT INTO ports VALUES ('','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','fa:16:3e:e3:cc:bb',1,'DOWN','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','network:router_gateway');
+INSERT INTO subnets VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','ext-subnet','f37aa3fe-ab99-4d0f-a566-6cd3169d7516',4,'10.25.0.0/24','10.25.0.4',0,1,NULL,NULL);
+INSERT INTO ipallocations VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','10.25.0.17','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516');
+select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
+tenant_id id name network_id mac_address admin_state_up status device_id device_owner
+ f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 fa:16:3e:e3:cc:bb 1 DOWN f37aa3fe-ab99-4d0f-a566-6cd3169d7516 network:router_gateway
+select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
+tenant_id id name network_id mac_address admin_state_up status device_id device_owner
+ f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 fa:16:3e:e3:cc:bb 1 DOWN f37aa3fe-ab99-4d0f-a566-6cd3169d7516 network:router_gateway
+DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
+select * from networks;
+tenant_id id name status admin_state_up shared
+f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 MyNet ACTIVE 0 0
+select * from ports;
+tenant_id id name network_id mac_address admin_state_up status device_id device_owner
+select * from subnets;
+tenant_id id name network_id ip_version cidr gateway_ip enable_dhcp shared ipv6_ra_mode ipv6_address_mode
+f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 ext-subnet f37aa3fe-ab99-4d0f-a566-6cd3169d7516 4 10.25.0.0/24 10.25.0.4 0 1 NULL NULL
+select * from ipallocations;
+port_id ip_address subnet_id network_id
+select * from ports;
+tenant_id id name network_id mac_address admin_state_up status device_id device_owner
+
+# On node_2
+select * from networks;
+tenant_id id name status admin_state_up shared
+f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 MyNet ACTIVE 0 0
+select * from ports;
+tenant_id id name network_id mac_address admin_state_up status device_id device_owner
+select * from subnets;
+tenant_id id name network_id ip_version cidr gateway_ip enable_dhcp shared ipv6_ra_mode ipv6_address_mode
+f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 ext-subnet f37aa3fe-ab99-4d0f-a566-6cd3169d7516 4 10.25.0.0/24 10.25.0.4 0 1 NULL NULL
+select * from ipallocations;
+port_id ip_address subnet_id network_id
+select * from ports;
+tenant_id id name network_id mac_address admin_state_up status device_id device_owner
+drop table ipallocations;
+drop table subnets;
+drop table ports;
+drop table networks;
diff --git a/mysql-test/suite/galera/r/galera#414.result b/mysql-test/suite/galera/r/galera#414.result
new file mode 100644
index 00000000000..029961f9463
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera#414.result
@@ -0,0 +1,5 @@
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+CALL mtr.add_suppression("Failed to set packet size");
+CALL mtr.add_suppression("Failed to set packet size");
diff --git a/mysql-test/suite/galera/r/galera_account_management.result b/mysql-test/suite/galera/r/galera_account_management.result
new file mode 100644
index 00000000000..4fa33a63064
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_account_management.result
@@ -0,0 +1,47 @@
+CREATE USER user1, user2 IDENTIFIED BY 'password';
+SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
+COUNT(*) = 2
+1
+ALTER USER user1 PASSWORD EXPIRE;
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+password_expired = 'Y'
+1
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+password_expired = 'Y'
+1
+RENAME USER user2 TO user3;
+SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
+COUNT(*) = 1
+1
+SET PASSWORD FOR user3 = PASSWORD('foo');
+SELECT password != '' FROM mysql.user WHERE user = 'user3';
+password != ''
+1
+DROP USER user1, user3;
+SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
+COUNT(*) = 0
+1
+GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
+COUNT(*) = 1
+1
+SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
+Select_priv = 'Y'
+1
+CREATE USER user5;
+GRANT PROXY ON user4 TO user5;
+SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
+COUNT(*) = 1
+1
+REVOKE ALL PRIVILEGES ON *.* FROM user4;
+SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
+Select_priv = 'N'
+1
+REVOKE PROXY ON user4 FROM user5;
+SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
+COUNT(*) = 0
+1
+DROP USER user4, user5;
diff --git a/mysql-test/suite/galera/r/galera_admin.result b/mysql-test/suite/galera/r/galera_admin.result
new file mode 100644
index 00000000000..e58b0a5e310
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_admin.result
@@ -0,0 +1,43 @@
+DROP TABLE IF EXISTS t1, t2;
+DROP TABLE IF EXISTS x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+# ANALYZE test
+ANALYZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+# OPTIMIZE test
+OPTIMIZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+# REPAIR test
+REPAIR TABLE x1, x2;
+Table Op Msg_type Msg_text
+test.x1 repair status OK
+test.x2 repair status OK
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+DROP TABLE t1, t2;
+DROP TABLE x1, x2;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
diff --git a/mysql-test/suite/galera/r/galera_alter_engine_innodb.result b/mysql-test/suite/galera/r/galera_alter_engine_innodb.result
new file mode 100644
index 00000000000..2b30ac5814d
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_alter_engine_innodb.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+ALTER TABLE t1 ENGINE=InnoDB;
+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+ENGINE = 'InnoDB'
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_alter_engine_myisam.result b/mysql-test/suite/galera/r/galera_alter_engine_myisam.result
new file mode 100644
index 00000000000..280cb58208c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_alter_engine_myisam.result
@@ -0,0 +1,11 @@
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1);
+ALTER TABLE t1 ENGINE=InnoDB;
+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+ENGINE = 'InnoDB'
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_alter_table_force.result b/mysql-test/suite/galera/r/galera_alter_table_force.result
new file mode 100644
index 00000000000..401ab46d868
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_alter_table_force.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+ALTER TABLE t1 FORCE;
+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+ENGINE = 'InnoDB'
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_applier_ftwrl_table.result b/mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
new file mode 100644
index 00000000000..1b2a3b937bb
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
@@ -0,0 +1,15 @@
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+FLUSH TABLE t1 WITH READ LOCK;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+SET SESSION wsrep_sync_wait = 0;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 15;
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result b/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result
new file mode 100644
index 00000000000..c30f78896e5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result
@@ -0,0 +1,26 @@
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION lock_wait_timeout = 60;
+SET SESSION innodb_lock_wait_timeout=60;
+SET SESSION wait_timeout=60;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+FLUSH TABLE t1 WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SELECT 1 FROM DUAL;
+1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+COUNT(*) = 1
+1
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 15;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+COUNT(*) = 0
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_as_master.result b/mysql-test/suite/galera/r/galera_as_master.result
new file mode 100644
index 00000000000..e96d39aea0c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_master.result
@@ -0,0 +1,49 @@
+START SLAVE;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+# Disable binary logging for current session
+SET SQL_LOG_BIN=OFF;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(1);
+INSERT INTO t1 VALUES(2);
+CREATE TABLE test.t3 AS SELECT * from t1;
+SET SQL_LOG_BIN=ON;
+INSERT INTO t1 VALUES(3);
+CREATE TABLE test.t4 AS SELECT * from t1;
+SELECT * FROM t1;
+f1
+1
+2
+3
+SELECT * FROM t2;
+f1
+1
+SELECT * FROM t3;
+f1
+1
+2
+SELECT * FROM t4;
+f1
+1
+2
+3
+SHOW TABLES;
+Tables_in_test
+t1
+t4
+SELECT * FROM t1;
+f1
+1
+3
+SELECT * FROM t4;
+f1
+1
+2
+3
+# Cleanup
+DROP TABLE t1, t4;
+SET SQL_LOG_BIN=OFF;
+DROP TABLE t2, t3;
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
diff --git a/mysql-test/suite/galera/r/galera_as_master_gtid.result b/mysql-test/suite/galera/r/galera_as_master_gtid.result
new file mode 100644
index 00000000000..8dfe462d495
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_master_gtid.result
@@ -0,0 +1,59 @@
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+uuids_do_not_match
+1
+SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000002 120 Previous_gtids 1 151
+mysqld-bin.000002 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
+mysqld-bin.000002 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000002 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
+mysqld-bin.000002 375 Query 1 452 BEGIN
+mysqld-bin.000002 452 Table_map 1 497 table_id: # (test.t1)
+mysqld-bin.000002 497 Write_rows 1 537 table_id: # flags: STMT_END_F
+mysqld-bin.000002 537 Xid 1 568 COMMIT /* xid=# */
+INSERT INTO t1 VALUES(2);
+uuids_do_not_match
+1
+uuids_match
+1
+SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000003 120 Previous_gtids 2 151
+mysqld-bin.000003 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
+mysqld-bin.000003 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000003 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
+mysqld-bin.000003 375 Query 1 443 BEGIN
+mysqld-bin.000003 443 Table_map 1 488 table_id: # (test.t1)
+mysqld-bin.000003 488 Write_rows 1 528 table_id: # flags: STMT_END_F
+mysqld-bin.000003 528 Xid 1 559 COMMIT /* xid=# */
+mysqld-bin.000003 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
+mysqld-bin.000003 607 Query 2 684 BEGIN
+mysqld-bin.000003 684 Table_map 2 729 table_id: # (test.t1)
+mysqld-bin.000003 729 Write_rows 2 769 table_id: # flags: STMT_END_F
+mysqld-bin.000003 769 Xid 2 800 COMMIT /* xid=# */
+uuids_do_not_match
+1
+uuids_match
+1
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 120 Previous_gtids 3 151
+mysqld-bin.000001 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
+mysqld-bin.000001 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000001 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
+mysqld-bin.000001 375 Query 1 443 BEGIN
+mysqld-bin.000001 443 Table_map 1 488 table_id: # (test.t1)
+mysqld-bin.000001 488 Write_rows 1 528 table_id: # flags: STMT_END_F
+mysqld-bin.000001 528 Xid 1 559 COMMIT /* xid=# */
+mysqld-bin.000001 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
+mysqld-bin.000001 607 Query 2 675 BEGIN
+mysqld-bin.000001 675 Table_map 2 720 table_id: # (test.t1)
+mysqld-bin.000001 720 Write_rows 2 760 table_id: # flags: STMT_END_F
+mysqld-bin.000001 760 Xid 2 791 COMMIT /* xid=# */
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result b/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result
new file mode 100644
index 00000000000..80fbccf58e2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result
@@ -0,0 +1,15 @@
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+STOP SLAVE;
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+INSERT INTO t1 VALUES(3);
+INSERT INTO t1 VALUES(4);
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_as_master_large.result b/mysql-test/suite/galera/r/galera_as_master_large.result
new file mode 100644
index 00000000000..4d5533899cf
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_master_large.result
@@ -0,0 +1,30 @@
+#
+# MDEV-9044 : Getting binlog corruption on my Galera cluster (10.1.8)
+# making it impossible to async slave.
+#
+START SLAVE;
+SELECT @@GLOBAL.BINLOG_CACHE_SIZE;
+@@GLOBAL.BINLOG_CACHE_SIZE
+8192
+CREATE TABLE t1 (c1 INTEGER PRIMARY KEY, c2 VARCHAR(12000)) ENGINE=INNODB;
+CREATE TABLE t2 (c1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+START TRANSACTION;
+INSERT INTO t1 VALUES(1, REPEAT('-', 10000));
+COMMIT;
+INSERT INTO t2 VALUES(1);
+SELECT c1, LENGTH(c2) FROM t1;
+c1 LENGTH(c2)
+1 10000
+SELECT * FROM t2;
+c1
+1
+SELECT c1, LENGTH(c2) FROM t1;
+c1 LENGTH(c2)
+1 10000
+SELECT * FROM t2;
+c1
+1
+# Cleanup
+DROP TABLE t1, t2;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_as_slave.result b/mysql-test/suite/galera/r/galera_as_slave.result
new file mode 100644
index 00000000000..2d7d689aa36
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave.result
@@ -0,0 +1,15 @@
+START SLAVE;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES (2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (3);
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_autoinc.result b/mysql-test/suite/galera/r/galera_as_slave_autoinc.result
new file mode 100644
index 00000000000..3c5319a6126
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave_autoinc.result
@@ -0,0 +1,80 @@
+START SLAVE;
+SET SESSION binlog_format='STATEMENT';
+CREATE TABLE t1 (
+i int(11) NOT NULL AUTO_INCREMENT,
+c char(32) DEFAULT 'dummy_text',
+PRIMARY KEY (i)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+insert into t1(i) values(null);
+select * from t1;
+i c
+1 dummy_text
+insert into t1(i) values(null), (null), (null);
+select * from t1;
+i c
+1 dummy_text
+2 dummy_text
+3 dummy_text
+4 dummy_text
+SET SESSION auto_increment_increment=7;
+insert into t1(i) values(null), (null), (null);
+SET SESSION auto_increment_offset=5;
+insert into t1(i) values(null), (null), (null);
+select * from t1;
+i c
+1 dummy_text
+2 dummy_text
+3 dummy_text
+4 dummy_text
+8 dummy_text
+15 dummy_text
+22 dummy_text
+33 dummy_text
+40 dummy_text
+47 dummy_text
+show variables like 'binlog_format';
+Variable_name Value
+binlog_format STATEMENT
+show variables like 'auto_increment_increment';
+Variable_name Value
+auto_increment_increment 7
+select * from t1;
+i c
+1 dummy_text
+2 dummy_text
+3 dummy_text
+4 dummy_text
+8 dummy_text
+15 dummy_text
+22 dummy_text
+33 dummy_text
+40 dummy_text
+47 dummy_text
+show variables like 'binlog_format';
+Variable_name Value
+binlog_format ROW
+show variables like 'auto_increment_increment';
+Variable_name Value
+auto_increment_increment 2
+select * from t1;
+i c
+1 dummy_text
+2 dummy_text
+3 dummy_text
+4 dummy_text
+8 dummy_text
+15 dummy_text
+22 dummy_text
+33 dummy_text
+40 dummy_text
+47 dummy_text
+show variables like 'binlog_format';
+Variable_name Value
+binlog_format ROW
+show variables like 'auto_increment_increment';
+Variable_name Value
+auto_increment_increment 2
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid.result b/mysql-test/suite/galera/r/galera_as_slave_gtid.result
new file mode 100644
index 00000000000..fbac7b1b6b5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave_gtid.result
@@ -0,0 +1,16 @@
+START SLAVE;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+SELECT LENGTH(@@global.gtid_binlog_state) > 1;
+LENGTH(@@global.gtid_binlog_state) > 1
+1
+gtid_binlog_state_equal
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+gtid_binlog_state_equal
+1
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_nonprim.result b/mysql-test/suite/galera/r/galera_as_slave_nonprim.result
new file mode 100644
index 00000000000..365ea31f292
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave_nonprim.result
@@ -0,0 +1,18 @@
+START SLAVE;
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+expected_error
+1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+START SLAVE;
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown command' on query");
+CALL mtr.add_suppression("Slave: Unknown command Error_code: 1047");
+CALL mtr.add_suppression("Transport endpoint is not connected");
+CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
+CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_preordered.result b/mysql-test/suite/galera/r/galera_as_slave_preordered.result
new file mode 100644
index 00000000000..27a08e73491
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave_preordered.result
@@ -0,0 +1,19 @@
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
+1
+SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
+COUNT(*) = 2 * 100 * 10 * 10
+1
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
+1
+DROP TABLE t1;
+DROP TABLE ten;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_replication_bundle.result b/mysql-test/suite/galera/r/galera_as_slave_replication_bundle.result
new file mode 100644
index 00000000000..a86bfd20e2f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave_replication_bundle.result
@@ -0,0 +1,15 @@
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+INSERT INTO t1 VALUES(4);
+INSERT INTO t1 VALUES(5);
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result b/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result
new file mode 100644
index 00000000000..228d7c6f041
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result
@@ -0,0 +1,36 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+CREATE PROCEDURE p1 ()
+BEGIN
+DECLARE x INT DEFAULT 1;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+WHILE 1 DO
+INSERT INTO t1 VALUES (DEFAULT);
+COMMIT;
+END WHILE;
+END|
+CALL p1();;
+CALL p1();;
+Killing server ...
+INSERT INTO t1 VALUES (DEFAULT);
+INSERT INTO t1 VALUES (DEFAULT);
+Got one of the listed errors
+Got one of the listed errors
+count_equal
+1
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
diff --git a/mysql-test/suite/galera/r/galera_bf_abort.result b/mysql-test/suite/galera/r/galera_bf_abort.result
new file mode 100644
index 00000000000..cc750f05050
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1,'node_2');
+INSERT INTO t1 VALUES (1,'node_1');
+INSERT INTO t1 VALUES (2, 'node_2');
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result b/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result
new file mode 100644
index 00000000000..3c5c07ae396
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result
@@ -0,0 +1,15 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+FLUSH TABLES t1 FOR EXPORT;
+INSERT INTO t1 VALUES (2);
+SET SESSION wsrep_sync_wait = 0;
+UNLOCK TABLES;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait = 15;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_abort_for_update.result b/mysql-test/suite/galera/r/galera_bf_abort_for_update.result
new file mode 100644
index 00000000000..3978a3df193
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort_for_update.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 FOR UPDATE;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result b/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result
new file mode 100644
index 00000000000..e3819172510
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result
@@ -0,0 +1,8 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+FLUSH TABLES WITH READ LOCK;;
+INSERT INTO t1 VALUES (1);
+UNLOCK TABLES;
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result b/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result
new file mode 100644
index 00000000000..2e44a773b23
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SELECT GET_LOCK("foo", 1000);
+GET_LOCK("foo", 1000)
+1
+SET AUTOCOMMIT=OFF;
+INSERT INTO t1 VALUES (1);
+SELECT GET_LOCK("foo", 1000);;
+INSERT INTO t1 VALUES (1);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result b/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result
new file mode 100644
index 00000000000..7510e48ee83
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+LOCK TABLE t1 WRITE;
+INSERT INTO t1 VALUES (2);
+UNLOCK TABLES;
+COMMIT;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_abort_sleep.result b/mysql-test/suite/galera/r/galera_bf_abort_sleep.result
new file mode 100644
index 00000000000..8e85a5feda2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort_sleep.result
@@ -0,0 +1,9 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+INSERT INTO t1 VALUES (1);
+SELECT SLEEP(1000);;
+INSERT INTO t1 VALUES (1);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_lock_wait.result b/mysql-test/suite/galera/r/galera_bf_lock_wait.result
new file mode 100644
index 00000000000..4e6019ec8ad
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_lock_wait.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 ENGINE=InnoDB select 1 as a, 1 as b union select 2, 2;
+ALTER TABLE t1 add primary key(a);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION rollback;
+WHILE 1 DO
+start transaction;
+update t1 set b=connection_id() where a=1;
+commit;
+END WHILE;
+END|
+call p1;
+call p1;
+call p1;
+call p1;
+checking error log for 'BF lock wait long' message for 10 times every 10 seconds ...
+drop table t1;
+drop procedure p1;
diff --git a/mysql-test/suite/galera/r/galera_binlog_cache_size.result b/mysql-test/suite/galera/r/galera_binlog_cache_size.result
new file mode 100644
index 00000000000..9726cf2a440
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_binlog_cache_size.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 VARCHAR(767)) ENGINE=InnoDB;
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SET GLOBAL binlog_cache_size=4096;
+SET GLOBAL max_binlog_cache_size=4096;
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten;
+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten;
+ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_binlog_checksum.result b/mysql-test/suite/galera/r/galera_binlog_checksum.result
new file mode 100644
index 00000000000..a6ab62350b1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_binlog_checksum.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result b/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result
new file mode 100644
index 00000000000..4156c0c70a7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result
@@ -0,0 +1,9 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 VARCHAR(1000));
+INSERT INTO t1 SELECT REPEAT('x', 1000) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SELECT COUNT(*) = 10000 FROM t1;
+COUNT(*) = 10000
+1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result b/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result
new file mode 100644
index 00000000000..984a943fcbe
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result
@@ -0,0 +1,6 @@
+CREATE TABLE t1 (f1 VARCHAR(1000));
+INSERT INTO t1 VALUES (REPEAT('x', 1000));
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('x', 1000);
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_binlog_row_image.result b/mysql-test/suite/galera/r/galera_binlog_row_image.result
new file mode 100644
index 00000000000..a1f0fb455f3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_binlog_row_image.result
@@ -0,0 +1,79 @@
+SET SESSION binlog_row_image=minimal;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER NOT NULL UNIQUE) ENGINE=InnoDB;
+CREATE TABLE t3 (f1 VARCHAR(1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 1;
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+UPDATE t2 SET f1 = 2 WHERE f1 = 1;
+UPDATE t3 SET f1 = 2 WHERE f1 = 1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 2;
+COUNT(*) = 1
+1
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t3;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET SESSION binlog_row_image=noblob;
+CREATE TABLE t1 (f1 BLOB, f2 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('abc', 1);
+INSERT INTO t2 VALUES ('abc');
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'abc';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'abc';
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 'xyz';
+UPDATE t2 SET f1 = 'xyz';
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'xyz';
+COUNT(*) = 1
+1
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
+COUNT(*) = 1
+1
+DELETE FROM t1;
+DELETE FROM t2;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result b/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result
new file mode 100644
index 00000000000..80ae3d0de2c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result
@@ -0,0 +1,12 @@
+SET GLOBAL binlog_rows_query_log_events=TRUE;
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+COUNT(*) = 1
+1
+SET GLOBAL binlog_rows_query_log_events = 0;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_concurrent_ctas.result b/mysql-test/suite/galera/r/galera_concurrent_ctas.result
new file mode 100644
index 00000000000..8b0a4c07ac2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_concurrent_ctas.result
@@ -0,0 +1 @@
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_create_function.result b/mysql-test/suite/galera/r/galera_create_function.result
new file mode 100644
index 00000000000..8e4a823d00f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_create_function.result
@@ -0,0 +1,58 @@
+CREATE USER 'user1';
+CREATE
+DEFINER = 'user1'
+FUNCTION f1 (param INTEGER)
+RETURNS VARCHAR(200)
+COMMENT 'f1_comment'
+LANGUAGE SQL
+NOT DETERMINISTIC
+MODIFIES SQL DATA
+SQL SECURITY DEFINER
+RETURN 'abc';
+GRANT EXECUTE ON FUNCTION f1 TO user1;
+CREATE
+DEFINER = CURRENT_USER
+FUNCTION f2 (param VARCHAR(100))
+RETURNS INTEGER
+DETERMINISTIC
+NO SQL
+SQL SECURITY INVOKER
+RETURN 123;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1
+ MODIFIES SQL DATA
+ COMMENT 'f1_comment'
+RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT 1 FROM DUAL;
+1
+1
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1
+ MODIFIES SQL DATA
+ COMMENT 'f1_comment'
+RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f2;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11)
+ NO SQL
+ DETERMINISTIC
+ SQL SECURITY INVOKER
+RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f2;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11)
+ NO SQL
+ DETERMINISTIC
+ SQL SECURITY INVOKER
+RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT f1(1) = 'abc';
+f1(1) = 'abc'
+1
+SELECT f2('abc') = 123;
+f2('abc') = 123
+1
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP USER 'user1';
diff --git a/mysql-test/suite/galera/r/galera_create_procedure.result b/mysql-test/suite/galera/r/galera_create_procedure.result
new file mode 100644
index 00000000000..6191ef48ee5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_create_procedure.result
@@ -0,0 +1,53 @@
+CREATE USER 'user1';
+CREATE TABLE t1 (f1 INTEGER);
+CREATE
+DEFINER = 'user1'
+PROCEDURE p1 (IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER)
+COMMENT 'p1_comment'
+LANGUAGE SQL
+NOT DETERMINISTIC
+MODIFIES SQL DATA
+SQL SECURITY DEFINER
+INSERT INTO t1 VALUES (1);
+GRANT EXECUTE ON PROCEDURE p1 TO user1;
+CREATE
+DEFINER = CURRENT_USER
+PROCEDURE p2 (param VARCHAR(100))
+DETERMINISTIC
+NO SQL
+SQL SECURITY INVOKER BEGIN END ;
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` PROCEDURE `p1`(IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER)
+ MODIFIES SQL DATA
+ COMMENT 'p1_comment'
+INSERT INTO t1 VALUES (1) latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT 1 FROM DUAL;
+1
+1
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` PROCEDURE `p1`(IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER)
+ MODIFIES SQL DATA
+ COMMENT 'p1_comment'
+INSERT INTO t1 VALUES (1) latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PROCEDURE p2;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(param VARCHAR(100))
+ NO SQL
+ DETERMINISTIC
+ SQL SECURITY INVOKER
+BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PROCEDURE p2;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(param VARCHAR(100))
+ NO SQL
+ DETERMINISTIC
+ SQL SECURITY INVOKER
+BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1(@a, @b, @c);
+CALL p2('abc');
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP USER 'user1';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_create_table_like.result b/mysql-test/suite/galera/r/galera_create_table_like.result
new file mode 100644
index 00000000000..b335101fa62
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_create_table_like.result
@@ -0,0 +1,47 @@
+CREATE SCHEMA schema1;
+CREATE SCHEMA schema2;
+USE schema1;
+CREATE TABLE real_table (f1 INTEGER) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE temp_table (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE myisam_table (f1 INTEGER) ENGINE=MyISAM;
+USE schema2;
+CREATE TABLE real_table1 LIKE schema1.real_table;
+CREATE TABLE real_table2 LIKE schema1.temp_table;
+CREATE TABLE real_table3 LIKE schema1.myisam_table;
+CREATE TEMPORARY TABLE temp_table1 LIKE schema1.real_table;
+CREATE TEMPORARY TABLE temp_table2 LIKE schema1.temp_table;
+CREATE TEMPORARY TABLE temp_table3 LIKE schema1.myisam_table;
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table' AND TABLE_SCHEMA = 'schema1';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'myisam_table' AND TABLE_SCHEMA = 'schema1';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table' AND TABLE_SCHEMA = 'schema1';
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table1' AND TABLE_SCHEMA = 'schema2';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table2' AND TABLE_SCHEMA = 'schema2';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table3' AND TABLE_SCHEMA = 'schema2';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table1' AND TABLE_SCHEMA = 'schema2';
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table2' AND TABLE_SCHEMA = 'schema2';
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table3' AND TABLE_SCHEMA = 'schema2';
+COUNT(*) = 0
+1
+DROP TABLE schema1.real_table;
+DROP TABLE schema1.myisam_table;
+DROP TABLE schema2.real_table1;
+DROP TABLE schema2.real_table2;
+DROP TABLE schema2.real_table3;
+DROP SCHEMA schema1;
+DROP SCHEMA schema2;
diff --git a/mysql-test/suite/galera/r/galera_create_trigger.result b/mysql-test/suite/galera/r/galera_create_trigger.result
new file mode 100644
index 00000000000..7e656081871
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_create_trigger.result
@@ -0,0 +1,42 @@
+CREATE TABLE definer_root (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+CREATE TABLE definer_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+CREATE TABLE definer_current_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+CREATE TABLE definer_default (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+CREATE USER 'user1';
+CREATE DEFINER=root@localhost TRIGGER definer_root BEFORE INSERT ON definer_root FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+CREATE DEFINER=user1 TRIGGER definer_user BEFORE INSERT ON definer_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+CREATE DEFINER=current_user TRIGGER definer_current_user BEFORE INSERT ON definer_current_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+CREATE TRIGGER definer_default BEFORE INSERT ON definer_default FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+INSERT INTO definer_root (f1) VALUES (1);
+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_root';
+DEFINER = 'root@localhost'
+1
+SELECT trigger_user = 'root@localhost' FROM definer_root;
+trigger_user = 'root@localhost'
+1
+INSERT INTO definer_user (f1) VALUES (1);
+SELECT DEFINER = 'user1@%' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_user';
+DEFINER = 'user1@%'
+1
+SELECT trigger_user = 'user1@%' FROM definer_user;
+trigger_user = 'user1@%'
+1
+INSERT INTO definer_current_user (f1) VALUES (1);
+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_current_user';
+DEFINER = 'root@localhost'
+1
+SELECT trigger_user = 'root@localhost' FROM definer_current_user;
+trigger_user = 'root@localhost'
+1
+INSERT INTO definer_default (f1) VALUES (1);
+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_default';
+DEFINER = 'root@localhost'
+1
+SELECT trigger_user = 'root@localhost' FROM definer_default;
+trigger_user = 'root@localhost'
+1
+DROP TABLE definer_current_user;
+DROP TABLE definer_user;
+DROP TABLE definer_root;
+DROP TABLE definer_default;
+DROP USER 'user1';
diff --git a/mysql-test/suite/galera/r/galera_ddl_multiline.result b/mysql-test/suite/galera/r/galera_ddl_multiline.result
new file mode 100644
index 00000000000..602f18326e8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ddl_multiline.result
@@ -0,0 +1,80 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t4 (f1 INTEGER) ENGINE=InnoDB;;
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t5 (f1 INTEGER) ENGINE=InnoDB;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CREATE TABLE t6 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t2 VALUES (1);;
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1, t2, t3, t4, t5, t6;
diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result
new file mode 100644
index 00000000000..28c3f4dd104
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_defaults.result
@@ -0,0 +1,122 @@
+SELECT COUNT(*) = 43 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
+COUNT(*) = 43
+1
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME LIKE 'wsrep_%'
+AND VARIABLE_NAME NOT IN (
+'WSREP_PROVIDER_OPTIONS',
+'WSREP_SST_RECEIVE_ADDRESS',
+'WSREP_NODE_ADDRESS',
+'WSREP_NODE_NAME',
+'WSREP_PROVIDER',
+'WSREP_DATA_HOME_DIR',
+'WSREP_NODE_INCOMING_ADDRESS',
+'WSREP_START_POSITION',
+'WSREP_PATCH_VERSION'
+)
+ORDER BY VARIABLE_NAME;
+VARIABLE_NAME VARIABLE_VALUE
+WSREP_AUTO_INCREMENT_CONTROL ON
+WSREP_CAUSAL_READS ON
+WSREP_CERTIFY_NONPK ON
+WSREP_CLUSTER_ADDRESS gcomm://
+WSREP_CLUSTER_NAME my_wsrep_cluster
+WSREP_CONVERT_LOCK_TO_TRX OFF
+WSREP_DBUG_OPTION
+WSREP_DEBUG OFF
+WSREP_DESYNC OFF
+WSREP_DIRTY_READS OFF
+WSREP_DRUPAL_282555_WORKAROUND OFF
+WSREP_FORCED_BINLOG_FORMAT NONE
+WSREP_GTID_DOMAIN_ID 0
+WSREP_GTID_MODE OFF
+WSREP_LOAD_DATA_SPLITTING ON
+WSREP_LOG_CONFLICTS OFF
+WSREP_MAX_WS_ROWS 0
+WSREP_MAX_WS_SIZE 2147483647
+WSREP_MYSQL_REPLICATION_BUNDLE 0
+WSREP_NOTIFY_CMD
+WSREP_ON ON
+WSREP_OSU_METHOD TOI
+WSREP_RECOVER OFF
+WSREP_REPLICATE_MYISAM OFF
+WSREP_RESTART_SLAVE OFF
+WSREP_RETRY_AUTOCOMMIT 1
+WSREP_SLAVE_FK_CHECKS ON
+WSREP_SLAVE_THREADS 1
+WSREP_SLAVE_UK_CHECKS OFF
+WSREP_SST_AUTH
+WSREP_SST_DONOR
+WSREP_SST_DONOR_REJECTS_QUERIES OFF
+WSREP_SST_METHOD rsync
+WSREP_SYNC_WAIT 15
+<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = no; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992;
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME LIKE 'wsrep_%'
+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
+COUNT(*)
+58
+SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME LIKE 'wsrep_%'
+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'
+ORDER BY VARIABLE_NAME;
+VARIABLE_NAME
+WSREP_APPLY_OOOE
+WSREP_APPLY_OOOL
+WSREP_APPLY_WINDOW
+WSREP_CAUSAL_READS
+WSREP_CERT_DEPS_DISTANCE
+WSREP_CERT_INDEX_SIZE
+WSREP_CERT_INTERVAL
+WSREP_CLUSTER_CONF_ID
+WSREP_CLUSTER_SIZE
+WSREP_CLUSTER_STATE_UUID
+WSREP_CLUSTER_STATUS
+WSREP_COMMIT_OOOE
+WSREP_COMMIT_OOOL
+WSREP_COMMIT_WINDOW
+WSREP_CONNECTED
+WSREP_DESYNC_COUNT
+WSREP_EVS_DELAYED
+WSREP_EVS_EVICT_LIST
+WSREP_EVS_REPL_LATENCY
+WSREP_EVS_STATE
+WSREP_FLOW_CONTROL_PAUSED
+WSREP_FLOW_CONTROL_PAUSED_NS
+WSREP_FLOW_CONTROL_RECV
+WSREP_FLOW_CONTROL_SENT
+WSREP_GCOMM_UUID
+WSREP_INCOMING_ADDRESSES
+WSREP_LAST_COMMITTED
+WSREP_LOCAL_BF_ABORTS
+WSREP_LOCAL_CACHED_DOWNTO
+WSREP_LOCAL_CERT_FAILURES
+WSREP_LOCAL_COMMITS
+WSREP_LOCAL_INDEX
+WSREP_LOCAL_RECV_QUEUE
+WSREP_LOCAL_RECV_QUEUE_AVG
+WSREP_LOCAL_RECV_QUEUE_MAX
+WSREP_LOCAL_RECV_QUEUE_MIN
+WSREP_LOCAL_REPLAYS
+WSREP_LOCAL_SEND_QUEUE
+WSREP_LOCAL_SEND_QUEUE_AVG
+WSREP_LOCAL_SEND_QUEUE_MAX
+WSREP_LOCAL_SEND_QUEUE_MIN
+WSREP_LOCAL_STATE
+WSREP_LOCAL_STATE_COMMENT
+WSREP_LOCAL_STATE_UUID
+WSREP_PROTOCOL_VERSION
+WSREP_PROVIDER_NAME
+WSREP_PROVIDER_VENDOR
+WSREP_PROVIDER_VERSION
+WSREP_READY
+WSREP_RECEIVED
+WSREP_RECEIVED_BYTES
+WSREP_REPLICATED
+WSREP_REPLICATED_BYTES
+WSREP_REPL_DATA_BYTES
+WSREP_REPL_KEYS
+WSREP_REPL_KEYS_BYTES
+WSREP_REPL_OTHER_BYTES
+WSREP_THREAD_COUNT
diff --git a/mysql-test/suite/galera/r/galera_delete_limit.result b/mysql-test/suite/galera/r/galera_delete_limit.result
new file mode 100644
index 00000000000..72bee18eab6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_delete_limit.result
@@ -0,0 +1,19 @@
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND();
+DELETE FROM t1 ORDER BY RAND() LIMIT 5;
+sum_matches
+1
+max_matches
+1
+DROP TABLE t1;
+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND();
+DELETE FROM t2 ORDER BY RAND() LIMIT 5;
+sum_matches
+1
+max_matches
+1
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_desync_overlapped.result b/mysql-test/suite/galera/r/galera_desync_overlapped.result
new file mode 100644
index 00000000000..a1e7d59a661
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_desync_overlapped.result
@@ -0,0 +1,45 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 1
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
+INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+SET GLOBAL wsrep_desync = 1;
+Warnings:
+Warning 1231 'wsrep_desync' is already ON.
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 1
+SET DEBUG_SYNC='now WAIT_FOR alter1';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
+INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+SET DEBUG_SYNC='RESET';
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET GLOBAL wsrep_desync = 0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET GLOBAL wsrep_desync = 0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1000
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1000
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_drop_multi.result b/mysql-test/suite/galera/r/galera_drop_multi.result
new file mode 100644
index 00000000000..d82ae3bec1a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_drop_multi.result
@@ -0,0 +1,20 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t5 (f1 INTEGER);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+DROP TABLE t1, t2, t3, t4;
+INSERT INTO t5 VALUES (1);
+COMMIT;
+SHOW CREATE TABLE t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+SHOW CREATE TABLE t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+SHOW CREATE TABLE t3;
+ERROR 42S02: Table 'test.t3' doesn't exist
+SHOW CREATE TABLE t4;
+ERROR 42S02: Table 'test.t4' doesn't exist
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t2,test.t4'' on query\. Default database: 'test'\. Query: 'DROP TABLE t1, t2, t3, t4', Error_code: 1051");
+DROP TABLE t5;
diff --git a/mysql-test/suite/galera/r/galera_enum.result b/mysql-test/suite/galera/r/galera_enum.result
new file mode 100644
index 00000000000..e853c5c9943
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_enum.result
@@ -0,0 +1,37 @@
+CREATE TABLE t1 (f1 ENUM('', 'one', 'two'), KEY (f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('');
+INSERT INTO t1 VALUES ('one'), ('two');
+INSERT INTO t1 VALUES (0), (1), (2);
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 1
+SELECT COUNT(*) = 6 FROM t1;
+COUNT(*) = 6
+1
+SELECT COUNT(*) = 2 FROM t1 where f1 = '';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM t1 where f1 = 'one';
+COUNT(*) = 2
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 ENUM('', 'one', 'two', 'three', 'four') PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (''), ('one'), ('two');
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = '';
+COUNT(*) = 1
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'three' where f1 = '';
+SET AUTOCOMMIt=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'four' where f1 = '';
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three';
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_events.result b/mysql-test/suite/galera/r/galera_events.result
new file mode 100644
index 00000000000..09d8406d5d0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_events.result
@@ -0,0 +1,18 @@
+CREATE EVENT event1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT 1;
+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
+DEFINER= 'root@localhost' ORIGINATOR = 1 STATUS = 'SLAVESIDE_DISABLED' EVENT_TYPE = 'ONE TIME' ON_COMPLETION = 'NOT PRESERVE'
+1 1 1 1 1
+ALTER EVENT event1 DISABLE;
+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
+DEFINER= 'root@localhost' ORIGINATOR = 1 STATUS = 'SLAVESIDE_DISABLED' EVENT_TYPE = 'ONE TIME' ON_COMPLETION = 'NOT PRESERVE'
+1 1 1 1 1
+SET GLOBAL event_scheduler = ON;
+CREATE EVENT event2 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION NOT PRESERVE DO SELECT 1;
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event2';
+COUNT(*) = 0
+1
+DROP EVENT event1;
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
+COUNT(*) = 0
+1
+SET GLOBAL event_scheduler = OFF;;
diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
new file mode 100644
index 00000000000..89f4301a0b4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
@@ -0,0 +1,30 @@
+CREATE TABLE grandparent (
+id INT NOT NULL PRIMARY KEY
+) ENGINE=InnoDB;
+CREATE TABLE parent (
+id INT NOT NULL PRIMARY KEY,
+grandparent_id INT,
+FOREIGN KEY (grandparent_id)
+REFERENCES grandparent(id)
+ON DELETE CASCADE
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT NOT NULL PRIMARY KEY,
+parent_id INT,
+FOREIGN KEY (parent_id)
+REFERENCES parent(id)
+ON DELETE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO grandparent VALUES (1),(2);
+INSERT INTO parent VALUES (1,1), (2,2);
+INSERT INTO child VALUES (1,1), (2,2);
+DELETE FROM grandparent WHERE id = 1;
+SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
+COUNT(*) = 0
+1
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE grandparent;
diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_update.result b/mysql-test/suite/galera/r/galera_fk_cascade_update.result
new file mode 100644
index 00000000000..2ab2ad31a13
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_cascade_update.result
@@ -0,0 +1,30 @@
+CREATE TABLE grandparent (
+id INT NOT NULL PRIMARY KEY
+) ENGINE=InnoDB;
+CREATE TABLE parent (
+id INT NOT NULL PRIMARY KEY,
+grandparent_id INT,
+FOREIGN KEY (grandparent_id)
+REFERENCES grandparent(id)
+ON UPDATE CASCADE
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT NOT NULL PRIMARY KEY,
+grandparent_id INT,
+FOREIGN KEY (grandparent_id)
+REFERENCES parent(grandparent_id)
+ON UPDATE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO grandparent VALUES (1),(2);
+INSERT INTO parent VALUES (1,1), (2,2);
+INSERT INTO child VALUES (1,1), (2,2);
+UPDATE grandparent SET id = 3 WHERE id = 1;
+SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM child WHERE grandparent_id = 3;
+COUNT(*) = 1
+1
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE grandparent;
diff --git a/mysql-test/suite/galera/r/galera_fk_conflict.result b/mysql-test/suite/galera/r/galera_fk_conflict.result
new file mode 100644
index 00000000000..ae6c4823a54
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_conflict.result
@@ -0,0 +1,23 @@
+CREATE TABLE parent (
+id INT PRIMARY KEY,
+KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY,
+parent_id INT,
+FOREIGN KEY (parent_id)
+REFERENCES parent(id)
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1), (2);
+INSERT INTO child VALUES (1,1);
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+DELETE FROM parent WHERE id = 2;
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO child VALUES (2, 2);
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/r/galera_fk_mismatch.result b/mysql-test/suite/galera/r/galera_fk_mismatch.result
new file mode 100644
index 00000000000..07cdb1b09a2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_mismatch.result
@@ -0,0 +1,25 @@
+CREATE TABLE parent (
+id1 INT,
+id2 INT,
+PRIMARY KEY (id1, id2) /* Multipart PK */
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY,
+parent_id1 INT,
+FOREIGN KEY (parent_id1)
+REFERENCES parent(id1) /* FK is subset of PK above */
+ON UPDATE CASCADE
+ON DELETE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1, 2);
+INSERT INTO child VALUES (1, 1);
+UPDATE parent SET id1 = 3 WHERE id1 = 1;
+SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3;
+COUNT(*) = 1
+1
+DELETE FROM parent WHERE id1 = 3;
+SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3;
+COUNT(*) = 0
+1
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/r/galera_fk_multicolumn.result b/mysql-test/suite/galera/r/galera_fk_multicolumn.result
new file mode 100644
index 00000000000..a86b87a83ef
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_multicolumn.result
@@ -0,0 +1,35 @@
+CREATE TABLE t0 (
+f1 INT PRIMARY KEY,
+f2 INT UNIQUE
+);
+CREATE TABLE t1 (
+f1 INT PRIMARY KEY,
+FOREIGN KEY (f1)
+REFERENCES t0(f1)
+ON UPDATE CASCADE
+);
+CREATE TABLE t2 (
+f2 INT PRIMARY KEY,
+FOREIGN KEY (f2)
+REFERENCES t0(f2)
+ON UPDATE CASCADE
+);
+INSERT INTO t0 VALUES (0, 0);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t2 VALUES (0);
+UPDATE t0 SET f1 = 1, f2 = 2;
+SELECT f1 = 1 FROM t1 WHERE f1 = 1;
+f1 = 1
+1
+SELECT f2 = 2 FROM t2 WHERE f2 = 2;
+f2 = 2
+1
+SELECT f1 = 1 FROM t1;
+f1 = 1
+1
+SELECT f2 = 2 FROM t2;
+f2 = 2
+1
+DROP TABLE t2;
+DROP TABLE t1;
+DROP TABLE t0;
diff --git a/mysql-test/suite/galera/r/galera_fk_multitable.result b/mysql-test/suite/galera/r/galera_fk_multitable.result
new file mode 100644
index 00000000000..e77128d3b04
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_multitable.result
@@ -0,0 +1,22 @@
+CREATE TABLE t0 (
+f0 INT PRIMARY KEY
+);
+CREATE TABLE t1 (
+f1 INT PRIMARY KEY,
+f0 INTEGER,
+FOREIGN KEY (f0)
+REFERENCES t0(f0)
+ON DELETE CASCADE
+);
+INSERT INTO t0 VALUES (0), (1);
+INSERT INTO t1 VALUES (0, 0);
+INSERT INTO t1 VALUES (1, 0);
+DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0;
+SELECT COUNT(*) = 1 FROM t0;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+DROP TABLE t0;
diff --git a/mysql-test/suite/galera/r/galera_fk_no_pk.result b/mysql-test/suite/galera/r/galera_fk_no_pk.result
new file mode 100644
index 00000000000..e4f92863d92
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_no_pk.result
@@ -0,0 +1,28 @@
+CREATE TABLE parent (
+id INT,
+KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT,
+parent_id INT,
+FOREIGN KEY (parent_id)
+REFERENCES parent(id)
+ON UPDATE CASCADE
+ON DELETE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1), (1), (2), (2);
+INSERT INTO child VALUES (1,1), (2,2), (1,1), (2,2);
+DELETE FROM parent WHERE id = 1;
+SELECT COUNT(*) = 0 FROM child WHERE id = 1;
+COUNT(*) = 0
+1
+UPDATE parent SET id = 3 WHERE id = 2;
+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
+COUNT(*) = 0
+1
+SELECT parent_id = 3 FROM child WHERE id = 2;
+parent_id = 3
+1
+1
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/r/galera_fk_selfreferential.result b/mysql-test/suite/galera/r/galera_fk_selfreferential.result
new file mode 100644
index 00000000000..25c37046e88
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_selfreferential.result
@@ -0,0 +1,13 @@
+CREATE TABLE t1 (
+f1 INT NOT NULL PRIMARY KEY,
+f2 INT,
+FOREIGN KEY (f2)
+REFERENCES t1(f1)
+ON DELETE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1), (2, 1);
+DELETE FROM t1 WHERE f1 = 1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_fk_setnull.result b/mysql-test/suite/galera/r/galera_fk_setnull.result
new file mode 100644
index 00000000000..f7fb9d04040
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_setnull.result
@@ -0,0 +1,30 @@
+CREATE TABLE parent (
+id INT NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT,
+parent_id INT,
+FOREIGN KEY (parent_id)
+REFERENCES parent(id)
+ON UPDATE SET NULL
+ON DELETE SET NULL
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1),(2);
+INSERT INTO child VALUES (1,1),(2,2);
+DELETE FROM parent WHERE id = 1;
+SELECT parent_id IS NULL FROM child WHERE id = 1;
+parent_id IS NULL
+1
+SELECT parent_id IS NULL FROM child WHERE id = 1;
+parent_id IS NULL
+1
+UPDATE parent SET id = 3 WHERE id = 2;
+SELECT parent_id IS NULL FROM child WHERE id = 2;
+parent_id IS NULL
+1
+SELECT parent_id IS NULL FROM child WHERE id = 2;
+parent_id IS NULL
+1
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/r/galera_flush.result b/mysql-test/suite/galera/r/galera_flush.result
new file mode 100644
index 00000000000..71226432eda
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_flush.result
@@ -0,0 +1,88 @@
+DROP TABLE IF EXISTS t1, t2;
+FLUSH DES_KEY_FILE;
+wsrep_last_committed_diff
+1
+FLUSH HOSTS;
+wsrep_last_committed_diff
+1
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+INSERT INTO mysql.user VALUES('localhost','user1',PASSWORD('pass1'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N','N','',0);
+FLUSH PRIVILEGES;
+DELETE FROM mysql.user WHERE user = 'user1';
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+FLUSH PRIVILEGES;
+FLUSH QUERY CACHE;
+wsrep_last_committed_diff
+1
+FLUSH STATUS;
+wsrep_last_committed_diff
+1
+FLUSH USER_RESOURCES;
+wsrep_last_committed_diff
+1
+FLUSH TABLES;
+wsrep_last_committed_diff
+1
+CREATE TABLE t2 (f1 INTEGER);
+FLUSH TABLES t2;
+wsrep_last_committed_diff
+1
+FLUSH ERROR LOGS;
+wsrep_last_committed_diff
+1
+FLUSH SLOW LOGS;
+wsrep_last_committed_diff
+1
+FLUSH GENERAL LOGS;
+wsrep_last_committed_diff
+1
+FLUSH ENGINE LOGS;
+wsrep_last_committed_diff
+1
+FLUSH RELAY LOGS;
+wsrep_last_committed_diff
+1
+SET @userstat_old= @@userstat;
+SET GLOBAL userstat=ON;
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+wsrep_last_committed_diff
+1
+SET @old_thread_statistics= @@global.thread_statistics;
+SET GLOBAL thread_statistics= ON;
+FLUSH THREAD_STATISTICS;
+wsrep_last_committed_diff
+1
+FLUSH CHANGED_PAGE_BITMAPS;
+wsrep_last_committed_diff
+1
+CREATE TABLE t1 (f1 INTEGER);
+FLUSH LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+wsrep_last_committed_diff
+1
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+wsrep_last_committed_diff
+1
+LOCK TABLES t1 READ;
+FLUSH TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+wsrep_last_committed_diff
+1
+FLUSH TABLES t1;
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+DROP TABLE t2;
+SET GLOBAL userstat= @userstat_old;
+SET GLOBAL thread_statistics= @old_thread_statistics;
diff --git a/mysql-test/suite/galera/r/galera_flush_local.result b/mysql-test/suite/galera/r/galera_flush_local.result
new file mode 100644
index 00000000000..3fdd541b513
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_flush_local.result
@@ -0,0 +1,145 @@
+DROP TABLE IF EXISTS t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+FLUSH LOCAL DES_KEY_FILE;
+FLUSH LOCAL HOSTS;
+FLUSH LOCAL QUERY CACHE;
+FLUSH LOCAL STATUS;
+FLUSH LOCAL PRIVILEGES;
+FLUSH LOCAL USER_RESOURCES;
+FLUSH LOCAL TABLES;
+FLUSH LOCAL TABLES t2;
+FLUSH LOCAL ERROR LOGS;
+FLUSH LOCAL SLOW LOGS;
+FLUSH LOCAL GENERAL LOGS;
+FLUSH LOCAL ENGINE LOGS;
+FLUSH LOCAL RELAY LOGS;
+FLUSH LOCAL CLIENT_STATISTICS;
+FLUSH LOCAL INDEX_STATISTICS;
+FLUSH LOCAL TABLE_STATISTICS;
+FLUSH LOCAL USER_STATISTICS;
+FLUSH LOCAL LOGS;
+FLUSH LOCAL BINARY LOGS;
+FLUSH LOCAL TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+FLUSH LOCAL TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1;
+ANALYZE LOCAL TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+OPTIMIZE LOCAL TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+REPAIR LOCAL TABLE x1, x2;
+Table Op Msg_type Msg_text
+test.x1 repair status OK
+test.x2 repair status OK
+wsrep_last_committed_diff
+1
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+DROP TABLE t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+set wsrep_on=0;
+FLUSH DES_KEY_FILE;
+FLUSH HOSTS;
+FLUSH QUERY CACHE;
+FLUSH STATUS;
+FLUSH PRIVILEGES;
+FLUSH USER_RESOURCES;
+FLUSH TABLES;
+FLUSH TABLES t2;
+FLUSH ERROR LOGS;
+FLUSH SLOW LOGS;
+FLUSH GENERAL LOGS;
+FLUSH ENGINE LOGS;
+FLUSH RELAY LOGS;
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+FLUSH LOGS;
+FLUSH BINARY LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+FLUSH TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+FLUSH TABLES t1;
+ANALYZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+OPTIMIZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+REPAIR TABLE x1, x2;
+Table Op Msg_type Msg_text
+test.x1 repair status OK
+test.x2 repair status OK
+wsrep_last_committed_diff
+1
+wsrep_last_committed_diff2
+1
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+set wsrep_on=1;
+DROP TABLE t1, t2, x1, x2;
diff --git a/mysql-test/suite/galera/r/galera_forced_binlog_format.result b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
new file mode 100644
index 00000000000..92e78685b58
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
@@ -0,0 +1,43 @@
+RESET MASTER;
+SET SESSION binlog_format = 'STATEMENT';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION binlog_format = 'MIXED';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: MIXED
+INSERT INTO t1 VALUES (2);
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 249;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 <Pos> Gtid_list 1 <End_log_pos> []
+mysqld-bin.000001 <Pos> Binlog_checkpoint 1 <End_log_pos> mysqld-bin.000001
+mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> GTID 0-1-1
+mysqld-bin.000001 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2
+mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
+mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F
+mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */
+mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-3
+mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
+mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F
+mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */
+DROP TABLE t1;
+#
+# MDEV-9401: wsrep_forced_binlog_format with binlog causes crash
+#
+SET SESSION binlog_format = 'ROW';
+CREATE DATABASE testdb_9401;
+USE testdb_9401;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE USER dummy@localhost;
+GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
+FLUSH PRIVILEGES;
+SHOW GRANTS FOR dummy@localhost;
+Grants for dummy@localhost
+GRANT USAGE ON *.* TO 'dummy'@'localhost'
+GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO 'dummy'@'localhost'
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
+DROP USER dummy@localhost;
+DROP DATABASE testdb_9401;
+# End of tests
diff --git a/mysql-test/suite/galera/r/galera_ftwrl.result b/mysql-test/suite/galera/r/galera_ftwrl.result
new file mode 100644
index 00000000000..c216b52650b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ftwrl.result
@@ -0,0 +1,16 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+FLUSH TABLES WITH READ LOCK;
+INSERT INTO t1 VALUES (1);
+SHOW TABLES;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UNLOCK TABLES;
+SHOW TABLES;
+Tables_in_test
+t1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ftwrl_drain.result b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
new file mode 100644
index 00000000000..d704699925b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
@@ -0,0 +1,26 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+FLUSH TABLES WITH READ LOCK;;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET SESSION lock_wait_timeout = 1;
+SET SESSION innodb_lock_wait_timeout=1;
+SET SESSION wait_timeout=1;
+INSERT INTO t2 VALUES (2);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UNLOCK TABLES;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+INSERT INTO t1 VALUES (3);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_fulltext.result b/mysql-test/suite/galera/r/galera_fulltext.result
new file mode 100644
index 00000000000..84ae0a116a1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fulltext.result
@@ -0,0 +1,26 @@
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
+SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%';
+COUNT(*) = 13
+1
+INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
+SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
+COUNT(f2) = 1000
+1
+UPDATE t1 SET f2 = 'abcdefjhk';
+SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
+COUNT(f2) = 1000
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB;
+INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz');
+COUNT(f1) = 1000
+1
+UPDATE t1 SET f1 = 'abcdefjhk';
+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');
+COUNT(f1) = 1000
+1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_gcache_recover.result b/mysql-test/suite/galera/r/galera_gcache_recover.result
new file mode 100644
index 00000000000..127bcba39d8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gcache_recover.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+INSERT INTO t1 VALUES (2);
+Killing server ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+INSERT INTO t1 VALUES (3);
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+include/diff_servers.inc [servers=1 2]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [async IST sender starting to serve]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result b/mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result
new file mode 100644
index 00000000000..30ee5772411
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result
@@ -0,0 +1,19 @@
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+Killing server ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1;
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [IST first seqno 2 not found from cache, falling back to SST]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
diff --git a/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result
new file mode 100644
index 00000000000..868b39bfbd6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result
@@ -0,0 +1,107 @@
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE PROCEDURE insert_simple ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef');
+END WHILE;
+END|
+CREATE PROCEDURE insert_multi ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+END WHILE;
+END|
+CREATE PROCEDURE insert_transaction ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+SET AUTOCOMMIT = OFF;
+WHILE 1 DO
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+COMMIT;
+END WHILE;
+END|
+CREATE PROCEDURE update_simple ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = CONCAT(f2,f2);
+END WHILE;
+END|
+CREATE PROCEDURE insert_1k ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024));
+END WHILE;
+END|
+CREATE PROCEDURE insert_1m ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024));
+END WHILE;
+END|
+CREATE PROCEDURE insert_10m ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+END WHILE;
+END|
+CALL insert_simple();;
+CALL insert_multi();;
+CALL insert_transaction ();;
+CALL update_simple ();;
+CALL insert_1k ();;
+CALL insert_1m ();;
+CALL insert_10m ();;
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+Killing server ...
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1;
+DROP TABLE ten;
+DROP PROCEDURE insert_simple;
+DROP PROCEDURE insert_multi;
+DROP PROCEDURE insert_transaction;
+DROP PROCEDURE update_simple;
+DROP PROCEDURE insert_1k;
+DROP PROCEDURE insert_1m;
+CALL mtr.add_suppression("conflict state 7 after post commit");
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [async IST sender starting to serve]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
diff --git a/mysql-test/suite/galera/r/galera_gcs_fc_limit.result b/mysql-test/suite/galera/r/galera_gcs_fc_limit.result
new file mode 100644
index 00000000000..9463b5f8eef
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gcs_fc_limit.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
+LOCK TABLE t1 WRITE;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+UNLOCK TABLES;
+INSERT INTO t1 VALUES (6);
+SELECT COUNT(*) = 6 FROM t1;
+COUNT(*) = 6
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_gcs_fragment.result b/mysql-test/suite/galera/r/galera_gcs_fragment.result
new file mode 100644
index 00000000000..0c9c1819f60
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gcs_fragment.result
@@ -0,0 +1,24 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
+SET GLOBAL wsrep_cluster_address='';
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,gcs_core_after_frag_send';
+SET SESSION wsrep_retry_autocommit=0;
+INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SET GLOBAL wsrep_provider_options = 'signal=gcs_core_after_frag_send';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SELECT * FROM t1;
+f1 f2
+2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+SELECT * FROM t1;
+f1 f2
+2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result b/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result
new file mode 100644
index 00000000000..606cb549def
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result
@@ -0,0 +1,15 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 VARCHAR(512) UNIQUE) ENGINE=InnoDB;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+INSERT INTO t2 VALUES (REPEAT('x', 512));
+SELECT COUNT(*) = 10000 FROM t1;
+COUNT(*) = 10000
+1
+SELECT LENGTH(f1) = 512 FROM t2 WHERE f1 = REPEAT('x', 512);
+LENGTH(f1) = 512
+1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_gra_log.result b/mysql-test/suite/galera/r/galera_gra_log.result
new file mode 100644
index 00000000000..9f5cbdd75fc
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gra_log.result
@@ -0,0 +1,41 @@
+SET SESSION wsrep_on=OFF;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t1 (f1 INTEGER);
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at 4
+<ISO TIMESTAMP> server id 2 end_log_pos 120 Start: binlog v 4, server v 5.6.24-debug-log created 150804 11:37:14 at startup
+# Warning: this binlog is either in use or was not closed properly.
+ROLLBACK/*!*/;
+BINLOG '
+unnAVQ8CAAAAdAAAAHgAAAABAAQANS42LjI0LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAC6ecBVEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAKNu
+Jfk=
+'/*!*/;
+# at 120
+<ISO TIMESTAMP> server id 1 end_log_pos 91 Query thread_id=<QUERY_THREAD_ID> exec_time=0 error_code=0
+use `test`/*!*/;
+SET TIMESTAMP=<TIMESTAMP>/*!*/;
+SET @@session.pseudo_thread_id=<PSEUDO_THREAD_ID>/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=1073741824/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (f1 INTEGER)
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+SET SESSION wsrep_on=ON;
+CALL mtr.add_suppression("Slave SQL: Error 'Table 't1' already exists' on query");
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_gtid.result b/mysql-test/suite/galera/r/galera_gtid.result
new file mode 100644
index 00000000000..546c29cb49a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gtid.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 2;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+COUNT(*) = 1
+1
+gtid_binlog_state_equal
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_gtid_slave.result b/mysql-test/suite/galera/r/galera_gtid_slave.result
new file mode 100644
index 00000000000..40f3f1c0d53
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gtid_slave.result
@@ -0,0 +1,26 @@
+START SLAVE;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+begin;
+insert into t2 values(21);
+insert into t2 values(22);
+commit;
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-2
+INSERT INTO t1 VALUES(4);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-2,2-3-3
+DROP TABLE t1,t2;
+reset master;
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+reset master;
diff --git a/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result
new file mode 100644
index 00000000000..81fae57d731
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result
@@ -0,0 +1,130 @@
+#Connection 2
+START SLAVE;
+#Connection 1
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(1,11);
+INSERT INTO t2 VALUES(2,22);
+INSERT INTO t2 VALUES(3,33);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4
+include/save_master_gtid.inc
+#Connection 2
+include/sync_with_master_gtid.inc
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4
+INSERT INTO t2 VALUES(4,44);
+INSERT INTO t2 VALUES(5,55);
+INSERT INTO t2 VALUES(6,66);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-3
+#Connection 3
+INSERT INTO t2 VALUES(7,77);
+INSERT INTO t2 VALUES(8,88);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-3,2-3-5
+#Connection 1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+include/save_master_gtid.inc
+#Connection 2
+include/sync_with_master_gtid.inc
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+#Connection 3
+Shutting down server ...
+#Connection 2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+#Connection 3
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node3_committed_after');
+INSERT INTO t1 VALUES ('node3_committed_after');
+COMMIT;
+#Connection 2
+Select * from t1 order by f1;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_during
+node1_committed_during
+node2_committed_before
+node2_committed_before
+node3_committed_after
+node3_committed_after
+#Connection 3
+Select * from t1 order by f1;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_during
+node1_committed_during
+node2_committed_before
+node2_committed_before
+node3_committed_after
+node3_committed_after
+#Connection 2
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-6,2-2-7,2-3-8
+#Connection 3
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-6,2-2-7,2-3-8
+#Connection 1
+SET AUTOCOMMIT=ON;
+#Connection 2
+SET AUTOCOMMIT=ON;
+#Connection 3
+SET AUTOCOMMIT=ON;
+#Connection 2
+STOP slave;
+INSERT INTO t1 VALUES ('node2_slave_stoped');
+#Connection 1
+INSERT INTO t1 VALUES ('node1_normal_entry');
+include/save_master_gtid.inc
+#Connection 2
+INSERT INTO t1 VALUES ('node2_slave_stoped_inserted');
+start slave;
+include/sync_with_master_gtid.inc
+INSERT INTO t1 VALUES ('node2_slave_started');
+SELECT count(*) from t1;
+count(*)
+12
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-7,2-3-8,2-2-11
+#Connection 3
+SELECT count(*) from t1;
+count(*)
+12
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-7,2-3-8,2-2-11
+#Connection 1
+DROP TABLE t2,t1;
+#Connection 2
+#Connection 3
+#Connection 2
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+#Connection 3
+reset master;
+#Connection 1
+reset master;
diff --git a/mysql-test/suite/galera/r/galera_insert_ignore.result b/mysql-test/suite/galera/r/galera_insert_ignore.result
new file mode 100644
index 00000000000..b98a308efb5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_insert_ignore.result
@@ -0,0 +1,52 @@
+SET GLOBAL wsrep_sync_wait = 15;
+SET GLOBAL wsrep_sync_wait = 15;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1), (2);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+SELECT * FROM t1;
+f1
+1
+2
+SELECT * FROM t1;
+f1
+1
+2
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (0), (2), (3);
+INSERT IGNORE INTO t1 SELECT f1 FROM t2;
+Warnings:
+Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+SELECT * FROM t1;
+f1
+0
+1
+2
+3
+SELECT * FROM t1;
+f1
+0
+1
+2
+3
+CREATE TABLE t3 (f1 INTEGER UNIQUE) Engine=InnoDB;
+INSERT INTO t3 VALUES (NULL);
+INSERT IGNORE INTO t3 VALUES (1), (NULL), (2);
+SELECT * FROM t3;
+f1
+NULL
+NULL
+1
+2
+SELECT * FROM t3;
+f1
+NULL
+NULL
+1
+2
+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);
diff --git a/mysql-test/suite/galera/r/galera_insert_multi.result b/mysql-test/suite/galera/r/galera_insert_multi.result
new file mode 100644
index 00000000000..33717781f2c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_insert_multi.result
@@ -0,0 +1,58 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t1 VALUES (3),(4);
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER, KEY (f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(1);
+INSERT INTO t1 VALUES (2),(2);
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1), (2);
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (2), (1);
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ROLLBACK;
+INSERT INTO t1 VALUES (1), (2);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1), (2);
+START TRANSACTION;
+INSERT INTO t1 VALUES (2), (1);
+ROLLBACK;
+COMMIT;
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result
new file mode 100644
index 00000000000..5421b234ee1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result
@@ -0,0 +1,184 @@
+Performing State Transfer on a server that has been killed and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug = 'd,sync.alter_opened_table';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET wsrep_sync_wait = 0;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/galera_ist_mysqldump.result b/mysql-test/suite/galera/r/galera_ist_mysqldump.result
new file mode 100644
index 00000000000..788d60051b5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_mysqldump.result
@@ -0,0 +1,285 @@
+Setting SST method to mysqldump ...
+CREATE USER 'sst';
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+Performing State Transfer on a server that has been shut down cleanly and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug = 'd,sync.alter_opened_table';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET wsrep_sync_wait = 0;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+DROP USER sst;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
+CALL mtr.add_suppression("InnoDB: New log files created");
+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+CALL mtr.add_suppression("Can't open and lock time zone table");
+CALL mtr.add_suppression("Can't open and lock privilege tables");
+CALL mtr.add_suppression("Info table is not ready to be used");
+CALL mtr.add_suppression("Native table .* has the wrong structure");
diff --git a/mysql-test/suite/galera/r/galera_ist_progress.result b/mysql-test/suite/galera/r/galera_ist_progress.result
new file mode 100644
index 00000000000..9fc7febbea5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_progress.result
@@ -0,0 +1,19 @@
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+INSERT INTO t1 VALUES (10);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+include/assert_grep.inc [Receiving IST: 11 writesets, seqnos]
+include/assert_grep.inc [Receiving IST\.\.\. 0\.0% \( 0/11 events\) complete]
+include/assert_grep.inc [Receiving IST\.\.\.100\.0% \(11/11 events\) complete]
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_recv_bind.result b/mysql-test/suite/galera/r/galera_ist_recv_bind.result
new file mode 100644
index 00000000000..de4e07fbe41
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_recv_bind.result
@@ -0,0 +1,13 @@
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'
+1
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'
+1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
new file mode 100644
index 00000000000..ca6848fb925
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
@@ -0,0 +1,32 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a');
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+Loading wsrep_provider ...
+SET SESSION wsrep_on=OFF;
+SET SESSION wsrep_on=ON;
+UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
+UPDATE t1 SET f2 = 'e' WHERE f1 > 4;
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+UPDATE t1 SET f2 = 'f' WHERE f1 > 5;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+4 d
+5 e
+6 f
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+4 d
+5 e
+6 f
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result
new file mode 100644
index 00000000000..0b25a299b24
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_rsync.result
@@ -0,0 +1,358 @@
+Performing State Transfer on a server that has been temporarily disconnected
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Loading wsrep provider ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET wsrep_sync_wait = 0;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result
new file mode 100644
index 00000000000..175e7443a4d
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result
@@ -0,0 +1,357 @@
+Performing State Transfer on a server that has been temporarily disconnected
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Loading wsrep provider ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug = 'd,sync.alter_opened_table';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET wsrep_sync_wait = 0;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/galera_kill_applier.result b/mysql-test/suite/galera/r/galera_kill_applier.result
new file mode 100644
index 00000000000..fe4911639ed
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_kill_applier.result
@@ -0,0 +1,4 @@
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
diff --git a/mysql-test/suite/galera/r/galera_kill_ddl.result b/mysql-test/suite/galera/r/galera_kill_ddl.result
new file mode 100644
index 00000000000..b83226bbd42
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_kill_ddl.result
@@ -0,0 +1,8 @@
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+Killing server ...
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_kill_largechanges.result b/mysql-test/suite/galera/r/galera_kill_largechanges.result
new file mode 100644
index 00000000000..a37056ad9b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_kill_largechanges.result
@@ -0,0 +1,14 @@
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB;
+Killing server ...
+INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+SELECT COUNT(*) = 1000000 FROM t1;
+COUNT(*) = 1000000
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-test/suite/galera/r/galera_kill_nochanges.result
new file mode 100644
index 00000000000..db3c75e2886
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_kill_nochanges.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+Killing server ...
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_kill_smallchanges.result b/mysql-test/suite/galera/r/galera_kill_smallchanges.result
new file mode 100644
index 00000000000..8409740a035
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_kill_smallchanges.result
@@ -0,0 +1,11 @@
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+Killing server ...
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_lock_table.result b/mysql-test/suite/galera/r/galera_lock_table.result
new file mode 100644
index 00000000000..16e9037a4de
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_lock_table.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+LOCK TABLE t1 READ;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+SET SESSION wsrep_sync_wait=0;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+UNLOCK TABLES;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result
new file mode 100644
index 00000000000..4772f347375
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_log_bin.result
@@ -0,0 +1,59 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 2 FROM t2;
+COUNT(*) = 2
+1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+FLUSH LOGS;
+SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,18;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000002 # Gtid # # GTID 0-1-1
+mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2
+mysqld-bin.000002 # Table_map # # table_id: # (test.t1)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
+mysqld-bin.000002 # Gtid # # GTID 0-1-3
+mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
+mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4
+mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
+mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5
+mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
+mysqld-bin.000002 # Gtid # # GTID 0-1-6
+mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,18;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000003 # Gtid # # GTID 0-1-1
+mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2
+mysqld-bin.000003 # Table_map # # table_id: # (test.t1)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
+mysqld-bin.000003 # Gtid # # GTID 0-1-3
+mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
+mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4
+mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
+mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5
+mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
+mysqld-bin.000003 # Gtid # # GTID 0-1-6
+mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
+DROP TABLE t1;
+DROP TABLE t2;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_log_output_csv.result b/mysql-test/suite/galera/r/galera_log_output_csv.result
new file mode 100644
index 00000000000..cdb5ee49f3e
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_log_output_csv.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) > 0 FROM mysql.general_log;
+COUNT(*) > 0
+1
+SELECT 1 = 1 FROM t1;
+1 = 1
+1
+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 1 = 1 FROM t1';
+COUNT(*) = 1
+1
+SELECT 2 = 2 FROM t1;
+2 = 2
+1
+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1';
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_many_columns.result b/mysql-test/suite/galera/r/galera_many_columns.result
new file mode 100644
index 00000000000..6fa574e47c2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_columns.result
@@ -0,0 +1,32 @@
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+SELECT f1 = 'ABC', f1017 = 'ABC' FROM t1;
+f1 = 'ABC' f1017 = 'ABC'
+1 1
+UPDATE t1 SET f1 = 'XYZ', f1017 = 'XYZ' ;
+SELECT f1 = 'XYZ', f1017 = 'XYZ' FROM t1 WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+f1 = 'XYZ' f1017 = 'XYZ'
+1 1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'KLM' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'CDE' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ROLLBACK;
+ROLLBACK;
+START TRANSACTION;
+INSERT INTO t1 (f1, f1017) VALUES ('BCE','BCE');
+INSERT INTO t1 (f1, f1017) VALUES ('CED','CED');
+INSERT INTO t1 (f1, f1017) VALUES ('EDF','EDF');
+INSERT INTO t1 (f1, f1017) VALUES ('FED','FED');
+ROLLBACK;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_many_indexes.result b/mysql-test/suite/galera/r/galera_many_indexes.result
new file mode 100644
index 00000000000..ab6eec550a1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_indexes.result
@@ -0,0 +1,123 @@
+CREATE TABLE t1 (f1 VARCHAR(767) PRIMARY KEY) ENGINE=InnoDB;
+CREATE UNIQUE INDEX i63 ON t1(f1);
+CREATE UNIQUE INDEX i62 ON t1(f1);
+CREATE UNIQUE INDEX i61 ON t1(f1);
+CREATE UNIQUE INDEX i60 ON t1(f1);
+CREATE UNIQUE INDEX i59 ON t1(f1);
+CREATE UNIQUE INDEX i58 ON t1(f1);
+CREATE UNIQUE INDEX i57 ON t1(f1);
+CREATE UNIQUE INDEX i56 ON t1(f1);
+CREATE UNIQUE INDEX i55 ON t1(f1);
+CREATE UNIQUE INDEX i54 ON t1(f1);
+CREATE UNIQUE INDEX i53 ON t1(f1);
+CREATE UNIQUE INDEX i52 ON t1(f1);
+CREATE UNIQUE INDEX i51 ON t1(f1);
+CREATE UNIQUE INDEX i50 ON t1(f1);
+CREATE UNIQUE INDEX i49 ON t1(f1);
+CREATE UNIQUE INDEX i48 ON t1(f1);
+CREATE UNIQUE INDEX i47 ON t1(f1);
+CREATE UNIQUE INDEX i46 ON t1(f1);
+CREATE UNIQUE INDEX i45 ON t1(f1);
+CREATE UNIQUE INDEX i44 ON t1(f1);
+CREATE UNIQUE INDEX i43 ON t1(f1);
+CREATE UNIQUE INDEX i42 ON t1(f1);
+CREATE UNIQUE INDEX i41 ON t1(f1);
+CREATE UNIQUE INDEX i40 ON t1(f1);
+CREATE UNIQUE INDEX i39 ON t1(f1);
+CREATE UNIQUE INDEX i38 ON t1(f1);
+CREATE UNIQUE INDEX i37 ON t1(f1);
+CREATE UNIQUE INDEX i36 ON t1(f1);
+CREATE UNIQUE INDEX i35 ON t1(f1);
+CREATE UNIQUE INDEX i34 ON t1(f1);
+CREATE UNIQUE INDEX i33 ON t1(f1);
+CREATE UNIQUE INDEX i32 ON t1(f1);
+CREATE UNIQUE INDEX i31 ON t1(f1);
+CREATE UNIQUE INDEX i30 ON t1(f1);
+CREATE UNIQUE INDEX i29 ON t1(f1);
+CREATE UNIQUE INDEX i28 ON t1(f1);
+CREATE UNIQUE INDEX i27 ON t1(f1);
+CREATE UNIQUE INDEX i26 ON t1(f1);
+CREATE UNIQUE INDEX i25 ON t1(f1);
+CREATE UNIQUE INDEX i24 ON t1(f1);
+CREATE UNIQUE INDEX i23 ON t1(f1);
+CREATE UNIQUE INDEX i22 ON t1(f1);
+CREATE UNIQUE INDEX i21 ON t1(f1);
+CREATE UNIQUE INDEX i20 ON t1(f1);
+CREATE UNIQUE INDEX i19 ON t1(f1);
+CREATE UNIQUE INDEX i18 ON t1(f1);
+CREATE UNIQUE INDEX i17 ON t1(f1);
+CREATE UNIQUE INDEX i16 ON t1(f1);
+CREATE UNIQUE INDEX i15 ON t1(f1);
+CREATE UNIQUE INDEX i14 ON t1(f1);
+CREATE UNIQUE INDEX i13 ON t1(f1);
+CREATE UNIQUE INDEX i12 ON t1(f1);
+CREATE UNIQUE INDEX i11 ON t1(f1);
+CREATE UNIQUE INDEX i10 ON t1(f1);
+CREATE UNIQUE INDEX i9 ON t1(f1);
+CREATE UNIQUE INDEX i8 ON t1(f1);
+CREATE UNIQUE INDEX i7 ON t1(f1);
+CREATE UNIQUE INDEX i6 ON t1(f1);
+CREATE UNIQUE INDEX i5 ON t1(f1);
+CREATE UNIQUE INDEX i4 ON t1(f1);
+CREATE UNIQUE INDEX i3 ON t1(f1);
+CREATE UNIQUE INDEX i2 ON t1(f1);
+CREATE UNIQUE INDEX i1 ON t1(f1);
+INSERT INTO t1 VALUES (REPEAT('a', 767));
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT LENGTH(f1) = 767 FROM t1;
+LENGTH(f1) = 767
+1
+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 769 const 1 Using index
+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
+COUNT(*) = 1
+1
+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const i1 i1 769 const 1 Using index
+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
+COUNT(*) = 1
+1
+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const i63 i63 769 const 1 Using index
+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
+COUNT(*) = 1
+1
+INSERT INTO t1 VALUES (REPEAT('b', 767));
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+DELETE FROM t1 WHERE f1 = REPEAT('b', 767);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+INSERT INTO t1 (f1) VALUES (REPEAT('c', 767));
+ROLLBACK;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+START TRANSACTION;
+SET AUTOCOMMIT=OFF;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+START TRANSACTION;
+START TRANSACTION;
+UPDATE t1 SET f1 = REPEAT('e', 767);
+UPDATE t1 SET f1 = REPEAT('f', 767);
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_many_rows.result b/mysql-test/suite/galera/r/galera_many_rows.result
new file mode 100644
index 00000000000..e650dd6f5de
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_rows.result
@@ -0,0 +1,32 @@
+SET SESSION innodb_lock_wait_timeout=600;
+SET SESSION lock_wait_timeout=600;
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_sync_wait = 15;
+SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
+SELECT COUNT(*) = 100000 FROM t1;
+COUNT(*) = 100000
+1
+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+SELECT COUNT(*) = 200000 FROM t1;
+COUNT(*) = 200000
+1
+UPDATE t1 SET f2 = 1;
+SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1;
+COUNT(*) = 200000
+1
+START TRANSACTION;
+SELECT COUNT(*) = 200000 FROM t1;
+COUNT(*) = 200000
+1
+UPDATE t1 SET f2 = 3;
+START TRANSACTION;
+UPDATE t1 SET f2 = 4;
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_many_tables_nopk.result b/mysql-test/suite/galera/r/galera_many_tables_nopk.result
new file mode 100644
index 00000000000..283905979ec
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_tables_nopk.result
@@ -0,0 +1,17 @@
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+COMMIT;
+CREATE TABLE sum_table (f1 INTEGER);
+SELECT SUM(f1) = 900 FROM sum_table;
+SUM(f1) = 900
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t900 SET f1 = 3;
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP SCHEMA test;
+CREATE SCHEMA test;
diff --git a/mysql-test/suite/galera/r/galera_many_tables_pk.result b/mysql-test/suite/galera/r/galera_many_tables_pk.result
new file mode 100644
index 00000000000..37474797d74
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_tables_pk.result
@@ -0,0 +1,21 @@
+SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
+COUNT(*) = 100
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+COMMIT;
+CREATE TABLE sum_table (f1 INTEGER);
+SELECT SUM(f1) = 100 FROM sum_table;
+SUM(f1) = 100
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t100 SET f1 = 3;
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+include/diff_servers.inc [servers=1 2]
+DROP SCHEMA test;
+CREATE SCHEMA test;
diff --git a/mysql-test/suite/galera/r/galera_mdev_10812.result b/mysql-test/suite/galera/r/galera_mdev_10812.result
new file mode 100644
index 00000000000..fba10004761
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_mdev_10812.result
@@ -0,0 +1,11 @@
+#
+# MDEV-10812: On COM_STMT_CLOSE/COM_QUIT, when wsrep_conflict_state
+# is ABORTED, it causes wrong response to be sent to the client
+#
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+CREATE TABLE t1(a INT PRIMARY KEY);
+INSERT INTO t1 VALUES(1),(2),(3);
+START TRANSACTION ;
+UPDATE t1 SET a=a+100;
+UPDATE t1 SET a=a+100;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_mdev_13787.result b/mysql-test/suite/galera/r/galera_mdev_13787.result
new file mode 100644
index 00000000000..e3133f60b0c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_mdev_13787.result
@@ -0,0 +1,3 @@
+create table t(a int);
+insert into t select 1;
+DROP TABLE t;
diff --git a/mysql-test/suite/galera/r/galera_mdl_race.result b/mysql-test/suite/galera/r/galera_mdl_race.result
new file mode 100644
index 00000000000..535f20de7f1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_mdl_race.result
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+LOCK TABLE t2 WRITE;
+SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SELECT * FROM t2;;
+SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
+UNLOCK TABLES;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera/r/galera_migrate.result b/mysql-test/suite/galera/r/galera_migrate.result
new file mode 100644
index 00000000000..aab3ffbd6b6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_migrate.result
@@ -0,0 +1,79 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+INSERT INTO t1 VALUES (2);
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+SET GLOBAL wsrep_cluster_address='gcomm://';
+INSERT INTO t1 VALUES (5);
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 1
+1
+INSERT INTO t1 VALUES (6);
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+STOP SLAVE;
+RESET SLAVE ALL;
+STOP SLAVE;
+RESET SLAVE ALL;
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+SELECT COUNT(*) = 8 FROM t1;
+COUNT(*) = 8
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT COUNT(*) = 8 FROM t1;
+COUNT(*) = 8
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP TABLE t1;
+DROP TABLE t1;
+SET GLOBAL wsrep_provider = 'none';
+SET GLOBAL wsrep_sst_auth = '';
+SET GLOBAL wsrep_provider_options = '';
+DROP TABLE t1;
+DROP USER sst;
+SET GLOBAL wsrep_provider = 'none';
+SET GLOBAL wsrep_sst_method = 'rsync';
+SET GLOBAL wsrep_provider_options = '';
+SET GLOBAL wsrep_sst_receive_address = 'AUTO';
+DROP TABLE t1;
+DROP USER sst;
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
diff --git a/mysql-test/suite/galera/r/galera_multi_database.result b/mysql-test/suite/galera/r/galera_multi_database.result
new file mode 100644
index 00000000000..a04eb484caf
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_multi_database.result
@@ -0,0 +1,28 @@
+CREATE DATABASE d1;
+CREATE TABLE d1.t1(f1 INTEGER) ENGINE=InnoDB;
+CREATE DATABASE d2;
+CREATE TABLE d2.t1(f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO d1.t1 VALUES (1);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO d2.t1 VALUES (1);
+COMMIT;
+COMMIT;
+SELECT COUNT(*) = 1 FROM d1.t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM d2.t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM d1.t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM d2.t1;
+COUNT(*) = 1
+1
+DROP TABLE d1.t1;
+DROP TABLE d2.t1;
+DROP DATABASE d1;
+DROP DATABASE d2;
diff --git a/mysql-test/suite/galera/r/galera_myisam_autocommit.result b/mysql-test/suite/galera/r/galera_myisam_autocommit.result
new file mode 100644
index 00000000000..3f8d93bae76
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_myisam_autocommit.result
@@ -0,0 +1,24 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2), (3);
+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2), (3);
+INSERT INTO t2 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
+INSERT INTO t2 VALUES (6), (1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+UPDATE t1 SET f1 = 9;
+UPDATE t2 SET f1 = 9 WHERE f1 = 1;
+DELETE FROM t1 WHERE f1 = 9;
+DELETE FROM t2 WHERE f1 = 9;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_myisam_transactions.result b/mysql-test/suite/galera/r/galera_myisam_transactions.result
new file mode 100644
index 00000000000..284f92b414c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_myisam_transactions.result
@@ -0,0 +1,34 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t3 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES (NEW.f1);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+COMMIT;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/galera/r/galera_nopk_bit.result b/mysql-test/suite/galera/r/galera_nopk_bit.result
new file mode 100644
index 00000000000..5723dac42fd
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_nopk_bit.result
@@ -0,0 +1,27 @@
+CREATE TABLE t1 (f1 BIT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(0),(b'1');
+SELECT f1 IS NULL, f1 = b'1' FROM t1;
+f1 IS NULL f1 = b'1'
+1 NULL
+0 0
+0 1
+DELETE FROM t1 WHERE f1 = b'1';
+UPDATE t1 SET f1 = b'1' WHERE f1 IS NULL;
+UPDATE t1 SET f1 = 1 WHERE f1 = b'0';
+SELECT f1 IS NULL, f1 = b'1' FROM t1;
+f1 IS NULL f1 = b'1'
+0 1
+0 1
+CREATE TABLE t2 (f1 BIT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (NULL);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 0 WHERE f1 IS NULL;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 1 WHERE f1 IS NULL;
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_nopk_blob.result b/mysql-test/suite/galera/r/galera_nopk_blob.result
new file mode 100644
index 00000000000..7491b715ed2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_nopk_blob.result
@@ -0,0 +1,27 @@
+CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),('abc');
+SELECT f1 FROM t1;
+f1
+NULL
+abc
+DELETE FROM t1 WHERE f1 IS NULL;
+UPDATE t1 SET f1 = 'xyz' WHERE f1 = 'abc';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT f1 = 'abc' FROM t1;
+f1 = 'abc'
+0
+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (NULL);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'abc' WHERE f1 IS NULL;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'xyz' WHERE f1 IS NULL;
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_nopk_large_varchar.result b/mysql-test/suite/galera/r/galera_nopk_large_varchar.result
new file mode 100644
index 00000000000..abca81e15b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_nopk_large_varchar.result
@@ -0,0 +1,30 @@
+CREATE TABLE t1 (f1 VARCHAR(8000)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(CONCAT(REPEAT('x', 7999), 'a'));
+SELECT LENGTH(f1) FROM t1;
+LENGTH(f1)
+NULL
+8000
+DELETE FROM t1 WHERE f1 IS NULL;
+UPDATE t1 SET f1 = CONCAT(REPEAT('x', 7999), 'b') WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT LENGTH(f1) = 8000 FROM t1;
+LENGTH(f1) = 8000
+1
+SELECT f1 = CONCAT(REPEAT('x', 7999), 'b') FROM t1;
+f1 = CONCAT(REPEAT('x', 7999), 'b')
+1
+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (CONCAT(REPEAT('x', 7999), 'a'));
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'abc' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'xyz' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_nopk_unicode.result b/mysql-test/suite/galera/r/galera_nopk_unicode.result
new file mode 100644
index 00000000000..68d049a2146
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_nopk_unicode.result
@@ -0,0 +1,24 @@
+CREATE TABLE t1 (
+f1 VARCHAR(255),
+KEY (f1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES ('текÑÑ‚');
+SELECT f1 = 'текÑÑ‚' FROM t1;
+f1 = 'текÑÑ‚'
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚2';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚3';
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT f1 = 'текÑÑ‚2' FROM t1;
+f1 = 'текÑÑ‚2'
+1
+SELECT f1 = 'текÑÑ‚2' FROM t1 WHERE f1 = 'текÑÑ‚2';
+f1 = 'текÑÑ‚2'
+1
+DROP TABLE t1;
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
new file mode 100644
index 00000000000..27768dc441a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
@@ -0,0 +1,33 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 READ;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+SET SESSION wsrep_sync_wait=0;
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%applied write set%';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table level lock%';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 15;;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
+COUNT(*) = 2
+1
+SET GLOBAL wsrep_slave_threads = 1;;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result
new file mode 100644
index 00000000000..1f163f4366c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result
@@ -0,0 +1,18 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_slave_threads = 4;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+SELECT COUNT(*) = 30000 FROM t1;
+COUNT(*) = 30000
+1
+SELECT COUNT(DISTINCT f1) = 30000 FROM t1;
+COUNT(DISTINCT f1) = 30000
+1
+SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 5
+1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result
new file mode 100644
index 00000000000..05ce328228a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result
@@ -0,0 +1,15 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_slave_threads = 4;
+SELECT COUNT(*) = 20000 FROM t1;
+COUNT(*) = 20000
+1
+SELECT COUNT(DISTINCT f1) = 20000 FROM t1;
+COUNT(DISTINCT f1) = 20000
+1
+SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
+COUNT(*) = 4
+1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_parallel_simple.result b/mysql-test/suite/galera/r/galera_parallel_simple.result
new file mode 100644
index 00000000000..3b10815c63d
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_parallel_simple.result
@@ -0,0 +1,28 @@
+CREATE TABLE t1 (id INT) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 15;
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+0
+SELECT COUNT(*) = 10 FROM t2;
+COUNT(*) = 10
+0
+SET GLOBAL wsrep_slave_threads = 1;;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_pc_ignore_sb.result b/mysql-test/suite/galera/r/galera_pc_ignore_sb.result
new file mode 100644
index 00000000000..5fcccfe2d59
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_pc_ignore_sb.result
@@ -0,0 +1,12 @@
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+Killing server ...
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 1
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+VARIABLE_VALUE = 'ON'
+1
+SET GLOBAL wsrep_cluster_address = '';
diff --git a/mysql-test/suite/galera/r/galera_pk_bigint_signed.result b/mysql-test/suite/galera/r/galera_pk_bigint_signed.result
new file mode 100644
index 00000000000..a3075994657
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_pk_bigint_signed.result
@@ -0,0 +1,26 @@
+CREATE TABLE t1 (f1 BIGINT SIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES
+(-9223372036854775808, 'min'),
+(9223372036854775807, 'max')
+;
+SELECT * FROM t1;
+f1 f2
+-9223372036854775808 min
+9223372036854775807 max
+UPDATE t1 SET f2 = CONCAT(f2, '_');
+SELECT * FROM t1;
+f1 f2
+-9223372036854775808 min_
+9223372036854775807 max_
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'foo' WHERE f1 = -9223372036854775808;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'bar' WHERE f1 = -9223372036854775808;
+COMMIT;
+SET AUTOCOMMIT=ON;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SET AUTOCOMMIT=ON;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result b/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result
new file mode 100644
index 00000000000..441926e949c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result
@@ -0,0 +1,23 @@
+CREATE TABLE t1 (f1 BIGINT UNSIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES
+(18446744073709551615, 'max')
+;
+SELECT f1 = 18446744073709551615 FROM t1;
+f1 = 18446744073709551615
+1
+UPDATE t1 SET f2 = CONCAT(f2, '_');
+SELECT f1 = 18446744073709551615 FROM t1;
+f1 = 18446744073709551615
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'foo' WHERE f1 = 18446744073709551615;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'bar' WHERE f1 = 18446744073709551615;
+COMMIT;
+SET AUTOCOMMIT=ON;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SET AUTOCOMMIT=ON;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_prepared_statement.result b/mysql-test/suite/galera/r/galera_prepared_statement.result
new file mode 100644
index 00000000000..de5ac9c760a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_prepared_statement.result
@@ -0,0 +1,33 @@
+CREATE TABLE t1 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t3 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t4 (f1 CHAR(5)) ENGINE=InnoDB;
+SET SESSION sql_mode='STRICT_ALL_TABLES';
+PREPARE st1 FROM 'INSERT INTO t1 VALUES ("abc")';
+PREPARE st2 FROM 'INSERT INTO t2 VALUES ("abc")';
+PREPARE st3 FROM 'INSERT INTO t3 VALUES ("abc")';
+PREPARE st4 FROM 'INSERT INTO t4 VALUES ("abc")';
+EXECUTE st1;
+EXECUTE st2;
+EXECUTE st3;
+EXECUTE st4;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t4;
+COUNT(*) = 1
+1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+ALTER TABLE t1 DROP COLUMN f1;
+EXECUTE st1;
+ERROR 22007: Incorrect integer value: 'abc' for column 'f2' at row 1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
diff --git a/mysql-test/suite/galera/r/galera_query_cache.result b/mysql-test/suite/galera/r/galera_query_cache.result
new file mode 100644
index 00000000000..502d8a58e9c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_query_cache.result
@@ -0,0 +1,57 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+RESET QUERY CACHE;
+FLUSH STATUS;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+VARIABLE_VALUE = 1
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
+INSERT INTO t1 VALUES (2);
+FLUSH STATUS;
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+VARIABLE_VALUE = 0
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+VARIABLE_VALUE = 1
+1
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 0
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+FLUSH STATUS;
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+VARIABLE_VALUE = 0
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+VARIABLE_VALUE = 1
+1
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 0
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result b/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result
new file mode 100644
index 00000000000..5fe382048fb
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result
@@ -0,0 +1,53 @@
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SELECT MAX(id) FROM t1;
+MAX(id)
+1
+INSERT INTO t1 VALUES (2);
+SELECT MAX(id) FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+FLUSH QUERY CACHE;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "RESET";
+INSERT INTO t1 VALUES (3);
+SELECT MAX(id) FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+INSERT INTO t1 VALUES (4);
+SELECT MAX(id) FROM t1;
+MAX(id)
+4
+FLUSH STATUS;
+SELECT MAX(id) FROM t1;
+MAX(id)
+4
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+INSERT INTO t1 VALUES (5);
+SELECT MAX(id) FROM t1 ;
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+MAX(id)
+5
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
diff --git a/mysql-test/suite/galera/r/galera_read_only.result b/mysql-test/suite/galera/r/galera_read_only.result
new file mode 100644
index 00000000000..82736c5f4ba
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_read_only.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL read_only=TRUE;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+CREATE USER foo@localhost;
+# Open connection to node 2 using 'foo' user.
+
+# Connect with foo_node_2
+INSERT INTO t1 VALUES (2);
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SET GLOBAL read_only=FALSE;
+DROP TABLE t1;
+DROP USER foo@localhost;
diff --git a/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result b/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result
new file mode 100644
index 00000000000..4acf0143f8b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result
@@ -0,0 +1,18 @@
+SET GLOBAL wsrep_provider_options = 'repl.key_format=FLAT16';
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (123);
+CREATE TABLE t2 (f1 VARCHAR(256)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (REPEAT('a', 256));
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 234;
+UPDATE t2 SET f1 = REPEAT('b', 256);
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 234;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = REPEAT('b', 256);
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_repl_max_ws_size.result b/mysql-test/suite/galera/r/galera_repl_max_ws_size.result
new file mode 100644
index 00000000000..f7914a1b803
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_repl_max_ws_size.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
+INSERT INTO t1 VALUES (REPEAT('a', 512));
+ERROR HY000: Got error 90 "Message too long" during COMMIT
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+CALL mtr.add_suppression("Maximum writeset size exceeded by");
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("transaction size exceeded");
+CALL mtr.add_suppression("rbr write fail");
diff --git a/mysql-test/suite/galera/r/galera_restart_nochanges.result b/mysql-test/suite/galera/r/galera_restart_nochanges.result
new file mode 100644
index 00000000000..accace97826
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_restart_nochanges.result
@@ -0,0 +1,9 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_restart_on_unknown_option.result b/mysql-test/suite/galera/r/galera_restart_on_unknown_option.result
new file mode 100644
index 00000000000..a21b1edf3e7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_restart_on_unknown_option.result
@@ -0,0 +1,40 @@
+CALL mtr.add_suppression("Aborting");
+CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
+SELECT * FROM t1;
+f1 f2
+1 a
+2 a
+3 a
+Shutting down server ...
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+Starting server ...
+Starting server ...
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+Shutting down server ...
+UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 d
+3 d
+Starting server ...
+Starting server ...
+SELECT * FROM t1;
+f1 f2
+1 a
+2 d
+3 d
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_roles.result b/mysql-test/suite/galera/r/galera_roles.result
new file mode 100644
index 00000000000..6312250c18d
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_roles.result
@@ -0,0 +1,195 @@
+#
+# Testing CREATE/GRANT role
+#
+
+# On node_1
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (a int, b int);
+CREATE TABLE test1.t2 (a int, b int);
+INSERT INTO test1.t1 values (1,2),(3,4);
+INSERT INTO test1.t2 values (5,6),(7,8);
+CREATE PROCEDURE test1.pr1() SELECT "pr1";
+CREATE USER foo@localhost;
+CREATE ROLE role1;
+GRANT role1 TO foo@localhost;
+GRANT RELOAD ON *.* TO role1;
+GRANT SELECT ON mysql.* TO role1;
+GRANT EXECUTE ON PROCEDURE test1.pr1 TO role1;
+GRANT SELECT ON test1.t1 TO role1;
+GRANT SELECT (a) ON test1.t2 TO role1;
+# Open connections to the 2 nodes using 'foo' user.
+
+# Connect with foo_node_1
+SHOW GRANTS;
+Grants for foo@localhost
+GRANT role1 TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO 'foo'@'localhost'
+FLUSH TABLES;
+ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
+SELECT * FROM mysql.roles_mapping;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
+SHOW TABLES FROM test1;
+ERROR 42000: Access denied for user 'foo'@'localhost' to database 'test1'
+SET ROLE role1;
+FLUSH TABLES;
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+localhost foo role1 N
+localhost root role1 Y
+SHOW TABLES FROM test1;
+Tables_in_test1
+t1
+t2
+SELECT * FROM test1.t1;
+a b
+1 2
+3 4
+SELECT * FROM test1.t2;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
+SELECT a FROM test1.t2;
+a
+5
+7
+CALL test1.pr1();
+pr1
+pr1
+
+# Connect with foo_node_2
+SHOW GRANTS;
+Grants for foo@localhost
+GRANT role1 TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO 'foo'@'localhost'
+FLUSH TABLES;
+ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
+SELECT * FROM mysql.roles_mapping;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
+SHOW TABLES FROM test1;
+ERROR 42000: Access denied for user 'foo'@'localhost' to database 'test1'
+SET ROLE role1;
+FLUSH TABLES;
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+localhost foo role1 N
+localhost root role1 Y
+SHOW TABLES FROM test1;
+Tables_in_test1
+t1
+t2
+SELECT * FROM test1.t1;
+a b
+1 2
+3 4
+SELECT * FROM test1.t2;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
+SELECT a FROM test1.t2;
+a
+5
+7
+CALL test1.pr1();
+pr1
+pr1
+#
+# Testing REVOKE role
+#
+#
+# Connect with node_1
+REVOKE EXECUTE ON PROCEDURE test1.pr1 FROM role1;
+
+# Connect with foo_node_1
+CALL test1.pr1();
+ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test1.pr1'
+
+# Connect with foo_node_2
+CALL test1.pr1();
+ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test1.pr1'
+#
+# Testing DROP role
+#
+
+# Connect with node_1
+DROP ROLE role1;
+
+# Connect with foo_node_1
+FLUSH TABLES;
+SELECT * FROM mysql.roles_mapping;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
+SELECT * FROM test1.t1;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
+SELECT a FROM test1.t2;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
+SHOW GRANTS;
+Grants for foo@localhost
+GRANT USAGE ON *.* TO 'foo'@'localhost'
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+ROLE_NAME
+NULL
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+ROLE_NAME
+NULL
+SELECT CURRENT_ROLE();
+CURRENT_ROLE()
+role1
+
+# Connect with foo_node_2
+FLUSH TABLES;
+SELECT * FROM mysql.roles_mapping;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
+SELECT * FROM test1.t1;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
+SELECT a FROM test1.t2;
+ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
+SHOW GRANTS;
+Grants for foo@localhost
+GRANT USAGE ON *.* TO 'foo'@'localhost'
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+ROLE_NAME
+NULL
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+ROLE_NAME
+NULL
+SELECT CURRENT_ROLE();
+CURRENT_ROLE()
+role1
+# Connect with node_1
+DROP USER foo@localhost;
+DROP DATABASE test1;
+#
+# MDEV-10566: Create role statement replicated inconsistently in Galera Cluster
+#
+
+# On node_1
+CREATE USER foo@localhost;
+CREATE ROLE role1;
+CREATE ROLE role2 WITH ADMIN CURRENT_USER;
+CREATE ROLE role3 WITH ADMIN foo@localhost;
+CREATE ROLE role4 WITH ADMIN role1;
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+ role1 role4 Y
+localhost foo role3 Y
+localhost root role1 Y
+localhost root role2 Y
+SELECT * FROM INFORMATION_SCHEMA.APPLICABLE_ROLES;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role4 YES NULL
+root@localhost role1 YES NO
+root@localhost role2 YES NO
+
+# On node_2
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+ role1 role4 Y
+localhost foo role3 Y
+localhost root role1 Y
+localhost root role2 Y
+SELECT * FROM INFORMATION_SCHEMA.APPLICABLE_ROLES;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role4 YES NULL
+root@localhost role1 YES NO
+root@localhost role2 YES NO
+DROP ROLE role1;
+DROP ROLE role2;
+DROP ROLE role3;
+DROP ROLE role4;
+DROP USER foo@localhost;
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_rsu_add_pk.result b/mysql-test/suite/galera/r/galera_rsu_add_pk.result
new file mode 100644
index 00000000000..3fd24af9ad7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_rsu_add_pk.result
@@ -0,0 +1,26 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_OSU_method = "TOI";
+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+SELECT COUNT(*) = 300000 FROM t1;
+COUNT(*) = 300000
+1
+SELECT MAX(f1) = 299999 FROM t1;
+MAX(f1) = 299999
+1
+SELECT COUNT(*) = 300000 FROM t1;
+COUNT(*) = 300000
+1
+SELECT MAX(f1) = 299999 FROM t1;
+MAX(f1) = 299999
+1
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_OSU_method = "TOI";
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_rsu_drop_pk.result b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result
new file mode 100644
index 00000000000..039fb68d244
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result
@@ -0,0 +1,42 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION wsrep_OSU_method = "TOI";
+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+SELECT COUNT(*) = 300000 FROM t1;
+COUNT(*) = 300000
+1
+SELECT MAX(f1) = 299999 FROM t1;
+MAX(f1) = 299999
+1
+SELECT COUNT(*) = 300000 FROM t1;
+COUNT(*) = 300000
+1
+SELECT MAX(f1) = 299999 FROM t1;
+MAX(f1) = 299999
+1
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION wsrep_OSU_method = "TOI";
+INSERT INTO t1 (f1) VALUES (1);
+INSERT INTO t1 (f1) VALUES (10);
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 10;
+COUNT(*) = 2
+1
+INSERT INTO t1 (f1) VALUES (100);
+INSERT INTO t1 (f1) VALUES (1000);
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 100;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1000;
+COUNT(*) = 2
+1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_rsu_error.result b/mysql-test/suite/galera/r/galera_rsu_error.result
new file mode 100644
index 00000000000..bfe41390d1d
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_rsu_error.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 VALUES (1), (1);
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SET SESSION wsrep_OSU_method = "TOI";
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1';
+COUNT(*) = 0
+1
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1';
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(3) = 4 FROM t1;
+COUNT(3) = 4
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_rsu_simple.result b/mysql-test/suite/galera/r/galera_rsu_simple.result
new file mode 100644
index 00000000000..4c2780a2933
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_rsu_simple.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 1
+1
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+INSERT INTO t1 (f1) VALUES (2);
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result b/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result
new file mode 100644
index 00000000000..08980389392
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result
@@ -0,0 +1,41 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL,
+ `f2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync OFF
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=1;;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SET GLOBAL wsrep_desync=0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL,
+ `f2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+CALL mtr.add_suppression("Protocol violation");
+CALL mtr.add_suppression("desync failed");
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-test/suite/galera/r/galera_sbr.result b/mysql-test/suite/galera/r/galera_sbr.result
new file mode 100644
index 00000000000..0bf6cc7c9d3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sbr.result
@@ -0,0 +1,14 @@
+SET SESSION binlog_format = 'STATEMENT';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION binlog_format = 'MIXED';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: MIXED
+INSERT INTO t1 VALUES (2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
+SET GLOBAL binlog_format = 'ROW';
diff --git a/mysql-test/suite/galera/r/galera_sbr_binlog.result b/mysql-test/suite/galera/r/galera_sbr_binlog.result
new file mode 100644
index 00000000000..0bf6cc7c9d3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sbr_binlog.result
@@ -0,0 +1,14 @@
+SET SESSION binlog_format = 'STATEMENT';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION binlog_format = 'MIXED';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: MIXED
+INSERT INTO t1 VALUES (2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
+SET GLOBAL binlog_format = 'ROW';
diff --git a/mysql-test/suite/galera/r/galera_serializable.result b/mysql-test/suite/galera/r/galera_serializable.result
new file mode 100644
index 00000000000..90fe628e505
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_serializable.result
@@ -0,0 +1,27 @@
+CREATE TABLE t1 (id INT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+START TRANSACTION;
+SELECT * FROM t1;
+id f2
+INSERT INTO t1 VALUES (1,1);
+SELECT * FROM t1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ROLLBACK;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1,1);
+START TRANSACTION;
+SELECT * FROM t1;
+id f2
+1 1
+UPDATE t1 SET f2 = 2;
+UPDATE t1 SET f2 = 3;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ROLLBACK;
+DELETE FROM t1;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (1,2);
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_server.result b/mysql-test/suite/galera/r/galera_server.result
new file mode 100644
index 00000000000..ef81bf376b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_server.result
@@ -0,0 +1,20 @@
+# On node_1
+CREATE SERVER s1
+FOREIGN DATA WRAPPER mysql
+OPTIONS (HOST 'foo');
+# On node_2
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 foo 3306 mysql
+ALTER SERVER s1
+OPTIONS (HOST 'bar');
+# On node_1
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 bar 3306 mysql
+DROP SERVER s1;
+# On node_2
+SELECT COUNT(*)=0 FROM mysql.servers;
+COUNT(*)=0
+1
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_split_brain.result b/mysql-test/suite/galera/r/galera_split_brain.result
new file mode 100644
index 00000000000..6473f95735b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_split_brain.result
@@ -0,0 +1,4 @@
+call mtr.add_suppression("WSREP: TO isolation failed for: ");
+Killing server ...
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
diff --git a/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result b/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result
new file mode 100644
index 00000000000..c15a24e481f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION sql_log_bin = 0;
+INSERT INTO t1 VALUES (1);
+SET SESSION sql_log_bin = 1;
+INSERT INTO t1 VALUES (2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ssl.result b/mysql-test/suite/galera/r/galera_ssl.result
new file mode 100644
index 00000000000..569c3c607d5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ssl.result
@@ -0,0 +1,18 @@
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ssl_compression.result b/mysql-test/suite/galera/r/galera_ssl_compression.result
new file mode 100644
index 00000000000..f25b614d139
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ssl_compression.result
@@ -0,0 +1,22 @@
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SET GLOBAL wsrep_provider_options = "socket.ssl_compression=No";
+ERROR HY000: Incorrect arguments to SET
+CREATE TABLE t1 (f1 VARCHAR(333) PRIMARY KEY, f2 BLOB) Engine=InnoDB;
+INSERT INTO t1 VALUES (REPEAT('a', 333), REPEAT('b', 65535));
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('a', 333) AND f2 = REPEAT('b', 65535);
+COUNT(*) = 1
+1
+DROP TABLE t1;
+CALL mtr.add_suppression("Unknown parameter 'socket\.ssl_compression'");
+CALL mtr.add_suppression("Set options returned 7");
diff --git a/mysql-test/suite/galera/r/galera_ssl_upgrade.result b/mysql-test/suite/galera/r/galera_ssl_upgrade.result
new file mode 100644
index 00000000000..b24671d120d
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ssl_upgrade.result
@@ -0,0 +1,15 @@
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result
new file mode 100644
index 00000000000..5c0d9a45d41
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result
@@ -0,0 +1,460 @@
+Setting SST method to mysqldump ...
+CREATE USER 'sst';
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+Performing State Transfer on a server that has been temporarily disconnected
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Loading wsrep provider ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that starts from a clean var directory
+This is accomplished by shutting down node #2 and removing its var directory before restarting it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+Cleaning var directory ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug = 'd,sync.alter_opened_table';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET wsrep_sync_wait = 0;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+DROP USER sst;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
+CALL mtr.add_suppression("InnoDB: New log files created");
+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+CALL mtr.add_suppression("Can't open and lock time zone table");
+CALL mtr.add_suppression("Can't open and lock privilege tables");
+CALL mtr.add_suppression("Info table is not ready to be used");
+CALL mtr.add_suppression("Native table .* has the wrong structure");
diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
new file mode 100644
index 00000000000..227e1c15444
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
@@ -0,0 +1,109 @@
+Setting SST method to mysqldump ...
+CREATE USER 'sst';
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+CREATE USER sslsst;
+GRANT ALL PRIVILEGES ON *.* TO sslsst;
+GRANT USAGE ON *.* TO sslsst REQUIRE SSL;
+SET GLOBAL wsrep_sst_auth = 'sslsst:';
+Performing State Transfer on a server that has been temporarily disconnected
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Loading wsrep provider ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+DROP USER sst;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
+CALL mtr.add_suppression("InnoDB: New log files created");
+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+CALL mtr.add_suppression("Can't open and lock time zone table");
+CALL mtr.add_suppression("Can't open and lock privilege tables");
+CALL mtr.add_suppression("Info table is not ready to be used");
+CALL mtr.add_suppression("Native table .* has the wrong structure");
+DROP USER sslsst;
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync.result b/mysql-test/suite/galera/r/galera_sst_rsync.result
new file mode 100644
index 00000000000..df2d9190a4b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync.result
@@ -0,0 +1,359 @@
+Performing State Transfer on a server that has been shut down cleanly and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that starts from a clean var directory
+This is accomplished by shutting down node #2 and removing its var directory before restarting it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+Cleaning var directory ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET wsrep_sync_wait = 0;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result
new file mode 100644
index 00000000000..990e0a29506
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result
@@ -0,0 +1,3 @@
+SELECT 1;
+1
+1
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result
new file mode 100644
index 00000000000..df2d9190a4b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result
@@ -0,0 +1,359 @@
+Performing State Transfer on a server that has been shut down cleanly and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that starts from a clean var directory
+This is accomplished by shutting down node #2 and removing its var directory before restarting it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+Cleaning var directory ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET wsrep_sync_wait = 0;
+Killing server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result
new file mode 100644
index 00000000000..990e0a29506
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result
@@ -0,0 +1,3 @@
+SELECT 1;
+1
+1
diff --git a/mysql-test/suite/galera/r/galera_status_cluster.result b/mysql-test/suite/galera/r/galera_status_cluster.result
new file mode 100644
index 00000000000..d7cf671cb10
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_status_cluster.result
@@ -0,0 +1,12 @@
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
diff --git a/mysql-test/suite/galera/r/galera_status_local_index.result b/mysql-test/suite/galera/r/galera_status_local_index.result
new file mode 100644
index 00000000000..4e886ac8921
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_status_local_index.result
@@ -0,0 +1,13 @@
+CREATE TABLE wsrep_local_indexes (wsrep_local_index INTEGER);
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+SELECT COUNT(*) = 2 FROM wsrep_local_indexes;
+COUNT(*) = 2
+1
+SELECT COUNT(DISTINCT wsrep_local_index) = 2 FROM wsrep_local_indexes;
+COUNT(DISTINCT wsrep_local_index) = 2
+1
+SELECT COUNT(*) = 0 FROM wsrep_local_indexes WHERE wsrep_local_index NOT IN (0, 1);
+COUNT(*) = 0
+1
+DROP TABLE wsrep_local_indexes;
diff --git a/mysql-test/suite/galera/r/galera_status_local_state.result b/mysql-test/suite/galera/r/galera_status_local_state.result
new file mode 100644
index 00000000000..65713f1975c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_status_local_state.result
@@ -0,0 +1,14 @@
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+VARIABLE_VALUE = 4
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SET GLOBAL wsrep_desync = 1;
+SELECT VARIABLE_VALUE = 'Donor/Desynced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Donor/Desynced'
+1
+SET GLOBAL wsrep_desync = 0;
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
diff --git a/mysql-test/suite/galera/r/galera_suspend_slave.result b/mysql-test/suite/galera/r/galera_suspend_slave.result
new file mode 100644
index 00000000000..357a0d4f78e
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_suspend_slave.result
@@ -0,0 +1,13 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+Suspending node_2 ...
+INSERT INTO t1 VALUES (1);
+Got one of the listed errors
+Resuming node_2 ...
+SET SESSION wsrep_sync_wait = 1;
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 1;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SET SESSION wsrep_sync_wait = 15;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_sync_wait_show.result b/mysql-test/suite/galera/r/galera_sync_wait_show.result
new file mode 100644
index 00000000000..bc6e5fe5752
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sync_wait_show.result
@@ -0,0 +1,39 @@
+SET SESSION wsrep_sync_wait = 8;
+CREATE DATABASE db1;
+SHOW CREATE DATABASE db1;
+Database Create Database
+db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */
+DROP DATABASE db1;
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 1 FROM DUAL latin1 latin1_swedish_ci latin1_swedish_ci
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 stmt 0 "SELECT 1 FROM DUAL"
+DROP PROCEDURE p1;
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
+DROP FUNCTION f1;
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 freturn 3 123
+DROP FUNCTION f1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
+SHOW CREATE TRIGGER tr1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci
+DROP TABLE t1;
+CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
+SHOW CREATE EVENT event1;
+Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
+event1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+DROP EVENT event1;
diff --git a/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result b/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result
new file mode 100644
index 00000000000..f91415323ec
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result
@@ -0,0 +1,42 @@
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+ALTER TABLE t1 AUTO_INCREMENT = 1000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000;
+MIN(f1) >= 1000 COUNT(*) = 20 COUNT(DISTINCT f1) = 20
+1 1 1
+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000;
+MIN(f1) >= 1000 COUNT(*) = 20 COUNT(DISTINCT f1) = 20
+1 1 1
+ALTER TABLE t1 AUTO_INCREMENT = 5;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000;
+MIN(f1) >= 1000 COUNT(*) = 40 COUNT(DISTINCT f1) = 40
+1 1 1
+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000;
+MIN(f1) >= 1000 COUNT(*) = 40 COUNT(DISTINCT f1) = 40
+1 1 1
+DROP TABLE t1;
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+ALTER TABLE t1 AUTO_INCREMENT=100;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1;
+MIN(f1) = 100 MAX(f1) = 119 COUNT(f1) = 20 COUNT(DISTINCT f1) = 20
+1 1 1 1
+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1;
+MIN(f1) = 100 MAX(f1) = 119 COUNT(f1) = 20 COUNT(DISTINCT f1) = 20
+1 1 1 1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_error.result b/mysql-test/suite/galera/r/galera_toi_ddl_error.result
new file mode 100644
index 00000000000..656e20bcc46
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_ddl_error.result
@@ -0,0 +1,19 @@
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 (f1) SELECT (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+INSERT INTO t1 (f1) SELECT MAX(f1) FROM t1;
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+ERROR 23000: Duplicate entry '111110' for key 'PRIMARY'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result
new file mode 100644
index 00000000000..81781fbeae7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result
@@ -0,0 +1,31 @@
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE parent (
+id INT PRIMARY KEY AUTO_INCREMENT,
+f2 INTEGER,
+KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY AUTO_INCREMENT,
+parent_id INT
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (DEFAULT, 0);
+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+INSERT INTO parent (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+INSERT INTO parent (f2) SELECT 2 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id);;
+SELECT COUNT(*) = 20001 FROM parent;
+COUNT(*) = 20001
+1
+SELECT COUNT(*) = 10000 FROM child;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 20001 FROM parent;
+COUNT(*) = 20001
+1
+SELECT COUNT(*) = 10000 FROM child;
+COUNT(*) = 10000
+1
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result b/mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result
new file mode 100644
index 00000000000..8366cfd27c8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result
@@ -0,0 +1,23 @@
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE parent (
+id INT PRIMARY KEY,
+KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY AUTO_INCREMENT,
+parent_id INT
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1);
+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;;
+UPDATE parent SET id = 2 WHERE id = 1;;
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+COUNT(*) = 10000
+1
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_locking.result b/mysql-test/suite/galera/r/galera_toi_ddl_locking.result
new file mode 100644
index 00000000000..f0a51db14d3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_ddl_locking.result
@@ -0,0 +1,41 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+INSERT INTO t1 VALUES (1);
+Got one of the listed errors
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t2 VALUES (1);
+COMMIT;;
+SET SESSION wsrep_sync_wait = 0;
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'Commit';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result b/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result
new file mode 100644
index 00000000000..41e693c2b19
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result
@@ -0,0 +1,23 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 123);;
+CREATE UNIQUE INDEX i1 ON t1(f2);;
+INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 234);
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 3
+1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 3
+1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result b/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result
new file mode 100644
index 00000000000..9dfa433d49f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result
@@ -0,0 +1,35 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2, 3);
+ALTER TABLE t1 DROP COLUMN f2;
+INSERT INTO t1 VALUES (4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+SELECT * FROM t1 ORDER BY f1;
+f1
+1
+2
+4
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+SELECT * FROM t1 ORDER BY f1;
+f1
+1
+2
+4
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_toi_drop_database.result b/mysql-test/suite/galera/r/galera_toi_drop_database.result
new file mode 100644
index 00000000000..d652a5154be
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_drop_database.result
@@ -0,0 +1,24 @@
+CREATE DATABASE database1;
+USE database1;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
+USE database1;
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
+DROP DATABASE database1;;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+COUNT(*) = 0
+1
+USE database1;
+ERROR 42000: Unknown database 'database1'
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+COUNT(*) = 0
+1
+USE database1;
+ERROR 42000: Unknown database 'database1'
diff --git a/mysql-test/suite/galera/r/galera_toi_ftwrl.result b/mysql-test/suite/galera/r/galera_toi_ftwrl.result
new file mode 100644
index 00000000000..594717c96ff
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_ftwrl.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+FLUSH TABLES WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result b/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result
new file mode 100644
index 00000000000..eac50e8853c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=EXCLUSIVE;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+INSERT INTO t1 VALUES (2, 2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (3, 3);
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_toi_lock_shared.result b/mysql-test/suite/galera/r/galera_toi_lock_shared.result
new file mode 100644
index 00000000000..36c38860688
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_lock_shared.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED;
+INSERT INTO t1 VALUES (2, 2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (3, 3);
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_toi_truncate.result b/mysql-test/suite/galera/r/galera_toi_truncate.result
new file mode 100644
index 00000000000..f52316f3cbc
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_toi_truncate.result
@@ -0,0 +1,15 @@
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
+TRUNCATE TABLE t1;;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_transaction_read_only.result b/mysql-test/suite/galera/r/galera_transaction_read_only.result
new file mode 100644
index 00000000000..3cd1076a285
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_transaction_read_only.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+COMMIT;
+wsrep_last_committed_diff
+1
+START TRANSACTION READ ONLY;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+COMMIT;
+wsrep_last_committed_diff
+1
+START TRANSACTION;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+COMMIT;
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_transaction_replay.result b/mysql-test/suite/galera/r/galera_transaction_replay.result
new file mode 100644
index 00000000000..eec9ba03ef5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_transaction_replay.result
@@ -0,0 +1,59 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+f1 f2
+2 a
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+COMMIT;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+wsrep_local_replays
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+DROP TABLE t1;
+CREATE TABLE t1 (i int primary key, j int) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1, 0), (3, 0);
+SELECT * FROM t1;
+i j
+1 0
+3 0
+PREPARE stmt1 FROM "UPDATE t1 SET j = 1 where i > 0";
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+EXECUTE stmt1;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+INSERT INTO t1 VALUES(2,2);
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+SELECT * FROM t1;
+i j
+1 1
+2 2
+3 1
+SELECT * FROM t1;
+i j
+1 1
+2 2
+3 1
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_truncate.result b/mysql-test/suite/galera/r/galera_truncate.result
new file mode 100644
index 00000000000..eeeb6721d12
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_truncate.result
@@ -0,0 +1,29 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+CREATE TABLE t2 (f1 VARCHAR(255)) Engine=InnoDB;
+INSERT INTO t2 VALUES ('abc');
+TRUNCATE TABLE t2;
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+CREATE TABLE t3 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t3 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+CREATE TABLE t4 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB AUTO_INCREMENT=1234;
+INSERT INTO t4 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+TRUNCATE TABLE t3;
+TRUNCATE TABLE t4;
+SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t3', 't4');
+AUTO_INCREMENT = 1
+1
+1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
diff --git a/mysql-test/suite/galera/r/galera_truncate_temporary.result b/mysql-test/suite/galera/r/galera_truncate_temporary.result
new file mode 100644
index 00000000000..0bdc4e3632a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_truncate_temporary.result
@@ -0,0 +1,63 @@
+CREATE TEMPORARY TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT * FROM t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+SELECT f1 = 2 FROM t1;
+f1 = 2
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT f1 = 1 FROM t1;
+f1 = 1
+1
+DROP TABLE t1;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT f1 = 1 FROM t1;
+f1 = 1
+1
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT f1 = 2 FROM t1;
+f1 = 2
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_unicode_identifiers.result b/mysql-test/suite/galera/r/galera_unicode_identifiers.result
new file mode 100644
index 00000000000..9aee4616ec5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_unicode_identifiers.result
@@ -0,0 +1,46 @@
+SET GLOBAL wsrep_sync_wait = 15;
+SET GLOBAL wsrep_sync_wait = 15;
+CREATE DATABASE `database with space`;
+USE `database with space`;
+CREATE TABLE `table with space` (
+`column with space` INTEGER AUTO_INCREMENT PRIMARY KEY,
+`second column with space` INTEGER,
+UNIQUE `index name with space` (`second column with space`)
+);
+INSERT INTO `table with space` VALUES (1, 1);
+CREATE DATABASE `база`;
+USE `база`;
+CREATE TABLE `таблица` (
+`първа_колона` INTEGER PRIMARY KEY,
+`втора_колона` INTEGER,
+UNIQUE `индекÑ` (`втора_колона`)
+);
+INSERT INTO `таблица` VALUES (1, 1);
+CREATE DATABASE `втора база`;
+USE `втора база`;
+CREATE TABLE `втора таблица` (
+`първа колона` INTEGER,
+`втора колона` INTEGER,
+KEY `първи индекÑ` (`първа колона`)
+);
+INSERT INTO `втора таблица` VALUES (1, 1);
+USE `database with space`;
+SELECT `second column with space` FROM `table with space`;
+second column with space
+1
+USE `база`;
+SELECT * FROM `таблица`;
+първа_колона втора_колона
+1 1
+USE `втора база`;
+SELECT `втора колона` FROM `втора таблица`;
+втора колона
+1
+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);
+DROP TABLE `database with space`.`table with space`;
+DROP TABLE `база`.`таблица`;
+DROP TABLE `втора база`.`втора таблица`;
+DROP DATABASE `database with space`;
+DROP DATABASE `база`;
+DROP DATABASE `втора база`;
+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);
diff --git a/mysql-test/suite/galera/r/galera_unicode_pk.result b/mysql-test/suite/galera/r/galera_unicode_pk.result
new file mode 100644
index 00000000000..d59615b2542
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_unicode_pk.result
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (
+f1 VARCHAR(255) PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES ('текÑÑ‚');
+SELECT f1 = 'текÑÑ‚' FROM t1;
+f1 = 'текÑÑ‚'
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚2';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚3';
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT f1 = 'текÑÑ‚2' FROM t1;
+f1 = 'текÑÑ‚2'
+1
+SELECT f1 = 'текÑÑ‚2' FROM t1 WHERE f1 = 'текÑÑ‚2';
+f1 = 'текÑÑ‚2'
+1
+START TRANSACTION;
+INSERT INTO t1 VALUES ('текÑÑ‚4');
+START TRANSACTION;
+INSERT INTO t1 VALUES ('текÑÑ‚4');
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_update_limit.result b/mysql-test/suite/galera/r/galera_update_limit.result
new file mode 100644
index 00000000000..c26eb1c29f6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_update_limit.result
@@ -0,0 +1,17 @@
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND();
+UPDATE IGNORE t1 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5;
+sum_matches
+1
+max_matches
+1
+DROP TABLE t1;
+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND();
+UPDATE IGNORE t2 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5;
+sum_matches
+1
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_v1_row_events.result b/mysql-test/suite/galera/r/galera_v1_row_events.result
new file mode 100644
index 00000000000..a6ab62350b1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_v1_row_events.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_OSU_method.result b/mysql-test/suite/galera/r/galera_var_OSU_method.result
new file mode 100644
index 00000000000..9a07873e1b9
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_OSU_method.result
@@ -0,0 +1,16 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET SESSION wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 1
+1
+SET SESSION wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_OSU_method2.result b/mysql-test/suite/galera/r/galera_var_OSU_method2.result
new file mode 100644
index 00000000000..08f2e6aa0d8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_OSU_method2.result
@@ -0,0 +1,19 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET SESSION wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (1,2);
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (3,4);
+SET GLOBAL wsrep_OSU_method = "TOI";
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result b/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result
new file mode 100644
index 00000000000..92b69fbbaa7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result
@@ -0,0 +1,61 @@
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+SELECT @@auto_increment_increment = 1;
+@@auto_increment_increment = 1
+1
+SELECT @@auto_increment_offset = 1;
+@@auto_increment_offset = 1
+1
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL AUTO_INCREMENT,
+ `node` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL AUTO_INCREMENT,
+ `node` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT @@auto_increment_increment = 1;
+@@auto_increment_increment = 1
+1
+SELECT @@auto_increment_offset = 1;
+@@auto_increment_offset = 1
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (node) VALUES ('node1');
+SELECT f1 FROM t1;
+f1
+1
+SELECT @@auto_increment_increment = 1;
+@@auto_increment_increment = 1
+1
+SELECT @@auto_increment_offset = 1;
+@@auto_increment_offset = 1
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (node) VALUES ('node2');
+SELECT f1 FROM t1;
+f1
+1
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM t1;
+f1 node
+1 node1
+SELECT * FROM t1;
+f1 node
+1 node1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
new file mode 100644
index 00000000000..c1bb065975b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
@@ -0,0 +1,30 @@
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
+@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
+1
+SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
+@@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1
+1
+INSERT INTO t1 VALUES (DEFAULT, 'node1');;
+INSERT INTO t1 VALUES (DEFAULT, 'node2');;
+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
+@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
+1
+SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
+@@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1
+1
+INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2');;
+INSERT INTO t1 VALUES (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1');;
+SELECT COUNT(*) = 22 FROM t1;
+COUNT(*) = 22
+1
+SELECT COUNT(DISTINCT f1) = 22 FROM t1;
+COUNT(DISTINCT f1) = 22
+1
+SELECT COUNT(*) = 22 FROM t1;
+COUNT(*) = 22
+1
+SELECT COUNT(DISTINCT f1) = 22 FROM t1;
+COUNT(DISTINCT f1) = 22
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result b/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result
new file mode 100644
index 00000000000..0a3516e043f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result
@@ -0,0 +1,22 @@
+SET GLOBAL wsrep_certify_nonPK = OFF;
+SET GLOBAL wsrep_certify_nonPK = OFF;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB /* Table has no primary key */;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2);
+Got one of the listed errors
+INSERT INTO t2 VALUES (1), (2);
+UPDATE t2 SET f1 = 3 WHERE f1 = 1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 2 FROM t2;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 3;
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_certify_nonPK = 1;
+SET GLOBAL wsrep_certify_nonPK = 1;
+DROP TABLE t1;
+DROP TABLE t2;
+call mtr.add_suppression("SQL statement was ineffective");
diff --git a/mysql-test/suite/galera/r/galera_var_cluster_address.result b/mysql-test/suite/galera/r/galera_var_cluster_address.result
new file mode 100644
index 00000000000..7c56e22eca2
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_cluster_address.result
@@ -0,0 +1,40 @@
+SET GLOBAL wsrep_cluster_address = 'foo://';
+SET SESSION wsrep_sync_wait=0;
+SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SHOW STATUS LIKE 'wsrep_ready';
+Variable_name Value
+wsrep_ready OFF
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status non-Primary
+SHOW STATUS LIKE 'wsrep_local_state';
+Variable_name Value
+wsrep_local_state 0
+SHOW STATUS LIKE 'wsrep_local_state_comment';
+Variable_name Value
+wsrep_local_state_comment Initialized
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 1
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+CALL mtr.add_suppression("Backend not supported: foo");
+CALL mtr.add_suppression("Failed to initialize backend using 'foo");
+CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo");
+CALL mtr.add_suppression("gcs connect failed: Socket type not supported");
+CALL mtr.add_suppression("wsrep::connect\\(\\) failed: 7");
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)");
+CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110");
+CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
+CALL mtr.add_suppression("gcs connect failed: Connection timed out");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_var_desync_on.result b/mysql-test/suite/galera/r/galera_var_desync_on.result
new file mode 100644
index 00000000000..f286ae72308
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_desync_on.result
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
+SET GLOBAL wsrep_desync = TRUE;
+FLUSH TABLES WITH READ LOCK;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+INSERT INTO t1 VALUES (10);
+SET SESSION wsrep_sync_wait = 0;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_desync = FALSE;
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 1;
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+INSERT INTO t1 VALUES (11);
+SELECT COUNT(*) = 11 FROM t1;
+COUNT(*) = 11
+1
+CALL mtr.add_suppression("Protocol violation");
+DROP TABLE t1;
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
new file mode 100644
index 00000000000..f141b332b6c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
@@ -0,0 +1,46 @@
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+SET @@global.wsrep_cluster_address = '';
+SET @@session.wsrep_dirty_reads=OFF;
+SET SESSION wsrep_sync_wait=0;
+SHOW STATUS LIKE 'wsrep_ready';
+Variable_name Value
+wsrep_ready OFF
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status non-Primary
+SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT 1 FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SET @@session.wsrep_dirty_reads=ON;
+SELECT * FROM t1;
+i
+1
+SELECT 1 FROM t1;
+1
+1
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+i variable_name variable_value
+1 WSREP_DIRTY_READS ON
+SET @@session.wsrep_dirty_reads=OFF;
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT 1;
+1
+1
+USE information_schema;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
+ERROR 08S01: WSREP has not yet prepared node for application use
+USE test;
+SELECT * FROM t1;
+i
+1
+DROP TABLE t1;
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_var_fkchecks.result b/mysql-test/suite/galera/r/galera_var_fkchecks.result
new file mode 100644
index 00000000000..342212a5241
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_fkchecks.result
@@ -0,0 +1,26 @@
+CREATE TABLE parent (
+id INT PRIMARY KEY,
+KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY,
+parent_id INT,
+FOREIGN KEY (parent_id)
+REFERENCES parent(id)
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1);
+INSERT INTO child VALUES (1,1);
+SET SESSION foreign_key_checks = 0;
+INSERT INTO child VALUES (2,2);
+SELECT COUNT(*) = 1 FROM child WHERE id = 2;
+COUNT(*) = 1
+1
+INSERT INTO child VALUES (3,3);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+SET SESSION foreign_key_checks = 0;
+DELETE FROM parent;
+SELECT COUNT(*) = 0 FROM parent;
+COUNT(*) = 0
+1
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result
new file mode 100644
index 00000000000..8e84236d5bf
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result
@@ -0,0 +1,74 @@
+# On node_1
+list of GTID variables :
+gtid_domain_id 1
+gtid_binlog_pos
+gtid_binlog_state
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 9999
+wsrep_gtid_mode 1
+# On node_2
+list of GTID variables :
+gtid_domain_id 2
+gtid_binlog_pos
+gtid_binlog_state
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 9999
+wsrep_gtid_mode 1
+# On node_1
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(i INT) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+SELECT * FROM t2;
+i
+list of GTID variables :
+gtid_domain_id 1
+gtid_binlog_pos 9999-1-3
+gtid_binlog_state 9999-1-3
+gtid_current_pos 9999-1-3
+gtid_slave_pos
+wsrep_gtid_domain_id 9999
+wsrep_gtid_mode 1
+# On node_2
+SELECT * FROM t1;
+i
+1
+list of GTID variables :
+gtid_domain_id 2
+gtid_binlog_pos 9999-1-3
+gtid_binlog_state 9999-1-3
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 9999
+wsrep_gtid_mode 1
+# On node_1
+INSERT INTO t2 VALUES(1);
+SELECT * FROM t2;
+i
+1
+list of GTID variables :
+gtid_domain_id 1
+gtid_binlog_pos 1-1-1,9999-1-3
+gtid_binlog_state 1-1-1,9999-1-3
+gtid_current_pos 1-1-1,9999-1-3
+gtid_slave_pos
+wsrep_gtid_domain_id 9999
+wsrep_gtid_mode 1
+# On node_2
+SELECT * FROM t2;
+i
+list of GTID variables :
+gtid_domain_id 2
+gtid_binlog_pos 9999-1-3
+gtid_binlog_state 9999-1-3
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 9999
+wsrep_gtid_mode 1
+# On node_1
+DROP TABLE t1, t2;
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
new file mode 100644
index 00000000000..912e45a14b1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
@@ -0,0 +1,12 @@
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL innodb_disallow_writes=ON;
+INSERT INTO t1 VALUES (1);;
+SET GLOBAL innodb_disallow_writes=OFF;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_load_data_splitting.result b/mysql-test/suite/galera/r/galera_var_load_data_splitting.result
new file mode 100644
index 00000000000..db145fd1561
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_load_data_splitting.result
@@ -0,0 +1,9 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_load_data_splitting = TRUE;
+SELECT COUNT(*) = 95000 FROM t1;
+COUNT(*) = 95000
+1
+wsrep_last_committed_diff
+1
+SET GLOBAL wsrep_load_data_splitting = 1;;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_log_bin.result b/mysql-test/suite/galera/r/galera_var_log_bin.result
new file mode 100644
index 00000000000..a6ab62350b1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_log_bin.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_max_ws_rows.result b/mysql-test/suite/galera/r/galera_var_max_ws_rows.result
new file mode 100644
index 00000000000..a1deb16c5a6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_max_ws_rows.result
@@ -0,0 +1,135 @@
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_max_ws_rows = 4;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+INSERT INTO t1 (f2) VALUES (5);
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+UPDATE t1 SET f2 = 10 WHERE f2 = 4;
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+DELETE FROM t1 WHERE f2 = 1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 5;
+INSERT INTO t1 (f2) VALUES (1),(2),(3),(4),(5);
+SET GLOBAL wsrep_max_ws_rows = 4;
+UPDATE t1 SET f2 = f2 + 10;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+DELETE FROM t1 WHERE f2 < 10;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+INSERT INTO t1 (f2) SELECT * FROM ten;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+INSERT INTO t1 (f2) VALUES (10),(20),(30),(40),(50);
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+SET GLOBAL wsrep_max_ws_rows = 10;
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 100;
+SELECT COUNT(*) = 100 FROM t1;
+COUNT(*) = 100
+1
+DELETE FROM t1 WHERE f2 < 101;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 9999;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SET GLOBAL wsrep_max_ws_rows = 9999;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+SET GLOBAL wsrep_max_ws_rows = 9999;
+DELETE FROM t1 WHERE f2 = 2;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+DELETE FROM t1 WHERE f2 = 2;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET AUTOCOMMIT = ON;
+SET GLOBAL wsrep_max_ws_rows = 1;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+DROP TABLE t1;
+DROP TABLE ten;
+#
+# MDEV-11817: Altering a table with more rows than
+# wsrep_max_ws_rows causes cluster to break when running
+# Galera cluster in TOI mode
+#
+CREATE TABLE t1(c1 INT)ENGINE = INNODB;
+SET GLOBAL wsrep_max_ws_rows= DEFAULT;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 SELECT * FROM t1;
+SET GLOBAL wsrep_max_ws_rows= 1;
+ALTER TABLE t1 CHANGE COLUMN c1 c1 BIGINT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_max_ws_size.result b/mysql-test/suite/galera/r/galera_var_max_ws_size.result
new file mode 100644
index 00000000000..fe92fd888e5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_max_ws_size.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine=InnoDB;
+SET GLOBAL wsrep_max_ws_size = 1024;
+INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
+ERROR HY000: Got error 90 "Message too long" during COMMIT
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SELECT @@wsrep_max_ws_size = 10000;
+@@wsrep_max_ws_size = 10000
+1
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=20000';
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SET GLOBAL wsrep_max_ws_size = 20000;
+provider_options_match
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result b/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result
new file mode 100644
index 00000000000..f2a951c26b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_mysql_replication_bundle = 2;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+0
+INSERT INTO t1 VALUES (2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SET GLOBAL wsrep_mysql_replication_bundle = 0;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_node_address.result b/mysql-test/suite/galera/r/galera_var_node_address.result
new file mode 100644
index 00000000000..cf36e964f93
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_node_address.result
@@ -0,0 +1,11 @@
+call mtr.add_suppression("WSREP: Stray state UUID msg: .* current group state WAIT_STATE_UUID .*");
+call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .* is not in state transfer (.*). Message ignored.");
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_notify_cmd.result b/mysql-test/suite/galera/r/galera_var_notify_cmd.result
new file mode 100644
index 00000000000..e9e4605e1bc
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_notify_cmd.result
@@ -0,0 +1,10 @@
+SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
+COUNT(DISTINCT uuid) = 2
+1
+SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status;
+MAX(size) = 2
+1
+SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status;
+COUNT(DISTINCT idx) = 2
+1
+DROP SCHEMA mtr_wsrep_notify;
diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result
new file mode 100644
index 00000000000..c8b79071d10
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result
@@ -0,0 +1,8 @@
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_replicate_myisam = 0;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result
new file mode 100644
index 00000000000..22ba4ca8767
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result
@@ -0,0 +1,87 @@
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2), (3);
+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(100)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1, 'abc'),(2,'abc'), (3, 'xxx');
+REPLACE INTO t1 VALUES (1, 'klm'), (2,'xyz');
+REPLACE INTO t1 SELECT 3, 'yyy' FROM DUAL;
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1 AND f2 = 'klm';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2 AND f2 = 'xyz';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3 AND f2 = 'yyy';
+COUNT(*) = 1
+1
+UPDATE t1 SET f2 = 'zzz' WHERE f2 = 'yyy';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'zzz';
+COUNT(*) = 1
+1
+DELETE FROM t1 WHERE f2 = 'zzz';
+SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'zzz';
+COUNT(*) = 0
+1
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+COMMIT;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t2 VALUES (2);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (f2 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+COMMIT;
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# MDEV-11152: wsrep_replicate_myisam: SELECT gets replicated using TO
+#
+CREATE TABLE t1 (i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+DROP TABLE t1;
+SET GLOBAL wsrep_replicate_myisam = 0;
+SET GLOBAL wsrep_replicate_myisam = 0;
diff --git a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
new file mode 100644
index 00000000000..f4d17ad9a41
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
@@ -0,0 +1,32 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5);
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t1 (f1) VALUES (1),(2);;
+TRUNCATE TABLE t1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SET SESSION wsrep_retry_autocommit = 1;
+INSERT INTO t1 (f1) VALUES (3),(4);;
+TRUNCATE TABLE t1;
+SELECT * FROM test.t1;
+f1 f2
+3 0
+4 0
+CREATE PROCEDURE repeated_truncate ()
+BEGIN
+DECLARE i INT;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET i = 0;
+WHILE i <= 1000 DO
+TRUNCATE TABLE t1;
+SET i = i + 1;
+END WHILE;
+END|
+CALL repeated_truncate();
+SET SESSION wsrep_retry_autocommit = 1;
+INSERT INTO t1 (f1) VALUES (5),(6);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SET SESSION wsrep_retry_autocommit = 1024;
+INSERT INTO t1 (f1) VALUES (7),(8);;
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1;
+DROP PROCEDURE repeated_truncate;
diff --git a/mysql-test/suite/galera/r/galera_var_slave_threads.result b/mysql-test/suite/galera/r/galera_var_slave_threads.result
new file mode 100644
index 00000000000..2340d25d160
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_slave_threads.result
@@ -0,0 +1,115 @@
+CALL mtr.add_suppression("WSREP: Refusing exit for the last slave thread.");
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+CREATE TABLE t2 (f1 INT AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_slave_threads = 0;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
+SHOW WARNINGS;
+Level Code Message
+Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
+SELECT @@wsrep_slave_threads = 1;
+@@wsrep_slave_threads = 1
+1
+SET GLOBAL wsrep_slave_threads = 1;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_slave_threads = 64;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = @@wsrep_slave_threads + 1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_slave_threads = 1;
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+INSERT INTO t2 VALUES (DEFAULT);
+SELECT COUNT(*) = 64 FROM t2;
+COUNT(*) = 64
+1
+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = @@wsrep_slave_threads + 1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# lp:1372840 - Changing wsrep_slave_threads causes future connections to hang
+#
+CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=INNODB;
+SET GLOBAL wsrep_slave_threads = 4;
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
+# End of tests
diff --git a/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-test/suite/galera/r/galera_var_sync_wait.result
new file mode 100644
index 00000000000..51c1fb3662b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result
@@ -0,0 +1,27 @@
+#
+# MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file
+#
+SELECT @@global.wsrep_sync_wait;
+@@global.wsrep_sync_wait
+15
+SELECT @@global.wsrep_causal_reads;
+@@global.wsrep_causal_reads
+1
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_sync_wait = 1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+CREATE TABLE t2 (f1 INT PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_sync_wait = 4;
+INSERT INTO t2 VALUES (1);
+CREATE TABLE t3 (f1 INT PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t3 VALUES (1);
+SET GLOBAL wsrep_sync_wait = 2;
+UPDATE t3 SET f1 = 2;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SET GLOBAL wsrep_sync_wait = 15;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result
new file mode 100644
index 00000000000..8b1c4ebf83b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result
@@ -0,0 +1,19 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_on = FALSE;
+INSERT INTO t1 VALUES (2);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_on = TRUE;
+INSERT INTO t1 VALUES (3);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 0 FROM t1 WHERE f1 = 2;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_wan.result b/mysql-test/suite/galera/r/galera_wan.result
new file mode 100644
index 00000000000..6be32b291e5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wan.result
@@ -0,0 +1,14 @@
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+SELECT VARIABLE_VALUE LIKE '%gmcast.segment = 3%' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_provider_options';
+VARIABLE_VALUE LIKE '%gmcast.segment = 3%'
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
diff --git a/mysql-test/suite/galera/r/galera_wan_restart_ist.result b/mysql-test/suite/galera/r/galera_wan_restart_ist.result
new file mode 100644
index 00000000000..e58bff34e54
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wan_restart_ist.result
@@ -0,0 +1,53 @@
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (13);
+Shutting down server ...
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (131);
+INSERT INTO t1 VALUES (22);
+Shutting down server ...
+INSERT INTO t1 VALUES (21);
+INSERT INTO t1 VALUES (23);
+INSERT INTO t1 VALUES (24);
+INSERT INTO t1 VALUES (221);
+INSERT INTO t1 VALUES (34);
+Shutting down server ...
+INSERT INTO t1 VALUES (31);
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (33);
+INSERT INTO t1 VALUES (341);
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+DROP TABLE t1;
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
diff --git a/mysql-test/suite/galera/r/galera_wan_restart_sst.result b/mysql-test/suite/galera/r/galera_wan_restart_sst.result
new file mode 100644
index 00000000000..15de0fab342
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wan_restart_sst.result
@@ -0,0 +1,54 @@
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (13);
+Killing server ...
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (131);
+INSERT INTO t1 VALUES (22);
+Killing server ...
+INSERT INTO t1 VALUES (21);
+INSERT INTO t1 VALUES (23);
+INSERT INTO t1 VALUES (24);
+INSERT INTO t1 VALUES (221);
+INSERT INTO t1 VALUES (34);
+Killing server ...
+INSERT INTO t1 VALUES (31);
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (33);
+INSERT INTO t1 VALUES (341);
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+DROP TABLE t1;
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+CALL mtr.add_suppression("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
diff --git a/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result
new file mode 100644
index 00000000000..06fc27ae7ed
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result
@@ -0,0 +1,33 @@
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+SET GLOBAL wsrep_desync = TRUE;
+SET SESSION wsrep_on = FALSE;
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+SELECT COUNT(*) = 200000 FROM t1;
+COUNT(*) = 200000
+1
+SELECT MAX(f1) = 199999 FROM t1;
+MAX(f1) = 199999
+1
+SELECT COUNT(*) = 200000 FROM t1;
+COUNT(*) = 200000
+1
+SELECT MAX(f1) = 199999 FROM t1;
+MAX(f1) = 199999
+1
+SET GLOBAL wsrep_desync = TRUE;
+SET SESSION wsrep_on = FALSE;
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+INSERT INTO t1 (f1) VALUES (1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO t1 (f1) VALUES (100);
+ERROR 23000: Duplicate entry '100' for key 'PRIMARY'
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_wsrep_log_conficts.result b/mysql-test/suite/galera/r/galera_wsrep_log_conficts.result
new file mode 100644
index 00000000000..b535c6477b7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wsrep_log_conficts.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (
+f1 VARCHAR(255) PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES ('abc');
+SELECT f1 = 'abc' FROM t1;
+f1 = 'abc'
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'klm';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'xyz';
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+include/assert_grep.inc [cluster conflict due to high priority abort for threads]
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result
new file mode 100644
index 00000000000..e3f2fa4046f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result
@@ -0,0 +1,36 @@
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+VARIABLE_VALUE = 0
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+VARIABLE_VALUE = 4
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+VARIABLE_VALUE = 0
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+VARIABLE_VALUE = 4
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
diff --git a/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result b/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result
new file mode 100644
index 00000000000..f19dc40205b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result
@@ -0,0 +1,5 @@
+call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
+call mtr.add_suppression("WSREP\: Set options returned 7");
+SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
+ERROR HY000: Incorrect arguments to SET
+Unhandled exceptions: 0
diff --git a/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result b/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result
new file mode 100644
index 00000000000..89110b48def
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result
@@ -0,0 +1,14 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+SET SESSION wsrep_sync_wait = 0;
+INSERT INTO t1 VALUES (4);
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+SELECT COUNT(*) = 3 FROM t1;
+COUNT(*) = 3
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_zero_length_column.result b/mysql-test/suite/galera/r/galera_zero_length_column.result
new file mode 100644
index 00000000000..2e6119bd1ba
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_zero_length_column.result
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY , f2 VARCHAR(0)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 VARCHAR(0)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, '');
+INSERT INTO t2 VALUES (NULL);
+INSERT INTO t2 VALUES ('');
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SELECT f2 IS NULL FROM t1 WHERE f1 = 1;
+f2 IS NULL
+1
+SELECT f2 = '' FROM t1 WHERE f1 = 2;
+f2 = ''
+1
+SELECT COUNT(*) = 2 FROM t2;
+COUNT(*) = 2
+1
+SELECT f1 IS NULL FROM t2 WHERE f1 IS NULL;
+f1 IS NULL
+1
+SELECT f1 = '' FROM t2 WHERE f1 IS NOT NULL;
+f1 = ''
+1
+UPDATE t1 SET f2 = '' WHERE f1 = 1;
+UPDATE t1 SET f2 = NULL WHERE f1 = 2;
+UPDATE t2 SET f1 = '' WHERE f1 IS NULL;
+SELECT f2 = '' FROM t1 WHERE f1 = 1;
+f2 = ''
+1
+SELECT f2 IS NULL FROM t1 WHERE f1 = 2;
+f2 IS NULL
+1
+SELECT COUNT(*) = 2 FROM t2 WHERE f1 = '';
+COUNT(*) = 2
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/grant.result b/mysql-test/suite/galera/r/grant.result
new file mode 100644
index 00000000000..8d257e7e8e2
--- /dev/null
+++ b/mysql-test/suite/galera/r/grant.result
@@ -0,0 +1,17 @@
+#
+# MDEV#6266: Changing password fails on galera cluster
+#
+
+# On node_1
+GRANT SELECT ON *.* TO 'user_6266'@'localhost' IDENTIFIED BY 'pass';
+
+# Now, try changing password for 'user_6266'. This command should also
+# execute successfully on the other node.
+SET PASSWORD FOR 'user_6266'@'localhost' = PASSWORD('newpass');
+
+# On node_2
+SELECT user FROM mysql.user WHERE user='user_6266';
+user
+user_6266
+DROP USER 'user_6266'@'localhost';
+# End of test
diff --git a/mysql-test/suite/galera/r/lp1276424.result b/mysql-test/suite/galera/r/lp1276424.result
new file mode 100644
index 00000000000..5f09ec9ea8b
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp1276424.result
@@ -0,0 +1,11 @@
+CREATE TABLE t1 (f1 INT DEFAULT NULL, UNIQUE KEY i1 (f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SELECT f1 IS NULL FROM t1;
+f1 IS NULL
+1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/lp1347768.result b/mysql-test/suite/galera/r/lp1347768.result
new file mode 100644
index 00000000000..c085059e014
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp1347768.result
@@ -0,0 +1,17 @@
+CREATE TABLE `r8kmb_redirect_links` (
+`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+`old_url` varchar(255) DEFAULT NULL,
+`new_url` varchar(255) NOT NULL,
+`referer` varchar(150) NOT NULL,
+`comment` varchar(255) NOT NULL,
+`published` tinyint(4) NOT NULL,
+`created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+`modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+PRIMARY KEY (`id`),
+UNIQUE KEY `idx_link_old` (`old_url`),
+KEY `idx_link_modifed` (`modified_date`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO r8kmb_redirect_links VALUES (550,'http://mysite.com/images/download/ßуñûічýøù_ôþóþòір_þфõÑ.doc','','','',0,'2013-07-15 14:29:42','0000-00-00 00:00:00');
+Warnings:
+Warning 1265 Data truncated for column 'old_url' at row 1
+DROP TABLE r8kmb_redirect_links;
diff --git a/mysql-test/suite/galera/r/lp1376747-2.result b/mysql-test/suite/galera/r/lp1376747-2.result
new file mode 100644
index 00000000000..3b8aee61ed2
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp1376747-2.result
@@ -0,0 +1,19 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLES t1 FOR EXPORT;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/lp1376747-3.result b/mysql-test/suite/galera/r/lp1376747-3.result
new file mode 100644
index 00000000000..fc982c94244
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp1376747-3.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLE WITH READ LOCK;
+### This shouldn't block.
+FLUSH TABLES t1 FOR EXPORT;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (2,3);
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/lp1376747-4.result b/mysql-test/suite/galera/r/lp1376747-4.result
new file mode 100644
index 00000000000..e39b7171a5b
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp1376747-4.result
@@ -0,0 +1,40 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+FLUSH TABLE WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+FLUSH TABLES t1 WITH READ LOCK;;
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/lp1376747.result b/mysql-test/suite/galera/r/lp1376747.result
new file mode 100644
index 00000000000..4617d5952bb
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp1376747.result
@@ -0,0 +1,19 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLES t1 WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/lp1438990.result b/mysql-test/suite/galera/r/lp1438990.result
new file mode 100644
index 00000000000..b53bc186953
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp1438990.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging;
+INSERT t3 VALUES (x);
+END;
+SAVEPOINT event_logging;
+INSERT INTO t2 VALUES (x);
+RELEASE SAVEPOINT event_logging;
+END|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-test/suite/galera/r/lp959512.result b/mysql-test/suite/galera/r/lp959512.result
new file mode 100644
index 00000000000..55adfa360b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/lp959512.result
@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS variable;
+Warnings:
+Note 1051 Unknown table 'test.variable'
+DROP TABLE IF EXISTS foo;
+Warnings:
+Note 1051 Unknown table 'test.foo'
+CREATE TABLE variable (
+name varchar(128) NOT NULL DEFAULT '' COMMENT 'The name of the variable.',
+value longblob NOT NULL COMMENT 'The value of the variable.',
+PRIMARY KEY (name)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Named variable/value pairs created by Drupal core or any...';
+CREATE TABLE foo (a int);
+INSERT INTO variable (name, value) VALUES ('menu_expanded', 'a:0:{}');
+START TRANSACTION;
+SELECT 1 AS expression FROM variable variable
+WHERE ( (name = 'menu_expanded') ) FOR UPDATE;
+expression
+1
+UPDATE variable SET value='a:0:{}' WHERE ( (name = 'menu_expanded') );
+COMMIT;
+INSERT INTO foo VALUES (1);
+UPDATE foo SET a = 2 WHERE a = 1;
+DROP TABLE foo;
+DROP TABLE variable;
diff --git a/mysql-test/suite/galera/r/mdev_10518.result b/mysql-test/suite/galera/r/mdev_10518.result
new file mode 100644
index 00000000000..b2a3e0a65ef
--- /dev/null
+++ b/mysql-test/suite/galera/r/mdev_10518.result
@@ -0,0 +1,74 @@
+# On node_1
+list of GTID variables :
+gtid_domain_id 1
+gtid_binlog_pos
+gtid_binlog_state
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 4294967295
+wsrep_gtid_mode 1
+# On node_2
+list of GTID variables :
+gtid_domain_id 2
+gtid_binlog_pos
+gtid_binlog_state
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 4294967295
+wsrep_gtid_mode 1
+# On node_1
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(i INT) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+SELECT * FROM t2;
+i
+list of GTID variables :
+gtid_domain_id 1
+gtid_binlog_pos 4294967295-1-3
+gtid_binlog_state 4294967295-1-3
+gtid_current_pos 4294967295-1-3
+gtid_slave_pos
+wsrep_gtid_domain_id 4294967295
+wsrep_gtid_mode 1
+# On node_2
+SELECT * FROM t1;
+i
+1
+list of GTID variables :
+gtid_domain_id 2
+gtid_binlog_pos 4294967295-1-3
+gtid_binlog_state 4294967295-1-3
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 4294967295
+wsrep_gtid_mode 1
+# On node_1
+INSERT INTO t2 VALUES(1);
+SELECT * FROM t2;
+i
+1
+list of GTID variables :
+gtid_domain_id 1
+gtid_binlog_pos 1-1-1,4294967295-1-3
+gtid_binlog_state 1-1-1,4294967295-1-3
+gtid_current_pos 1-1-1,4294967295-1-3
+gtid_slave_pos
+wsrep_gtid_domain_id 4294967295
+wsrep_gtid_mode 1
+# On node_2
+SELECT * FROM t2;
+i
+list of GTID variables :
+gtid_domain_id 2
+gtid_binlog_pos 4294967295-1-3
+gtid_binlog_state 4294967295-1-3
+gtid_current_pos
+gtid_slave_pos
+wsrep_gtid_domain_id 4294967295
+wsrep_gtid_mode 1
+# On node_1
+DROP TABLE t1, t2;
+# End of test
diff --git a/mysql-test/suite/galera/r/mdev_9290.result b/mysql-test/suite/galera/r/mdev_9290.result
new file mode 100644
index 00000000000..cb2f0813333
--- /dev/null
+++ b/mysql-test/suite/galera/r/mdev_9290.result
@@ -0,0 +1,14 @@
+#
+# MDEV-9290 : InnoDB: Assertion failure in file trx0sys.cc line 353
+# InnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno
+#
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+COMMIT;
+SELECT * FROM t1;
+i
+1
+2
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#110.result b/mysql-test/suite/galera/r/mysql-wsrep#110.result
new file mode 100644
index 00000000000..551c3666fb4
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#110.result
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging;
+INSERT t3 VALUES (x);
+END;
+SAVEPOINT event_logging;
+INSERT INTO t2 VALUES (x);
+END|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#198.result b/mysql-test/suite/galera/r/mysql-wsrep#198.result
new file mode 100644
index 00000000000..a278c492372
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#198.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SELECT 1 FROM DUAL;
+1
+1
+LOCK TABLE t2 WRITE;
+OPTIMIZE TABLE t1,t2;;
+REPAIR TABLE t1,t2;;
+SET SESSION wsrep_sync_wait = 0;
+INSERT INTO t2 VALUES (1);
+UNLOCK TABLES;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+Table Op Msg_type Msg_text
+test.t1 repair note The storage engine for the table doesn't support repair
+test.t2 repair note The storage engine for the table doesn't support repair
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#201.result b/mysql-test/suite/galera/r/mysql-wsrep#201.result
new file mode 100644
index 00000000000..34d184d8ec1
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#201.result
@@ -0,0 +1,3 @@
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (DEFAULT);
+SET GLOBAL query_cache_size=1355776;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#237.result b/mysql-test/suite/galera/r/mysql-wsrep#237.result
new file mode 100644
index 00000000000..1889a8feca0
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#237.result
@@ -0,0 +1,11 @@
+CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
+INSERT INTO t values (1);;
+SET SESSION wsrep_sync_wait = 0;
+FLUSH TABLES;
+SELECT SLEEP(1);
+SLEEP(1)
+0
+SET DEBUG_SYNC= 'now SIGNAL continue';
+DROP TABLE t;
+SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#247.result b/mysql-test/suite/galera/r/mysql-wsrep#247.result
new file mode 100644
index 00000000000..1b00f511f03
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#247.result
@@ -0,0 +1,11 @@
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+CREATE TABLE t1 (i int primary key);
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync ON
+SET GLOBAL wsrep_desync=0;
+DROP TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync OFF
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#31.result b/mysql-test/suite/galera/r/mysql-wsrep#31.result
new file mode 100644
index 00000000000..a21bb3eccfd
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#31.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES('test');
+CREATE DATABASE db;
+Shutting down server 2 ...
+Recovering server 2 ...
+Performing --wsrep-recover ...
+Restarting server ...
+Using --wsrep-start-position when starting mysqld ...
+DROP TABLE t1;
+DROP DATABASE db;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result
new file mode 100644
index 00000000000..fc647a2000d
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result
@@ -0,0 +1,104 @@
+Setting SST method to mysqldump ...
+CREATE USER 'sst';
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+Performing State Transfer on a server that has been temporarily disconnected
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+Loading wsrep provider ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+DROP USER sst;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
+CALL mtr.add_suppression("InnoDB: New log files created");
+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+CALL mtr.add_suppression("Can't open and lock time zone table");
+CALL mtr.add_suppression("Can't open and lock privilege tables");
+CALL mtr.add_suppression("Info table is not ready to be used");
+CALL mtr.add_suppression("Native table .* has the wrong structure");
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#90.result b/mysql-test/suite/galera/r/mysql-wsrep#90.result
new file mode 100644
index 00000000000..da57b9d0068
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#90.result
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (1,2);
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (3,4);
+DROP TABLE t1;
+SET GLOBAL WSREP_OSU_METHOD = TOI;
diff --git a/mysql-test/suite/galera/r/partition.result b/mysql-test/suite/galera/r/partition.result
new file mode 100644
index 00000000000..3907b4f08c9
--- /dev/null
+++ b/mysql-test/suite/galera/r/partition.result
@@ -0,0 +1,140 @@
+#
+# MDEV#4953 Galera: DELETE from a partitioned table is not replicated
+#
+USE test;
+CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,100), (2,200);
+SELECT * FROM t1;
+pk i
+2 200
+1 100
+DELETE FROM t1;
+SELECT * FROM t1;
+pk i
+
+# On node_1
+SELECT * FROM t1;
+pk i
+
+# On node_2
+SELECT * FROM t1;
+pk i
+DROP TABLE t1;
+#
+# MDEV#7501 : alter table exchange partition is not replicated in
+# galera cluster
+#
+
+# On node_1
+CREATE TABLE test.t1 (
+i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (i)
+) ENGINE=INNODB
+PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = INNODB,
+PARTITION p2 VALUES LESS THAN (20) ENGINE = INNODB,
+PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = INNODB);
+INSERT INTO test.t1 (i) VALUE (9),(19);
+CREATE TABLE test.p1 LIKE test.t1;
+ALTER TABLE test.p1 REMOVE PARTITIONING;
+ALTER TABLE test.t1 EXCHANGE PARTITION p1 WITH TABLE test.p1;
+SELECT * FROM test.t1;
+i
+19
+SELECT * FROM test.p1;
+i
+9
+
+# On node_2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`i`)
+) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION p2 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+SHOW CREATE TABLE p1;
+Table Create Table
+p1 CREATE TABLE `p1` (
+ `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`i`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
+SELECT * FROM test.t1;
+i
+19
+SELECT * FROM test.p1;
+i
+9
+
+# On node_1
+ALTER TABLE t1 TRUNCATE PARTITION p2;
+SELECT * FROM test.t1;
+i
+
+# On node_2
+SELECT * FROM test.t1;
+i
+
+# On node_1
+ALTER TABLE t1 DROP PARTITION p2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+
+# On node_2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+DROP TABLE t1, p1;
+#
+# MDEV-5146: Bulk loads into partitioned table not working
+#
+# Case 1: wsrep_load_data_splitting = ON & LOAD DATA with 20002
+# entries.
+SET GLOBAL wsrep_load_data_splitting = ON;
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+SELECT COUNT(*) = 20002 FROM t1;
+COUNT(*) = 20002
+1
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+# Case 2: wsrep_load_data_splitting = ON & LOAD DATA with 101 entries.
+SET GLOBAL wsrep_load_data_splitting = ON;
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+SELECT COUNT(*) = 101 FROM t1;
+COUNT(*) = 101
+1
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+# Case 3: wsrep_load_data_splitting = OFF & LOAD DATA with 20002
+# entries.
+SET GLOBAL wsrep_load_data_splitting = OFF;
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+SELECT COUNT(*) = 20002 FROM t1;
+COUNT(*) = 20002
+1
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+SET GLOBAL wsrep_load_data_splitting = 1;;
+# End of test
diff --git a/mysql-test/suite/galera/r/pxc-421.result b/mysql-test/suite/galera/r/pxc-421.result
new file mode 100644
index 00000000000..f5c0fabcd6e
--- /dev/null
+++ b/mysql-test/suite/galera/r/pxc-421.result
@@ -0,0 +1,38 @@
+set GLOBAL wsrep_slave_threads=26;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+set GLOBAL wsrep_slave_threads=16;
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+set SESSION wsrep_sync_wait=0;
+INSERT INTO t1 VALUES (4);
+set GLOBAL wsrep_slave_threads=5;
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+set GLOBAL wsrep_slave_threads=12;
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+INSERT INTO t1 VALUES (100), (101), (102);
+set GLOBAL wsrep_slave_threads=5;
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+show global variables like 'wsrep_slave_threads';
+Variable_name Value
+wsrep_slave_threads 5
+SET GLOBAL wsrep_slave_threads = 1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+16
+SET GLOBAL auto_increment_offset = 2;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+15
+show global variables like 'wsrep_slave_threads';
+Variable_name Value
+wsrep_slave_threads 12
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
+SET GLOBAL auto_increment_offset = 1;
diff --git a/mysql-test/suite/galera/r/query_cache.result b/mysql-test/suite/galera/r/query_cache.result
new file mode 100644
index 00000000000..4b1b950e5c3
--- /dev/null
+++ b/mysql-test/suite/galera/r/query_cache.result
@@ -0,0 +1,1645 @@
+
+# Execute FLUSH/RESET commands.
+# On node-1
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache;
+reset query cache;
+flush status;
+# On node-2
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache;
+reset query cache;
+flush status;
+# On node-1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select sql_no_cache * from t1;
+a
+1
+2
+3
+select length(now()) from t1;
+length(now())
+19
+19
+19
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select sql_no_cache * from t1;
+a
+1
+2
+3
+select length(now()) from t1;
+length(now())
+19
+19
+19
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+delete from t1 where a=1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+select * from t1;
+a
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+select * from t1;
+a
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+update t1 set a=1 where a=3;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+select * from t1;
+a
+2
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+select * from t1;
+a
+2
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-1
+drop table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+
+# On node-1
+create table t1 (a int not null) ENGINE=MyISAM;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) ENGINE=MyISAM;
+insert into t2 values (4),(5),(6);
+create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
+select * from t3;
+a
+1
+2
+3
+4
+5
+6
+select * from t3;
+a
+1
+2
+3
+4
+5
+6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+insert into t2 values (7);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+insert into t3 values (8);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t3;
+a
+1
+2
+3
+8
+4
+5
+6
+7
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+update t2 set a=9 where a=7;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t1;
+a
+1
+2
+3
+8
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+update t3 set a=10 where a=1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t3;
+a
+10
+2
+3
+8
+4
+5
+6
+9
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+delete from t2 where a=9;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from t1;
+a
+10
+2
+3
+8
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+delete from t3 where a=10;
+select * from t3;
+a
+2
+3
+8
+4
+5
+6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+# On node-2
+select * from t3;
+a
+select * from t3;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+drop table t1, t2, t3;
+# On node-1
+set query_cache_type=demand;
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set query_cache_type=on;
+# On node-2
+set query_cache_type=demand;
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set query_cache_type=on;
+# On node-1
+reset query cache;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+reset query cache;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+# On node-1
+select sql_no_cache * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+select sql_no_cache * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create table t1 (a text not null) engine=innodb;
+select CONNECTION_ID() from t1;
+CONNECTION_ID()
+select FOUND_ROWS();
+FOUND_ROWS()
+0
+select NOW() from t1;
+NOW()
+select CURDATE() from t1;
+CURDATE()
+select CURTIME() from t1;
+CURTIME()
+select DATABASE() from t1;
+DATABASE()
+select ENCRYPT("test") from t1;
+ENCRYPT("test")
+select LAST_INSERT_ID() from t1;
+LAST_INSERT_ID()
+select RAND() from t1;
+RAND()
+select UNIX_TIMESTAMP() from t1;
+UNIX_TIMESTAMP()
+select USER() from t1;
+USER()
+select CURRENT_USER() from t1;
+CURRENT_USER()
+select benchmark(1,1) from t1;
+benchmark(1,1)
+explain extended select benchmark(1,1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select benchmark(1,1) AS `benchmark(1,1)` from `test`.`t1`
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+select CONNECTION_ID() from t1;
+CONNECTION_ID()
+select FOUND_ROWS();
+FOUND_ROWS()
+0
+select NOW() from t1;
+NOW()
+select CURDATE() from t1;
+CURDATE()
+select CURTIME() from t1;
+CURTIME()
+select DATABASE() from t1;
+DATABASE()
+select ENCRYPT("test") from t1;
+ENCRYPT("test")
+select LAST_INSERT_ID() from t1;
+LAST_INSERT_ID()
+select RAND() from t1;
+RAND()
+select UNIX_TIMESTAMP() from t1;
+UNIX_TIMESTAMP()
+select USER() from t1;
+USER()
+select CURRENT_USER() from t1;
+CURRENT_USER()
+select benchmark(1,1) from t1;
+benchmark(1,1)
+explain extended select benchmark(1,1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select benchmark(1,1) AS `benchmark(1,1)` from `test`.`t1`
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create database mysqltest;
+create table mysqltest.t1 (i int not null auto_increment, a int, primary key
+(i)) engine=innodb;
+insert into mysqltest.t1 values (1, 1);
+select * from mysqltest.t1 where i is null;
+i a
+create table t1(a int) engine=innodb;
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+select * from mysqltest.t1;
+i a
+1 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+select * from mysqltest.t1;
+i a
+1 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop database mysqltest;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create table t1 (a char(1) not null collate koi8r_general_ci) engine=innodb;
+insert into t1 values(_koi8r"á");
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+set CHARACTER SET koi8r;
+select * from t1;
+a
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+a
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 4
+# On node-2
+set CHARACTER SET koi8r;
+select * from t1;
+a
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+a
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+drop table t1;
+# On node-1
+create database if not exists mysqltest;
+create table mysqltest.t1 (i int not null) engine=innodb;
+create table t1 (i int not null) engine=innodb;
+insert into mysqltest.t1 (i) values (1);
+insert into t1 (i) values (2);
+select * from t1;
+i
+2
+use mysqltest;
+select * from t1;
+i
+1
+select * from t1;
+i
+1
+use test;
+select * from t1;
+i
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+# On node-2
+select * from t1;
+i
+2
+use mysqltest;
+select * from t1;
+i
+1
+select * from t1;
+i
+1
+use test;
+select * from t1;
+i
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+drop database mysqltest;
+drop table t1;
+# On node-1
+create table t1 (i int not null) engine=innodb;
+insert into t1 (i) values (1),(2),(3),(4);
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+# On node-2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+i
+1
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 6
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select * from t1 where i=1;
+i
+1
+select FOUND_ROWS();
+FOUND_ROWS()
+1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+drop table t1;
+# On node-2
+flush query cache;
+reset query cache;
+# On node-1
+flush query cache;
+reset query cache;
+create table t1 (a int not null) ENGINE=MYISAM;
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 9
+insert delayed into t1 values (4);
+select a from t1;
+a
+1
+2
+3
+4
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 9
+# On node-2
+select * from t1;
+a
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+insert delayed into t1 values (4);
+select a from t1;
+a
+4
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+drop table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+# On node-1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 9
+# On node-2
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+set GLOBAL query_cache_min_res_unit=1001;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_min_res_unit value: '1001'
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 1000
+# On node-1
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+set GLOBAL query_cache_min_res_unit=1001;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_min_res_unit value: '1001'
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 1000
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) engine=innodb;
+insert into t2 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+# On node-2
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 10
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+drop table t1;
+select a from t2;
+a
+1
+2
+3
+select a from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+# On node-1
+select a from t2;
+a
+1
+2
+3
+select a from t2;
+a
+1
+2
+3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+drop table t2;
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+Variable_name Value
+query_cache_min_res_unit 4096
+# On node-1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1);
+select "aaa" from t1;
+aaa
+aaa
+select "AAA" from t1;
+AAA
+AAA
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-2
+select "aaa" from t1;
+aaa
+aaa
+select "AAA" from t1;
+AAA
+AAA
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+set GLOBAL query_cache_size=1000;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '1000'
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=1024;
+Warnings:
+Warning 1282 Query cache failed to set size 1024; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=10240;
+Warnings:
+Warning 1282 Query cache failed to set size 10240; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=20480;
+Warnings:
+Warning 1282 Query cache failed to set size 20480; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=40960;
+Warnings:
+Warning 1282 Query cache failed to set size 40960; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 51200
+select * from t1;
+a
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 61440
+select * from t1;
+a
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 81920
+select * from t1;
+a
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 102400
+select * from t1;
+a
+# On node-2
+set GLOBAL query_cache_size=1000;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '1000'
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=1024;
+Warnings:
+Warning 1282 Query cache failed to set size 1024; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=10240;
+Warnings:
+Warning 1282 Query cache failed to set size 10240; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=20480;
+Warnings:
+Warning 1282 Query cache failed to set size 20480; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=40960;
+Warnings:
+Warning 1282 Query cache failed to set size 40960; new query cache size is 0
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+select * from t1;
+a
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 51200
+select * from t1;
+a
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 61440
+select * from t1;
+a
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 81920
+select * from t1;
+a
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 102400
+select * from t1;
+a
+drop table t1;
+# On node-1
+set GLOBAL query_cache_size=1048576;
+create table t1 (i int not null) engine=innodb;
+create table t2 (i int not null) engine=innodb;
+select * from t1;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+create temporary table t3 (i int not null);
+select * from t2;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select * from t3;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+update t1 set i=(select distinct 1 from (select * from t2) a);
+drop table t3;
+# On node-2
+set GLOBAL query_cache_size=1048576;
+select * from t1;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+select * from t2;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+drop table t1, t2;
+# On node-1
+use mysql;
+select * from db;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+use test;
+select * from mysql.db;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-1
+create table t1(id int auto_increment primary key) engine=innodb;
+insert into t1 values (1), (2), (3);
+select * from t1;
+id
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-2
+select * from t1;
+id
+1
+2
+3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+# On node-1
+alter table t1 rename to t2;
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+# On node-2
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+drop table t2;
+# On node-1
+create table t1 (word char(20) not null) engine=innodb;
+select * from t1;
+word
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+load data infile 'MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select count(*) from t1;
+count(*)
+70
+# On node-2
+select count(*) from t1;
+count(*)
+70
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+load data infile 'MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+select count(*) from t1;
+count(*)
+140
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2),(3);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select * from t1 into outfile "query_cache.out.file";
+select * from t1 into outfile "query_cache.out.file";
+ERROR HY000: File 'query_cache.out.file' already exists
+select * from t1 limit 1 into dumpfile "query_cache.dump.file";
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2);
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+select * from t1;
+a
+1
+2
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+a
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+SET SQL_SELECT_LIMIT=DEFAULT;
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+select * from t1;
+a
+1
+2
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+a
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+SET SQL_SELECT_LIMIT=DEFAULT;
+drop table t1;
+# On node-1
+create table t1 (a int not null) engine=innodb;
+create table t2 (a int not null) engine=innodb;
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+a
+select * from t2;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+unlock table;
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+# On node-2
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+a
+select * from t2;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+unlock table;
+select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+drop table t1,t2;
+# On node-1
+create table t1 (id int primary key) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+id
+1
+2
+3
+create temporary table t1 (a int not null auto_increment primary key);
+select * from t1;
+a
+drop table t1;
+drop table t1;
+# On node-1
+SET NAMES koi8r;
+CREATE TABLE t1 (a char(1) character set koi8r) engine=innodb;
+INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Ã');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+SELECT a,'Â','â'='Â' FROM t1;
+a  'â'='Â'
+à Â 0
+à Â 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+a  'â'='Â'
+à Â 0
+à Â 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a ç? 'ç?'='ç?'
+Ã ç? 1
+Ã ç? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a � 'â'='Â'
+ö Ã? 1
+ö Ã? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 4
+SET NAMES default;
+# On node-2
+SELECT a,'Â','â'='Â' FROM t1;
+a  'â'='Â'
+? Â 0
+? Â 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+a ?? 'â'='Â'
+? ?? 1
+? ?? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a ?? '??'='?‚'
+? ?? 1
+? ?? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+a � 'â'='Â'
+ö Ã? 1
+ö Ã? 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 4
+drop table t1;
+# On node-1
+create table t1 (a int) engine=innodb;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 46
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+/**/ select * from t1;
+a
+/**/ select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 47
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 13
+# On node-2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 38
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
+/**/ select * from t1;
+a
+/**/ select * from t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 39
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 12
+drop table t1;
+# On node-1
+set session query_cache_type = 2;
+create table t1(a int) engine=innodb;
+select table_name from information_schema.tables
+where table_schema="test";
+table_name
+t1
+drop table t1;
+select table_name from information_schema.tables
+where table_schema="test";
+table_name
+set session query_cache_type = 1;
+set global query_cache_size=1024*1024;
+flush query cache;
+create table t1 ( a int ) engine=myisam;
+insert into t1 values (1);
+select a from t1;
+a
+1
+select a from t1;
+a
+1
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 14
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 14
+# On node-2
+select a from t1;
+a
+select a from t1;
+a
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 13
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+show status like 'qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 13
+drop table t1;
+# Restore original settings.
+# On node-1
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+
+# On node-2
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+# End of test
diff --git a/mysql-test/suite/galera/r/rename.result b/mysql-test/suite/galera/r/rename.result
new file mode 100644
index 00000000000..3c81e8b6320
--- /dev/null
+++ b/mysql-test/suite/galera/r/rename.result
@@ -0,0 +1,39 @@
+#
+# MDEV-8598 : Failed MySQL DDL commands and Galera replication
+#
+# On node 1
+USE test;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUE(1);
+SELECT * FROM t1;
+i
+1
+# Create a new user 'foo' with limited privileges
+CREATE USER foo@localhost;
+GRANT SELECT on test.* TO foo@localhost;
+# Open connection to the 1st node using 'test_user1' user.
+SELECT * FROM t1;
+i
+1
+# Following RENAME should not replicate to other node.
+RENAME TABLE t1 TO t2;
+ERROR 42000: DROP, ALTER command denied to user 'foo'@'localhost' for table 't1'
+# On node 2
+USE test;
+SELECT * FROM t1;
+i
+1
+# On node_1
+RENAME TABLE t1 TO t2;
+SHOW TABLES;
+Tables_in_test
+t2
+# On node 2
+USE test;
+SELECT * FROM t2;
+i
+1
+DROP USER foo@localhost;
+DROP TABLE t2;
+# End of tests
diff --git a/mysql-test/suite/galera/r/rpl_row_annotate.result b/mysql-test/suite/galera/r/rpl_row_annotate.result
new file mode 100644
index 00000000000..ff8d49702ac
--- /dev/null
+++ b/mysql-test/suite/galera/r/rpl_row_annotate.result
@@ -0,0 +1,66 @@
+# On node_2
+RESET MASTER;
+# On node_1
+RESET MASTER;
+CREATE TABLE t1(i INT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+DELETE FROM t1 WHERE i = 1;
+# On node_2
+INSERT INTO t1 VALUES(2);
+DELETE FROM t1 WHERE i = 2;
+# On node_1
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM <start_pos>;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 # Gtid_list 1 # []
+mysqld-bin.000001 # Binlog_checkpoint 1 # mysqld-bin.000001
+mysqld-bin.000001 # Gtid 1 # GTID 0-1-1
+mysqld-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(i INT)ENGINE=INNODB
+mysqld-bin.000001 # Gtid 1 # BEGIN GTID 0-1-2
+mysqld-bin.000001 # Annotate_rows 1 # INSERT INTO t1 VALUES(1)
+mysqld-bin.000001 # Table_map 1 # table_id: # (test.t1)
+mysqld-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 1 # COMMIT /* xid= */
+mysqld-bin.000001 # Gtid 1 # BEGIN GTID 0-1-3
+mysqld-bin.000001 # Annotate_rows 1 # DELETE FROM t1 WHERE i = 1
+mysqld-bin.000001 # Table_map 1 # table_id: # (test.t1)
+mysqld-bin.000001 # Delete_rows_v1 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 1 # COMMIT /* xid= */
+mysqld-bin.000001 # Gtid 2 # BEGIN GTID 0-2-4
+mysqld-bin.000001 # Annotate_rows 2 # INSERT INTO t1 VALUES(2)
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
+mysqld-bin.000001 # Write_rows_v1 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 2 # COMMIT /* xid= */
+mysqld-bin.000001 # Gtid 2 # BEGIN GTID 0-2-5
+mysqld-bin.000001 # Annotate_rows 2 # DELETE FROM t1 WHERE i = 2
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
+mysqld-bin.000001 # Delete_rows_v1 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 2 # COMMIT /* xid= */
+# On node_2
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM <start_pos>;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 # Gtid_list 2 # []
+mysqld-bin.000001 # Binlog_checkpoint 2 # mysqld-bin.000001
+mysqld-bin.000001 # Gtid 1 # GTID 0-1-1
+mysqld-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(i INT)ENGINE=INNODB
+mysqld-bin.000001 # Gtid 1 # BEGIN GTID 0-1-2
+mysqld-bin.000001 # Annotate_rows 1 # INSERT INTO t1 VALUES(1)
+mysqld-bin.000001 # Table_map 1 # table_id: # (test.t1)
+mysqld-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 1 # COMMIT /* xid= */
+mysqld-bin.000001 # Gtid 1 # BEGIN GTID 0-1-3
+mysqld-bin.000001 # Annotate_rows 1 # DELETE FROM t1 WHERE i = 1
+mysqld-bin.000001 # Table_map 1 # table_id: # (test.t1)
+mysqld-bin.000001 # Delete_rows_v1 1 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 1 # COMMIT /* xid= */
+mysqld-bin.000001 # Gtid 2 # BEGIN GTID 0-2-4
+mysqld-bin.000001 # Annotate_rows 2 # INSERT INTO t1 VALUES(2)
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
+mysqld-bin.000001 # Write_rows_v1 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 2 # COMMIT /* xid= */
+mysqld-bin.000001 # Gtid 2 # BEGIN GTID 0-2-5
+mysqld-bin.000001 # Annotate_rows 2 # DELETE FROM t1 WHERE i = 2
+mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
+mysqld-bin.000001 # Delete_rows_v1 2 # table_id: # flags: STMT_END_F
+mysqld-bin.000001 # Xid 2 # COMMIT /* xid= */
+DROP TABLE t1;
+# End of test
diff --git a/mysql-test/suite/galera/r/sql_log_bin.result b/mysql-test/suite/galera/r/sql_log_bin.result
new file mode 100644
index 00000000000..a2ebafe5231
--- /dev/null
+++ b/mysql-test/suite/galera/r/sql_log_bin.result
@@ -0,0 +1,53 @@
+
+# On node_1
+USE test;
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1);
+# Disable binary logging for current session
+SET SQL_LOG_BIN=OFF;
+INSERT INTO t1 VALUES (2);
+FLUSH BINARY LOGS;
+CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t2 VALUES (1);
+CREATE TABLE test.t3 AS SELECT * from t1;
+# Enable binary logging for current session
+SET SQL_LOG_BIN=ON;
+INSERT INTO t2 VALUES (2);
+CREATE TABLE t4 AS SELECT * from t2;
+SELECT * FROM t1;
+c1
+1
+2
+SELECT * FROM t2;
+c1
+1
+2
+SELECT * FROM t3;
+c1
+1
+2
+SELECT * FROM t4;
+c1
+1
+2
+
+# On node_2
+USE test;
+SELECT * FROM t1;
+c1
+1
+2
+SELECT * FROM t2;
+c1
+1
+2
+SELECT * FROM t3;
+c1
+1
+2
+SELECT * FROM t4;
+c1
+1
+2
+DROP TABLE t1, t2, t3, t4;
+# End of test
diff --git a/mysql-test/suite/galera/r/unique_key.result b/mysql-test/suite/galera/r/unique_key.result
new file mode 100644
index 00000000000..ffb4f01c1f8
--- /dev/null
+++ b/mysql-test/suite/galera/r/unique_key.result
@@ -0,0 +1,47 @@
+#
+# MDEV#5552 Deadlock when inserting NULL column value in column with
+# UNIQUE index
+#
+USE test;
+
+# On node_1
+CREATE TABLE t1(c1 INT DEFAULT NULL, UNIQUE KEY c1(c1)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM test.t1;
+c1
+NULL
+NULL
+
+# On node_2
+SELECT * FROM test.t1;
+c1
+NULL
+NULL
+
+# On node_1
+INSERT INTO t1 VALUES (1);
+UPDATE t1 SET c1=NULL WHERE c1=1;
+SELECT * FROM test.t1;
+c1
+NULL
+NULL
+NULL
+
+# On node_2
+SELECT * FROM test.t1;
+c1
+NULL
+NULL
+NULL
+
+# On node_1
+DELETE FROM t1 WHERE c1<=>NULL;
+SELECT * FROM test.t1;
+c1
+
+# On node_2
+SELECT * FROM test.t1;
+c1
+DROP TABLE t1;
+# End of test
diff --git a/mysql-test/suite/galera/r/view.result b/mysql-test/suite/galera/r/view.result
new file mode 100644
index 00000000000..06d7bf072e8
--- /dev/null
+++ b/mysql-test/suite/galera/r/view.result
@@ -0,0 +1,52 @@
+#
+# MDEV-7222: Cluster Node Crash at CREATE DEFINER statement
+#
+USE test;
+CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+#
+# MDEV-8464 : ALTER VIEW not replicated in some cases
+#
+# On node_1
+USE test;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT * FROM t1;
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t1;
+CREATE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t1;
+CREATE ALGORITHM=UNDEFINED DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
+# On node_2
+USE test;
+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`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+SHOW CREATE VIEW v2;
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+SHOW CREATE VIEW v3;
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+SHOW CREATE VIEW v4;
+View Create View character_set_client collation_connection
+v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+# On node_1
+ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
+ALTER ALGORITHM=UNDEFINED VIEW v2 AS SELECT * FROM t1;
+ALTER DEFINER=CURRENT_USER VIEW v3 AS SELECT * FROM t1;
+ALTER ALGORITHM=TEMPTABLE DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
+# On node_2
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+SHOW CREATE VIEW v2;
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+SHOW CREATE VIEW v3;
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+SHOW CREATE VIEW v4;
+View Create View character_set_client collation_connection
+v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
+# Cleanup
+DROP VIEW v1, v2, v3, v4;
+DROP TABLE t1;
+# End of tests
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
new file mode 100644
index 00000000000..361743f1243
--- /dev/null
+++ b/mysql-test/suite/galera/suite.pm
@@ -0,0 +1,86 @@
+package My::Suite::GALERA;
+use File::Basename;
+use My::Find;
+
+@ISA = qw(My::Suite);
+
+return "Not run for embedded server" if $::opt_embedded_server;
+
+return "WSREP is not compiled in" unless defined $::mysqld_variables{'wsrep-on'};
+
+my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
+ "/usr/lib/galera/libgalera_smm.so",
+ "/usr/lib64/galera/libgalera_smm.so";
+
+return "No wsrep provider library" unless -f $provider;
+
+$ENV{WSREP_PROVIDER} = $provider;
+
+my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
+return "No SST scripts" unless $spath;
+
+my ($cpath) = grep { -f "$_/mysql"; } "$::bindir/scripts", $::path_client_bindir;
+return "No scritps" unless $cpath;
+
+my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
+return "No my_print_defaults" unless $epath;
+
+push @::global_suppressions,
+ (
+ qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1),
+ qr(WSREP: Could not open saved state file for reading: .*),
+ qr(WSREP: Could not open state file for reading: .*),
+ qr(WSREP: Gap in state sequence. Need state transfer.),
+ qr(WSREP: Failed to prepare for incremental state transfer:),
+ qr(WSREP:.*down context.*),
+ qr(WSREP: Failed to send state UUID:),
+ qr(WSREP: last inactive check more than .* skipping check),
+ qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.),
+ qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|,
+ qr(WSREP: Quorum: No node with complete state),
+ qr(WSREP: Initial position was provided by configuration or SST, avoiding override),
+ qr|WSREP: discarding established \(time wait\) .*|,
+ qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.),
+ qr(WSREP: evs::proto.*),
+ qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|,
+ qr(WSREP: no nodes coming from prim view, prim not possible),
+ qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable),
+ qr(WSREP: user message in state LEAVING),
+ qr(WSREP: .* sending install message failed: Transport endpoint is not connected),
+ qr(WSREP: .* sending install message failed: Resource temporarily unavailable),
+ qr(WSREP: Maximum writeset size exceeded by .*),
+ qr(WSREP: transaction size exceeded.*),
+ qr(WSREP: RBR event .*),
+ qr(WSREP: Ignoring error for TO isolated action: .*),
+ qr(WSREP: transaction size limit .*),
+ qr(WSREP: rbr write fail, .*),
+ qr(WSREP: .*Backend not supported: foo.*),
+ qr(WSREP: .*Failed to initialize backend using .*),
+ qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*),
+ qr(WSREP: gcs connect failed: Socket type not supported),
+ qr(WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 .*),
+ qr(WSREP: .*Failed to open backend connection: -110 .*),
+ qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*),
+ qr(WSREP: gcs connect failed: Connection timed out),
+ qr|WSREP: wsrep::connect\(.*\) failed: 7|,
+ qr(WSREP: SYNC message from member .* in non-primary configuration. Ignored.),
+ qr(WSREP: Could not find peer:),
+ qr(WSREP: TO isolation failed for: .*),
+ qr|WSREP: gcs_caused\(\) returned .*|,
+ qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|,
+ qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|,
+ qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|,
+ qr(WSREP: Action message in non-primary configuration from member [0-9]*),
+ qr(WSREP: discarding established .*),
+ qr|WSREP: .*core_handle_uuid_msg.*|,
+ qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on),
+ qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|,
+ );
+
+
+$ENV{PATH}="$epath:$ENV{PATH}";
+$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
+$ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath;
+
+bless { };
+
diff --git a/mysql-test/suite/galera/t/GAL-382.test b/mysql-test/suite/galera/t/GAL-382.test
new file mode 100644
index 00000000000..05cc7346055
--- /dev/null
+++ b/mysql-test/suite/galera/t/GAL-382.test
@@ -0,0 +1,16 @@
+#
+# GAL-382 InnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno in trx0sys.cc line 356
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb;
+insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
+create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb;
+replace into t2 (i, j, k) select /*!99997 */ i, k, j from t1;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/GAL-401.test b/mysql-test/suite/galera/t/GAL-401.test
new file mode 100644
index 00000000000..06ce37dc81f
--- /dev/null
+++ b/mysql-test/suite/galera/t/GAL-401.test
@@ -0,0 +1,56 @@
+# This tests proper desync counter cleanup when DONOR/DESYNC state is cleared.
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Make node 1 tolerate split-brain
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+
+# Desync and disconnect node 2 from the PC:
+--connection node_2
+SET @@global.wsrep_desync = 1;
+SET SESSION wsrep_dirty_reads=1;
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Wait until node 2 disappears from the PC:
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Modify app state to force node 2 into PRIMARY upon reconnection.
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+
+# Reconnect node 2 to the PC:
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SET wsrep_dirty_reads=0;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+# Must return 0:
+SHOW STATUS LIKE 'wsrep_desync_count';
+
+# Resync node_2, should pass:
+SET @@global.wsrep_desync = 0;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+
+SET SESSION wsrep_sync_wait=15;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
diff --git a/mysql-test/suite/galera/t/GAL-419.test b/mysql-test/suite/galera/t/GAL-419.test
new file mode 100644
index 00000000000..e50b948bf35
--- /dev/null
+++ b/mysql-test/suite/galera/t/GAL-419.test
@@ -0,0 +1,35 @@
+#
+# GAL-419 safe_to_bootstrap: boostrap using wsrep_cluster_address=gcomm:// not prevented
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--sleep 2
+
+# Node #1 has wsrep_cluster_address=gcomm:// in my.cnf, so should fail to bootstrap
+
+--error 1
+--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf | grep 'This node is not safe to bootstrap the cluster'
+
+# Unless we remove grastate.dat
+
+--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--connection node_1
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--connection node_2
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
diff --git a/mysql-test/suite/galera/t/GAL-480.test b/mysql-test/suite/galera/t/GAL-480.test
new file mode 100644
index 00000000000..c2b34f2a935
--- /dev/null
+++ b/mysql-test/suite/galera/t/GAL-480.test
@@ -0,0 +1,46 @@
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB;
+
+FLUSH TABLE t1 FOR EXPORT;
+UNLOCK TABLES;
+
+ALTER TABLE t1 DROP COLUMN f1;
+
+SET SESSION wsrep_osu_method='RSU';
+ALTER TABLE t1 ADD COLUMN f1 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f1;
+ALTER TABLE t1 ADD COLUMN f2 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f2;
+ALTER TABLE t1 ADD COLUMN f3 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f3;
+ALTER TABLE t1 ADD COLUMN f4 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f4;
+ALTER TABLE t1 ADD COLUMN f5 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f5;
+ALTER TABLE t1 ADD COLUMN f6 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f6;
+ALTER TABLE t1 ADD COLUMN f7 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f7;
+ALTER TABLE t1 ADD COLUMN f8 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f8;
+ALTER TABLE t1 ADD COLUMN f9 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f9;
+ALTER TABLE t1 ADD COLUMN f10 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f10;
+ALTER TABLE t1 ADD COLUMN f11 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f11;
+ALTER TABLE t1 ADD COLUMN f12 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f12;
+ALTER TABLE t1 ADD COLUMN f13 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f13;
+ALTER TABLE t1 ADD COLUMN f14 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f14;
+ALTER TABLE t1 ADD COLUMN f15 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f15;
+ALTER TABLE t1 ADD COLUMN f16 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f16;
+
+SET SESSION wsrep_osu_method='TOI';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-252.test b/mysql-test/suite/galera/t/MW-252.test
new file mode 100644
index 00000000000..dfb82e8070a
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-252.test
@@ -0,0 +1,42 @@
+#
+# MW-252 - Check that FTWRL causes the node to become desynced
+# and not subject to flow control
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+FLUSH TABLES WITH READ LOCK;
+
+# Node #1 is now desynced
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Donor/Desynced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Node #2 can issue updates without flow control kicking in
+--connection node_2
+
+--let $count = 100
+--disable_query_log
+while ($count)
+{
+ INSERT INTO t1 VALUES (1);
+ --dec $count
+}
+--enable_query_log
+
+# Restore cluster
+--connection node_1
+UNLOCK TABLES;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 100 FROM t1
+--source include/wait_condition.inc
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-258.test b/mysql-test/suite/galera/t/MW-258.test
new file mode 100644
index 00000000000..174dd2c02c6
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-258.test
@@ -0,0 +1,42 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+LOCK TABLE t1 WRITE;
+--echo value prior to RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+SHOW VARIABLES LIKE 'wsrep_desync';
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1b
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+--send ALTER TABLE t1 ADD COLUMN f3 INTEGER;
+
+--sleep 5
+--connection node_1
+--echo value during RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+SHOW VARIABLES LIKE 'wsrep_desync';
+UNLOCK TABLES;
+
+--connection node_1a
+--reap
+--connection node_1b
+--reap
+
+--connection node_1
+--echo value after RSU:
+--sleep 3
+SHOW STATUS LIKE 'wsrep_desync_count';
+SHOW VARIABLES LIKE 'wsrep_desync';
+SET GLOBAL wsrep_desync=0;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-259.test b/mysql-test/suite/galera/t/MW-259.test
new file mode 100644
index 00000000000..7298285f6ff
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-259.test
@@ -0,0 +1,42 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=0;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+# wsrep_desync=1 will block
+--send SET GLOBAL wsrep_desync=1;
+
+--connection node_1b
+--sleep 2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'SET GLOBAL wsrep_desync=1'
+--source include/wait_condition.inc
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+DROP TABLE t1;
+SET GLOBAL wsrep_desync=0;
+
+--connection node_1
+--reap
+
+--connection node_1a
+--reap
+
+# Cleanup
+SET DEBUG_SYNC= 'RESET';
+
diff --git a/mysql-test/suite/galera/t/MW-284.cnf b/mysql-test/suite/galera/t/MW-284.cnf
new file mode 100644
index 00000000000..52fd3093931
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-284.cnf
@@ -0,0 +1 @@
+!include ../galera_2nodes_as_master.cnf
diff --git a/mysql-test/suite/galera/t/MW-284.test b/mysql-test/suite/galera/t/MW-284.test
new file mode 100644
index 00000000000..7add82f1227
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-284.test
@@ -0,0 +1,63 @@
+#
+# MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root', MASTER_CONNECT_RETRY=1;
+--enable_query_log
+
+--connection node_1
+--let $wsrep_sync_wait_state= `SELECT @@global.wsrep_sync_wait;`
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
+--source include/wait_condition.inc
+SET SESSION wsrep_on = ON;
+#wsrep_sync_wait is set to zero because when slave tries to connect it it ask for queries like SELECT UNIX_TIMESTAMP() on node 1 which will fail, causing
+#a warning in slave error log.
+SET global wsrep_sync_wait=0;
+
+--connection node_3
+START SLAVE;
+--sleep 1
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= Connecting
+--source include/wait_for_slave_param.inc
+
+--connection node_1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+# We expect the slave to reconnect and resume replication
+
+--connection node_3
+--source include/wait_for_slave_to_start.inc
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) > 0 FROM t1
+--source include/wait_condition.inc
+
+# Cleanup
+
+--connection node_1
+DROP TABLE t1;
+
+--eval SET global wsrep_sync_wait=$wsrep_sync_wait_state
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
+
+CALL mtr.add_suppression('failed registering on master');
+CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
diff --git a/mysql-test/suite/galera/t/MW-285.test b/mysql-test/suite/galera/t/MW-285.test
new file mode 100644
index 00000000000..1c567f7b250
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-285.test
@@ -0,0 +1,31 @@
+#
+# Broken FK constraints cause assertions
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY,
+ parent1_id INT,
+ parent2_id INT,
+ FOREIGN KEY (parent1_id) REFERENCES parent1(id),
+ FOREIGN KEY (parent1_id) REFERENCES parent2(id)
+) ENGINE=InnoDB;
+
+INSERT INTO parent1 VALUES (1);
+INSERT INTO parent2 VALUES (1);
+INSERT INTO child VALUES (1,1,1);
+INSERT INTO child VALUES (2,1,1);
+
+SET foreign_key_checks=OFF;
+DROP TABLE parent1;
+
+UPDATE child SET parent1_id=2 WHERE id=1;
+
+DROP TABLE child;
+DROP TABLE parent2;
+SET foreign_key_checks=ON;
diff --git a/mysql-test/suite/galera/t/MW-286.test b/mysql-test/suite/galera/t/MW-286.test
new file mode 100644
index 00000000000..08deb317fbe
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-286.test
@@ -0,0 +1,33 @@
+#
+# MW-286 Spurious deadlock error after error with wsrep_desync and wsrep_on
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+# Insert some values before the ALTER
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+# Insert more values while the ALTER is running
+--send INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+SET GLOBAL wsrep_desync = TRUE;
+SET wsrep_on = FALSE;
+
+--error ER_QUERY_INTERRUPTED
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+
+SET SESSION wsrep_sync_wait = 0;
+SET wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/MW-292.test b/mysql-test/suite/galera/t/MW-292.test
new file mode 100644
index 00000000000..ecb1273759e
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-292.test
@@ -0,0 +1,79 @@
+#
+# MW-292 Reset timestamp after transaction replay
+#
+# We force transaction replay to happen and then we check that NOW() is not stuck in time.
+# As a bonus we also check that RAND() continues to return random values after replay
+#
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+
+CREATE TABLE rand_table (f1 FLOAT);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+
+# Block the commit
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send COMMIT;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--source include/galera_wait_sync_point.inc
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+
+# Wait for both transactions to be blocked
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Update_rows_log_event::find_row%';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+--source include/wait_condition.inc
+
+# Unblock the commit
+--connection node_1a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+# Commit succeeds via replay
+--connection node_1
+--reap
+
+# Confirm that NOW() is not stuck in time relative to SYSDATE();
+--sleep 3
+SELECT TIMEDIFF(SYSDATE(), NOW()) < 2;
+
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+
+SELECT COUNT(DISTINCT f1) = 10 FROM rand_table;
+
+# wsrep_local_replays has increased by 1
+--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+--disable_query_log
+--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old = 1 AS wsrep_local_replays;
+--enable_query_log
+
+--connection node_2
+DROP TABLE t1;
+DROP TABLE rand_table;
diff --git a/mysql-test/suite/galera/t/MW-309.test b/mysql-test/suite/galera/t/MW-309.test
new file mode 100644
index 00000000000..351a508ecec
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-309.test
@@ -0,0 +1,32 @@
+#
+# MW-309 Regression: wsrep_max_ws_rows limit also applies to certain SELECT queries
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+
+SET GLOBAL wsrep_max_ws_rows = 2;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+SELECT * FROM t1 GROUP BY f1;
+
+--error 0
+SELECT * FROM t1 GROUP BY f1;
+
+--disable_result_log
+--error 0
+SHOW STATUS LIKE '%wsrep%';
+--enable_result_log
+
+SET GLOBAL wsrep_max_ws_rows = 0;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-313-master.opt b/mysql-test/suite/galera/t/MW-313-master.opt
new file mode 100644
index 00000000000..8a755e98b00
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-313-master.opt
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/MW-313.test b/mysql-test/suite/galera/t/MW-313.test
new file mode 100644
index 00000000000..92fd835c615
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-313.test
@@ -0,0 +1,51 @@
+#
+# MW-313 Enforce wsrep_max_ws_rows also when binlog is enabled
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+
+# No error expected for SELECT and SHOW
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+
+SET GLOBAL wsrep_max_ws_rows = 2;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+SELECT * FROM t1 GROUP BY f1;
+
+--error 0
+SELECT * FROM t1 GROUP BY f1;
+
+--disable_result_log
+--error 0
+SHOW STATUS LIKE '%wsrep%';
+--enable_result_log
+
+# Error expected for DML
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 SELECT * FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES (1);
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f1) VALUES (2),(3),(4);
+
+ROLLBACK;
+START TRANSACTION;
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1;
+
+DROP TABLE t1;
+SET GLOBAL wsrep_max_ws_rows = 0;
diff --git a/mysql-test/suite/galera/t/MW-328-footer.inc b/mysql-test/suite/galera/t/MW-328-footer.inc
new file mode 100644
index 00000000000..5b736df220f
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-328-footer.inc
@@ -0,0 +1,18 @@
+#
+# Cleanup for MW-328 tests
+#
+
+--connection node_1
+--disable_query_log
+--eval KILL CONNECTION $sp_connection_id
+--enable_query_log
+
+--connection node_1X
+--error 2013,1317
+--reap
+
+--connection node_1
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-test/suite/galera/t/MW-328-header.inc b/mysql-test/suite/galera/t/MW-328-header.inc
new file mode 100644
index 00000000000..f0a6ccaccc6
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-328-header.inc
@@ -0,0 +1,29 @@
+#
+# Initialization for MW-328 tests
+#
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+
+#
+# Have some random updates going on against t1
+#
+
+DELIMITER |;
+CREATE PROCEDURE proc_update ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+ END WHILE;
+END|
+
+DELIMITER ;|
+
+--connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1X
+--let $sp_connection_id = `SELECT CONNECTION_ID()`
+--send CALL proc_update();
diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test
new file mode 100644
index 00000000000..4d6e1ea3625
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-328A.test
@@ -0,0 +1,56 @@
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Attempt to insert into t2 and check if insert actually inserted rows if
+# a success was reported.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source suite/galera/t/MW-328-header.inc
+
+--connection node_2
+--let $count = 100
+--let $successes = 0
+--let $deadlocks = 0
+
+SET SESSION wsrep_retry_autocommit = 0;
+
+--disable_query_log
+
+while ($count)
+{
+ TRUNCATE TABLE t2;
+
+ --error 0,1213
+ INSERT IGNORE INTO t2 SELECT f2 FROM t1;
+ if ($mysql_errno != 1213) {
+ --inc $successes
+ if (`SELECT COUNT(*) = 0 FROM t2`) {
+ --die No rows arrived in table t2
+ }
+ }
+
+ if ($mysql_errno == 1213) {
+ --inc $deadlocks
+
+ }
+
+ --dec $count
+}
+
+--enable_query_log
+
+#
+# Check that the test produced both deadlocks and successes
+#
+
+--disable_query_log
+--eval SELECT $successes > 0 AS have_successes
+--eval SELECT $deadlocks > 0 AS have_deadlocks
+--enable_query_log
+
+
+--source suite/galera/t/MW-328-footer.inc
diff --git a/mysql-test/suite/galera/t/MW-328B.test b/mysql-test/suite/galera/t/MW-328B.test
new file mode 100644
index 00000000000..a7b4053ab0c
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-328B.test
@@ -0,0 +1,36 @@
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Make sure an unrelated SELECT following a BF-aborted query never
+# gets the deadlock error
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source suite/galera/t/MW-328-header.inc
+
+--connection node_2
+--let $count = 100
+
+SET SESSION wsrep_retry_autocommit = 0;
+
+--disable_query_log
+
+while ($count)
+{
+ --error 0,1213
+ INSERT IGNORE INTO t2 SELECT f2 FROM t1;
+
+ --disable_result_log
+ --error 0
+ SELECT 1 FROM DUAL;
+ --enable_result_log
+
+ --dec $count
+}
+
+--enable_query_log
+
+--source suite/galera/t/MW-328-footer.inc
diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test
new file mode 100644
index 00000000000..b681e743ab3
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-328C.test
@@ -0,0 +1,36 @@
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Make sure that a high value of wsrep_retry_autocommit
+# masks all deadlock errors
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source suite/galera/t/MW-328-header.inc
+
+--connection node_2
+--let $count = 100
+
+SET SESSION wsrep_retry_autocommit = 10000;
+
+--disable_query_log
+
+while ($count)
+{
+ --error 0
+ INSERT IGNORE INTO t2 SELECT f2 FROM t1;
+
+ --disable_result_log
+ --error 0
+ SELECT 1 FROM DUAL;
+ --enable_result_log
+
+ --dec $count
+}
+
+--enable_query_log
+
+--source suite/galera/t/MW-328-footer.inc
diff --git a/mysql-test/suite/galera/t/MW-328D.test b/mysql-test/suite/galera/t/MW-328D.test
new file mode 100644
index 00000000000..d5cffdb8f47
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-328D.test
@@ -0,0 +1,40 @@
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Test that non-Galera deadlock error still behaves as expected
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (i INT) ENGINE = InnoDB;
+INSERT INTO t1 (i) VALUES(1);
+
+CREATE TABLE t2 (i INT) ENGINE = InnoDB;
+
+# Create a deadlock situation
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+--send INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;
+
+--connection node_1
+--sleep 2
+DELETE FROM t1 WHERE i = 1;
+COMMIT;
+
+# We expect that ER_LOCK_DEADLOCK will be delivered even though it was a INSERT INGORE statement
+--connection node_1a
+--error ER_LOCK_DEADLOCK
+--reap
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera/t/MW-328E.test b/mysql-test/suite/galera/t/MW-328E.test
new file mode 100644
index 00000000000..fd4b0bf9039
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-328E.test
@@ -0,0 +1,41 @@
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Test that non-Galera deadlock error still behaves as expected (case #2)
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+create table t1 (i int primary key, j int) engine=innodb;
+create table t2 (i int primary key, j int) engine=innodb;
+
+insert into t1 values (1,0);
+insert into t2 values (2,0);
+
+set autocommit=off;
+start transaction;
+update t1 set j=1 where i=1;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+set autocommit=off;
+start transaction;
+begin;
+update t2 set j=1 where i=2;
+
+--connection node_1
+# Hang expected here
+--send insert into t1 select * from t2;
+
+--sleep 2
+--connection node_1a
+--error ER_LOCK_DEADLOCK
+insert into t2 select * from t1;
+
+--connection node_1
+--reap
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera/t/MW-329-master.opt b/mysql-test/suite/galera/t/MW-329-master.opt
new file mode 100644
index 00000000000..6565a6af3c4
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-329-master.opt
@@ -0,0 +1 @@
+--wsrep-retry-autocommit=0
diff --git a/mysql-test/suite/galera/t/MW-329.test b/mysql-test/suite/galera/t/MW-329.test
new file mode 100644
index 00000000000..d9f9a787442
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-329.test
@@ -0,0 +1,85 @@
+#
+# #MW-329 Fix incorrect affected rows count after replay
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+
+# We start with a populated table
+INSERT INTO t1 (f1) VALUES (1),(65535);
+
+# Clear the wsrep_local_replays counter
+
+FLUSH STATUS;
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
+
+#
+# Run concurrent INSERTs
+#
+
+DELIMITER |;
+CREATE PROCEDURE proc_insert ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 ));
+ END WHILE;
+END|
+DELIMITER ;|
+
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1b
+--let $connection_id = `SELECT CONNECTION_ID()`
+--send CALL proc_insert();
+
+#
+# Run concurrent UPDATEs. We expect that each UPDATE will report that
+# some rows were matched and updated
+#
+
+--connection node_2
+--let $count = 10
+while ($count)
+{
+ --let $signature = `SELECT LEFT(MD5(RAND()), 10)`
+ --disable_query_log
+ --error 0,ER_LOCK_DEADLOCK
+ --eval UPDATE t1 SET f2 = '$signature'
+ --enable_query_log
+ --let $row_count = `SELECT ROW_COUNT()`
+ if (`SELECT @@error_count = 0`) {
+ if (`SELECT $row_count = 0`) {
+ --die ROW_COUNT() = 0
+ }
+ }
+ --dec $count
+}
+
+#
+# Confirm that some transaction replays occurred
+#
+
+SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
+
+#
+# Terminate the stored procedure
+#
+
+--connection node_1
+--disable_query_log
+--eval KILL CONNECTION $connection_id
+--enable_query_log
+
+--connection node_1b
+--error 0,2013,1317
+--reap
+
+--connection node_1
+DROP PROCEDURE proc_insert;
+DROP TABLE t1;
+
+# Due to MW-330, Multiple "conflict state 3 after post commit" warnings if table is dropped while SP is running
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-test/suite/galera/t/MW-336.test b/mysql-test/suite/galera/t/MW-336.test
new file mode 100644
index 00000000000..79d8951a822
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-336.test
@@ -0,0 +1,64 @@
+#
+# MW-336 Slave threads may leak if variable wsrep_slave_threads is set repeatedly
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+--connection node_1
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 1;
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+
+--connection node_1
+--sleep 0.5
+SET GLOBAL wsrep_slave_threads = 10;
+--sleep 0.5
+SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+
+SET GLOBAL wsrep_slave_threads = 20;
+--sleep 0.5
+SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+
+
+SET GLOBAL wsrep_slave_threads = 1;
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+
+
+--connection node_1
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 0;
+
+--connection node_2
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (20);
+
+--connection node_1
+--sleep 0.5
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-357.test b/mysql-test/suite/galera/t/MW-357.test
new file mode 100644
index 00000000000..d13cf058aeb
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-357.test
@@ -0,0 +1,13 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_2
+SET GLOBAL wsrep_slave_threads = 0;
+
+--connection node_1
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-369.inc b/mysql-test/suite/galera/t/MW-369.inc
new file mode 100644
index 00000000000..5fd9ef150ae
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-369.inc
@@ -0,0 +1,75 @@
+#
+# This file should be included from tests for MW-369 to run concurrent
+# transaction from node_1 with autocommit query from node_2.
+#
+# The parameters:
+# * $mw_369_parent_query - the parent query to be run inside transaction
+# * $mw_369_child_query - the child query
+#
+# The operations are the following:
+#
+# node_1:
+# START TRANSACTION;
+# $mw_369_parent_query
+# node_2
+# $mw_369_child_query - will be blocked on node_1 in apply monitor
+# node_1:
+# COMMIT; - will be blocked on node_1 in local monitor
+#
+# The $mw_369_child_query is always expected to succeed. The caller is
+# responsible for checking if the final COMMIT on connection node_1
+# succeeds.
+#
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+--eval $mw_369_parent_query
+
+#
+# Block the $mw_369_child_query from node_2
+#
+# --connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_set_sync_point.inc
+
+#
+# insert client row, which will make it impossible to replay the
+# delete on parent
+#
+--connection node_2
+--eval $mw_369_child_query
+
+#
+# Wait until $mw_369_child_query from node_2 reaches the sync point and
+# block the 'COMMIT' from node_1 before it certifies.
+#
+--connection node_1a
+--source include/galera_wait_sync_point.inc
+--source include/galera_clear_sync_point.inc
+
+--let $galera_sync_point = local_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send COMMIT
+
+#
+# Wait until both sync points have been reached
+#
+--connection node_1a
+--let $galera_sync_point = apply_monitor_slave_enter_sync local_monitor_enter_sync
+--source include/galera_wait_sync_point.inc
+
+#
+# both threads are now parked in sync points, signal them to continue
+#
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_signal_sync_point.inc
+
+--let $galera_sync_point = local_monitor_enter_sync
+--source include/galera_signal_sync_point.inc
+--source include/galera_clear_sync_point.inc
diff --git a/mysql-test/suite/galera/t/MW-369.test b/mysql-test/suite/galera/t/MW-369.test
new file mode 100644
index 00000000000..720d6daf518
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-369.test
@@ -0,0 +1,246 @@
+#
+# Test A Outline:
+# ===============
+#
+# This test tests the scenario for MW-369 where a new child table
+# row referring to parent table row is inserted concurrently from
+# another node while the transaction which tries to delete a
+# referred row from the parent table is committing.
+#
+# The p table will originally have rows (1, 0), (2, 0).
+# The c table will be empty.
+#
+# A new row (1, 1) pointing to parent row (1, 0) is inserted from
+# connection node_2, the transaction which tries to remove the
+# parent row (1, 0) is run from connection node_1.
+#
+# Expected outcome:
+# ================
+#
+# The transaction on node_1 will fail. The parent table will contain
+# rows (1, 0), (2, 0) and the child table will contain row (1, 1).
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+--let $mw_369_parent_query = DELETE FROM p WHERE f1 = 1
+--let $mw_369_child_query = INSERT INTO c VALUES (1, 1)
+
+#
+# we must open connection node_1a here, MW-369.inc will use it later
+#
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# Test B Outline:
+# ===============
+#
+# This test tests the scenario for MW-369 where a existing
+# child table row is updated concurrently from another node
+# with a transaction which updates the parent table.
+#
+# The p table will originally have rows (1, 0), (2, 0).
+# The c table will originally have rows (1, 1, 0) which points
+# to parent table row (1, 0).
+#
+# Expected outcome:
+# ================
+#
+# Both updates should succeed since they are done to separate tables and
+# rows. The parent table will contain rows (1, 1), (2, 0). The child
+# table will contain row (1, 1, 1).
+#
+
+--connection node_1
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+
+--let mw_369_parent_query = UPDATE p SET f2 = 1 WHERE f1 = 1
+--let $mw_369_child_query = UPDATE c SET f2 = 1 WHERE f1 = 1
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# Test C Outline:
+# ===============
+#
+# This test tests the scenario for MW-369 where a child table row is
+# deleted concurrently from the other node while a transaction updates
+# the parent table referred by the child table row.
+#
+# The p table will originally have rows (1, 0), (2, 0)
+# The c table will originally have row (1, 1) which points to parent
+# table row (1, 0).
+#
+# A row (1, 1) pointing to parent row (1, 0) is deleted from
+# connection node_2, the transaction which tries to update the
+# parent row (1, 0) is run from connection node_1.
+#
+# Expected Outcome:
+# ================
+# Both operations on node_1 and node_2 should succeed without conflicts.
+# The parent table should contain values (1, 1), (2, 0) and the child
+# table should be empty.
+
+--connection node_1
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1);
+
+--let $mw_369_parent_query = UPDATE p SET f2 = 1 WHERE f1 = 1
+--let $mw_369_child_query = DELETE FROM c WHERE f1 = 1
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+
+#
+# Test D Outline:
+# ===============
+#
+# This test is similar to test A, where parent row is deleted while a child row
+# is inserted simultaneously on node 2. However, in this test case the FK
+# constraint's target column is a unique key, and parent row is not delete,
+# but this key value is changed so that insert on node 2 will cause FK
+# violation
+#
+# The p table will originally have rows (1, 0)
+# The c table will originally be empty
+#
+# in node_1, parent row is updated to value (1,1)
+# A row (1, 0) pointing to the old version of parent row (1, 0) is inserted
+# in connection node_2
+#
+# Expected Outcome:
+# ================
+# This is a true conflict and one transaciton must abort. In this case it is node_1
+# transaction, which was scheduled later.
+# Parent table should have row (1,0)
+# child table should have row (1,0)
+#
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER UNIQUE KEY) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f2)) ;
+
+INSERT INTO p VALUES (1, 0);
+
+--let $mw_369_parent_query = UPDATE p SET f2 = 1 WHERE f1 = 1
+--let $mw_369_child_query = INSERT INTO c VALUES (1, 0);
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# Test E Outline:
+# ===============
+#
+# This test is similar to test B, where parent row is deleted while a child row
+# is updated simultaneously on node 2. However, in this test case the FK
+# constraint has ON DELETE CASCADE option, and the delete on parent row will
+# cascade a delete on child row as well. This will cause true conflict with
+# connection node_2, which tries to update unrelated column on child table.
+#
+# The p table will originally have rows (1, 0), (2,0)
+# The c table will originally have row (1,1,0)
+#
+# in node_1, parent row (1,0) is deleted and cascaded delete will happen on
+# child table row (1,1,0).
+# in connection node_2 child table row is update to value (1,1,1)
+#
+# Expected Outcome:
+# ================
+# This is a true conflict and one transaciton must abort. In this case it is node_1
+# transaction, which was scheduled later.
+# Parent table should have rows (1,0), (2,0)
+# child table should have row (1,1,1)
+#
+
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+ ON DELETE CASCADE) ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = DELETE FROM p WHERE f1 = 1
+--let $mw_369_child_query = UPDATE c SET f2 = 1 WHERE f1 = 1
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
diff --git a/mysql-test/suite/galera/t/MW-388.test b/mysql-test/suite/galera/t/MW-388.test
new file mode 100644
index 00000000000..209695dca80
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-388.test
@@ -0,0 +1,76 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) Engine=InnoDB;
+
+DELIMITER |;
+CREATE PROCEDURE insert_proc ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+ BEGIN
+ GET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;
+ END;
+ INSERT INTO t1 VALUES (1, 'node 1'),(2, 'node 1');
+ INSERT INTO t1 VALUES (3, 'node 1');
+END|
+DELIMITER ;|
+
+# We need two slave threads here to guarantee progress.
+# If we use only one thread the following could happen
+# in node_1:
+# We block the only slave thread in wsrep_apply_cb and we
+# issue an INSERT (by calling the stored procedure) that will
+# try to acquire galera's local monitor in pre_commit().
+# This usually works fine, except for when a commit cut event
+# sneaks in the slave queue and gets a local seqno smaller than
+# that of the INSERT. Because there is only one slave thread,
+# commit cut is not processed and therefore does not advance
+# local monitor, and our INSERT remains stuck there.
+SET GLOBAL wsrep_slave_threads = 2;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+
+--connection node_2
+--send INSERT INTO t1 VALUES (1, 'node 2');
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
+--send CALL insert_proc ();
+
+--connection node_1a
+SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
+
+
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+--connection node_2
+--reap
+
+--connection node_1
+# We expect no errors here, because the handler in insert_proc() caught the deadlock error
+--reap
+SELECT @errno = 1213;
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+SET GLOBAL wsrep_slave_threads = DEFAULT;
+DROP TABLE t1;
+DROP PROCEDURE insert_proc;
+
+SET GLOBAL debug = NULL;
+SET debug_sync='RESET';
+
+# Make sure no pending signals are leftover to surprise subsequent tests.
+SELECT @@debug_sync;
diff --git a/mysql-test/suite/galera/t/MW-402.test b/mysql-test/suite/galera/t/MW-402.test
new file mode 100644
index 00000000000..80f368b50c8
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-402.test
@@ -0,0 +1,228 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+#
+# we must open connection node_1a here, MW-369.inc will use it later
+#
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+#
+# cascading delete operation is replicated from node2
+# and this conflicts with an update for child table in node1
+#
+# As a result, the update should fail for certification error
+#
+--connection node_1
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON DELETE CASCADE);
+
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE c SET f2=1 where f1=1
+--let $mw_369_child_query = DELETE FROM p WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# cascading update operation is replicated from node2
+# and this conflicts with an update for child table in node1
+#
+# As a result, the update should fail for certification error
+#
+--connection node_1
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE c SET f2=2 where f1=1
+--let $mw_369_child_query = UPDATE p set f1=11 WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# ON UPDATE CASCADE tests
+# Here we update primary key of parent table to cause cascaded update
+# on child table
+#
+# cascading update operation is replicated from node2
+# and this conflicts with an update for child table in node1
+#
+# As a result, the update should fail for certification error
+#
+--connection node_1
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE c SET p_id=2 where f1=1
+--let $mw_369_child_query = UPDATE p set f1=11 WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+# same as previous, but statements in different order
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+--let $mw_369_parent_query = UPDATE p set f1=21 WHERE f1 = 11
+--let $mw_369_child_query = UPDATE c SET p_id=2 where f1=1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# CASCADE DELETE tests with two parent tables
+# Here we cause cascaded operation on child table through
+# one parent table and have other operation on the other
+# parent table
+#
+# cascading update operation is replicated from node2
+# but this does not conflict with an update for the other parent table in node1
+#
+# As a result, the update on p2 should succeed
+#
+--connection node_1
+
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ ON DELETE CASCADE,
+ CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1));
+
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+
+INSERT INTO c VALUES (1, 1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE p2 SET f2=2 where f1=1
+--let $mw_369_child_query = DELETE FROM p1 WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+
+#
+# CASCADE DELETE tests with two parent tables
+# Here we cause cascaded operation on child table through
+# one parent table and issue other delete operation through the
+# other parent table. The cascade progresses to same child table row where
+# we should see the conflict to happen
+#
+# As a result, the update on p2 should fail
+#
+--connection node_1
+
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ ON DELETE CASCADE,
+ CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ ON DELETE CASCADE);
+
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+
+INSERT INTO c VALUES (1, 1, 1, 0);
+
+--let $mw_369_parent_query = DELETE FROM p2 WHERE f1=1
+--let $mw_369_child_query = DELETE FROM p1 WHERE f1=1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2; \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/MW-44-master.opt b/mysql-test/suite/galera/t/MW-44-master.opt
new file mode 100644
index 00000000000..a15aa0a99d9
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-44-master.opt
@@ -0,0 +1 @@
+--log-output=TABLE
diff --git a/mysql-test/suite/galera/t/MW-44.test b/mysql-test/suite/galera/t/MW-44.test
new file mode 100644
index 00000000000..55a3fd57f80
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-44.test
@@ -0,0 +1,25 @@
+#
+# MW-44: DDL is logged in the general_log on the slave
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+TRUNCATE TABLE mysql.general_log;
+
+--connection node_2
+TRUNCATE TABLE mysql.general_log;
+
+--connection node_1
+SET SESSION wsrep_osu_method=TOI;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_osu_method=RSU;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET SESSION wsrep_osu_method=TOI;
+
+SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-86-wait1-master.opt b/mysql-test/suite/galera/t/MW-86-wait1-master.opt
new file mode 100644
index 00000000000..8a755e98b00
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-86-wait1-master.opt
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/MW-86-wait1.test b/mysql-test/suite/galera/t/MW-86-wait1.test
new file mode 100644
index 00000000000..6c0982ad8b3
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-86-wait1.test
@@ -0,0 +1,106 @@
+#
+# SHOW commands no longer obey wsrep_sync_wait = 1 (WSREP_SYNC_WAIT_BEFORE_READ)
+# (they do not wait for the background INSERT in the applier in node_2 to
+# complete)
+#
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+--source include/have_debug_sync.inc
+
+--connection node_2
+# Make sure no signals have been leftover from previous tests to surprise us.
+SELECT @@debug_sync;
+
+SET SESSION wsrep_sync_wait = 1;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+
+--connection node_1
+CREATE TABLE t_wait1 (f1 INTEGER) ENGINE=InnoDB;
+# This will complete in node_1 but will start a background apply in node_2
+# which will stop because of sync.wsrep_apply_cb we set above.
+INSERT INTO t_wait1 VALUES (1);
+
+--connection node_2
+
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+
+--disable_result_log
+
+SHOW BINARY LOGS;
+
+SHOW BINLOG EVENTS;
+
+--error ER_NO_SUCH_TABLE
+SHOW COLUMNS FROM t1;
+
+--error ER_EVENT_DOES_NOT_EXIST
+SHOW CREATE EVENT e1;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE FUNCTION f1;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PROCEDURE p1;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t1;
+
+--error ER_TRG_DOES_NOT_EXIST
+SHOW CREATE TRIGGER tr1;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE VIEW v1;
+
+SHOW DATABASES;
+
+SHOW ENGINE InnoDB STATUS;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW FUNCTION CODE f1;
+
+SHOW FUNCTION STATUS;
+
+SHOW GRANTS FOR 'root'@'localhost';
+
+--error ER_NO_SUCH_TABLE
+SHOW INDEX FROM t1;
+
+SHOW OPEN TABLES;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW PROCEDURE CODE p1;
+
+SHOW PROCEDURE STATUS;
+
+SHOW PRIVILEGES;
+
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+SHOW TABLE STATUS;
+
+SHOW TABLES;
+
+SHOW TRIGGERS;
+
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+
+--error 0
+SHOW WARNINGS;
+
+--enable_result_log
+
+# Unblock the background INSERT and remove the sync point.
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb";
+
+SET SESSION wsrep_sync_wait = default;
+
+# This will wait for the background INSERT to complete before we quit
+# from the test.
+DROP TABLE t_wait1;
+
+SET GLOBAL debug = NULL;
+SET debug_sync='RESET';
+
+# Make sure no pending signals are leftover to surprise subsequent tests.
+SELECT @@debug_sync;
diff --git a/mysql-test/suite/galera/t/MW-86-wait8-master.opt b/mysql-test/suite/galera/t/MW-86-wait8-master.opt
new file mode 100644
index 00000000000..8a755e98b00
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-86-wait8-master.opt
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/MW-86-wait8.test b/mysql-test/suite/galera/t/MW-86-wait8.test
new file mode 100644
index 00000000000..65e612c5c8e
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-86-wait8.test
@@ -0,0 +1,128 @@
+#
+# SHOW commands now obey wsrep_sync_wait = 8 (WSREP_SYNC_WAIT_BEFORE_SHOW)
+#
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+--source include/have_debug_sync.inc
+
+--connection node_2
+# Make sure no signals have been leftover from previous tests to surprise us.
+SELECT @@debug_sync;
+
+SET SESSION wsrep_sync_wait = 8;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+
+--connection node_1
+CREATE TABLE t_wait8 (f1 INTEGER) ENGINE=InnoDB;
+# This will complete in node_1 but will start a background apply in node_2
+# which will stop because of sync.wsrep_apply_cb we set above.
+INSERT INTO t_wait8 VALUES (1);
+
+--connection node_2
+
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT0.1S";
+
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+
+--disable_result_log
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW BINARY LOGS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW BINLOG EVENTS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW COLUMNS FROM t1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE DATABASE db1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE EVENT e1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE FUNCTION f1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE PROCEDURE p1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE TABLE t1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE TRIGGER tr1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE VIEW v1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW DATABASES;
+
+--error 0
+SHOW ENGINE InnoDB STATUS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW FUNCTION CODE f1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW FUNCTION STATUS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW GRANTS FOR 'root'@'localhost';
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW INDEX FROM t1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW OPEN TABLES;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW PROCEDURE CODE p1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW PROCEDURE STATUS;
+
+--error 0
+SHOW PRIVILEGES;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW TABLE STATUS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW TABLES;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW TRIGGERS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+
+--error 0
+SHOW WARNINGS;
+
+--enable_result_log
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"
+--enable_query_log
+
+# Unblock the background INSERT and remove the sync point.
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+SET SESSION wsrep_sync_wait = default;
+
+# This will wait for the background INSERT to complete before we quit
+# from the test.
+DROP TABLE t_wait8;
+
+SET GLOBAL debug = NULL;
+SET debug_sync='RESET';
+
+# Make sure no pending signals are leftover to surprise subsequent tests.
+SELECT @@debug_sync;
diff --git a/mysql-test/suite/galera/t/basic.test b/mysql-test/suite/galera/t/basic.test
new file mode 100644
index 00000000000..8fc6eee3b3b
--- /dev/null
+++ b/mysql-test/suite/galera/t/basic.test
@@ -0,0 +1,26 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+USE test;
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+SELECT * FROM t1;
+
+--echo
+--echo # On node_1
+--connection node_1
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM test.t1;
+
+--let $galera_diff_statement = SELECT * FROM t1
+--source include/galera_diff.inc
+
+# Cleanup
+DROP TABLE t1;
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/binlog_checksum.test b/mysql-test/suite/galera/t/binlog_checksum.test
new file mode 100644
index 00000000000..5aab68a7746
--- /dev/null
+++ b/mysql-test/suite/galera/t/binlog_checksum.test
@@ -0,0 +1,36 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo # On node_1
+--connection node_1
+SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
+SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
+
+--echo # On node_2
+--connection node_2
+SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
+SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
+
+USE test;
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+SELECT * FROM t1;
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM test.t1;
+
+--let $galera_diff_statement = SELECT * FROM t1
+--source include/galera_diff.inc
+
+# Cleanup
+DROP TABLE t1;
+--connection node_1
+SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
+--connection node_2
+SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/create.test b/mysql-test/suite/galera/t/create.test
new file mode 100644
index 00000000000..96a6640c21f
--- /dev/null
+++ b/mysql-test/suite/galera/t/create.test
@@ -0,0 +1,89 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
+--echo #
+
+SET @wsrep_forced_binlog_format_saved=@@GLOBAL.wsrep_forced_binlog_format;
+SET @@GLOBAL.wsrep_forced_binlog_format=STATEMENT;
+
+# @@log_bin must be OFF
+SHOW VARIABLES LIKE '%log%bin%';
+
+USE test;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TEMPORARY TABLE `t1_temp` AS SELECT * FROM `t1` WHERE i = 1;
+SELECT * FROM t1;
+SELECT * FROM t1_temp;
+
+# Cleanup
+DROP TABLE t1;
+SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
+
+--echo #
+--echo # MDEV-7673: CREATE TABLE SELECT fails on Galera cluster
+--echo #
+--connection node_1
+CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i;
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+# Cleanup
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8166 : Adding index on new table from select crashes Galera
+--echo # cluster
+--echo #
+--connection node_1
+CREATE TABLE t1(i int(11) NOT NULL DEFAULT '0') ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t1(i) VALUES (1), (2), (3);
+
+CREATE TABLE t2 (i INT) SELECT i FROM t1;
+ALTER TABLE t2 ADD INDEX idx(i);
+
+SELECT * FROM t2;
+
+--connection node_2
+SELECT * FROM t2;
+SHOW CREATE TABLE t2;
+
+# Cleanup
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-9853: WSREP says it cannot get fake InnoDB transaction ID
+--echo # followed by segmentation fault
+--echo #
+CREATE TABLE `t1`(`c1` INT) ENGINE=INNODB;
+
+SET autocommit=0;
+CREATE TABLE `t2` (`c1` INT) ENGINE=INNODB SELECT * FROM t1;
+COMMIT;
+SET autocommit=1;
+
+# Cleanup
+DROP TABLE t1, t2;
+
+
+--echo #
+--echo # MDEV-10235: Deadlock in CREATE TABLE ... AS SELECT .. if result set
+--echo # is empty in Galera
+--echo #
+--connection node_1
+CREATE TABLE t1(c1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2 AS SELECT * FROM t1 WHERE c1=2;
+
+--connection node_2
+SELECT * FROM t1;
+SELECT * FROM t2;
+# Cleanup
+DROP TABLE t1, t2;
+
+--source include/galera_end.inc
+--echo # End of tests
+
diff --git a/mysql-test/suite/galera/t/enforce_storage_engine.test b/mysql-test/suite/galera/t/enforce_storage_engine.test
new file mode 100644
index 00000000000..5f07dd53a3e
--- /dev/null
+++ b/mysql-test/suite/galera/t/enforce_storage_engine.test
@@ -0,0 +1,33 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# enforce_storage_engine should prevent the creation of tables with
+# non-enforced storage engines on the master node and the command
+# should also not replicate to other nodes.
+
+--echo #
+--echo # MDEV-8831 : enforce_storage_engine doesn't block table creation on
+--echo # other nodes (galera cluster)
+--echo #
+
+--connection node_1
+SET @@enforce_storage_engine=INNODB;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+--error ER_UNKNOWN_STORAGE_ENGINE
+CREATE TABLE t2(i INT) ENGINE=MYISAM;
+
+INSERT INTO t1 VALUES(1);
+
+--connection node_2
+SHOW TABLES;
+SELECT COUNT(*)=1 FROM t1;
+
+CREATE TABLE t2(i INT) ENGINE=MYISAM;
+
+--connection node_1
+SHOW TABLES;
+
+# Cleanup
+DROP TABLE t1, t2;
+
+--echo # End of tests
diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.opt b/mysql-test/suite/galera/t/enforce_storage_engine2.opt
new file mode 100644
index 00000000000..03f7dc5e527
--- /dev/null
+++ b/mysql-test/suite/galera/t/enforce_storage_engine2.opt
@@ -0,0 +1,2 @@
+--enforce_storage_engine=innodb --sql_mode=''
+
diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.test b/mysql-test/suite/galera/t/enforce_storage_engine2.test
new file mode 100644
index 00000000000..7a822bced59
--- /dev/null
+++ b/mysql-test/suite/galera/t/enforce_storage_engine2.test
@@ -0,0 +1,20 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-9312: storage engine not enforced during galera cluster
+--echo # replication
+--echo #
+--connection node_1
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(i INT) ENGINE=MYISAM;
+
+--connection node_2
+SHOW TABLES;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+# Cleanup
+DROP TABLE t1, t2;
+
+--echo # End of tests
diff --git a/mysql-test/suite/galera/t/ev51914.test b/mysql-test/suite/galera/t/ev51914.test
new file mode 100644
index 00000000000..e5edacabe89
--- /dev/null
+++ b/mysql-test/suite/galera/t/ev51914.test
@@ -0,0 +1,214 @@
+# Disable SAVEPOINT and ROLLBACK TO SAVEPOINT in SP, SF, TR.
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+
+--connection node_1
+--echo SAVEPOINT in a stored function should be forbidden
+--delimiter |
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+ SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+
+SELECT f1();
+
+DROP FUNCTION f1;
+
+--echo ROLLBACK TO SAVEPOINT in a stored function should be forbidden
+--delimiter |
+CREATE FUNCTION f2 () RETURNS INT BEGIN
+ ROLLBACK TO SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+SELECT f2();
+COMMIT;
+
+DROP FUNCTION f2;
+
+BEGIN;
+SAVEPOINT S;
+ROLLBACK TO SAVEPOINT S;
+COMMIT;
+
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 values (110), (111), (112), (113), (114);
+
+--echo Direct SAVEPOINT in a trigger should be forbidden
+--connection node_2
+CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+DROP TRIGGER i1_t1;
+
+CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (2);
+DROP TRIGGER i2_t1;
+
+INSERT INTO t1 VALUES (3);
+CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u1_t1;
+
+CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u2_t1;
+
+CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+
+CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+
+--echo SAVEPOINT in a compound statement in a trigger should be forbidden
+--delimiter |
+CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+ SAVEPOINT s;
+END|
+--delimiter ;
+INSERT INTO t1 VALUES (5);
+DROP TRIGGER i3_t1;
+
+--echo SAVEPOINT in a PS call in a trigger should be forbidden
+# echo handled by SAVEPOINT forbidden in PS
+--delimiter |
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+ PREPARE set_savepoint FROM "SAVEPOINT s";
+ EXECUTE set_savepoint;
+ DEALLOCATE PREPARE set_savepoint;
+END|
+--delimiter ;
+
+--connection node_2
+--echo SAVEPOINT in SP called from a trigger should be forbidden
+--delimiter |
+CREATE PROCEDURE p1() BEGIN
+ SAVEPOINT s;
+END|
+--delimiter ;
+--connection node_1
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+INSERT INTO t1 VALUES (6);
+DROP TRIGGER i5_t1;
+
+--echo SAVEPOINT in a SP called from a PS called from a trigger be forbidden
+# echo handled by SAVEPOINT forbidden in PS
+PREPARE call_p1 FROM "CALL p1";
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
+
+--echo SAVEPOINT in a function called from a trigger should be forbidden
+--delimiter |
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+ SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
+INSERT INTO t1 VALUES (7);
+DROP TRIGGER i7_t1;
+
+--echo SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
+--delimiter |
+CREATE PROCEDURE p2() BEGIN
+ CALL p1();
+END|
+--delimiter ;
+CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
+INSERT INTO t1 VALUES (8);
+DROP TRIGGER i8_t1;
+
+--echo SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
+CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+--delimiter |
+CREATE PROCEDURE p3() BEGIN
+ INSERT INTO t1 VALUES (9);
+END|
+--delimiter ;
+CALL p3();
+DROP TRIGGER i9_t1;
+
+--echo ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
+# Trigger activation creates a new savepoint level, making the earlier levels
+# inaccessible. Thus forbidding SAVEPOINT should be enough as then there is
+# no valid savepoint to pass to ROLLBACK TO SAVEPOINT, but we forbid it once
+# more just in case.
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+INSERT INTO t1 VALUES (5);
+COMMIT;
+DROP TRIGGER i4_t1;
+
+--echo ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
+--delimiter |
+CREATE PROCEDURE p4() BEGIN
+ ROLLBACK TO SAVEPOINT s;
+END|
+--delimiter ;
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+INSERT INTO t1 VALUES (6);
+COMMIT;
+DROP TRIGGER i5_t1;
+
+--echo SAVEPOINT in a SP next to a trigger should work
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
+--delimiter |
+CREATE PROCEDURE p5() BEGIN
+ SAVEPOINT s;
+ INSERT INTO t1 VALUES (10);
+ ROLLBACK TO SAVEPOINT s;
+END|
+--delimiter ;
+BEGIN;
+CALL p5();
+COMMIT;
+DROP TRIGGER i6_t1;
+
+--connection node_2
+delimiter |;
+create trigger t1 before insert on t1 for each row
+begin
+ insert into t2 values (NULL);
+end|
+delimiter ;|
+
+--connection node_1
+INSERT INTO t1 VALUES (201), (202), (203);
+
+--connection node_1
+SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+
+--connection node_2
+SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+
+--connection node_1
+DEALLOCATE PREPARE call_p1;
+
+--connection node_2
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+DROP FUNCTION f1;
diff --git a/mysql-test/suite/galera/t/fk.test b/mysql-test/suite/galera/t/fk.test
new file mode 100644
index 00000000000..e0b7cf06ed0
--- /dev/null
+++ b/mysql-test/suite/galera/t/fk.test
@@ -0,0 +1,116 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# MDEV-6651: MariaDB galera cluster crashes in file row0mysql.cc line 684
+# DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516'
+# where table ports have foreign keys
+#
+
+USE test;
+--echo
+--echo # On node_1
+--connection node_1
+
+ CREATE TABLE networks (
+ `tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+ `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `status` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `admin_state_up` tinyint(1) DEFAULT NULL,
+ `shared` tinyint(1) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+ CREATE TABLE ports (
+ `tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+ `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+ `mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
+ `admin_state_up` tinyint(1) NOT NULL,
+ `status` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
+ `device_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `device_owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `network_id` (`network_id`),
+ CONSTRAINT `ports_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+CREATE TABLE subnets (
+ `tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+ `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `network_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `ip_version` int(11) NOT NULL,
+ `cidr` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
+ `gateway_ip` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `enable_dhcp` tinyint(1) DEFAULT NULL,
+ `shared` tinyint(1) DEFAULT NULL,
+ `ipv6_ra_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
+ `ipv6_address_mode` enum('slaac','dhcpv6-stateful','dhcpv6-stateless') COLLATE utf8_unicode_ci DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `network_id` (`network_id`),
+ CONSTRAINT `subnets_ibfk_1` FOREIGN KEY (`network_id`) REFERENCES networks (`id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+ CREATE TABLE `ipallocations` (
+ `port_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `ip_address` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
+ `subnet_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+ `network_id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`ip_address`,`subnet_id`,`network_id`),
+ KEY `port_id` (`port_id`),
+ KEY `subnet_id` (`subnet_id`),
+ KEY `network_id` (`network_id`),
+ CONSTRAINT `ipallocations_ibfk_1` FOREIGN KEY (`port_id`) REFERENCES `ports` (`id`) ON DELETE CASCADE,
+ CONSTRAINT `ipallocations_ibfk_2` FOREIGN KEY (`subnet_id`) REFERENCES `subnets` (`id`) ON DELETE CASCADE,
+ CONSTRAINT `ipallocations_ibfk_3` FOREIGN KEY (`network_id`) REFERENCES `networks` (`id`) ON DELETE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO networks VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','MyNet','ACTIVE',0,0);
+
+INSERT INTO ports VALUES ('','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','fa:16:3e:e3:cc:bb',1,'DOWN','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','network:router_gateway');
+
+INSERT INTO subnets VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','ext-subnet','f37aa3fe-ab99-4d0f-a566-6cd3169d7516',4,'10.25.0.0/24','10.25.0.4',0,1,NULL,NULL);
+
+INSERT INTO ipallocations VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','10.25.0.17','f37aa3fe-ab99-4d0f-a566-6cd3169d7516','f37aa3fe-ab99-4d0f-a566-6cd3169d7516');
+
+select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
+
+--connection node_2
+
+select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
+
+--let $galera_diff_statement = SELECT * FROM ports
+--source include/galera_diff.inc
+
+--connection node_1
+
+DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
+
+select * from networks;
+select * from ports;
+select * from subnets;
+select * from ipallocations;
+select * from ports;
+
+--echo
+--echo # On node_2
+--connection node_2
+select * from networks;
+select * from ports;
+select * from subnets;
+select * from ipallocations;
+select * from ports;
+
+--let $galera_diff_statement = SELECT * FROM ports
+--source include/galera_diff.inc
+
+--connection node_1
+drop table ipallocations;
+drop table subnets;
+drop table ports;
+drop table networks;
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera#414.cnf b/mysql-test/suite/galera/t/galera#414.cnf
new file mode 100644
index 00000000000..fbd1c58754f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera#414.cnf
@@ -0,0 +1,8 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=2'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=2'
+
diff --git a/mysql-test/suite/galera/t/galera#414.test b/mysql-test/suite/galera/t/galera#414.test
new file mode 100644
index 00000000000..de10898df42
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera#414.test
@@ -0,0 +1,43 @@
+#
+# codership/galera#414 Shutdown crashes node if the node started with `gcs.max_packet_size=2`
+#
+
+--source include/big_test.inc
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+# We perform the shutdown/restart sequence in here. If there was a crash during shutdown, MTR will detect it
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+--source include/start_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_on = ON;
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+--connection node_1
+CALL mtr.add_suppression("Failed to set packet size");
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+CALL mtr.add_suppression("Failed to set packet size");
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_account_management.test b/mysql-test/suite/galera/t/galera_account_management.test
new file mode 100644
index 00000000000..6dea0fcfa9e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_account_management.test
@@ -0,0 +1,99 @@
+#
+# Test the account management statements - GRANT, REVOKE, etc.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# CREATE USER
+#
+--connection node_1
+CREATE USER user1, user2 IDENTIFIED BY 'password';
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
+
+#
+# ALTER USER
+#
+
+--connection node_1
+ALTER USER user1 PASSWORD EXPIRE;
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+
+--connection node_2
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+
+#
+# RENAME USER
+#
+
+--connection node_1
+RENAME USER user2 TO user3;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
+
+#
+# SET PASSWORD
+#
+
+--connection node_1
+SET PASSWORD FOR user3 = PASSWORD('foo');
+
+--connection node_1
+SELECT password != '' FROM mysql.user WHERE user = 'user3';
+
+#
+# DROP USER
+#
+--connection node_1
+DROP USER user1, user3;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
+
+#
+# GRANT
+#
+
+--connection node_1
+GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
+SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
+
+#
+# GRANT PROXY ON
+#
+--connection node_1
+CREATE USER user5;
+GRANT PROXY ON user4 TO user5;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
+
+#
+# REVOKE
+#
+
+--connection node_1
+REVOKE ALL PRIVILEGES ON *.* FROM user4;
+
+--connection node_2
+SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
+
+#
+# REVOKE PROXY
+#
+
+--connection node_1
+REVOKE PROXY ON user4 FROM user5;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
+
+DROP USER user4, user5;
diff --git a/mysql-test/suite/galera/t/galera_admin.test b/mysql-test/suite/galera/t/galera_admin.test
new file mode 100644
index 00000000000..e3c43256ad5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_admin.test
@@ -0,0 +1,86 @@
+#
+# Test that various admin commands from sql_admin.cc
+# Currently, REPAIR, OPTIMIZE and ANALYZE are tested.
+# Jira: PXC-390
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+DROP TABLE IF EXISTS x1, x2;
+--enable_warnings
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+# Wait until all the data from t2 has been replicated
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 10 FROM x1;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10 FROM x2;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10 FROM t1;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10000 FROM t2;
+--source include/wait_condition.inc
+
+
+--echo # ANALYZE test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+ANALYZE TABLE t1, t2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--echo # OPTIMIZE test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+OPTIMIZE TABLE t1, t2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--echo # REPAIR test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+REPAIR TABLE x1, x2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--connection node_2
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+--connection node_1
+DROP TABLE t1, t2;
+DROP TABLE x1, x2;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
diff --git a/mysql-test/suite/galera/t/galera_alter_engine_innodb.test b/mysql-test/suite/galera/t/galera_alter_engine_innodb.test
new file mode 100644
index 00000000000..bc914a38776
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_alter_engine_innodb.test
@@ -0,0 +1,17 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test ALTER ENGINE from InnoDB to InnoDB
+#
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+ALTER TABLE t1 ENGINE=InnoDB;
+
+--connection node_2
+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_alter_engine_myisam.test b/mysql-test/suite/galera/t/galera_alter_engine_myisam.test
new file mode 100644
index 00000000000..6d41d276a17
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_alter_engine_myisam.test
@@ -0,0 +1,25 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test ALTER ENGINE from MyISAM to InnoDB under wsrep_replicate_myisam
+#
+
+--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam`
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1);
+
+ALTER TABLE t1 ENGINE=InnoDB;
+
+--connection node_2
+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+--disable_query_log
+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_alter_table_force.test b/mysql-test/suite/galera/t/galera_alter_table_force.test
new file mode 100644
index 00000000000..1fcc9d4bda5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_alter_table_force.test
@@ -0,0 +1,17 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test ALTER TABLE FORCE, a 5.6.3 feature that simply rebuilds the table
+#
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+ALTER TABLE t1 FORCE;
+
+--connection node_2
+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test b/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test
new file mode 100644
index 00000000000..97819384a75
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test
@@ -0,0 +1,34 @@
+#
+# Test that applying plays well with FLUSH TABLE table_name WITH READ LOCK. The applier
+# thread should block until UNLOCK TABLEs.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+FLUSH TABLE t1 WITH READ LOCK;
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 15;
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt
new file mode 100644
index 00000000000..d8ecaacaa4c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt
@@ -0,0 +1 @@
+--lock_wait_timeout=5 --innodb_lock_wait_timeout=5 --wait_timeout=5
diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test
new file mode 100644
index 00000000000..67f2108d263
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test
@@ -0,0 +1,37 @@
+#
+# Test that applying a DDL plays well with FLUSH TABLE table_name WITH READ LOCK. The applier
+# thread should block until UNLOCK TABLEs.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+
+# Those values are valid only for connection node_1. The global values from the -master.opt file apply to applier threads.
+SET SESSION lock_wait_timeout = 60;
+SET SESSION innodb_lock_wait_timeout=60;
+SET SESSION wait_timeout=60;
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+FLUSH TABLE t1 WITH READ LOCK;
+
+--connection node_2
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1
+SELECT 1 FROM DUAL;
+# Sleep for longer than the global timeout ...
+--sleep 6
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 15;
+
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_as_master.cnf b/mysql-test/suite/galera/t/galera_as_master.cnf
new file mode 100644
index 00000000000..52fd3093931
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master.cnf
@@ -0,0 +1 @@
+!include ../galera_2nodes_as_master.cnf
diff --git a/mysql-test/suite/galera/t/galera_as_master.test b/mysql-test/suite/galera/t/galera_as_master.test
new file mode 100644
index 00000000000..93f9224b258
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master.test
@@ -0,0 +1,65 @@
+#
+# Test Galera as a master to a MySQL slave
+#
+# The galera/galera_2node_master.cnf describes the setup of the nodes
+#
+
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+--echo # Disable binary logging for current session
+SET SQL_LOG_BIN=OFF;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(1);
+INSERT INTO t1 VALUES(2);
+CREATE TABLE test.t3 AS SELECT * from t1;
+
+SET SQL_LOG_BIN=ON;
+INSERT INTO t1 VALUES(3);
+CREATE TABLE test.t4 AS SELECT * from t1;
+
+--connection node_2
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+SELECT * FROM t4;
+
+--connection node_3
+SHOW TABLES;
+
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 3 FROM t4;
+--source include/wait_condition.inc
+
+SELECT * FROM t1;
+SELECT * FROM t4;
+
+--echo # Cleanup
+--connection node_1
+DROP TABLE t1, t4;
+SET SQL_LOG_BIN=OFF;
+DROP TABLE t2, t3;
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't4';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
+
+CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
+
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid.cnf b/mysql-test/suite/galera/t/galera_as_master_gtid.cnf
new file mode 100644
index 00000000000..19517556331
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master_gtid.cnf
@@ -0,0 +1,8 @@
+!include ../galera_2nodes_as_master.cnf
+
+[mysqld]
+gtid-mode=ON
+log-bin=mysqld-bin
+log-slave-updates
+enforce-gtid-consistency
+binlog-format=ROW
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid.test b/mysql-test/suite/galera/t/galera_as_master_gtid.test
new file mode 100644
index 00000000000..9db104b7cab
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master_gtid.test
@@ -0,0 +1,70 @@
+#
+# Test Galera as a master to a MySQL slave with GTID
+#
+# The galera/galera_2node_master.cnf describes the setup of the nodes
+#
+# We check that all transactions originating from within Galera use a UUID that is
+# different from the server_uuid of either node
+#
+#
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE USER='root';
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+--let $effective_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
+--disable_query_log
+--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
+--enable_query_log
+
+--replace_result $effective_uuid <effective_uuid>
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120;
+
+--connection node_2
+INSERT INTO t1 VALUES(2);
+
+--disable_query_log
+--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
+--eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match;
+--enable_query_log
+
+--replace_result $effective_uuid <effective_uuid>
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120;
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
+--source include/wait_condition.inc
+
+--disable_query_log
+--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
+--eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match;
+--enable_query_log
+
+--replace_result $effective_uuid <effective_uuid>
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+--connection node_1
+DROP TABLE t1;
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf
new file mode 100644
index 00000000000..19517556331
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf
@@ -0,0 +1,8 @@
+!include ../galera_2nodes_as_master.cnf
+
+[mysqld]
+gtid-mode=ON
+log-bin=mysqld-bin
+log-slave-updates
+enforce-gtid-consistency
+binlog-format=ROW
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test
new file mode 100644
index 00000000000..23606d7ac4c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test
@@ -0,0 +1,54 @@
+#
+# Test that a MySQL slave can use CHANGE MASTER MASTER_AUTO_POSITION to begin replicating
+# from another Galera node
+#
+# The galera/galera_2node_master.cnf describes the setup of the nodes
+#
+#
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE USER='root';
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+--connection node_2
+INSERT INTO t1 VALUES(2);
+
+--connection node_3
+STOP SLAVE;
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_2, MASTER_AUTO_POSITION=1;
+--enable_query_log
+START SLAVE USER='root';
+
+--connection node_1
+INSERT INTO t1 VALUES(3);
+
+--connection node_2
+INSERT INTO t1 VALUES(4);
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
+--source include/wait_condition.inc
+
+--connection node_1
+DROP TABLE t1;
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_as_master_large.cnf b/mysql-test/suite/galera/t/galera_as_master_large.cnf
new file mode 100644
index 00000000000..bd8f3819b20
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master_large.cnf
@@ -0,0 +1,4 @@
+!include ../galera_2nodes_as_master.cnf
+
+[mysqld.1]
+binlog-cache-size=8192
diff --git a/mysql-test/suite/galera/t/galera_as_master_large.test b/mysql-test/suite/galera/t/galera_as_master_large.test
new file mode 100644
index 00000000000..fa343cd9c93
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master_large.test
@@ -0,0 +1,46 @@
+--echo #
+--echo # MDEV-9044 : Getting binlog corruption on my Galera cluster (10.1.8)
+--echo # making it impossible to async slave.
+--echo #
+
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+
+SELECT @@GLOBAL.BINLOG_CACHE_SIZE;
+CREATE TABLE t1 (c1 INTEGER PRIMARY KEY, c2 VARCHAR(12000)) ENGINE=INNODB;
+CREATE TABLE t2 (c1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(1, REPEAT('-', 10000));
+COMMIT;
+INSERT INTO t2 VALUES(1);
+save_master_pos;
+
+--connection node_2
+SELECT c1, LENGTH(c2) FROM t1;
+SELECT * FROM t2;
+
+--connection node_3
+sync_with_master;
+
+SELECT c1, LENGTH(c2) FROM t1;
+SELECT * FROM t2;
+
+--echo # Cleanup
+--connection node_1
+DROP TABLE t1, t2;
+save_master_pos;
+
+--connection node_3
+sync_with_master;
+
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_as_slave.cnf b/mysql-test/suite/galera/t/galera_as_slave.cnf
new file mode 100644
index 00000000000..9449ec9cf40
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave.cnf
@@ -0,0 +1 @@
+!include ../galera_2nodes_as_slave.cnf
diff --git a/mysql-test/suite/galera/t/galera_as_slave.test b/mysql-test/suite/galera/t/galera_as_slave.test
new file mode 100644
index 00000000000..849b75eadd1
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave.test
@@ -0,0 +1,50 @@
+#
+# Test Galera as a slave to a MySQL master
+#
+# The galera/galera_2node_slave.cnf describes the setup of the nodes
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--source include/wait_condition.inc
+
+INSERT INTO t1 VALUES (2);
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+SELECT COUNT(*) = 2 FROM t1;
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+SELECT COUNT(*) = 3 FROM t1;
+
+--connection node_1
+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
+
+STOP SLAVE;
+RESET SLAVE ALL;
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_autoinc.cnf b/mysql-test/suite/galera/t/galera_as_slave_autoinc.cnf
new file mode 100644
index 00000000000..9449ec9cf40
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_autoinc.cnf
@@ -0,0 +1 @@
+!include ../galera_2nodes_as_slave.cnf
diff --git a/mysql-test/suite/galera/t/galera_as_slave_autoinc.test b/mysql-test/suite/galera/t/galera_as_slave_autoinc.test
new file mode 100644
index 00000000000..59483d0591c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_autoinc.test
@@ -0,0 +1,83 @@
+#
+# Test Galera as a slave to a MySQL master
+#
+# The galera/galera_2node_slave.cnf describes the setup of the nodes
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+
+##
+## Verify the correct operation of the auto-increment when
+## the binlog format set to the 'STATEMENT' on the master node:
+##
+
+SET SESSION binlog_format='STATEMENT';
+
+CREATE TABLE t1 (
+ i int(11) NOT NULL AUTO_INCREMENT,
+ c char(32) DEFAULT 'dummy_text',
+ PRIMARY KEY (i)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+insert into t1(i) values(null);
+
+select * from t1;
+
+insert into t1(i) values(null), (null), (null);
+
+select * from t1;
+
+SET SESSION auto_increment_increment=7;
+insert into t1(i) values(null), (null), (null);
+
+SET SESSION auto_increment_offset=5;
+insert into t1(i) values(null), (null), (null);
+
+select * from t1;
+
+show variables like 'binlog_format';
+show variables like 'auto_increment_increment';
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 10 FROM t1;
+--source include/wait_condition.inc
+
+select * from t1;
+
+show variables like 'binlog_format';
+show variables like 'auto_increment_increment';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+
+select * from t1;
+
+show variables like 'binlog_format';
+show variables like 'auto_increment_increment';
+
+--connection node_1
+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
+
+STOP SLAVE;
+RESET SLAVE ALL;
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf b/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf
new file mode 100644
index 00000000000..01d2eb12630
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf
@@ -0,0 +1,6 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+log-bin=mysqld-bin
+log-slave-updates
+binlog-format=ROW
diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.test b/mysql-test/suite/galera/t/galera_as_slave_gtid.test
new file mode 100644
index 00000000000..c2331a2ae05
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.test
@@ -0,0 +1,67 @@
+#
+# Test Galera as a slave to a MariaDB master using GTIDs
+#
+# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
+# suite/galera/t/galera_as_slave_gtid.cnf has the GTID options
+#
+# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+SELECT LENGTH(@@global.gtid_binlog_state) > 1;
+--let $gtid_binlog_state_node1 = `SELECT @@global.gtid_binlog_state;`
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--source include/wait_condition.inc
+
+--disable_query_log
+--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
+--enable_query_log
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+SELECT COUNT(*) = 1 FROM t1;
+
+--disable_query_log
+--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
+--enable_query_log
+
+--connection node_1
+DROP TABLE t1;
+
+#
+# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
+# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
+# warning is also reported by MTR, which is also weird.
+#
+
+--sleep 1
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_nonprim.cnf b/mysql-test/suite/galera/t/galera_as_slave_nonprim.cnf
new file mode 100644
index 00000000000..5a44e5664b5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_nonprim.cnf
@@ -0,0 +1 @@
+!include ../galera_3nodes_as_slave.cnf
diff --git a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
new file mode 100644
index 00000000000..46a93458271
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
@@ -0,0 +1,96 @@
+#
+# Test the behavior of a Galera async slave if it goes non-prim. Async replication
+# should abort with an error but it should be possible to restart it.
+#
+# The galera/galera_2node_slave.cnf describes the setup of the nodes
+#
+
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+# Step #1. Establish replication
+#
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+#
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root';
+--enable_query_log
+START SLAVE;
+SET SESSION wsrep_sync_wait = 0;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+--sleep 1
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+# Step #2. Force async slave to go non-primary
+
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Step #3. Force async replication to fail by creating a replication event while the slave is non-prim
+
+--connection node_1
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+
+--connection node_2
+--sleep 5
+
+--let $value = query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1)
+--connection node_3
+--disable_query_log
+--eval SELECT "$value" IN ("Error 'Unknown command' on query. Default database: 'test'. Query: 'BEGIN'", "Node has dropped from cluster") AS expected_error
+--enable_query_log
+
+# Step #4. Bring back the async slave and restart replication
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+
+--connection node_3
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--connection node_2
+--source include/wait_until_ready.inc
+--source include/wait_until_connected_again.inc
+
+START SLAVE;
+
+# Confirm that the replication events have arrived
+
+--let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
+--source include/wait_condition.inc
+
+--connection node_1
+DROP TABLE t1;
+
+--sleep 2
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
+
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown command' on query");
+CALL mtr.add_suppression("Slave: Unknown command Error_code: 1047");
+CALL mtr.add_suppression("Transport endpoint is not connected");
+CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
+CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
+
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf b/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf
new file mode 100644
index 00000000000..d1a0fb15ff3
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf
@@ -0,0 +1,3 @@
+!include ../galera_2nodes_as_slave.cnf
+[mysqld]
+wsrep-preordered=TRUE
diff --git a/mysql-test/suite/galera/t/galera_as_slave_preordered.test b/mysql-test/suite/galera/t/galera_as_slave_preordered.test
new file mode 100644
index 00000000000..6f221f83b3a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_preordered.test
@@ -0,0 +1,84 @@
+#
+# Test Galera as a slave to a MySQL master with --wsrep-preordered=TRUE
+#
+# The galera/galera_2node_slave.cnf describes the setup of the nodes
+#
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE USER='root';
+
+#
+# Issue many large-ish transaction on the async master
+#
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+
+--disable_query_log
+--let $count = 100
+while ($count)
+{
+ --eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
+ --dec $count
+}
+--enable_query_log
+
+#
+# While the async transactions are being applied, issue another set of transactions
+# on the Galera node.
+#
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $count = 100
+--disable_query_log
+while ($count)
+{
+ --eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
+ --dec $count
+}
+--enable_query_log
+
+#
+# Confirm that all transactions successfully committed
+#
+
+--let $wait_condition = SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+
+#
+# Cleanup
+#
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE ten;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.cnf b/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.cnf
new file mode 100644
index 00000000000..d092d88bfaf
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.cnf
@@ -0,0 +1,4 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+wsrep-mysql-replication-bundle=2
diff --git a/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.test b/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.test
new file mode 100644
index 00000000000..460e040c010
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.test
@@ -0,0 +1,48 @@
+#
+# Test the wsrep_replication_bundle variable. We expect that multiple async replication events
+# will be grouped together and thus a smaller number of wsrep_last_committed transactions will
+# be reported.
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+INSERT INTO t1 VALUES(4);
+INSERT INTO t1 VALUES(5);
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
+--source include/wait_condition.inc
+
+# With wsrep_mysql_replication_bundle = 2, the last insert is not delivered
+# because there are not enough events remaining to complete an entire bundle
+SELECT COUNT(*) = 4 FROM t1;
+
+# Bundle is now complete, the last INSERT and the DROP are delivered
+--connection node_1
+DROP TABLE t1;
+
+--connection node_2
+--sleep 1
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
new file mode 100644
index 00000000000..b4bf5f02171
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
new file mode 100644
index 00000000000..30ce9bc4ceb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
@@ -0,0 +1,95 @@
+#
+# Test that autoincrement works correctly while the cluster membership
+# is changing and SST takes place.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $connection_id = `SELECT CONNECTION_ID()`
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+
+# Issue an endless stream of autoincrement inserts
+
+DELIMITER |;
+CREATE PROCEDURE p1 ()
+BEGIN
+ DECLARE x INT DEFAULT 1;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+
+ WHILE 1 DO
+ INSERT INTO t1 VALUES (DEFAULT);
+ COMMIT;
+ END WHILE;
+END|
+DELIMITER ;|
+
+--send CALL p1();
+--sleep 2
+
+--connection node_2
+--send CALL p1();
+--sleep 2
+
+# Kill and restart node #2
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--source include/kill_galera.inc
+
+--sleep 10
+--source include/start_mysqld.inc
+--sleep 25
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (DEFAULT);
+
+# Terminate the stored procedure
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+--disable_query_log
+--eval KILL CONNECTION $connection_id
+--enable_query_log
+
+INSERT INTO t1 VALUES (DEFAULT);
+
+--connection node_1
+# CR_SERVER_LOST
+--error 2013,2006
+--reap
+
+--connection node_2
+# CR_SERVER_LOST
+--error 2013,2006
+--reap
+
+--sleep 10
+
+# Confirm that the count is correct and that the cluster is intact
+
+--connection node_1a
+--let $count = `SELECT COUNT(*) FROM t1`
+
+--connection node_2a
+--disable_query_log
+--eval SELECT COUNT(*) = $count AS count_equal FROM t1
+--enable_query_log
+
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
+
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1a
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
diff --git a/mysql-test/suite/galera/t/galera_bf_abort.test b/mysql-test/suite/galera/t/galera_bf_abort.test
new file mode 100644
index 00000000000..f3476fba490
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort.test
@@ -0,0 +1,34 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test a local transaction being aborted by a slave one
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+
+--connection node_2
+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1,'node_2');
+
+--connection node_1
+INSERT INTO t1 VALUES (1,'node_1');
+
+--connection node_2a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'node_1'
+--source include/wait_condition.inc
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+INSERT INTO t1 VALUES (2, 'node_2');
+
+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+--disable_query_log
+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test b/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test
new file mode 100644
index 00000000000..fde783e2cef
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test that a local FLUSH TABLES FOR EXPORT will NOT be broken by an incoming remote transaction against that table
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+UNLOCK TABLES;
+
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait = 15;
+SELECT COUNT(*) = 1 FROM t1;
+
+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+--disable_query_log
+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 0 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_bf_abort_for_update.test b/mysql-test/suite/galera/t/galera_bf_abort_for_update.test
new file mode 100644
index 00000000000..24c29778e5d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort_for_update.test
@@ -0,0 +1,29 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test a local transaction being aborted by a slave one while it is running a SELECT FOR UPDATE
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+SELECT * FROM t1 FOR UPDATE;
+
+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+--disable_query_log
+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test b/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test
new file mode 100644
index 00000000000..44398e717d1
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test
@@ -0,0 +1,30 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# A local transaction running FLUSH TABLES WITH READ LOCK will not be aborted by a slave transaction
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+--send FLUSH TABLES WITH READ LOCK;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--reap
+
+UNLOCK TABLES;
+
+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+# No aborts should be registered on the counter
+--disable_query_log
+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 0 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test b/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test
new file mode 100644
index 00000000000..72fc1c5b583
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test
@@ -0,0 +1,36 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test a local transaction being aborted by a slave one while it is running a GET_LOCK()
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+SELECT GET_LOCK("foo", 1000);
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+INSERT INTO t1 VALUES (1);
+--send SELECT GET_LOCK("foo", 1000);
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+--reap
+
+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+# Check that wsrep_local_bf_aborts has been incremented by exactly 1
+--disable_query_log
+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test
new file mode 100644
index 00000000000..4582f3f972d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test
@@ -0,0 +1,36 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test that a local LOCK TABLE will NOT be broken by an incoming remote transaction against that table
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+LOCK TABLE t1 WRITE;
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+UNLOCK TABLES;
+
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+COMMIT;
+SELECT COUNT(*) = 1 FROM t1;
+
+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+--disable_query_log
+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 0 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_bf_abort_sleep.test b/mysql-test/suite/galera/t/galera_bf_abort_sleep.test
new file mode 100644
index 00000000000..8d135dc7d42
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort_sleep.test
@@ -0,0 +1,30 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test a local transaction being aborted by a slave one while it is running a SLEEP()
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+INSERT INTO t1 VALUES (1);
+--send SELECT SLEEP(1000);
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+--reap
+
+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+# Check that wsrep_local_bf_aborts has been incremented by exactly 1
+--disable_query_log
+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_bf_lock_wait.test b/mysql-test/suite/galera/t/galera_bf_lock_wait.test
new file mode 100644
index 00000000000..e3a9077a888
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_lock_wait.test
@@ -0,0 +1,52 @@
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+CREATE TABLE t1 ENGINE=InnoDB select 1 as a, 1 as b union select 2, 2;
+ALTER TABLE t1 add primary key(a);
+
+DELIMITER |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION rollback;
+ WHILE 1 DO
+ start transaction;
+ update t1 set b=connection_id() where a=1;
+ commit;
+ END WHILE;
+END|
+
+
+DELIMITER ;|
+
+--connect node_1_p1, 127.0.0.1, root, , test, $NODE_MYPORT_1
+send call p1;
+--connect node_1_p2, 127.0.0.1, root, , test, $NODE_MYPORT_1
+send call p1;
+--connect node_2_p1, 127.0.0.1, root, , test, $NODE_MYPORT_2
+send call p1;
+--connect node_2_p2, 127.0.0.1, root, , test, $NODE_MYPORT_2
+send call p1;
+
+connection default;
+let $counter=10;
+let $sleep_period=10;
+
+echo checking error log for 'BF lock wait long' message for $counter times every $sleep_period seconds ...;
+while($counter > 0)
+{
+--disable_query_log
+--disable_result_log
+ eval do sleep($sleep_period);
+--enable_query_log
+--enable_result_log
+
+# use error 0,1 instead if want test to continue
+ --error 1
+ exec grep 'BF lock wait long' $MYSQLTEST_VARDIR/log/mysqld.*.err;
+ dec $counter;
+}
+
+drop table t1;
+drop procedure p1;
+
diff --git a/mysql-test/suite/galera/t/galera_binlog_cache_size.test b/mysql-test/suite/galera/t/galera_binlog_cache_size.test
new file mode 100644
index 00000000000..6ce9072d412
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_cache_size.test
@@ -0,0 +1,35 @@
+#
+# Test that Galera, like the stock MySQL, returns an error on transactions
+# larger than max_binlog_cache_size
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 VARCHAR(767)) ENGINE=InnoDB;
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+--let $max_binlog_cache_size_orig = `SELECT @@max_binlog_cache_size`
+--let $binlog_cache_size_orig = `SELECT @@binlog_cache_size`
+
+SET GLOBAL binlog_cache_size=4096;
+SET GLOBAL max_binlog_cache_size=4096;
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+--connection node_1a
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten;
+--error ER_TRANS_CACHE_FULL
+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten;
+
+--disable_query_log
+--eval SET GLOBAL max_binlog_cache_size = $max_binlog_cache_size_orig
+--eval SET GLOBAL binlog_cache_size = $binlog_cache_size_orig
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt b/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt
new file mode 100644
index 00000000000..c8e53f07fc2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt
@@ -0,0 +1 @@
+--binlog-checksum=CRC32 --master-verify-checksum=1 --slave-sql-verify-checksum=1
diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum.test b/mysql-test/suite/galera/t/galera_binlog_checksum.test
new file mode 100644
index 00000000000..48669305242
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_checksum.test
@@ -0,0 +1,22 @@
+#
+# Test that Galera works with binary log checksums.
+# The galera_binlog_checksum-master.opt file is used to enable checksums.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
new file mode 100644
index 00000000000..a36d21315a6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
@@ -0,0 +1 @@
+--binlog-row-event-max-size=4294967295
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test
new file mode 100644
index 00000000000..d0cc23446b2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test
@@ -0,0 +1,21 @@
+#
+# Test that replication works event with the maximum value of binlog-row-event-max-size - 4294967295 (on 32-bit platforms)
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 VARCHAR(1000));
+
+# Insert 10K records, 1K bytes each
+INSERT INTO t1 SELECT REPEAT('x', 1000) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_2
+SELECT COUNT(*) = 10000 FROM t1;
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt
new file mode 100644
index 00000000000..22174756652
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt
@@ -0,0 +1 @@
+--binlog-row-event-max-size=256
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test
new file mode 100644
index 00000000000..00b55339770
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test
@@ -0,0 +1,15 @@
+#
+# Test that replication works event with the minimum value of binlog-row-event-max-size - 256
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 VARCHAR(1000));
+INSERT INTO t1 VALUES (REPEAT('x', 1000));
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('x', 1000);
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/galera/t/galera_binlog_row_image.test b/mysql-test/suite/galera/t/galera_binlog_row_image.test
new file mode 100644
index 00000000000..70262ec44ca
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_row_image.test
@@ -0,0 +1,100 @@
+#
+# Test the operation on the different values of the binlog_row_image option
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# binlog_row_image = minimal
+#
+
+--connection node_1
+SET SESSION binlog_row_image=minimal;
+
+# Create a table with a PK, with a unique key and with no key
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER NOT NULL UNIQUE) ENGINE=InnoDB;
+CREATE TABLE t3 (f1 VARCHAR(1)) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 1;
+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 1;
+
+--connection node_1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+UPDATE t2 SET f1 = 2 WHERE f1 = 1;
+UPDATE t3 SET f1 = 2 WHERE f1 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 2;
+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 2;
+
+--connection node_1
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 0 FROM t2;
+SELECT COUNT(*) = 0 FROM t3;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+#
+# binlog_row_image = noblob
+#
+
+# A table with only a blob, and a table with a PK and a blob
+
+--connection node_1
+SET SESSION binlog_row_image=noblob;
+
+CREATE TABLE t1 (f1 BLOB, f2 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES ('abc', 1);
+INSERT INTO t2 VALUES ('abc');
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'abc';
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'abc';
+
+--connection node_1
+UPDATE t1 SET f1 = 'xyz';
+UPDATE t2 SET f1 = 'xyz';
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'xyz';
+
+--connection node_1
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 2;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
+
+--connection node_1
+DELETE FROM t1;
+DELETE FROM t2;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 0 FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test b/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test
new file mode 100644
index 00000000000..95bc85c4cab
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test
@@ -0,0 +1,28 @@
+#
+# Test that Galera continues to run even with binlog-rows-query-log-events=TRUE
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $binlog_rows_query_log_events_orig = `SELECT @@binlog_rows_query_log_events`
+
+SET GLOBAL binlog_rows_query_log_events=TRUE;
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+
+--connection node_1
+--eval SET GLOBAL binlog_rows_query_log_events = $binlog_rows_query_log_events_orig
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_concurrent_ctas.test b/mysql-test/suite/galera/t/galera_concurrent_ctas.test
new file mode 100644
index 00000000000..f0dcf8e4900
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_concurrent_ctas.test
@@ -0,0 +1,57 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--write_file $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+DROP table t1;
+CREATE table t1 as SELECT SLEEP(0);
+CREATE table t2 as SELECT SLEEP(0);
+CREATE table t3 as SELECT SLEEP(0);
+CREATE table t4 as SELECT SLEEP(0);
+CREATE table t5 as SELECT SLEEP(0);
+CREATE table t6 as SELECT SLEEP(0);
+CREATE table t7 as SELECT SLEEP(0);
+CREATE table t8 as SELECT SLEEP(0);
+CREATE table t9 as SELECT SLEEP(0);
+DROP table t1;
+DROP table t2;
+DROP table t3;
+DROP table t4;
+DROP table t5;
+DROP table t6;
+DROP table t7;
+DROP table t8;
+DROP table t9;
+EOF
+
+let $run=10;
+
+while($run)
+{
+ --error 0,1
+ exec $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_1 test
+ < $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql &
+ $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_2 test
+ < $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql;
+ dec $run;
+}
+
+--remove_file $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql
+
+--source include/galera_end.inc
+--echo # End of test
+
diff --git a/mysql-test/suite/galera/t/galera_create_function.test b/mysql-test/suite/galera/t/galera_create_function.test
new file mode 100644
index 00000000000..0d7cec0114f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_create_function.test
@@ -0,0 +1,53 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test CREATE FUNCTION
+#
+
+--connection node_1
+CREATE USER 'user1';
+
+CREATE
+DEFINER = 'user1'
+FUNCTION f1 (param INTEGER)
+RETURNS VARCHAR(200)
+COMMENT 'f1_comment'
+LANGUAGE SQL
+NOT DETERMINISTIC
+MODIFIES SQL DATA
+SQL SECURITY DEFINER
+RETURN 'abc';
+GRANT EXECUTE ON FUNCTION f1 TO user1;
+
+CREATE
+DEFINER = CURRENT_USER
+FUNCTION f2 (param VARCHAR(100))
+RETURNS INTEGER
+DETERMINISTIC
+NO SQL
+SQL SECURITY INVOKER
+RETURN 123;
+
+--connection node_1
+SHOW CREATE FUNCTION f1;
+
+--connection node_2
+# Work around codership/mysql-wsrep#228 - SHOW CREATE FUNCTION not covered by wsrep_sync_wait
+SELECT 1 FROM DUAL;
+SHOW CREATE FUNCTION f1;
+
+--connection node_1
+SHOW CREATE FUNCTION f2;
+
+--connection node_2
+SHOW CREATE FUNCTION f2;
+
+SELECT f1(1) = 'abc';
+SELECT f2('abc') = 123;
+
+--connection node_1
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+
+DROP USER 'user1';
diff --git a/mysql-test/suite/galera/t/galera_create_procedure.test b/mysql-test/suite/galera/t/galera_create_procedure.test
new file mode 100644
index 00000000000..30bc85fcea0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_create_procedure.test
@@ -0,0 +1,52 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test CREATE PROCEDURE
+#
+
+--connection node_1
+CREATE USER 'user1';
+CREATE TABLE t1 (f1 INTEGER);
+
+CREATE
+DEFINER = 'user1'
+PROCEDURE p1 (IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER)
+COMMENT 'p1_comment'
+LANGUAGE SQL
+NOT DETERMINISTIC
+MODIFIES SQL DATA
+SQL SECURITY DEFINER
+INSERT INTO t1 VALUES (1);
+GRANT EXECUTE ON PROCEDURE p1 TO user1;
+
+CREATE
+DEFINER = CURRENT_USER
+PROCEDURE p2 (param VARCHAR(100))
+DETERMINISTIC
+NO SQL
+SQL SECURITY INVOKER BEGIN END ;
+
+--connection node_1
+SHOW CREATE PROCEDURE p1;
+
+--connection node_2
+# Perform causal wait
+SELECT 1 FROM DUAL;
+SHOW CREATE PROCEDURE p1;
+
+--connection node_1
+SHOW CREATE PROCEDURE p2;
+
+--connection node_2
+SHOW CREATE PROCEDURE p2;
+
+CALL p1(@a, @b, @c);
+CALL p2('abc');
+
+--connection node_1
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP USER 'user1';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_create_table_like.test b/mysql-test/suite/galera/t/galera_create_table_like.test
new file mode 100644
index 00000000000..0e0e8b0ffcf
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_create_table_like.test
@@ -0,0 +1,50 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test the various forms of CREATE TABLE LIKE ... , since Galera has special handling
+# for them, especially when one of the tables is a temporary one.
+#
+
+CREATE SCHEMA schema1;
+CREATE SCHEMA schema2;
+
+USE schema1;
+CREATE TABLE real_table (f1 INTEGER) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE temp_table (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE myisam_table (f1 INTEGER) ENGINE=MyISAM;
+
+USE schema2;
+CREATE TABLE real_table1 LIKE schema1.real_table;
+CREATE TABLE real_table2 LIKE schema1.temp_table;
+CREATE TABLE real_table3 LIKE schema1.myisam_table;
+
+CREATE TEMPORARY TABLE temp_table1 LIKE schema1.real_table;
+CREATE TEMPORARY TABLE temp_table2 LIKE schema1.temp_table;
+CREATE TEMPORARY TABLE temp_table3 LIKE schema1.myisam_table;
+
+--connection node_2
+# Only the non-temporary tables are replicated, regardless of the type of table they are based on
+
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table' AND TABLE_SCHEMA = 'schema1';
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'myisam_table' AND TABLE_SCHEMA = 'schema1';
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table' AND TABLE_SCHEMA = 'schema1';
+
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table1' AND TABLE_SCHEMA = 'schema2';
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table2' AND TABLE_SCHEMA = 'schema2';
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table3' AND TABLE_SCHEMA = 'schema2';
+
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table1' AND TABLE_SCHEMA = 'schema2';
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table2' AND TABLE_SCHEMA = 'schema2';
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table3' AND TABLE_SCHEMA = 'schema2';
+
+--connection node_1
+DROP TABLE schema1.real_table;
+DROP TABLE schema1.myisam_table;
+
+DROP TABLE schema2.real_table1;
+DROP TABLE schema2.real_table2;
+DROP TABLE schema2.real_table3;
+
+DROP SCHEMA schema1;
+DROP SCHEMA schema2;
diff --git a/mysql-test/suite/galera/t/galera_create_trigger.test b/mysql-test/suite/galera/t/galera_create_trigger.test
new file mode 100644
index 00000000000..6708e30bf0f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_create_trigger.test
@@ -0,0 +1,43 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test CREATE TRIGGER, especially with different DEFINER
+#
+
+CREATE TABLE definer_root (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+CREATE TABLE definer_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+CREATE TABLE definer_current_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+CREATE TABLE definer_default (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB;
+
+CREATE USER 'user1';
+CREATE DEFINER=root@localhost TRIGGER definer_root BEFORE INSERT ON definer_root FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+CREATE DEFINER=user1 TRIGGER definer_user BEFORE INSERT ON definer_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+CREATE DEFINER=current_user TRIGGER definer_current_user BEFORE INSERT ON definer_current_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+CREATE TRIGGER definer_default BEFORE INSERT ON definer_default FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
+
+--connection node_2
+INSERT INTO definer_root (f1) VALUES (1);
+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_root';
+SELECT trigger_user = 'root@localhost' FROM definer_root;
+
+INSERT INTO definer_user (f1) VALUES (1);
+SELECT DEFINER = 'user1@%' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_user';
+SELECT trigger_user = 'user1@%' FROM definer_user;
+
+INSERT INTO definer_current_user (f1) VALUES (1);
+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_current_user';
+SELECT trigger_user = 'root@localhost' FROM definer_current_user;
+
+INSERT INTO definer_default (f1) VALUES (1);
+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_default';
+SELECT trigger_user = 'root@localhost' FROM definer_default;
+
+--connection node_1
+DROP TABLE definer_current_user;
+DROP TABLE definer_user;
+DROP TABLE definer_root;
+DROP TABLE definer_default;
+
+DROP USER 'user1';
+
diff --git a/mysql-test/suite/galera/t/galera_ddl_multiline.test b/mysql-test/suite/galera/t/galera_ddl_multiline.test
new file mode 100644
index 00000000000..c7155d066fa
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ddl_multiline.test
@@ -0,0 +1,54 @@
+#
+# Test that Galera works correctly with multiline statements, in particular involving DDLs
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection node_2
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection node_1
+--send CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
+--reap
+
+SHOW CREATE TABLE t3;
+SHOW CREATE TABLE t4;
+
+--connection node_2
+SHOW CREATE TABLE t3;
+SHOW CREATE TABLE t4;
+
+--connection node_1
+INSERT INTO t1 VALUES (1); CREATE TABLE t5 (f1 INTEGER) ENGINE=InnoDB;
+
+SELECT COUNT(*) = 1 FROM t1;
+SHOW CREATE TABLE t5;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SHOW CREATE TABLE t5;
+
+--connection node_1
+--send CREATE TABLE t6 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t2 VALUES (1);
+--reap
+
+SELECT COUNT(*) = 1 FROM t2;
+SHOW CREATE TABLE t6;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t2;
+SHOW CREATE TABLE t6;
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+DROP TABLE t1, t2, t3, t4, t5, t6;
+
diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test
new file mode 100644
index 00000000000..32fc24097d2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_defaults.test
@@ -0,0 +1,71 @@
+#
+# The purpose of this test is to preserve the current state of the following:
+# * SHOW VARIABLES LIKE 'wsrep%'
+# * wsrep_provider_options
+# * The names of the Galera status variables
+#
+# This way, if there is any change, inadvertent or not, the test will fail and the
+# developer and QA will be alerted.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Make sure that the test is operating on the right version of galera library.
+--disable_query_log
+--let $galera_version=3.20
+source ../wsrep/include/check_galera_version.inc;
+--enable_query_log
+
+# Global Variables
+
+SELECT COUNT(*) = 43 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
+
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME LIKE 'wsrep_%'
+AND VARIABLE_NAME NOT IN (
+ 'WSREP_PROVIDER_OPTIONS',
+ 'WSREP_SST_RECEIVE_ADDRESS',
+ 'WSREP_NODE_ADDRESS',
+ 'WSREP_NODE_NAME',
+ 'WSREP_PROVIDER',
+ 'WSREP_DATA_HOME_DIR',
+ 'WSREP_NODE_INCOMING_ADDRESS',
+ 'WSREP_START_POSITION',
+ 'WSREP_PATCH_VERSION'
+)
+ORDER BY VARIABLE_NAME;
+
+# wsrep_provider_options
+#
+# We replace the ones that vary from run to run with placeholders
+
+--let _WSREP_PROVIDER_OPTIONS = `SELECT @@wsrep_provider_options`
+--perl
+ use strict;
+ my $wsrep_provider_options = $ENV{'_WSREP_PROVIDER_OPTIONS'};
+ $wsrep_provider_options =~ s/base_dir = .*?;/<BASE_DIR>;/sgio;
+ $wsrep_provider_options =~ s/base_host = .*?;/<BASE_HOST>;/sgio;
+ $wsrep_provider_options =~ s/base_port = .*?;/<BASE_PORT>;/sgio;
+ $wsrep_provider_options =~ s/gcache\.dir = .*?;/<GCACHE_DIR>;/sgio;
+ $wsrep_provider_options =~ s/gcache\.name = .*?;/<GCACHE_NAME>;/sgio;
+ $wsrep_provider_options =~ s/gmcast\.listen_addr = .*?;/<GMCAST_LISTEN_ADDR>;/sgio;
+ $wsrep_provider_options =~ s/gcs\.recv_q_hard_limit = .*?;/<GCS_RECV_Q_HARD_LIMIT>;/sgio;
+ $wsrep_provider_options =~ s/ist\.recv_addr = .*?;/<IST_RECV_ADDR>;/sgio;
+ $wsrep_provider_options =~ s/evs\.evict = .*?;/<EVS_EVICT>;/sgio;
+ $wsrep_provider_options =~ s/signal = .*?;\s*//sgio;
+ $wsrep_provider_options =~ s/dbug = .*?;\s*//sgio;
+ print $wsrep_provider_options."\n";
+EOF
+
+# Global Status
+
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME LIKE 'wsrep_%'
+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
+
+SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME LIKE 'wsrep_%'
+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'
+ORDER BY VARIABLE_NAME;
diff --git a/mysql-test/suite/galera/t/galera_delete_limit.test b/mysql-test/suite/galera/t/galera_delete_limit.test
new file mode 100644
index 00000000000..4cbadbd3ba0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_delete_limit.test
@@ -0,0 +1,52 @@
+#
+# DELETE LIMIT should not cause any issues with row-based Galera replication
+# regardless of the order in which the rows were deleted
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# With a PK
+#
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND();
+
+--connection node_2
+DELETE FROM t1 ORDER BY RAND() LIMIT 5;
+--let $sum_remaining = `SELECT SUM(f1) FROM t1`
+--let $max_remaining = `SELECT MAX(f1) FROM t1`
+
+--connection node_1
+--disable_query_log
+--eval SELECT (SELECT SUM(f1) FROM t1) = $sum_remaining AS sum_matches;
+--eval SELECT f1 = $max_remaining AS max_matches FROM t1 WHERE f1 = $max_remaining;
+--enable_query_log
+
+DROP TABLE t1;
+
+#
+# Without a PK
+#
+
+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND();
+
+--connection node_2
+DELETE FROM t2 ORDER BY RAND() LIMIT 5;
+--let $sum_remaining = `SELECT SUM(f1) FROM t2`
+--let $max_remaining = `SELECT MAX(f1) FROM t2`
+
+--connection node_1
+--disable_query_log
+--eval SELECT (SELECT SUM(f1) FROM t2) = $sum_remaining AS sum_matches;
+--eval SELECT f1 = $max_remaining AS max_matches FROM t2 WHERE f1 = $max_remaining;
+--enable_query_log
+
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_desync_overlapped.test b/mysql-test/suite/galera/t/galera_desync_overlapped.test
new file mode 100644
index 00000000000..8b78e8cdeb7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_desync_overlapped.test
@@ -0,0 +1,59 @@
+#
+# Test for overlapped transactions under manual desync.
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
+send INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_1a
+
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+SET DEBUG_SYNC='now WAIT_FOR alter1';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
+send INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_1
+reap;
+
+--connection node_1a
+reap;
+
+--connection node_1
+
+SET DEBUG_SYNC='RESET';
+
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+
+--disable_query_log
+call mtr.add_suppression("Trying to make wsrep_desync = OFF on the node that is already synchronized.");
+--enable_query_log
+show status like 'wsrep_desync_count';
+SET GLOBAL wsrep_desync = 0;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_drop_multi.test b/mysql-test/suite/galera/t/galera_drop_multi.test
new file mode 100644
index 00000000000..44b1b619b2b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_drop_multi.test
@@ -0,0 +1,41 @@
+#
+# Test that multi-table DROP TABLE statements are properly replicated
+# See http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-20.html
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
+
+CREATE TABLE t5 (f1 INTEGER);
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+
+DROP TABLE t1, t2, t3, t4;
+
+INSERT INTO t5 VALUES (1);
+
+COMMIT;
+
+--connection node_2
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t1;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t2;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t3;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t4;
+
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t2,test.t4'' on query\. Default database: 'test'\. Query: 'DROP TABLE t1, t2, t3, t4', Error_code: 1051");
+
+--connection node_1
+DROP TABLE t5;
diff --git a/mysql-test/suite/galera/t/galera_enum.test b/mysql-test/suite/galera/t/galera_enum.test
new file mode 100644
index 00000000000..ff5332486aa
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_enum.test
@@ -0,0 +1,62 @@
+#
+# Test the ENUM column type, as it is frequently an unwanted child
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# ENUM as key
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 ENUM('', 'one', 'two'), KEY (f1)) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES ('');
+INSERT INTO t1 VALUES ('one'), ('two');
+INSERT INTO t1 VALUES (0), (1), (2);
+
+--connection node_2
+SELECT COUNT(*) = 6 FROM t1;
+SELECT COUNT(*) = 2 FROM t1 where f1 = '';
+SELECT COUNT(*) = 2 FROM t1 where f1 = 'one';
+
+DROP TABLE t1;
+
+#
+# ENUM as PK
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 ENUM('', 'one', 'two', 'three', 'four') PRIMARY KEY) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (''), ('one'), ('two');
+
+--connection node_2
+SELECT COUNT(*) = 3 FROM t1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = '';
+
+# Conflict
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'three' where f1 = '';
+
+--connection node_2
+SET AUTOCOMMIt=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'four' where f1 = '';
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+--connection node_1
+
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three';
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_events.test b/mysql-test/suite/galera/t/galera_events.test
new file mode 100644
index 00000000000..ae9940fc694
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_events.test
@@ -0,0 +1,53 @@
+#
+# Test that the replication of MySQL events conforms to the behavior of stock MySQL replication as described here
+# http://dev.mysql.com/doc/refman/5.6/en/replication-features-invoked.html
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $event_scheduler_orig = `SELECT @@event_scheduler;`
+
+#
+# Events arrive on slave as SLAVESIDE_DISABLED
+#
+
+--connection node_1
+CREATE EVENT event1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT 1;
+
+--connection node_2
+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
+
+--connection node_1
+ALTER EVENT event1 DISABLE;
+
+--connection node_2
+# The definition on node 2 should still say SLAVESIDE_DISABLED
+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
+
+#
+# Expired event should be dropped from the slave
+#
+
+--connection node_2
+SET GLOBAL event_scheduler = ON;
+CREATE EVENT event2 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION NOT PRESERVE DO SELECT 1;
+--sleep 1
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event2';
+
+#
+# DROP EVENT causes event to be dropped everywhere
+#
+
+--connection node_1
+DROP EVENT event1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
+
+# Cleanup
+
+--connection node_2
+--eval SET GLOBAL event_scheduler = $event_scheduler_orig;
diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
new file mode 100644
index 00000000000..9b79b4c30b6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
@@ -0,0 +1,41 @@
+#
+# Test Foreign Key Cascading DELETEs
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE grandparent (
+ id INT NOT NULL PRIMARY KEY
+) ENGINE=InnoDB;
+
+CREATE TABLE parent (
+ id INT NOT NULL PRIMARY KEY,
+ grandparent_id INT,
+ FOREIGN KEY (grandparent_id)
+ REFERENCES grandparent(id)
+ ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT NOT NULL PRIMARY KEY,
+ parent_id INT,
+ FOREIGN KEY (parent_id)
+ REFERENCES parent(id)
+ ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO grandparent VALUES (1),(2);
+INSERT INTO parent VALUES (1,1), (2,2);
+INSERT INTO child VALUES (1,1), (2,2);
+
+--connection node_2
+DELETE FROM grandparent WHERE id = 1;
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1;
+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
+
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE grandparent;
diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_update.test b/mysql-test/suite/galera/t/galera_fk_cascade_update.test
new file mode 100644
index 00000000000..e736803a285
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_cascade_update.test
@@ -0,0 +1,41 @@
+#
+# Test Foreign Key Cascading UPDATEs
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE grandparent (
+ id INT NOT NULL PRIMARY KEY
+) ENGINE=InnoDB;
+
+CREATE TABLE parent (
+ id INT NOT NULL PRIMARY KEY,
+ grandparent_id INT,
+ FOREIGN KEY (grandparent_id)
+ REFERENCES grandparent(id)
+ ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT NOT NULL PRIMARY KEY,
+ grandparent_id INT,
+ FOREIGN KEY (grandparent_id)
+ REFERENCES parent(grandparent_id)
+ ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO grandparent VALUES (1),(2);
+INSERT INTO parent VALUES (1,1), (2,2);
+INSERT INTO child VALUES (1,1), (2,2);
+
+--connection node_2
+UPDATE grandparent SET id = 3 WHERE id = 1;
+
+--connection node_1
+SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3;
+SELECT COUNT(*) = 1 FROM child WHERE grandparent_id = 3;
+
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE grandparent;
diff --git a/mysql-test/suite/galera/t/galera_fk_conflict.test b/mysql-test/suite/galera/t/galera_fk_conflict.test
new file mode 100644
index 00000000000..cb6f95ee687
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_conflict.test
@@ -0,0 +1,41 @@
+#
+# Test two transactions on separate nodes which conflict on a FK
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent (
+ id INT PRIMARY KEY,
+ KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY,
+ parent_id INT,
+ FOREIGN KEY (parent_id)
+ REFERENCES parent(id)
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1), (2);
+INSERT INTO child VALUES (1,1);
+
+--connection node_1
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+DELETE FROM parent WHERE id = 2;
+
+--connection node_2
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO child VALUES (2, 2);
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/t/galera_fk_mismatch.test b/mysql-test/suite/galera/t/galera_fk_mismatch.test
new file mode 100644
index 00000000000..bded41381a7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_mismatch.test
@@ -0,0 +1,38 @@
+#
+# Test the operation where the definition of the FK is different from the one of the underlying key
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent (
+ id1 INT,
+ id2 INT,
+ PRIMARY KEY (id1, id2) /* Multipart PK */
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY,
+ parent_id1 INT,
+ FOREIGN KEY (parent_id1)
+ REFERENCES parent(id1) /* FK is subset of PK above */
+ ON UPDATE CASCADE
+ ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1, 2);
+INSERT INTO child VALUES (1, 1);
+
+--connection node_2
+UPDATE parent SET id1 = 3 WHERE id1 = 1;
+
+--connection node_1
+SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3;
+
+DELETE FROM parent WHERE id1 = 3;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3;
+
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/t/galera_fk_multicolumn.test b/mysql-test/suite/galera/t/galera_fk_multicolumn.test
new file mode 100644
index 00000000000..ad42f65924d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_multicolumn.test
@@ -0,0 +1,42 @@
+#
+# Test UPDATE on multiple columns with multiple FKs
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t0 (
+ f1 INT PRIMARY KEY,
+ f2 INT UNIQUE
+);
+
+CREATE TABLE t1 (
+ f1 INT PRIMARY KEY,
+ FOREIGN KEY (f1)
+ REFERENCES t0(f1)
+ ON UPDATE CASCADE
+);
+
+CREATE TABLE t2 (
+ f2 INT PRIMARY KEY,
+ FOREIGN KEY (f2)
+ REFERENCES t0(f2)
+ ON UPDATE CASCADE
+);
+
+INSERT INTO t0 VALUES (0, 0);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t2 VALUES (0);
+
+--connection node_2
+UPDATE t0 SET f1 = 1, f2 = 2;
+
+--connection node_1
+SELECT f1 = 1 FROM t1 WHERE f1 = 1;
+SELECT f2 = 2 FROM t2 WHERE f2 = 2;
+SELECT f1 = 1 FROM t1;
+SELECT f2 = 2 FROM t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
+DROP TABLE t0;
diff --git a/mysql-test/suite/galera/t/galera_fk_multitable.test b/mysql-test/suite/galera/t/galera_fk_multitable.test
new file mode 100644
index 00000000000..6adfb8195ec
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_multitable.test
@@ -0,0 +1,32 @@
+#
+# Test multi-table DELETE in the presence of FKs
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t0 (
+ f0 INT PRIMARY KEY
+);
+
+CREATE TABLE t1 (
+ f1 INT PRIMARY KEY,
+ f0 INTEGER,
+ FOREIGN KEY (f0)
+ REFERENCES t0(f0)
+ ON DELETE CASCADE
+);
+
+INSERT INTO t0 VALUES (0), (1);
+INSERT INTO t1 VALUES (0, 0);
+INSERT INTO t1 VALUES (1, 0);
+
+--connection node_2
+DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0;
+
+--connection node_1
+SELECT COUNT(*) = 1 FROM t0;
+SELECT COUNT(*) = 0 FROM t1;
+
+DROP TABLE t1;
+DROP TABLE t0;
diff --git a/mysql-test/suite/galera/t/galera_fk_no_pk.test b/mysql-test/suite/galera/t/galera_fk_no_pk.test
new file mode 100644
index 00000000000..d1f9c26762d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_no_pk.test
@@ -0,0 +1,37 @@
+#
+# Test foreign keys if no PK is present
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent (
+ id INT,
+ KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT,
+ parent_id INT,
+ FOREIGN KEY (parent_id)
+ REFERENCES parent(id)
+ ON UPDATE CASCADE
+ ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1), (1), (2), (2);
+INSERT INTO child VALUES (1,1), (2,2), (1,1), (2,2);
+
+--connection node_2
+DELETE FROM parent WHERE id = 1;
+SELECT COUNT(*) = 0 FROM child WHERE id = 1;
+
+--connection node_1
+UPDATE parent SET id = 3 WHERE id = 2;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
+SELECT parent_id = 3 FROM child WHERE id = 2;
+
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/t/galera_fk_selfreferential.test b/mysql-test/suite/galera/t/galera_fk_selfreferential.test
new file mode 100644
index 00000000000..e2c19001030
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_selfreferential.test
@@ -0,0 +1,24 @@
+#
+# Test self-referential foreign keys
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (
+ f1 INT NOT NULL PRIMARY KEY,
+ f2 INT,
+ FOREIGN KEY (f2)
+ REFERENCES t1(f1)
+ ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1, 1), (2, 1);
+
+--connection node_2
+DELETE FROM t1 WHERE f1 = 1;
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_fk_setnull.test b/mysql-test/suite/galera/t/galera_fk_setnull.test
new file mode 100644
index 00000000000..46ba82dbf9c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_setnull.test
@@ -0,0 +1,36 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent (
+ id INT NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT,
+ parent_id INT,
+ FOREIGN KEY (parent_id)
+ REFERENCES parent(id)
+ ON UPDATE SET NULL
+ ON DELETE SET NULL
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1),(2);
+INSERT INTO child VALUES (1,1),(2,2);
+
+--connection node_2
+DELETE FROM parent WHERE id = 1;
+SELECT parent_id IS NULL FROM child WHERE id = 1;
+
+--connection node_1
+SELECT parent_id IS NULL FROM child WHERE id = 1;
+
+UPDATE parent SET id = 3 WHERE id = 2;
+SELECT parent_id IS NULL FROM child WHERE id = 2;
+
+--connection node_2
+SELECT parent_id IS NULL FROM child WHERE id = 2;
+
+--connection node_1
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/t/galera_flush-master.opt b/mysql-test/suite/galera/t/galera_flush-master.opt
new file mode 100644
index 00000000000..5a1fb6748d9
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush-master.opt
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1000000
diff --git a/mysql-test/suite/galera/t/galera_flush.test b/mysql-test/suite/galera/t/galera_flush.test
new file mode 100644
index 00000000000..77e95f62fda
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush.test
@@ -0,0 +1,273 @@
+#
+# Test that various FLUSH commands are replicated. Whenever possible, check the slave for the effects.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+--source include/have_query_cache.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+#
+# The following FLUSH statements should be replicated
+#
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH DES_KEY_FILE;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH HOSTS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+INSERT INTO mysql.user VALUES('localhost','user1',PASSWORD('pass1'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N','N','',0);
+FLUSH PRIVILEGES;
+--connect node_2a, 127.0.0.1, user1, pass1, test, $NODE_MYPORT_2
+--connection node_1
+DELETE FROM mysql.user WHERE user = 'user1';
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+FLUSH PRIVILEGES;
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH QUERY CACHE;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH STATUS;
+
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH USER_RESOURCES;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH TABLES;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+CREATE TABLE t2 (f1 INTEGER);
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH TABLES t2;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH ERROR LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH SLOW LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH GENERAL LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH ENGINE LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH RELAY LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+SET @userstat_old= @@userstat;
+SET GLOBAL userstat=ON;
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 4 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_1
+SET @old_thread_statistics= @@global.thread_statistics;
+SET GLOBAL thread_statistics= ON;
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH THREAD_STATISTICS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH CHANGED_PAGE_BITMAPS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+#
+# The following statements should not be replicated: FLUSH LOGS, FLUSH TABLES WITH LOCKS
+#
+
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+FLUSH LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+## Test LOCK TABLES with FLUSH TABLES
+## LOCK TABLES t1 write followed by flush tables t1 should succeed due to MDL upgrade.
+## LOCK tables t2 read followed by flush tables t2 should fail with ER_TABLE_NOT_LOCKED_FOR_WRITE
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES t1;
+UNLOCK TABLES;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
+--enable_query_log
+--connection node_1
+FLUSH TABLES t1;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE t2;
+SET GLOBAL userstat= @userstat_old;
+SET GLOBAL thread_statistics= @old_thread_statistics;
diff --git a/mysql-test/suite/galera/t/galera_flush_local.opt b/mysql-test/suite/galera/t/galera_flush_local.opt
new file mode 100644
index 00000000000..5a1fb6748d9
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush_local.opt
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1000000
diff --git a/mysql-test/suite/galera/t/galera_flush_local.test b/mysql-test/suite/galera/t/galera_flush_local.test
new file mode 100644
index 00000000000..768f4ea4f1b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush_local.test
@@ -0,0 +1,142 @@
+#
+# Test that various FLUSH LOCAL commands are replicated. Whenever possible, check the slave for the effects.
+# PXC-391
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, x1, x2;
+--enable_warnings
+#
+# The following FLUSH LOCAL statements should *not* be replicated
+#
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH LOCAL DES_KEY_FILE;
+FLUSH LOCAL HOSTS;
+FLUSH LOCAL QUERY CACHE;
+FLUSH LOCAL STATUS;
+FLUSH LOCAL PRIVILEGES;
+FLUSH LOCAL USER_RESOURCES;
+FLUSH LOCAL TABLES;
+FLUSH LOCAL TABLES t2;
+FLUSH LOCAL ERROR LOGS;
+FLUSH LOCAL SLOW LOGS;
+FLUSH LOCAL GENERAL LOGS;
+FLUSH LOCAL ENGINE LOGS;
+FLUSH LOCAL RELAY LOGS;
+FLUSH LOCAL CLIENT_STATISTICS;
+FLUSH LOCAL INDEX_STATISTICS;
+FLUSH LOCAL TABLE_STATISTICS;
+FLUSH LOCAL USER_STATISTICS;
+FLUSH LOCAL LOGS;
+FLUSH LOCAL BINARY LOGS;
+FLUSH LOCAL TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1;
+ANALYZE LOCAL TABLE t1, t2;
+OPTIMIZE LOCAL TABLE t1, t2;
+REPAIR LOCAL TABLE x1, x2;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
+--enable_query_log
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+
+--connection node_1
+DROP TABLE t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+
+--connection node_2
+--let $wsrep_last_committed_before2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+set wsrep_on=0;
+FLUSH DES_KEY_FILE;
+FLUSH HOSTS;
+FLUSH QUERY CACHE;
+FLUSH STATUS;
+FLUSH PRIVILEGES;
+FLUSH USER_RESOURCES;
+FLUSH TABLES;
+FLUSH TABLES t2;
+FLUSH ERROR LOGS;
+FLUSH SLOW LOGS;
+FLUSH GENERAL LOGS;
+FLUSH ENGINE LOGS;
+FLUSH RELAY LOGS;
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+FLUSH LOGS;
+FLUSH BINARY LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES t1;
+UNLOCK TABLES;
+FLUSH TABLES t1;
+ANALYZE TABLE t1, t2;
+OPTIMIZE TABLE t1, t2;
+REPAIR TABLE x1, x2;
+--connection node_2
+--let $wsrep_last_committed_after2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before2 AS wsrep_last_committed_diff;
+--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before + 9 AS wsrep_last_committed_diff2;
+--enable_query_log
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+--connection node_1
+set wsrep_on=1;
+DROP TABLE t1, t2, x1, x2;
diff --git a/mysql-test/suite/galera/t/galera_forced_binlog_format-master.opt b/mysql-test/suite/galera/t/galera_forced_binlog_format-master.opt
new file mode 100644
index 00000000000..8c58b59b45d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_forced_binlog_format-master.opt
@@ -0,0 +1 @@
+--log-bin --wsrep_forced_binlog_format=ROW
diff --git a/mysql-test/suite/galera/t/galera_forced_binlog_format.test b/mysql-test/suite/galera/t/galera_forced_binlog_format.test
new file mode 100644
index 00000000000..982276cc317
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_forced_binlog_format.test
@@ -0,0 +1,45 @@
+#
+# Test that wsrep_forced_binlog_format=ROW indeed prevents the log to be switched to STATEMENT format on a per-connection basis
+#
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+--connection node_1
+RESET MASTER;
+
+SET SESSION binlog_format = 'STATEMENT';
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+SET SESSION binlog_format = 'MIXED';
+
+INSERT INTO t1 VALUES (2);
+
+--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
+--replace_column 2 <Pos> 5 <End_log_pos>
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 249;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9401: wsrep_forced_binlog_format with binlog causes crash
+--echo #
+SET SESSION binlog_format = 'ROW';
+CREATE DATABASE testdb_9401;
+USE testdb_9401;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE USER dummy@localhost;
+GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
+FLUSH PRIVILEGES;
+SHOW GRANTS FOR dummy@localhost;
+# Cleanup
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
+DROP USER dummy@localhost;
+DROP DATABASE testdb_9401;
+
+--source include/galera_end.inc
+--echo # End of tests
+
diff --git a/mysql-test/suite/galera/t/galera_ftwrl.test b/mysql-test/suite/galera/t/galera_ftwrl.test
new file mode 100644
index 00000000000..739255609ee
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ftwrl.test
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# At this time, issing a FLUSH TABLES WITH READ LOCK causes SELECT and SHOW to
+# hang if causality can not be ensured because another node issued a statement
+# in the meantime which could not be applied because FTWRL blocks the applier
+# as well
+#
+# See LP bug 1271177
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options;`
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+FLUSH TABLES WITH READ LOCK;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW TABLES;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1;
+
+UNLOCK TABLES;
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig";
+--enable_query_log
+
+SHOW TABLES;
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_ftwrl_drain.test b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
new file mode 100644
index 00000000000..690e890cdea
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
@@ -0,0 +1,69 @@
+#
+# Test the following sequence of events:
+#
+# 1. issue a remote transaction
+# 2. applier is blocked from applying the transaction locally using apply_monitor_slave_enter_sync
+# 3. FTWRL is issued and blocks in ApplyOrder>::drain_common
+# 4. applier is unblocked
+# 5. remote transaction is applied
+# 6. FTWRL is granted
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+--connection node_1
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+# Wait until applier has blocked
+--source include/galera_wait_sync_point.inc
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--send FLUSH TABLES WITH READ LOCK;
+
+--connection node_2
+--sleep 1
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Init' AND INFO = 'FLUSH TABLES WITH READ LOCK'
+--source include/wait_condition.inc
+
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+--connection node_2a
+--reap
+
+--connection node_2
+
+SET SESSION lock_wait_timeout = 1;
+SET SESSION innodb_lock_wait_timeout=1;
+SET SESSION wait_timeout=1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t2 VALUES (2);
+
+--connection node_2a
+UNLOCK TABLES;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+INSERT INTO t1 VALUES (3);
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_fulltext.test b/mysql-test/suite/galera/t/galera_fulltext.test
new file mode 100644
index 00000000000..a90cab1aa1a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fulltext.test
@@ -0,0 +1,62 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# InnoDB FULLTEXT indexes
+#
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+#
+# Fulltext index creation causes the creation of multiple system tables
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
+
+--connection node_2
+SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%';
+
+#
+# Fulltext insertion causes a flurry of updates on those system tables
+#
+
+--connection node_1
+# Insert 1K rows
+INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_2
+SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
+
+UPDATE t1 SET f2 = 'abcdefjhk';
+
+--connection node_1
+SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
+
+--connection node_2
+
+DROP TABLE t1;
+
+#
+# Same on a table with no PK
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB;
+
+--connection node_2
+# We insert only 1K rows here, because updates without a PK are very slow
+INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_1
+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz');
+
+UPDATE t1 SET f1 = 'abcdefjhk';
+
+--connection node_2
+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_gcache_recover.cnf b/mysql-test/suite/galera/t/galera_gcache_recover.cnf
new file mode 100644
index 00000000000..c7b59b6a27e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcache_recover.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true'
diff --git a/mysql-test/suite/galera/t/galera_gcache_recover.test b/mysql-test/suite/galera/t/galera_gcache_recover.test
new file mode 100644
index 00000000000..e1bfe517d27
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcache_recover.test
@@ -0,0 +1,77 @@
+#
+# Kill entire cluster while gcache.recover=yes. Expect that node #2 will rejoin using IST
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) > 0 FROM t1;
+--source include/wait_condition.inc
+
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+INSERT INTO t1 VALUES (2);
+
+--source include/kill_galera.inc
+
+--sleep 1
+
+--connection node_1
+--let $galera_wsrep_recover_server_id=1
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+# Warning happens when the cluster is started for the first time
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that IST took place
+--let $assert_text = async IST sender starting to serve
+--let $assert_select = async IST sender starting to serve
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+--connection node_2
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that gcache recovery took place
+
+--let $assert_text = Recovering GCache ring buffer: found gapless sequence
+--let $assert_select = Recovering GCache ring buffer: found gapless sequence
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf
new file mode 100644
index 00000000000..da74ea9fc5d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+max_allowed_packet=10M
+innodb_log_file_size=110M
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M'
diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test
new file mode 100644
index 00000000000..b7fd9cf3aed
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test
@@ -0,0 +1,59 @@
+#
+# Attempt gcache recovery on a full gcache. Node will not be able to join via IST due to gcache rollover
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--connection node_1
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+--source include/kill_galera.inc
+
+--connection node_1
+--let $galera_wsrep_recover_server_id=1
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+DROP TABLE t1;
+
+# Warning always happens when the cluster is started for the first time
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that IST did not take place
+--let $assert_text = IST first seqno 2 not found from cache, falling back to SST
+--let $assert_select = IST first seqno 2 not found from cache, falling back to SST
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+--connection node_2
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf
new file mode 100644
index 00000000000..c08551eae84
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+innodb_log_file_size=110M
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
+
+[mysqld.2]
+innodb_log_file_size=110M
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test
new file mode 100644
index 00000000000..3bfcdc9f117
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test
@@ -0,0 +1,216 @@
+#
+# Kill entire cluster while various transactions are in progress
+# restore the cluster and expect that node #2 will rejoin using IST
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+DELIMITER |;
+CREATE PROCEDURE insert_simple ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef');
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_multi ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_transaction ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ SET AUTOCOMMIT = OFF;
+ WHILE 1 DO
+ START TRANSACTION;
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ COMMIT;
+ END WHILE;
+END|
+
+DELIMITER ;|
+DELIMITER |;
+
+CREATE PROCEDURE update_simple ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ UPDATE t1 SET f2 = CONCAT(f2,f2);
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_1k ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024));
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_1m ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024));
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_10m ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+ END WHILE;
+END|
+
+DELIMITER ;|
+
+--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_update_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_1k, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_1m, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_10m, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+--connection node_1_insert_simple
+--send CALL insert_simple();
+
+--connection node_1_insert_multi
+--send CALL insert_multi();
+
+--connection node_1_insert_transaction
+--send CALL insert_transaction ();
+
+--connection node_1_update_simple
+--send CALL update_simple ();
+
+--connection node_1_insert_1k
+--send CALL insert_1k ();
+
+--connection node_1_insert_1m
+--send CALL insert_1m ();
+
+--connection node_1_insert_10m
+--send CALL insert_10m ();
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--sleep 10
+--connection node_1
+--source include/kill_galera.inc
+
+--connection node_1_insert_simple
+--error 2013
+--reap
+
+--connection node_1_insert_multi
+--error 2013
+--reap
+
+--connection node_1_insert_transaction
+--error 2013
+--reap
+
+--connection node_1_update_simple
+--error 2013
+--reap
+
+--connection node_1_insert_1k
+--error 2013
+--reap
+
+--connection node_1_insert_1m
+--error 2013
+--reap
+
+--connection node_1_insert_10m
+--error 2013
+--reap
+
+--connection node_1
+--let $galera_wsrep_recover_server_id=1
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE ten;
+DROP PROCEDURE insert_simple;
+DROP PROCEDURE insert_multi;
+DROP PROCEDURE insert_transaction;
+DROP PROCEDURE update_simple;
+DROP PROCEDURE insert_1k;
+DROP PROCEDURE insert_1m;
+
+--connection node_1
+CALL mtr.add_suppression("conflict state 7 after post commit");
+
+# Warning happens when the cluster is started for the first time
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that IST took place
+--let $assert_text = async IST sender starting to serve
+--let $assert_select = async IST sender starting to serve
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+--connection node_2
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that gcache recovery took place
+
+--let $assert_text = Recovering GCache ring buffer: found gapless sequence
+--let $assert_select = Recovering GCache ring buffer: found gapless sequence
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
diff --git a/mysql-test/suite/galera/t/galera_gcs_fc_limit.test b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test
new file mode 100644
index 00000000000..61576a39316
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test
@@ -0,0 +1,59 @@
+#
+# Test that under gcs.fc_limit=1 on the slave, transactions on the master can not commit.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+--sleep 1
+
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
+
+# Block the slave applier thread
+LOCK TABLE t1 WRITE;
+
+--connection node_1
+--sleep 1
+INSERT INTO t1 VALUES (2);
+--sleep 2
+INSERT INTO t1 VALUES (3);
+--sleep 2
+INSERT INTO t1 VALUES (4);
+--sleep 2
+
+# This query will hang because flow control will kick in
+--send
+INSERT INTO t1 VALUES (5);
+--sleep 2
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'query end' AND INFO = 'INSERT INTO t1 VALUES (5)';
+--source include/wait_condition.inc
+
+--connection node_2
+# Unblock the slave applier thread
+UNLOCK TABLES;
+
+--connection node_1
+--reap
+
+INSERT INTO t1 VALUES (6);
+
+--connection node_2
+# Replication catches up and continues normally
+SELECT COUNT(*) = 6 FROM t1;
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_gcs_fragment.cnf b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf
new file mode 100644
index 00000000000..aae3fee5904
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64'
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64'
diff --git a/mysql-test/suite/galera/t/galera_gcs_fragment.test b/mysql-test/suite/galera/t/galera_gcs_fragment.test
new file mode 100644
index 00000000000..ae1e0d8bab0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_fragment.test
@@ -0,0 +1,66 @@
+# Test fragmentation over configuration changes
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Prepare table
+CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
+
+# Stop node2
+
+# Disconnect node_2 from group
+--connection node_2
+--let $wsrep_cluster_address_orig = `select @@wsrep_cluster_address`
+SET GLOBAL wsrep_cluster_address='';
+
+# Connection for sync points
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET SESSION wsrep_sync_wait=0;
+
+# Set breakpoint in gcs after first fragment send
+
+--let $galera_sync_point = gcs_core_after_frag_send
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit=0;
+--send INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+
+--connection node_1a
+--source include/galera_wait_sync_point.inc
+--source include/galera_clear_sync_point.inc
+
+
+# Restart node_2, wait until it joins the group and then make INSERT
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'
+--enable_query_log
+SET SESSION wsrep_on = 0;
+--source include/galera_wait_ready.inc
+SET SESSION wsrep_on = 1;
+
+INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+# Signal node_1 to continue
+--connection node_1a
+--source include/galera_signal_sync_point.inc
+
+# Deadlock error should be returned since write set send was
+# interrupted by gcs
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+# Do additional insert to verify that node_1 remain operational
+INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+
+# Nodes node_1 and node_2 should now contain rows 2 and 3
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf
new file mode 100644
index 00000000000..6bb11e5957a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64;gcache.size=10M'
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64;gcache.size=10M'
diff --git a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test
new file mode 100644
index 00000000000..98be4f6a300
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test
@@ -0,0 +1,26 @@
+#
+# Test fragmentation by setting gcs.max_packet_size to a low value
+# The actual setting is performed in galera_gcs_max_packet_size.cnf
+# as gcs.max_packet_size is not a dynamic variable
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 VARCHAR(512) UNIQUE) ENGINE=InnoDB;
+
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+INSERT INTO t2 VALUES (REPEAT('x', 512));
+
+--connection node_2
+SELECT COUNT(*) = 10000 FROM t1;
+SELECT LENGTH(f1) = 512 FROM t2 WHERE f1 = REPEAT('x', 512);
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_gra_log.test b/mysql-test/suite/galera/t/galera_gra_log.test
new file mode 100644
index 00000000000..5329dc24546
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gra_log.test
@@ -0,0 +1,38 @@
+#
+# Test that GRA_* files are generated on applier failure and are readable.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_2
+--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
+
+# Create applier failure
+
+SET SESSION wsrep_on=OFF;
+CREATE TABLE t1 (f1 INTEGER);
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+# Compose a valid binlog from a header file and the GRA file
+
+--let $gra_binlog_file = $MYSQLTEST_VARDIR/tmp/gra.log
+--exec rm -rf $gra_binlog_file
+
+--exec cp std_data/binlog-header.log $gra_binlog_file
+--exec cat $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log >> $gra_binlog_file
+
+# Make sure the binlog thus produced is readable and contains the failure
+--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /#[0-9]+ +[0-9]+:[0-9]+:[0-9]+/<ISO TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/ /thread_id=[0-9]+/thread_id=<QUERY_THREAD_ID>/
+--exec $MYSQL_BINLOG $gra_binlog_file
+
+SET SESSION wsrep_on=ON;
+
+CALL mtr.add_suppression("Slave SQL: Error 'Table 't1' already exists' on query");
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_gtid-master.opt b/mysql-test/suite/galera/t/galera_gtid-master.opt
new file mode 100644
index 00000000000..8a755e98b00
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid-master.opt
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/galera_gtid.test b/mysql-test/suite/galera/t/galera_gtid.test
new file mode 100644
index 00000000000..e8369be62e6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid.test
@@ -0,0 +1,27 @@
+#
+# Test GTID for basic Galera operations
+#
+
+--source include/have_log_bin.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY);
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+UPDATE t1 SET f1 = 2;
+
+--let $gtid_binlog_state_node2 = `SELECT @@global.gtid_binlog_state;`
+
+--connection node_1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+
+--disable_query_log
+--eval SELECT '$gtid_binlog_state_node2' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.cnf b/mysql-test/suite/galera/t/galera_gtid_slave.cnf
new file mode 100644
index 00000000000..409d0d1609a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave.cnf
@@ -0,0 +1,18 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+log-bin=mysqld-bin
+log-slave-updates
+binlog-format=ROW
+
+[mysqld.1]
+gtid-domain-id=1
+[mysqld.2]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+[mysqld.3]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.test b/mysql-test/suite/galera/t/galera_gtid_slave.test
new file mode 100644
index 00000000000..8ef87452a5b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave.test
@@ -0,0 +1,78 @@
+#
+# Test Galera as a slave to a MariaDB master using GTIDs
+#
+# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
+# suite/galera/t/galera_as_slave_gtid.cnf has the GTID options
+#
+# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+#multi stmt trans
+begin;
+insert into t2 values(21);
+insert into t2 values(22);
+commit;
+
+SELECT @@global.gtid_binlog_state;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--source include/wait_condition.inc
+--sleep 1
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+SELECT @@global.gtid_binlog_state;
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
+--source include/wait_condition.inc
+
+INSERT INTO t1 VALUES(4);
+SELECT @@global.gtid_binlog_state;
+
+--connection node_1
+DROP TABLE t1,t2;
+reset master;
+#
+# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
+# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
+# warning is also reported by MTR, which is also weird.
+#
+
+--sleep 1
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+
+--connection node_3
+reset master;
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf
new file mode 100644
index 00000000000..bb9c8e84f1b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf
@@ -0,0 +1,18 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+log-bin=mysqld-bin
+log-slave-updates
+binlog-format=ROW
+wsrep_sst_method=rsync
+[mysqld.1]
+gtid-domain-id=1
+[mysqld.2]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+[mysqld.3]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test
new file mode 100644
index 00000000000..3fe94ad16b7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test
@@ -0,0 +1,207 @@
+#
+# Test Galera as a slave to a MariaDB master using GTIDs
+#
+# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
+#
+# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster
+#
+
+--source include/big_test.inc
+--source include/have_innodb.inc
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--echo #Connection 2
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1,master_use_gtid=slave_pos;
+--enable_query_log
+START SLAVE;
+--sleep 1
+
+
+--echo #Connection 1
+--connection node_1
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(1,11);
+INSERT INTO t2 VALUES(2,22);
+INSERT INTO t2 VALUES(3,33);
+
+SELECT @@global.gtid_binlog_state;
+--source include/save_master_gtid.inc
+
+--echo #Connection 2
+--connection node_2
+--source include/sync_with_master_gtid.inc
+SELECT @@global.gtid_binlog_state;
+
+INSERT INTO t2 VALUES(4,44);
+INSERT INTO t2 VALUES(5,55);
+INSERT INTO t2 VALUES(6,66);
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 3
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 't2';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 6 FROM t2;
+--source include/wait_condition.inc
+
+INSERT INTO t2 VALUES(7,77);
+INSERT INTO t2 VALUES(8,88);
+SELECT @@global.gtid_binlog_state;
+
+#Perform SST
+--echo #Connection 1
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+--source include/save_master_gtid.inc
+
+--echo #Connection 2
+--connection node_2
+--source include/sync_with_master_gtid.inc
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+
+--echo #Connection 3
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 't1';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
+--source include/wait_condition.inc
+--let $node_1= node_2
+--let $node_2= node_3
+--source include/auto_increment_offset_save.inc
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+
+--echo #Connection 2
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+
+--echo #Connection 3
+--connection node_3
+--echo Starting server ...
+--source include/start_mysqld.inc
+--source include/wait_until_ready.inc
+--source include/auto_increment_offset_restore.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node3_committed_after');
+INSERT INTO t1 VALUES ('node3_committed_after');
+COMMIT;
+
+--echo #Connection 2
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
+--source include/wait_condition.inc
+Select * from t1 order by f1;
+
+--echo #Connection 3
+--connection node_3
+Select * from t1 order by f1;
+
+#SST Done
+--sleep 1
+--echo #Connection 2
+--connection node_2
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 3
+--connection node_3
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 1
+--connection node_1
+SET AUTOCOMMIT=ON;
+#drop table t1;
+#CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+
+--echo #Connection 2
+--connection node_2
+SET AUTOCOMMIT=ON;
+--echo #Connection 3
+--connection node_3
+SET AUTOCOMMIT=ON;
+
+#
+#stop slave on node 2
+--echo #Connection 2
+--connection node_2
+STOP slave;
+--sleep 1
+INSERT INTO t1 VALUES ('node2_slave_stoped');
+
+--echo #Connection 1
+--connection node_1
+INSERT INTO t1 VALUES ('node1_normal_entry');
+--source include/save_master_gtid.inc
+
+#start slave
+--echo #Connection 2
+--connection node_2
+INSERT INTO t1 VALUES ('node2_slave_stoped_inserted');
+start slave;
+--source include/sync_with_master_gtid.inc
+INSERT INTO t1 VALUES ('node2_slave_started');
+SELECT count(*) from t1;
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 3
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 12 FROM t1;
+--source include/wait_condition.inc
+SELECT count(*) from t1;
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 1
+--connection node_1
+DROP TABLE t2,t1;
+
+# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
+# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
+# warning is also reported by MTR, which is also weird.
+#
+
+--sleep 3
+
+--echo #Connection 2
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
+--source include/wait_condition.inc
+
+--echo #Connection 3
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--echo #Connection 2
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+
+--echo #Connection 3
+--connection node_3
+reset master;
+
+--echo #Connection 1
+--connection node_1
+reset master;
diff --git a/mysql-test/suite/galera/t/galera_insert_ignore.test b/mysql-test/suite/galera/t/galera_insert_ignore.test
new file mode 100644
index 00000000000..027f70e96d9
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_insert_ignore.test
@@ -0,0 +1,60 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_sync_wait_orig = (SELECT @@wsrep_sync_wait)
+SET GLOBAL wsrep_sync_wait = 15;
+
+--connection node_2
+SET GLOBAL wsrep_sync_wait = 15;
+
+
+#
+# INSERT IGNORE with PRIMARY KEY
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+INSERT IGNORE INTO t1 VALUES (1), (2);
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+#
+# INSERT IGNORE ... SELECT
+#
+
+--connection node_2
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (0), (2), (3);
+INSERT IGNORE INTO t1 SELECT f1 FROM t2;
+
+SELECT * FROM t1;
+--connection node_1
+SELECT * FROM t1;
+
+#
+# INSERT IGNORE with UNIQUE + NULLs
+#
+
+--connection node_2
+CREATE TABLE t3 (f1 INTEGER UNIQUE) Engine=InnoDB;
+INSERT INTO t3 VALUES (NULL);
+
+--connection node_1
+INSERT IGNORE INTO t3 VALUES (1), (NULL), (2);
+SELECT * FROM t3;
+
+--connection node_2
+SELECT * FROM t3;
+
+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
+
diff --git a/mysql-test/suite/galera/t/galera_insert_multi.test b/mysql-test/suite/galera/t/galera_insert_multi.test
new file mode 100644
index 00000000000..d62283aff69
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_insert_multi.test
@@ -0,0 +1,122 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Multi-row INSERT with a PK
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+
+--connection node_2
+INSERT INTO t1 VALUES (3),(4);
+
+--connection node_1
+SELECT COUNT(*) = 4 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 4 FROM t1;
+
+DROP TABLE t1;
+
+#
+# Multi-row INSERT without a PK
+#
+
+--connection node_2
+CREATE TABLE t1 (f1 INTEGER, KEY (f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(1);
+
+--connection node_1
+INSERT INTO t1 VALUES (2),(2);
+
+--connection node_2
+SELECT COUNT(*) = 4 FROM t1;
+
+--connection node_1
+SELECT COUNT(*) = 4 FROM t1;
+
+DROP TABLE t1;
+
+#
+# Error in the middle of a multi-row INSERT
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (1);
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+DROP TABLE t1;
+
+#
+# Deadlock
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1), (2);
+
+--connection node_2
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (2), (1);
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+# Workaround for mysql-wsrep#39 Transaction receives deadlock error twice in row
+--error 0,ER_LOCK_DEADLOCK
+ROLLBACK;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1), (2);
+
+DROP TABLE t1;
+
+#
+# Rollback
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES (1), (2);
+
+--connection node_2
+START TRANSACTION;
+INSERT INTO t1 VALUES (2), (1);
+
+--connection node_1
+ROLLBACK;
+
+--connection node_2
+COMMIT;
+SELECT COUNT(*) = 2 FROM t1;
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
+
+
+
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf
new file mode 100644
index 00000000000..41a1aab382b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf
@@ -0,0 +1,14 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth=root:
+
+innodb_flush_log_at_trx_commit=0
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test
new file mode 100644
index 00000000000..07838702deb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test
@@ -0,0 +1,12 @@
+#
+# This test performs server kill and IST while innodb_flush_logs_on_trx_commit = 0
+# This confirms that IST can properly catch up even in the face of relaxed single-node durability
+#
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
diff --git a/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf
new file mode 100644
index 00000000000..357c8678658
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+# We do not set mysqldump-related SST options here because doing so on startup
+# causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+
+
diff --git a/mysql-test/suite/galera/t/galera_ist_mysqldump.test b/mysql-test/suite/galera/t/galera_ist_mysqldump.test
new file mode 100644
index 00000000000..a9ff8c41f06
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_mysqldump.test
@@ -0,0 +1,17 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source suite/galera/include/galera_sst_set_mysqldump.inc
+
+# mysql-wsrep#33 - nnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno in trx_sys_update_wsrep_checkpoint with mysqldump IST
+# --source suite/galera/include/galera_st_disconnect_slave.inc
+
+# We set the required mysqldump SST options here so that they are used every time the server is restarted during the test
+--let $start_mysqld_params = --wsrep_sst_auth=sst:sst --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=127.0.0.1:$NODE_MYPORT_2 --skip-grant-tables
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
+--source suite/galera/include/galera_sst_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_ist_progress.cnf b/mysql-test/suite/galera/t/galera_ist_progress.cnf
new file mode 100644
index 00000000000..0a26f6d6c83
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_progress.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_ist_progress.test b/mysql-test/suite/galera/t/galera_ist_progress.test
new file mode 100644
index 00000000000..3ba63415c28
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_progress.test
@@ -0,0 +1,76 @@
+#
+# Test progress output during IST
+#
+
+--source include/galera_cluster.inc
+# This could cause out of storage if run /dev/shm
+--source include/big_test.inc
+
+# Isolate node #2
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+SET SESSION wsrep_on = ON;
+
+# Node #2 is now isolated. Run some transactions to accumulate writesets for IST
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+INSERT INTO t1 VALUES (10);
+
+# Restore node #2, IST is performed
+
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+#
+# Grep for expected IST output in joiner log
+#
+
+--connection node_1
+
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = Need state transfer
+
+--let $assert_text = Receiving IST: 11 writesets, seqnos
+--let $assert_select = Receiving IST: 11 writesets, seqnos
+--source include/assert_grep.inc
+
+--let $assert_text = Receiving IST\.\.\. 0\.0% \( 0/11 events\) complete
+--let $assert_select = Receiving IST\.\.\. 0\.0% \( 0/11 events\) complete
+--source include/assert_grep.inc
+
+--let $assert_text = Receiving IST\.\.\.100\.0% \(11/11 events\) complete
+--let $assert_select = Receiving IST\.\.\.100\.0% \(11/11 events\) complete
+--source include/assert_grep.inc
+
+# Cleanup
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf
new file mode 100644
index 00000000000..2628f05eaef
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf
@@ -0,0 +1,8 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;ist.recv_bind=127.0.0.1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;ist.recv_bind=127.0.0.1'
+
diff --git a/mysql-test/suite/galera/t/galera_ist_recv_bind.test b/mysql-test/suite/galera/t/galera_ist_recv_bind.test
new file mode 100644
index 00000000000..a339684c158
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_recv_bind.test
@@ -0,0 +1,55 @@
+#
+# Test ist.recv_bind option. Since MTR can not do proper testing with multiple interfaces and such, we
+# simply confirm that the option can be set (in the galera_ist_recv_bind.cnf file) and that IST works as expected
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+--connection node_1
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+
+--connection node_2
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+
+# Isolate node #2
+
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+SET SESSION wsrep_on = ON;
+
+# Node #2 is now isolated. Run some transactions to accumulate writesets for IST
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+# Restore node #2
+
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Confirm that IST has taken place
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--source include/wait_condition.inc
+
+# Cleanup
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf b/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf
new file mode 100644
index 00000000000..10958aad9a8
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf
@@ -0,0 +1,4 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
new file mode 100644
index 00000000000..633318629a6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
@@ -0,0 +1,113 @@
+#
+# Test that a joiner performing IST can be killed and restarted with no adverse consequences.
+# This is achieved by using the recv_IST_after_apply_trx Galera dbug sync point to block IST after
+# one transaction has been applied. When IST blocks, we kill and restart the joiner
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+# This could cause out of storage if run /dev/shm
+--source include/big_test.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a');
+
+# Disconnect node #2
+--connection node_2
+--source suite/galera/include/galera_unload_provider.inc
+
+--connection node_1
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+
+# Wait until node #1 has left
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+
+--connection node_2
+# Write file to make mysql-test-run.pl expect the crash, but don't start it
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--exec echo "wait" > $_expect_file_name
+
+--let KILL_NODE_PIDFILE = `SELECT @@pid_file`
+
+# ... and restart provider to force IST
+--echo Loading wsrep_provider ...
+--disable_query_log
+# base_port setting is lost for some reason when unloading provider, so we need to restore it
+--eval SET GLOBAL wsrep_provider_options= 'base_port=$NODE_GALERAPORT_2';
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+# Make sure IST will block ...
+--let $galera_sync_point = recv_IST_after_apply_trx
+--source include/galera_set_sync_point.inc
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+SET SESSION wsrep_on=OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'recv_IST_after_apply_trx' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters';
+--source include/wait_condition.inc
+SET SESSION wsrep_on=ON;
+
+--connection node_1
+# Perform DML while IST is in progress
+UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
+
+# Kill node #2 while IST is in progress
+--connection node_2
+
+# Kill the connected server
+--disable_reconnect
+
+--perl
+ my $pid_filename = $ENV{'KILL_NODE_PIDFILE'};
+ my $mysqld_pid = `cat $pid_filename`;
+ chomp($mysqld_pid);
+ system("kill -9 $mysqld_pid");
+ exit(0);
+EOF
+
+--source include/wait_until_disconnected.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Perform DML while node #2 is down
+UPDATE t1 SET f2 = 'e' WHERE f1 > 4;
+
+--connection node_2
+
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--connection node_1
+UPDATE t1 SET f2 = 'f' WHERE f1 > 5;
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+DROP TABLE t1;
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+
diff --git a/mysql-test/suite/galera/t/galera_ist_rsync.cnf b/mysql-test/suite/galera/t/galera_ist_rsync.cnf
new file mode 100644
index 00000000000..797e3651967
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_rsync.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+wsrep_sync_wait=1
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+wsrep_sync_wait=1
+
diff --git a/mysql-test/suite/galera/t/galera_ist_rsync.test b/mysql-test/suite/galera/t/galera_ist_rsync.test
new file mode 100644
index 00000000000..1da79cd4214
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_rsync.test
@@ -0,0 +1,13 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+--source suite/galera/include/galera_st_disconnect_slave.inc
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf
new file mode 100644
index 00000000000..a762b939f69
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth=root:
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test
new file mode 100644
index 00000000000..8b399e77794
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test
@@ -0,0 +1,9 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source suite/galera/include/galera_st_disconnect_slave.inc
+--source suite/galera/include/galera_st_shutdown_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
diff --git a/mysql-test/suite/galera/t/galera_kill_applier.test b/mysql-test/suite/galera/t/galera_kill_applier.test
new file mode 100644
index 00000000000..e14a8b9af23
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_kill_applier.test
@@ -0,0 +1,26 @@
+#
+# This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1`
+
+--disable_query_log
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL $applier_thread
+
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL QUERY $applier_thread
+
+--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1`
+
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL $aborter_thread
+
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL QUERY $aborter_thread
+--enable_query_log
diff --git a/mysql-test/suite/galera/t/galera_kill_ddl.test b/mysql-test/suite/galera/t/galera_kill_ddl.test
new file mode 100644
index 00000000000..90f3f30cc76
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_kill_ddl.test
@@ -0,0 +1,44 @@
+#
+# This test kill -9-s a slave while small updates have been performed on the master.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+# Enable the master to continue running during the split-brain situation that
+# occurs when the slave is killed
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+--connection node_2
+--source include/kill_galera.inc
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_2
+--source include/start_mysqld.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
+
+--connection node_1
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_kill_largechanges.test b/mysql-test/suite/galera/t/galera_kill_largechanges.test
new file mode 100644
index 00000000000..e9a32ce813b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_kill_largechanges.test
@@ -0,0 +1,43 @@
+#
+# This test kill -9-s a slave while a large update has been performed on the master. SST is performed.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+# Enable the master to continue running during the split-brain situation that
+# occurs when the slave is killed
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB;
+
+--connection node_2
+--source include/kill_galera.inc
+
+--connection node_1
+# We create a 128Mb (or so) transaction that is larger than gcache. The size of the gcache is not adjustable dynamically
+INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+
+--connection node_2
+--source include/start_mysqld.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+
+SELECT COUNT(*) = 1000000 FROM t1;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_kill_nochanges.test b/mysql-test/suite/galera/t/galera_kill_nochanges.test
new file mode 100644
index 00000000000..1903df449e4
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_kill_nochanges.test
@@ -0,0 +1,24 @@
+#
+# This test kill -9-s a slave while no updates have been performed on the master.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--source include/kill_galera.inc
+--source include/start_mysqld.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_kill_smallchanges.test b/mysql-test/suite/galera/t/galera_kill_smallchanges.test
new file mode 100644
index 00000000000..d998032cbc3
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_kill_smallchanges.test
@@ -0,0 +1,39 @@
+#
+# This test kill -9-s a slave while small updates have been performed on the master.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+# Enable the master to continue running during the split-brain situation that
+# occurs when the slave is killed
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+--connection node_2
+--source include/kill_galera.inc
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--source include/start_mysqld.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_lock_table.test b/mysql-test/suite/galera/t/galera_lock_table.test
new file mode 100644
index 00000000000..bd581842f6f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_lock_table.test
@@ -0,0 +1,43 @@
+#
+# Test that a LOCK TABLE on the slave will cause the applier thread to block, so no subsequent updates
+# are replicated on the slave until UNLOCK TABLE is issued.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait`
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+LOCK TABLE t1 READ;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# We use a separate connection here so that we can SELECT from both tables
+# without running into "table t2 was not locked" error.
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+SET SESSION wsrep_sync_wait=0;
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 0 FROM t2;
+
+--connection node_2
+UNLOCK TABLES;
+
+--disable_query_log
+--eval SET SESSION wsrep_sync_wait=$wsrep_sync_wait_orig;
+--enable_query_log
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_log_bin-master.opt b/mysql-test/suite/galera/t/galera_log_bin-master.opt
new file mode 100644
index 00000000000..8a755e98b00
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_bin-master.opt
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test
new file mode 100644
index 00000000000..d2d3987d711
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_bin.test
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test Galera with --log-bin --log-slave-updates .
+# This way the actual MySQL binary log is used,
+# rather than Galera's own implementation
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 2 FROM t2;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+FLUSH LOGS;
+--replace_column 2 # 4 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,18;
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+--replace_column 2 # 4 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,18;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-test/suite/galera/t/galera_log_output_csv-master.opt b/mysql-test/suite/galera/t/galera_log_output_csv-master.opt
new file mode 100644
index 00000000000..2f71b140b65
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_output_csv-master.opt
@@ -0,0 +1 @@
+--log-output=TABLE --log-queries-not-using-indexes --general-log --slow-query-log
diff --git a/mysql-test/suite/galera/t/galera_log_output_csv.test b/mysql-test/suite/galera/t/galera_log_output_csv.test
new file mode 100644
index 00000000000..94ae3dd6168
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_output_csv.test
@@ -0,0 +1,24 @@
+#
+# Test that --log-output=FILE works with Galera.
+# The relevant options are set using a -master.opt file
+# wsrep_replicate_myisam is not used as it crashes in MTR with mysql-wsrep#14
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+SELECT COUNT(*) > 0 FROM mysql.general_log;
+
+SELECT 1 = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 1 = 1 FROM t1';
+
+--connection node_2
+
+SELECT 2 = 2 FROM t1;
+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1';
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_many_columns.test b/mysql-test/suite/galera/t/galera_many_columns.test
new file mode 100644
index 00000000000..3f596179c01
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_columns.test
@@ -0,0 +1,63 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--disable_query_log
+SET @create_var1 = "";
+--let $count = 1017
+while ($count)
+{
+ --eval SET @create_var1 = CONCAT(@create_var1, "f", $count, " VARCHAR(3) DEFAULT 'ABC', ")
+ --dec $count
+}
+
+--let $create_var = `SELECT @create_var1`
+--eval CREATE TABLE t1 ($create_var PRIMARY KEY (f1, f1017)) ENGINE=InnoDB;
+--enable_query_log
+
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+
+--connection node_2
+SELECT f1 = 'ABC', f1017 = 'ABC' FROM t1;
+UPDATE t1 SET f1 = 'XYZ', f1017 = 'XYZ' ;
+
+--connection node_1
+SELECT f1 = 'XYZ', f1017 = 'XYZ' FROM t1 WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+
+
+# Deadlock
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'KLM' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'CDE' WHERE f1 = 'XYZ' AND f1017 = 'XYZ';
+COMMIT;
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+COMMIT;
+ROLLBACK;
+
+--connection node_2
+ROLLBACK;
+
+# Rollback
+
+--connection node_1
+START TRANSACTION;
+INSERT INTO t1 (f1, f1017) VALUES ('BCE','BCE');
+INSERT INTO t1 (f1, f1017) VALUES ('CED','CED');
+INSERT INTO t1 (f1, f1017) VALUES ('EDF','EDF');
+INSERT INTO t1 (f1, f1017) VALUES ('FED','FED');
+ROLLBACK;
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_many_indexes.test b/mysql-test/suite/galera/t/galera_many_indexes.test
new file mode 100644
index 00000000000..e01d0b23aa5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_indexes.test
@@ -0,0 +1,74 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 VARCHAR(767) PRIMARY KEY) ENGINE=InnoDB;
+
+# MySQL complains about multiple identical indexes on the same column
+--disable_warnings
+
+--let $count = 63
+while ($count)
+{
+ --disable_query_log
+ --eval SET @ddl_var1 = CONCAT("CREATE UNIQUE INDEX i", $count, " ON t1(f1)")
+ --let $ddl_var = `SELECT @ddl_var1`
+ --enable_query_log
+ --eval $ddl_var
+ --dec $count
+}
+--enable_warnings
+
+INSERT INTO t1 VALUES (REPEAT('a', 767));
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT LENGTH(f1) = 767 FROM t1;
+
+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
+
+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767);
+
+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767);
+
+INSERT INTO t1 VALUES (REPEAT('b', 767));
+ANALYZE TABLE t1;
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM t1;
+ANALYZE TABLE t1;
+DELETE FROM t1 WHERE f1 = REPEAT('b', 767);
+
+# Rollback
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT COUNT(*) = 1 FROM t1;
+INSERT INTO t1 (f1) VALUES (REPEAT('c', 767));
+ROLLBACK;
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_2
+START TRANSACTION;
+SET AUTOCOMMIT=OFF;
+SELECT COUNT(*) = 1 FROM t1;
+
+# Deadlock
+--connection node_1
+START TRANSACTION;
+--connection node_2
+START TRANSACTION;
+
+--connection node_1
+UPDATE t1 SET f1 = REPEAT('e', 767);
+--connection node_2
+UPDATE t1 SET f1 = REPEAT('f', 767);
+
+--connection node_1
+COMMIT;
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_many_rows.test b/mysql-test/suite/galera/t/galera_many_rows.test
new file mode 100644
index 00000000000..58ba85e1b9e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_rows.test
@@ -0,0 +1,54 @@
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+SET SESSION innodb_lock_wait_timeout=600;
+SET SESSION lock_wait_timeout=600;
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--let $wsrep_provider_options_node2 = `SELECT @@wsrep_provider_options`
+SET SESSION wsrep_sync_wait = 15;
+
+SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
+
+SELECT COUNT(*) = 100000 FROM t1;
+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_1
+SELECT COUNT(*) = 200000 FROM t1;
+UPDATE t1 SET f2 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1;
+
+--connection node_1
+START TRANSACTION;
+SELECT COUNT(*) = 200000 FROM t1;
+UPDATE t1 SET f2 = 3;
+
+--connection node_2
+START TRANSACTION;
+UPDATE t1 SET f2 = 4;
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2';
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_many_tables_nopk.test b/mysql-test/suite/galera/t/galera_many_tables_nopk.test
new file mode 100644
index 00000000000..98a65b7c660
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_tables_nopk.test
@@ -0,0 +1,109 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+if (!`SELECT @@open_files_limit >= 1024`){
+ skip Need at least an open file limit of 1000;
+}
+
+#
+# This test forces 900 tables without a PK to participate in a single
+# transaction. The reason for 900 is that some linux system has by default
+# a limit of 1024 open files / process
+#
+
+#
+# First, create 900 tables
+#
+
+--connection node_1
+
+--let $count = 900
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER) ENGINE=InnoDB")`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+--let $count = 900
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (1234)")`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+#
+# Second, perform 900 updates
+#
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+
+--let $count = 900
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("UPDATE t", $count, " SET f1 = 1")`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+COMMIT;
+
+# Third, confirm that all the inserts have arrived on the second node
+#
+
+--connection node_2
+CREATE TABLE sum_table (f1 INTEGER);
+
+--let $count = 900
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("INSERT INTO sum_table SELECT COUNT(*) FROM t", $count)`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+SELECT SUM(f1) = 900 FROM sum_table;
+
+#
+# Fourth, create a deadlock
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+
+--let $count = 900
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("UPDATE t", $count, " SET f1 = 2")`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t900 SET f1 = 3;
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP SCHEMA test;
+CREATE SCHEMA test;
diff --git a/mysql-test/suite/galera/t/galera_many_tables_pk.test b/mysql-test/suite/galera/t/galera_many_tables_pk.test
new file mode 100644
index 00000000000..551307b123f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_tables_pk.test
@@ -0,0 +1,101 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+if (!`SELECT @@open_files_limit >= 1024`){
+ skip Need at least an open file limit of 1024;
+}
+
+#
+# First, create 100 tables and make sure the DDLs are all propagated
+#
+
+--connection node_1
+
+--let $count = 100
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB")`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+--connection node_2
+SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
+
+#
+# Second, create a transaction that uses all those tables
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+
+--let $count = 100
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (DEFAULT)")`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+COMMIT;
+
+#
+# Third, confirm that all the inserts have arrived on the second node
+#
+
+--connection node_2
+CREATE TABLE sum_table (f1 INTEGER);
+
+--let $count = 100
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("INSERT INTO sum_table SELECT COUNT(*) FROM t", $count)`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+SELECT SUM(f1) = 100 FROM sum_table;
+
+#
+# Fourth, create a deadlock
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+
+--let $count = 100
+while ($count)
+{
+ --disable_query_log
+ --let $ddl_var = `SELECT CONCAT("UPDATE t", $count, " SET f1 = 2")`
+ --eval $ddl_var
+ --enable_query_log
+ --dec $count
+}
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t100 SET f1 = 3;
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+DROP SCHEMA test;
+CREATE SCHEMA test;
diff --git a/mysql-test/suite/galera/t/galera_mdev_10812.test b/mysql-test/suite/galera/t/galera_mdev_10812.test
new file mode 100644
index 00000000000..4539ab6c84d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdev_10812.test
@@ -0,0 +1,27 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-10812: On COM_STMT_CLOSE/COM_QUIT, when wsrep_conflict_state
+--echo # is ABORTED, it causes wrong response to be sent to the client
+--echo #
+
+# First create a deadlock
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+CREATE TABLE t1(a INT PRIMARY KEY);
+INSERT INTO t1 VALUES(1),(2),(3);
+START TRANSACTION ;
+UPDATE t1 SET a=a+100;
+
+--sleep 2
+--connection node_2
+UPDATE t1 SET a=a+100;
+
+--sleep 2
+--connection node_1a
+# here we get deadlock error
+--disconnect node_1a
+
+--connection node_2
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.opt b/mysql-test/suite/galera/t/galera_mdev_13787.opt
new file mode 100644
index 00000000000..27ec1e3f00e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdev_13787.opt
@@ -0,0 +1 @@
+--innodb-stats-persistent=1
diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.test b/mysql-test/suite/galera/t/galera_mdev_13787.test
new file mode 100644
index 00000000000..940cffb8b65
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdev_13787.test
@@ -0,0 +1,6 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--connection node_1
+create table t(a int);
+insert into t select 1;
+DROP TABLE t;
diff --git a/mysql-test/suite/galera/t/galera_mdl_race.test b/mysql-test/suite/galera/t/galera_mdl_race.test
new file mode 100644
index 00000000000..508b85add4b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdl_race.test
@@ -0,0 +1,79 @@
+#
+# This test tests a potential race condition in MDL locking
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+
+# block access to t2
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+LOCK TABLE t2 WRITE;
+
+# Block before MLD lock wait
+--connection node_1
+ SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
+--send SELECT * FROM t2;
+
+# Wait for SELECT to be blocked
+--connection node_1a
+#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIS WHERE STATE = 'System lock';
+#--source include/wait_condition.inc
+#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+#--source include/wait_condition.inc
+
+# block applier to wait after BF victim is locked
+SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
+
+--sleep 3
+
+# Unblock the SELECT, to enter wsrep_thd_is_BF
+--connection node_1a
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
+
+--sleep 3
+
+# unblock applier to try to BF the SELECT
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
+
+
+# table lock is not needed anymore
+--sleep 3
+UNLOCK TABLES;
+
+# SELECT succeeds
+--connection node_1
+
+--error ER_LOCK_DEADLOCK
+--reap
+
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--connection node_1a
+SET DEBUG_SYNC = "RESET";
+
diff --git a/mysql-test/suite/galera/t/galera_migrate.cnf b/mysql-test/suite/galera/t/galera_migrate.cnf
new file mode 100644
index 00000000000..ed48f208e52
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_migrate.cnf
@@ -0,0 +1,59 @@
+#
+# This .cnf file starts 4 servers without enabling Galera.
+# The galera_migrate.test will set wsrep_provider and the other settings as needed.
+#
+
+!include include/default_mysqld.cnf
+
+[mysqld]
+binlog-format=row
+innodb_autoinc_lock_mode=2
+innodb_flush_log_at_trx_commit=2
+log-bin=mysqld-bin
+
+wsrep_node_address=127.0.0.1
+wsrep_causal_reads=ON
+wsrep_sync_wait = 15
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+[mysqld.3]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+[mysqld.4]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+NODE_GALERAPORT_4= @mysqld.4.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
+NODE_SSTPORT_4= @mysqld.4.#sst_port
diff --git a/mysql-test/suite/galera/t/galera_migrate.test b/mysql-test/suite/galera/t/galera_migrate.test
new file mode 100644
index 00000000000..84897b66c6d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_migrate.test
@@ -0,0 +1,204 @@
+#
+# Execute a migration from MariaDB replication to Galera replication.
+# The test starts with 4 stand-alone servers defined by galera_migrate.cnf and then
+# performs the following steps:
+#
+# 1. Begin with a single MySQL server
+# 2. Establish traditional MySQL master-slave replication
+# 3. Attach a new sever to serve as a MySQL replication slave
+# 4. Enable Galera on the new slave and create a single-node Galera cluster
+# 5. Attach a second Galera node
+# 6. Turn off the traditional replication parts of the system
+# 7. Continue replicating within Galera only
+#
+
+--source include/big_test.inc
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+
+#
+# Step #1 Begin with a single server
+#
+
+--connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+#
+# Step #2. Establish traditional MySQL replication
+#
+
+--connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
+--source include/wait_condition.inc
+
+#
+# Step #3. Attach a second slave, later to be converted to Galera
+#
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1;
+--enable_query_log
+START SLAVE USER='root';
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
+--source include/wait_condition.inc
+
+#
+# Step #4. Convert this MySQL slave into a Galera node
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (4);
+
+--connection node_3
+--disable_query_log
+--eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER'
+--eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_3'
+--enable_query_log
+SET GLOBAL wsrep_cluster_address='gcomm://';
+
+--connection node_1
+INSERT INTO t1 VALUES (5);
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+INSERT INTO t1 VALUES (6);
+
+#
+# Step #5. Attach a second Galera node using mysqldump SST
+#
+
+--connection node_3
+# We need a user with a password for mysqldump SST
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+
+--disable_query_log
+--eval SET GLOBAL wsrep_sst_method = 'mysqldump';
+--eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER'
+--eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_4'
+--eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.2:$NODE_MYPORT_4';
+--eval SET GLOBAL wsrep_cluster_address='gcomm://127.0.0.1:$NODE_GALERAPORT_3'
+--enable_query_log
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 6 FROM t1;
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+
+#
+# Step #6. Turn off traditional replication
+#
+
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+
+--connection node_3
+STOP SLAVE;
+RESET SLAVE ALL;
+
+#
+# Step #7. Continue replicating within Galera only
+#
+
+# We need fresh connections due to galera#191
+
+--connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3
+INSERT INTO t1 VALUES (7);
+
+--connect node_4a, 127.0.0.1, root, , test, $NODE_MYPORT_4
+INSERT INTO t1 VALUES (8);
+
+--connection node_4a
+SELECT COUNT(*) = 8 FROM t1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_3a
+SELECT COUNT(*) = 8 FROM t1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+#
+# Teardown
+#
+
+--connection node_1
+DROP TABLE t1;
+
+--connection node_2
+DROP TABLE t1;
+
+--connection node_3
+SET GLOBAL wsrep_provider = 'none';
+SET GLOBAL wsrep_sst_auth = '';
+SET GLOBAL wsrep_provider_options = '';
+DROP TABLE t1;
+DROP USER sst;
+
+--connection node_4
+SET GLOBAL wsrep_provider = 'none';
+SET GLOBAL wsrep_sst_method = 'rsync';
+SET GLOBAL wsrep_provider_options = '';
+SET GLOBAL wsrep_sst_receive_address = 'AUTO';
+DROP TABLE t1;
+DROP USER sst;
+
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
diff --git a/mysql-test/suite/galera/t/galera_multi_database.test b/mysql-test/suite/galera/t/galera_multi_database.test
new file mode 100644
index 00000000000..6e06aaaa2c6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_multi_database.test
@@ -0,0 +1,43 @@
+#
+# Test that identical updates can be delivered to two separate
+# databases without this causing a certification conflict
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE DATABASE d1;
+CREATE TABLE d1.t1(f1 INTEGER) ENGINE=InnoDB;
+
+CREATE DATABASE d2;
+CREATE TABLE d2.t1(f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO d1.t1 VALUES (1);
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO d2.t1 VALUES (1);
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+COMMIT;
+
+SELECT COUNT(*) = 1 FROM d1.t1;
+SELECT COUNT(*) = 1 FROM d2.t1;
+
+--connection node_1
+
+SELECT COUNT(*) = 1 FROM d1.t1;
+SELECT COUNT(*) = 1 FROM d2.t1;
+
+DROP TABLE d1.t1;
+DROP TABLE d2.t1;
+
+DROP DATABASE d1;
+DROP DATABASE d2;
diff --git a/mysql-test/suite/galera/t/galera_myisam_autocommit.test b/mysql-test/suite/galera/t/galera_myisam_autocommit.test
new file mode 100644
index 00000000000..b01b5dc07f7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_myisam_autocommit.test
@@ -0,0 +1,45 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# This tests simple autocommit replication of MyISAM tables. No updates arrive on the slave.
+#
+
+# Without a PK
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2), (3);
+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
+
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2), (3);
+INSERT INTO t2 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
+
+# Error
+--error ER_DUP_ENTRY
+INSERT INTO t2 VALUES (6), (1);
+
+# UPDATE
+
+UPDATE t1 SET f1 = 9;
+UPDATE t2 SET f1 = 9 WHERE f1 = 1;
+
+# DELETE
+
+DELETE FROM t1 WHERE f1 = 9;
+DELETE FROM t2 WHERE f1 = 9;
+
+# TRUNCATE
+
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 0 FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_myisam_transactions.test b/mysql-test/suite/galera/t/galera_myisam_transactions.test
new file mode 100644
index 00000000000..00e0bf3fdca
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_myisam_transactions.test
@@ -0,0 +1,36 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# This tests MyISAM tables in transactions. No MyISAM updates arrive on the slave, but InnoDB ones do.
+#
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t3 (f1 INTEGER) ENGINE=MyISAM;
+
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES (NEW.f1);
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+COMMIT;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 0 FROM t2;
+SELECT COUNT(*) = 0 FROM t2;
+
+--connection node_1
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+ROLLBACK;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 0 FROM t2;
+SELECT COUNT(*) = 0 FROM t2;
+
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/galera/t/galera_nopk_bit.test b/mysql-test/suite/galera/t/galera_nopk_bit.test
new file mode 100644
index 00000000000..4292a6d6711
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_nopk_bit.test
@@ -0,0 +1,46 @@
+#
+# This checks that even tables with a single BIT column are replicated properly without a PK
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 BIT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(0),(b'1');
+
+--connection node_2
+SELECT f1 IS NULL, f1 = b'1' FROM t1;
+
+DELETE FROM t1 WHERE f1 = b'1';
+UPDATE t1 SET f1 = b'1' WHERE f1 IS NULL;
+UPDATE t1 SET f1 = 1 WHERE f1 = b'0';
+
+--connection node_1
+SELECT f1 IS NULL, f1 = b'1' FROM t1;
+
+#
+# Provoke a conflict
+#
+
+--connection node_1
+CREATE TABLE t2 (f1 BIT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (NULL);
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 0 WHERE f1 IS NULL;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 1 WHERE f1 IS NULL;
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_nopk_blob.test b/mysql-test/suite/galera/t/galera_nopk_blob.test
new file mode 100644
index 00000000000..08e3b996c8e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_nopk_blob.test
@@ -0,0 +1,46 @@
+#
+# This checks that even tables with a single BLOB column and no FK are replicated properly
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),('abc');
+
+--connection node_2
+SELECT f1 FROM t1;
+
+DELETE FROM t1 WHERE f1 IS NULL;
+UPDATE t1 SET f1 = 'xyz' WHERE f1 = 'abc';
+
+--connection node_1
+SELECT COUNT(*) = 1 FROM t1;
+SELECT f1 = 'abc' FROM t1;
+
+#
+# Provoke a conflict
+#
+
+--connection node_1
+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (NULL);
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'abc' WHERE f1 IS NULL;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'xyz' WHERE f1 IS NULL;
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_nopk_large_varchar.test b/mysql-test/suite/galera/t/galera_nopk_large_varchar.test
new file mode 100644
index 00000000000..bb9bcd5a593
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_nopk_large_varchar.test
@@ -0,0 +1,50 @@
+#
+# This checks that even tables with a single long VARCHARcolumn and no FK are replicated properly
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# From the Innodb manual: "The maximum row length, except for variable-length columns (VARBINARY, VARCHAR, BLOB and TEXT),
+# is slightly less than half of a database page. That is, the maximum row length is about 8000 bytes"
+
+CREATE TABLE t1 (f1 VARCHAR(8000)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(CONCAT(REPEAT('x', 7999), 'a'));
+
+--connection node_2
+SELECT LENGTH(f1) FROM t1;
+
+DELETE FROM t1 WHERE f1 IS NULL;
+UPDATE t1 SET f1 = CONCAT(REPEAT('x', 7999), 'b') WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
+
+--connection node_1
+SELECT COUNT(*) = 1 FROM t1;
+SELECT LENGTH(f1) = 8000 FROM t1;
+SELECT f1 = CONCAT(REPEAT('x', 7999), 'b') FROM t1;
+
+#
+# Provoke a conflict
+#
+
+--connection node_1
+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (CONCAT(REPEAT('x', 7999), 'a'));
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'abc' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t2 SET f1 = 'xyz' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_nopk_unicode.test b/mysql-test/suite/galera/t/galera_nopk_unicode.test
new file mode 100644
index 00000000000..e036e14ebe0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_nopk_unicode.test
@@ -0,0 +1,43 @@
+#
+# Test non-ascii data in table without a PK
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (
+ f1 VARCHAR(255),
+ KEY (f1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 VALUES ('текÑÑ‚');
+
+--connection node_2
+SELECT f1 = 'текÑÑ‚' FROM t1;
+
+#
+# Provoke a conflict
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚2';
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚3';
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+SELECT f1 = 'текÑÑ‚2' FROM t1;
+SELECT f1 = 'текÑÑ‚2' FROM t1 WHERE f1 = 'текÑÑ‚2';
+
+
+DROP TABLE t1;
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
new file mode 100644
index 00000000000..febb91a9725
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
@@ -0,0 +1,51 @@
+#
+# Test that a LOCK TABLE on the slave will cause all applier threads to block,
+# Even though the two INSERTS are independent transactions, the fact that t1 is locked
+# prevents the applier thread from committing the insert against t2, as commits are done
+# in order.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+
+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
+--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait`
+
+SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 READ;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# We use a separate connection here so that we can SELECT from both tables
+# without running into "table t2 was not locked" error.
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+--sleep 1
+SET SESSION wsrep_sync_wait=0;
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%applied write set%';
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table level lock%';
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 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%';
+
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test
new file mode 100644
index 00000000000..f280e49d206
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test
@@ -0,0 +1,51 @@
+##
+## This test tests parallel application of multiple auto-increment insert transactions
+##
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+# Create a second connection to node1 so that we can run transactions concurrently
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
+--connection node_2
+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
+SET GLOBAL wsrep_slave_threads = 4;
+
+--connection node_1
+--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_1a
+--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_2
+--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_1
+--reap
+
+--connection node_1a
+--reap
+
+--connection node_2
+--reap
+SELECT COUNT(*) = 30000 FROM t1;
+SELECT COUNT(DISTINCT f1) = 30000 FROM t1;
+SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+
+--disable_query_log
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
+--enable_query_log
+
+--connection default
+DROP TABLE t1;
+DROP TABLE ten;
+
diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test
new file mode 100644
index 00000000000..8680d62a36d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test
@@ -0,0 +1,54 @@
+##
+## Tests the parallel application of many small-ish auto-increment insert transactions
+##
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+# Create a second connection to node1 so that we can run transactions concurrently
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
+--connection node_2
+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
+SET GLOBAL wsrep_slave_threads = 4;
+
+--connection node_1
+--let $count = 1000
+while ($count)
+{
+ --disable_query_log
+ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1;
+ --enable_query_log
+ --dec $count
+}
+
+--connection node_2
+--let $count = 1000
+while ($count)
+{
+ --disable_query_log
+ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1;
+ --enable_query_log
+ --dec $count
+}
+
+SELECT COUNT(*) = 20000 FROM t1;
+SELECT COUNT(DISTINCT f1) = 20000 FROM t1;
+SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
+
+--disable_query_log
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
+--enable_query_log
+
+--connection default
+DROP TABLE t1;
+DROP TABLE ten;
+
diff --git a/mysql-test/suite/galera/t/galera_parallel_simple.test b/mysql-test/suite/galera/t/galera_parallel_simple.test
new file mode 100644
index 00000000000..41cd0c8e6fa
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_parallel_simple.test
@@ -0,0 +1,56 @@
+#
+# Test that SHOW PROCESSLIST reports that two slave threads have been involved in applying
+# two independent transactions
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
+
+CREATE TABLE t1 (id INT) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+
+--connection node_2
+SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 WRITE;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'applied write set%';
+--source include/wait_condition.inc
+
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 15;
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM t2;
+
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_pc_ignore_sb.test b/mysql-test/suite/galera/t/galera_pc_ignore_sb.test
new file mode 100644
index 00000000000..84fd3a91857
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_pc_ignore_sb.test
@@ -0,0 +1,46 @@
+#
+# Test pc.ignore_sb=true wsrep_provider option . Killing one node should leave the other running.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_1
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+
+--connection node_2
+--source include/kill_galera.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+
+# Reset the master and restart the slave so that post-test checks can run
+
+SET GLOBAL wsrep_cluster_address = '';
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+
+--connection node_2
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+
diff --git a/mysql-test/suite/galera/t/galera_pk_bigint_signed.test b/mysql-test/suite/galera/t/galera_pk_bigint_signed.test
new file mode 100644
index 00000000000..12a8a8f5d64
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_pk_bigint_signed.test
@@ -0,0 +1,46 @@
+#
+# PK that is a BIGINT SIGNED
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 BIGINT SIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES
+ (-9223372036854775808, 'min'),
+ (9223372036854775807, 'max')
+;
+
+--connection node_2
+SELECT * FROM t1;
+
+UPDATE t1 SET f2 = CONCAT(f2, '_');
+
+--connection node_1
+SELECT * FROM t1;
+
+#
+# Deadlock
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'foo' WHERE f1 = -9223372036854775808;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'bar' WHERE f1 = -9223372036854775808;
+
+--connection node_1
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test b/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test
new file mode 100644
index 00000000000..2bb02d5ea4e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test
@@ -0,0 +1,45 @@
+#
+# PK that is a BIGINT UNSIGNED
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 BIGINT UNSIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES
+ (18446744073709551615, 'max')
+;
+
+--connection node_2
+SELECT f1 = 18446744073709551615 FROM t1;
+
+UPDATE t1 SET f2 = CONCAT(f2, '_');
+
+--connection node_1
+SELECT f1 = 18446744073709551615 FROM t1;
+
+#
+# Deadlock
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'foo' WHERE f1 = 18446744073709551615;
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'bar' WHERE f1 = 18446744073709551615;
+
+--connection node_1
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_prepared_statement.test b/mysql-test/suite/galera/t/galera_prepared_statement.test
new file mode 100644
index 00000000000..3bee097ff39
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_prepared_statement.test
@@ -0,0 +1,45 @@
+#
+# A simple test for PREPARE / EXECUTE -style prepared statements with Galera
+#
+# C-API-level prepared-statements can not be triggered from inside mysqltest, however
+# can be exercised when running an MTR test suite with the --ps-protocol switch.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t3 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t4 (f1 CHAR(5)) ENGINE=InnoDB;
+
+SET SESSION sql_mode='STRICT_ALL_TABLES';
+
+PREPARE st1 FROM 'INSERT INTO t1 VALUES ("abc")';
+PREPARE st2 FROM 'INSERT INTO t2 VALUES ("abc")';
+PREPARE st3 FROM 'INSERT INTO t3 VALUES ("abc")';
+PREPARE st4 FROM 'INSERT INTO t4 VALUES ("abc")';
+
+EXECUTE st1;
+EXECUTE st2;
+EXECUTE st3;
+EXECUTE st4;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+SELECT COUNT(*) = 1 FROM t3;
+SELECT COUNT(*) = 1 FROM t4;
+
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+ALTER TABLE t1 DROP COLUMN f1;
+
+--connection node_1
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+EXECUTE st1;
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
diff --git a/mysql-test/suite/galera/t/galera_query_cache-master.opt b/mysql-test/suite/galera/t/galera_query_cache-master.opt
new file mode 100644
index 00000000000..915a36c0937
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache-master.opt
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1355776
diff --git a/mysql-test/suite/galera/t/galera_query_cache.test b/mysql-test/suite/galera/t/galera_query_cache.test
new file mode 100644
index 00000000000..900faba0e1b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache.test
@@ -0,0 +1,67 @@
+--source include/have_query_cache.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Ensure that the query cache behaves properly with respect to Galera
+#
+# * in the absence of updates, the query cache does serve cached results
+# * any cache-invalidating query on the remote node also causes the local cache to be invalidated
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+RESET QUERY CACHE;
+FLUSH STATUS;
+
+#
+# 1. Cache works
+#
+
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+
+#
+# 2. Cache is invalidated by DML on remote node
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+FLUSH STATUS;
+
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+
+#
+# 3. Cache is invalidated by DDL on remote node
+#
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_2
+FLUSH STATUS;
+
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
+
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt b/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
new file mode 100644
index 00000000000..915a36c0937
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1355776
diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
new file mode 100644
index 00000000000..87afc2d7bb2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
@@ -0,0 +1,89 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/have_query_cache.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+SELECT MAX(id) FROM t1; # first lookup miss
+
+#
+# Query cache hit, wait timeout
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT MAX(id) FROM t1;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+FLUSH QUERY CACHE;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+SET DEBUG_SYNC = "RESET";
+
+#
+# Query cache miss, wait timeout
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT MAX(id) FROM t1;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+#
+# Query cache miss
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (4);
+
+--connection node_2
+SELECT MAX(id) FROM t1;
+
+#
+# Query cache hit
+#
+
+FLUSH STATUS;
+SELECT MAX(id) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+
+#
+# Query cache invalidated
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (5);
+
+--connection node_2
+--send SELECT MAX(id) FROM t1
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+--connection node_2
+--reap
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"
+DROP TABLE t1;
+
+--connection node_2a
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera/t/galera_read_only.test b/mysql-test/suite/galera/t/galera_read_only.test
new file mode 100644
index 00000000000..c0fa4af07e0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_read_only.test
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Ensure that the read_only option does not apply to Galera appliers and that replication
+# continues, the way MySQL replication would.
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+SET GLOBAL read_only=TRUE;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+CREATE USER foo@localhost;
+
+--echo # Open connection to node 2 using 'foo' user.
+--let $port_2= \$NODE_MYPORT_2
+--connect(foo_node_2,127.0.0.1,foo,,test,$port_2,)
+
+--echo
+--echo # Connect with foo_node_2
+--connection foo_node_2
+--error ER_OPTION_PREVENTS_STATEMENT
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+# Cleanup
+SET GLOBAL read_only=FALSE;
+DROP TABLE t1;
+DROP USER foo@localhost;
+
diff --git a/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test b/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test
new file mode 100644
index 00000000000..8749c20faed
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test
@@ -0,0 +1,34 @@
+#
+# Test repl.key_format = FLAT16 . Since it is very difficult to cause a collision on a 16-byte hash,
+# we simply verify that the option is settable and that replication works.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'repl.key_format=FLAT16';
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (123);
+
+CREATE TABLE t2 (f1 VARCHAR(256)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (REPEAT('a', 256));
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+UPDATE t1 SET f1 = 234;
+UPDATE t2 SET f1 = REPEAT('b', 256);
+
+--connection node_1
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 234;
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = REPEAT('b', 256);
+
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_repl_max_ws_size.test b/mysql-test/suite/galera/t/galera_repl_max_ws_size.test
new file mode 100644
index 00000000000..60b866ae018
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_repl_max_ws_size.test
@@ -0,0 +1,29 @@
+#
+# Test repl.max_ws_size . A transaction larger than this size can not commit.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+
+CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
+
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (REPEAT('a', 512));
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+
+DROP TABLE t1;
+
+CALL mtr.add_suppression("Maximum writeset size exceeded by");
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("transaction size exceeded");
+CALL mtr.add_suppression("rbr write fail");
diff --git a/mysql-test/suite/galera/t/galera_restart_nochanges.test b/mysql-test/suite/galera/t/galera_restart_nochanges.test
new file mode 100644
index 00000000000..0a6a0c5ccbe
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_restart_nochanges.test
@@ -0,0 +1,40 @@
+#
+# This test restarts a slave while no updates have been performed on the master. No SST is performed.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--source include/restart_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+--source include/wait_until_ready.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+DROP TABLE t1;
+
+# Restore original auto_increment_offset values.
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+
diff --git a/mysql-test/suite/galera/t/galera_restart_on_unknown_option.test b/mysql-test/suite/galera/t/galera_restart_on_unknown_option.test
new file mode 100644
index 00000000000..a8ea639415d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_restart_on_unknown_option.test
@@ -0,0 +1,157 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Suppress expected warnings:
+
+CALL mtr.add_suppression("Aborting");
+CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+#
+# We should count the number of "Assertion failed" warnings
+# in the log file before and after testing. To do this we need
+# to save original log file before testing:
+#
+--let TEST_LOG=$MYSQLTEST_VARDIR/log/mysqld.2.err
+--perl
+ use strict;
+ my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
+ my $test_log_copy=$test_log . '.copy';
+ if (-e $test_log_copy) {
+ unlink $test_log_copy;
+ }
+EOF
+--copy_file $TEST_LOG $TEST_LOG.copy
+
+--connection node_2
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
+
+SELECT * FROM t1;
+
+# Initiate normal shutdown on the node 2 and
+# waiting until shutdown has been completed:
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Some updates on node 1:
+
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+
+SELECT * FROM t1;
+
+# Remove the "grastate.dat" file (to initiate new SST)
+# and restart node 2 with unknown option:
+
+--connection node_2
+
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--let $start_mysqld_params=--galera-unknown-option
+
+--echo Starting server ...
+--exec echo "try:$start_mysqld_params" > $_expect_file_name
+
+# Sleep to ensure that server exited...
+
+--sleep 30
+
+# Restart node 2 without unknown option:
+
+--let $start_mysqld_params=
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Sanity check (node 2 is running now and can perform SQL operators):
+
+SELECT * FROM t1;
+
+# Initiate normal shutdown on the node 2 and
+# waiting until shutdown has been completed:
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Some updates on node 1 - to initiate IST next time:
+
+UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
+
+SELECT * FROM t1;
+
+# Restart node 2 with unknown option:
+
+--connection node_2
+
+--let $start_mysqld_params=--galera-unknown-option
+
+--echo Starting server ...
+--exec echo "try:$start_mysqld_params" > $_expect_file_name
+
+# Sleep to ensure that server exited...
+
+--sleep 30
+
+# Restart node 2 without unknown option:
+
+--let $start_mysqld_params=
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Sanity check (node 2 is running now and can perform SQL operators):
+
+SELECT * FROM t1;
+
+--connection node_1
+
+DROP TABLE t1;
+
+#
+# We should count the number of "Assertion failed" warnings
+# in the log file during test phase - to print the error message
+# if quantity of such warnings in log file increased at the end
+# of the test:
+#
+--perl
+ use strict;
+ my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
+ my $test_log_copy=$test_log . '.copy';
+ open(FILE, $test_log_copy) or die("Unable to open $test_log_copy: $!\n");
+ my $initial=grep(/Assertion * failed/gi,<FILE>);
+ close(FILE);
+ open(FILE, $test_log) or die("Unable to open $test_log: $!\n");
+ my $count_warnings=grep(/Assertion * failed/gi,<FILE>);
+ close(FILE);
+ if ($count_warnings != $initial) {
+ my $diff=$count_warnings-$initial;
+ print "Assertion failed $diff times.\n";
+ }
+EOF
+--remove_file $TEST_LOG.copy
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_roles.test b/mysql-test/suite/galera/t/galera_roles.test
new file mode 100644
index 00000000000..eea35762539
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_roles.test
@@ -0,0 +1,201 @@
+#
+# Test for CREATE/DROP/GRANT/REVOKE role.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # Testing CREATE/GRANT role
+--echo #
+
+--echo
+--echo # On node_1
+--connection node_1
+
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (a int, b int);
+CREATE TABLE test1.t2 (a int, b int);
+INSERT INTO test1.t1 values (1,2),(3,4);
+INSERT INTO test1.t2 values (5,6),(7,8);
+
+CREATE PROCEDURE test1.pr1() SELECT "pr1";
+
+CREATE USER foo@localhost;
+CREATE ROLE role1;
+
+GRANT role1 TO foo@localhost;
+GRANT RELOAD ON *.* TO role1;
+GRANT SELECT ON mysql.* TO role1;
+GRANT EXECUTE ON PROCEDURE test1.pr1 TO role1;
+GRANT SELECT ON test1.t1 TO role1;
+GRANT SELECT (a) ON test1.t2 TO role1;
+
+--echo # Open connections to the 2 nodes using 'foo' user.
+--let $port_1= \$NODE_MYPORT_1
+--connect(foo_node_1,127.0.0.1,foo,,test,$port_1,)
+
+--let $port_2= \$NODE_MYPORT_2
+--sleep 1
+--connect(foo_node_2,127.0.0.1,foo,,test,$port_2,)
+
+--echo
+--echo # Connect with foo_node_1
+--connection foo_node_1
+
+SHOW GRANTS;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+FLUSH TABLES;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM mysql.roles_mapping;
+--error ER_DBACCESS_DENIED_ERROR
+SHOW TABLES FROM test1;
+
+SET ROLE role1;
+
+FLUSH TABLES;
+--sorted_result
+SELECT * FROM mysql.roles_mapping;
+SHOW TABLES FROM test1;
+SELECT * FROM test1.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM test1.t2;
+SELECT a FROM test1.t2;
+CALL test1.pr1();
+
+--echo
+--echo # Connect with foo_node_2
+--connection foo_node_2
+
+SHOW GRANTS;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+FLUSH TABLES;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM mysql.roles_mapping;
+--error ER_DBACCESS_DENIED_ERROR
+SHOW TABLES FROM test1;
+
+SET ROLE role1;
+
+FLUSH TABLES;
+--sorted_result
+SELECT * FROM mysql.roles_mapping;
+SHOW TABLES FROM test1;
+SELECT * FROM test1.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM test1.t2;
+SELECT a FROM test1.t2;
+CALL test1.pr1();
+
+--echo #
+--echo # Testing REVOKE role
+--echo #
+
+--echo #
+--echo # Connect with node_1
+--connection node_1
+REVOKE EXECUTE ON PROCEDURE test1.pr1 FROM role1;
+
+--echo
+--echo # Connect with foo_node_1
+--connection foo_node_1
+
+--sleep 1
+--error ER_PROCACCESS_DENIED_ERROR
+CALL test1.pr1();
+
+--echo
+--echo # Connect with foo_node_2
+--connection foo_node_2
+
+--error ER_PROCACCESS_DENIED_ERROR
+CALL test1.pr1();
+
+--echo #
+--echo # Testing DROP role
+--echo #
+
+--echo
+--echo # Connect with node_1
+--connection node_1
+
+DROP ROLE role1;
+
+--echo
+--echo # Connect with foo_node_1
+--connection foo_node_1
+
+FLUSH TABLES;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM mysql.roles_mapping;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM test1.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT a FROM test1.t2;
+
+SHOW GRANTS;
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES; # yes, repeat it twice
+SELECT CURRENT_ROLE();
+
+--echo
+--echo # Connect with foo_node_2
+--connection foo_node_2
+
+FLUSH TABLES;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM mysql.roles_mapping;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM test1.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT a FROM test1.t2;
+
+SHOW GRANTS;
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES; # yes, repeat it twice
+SELECT CURRENT_ROLE();
+
+# Cleanup
+disconnect foo_node_2;
+--echo # Connect with node_1
+--connection node_1
+
+DROP USER foo@localhost;
+DROP DATABASE test1;
+
+--echo #
+--echo # MDEV-10566: Create role statement replicated inconsistently in Galera Cluster
+--echo #
+--echo
+--echo # On node_1
+--connection node_1
+CREATE USER foo@localhost;
+CREATE ROLE role1;
+CREATE ROLE role2 WITH ADMIN CURRENT_USER;
+CREATE ROLE role3 WITH ADMIN foo@localhost;
+CREATE ROLE role4 WITH ADMIN role1;
+
+--sorted_result
+SELECT * FROM mysql.roles_mapping;
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.APPLICABLE_ROLES;
+
+--echo
+--echo # On node_2
+--connection node_2
+--sorted_result
+SELECT * FROM mysql.roles_mapping;
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.APPLICABLE_ROLES;
+
+# Cleanup
+DROP ROLE role1;
+DROP ROLE role2;
+DROP ROLE role3;
+DROP ROLE role4;
+DROP USER foo@localhost;
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/galera_rsu_add_pk.test b/mysql-test/suite/galera/t/galera_rsu_add_pk.test
new file mode 100644
index 00000000000..7db990d7be1
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_rsu_add_pk.test
@@ -0,0 +1,43 @@
+#
+# ALTER TABLE ... ADD PRIMARY KEY under Rolling Schema Upgrade
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+# Insert some values before the ALTER
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+# Insert more values while the ALTER is running
+--send INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_OSU_method = "TOI";
+
+# Insert values after the ALTER
+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+
+SELECT COUNT(*) = 300000 FROM t1;
+SELECT MAX(f1) = 299999 FROM t1;
+
+--connection node_1
+--reap
+SELECT COUNT(*) = 300000 FROM t1;
+SELECT MAX(f1) = 299999 FROM t1;
+
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_OSU_method = "TOI";
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_rsu_drop_pk.test b/mysql-test/suite/galera/t/galera_rsu_drop_pk.test
new file mode 100644
index 00000000000..e64259494d1
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_rsu_drop_pk.test
@@ -0,0 +1,58 @@
+#
+# ALTER TABLE ... DROP PRIMARY KEY under Rolling Schema Upgrade
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+# Insert some values before the ALTER
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+# Insert more values while the ALTER is running
+--send INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION wsrep_OSU_method = "TOI";
+
+# Insert even more data after the ALTER has completed
+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+SELECT COUNT(*) = 300000 FROM t1;
+SELECT MAX(f1) = 299999 FROM t1;
+
+--connection node_1
+--reap
+SELECT COUNT(*) = 300000 FROM t1;
+SELECT MAX(f1) = 299999 FROM t1;
+
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION wsrep_OSU_method = "TOI";
+
+# Insert some previously-conflicting values after the ALTER has been applied on all nodes.
+--connection node_2
+INSERT INTO t1 (f1) VALUES (1);
+INSERT INTO t1 (f1) VALUES (10);
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1;
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 10;
+
+INSERT INTO t1 (f1) VALUES (100);
+INSERT INTO t1 (f1) VALUES (1000);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 100;
+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1000;
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_rsu_error.test b/mysql-test/suite/galera/t/galera_rsu_error.test
new file mode 100644
index 00000000000..cad8154ac76
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_rsu_error.test
@@ -0,0 +1,31 @@
+#
+# Test DDL errors under Rolling Schema Upgrade
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 VALUES (1), (1);
+
+--connection node_2
+SET SESSION wsrep_OSU_method = "RSU";
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_OSU_method = "TOI";
+
+# The ALTER has no effect
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1';
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 3 FROM t1;
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(3) = 4 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_rsu_simple.test b/mysql-test/suite/galera/t/galera_rsu_simple.test
new file mode 100644
index 00000000000..5841dbd8006
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_rsu_simple.test
@@ -0,0 +1,34 @@
+#
+# Test Rolling Schema Upgrade
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_2
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_1
+# The ALTER above is not visible on node_1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+# The INSERT above is now visible on node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+INSERT INTO t1 (f1) VALUES (2);
+
+--connection node_1
+# The ALTER has not replicated
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+# However the INSERT above has
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test
new file mode 100644
index 00000000000..882f846fe67
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test
@@ -0,0 +1,86 @@
+#
+# Test manipulating wsrep_desync while an RSU operation is in progress
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+# First, test wsrep_desync 1 > 0 during DDL
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SHOW CREATE TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+SET wsrep_OSU_method=TOI;
+
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+
+# Next, test wsrep_desync 0 > 1 during DDL, currently not allowed
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=0;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_create_table_no_lock'
+--source include/wait_condition.inc
+
+# wsrep_desync=1 will block
+--send SET GLOBAL wsrep_desync=1;
+
+
+--connection node_1b
+--sleep 2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'SET GLOBAL wsrep_desync=1'
+--source include/wait_condition.inc
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+--connection node_1a
+--reap
+SET GLOBAL wsrep_desync=0;
+
+SHOW CREATE TABLE t1;
+
+# Restore old state
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+
+CALL mtr.add_suppression("Protocol violation");
+CALL mtr.add_suppression("desync failed");
+
+--connection node_2
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-test/suite/galera/t/galera_sbr.test b/mysql-test/suite/galera/t/galera_sbr.test
new file mode 100644
index 00000000000..33f45c6b532
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sbr.test
@@ -0,0 +1,27 @@
+#
+# Test behavior if the user attempts to use statement-based replication
+#
+# SBR is not currently supported but we expect that no crashes or binlog-related assertions will be triggered.
+#
+
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+--connection node_1
+#SET GLOBAL binlog_format = 'STATEMENT';
+SET SESSION binlog_format = 'STATEMENT';
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+SET SESSION binlog_format = 'MIXED';
+
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
+
+--connection node_1
+SET GLOBAL binlog_format = 'ROW';
diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt b/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt
new file mode 100644
index 00000000000..beae84b3862
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt
@@ -0,0 +1 @@
+--log-bin
diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog.test b/mysql-test/suite/galera/t/galera_sbr_binlog.test
new file mode 100644
index 00000000000..1291a4ff8a9
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sbr_binlog.test
@@ -0,0 +1,28 @@
+#
+# Test behavior if the user attempts to use statement-based replication
+#
+# SBR is not currently supported but we expect that no crashes or binlog-related assertions will be triggered.
+#
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+--connection node_1
+#SET GLOBAL binlog_format = 'STATEMENT';
+SET SESSION binlog_format = 'STATEMENT';
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+SET SESSION binlog_format = 'MIXED';
+
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
+
+--connection node_1
+SET GLOBAL binlog_format = 'ROW';
diff --git a/mysql-test/suite/galera/t/galera_serializable.test b/mysql-test/suite/galera/t/galera_serializable.test
new file mode 100644
index 00000000000..b12d57fd488
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_serializable.test
@@ -0,0 +1,76 @@
+#
+# Test that the SERIALIZABLE isolation level behaves as expected.
+# A local serializable transaction is aborted by an incoming remote update
+#
+# wsrep_sync_wait does not work well with serializable, see mysql-wsrep#130
+# hence the need to use --sleep .
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (id INT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+#
+# Read (local transaction) / Write (remote transaction) conflict
+#
+
+SET AUTOCOMMIT=OFF;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+START TRANSACTION;
+
+SELECT * FROM t1;
+
+--connection node_2
+INSERT INTO t1 VALUES (1,1);
+
+--sleep 2
+--connection node_1
+--error ER_LOCK_DEADLOCK
+SELECT * FROM t1;
+
+ROLLBACK;
+DELETE FROM t1;
+
+#
+# Write (local transaction) / Write (remote transaction) conflict
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (1,1);
+START TRANSACTION;
+SELECT * FROM t1;
+
+--connection node_2
+UPDATE t1 SET f2 = 2;
+
+--sleep 2
+--connection node_1
+--error ER_LOCK_DEADLOCK
+UPDATE t1 SET f2 = 3;
+
+ROLLBACK;
+DELETE FROM t1;
+
+#
+# Write (local transaction) / Write (remote transaction) conflict
+# Local transaction writes before remote one.
+# Nothing special happens here - ordinary deadlock on COMMIT
+#
+
+--connection node_1
+START TRANSACTION;
+
+--connection node_1
+INSERT INTO t1 VALUES (1,1);
+
+--connection node_2
+INSERT INTO t1 VALUES (1,2);
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_server.test b/mysql-test/suite/galera/t/galera_server.test
new file mode 100644
index 00000000000..30b39028b96
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_server.test
@@ -0,0 +1,28 @@
+# Test for CREATE/ALTER/DROP SERVER in Galera cluster
+
+--source include/galera_cluster.inc
+
+--connection node_1
+--echo # On node_1
+CREATE SERVER s1
+ FOREIGN DATA WRAPPER mysql
+ OPTIONS (HOST 'foo');
+
+--connection node_2
+--echo # On node_2
+SELECT * FROM mysql.servers;
+ALTER SERVER s1
+ OPTIONS (HOST 'bar');
+
+--connection node_1
+--echo # On node_1
+SELECT * FROM mysql.servers;
+DROP SERVER s1;
+
+--connection node_2
+--echo # On node_2
+SELECT COUNT(*)=0 FROM mysql.servers;
+
+--source include/galera_end.inc
+--echo # End of test
+
diff --git a/mysql-test/suite/galera/t/galera_split_brain.test b/mysql-test/suite/galera/t/galera_split_brain.test
new file mode 100644
index 00000000000..a85a2ad9b8d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_split_brain.test
@@ -0,0 +1,47 @@
+#
+# Confirm that with two nodes, killing one causes the other to stop accepting connections
+# The pc.ignore_sb=true wsrep_provider option is tested in the galera_kill_* tests.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+call mtr.add_suppression("WSREP: TO isolation failed for: ");
+
+--connection node_1
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+
+--connection node_2
+--source include/kill_galera.inc
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+# Reset the master and restart the slave so that post-test checks can run
+
+
+--connection node_2
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--sleep 10
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/wait_until_connected_again.inc
+
+# Restore original auto_increment_offset values.
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+
diff --git a/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test b/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test
new file mode 100644
index 00000000000..cd8d6ba6426
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test
@@ -0,0 +1,26 @@
+#
+# Test SET SESSION sql_log_bin = 0 . We expect that updates gets repliated to
+# other nodes while they do not show up in the binary log files.
+# (see galera.galera_as_master)
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+SET SESSION sql_log_bin = 0;
+
+INSERT INTO t1 VALUES (1);
+
+SET SESSION sql_log_bin = 1;
+
+INSERT INTO t1 VALUES (2);
+
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_ssl.cnf b/mysql-test/suite/galera/t/galera_ssl.cnf
new file mode 100644
index 00000000000..1c22580cc15
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem'
diff --git a/mysql-test/suite/galera/t/galera_ssl.test b/mysql-test/suite/galera/t/galera_ssl.test
new file mode 100644
index 00000000000..e6346aa2151
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl.test
@@ -0,0 +1,25 @@
+#
+# Test node connections over SSL. The accompanying galera_ssl.cnf has a customized
+# wsrep_provider_options setting that enables SSL.
+#
+# At this time, the actual operation of SSL is not visible only in the error log and not in SHOW STATUS.
+# So this test can only check that the cluster has formed and is replicating.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_ssl_compression.cnf b/mysql-test/suite/galera/t/galera_ssl_compression.cnf
new file mode 100644
index 00000000000..d6fd2c4d510
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl_compression.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;socket.ssl_compression=YES'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;socket.ssl_compression=YES'
diff --git a/mysql-test/suite/galera/t/galera_ssl_compression.test b/mysql-test/suite/galera/t/galera_ssl_compression.test
new file mode 100644
index 00000000000..75f92c5b2f4
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl_compression.test
@@ -0,0 +1,35 @@
+#
+# Test SSL compression. The accompanying galera_ssl_compression.cnf has a customized wsrep_provider_options setting that enables SSL and compression.
+#
+# Unfortunately there is no wire-level traffic bytes counter that would allow us to determine that compression kicked in, so we can only
+# perform a most basic replication check.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_2
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+
+# Check that the socket.ssl_compression provider option is not dynamic
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_provider_options = "socket.ssl_compression=No";
+
+CREATE TABLE t1 (f1 VARCHAR(333) PRIMARY KEY, f2 BLOB) Engine=InnoDB;
+INSERT INTO t1 VALUES (REPEAT('a', 333), REPEAT('b', 65535));
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('a', 333) AND f2 = REPEAT('b', 65535);
+
+--connection node_1
+DROP TABLE t1;
+
+CALL mtr.add_suppression("Unknown parameter 'socket\.ssl_compression'");
+CALL mtr.add_suppression("Set options returned 7");
diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf
new file mode 100644
index 00000000000..2954ae0f4cb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem'
diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.test b/mysql-test/suite/galera/t/galera_ssl_upgrade.test
new file mode 100644
index 00000000000..a424942da30
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.test
@@ -0,0 +1,49 @@
+#
+# Test upgrading the SSL certificates in a rolling fashion.
+#
+# 1. The starting state with the old key and cert is is described in galera_ssl_upgrade.cnf
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# 2. Restart node #1 with a socket.ssl_ca that includes both the new and the old certificate
+
+--connection node_1
+--source include/shutdown_mysqld.inc
+--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-key.pem
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# 3. Restart node #2 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+--let $start_mysqld_params = --wsrep_provider_options=base_port=$NODE_GALERAPORT_2;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-key.pem
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# 4. Restart node #1 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
+
+--connection node_1
+--source include/shutdown_mysqld.inc
+--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-key.pem
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Upgrade complete. Both nodes now use the new key and certificate
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf b/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf
new file mode 100644
index 00000000000..574ae28b54a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf
@@ -0,0 +1,11 @@
+!include ../galera_2nodes.cnf
+
+# We do not set mysqldump-related SST options here because doing so on startup
+# causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump.test b/mysql-test/suite/galera/t/galera_sst_mysqldump.test
new file mode 100644
index 00000000000..0b7171597dd
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump.test
@@ -0,0 +1,18 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source suite/galera/include/galera_sst_set_mysqldump.inc
+
+--source suite/galera/include/galera_st_disconnect_slave.inc
+
+# We set the required mysqldump SST options here so that they are used every time the server is restarted during the test
+--let $start_mysqld_params = --wsrep_sst_auth=sst:sst --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=127.0.0.1:$NODE_MYPORT_2 --skip-grant-tables
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_clean_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
+--source suite/galera/include/galera_sst_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf
new file mode 100644
index 00000000000..e108484b248
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf
@@ -0,0 +1,22 @@
+!include ../galera_2nodes.cnf
+
+# We do not set mysqldump-related SST options here because doing so on startup
+# causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld]
+wsrep_debug=ON
+
+ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+ssl-key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
+
+[client]
+ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
+ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem
+ssl-key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
new file mode 100644
index 00000000000..c813e04169f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
@@ -0,0 +1,29 @@
+#
+# Test mysqldump SST with client SSL key. See galera_sst_mysqldump_with_key.cnf for the configuration on the client side.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_openssl.inc
+
+--source suite/galera/include/galera_sst_set_mysqldump.inc
+
+--connection node_1
+CREATE USER sslsst;
+GRANT ALL PRIVILEGES ON *.* TO sslsst;
+GRANT USAGE ON *.* TO sslsst REQUIRE SSL;
+
+SET GLOBAL wsrep_sst_auth = 'sslsst:';
+
+--source suite/galera/include/galera_st_disconnect_slave.inc
+
+--source suite/galera/include/galera_sst_restore.inc
+DROP USER sslsst;
+
+--connection node_2
+# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
+# Otherwise MTR's check_testcases complains
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.cnf b/mysql-test/suite/galera/t/galera_sst_rsync.cnf
new file mode 100644
index 00000000000..93981d9daa7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync.cnf
@@ -0,0 +1,11 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.test b/mysql-test/suite/galera/t/galera_sst_rsync.test
new file mode 100644
index 00000000000..c6823795e59
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync.test
@@ -0,0 +1,9 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_clean_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf
new file mode 100644
index 00000000000..31bd1af07c2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf
@@ -0,0 +1,24 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[xtrabackup]
+backup-locks
+close-files
+compact
+# compression requires qpress from the Percona repositories
+# compress
+# compress-threads=2
+encryption=AES256
+encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4
+galera-info
+history=backup
+parallel=2
+
+[SST]
+encrypt=1
+encrypt-algo=AES256
+encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test
new file mode 100644
index 00000000000..4573f176482
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test
@@ -0,0 +1,13 @@
+#
+# This test checks that various options can be passed to xtrabackup via the my.cnf file
+# Initial SST happens via xtrabackup, so there is not much to do in the body of the test
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf
new file mode 100644
index 00000000000..47cb3e02292
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
new file mode 100644
index 00000000000..aac6822170a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
@@ -0,0 +1,19 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_clean_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf
new file mode 100644
index 00000000000..969516f5f3b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf
@@ -0,0 +1,11 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[SST]
+tkey=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
+tcert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+encrypt=3
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test
new file mode 100644
index 00000000000..24d9589d111
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test
@@ -0,0 +1,13 @@
+#
+# This test checks that key and cert encryption options can be passed to xtrabackup via the my.cnf file
+# Initial SST happens via xtrabackup, so there is not much to do in the body of the test
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_status_cluster.test b/mysql-test/suite/galera/t/galera_status_cluster.test
new file mode 100644
index 00000000000..3299613d584
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_status_cluster.test
@@ -0,0 +1,18 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# A simple test for the wsrep_cluster_* status variables
+#
+
+--connection node_1
+
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+
+--connection node_2
+
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+
+
diff --git a/mysql-test/suite/galera/t/galera_status_local_index.test b/mysql-test/suite/galera/t/galera_status_local_index.test
new file mode 100644
index 00000000000..b61b8ced863
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_status_local_index.test
@@ -0,0 +1,21 @@
+#
+# Test that a two-node cluster has distinct values for wsrep_local_index for its nodes
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE wsrep_local_indexes (wsrep_local_index INTEGER);
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+
+--connection node_2
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM wsrep_local_indexes;
+SELECT COUNT(DISTINCT wsrep_local_index) = 2 FROM wsrep_local_indexes;
+SELECT COUNT(*) = 0 FROM wsrep_local_indexes WHERE wsrep_local_index NOT IN (0, 1);
+
+DROP TABLE wsrep_local_indexes;
diff --git a/mysql-test/suite/galera/t/galera_status_local_state.test b/mysql-test/suite/galera/t/galera_status_local_state.test
new file mode 100644
index 00000000000..09cdb25f80c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_status_local_state.test
@@ -0,0 +1,28 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test wsrep_local_state . We can not reliably produce all possible statuses in MTR, but
+# we can at least test for the ones we can.
+#
+
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+SET GLOBAL wsrep_desync = 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 'Donor/Desynced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+SET GLOBAL wsrep_desync = 0;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_suspend_slave.test b/mysql-test/suite/galera/t/galera_suspend_slave.test
new file mode 100644
index 00000000000..aa4543cf81c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_suspend_slave.test
@@ -0,0 +1,64 @@
+##
+## This test tests that transactions on the master will fail if the slave
+## is made completely unresponsive by suspending the process. Resuming the
+## process should allow replication to continue to run.
+##
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+--let NODE_2_PIDFILE = `SELECT @@pid_file`
+--disconnect node_2
+
+--connection node_1
+--echo Suspending node_2 ...
+--perl
+ my $pid_filename = $ENV{'NODE_2_PIDFILE'};
+ my $mysqld_pid = `cat $pid_filename`;
+ chomp($mysqld_pid);
+ system("kill -SIGSTOP $mysqld_pid");
+ exit(0);
+EOF
+
+--error ER_UNKNOWN_COM_ERROR,ER_LOCK_WAIT_TIMEOUT,ER_LOCK_DEADLOCK,ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (1);
+
+--echo Resuming node_2 ...
+--perl
+ my $pid_filename = $ENV{'NODE_2_PIDFILE'};
+ my $mysqld_pid = `cat $pid_filename`;
+ chomp($mysqld_pid);
+ system("kill -SIGCONT $mysqld_pid");
+ exit(0);
+EOF
+
+SET SESSION wsrep_sync_wait = 1;
+--sleep 10
+--source include/wait_until_ready.inc
+INSERT INTO t1 VALUES (1);
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+
+SET SESSION wsrep_sync_wait = 1;
+--source include/wait_until_ready.inc
+SELECT COUNT(*) = 1 FROM t1;
+
+SET SESSION wsrep_sync_wait = 15;
+DROP TABLE t1;
+
+# Restore original auto_increment_offset values.
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
+
diff --git a/mysql-test/suite/galera/t/galera_sync_wait_show.test b/mysql-test/suite/galera/t/galera_sync_wait_show.test
new file mode 100644
index 00000000000..58de5433030
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sync_wait_show.test
@@ -0,0 +1,70 @@
+#
+# Test that the various SHOW commands obey wsrep_sync_wait - codership/mysql-wsrep#228
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+--connection node_2
+# MW-86 SHOW commands have now bitmap value 8
+SET SESSION wsrep_sync_wait = 8;
+
+
+--connection node_1
+CREATE DATABASE db1;
+
+--connection node_2
+SHOW CREATE DATABASE db1;
+DROP DATABASE db1;
+
+
+--connection node_1
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+
+--connection node_2
+SHOW CREATE PROCEDURE p1;
+DROP PROCEDURE p1;
+
+
+
+--connection node_1
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+
+--connection node_2
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+
+--connection node_1
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+
+--connection node_2
+SHOW CREATE FUNCTION f1;
+DROP FUNCTION f1;
+
+
+--connection node_1
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+
+--connection node_2
+SHOW FUNCTION CODE f1;
+DROP FUNCTION f1;
+
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
+
+--connection node_2
+SHOW CREATE TRIGGER tr1;
+DROP TABLE t1;
+
+
+--connection node_1
+CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
+
+--connection node_2
+SHOW CREATE EVENT event1;
+DROP EVENT event1;
diff --git a/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test b/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test
new file mode 100644
index 00000000000..641d2101c80
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test
@@ -0,0 +1,120 @@
+
+#
+# Test the operation of ALTER TABLE ... AUTO_INCREMENT
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+
+--connection node_2
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+
+ALTER TABLE t1 AUTO_INCREMENT = 1000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+
+--connection node_1
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+
+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000;
+
+--connection node_2
+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000;
+
+#
+# AUTO_INCREMENT set to a value lower than the current one.
+# The ALTER does nothing, the sequence continues from the current maximum.
+#
+
+--connection node_1
+ALTER TABLE t1 AUTO_INCREMENT = 5;
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+
+--connection node_2
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000;
+
+--connection node_1
+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000;
+
+DROP TABLE t1;
+
+#
+# Under wsrep_auto_increment_control = OFF
+#
+
+--connection node_1
+--let $auto_increment_control_orig = `SELECT @@wsrep_auto_increment_control`
+--let $auto_increment_increment_node1 = `SELECT @@auto_increment_increment`
+--let $auto_increment_offset_node1 = `SELECT @@auto_increment_offset`
+
+# Restore stock MySQL defaults
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+
+#Open a fresh connection to node_1 so that the variables above take effect
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_2
+--let $auto_increment_increment_node2 = `SELECT @@auto_increment_increment`
+--let $auto_increment_offset_node2 = `SELECT @@auto_increment_offset`
+
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+
+#Open a fresh connection to node_2
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+
+--connection node_1a
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+--connection node_2a
+
+ALTER TABLE t1 AUTO_INCREMENT=100;
+
+--connection node_1a
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+
+--connection node_2a
+INSERT INTO t1 (f2) SELECT 1 FROM ten;
+
+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1;
+
+--connection node_1a
+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1;
+
+DROP TABLE t1;
+
+#
+# Restore all variables as they were
+#
+
+--disable_query_log
+
+--connection node_1
+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig
+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node1
+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node1
+
+--connection node_2
+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig
+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node2
+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node2
+
+--enable_query_log
+
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_error.test b/mysql-test/suite/galera/t/galera_toi_ddl_error.test
new file mode 100644
index 00000000000..c586d97bdb5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_error.test
@@ -0,0 +1,29 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+#
+# Test the operation of DDLs that fail partway through
+#
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+# Insert 100K rows
+INSERT INTO t1 (f1) SELECT (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+# Insert one duplicate value
+INSERT INTO t1 (f1) SELECT MAX(f1) FROM t1;
+
+--connection node_2
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SHOW CREATE TABLE t1;
+
+--connection node_1
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test
new file mode 100644
index 00000000000..1f446938775
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test
@@ -0,0 +1,70 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+#
+# This test creates a new FK constraint while concurrent INSERTS are running
+#
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE parent (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ f2 INTEGER,
+ KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ parent_id INT
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (DEFAULT, 0);
+
+--connection node_2
+--send INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+--connection node_1a
+--send INSERT INTO parent (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+--send INSERT INTO parent (f2) SELECT 2 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--let $galera_connection_name = node_1b
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+--connection node_1b
+--sleep 2
+--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id);
+
+--connection node_1a
+--reap
+
+--connection node_1b
+--reap
+
+--connection node_2
+--reap
+
+--connection node_2a
+--reap
+
+--connection node_1
+SELECT COUNT(*) = 20001 FROM parent;
+SELECT COUNT(*) = 10000 FROM child;
+
+--connection node_2
+SELECT COUNT(*) = 20001 FROM parent;
+SELECT COUNT(*) = 10000 FROM child;
+
+DROP TABLE child;
+DROP TABLE parent;
+
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test b/mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test
new file mode 100644
index 00000000000..f42fae4ed51
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test
@@ -0,0 +1,49 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# This test creates a new FK constraint while an UPDATE is running
+#
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE parent (
+ id INT PRIMARY KEY,
+ KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ parent_id INT
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1);
+
+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_1
+--sleep 1
+--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;
+
+--connection node_2
+--sleep 1
+--send UPDATE parent SET id = 2 WHERE id = 1;
+
+--connection node_1
+--reap
+
+--connection node_2
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+
+--connection node_1
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+
+DROP TABLE child;
+DROP TABLE parent;
+
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_locking.test b/mysql-test/suite/galera/t/galera_toi_ddl_locking.test
new file mode 100644
index 00000000000..12c83a1f87a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_locking.test
@@ -0,0 +1,76 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+#
+# Test that DDL indeed causes all nodes to block so even unrelated updates
+# are not allowed to proceed. We block the DDL using DBUG_SYNC
+#
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+
+--connection node_1
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--let $galera_connection_name = node_1b
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+
+# Allowed
+SELECT COUNT(*) = 0 FROM t1;
+
+# Allowed
+SELECT COUNT(*) = 0 FROM t2;
+
+# Not allowed
+--error ER_LOCK_DEADLOCK,ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (1);
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+
+# Allowed
+INSERT INTO t2 VALUES (1);
+
+# Hangs
+--send COMMIT;
+--sleep 1
+
+--connection node_1b
+SET SESSION wsrep_sync_wait = 0;
+
+# The Commit issued above is still not done
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'Commit';
+SELECT COUNT(*) = 0 FROM t2;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1a
+--reap
+
+--connection node_1
+--reap
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+
+--connection node_1
+SET DEBUG_SYNC= 'RESET';
+
+--connection node_1b
+SET DEBUG_SYNC= 'RESET';
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test
new file mode 100644
index 00000000000..821f7a6eb2c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test
@@ -0,0 +1,30 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# In this test, we simultaneously send two non-conflicting ALTER TABLE statements
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+
+--connection node_2
+--send ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 123);
+
+--connection node_1
+--send CREATE UNIQUE INDEX i1 ON t1(f2);
+
+--connection node_2
+--reap
+INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 234);
+
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 2 FROM t1;
+
+--connection node_1
+--reap
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test b/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test
new file mode 100644
index 00000000000..51eae7005df
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test
@@ -0,0 +1,29 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# In this test, we send two ALTER TABLE statements that would only work if executed in the right order
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2, 3);
+
+--connection node_1
+ALTER TABLE t1 DROP COLUMN f2;
+INSERT INTO t1 VALUES (4);
+
+--connection node_2
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) = 3 FROM t1;
+SELECT * FROM t1 ORDER BY f1;
+
+--connection node_1
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) = 3 FROM t1;
+SELECT * FROM t1 ORDER BY f1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_toi_drop_database.test b/mysql-test/suite/galera/t/galera_toi_drop_database.test
new file mode 100644
index 00000000000..e790a0ba812
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_drop_database.test
@@ -0,0 +1,56 @@
+#
+# Test the operation of DDLs that affect multiple database objects
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE DATABASE database1;
+USE database1;
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+
+# Make sure autocommit retrying does not kick in as this will mask the error we expect to get
+SET SESSION wsrep_retry_autocommit = 0;
+# Attemp to insert 1M rows
+--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+
+--connection node_1a
+USE database1;
+SET SESSION wsrep_retry_autocommit = 0;
+--send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+
+--connection node_2
+--sleep 1
+--send DROP DATABASE database1;
+
+--connection node_1
+--sleep 1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_1a
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+--reap
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+--error ER_BAD_DB_ERROR
+USE database1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+--error ER_BAD_DB_ERROR
+USE database1;
diff --git a/mysql-test/suite/galera/t/galera_toi_ftwrl.test b/mysql-test/suite/galera/t/galera_toi_ftwrl.test
new file mode 100644
index 00000000000..4d0edefda8e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_ftwrl.test
@@ -0,0 +1,22 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# At this time, issing a FLUSH TABLES WITH READ LOCK on one node does not prevent DDLs from other nodes
+# from proceeding. The locked node will apply the DDL after it has been unlocked
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+FLUSH TABLES WITH READ LOCK;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_2
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test b/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test
new file mode 100644
index 00000000000..3c66286a3e6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test
@@ -0,0 +1,38 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Ensure that ALTER LOCK=EXCLUSIVE works under TOI. It is difficult to check that concurrent operations
+# are truly not possible, but at least we expect no hangs or deadlocks
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+# Start a transaction that is concurrent to the DDL. This is not strictly necessary for this test
+# but does put more locks into play.
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+--connection node_2a
+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=EXCLUSIVE;
+
+# In Galera, a concurrent transaction aborts in the face of ALTER
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+--connection node_1
+INSERT INTO t1 VALUES (2, 2);
+SELECT COUNT(*) = 2 FROM t1;
+
+--connection node_2
+INSERT INTO t1 VALUES (3, 3);
+SELECT COUNT(*) = 3 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_toi_lock_shared.test b/mysql-test/suite/galera/t/galera_toi_lock_shared.test
new file mode 100644
index 00000000000..6857a0e08ca
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_lock_shared.test
@@ -0,0 +1,23 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Ensure that ALTER LOCK=SHARED works under TOI. It is difficult to check that concurrent operations
+# will be possible, but at least we expect no hangs or deadlocks
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED;
+
+--connection node_1
+INSERT INTO t1 VALUES (2, 2);
+SELECT COUNT(*) = 2 FROM t1;
+
+--connection node_2
+INSERT INTO t1 VALUES (3, 3);
+SELECT COUNT(*) = 3 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_toi_truncate.test b/mysql-test/suite/galera/t/galera_toi_truncate.test
new file mode 100644
index 00000000000..59ef5c2028f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_toi_truncate.test
@@ -0,0 +1,43 @@
+#
+# Test the operation of TRUNCATE with concurrent DML.
+# The DML should be BF-aborted if the DDL arrives from another node
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# INSERT and TRUNCATE on different nodes
+#
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+# Insert 100K rows
+--connection node_2
+# Prevent autocommit retring from masking the deadlock error we expect to get
+SET SESSION wsrep_retry_autocommit = 0;
+--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+
+--connection node_1
+--sleep 1
+--send TRUNCATE TABLE t1;
+
+--connection node_1
+--reap
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM t1;
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_transaction_read_only.test b/mysql-test/suite/galera/t/galera_transaction_read_only.test
new file mode 100644
index 00000000000..386d73fd3ca
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_transaction_read_only.test
@@ -0,0 +1,58 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Ensure that transactions that do not write anything do not cause the wsrep_last_committed counter to advance
+#
+
+# Empty transaction
+
+--connection node_1
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+COMMIT;
+
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
+--enable_query_log
+
+# START TRANSACTION READ ONLY
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+START TRANSACTION READ ONLY;
+SELECT COUNT(*) = 0 FROM t1;
+COMMIT;
+
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
+--enable_query_log
+
+# Ordinary transaction with only SELECTs
+
+--connection node_1
+START TRANSACTION;
+SELECT COUNT(*) = 0 FROM t1;
+COMMIT;
+
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
+--enable_query_log
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/galera/t/galera_transaction_replay.test b/mysql-test/suite/galera/t/galera_transaction_replay.test
new file mode 100644
index 00000000000..29870829ba3
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_transaction_replay.test
@@ -0,0 +1,124 @@
+#
+# This test tests the operation of transaction replay. If a potentially conflicting remote transaction arrives at
+# just the right time during the commit of a local transaction, the local transaction will be aborted and replayed.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+
+# Block the commit
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send COMMIT;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--source include/galera_wait_sync_point.inc
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+
+# Wait for both transactions to be blocked
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Update_rows_log_event::find_row%';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+--source include/wait_condition.inc
+
+# Unblock the commit
+--connection node_1a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+# wsrep_local_replays has increased by 1
+--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+--disable_query_log
+--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old = 1 AS wsrep_local_replays;
+--enable_query_log
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+DROP TABLE t1;
+
+#echo "# test for PS replaying"
+
+#
+# test replaying of prepared statements
+#
+--connection node_1
+CREATE TABLE t1 (i int primary key, j int) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1, 0), (3, 0);
+SELECT * FROM t1;
+
+PREPARE stmt1 FROM "UPDATE t1 SET j = 1 where i > 0";
+
+# block the commit of PS
+--connection node_1a
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send EXECUTE stmt1;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--source include/galera_wait_sync_point.inc
+
+# Issue a conflicting update on node_2
+--connection node_2
+#UPDATE t1 SET j=2;
+INSERT INTO t1 VALUES(2,2);
+
+
+# Wait until applying begins in node_1
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Write_rows_log_event::write_row%';
+--source include/wait_condition.inc
+
+# Unblock the PS commit
+--connection node_1a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_truncate.test b/mysql-test/suite/galera/t/galera_truncate.test
new file mode 100644
index 00000000000..79f9bad1f1b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_truncate.test
@@ -0,0 +1,57 @@
+#
+# Test TRUNCATE
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Simple case
+#
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM t1;
+
+#
+# Table with no PK
+#
+
+--connection node_2
+CREATE TABLE t2 (f1 VARCHAR(255)) Engine=InnoDB;
+INSERT INTO t2 VALUES ('abc');
+
+--connection node_1
+TRUNCATE TABLE t2;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t2;
+
+#
+# Table with AUTO_INCREMENT. The AUTO_INCREMENT counter must be reset on all nodes
+#
+
+--connection node_1
+CREATE TABLE t3 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t3 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+
+CREATE TABLE t4 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB AUTO_INCREMENT=1234;
+INSERT INTO t4 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+
+TRUNCATE TABLE t3;
+TRUNCATE TABLE t4;
+
+--connection node_2
+SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t3', 't4');
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
diff --git a/mysql-test/suite/galera/t/galera_truncate_temporary.test b/mysql-test/suite/galera/t/galera_truncate_temporary.test
new file mode 100644
index 00000000000..3ad94eb9930
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_truncate_temporary.test
@@ -0,0 +1,82 @@
+#
+# Test TRUNCATE on TEMPORARY tables. It should not be replicated
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_2
+--error ER_NO_SUCH_TABLE
+SELECT * FROM t1;
+
+--connection node_1
+DROP TABLE t1;
+
+#
+# Test the case where a TEMPORARY table is masking an existing one
+#
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+
+SELECT f1 = 2 FROM t1;
+SELECT COUNT(*) = 1 FROM t1;
+
+TRUNCATE TABLE t1;
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT f1 = 1 FROM t1;
+
+--connection node_1
+
+DROP TABLE t1;
+SELECT COUNT(*) = 1 FROM t1;
+SELECT f1 = 1 FROM t1;
+
+TRUNCATE TABLE t1;
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+DROP TABLE t1;
+
+#
+# Test the case where one node has a TEMPORARY table but the TRUNCATE arrives from another node
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+TRUNCATE TABLE t1;
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+SELECT f1 = 2 FROM t1;
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+SELECT COUNT(*) = 0 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_udf-master.opt b/mysql-test/suite/galera/t/galera_udf-master.opt
new file mode 100644
index 00000000000..14dfe3e20bc
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_udf-master.opt
@@ -0,0 +1,2 @@
+$UDF_EXAMPLE_LIB_OPT
+--query_cache_type=1
diff --git a/mysql-test/suite/galera/t/galera_unicode_identifiers.test b/mysql-test/suite/galera/t/galera_unicode_identifiers.test
new file mode 100644
index 00000000000..f3df60a6415
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_unicode_identifiers.test
@@ -0,0 +1,72 @@
+#
+# Test non-ascii table, column and index names
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_sync_wait_orig = (SELECT @@wsrep_sync_wait)
+SET GLOBAL wsrep_sync_wait = 15;
+
+--connection node_2
+SET GLOBAL wsrep_sync_wait = 15;
+
+--connection node_1
+
+# Spaces in identifiers
+
+CREATE DATABASE `database with space`;
+USE `database with space`;
+CREATE TABLE `table with space` (
+ `column with space` INTEGER AUTO_INCREMENT PRIMARY KEY,
+ `second column with space` INTEGER,
+ UNIQUE `index name with space` (`second column with space`)
+);
+INSERT INTO `table with space` VALUES (1, 1);
+
+# Unicode identifiers
+
+CREATE DATABASE `база`;
+USE `база`;
+CREATE TABLE `таблица` (
+ `първа_колона` INTEGER PRIMARY KEY,
+ `втора_колона` INTEGER,
+ UNIQUE `индекÑ` (`втора_колона`)
+);
+
+INSERT INTO `таблица` VALUES (1, 1);
+
+# Without a PK
+
+CREATE DATABASE `втора база`;
+USE `втора база`;
+CREATE TABLE `втора таблица` (
+ `първа колона` INTEGER,
+ `втора колона` INTEGER,
+ KEY `първи индекÑ` (`първа колона`)
+);
+
+INSERT INTO `втора таблица` VALUES (1, 1);
+
+--connection node_2
+USE `database with space`;
+SELECT `second column with space` FROM `table with space`;
+
+USE `база`;
+SELECT * FROM `таблица`;
+
+USE `втора база`;
+SELECT `втора колона` FROM `втора таблица`;
+
+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
+
+--connection node_1
+DROP TABLE `database with space`.`table with space`;
+DROP TABLE `база`.`таблица`;
+DROP TABLE `втора база`.`втора таблица`;
+
+DROP DATABASE `database with space`;
+DROP DATABASE `база`;
+DROP DATABASE `втора база`;
+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
+
diff --git a/mysql-test/suite/galera/t/galera_unicode_pk.test b/mysql-test/suite/galera/t/galera_unicode_pk.test
new file mode 100644
index 00000000000..0d571f5cfd7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_unicode_pk.test
@@ -0,0 +1,64 @@
+#
+# Test non-ascii data in table where the PK is unicode
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (
+ f1 VARCHAR(255) PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 VALUES ('текÑÑ‚');
+
+--connection node_2
+SELECT f1 = 'текÑÑ‚' FROM t1;
+
+#
+# Provoke a conflict
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚2';
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'текÑÑ‚3';
+
+--connection node_1
+COMMIT;
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+SELECT f1 = 'текÑÑ‚2' FROM t1;
+SELECT f1 = 'текÑÑ‚2' FROM t1 WHERE f1 = 'текÑÑ‚2';
+
+#
+# Provoke a duplicate key error
+#
+
+--connection node_2
+START TRANSACTION;
+INSERT INTO t1 VALUES ('текÑÑ‚4');
+
+--connection node_1
+START TRANSACTION;
+INSERT INTO t1 VALUES ('текÑÑ‚4');
+
+--connection node_2
+COMMIT;
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+# Work around for mysql-wsrep#29 'Spurious deadlock error on a DROP TABLE'
+--error 0,ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_update_limit.test b/mysql-test/suite/galera/t/galera_update_limit.test
new file mode 100644
index 00000000000..baacf2a60b2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_update_limit.test
@@ -0,0 +1,55 @@
+#
+# UPDATE LIMIT should not cause any issues with row-based Galera replication
+# regardless of the order in which the rows were updated
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# With a PK
+#
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND();
+
+--connection node_2
+UPDATE IGNORE t1 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5;
+
+# Check that the sum of all elements and the max element are identical across nodes
+# as this will indicate that the same UPDATE was applied to both nodes
+
+--let $sum_rows = `SELECT SUM(f1) FROM t1`
+--let $max_row = `SELECT MAX(f1) FROM t1`
+
+--connection node_1
+--disable_query_log
+--eval SELECT (SELECT SUM(f1) FROM t1) = $sum_rows AS sum_matches;
+--eval SELECT f1 = $max_row AS max_matches FROM t1 WHERE f1 = $max_row;
+--enable_query_log
+
+DROP TABLE t1;
+
+#
+# Without a PK
+#
+
+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND();
+
+--connection node_2
+UPDATE IGNORE t2 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5;
+
+--let $sum_rows = `SELECT SUM(f1) FROM t2`
+
+--connection node_1
+--disable_query_log
+--eval SELECT (SELECT SUM(f1) FROM t2) = $sum_rows AS sum_matches;
+--enable_query_log
+
+DROP TABLE t2;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_v1_row_events-master.opt b/mysql-test/suite/galera/t/galera_v1_row_events-master.opt
new file mode 100644
index 00000000000..dc82542128e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_v1_row_events-master.opt
@@ -0,0 +1 @@
+--log-bin-use-v1-row-events=1
diff --git a/mysql-test/suite/galera/t/galera_v1_row_events.test b/mysql-test/suite/galera/t/galera_v1_row_events.test
new file mode 100644
index 00000000000..0c0a044510e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_v1_row_events.test
@@ -0,0 +1,21 @@
+#
+# Test that Galera continues to run even with --log-bin-use-v1-row-events=1
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_OSU_method.test b/mysql-test/suite/galera/t/galera_var_OSU_method.test
new file mode 100644
index 00000000000..fcf964c4f89
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_OSU_method.test
@@ -0,0 +1,45 @@
+#
+# Test that the wsrep_var_OSU_method variable can be changed in the middle of an ALTER without adverse effects.
+# In-depth testing of various OSU methods is implemented in separate tests.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET SESSION wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_2
+# The ALTER above is not visible on node_2
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_1
+SET SESSION wsrep_OSU_method = "TOI";
+
+--connection node_1
+SET DEBUG_SYNC= 'RESET';
+
+--connection node_1a
+SET DEBUG_SYNC= 'RESET';
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_OSU_method2.test b/mysql-test/suite/galera/t/galera_var_OSU_method2.test
new file mode 100644
index 00000000000..099e2cc6612
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_OSU_method2.test
@@ -0,0 +1,47 @@
+#
+# Test that the wsrep_var_OSU_method variable can be changed in the middle of an ALTER without adverse effects.
+# In-depth testing of various OSU methods is implemented in separate tests.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET SESSION wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (1,2);
+
+--connection node_2
+# The ALTER above is visible on node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (3,4);
+
+--connection node_1
+SET GLOBAL wsrep_OSU_method = "TOI";
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+
+--connection node_1a
+SET DEBUG_SYNC= 'RESET';
+
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test b/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test
new file mode 100644
index 00000000000..c0bbe5af8cf
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test
@@ -0,0 +1,105 @@
+#
+# Test wsrep_auto_increment_control = OFF
+# We issue two concurrent INSERTs and one will fail with a deadlock error
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $auto_increment_control_orig = `SELECT @@wsrep_auto_increment_control`
+
+#
+# Preserve existing variable values
+#
+
+--connection node_1
+--let $auto_increment_increment_node1 = `SELECT @@auto_increment_increment`
+--let $auto_increment_offset_node1 = `SELECT @@auto_increment_offset`
+
+# Restore stock MySQL defaults
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+
+#Open a fresh connection to node_1 so that the variables above take effect
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_2
+--let $auto_increment_increment_node2 = `SELECT @@auto_increment_increment`
+--let $auto_increment_offset_node2 = `SELECT @@auto_increment_offset`
+
+SET GLOBAL wsrep_auto_increment_control = OFF;
+SET GLOBAL auto_increment_increment = 1;
+SET GLOBAL auto_increment_offset = 1;
+
+#Open a fresh connection to node_2
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+
+--connection node_1a
+SELECT @@auto_increment_increment = 1;
+SELECT @@auto_increment_offset = 1;
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
+
+#
+# We expect that SHOW CREATE TABLE on both nodes will return identical values
+#
+
+SHOW CREATE TABLE t1;
+
+--connection node_2a
+
+SHOW CREATE TABLE t1;
+
+--connection node_1a
+SELECT @@auto_increment_increment = 1;
+SELECT @@auto_increment_offset = 1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (node) VALUES ('node1');
+SELECT f1 FROM t1;
+
+--connection node_2a
+SELECT @@auto_increment_increment = 1;
+SELECT @@auto_increment_offset = 1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (node) VALUES ('node2');
+SELECT f1 FROM t1;
+
+--connection node_1a
+COMMIT;
+
+--connection node_2a
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+--connection node_1a
+SELECT * FROM t1;
+
+--connection node_2a
+SELECT * FROM t1;
+
+#
+# Restore all variables as they were
+#
+
+--disable_query_log
+
+--connection node_1
+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig
+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node1
+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node1
+
+--connection node_2
+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig
+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node2
+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node2
+
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
new file mode 100644
index 00000000000..d65a35be4d1
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
@@ -0,0 +1,53 @@
+#
+# Test the operation of wsrep_auto_increment_control = ON
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
+
+# auto_increment_increment is equal to the number of nodes
+# auto_increment_offset is equal to the ID of the node
+
+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
+SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
+
+# Expect no conflicts
+--send INSERT INTO t1 VALUES (DEFAULT, 'node1');
+
+--connection node_2
+--send INSERT INTO t1 VALUES (DEFAULT, 'node2');
+
+--connection node_1
+--reap
+
+--connection node_2
+--reap
+
+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
+SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
+
+# Expect no conflicts
+--send INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2');
+
+--connection node_1
+--send INSERT INTO t1 VALUES (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1');
+
+--connection node_2
+--reap
+
+--connection node_1
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 22 FROM t1;
+SELECT COUNT(DISTINCT f1) = 22 FROM t1;
+
+--connection node_1
+SELECT COUNT(*) = 22 FROM t1;
+SELECT COUNT(DISTINCT f1) = 22 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test b/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test
new file mode 100644
index 00000000000..d2d16176e41
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test
@@ -0,0 +1,43 @@
+#
+# Test wsrep_certify_nonPK = OFF
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_certify_nonPK_orig = `SELECT @@wsrep_certify_nonPK`
+SET GLOBAL wsrep_certify_nonPK = OFF;
+
+--connection node_2
+SET GLOBAL wsrep_certify_nonPK = OFF;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB /* Table has no primary key */;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+# All DML without a PK is rejected with an error
+--error ER_LOCK_DEADLOCK,ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (1), (2);
+
+# DML with a PK is allowed to proceed
+INSERT INTO t2 VALUES (1), (2);
+UPDATE t2 SET f1 = 3 WHERE f1 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) = 2 FROM t2;
+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 3;
+
+--connection node_1
+--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig
+
+--connection node_2
+--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--connection node_1
+call mtr.add_suppression("SQL statement was ineffective");
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera_var_cluster_address.test b/mysql-test/suite/galera/t/galera_var_cluster_address.test
new file mode 100644
index 00000000000..03706bbbb12
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_cluster_address.test
@@ -0,0 +1,78 @@
+#
+# Check the handling of @@wsrep_cluster_address
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+#
+# Set to invalid value
+#
+
+--connection node_2
+--let $wsrep_cluster_address_node2 = `SELECT @@wsrep_cluster_address`
+SET GLOBAL wsrep_cluster_address = 'foo://';
+
+# With wsrep_sync_wait, this returns an error
+#--error ER_LOCK_WAIT_TIMEOUT
+#SHOW STATUS;
+
+SET SESSION wsrep_sync_wait=0;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+
+# Must return 'OFF'
+SHOW STATUS LIKE 'wsrep_ready';
+
+# Must return 'Non-primary'
+SHOW STATUS LIKE 'wsrep_cluster_status';
+
+# Must return 0 = 'Initialized'
+SHOW STATUS LIKE 'wsrep_local_state';
+SHOW STATUS LIKE 'wsrep_local_state_comment';
+
+--connection node_1
+--sleep 1
+# Node #1 thinks that it is now part of a single-node primary cluster
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+
+#
+# Reset everything as it was
+#
+
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node2';
+--enable_query_log
+
+--source include/wait_until_connected_again.inc
+
+--connection node_1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_2
+CALL mtr.add_suppression("Backend not supported: foo");
+CALL mtr.add_suppression("Failed to initialize backend using 'foo");
+CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo");
+CALL mtr.add_suppression("gcs connect failed: Socket type not supported");
+CALL mtr.add_suppression("wsrep::connect\\(\\) failed: 7");
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)");
+CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110");
+CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
+CALL mtr.add_suppression("gcs connect failed: Connection timed out");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/galera_var_desync_on.test b/mysql-test/suite/galera/t/galera_var_desync_on.test
new file mode 100644
index 00000000000..06c5d30a769
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_desync_on.test
@@ -0,0 +1,62 @@
+#
+# Test wsrep_desync = ON . Node should temporarily not participate in flow control
+# so even if fc_limit has been reached, the master should be able to continue to
+# commit transactions.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
+SET GLOBAL wsrep_desync = TRUE;
+
+# Block the slave applier thread
+FLUSH TABLES WITH READ LOCK;
+
+--connection node_1
+
+# Without wsrep_desync = TRUE it would not be possible to perform 10 inserts on the master with gcs.fc_limit=1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+INSERT INTO t1 VALUES (10);
+--sleep 1
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+# No updates have arrived after the FLUSH TABLES
+SELECT COUNT(*) = 1 FROM t1;
+
+# Resync the slave
+SET GLOBAL wsrep_desync = FALSE;
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
+--enable_query_log
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 1;
+# The slave is now fully caught up
+SELECT COUNT(*) = 10 FROM t1;
+
+--connection node_1
+INSERT INTO t1 VALUES (11);
+
+--connection node_2
+# Replication continues normally
+SELECT COUNT(*) = 11 FROM t1;
+
+CALL mtr.add_suppression("Protocol violation");
+DROP TABLE t1;
+
+--connection node_1
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
new file mode 100644
index 00000000000..cba8488b879
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
@@ -0,0 +1,76 @@
+#
+# Check the handling of @@wsrep_dirty_reads
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_2
+--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
+
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+
+SET @@global.wsrep_cluster_address = '';
+SET @@session.wsrep_dirty_reads=OFF;
+
+# Set wsrep_sync_wait to avoid ER_LOCK_WAIT_TIMEOUT.
+SET SESSION wsrep_sync_wait=0;
+
+# Must return 'OFF'
+SHOW STATUS LIKE 'wsrep_ready';
+
+# Must return 'Non-primary'
+SHOW STATUS LIKE 'wsrep_cluster_status';
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT * FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT 1 FROM t1;
+
+SET @@session.wsrep_dirty_reads=ON;
+
+SELECT * FROM t1;
+SELECT 1 FROM t1;
+
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+
+SET @@session.wsrep_dirty_reads=OFF;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+
+SELECT 1;
+
+--error ER_UNKNOWN_COM_ERROR
+USE information_schema;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
+
+--disable_query_log
+--eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved'
+--enable_query_log
+--source include/wait_until_connected_again.inc
+
+--connection node_1
+USE test;
+SELECT * FROM t1;
+# Cleanup
+DROP TABLE t1;
+
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+--echo # End of test
+
diff --git a/mysql-test/suite/galera/t/galera_var_fkchecks.test b/mysql-test/suite/galera/t/galera_var_fkchecks.test
new file mode 100644
index 00000000000..c771b50c06c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_fkchecks.test
@@ -0,0 +1,40 @@
+#
+# Test the operation on the foreign_key_checks variable
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent (
+ id INT PRIMARY KEY,
+ KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY,
+ parent_id INT,
+ FOREIGN KEY (parent_id)
+ REFERENCES parent(id)
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1);
+INSERT INTO child VALUES (1,1);
+
+SET SESSION foreign_key_checks = 0;
+
+INSERT INTO child VALUES (2,2);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM child WHERE id = 2;
+
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO child VALUES (3,3);
+
+SET SESSION foreign_key_checks = 0;
+DELETE FROM parent;
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM parent;
+
+DROP TABLE child;
+DROP TABLE parent;
diff --git a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.cnf b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.cnf
new file mode 100644
index 00000000000..d3c49470f41
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.cnf
@@ -0,0 +1,16 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+log-bin
+log-slave-updates
+
+[mysqld.1]
+gtid_domain_id=1
+wsrep_gtid_mode=ON
+wsrep_gtid_domain_id=9999
+
+[mysqld.2]
+gtid_domain_id=2
+wsrep_gtid_mode=ON
+#wsrep_gitd_domain_id value will be inherited from donor node (mysqld.1)
+#wsrep_gitd_domain_id=X
diff --git a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test
new file mode 100644
index 00000000000..c4127b4f655
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test
@@ -0,0 +1,53 @@
+# Test for @@wsrep_gtid_mode and @@wsrep_gtid_domain_id variables
+#
+# When @@wsrep_gtid_mode=ON, all DDL/DML commands and transactions that
+# are meant to be replicated over Galera cluster nodes are tagged with
+# galera gtid_domain_id (@@wsrep_gtid_domain_id), while others are tagged
+# with the local domain_id (@@gtid_domain_id).
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo # On node_1
+--connection node_1
+# print initial GTIDs
+source include/print_gtid.inc;
+
+--echo # On node_2
+--connection node_2
+# print initial GTIDs
+source include/print_gtid.inc;
+
+--echo # On node_1
+--connection node_1
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(i INT) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+SELECT * FROM t2;
+source include/print_gtid.inc;
+
+--echo # On node_2
+--connection node_2
+SELECT * FROM t1;
+source include/print_gtid.inc;
+
+--echo # On node_1
+--connection node_1
+INSERT INTO t2 VALUES(1);
+SELECT * FROM t2;
+source include/print_gtid.inc;
+
+--echo # On node_2
+--connection node_2
+SELECT * FROM t2;
+source include/print_gtid.inc;
+
+--echo # On node_1
+--connection node_1
+# Cleanup
+DROP TABLE t1, t2;
+
+--source include/galera_end.inc
+--echo # End of test
+
diff --git a/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
new file mode 100644
index 00000000000..c08483b63ad
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
@@ -0,0 +1,33 @@
+#
+# This test checks that innodb_disallow_writes works as expected
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Open a separate connection to be used to run SHOW PROCESSLIST
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL innodb_disallow_writes=ON;
+--send INSERT INTO t1 VALUES (1);
+
+--connection node_1a
+let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'INSERT INTO t1 VALUES (1)' AND State = 'query end';
+--source include/wait_condition.inc
+
+SET GLOBAL innodb_disallow_writes=OFF;
+
+--connection node_1
+--reap
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_load_data_splitting.test b/mysql-test/suite/galera/t/galera_var_load_data_splitting.test
new file mode 100644
index 00000000000..38dab0a981b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_load_data_splitting.test
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+--let $wsrep_load_data_splitting_orig = `SELECT @@wsrep_load_data_splitting`
+
+# Create a file for LOAD DATA with 95K entries
+--perl
+open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/galera_var_load_data_splitting.csv") or die;
+foreach my $i (1..95000) {
+ print FILE "$i\n";
+}
+EOF
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+# Record wsrep_last_committed as it was before LOAD DATA
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+SET GLOBAL wsrep_load_data_splitting = TRUE;
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/galera_var_load_data_splitting.csv' INTO TABLE t1;
+--enable_query_log
+
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+SELECT COUNT(*) = 95000 FROM t1;
+
+# LOAD-ing 95K rows causes 10 commits to be registered
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 10 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+--eval SET GLOBAL wsrep_load_data_splitting = $wsrep_load_data_splitting_orig;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_log_bin.cnf b/mysql-test/suite/galera/t/galera_var_log_bin.cnf
new file mode 100644
index 00000000000..f7f17e3720a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_log_bin.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+log-bin
+
diff --git a/mysql-test/suite/galera/t/galera_var_log_bin.test b/mysql-test/suite/galera/t/galera_var_log_bin.test
new file mode 100644
index 00000000000..1b1886b996d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_log_bin.test
@@ -0,0 +1,22 @@
+#
+# A simple test that confirms that Galera works with log-bin enabled, that is
+# when MySQL's binlog is in effect rather than the Galera 'dummy' implementation.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+UPDATE t1 SET f1 = 2 WHERE f1 = 1;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_max_ws_rows.test b/mysql-test/suite/galera/t/galera_var_max_ws_rows.test
new file mode 100644
index 00000000000..ab6a3390c06
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_max_ws_rows.test
@@ -0,0 +1,176 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+--let $wsrep_max_ws_rows_orig = `SELECT @@wsrep_max_ws_rows`
+SET GLOBAL wsrep_max_ws_rows = 4;
+
+# Test that wsrep_max_ws_rows is enforced with multi statement transactions
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (5);
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = 10 WHERE f2 = 4;
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 = 1;
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+
+# Test that wsrep_max_ws_rows is enforced on sigle statements
+
+SET GLOBAL wsrep_max_ws_rows = 5;
+INSERT INTO t1 (f2) VALUES (1),(2),(3),(4),(5);
+SET GLOBAL wsrep_max_ws_rows = 4;
+
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = f2 + 10;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) SELECT * FROM ten;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (10),(20),(30),(40),(50);
+SELECT COUNT(*) = 5 FROM t1;
+
+# Fewer than wsrep_max_ws_rows is OK
+
+SET GLOBAL wsrep_max_ws_rows = 10;
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 0 FROM t1;
+
+# Test a series of transactions
+
+--disable_query_log
+SET GLOBAL wsrep_max_ws_rows = 5;
+let $i= 100;
+while ($i)
+{
+ START TRANSACTION;
+ --eval INSERT INTO t1 (f2) VALUES ($i);
+ COMMIT;
+ dec $i;
+}
+--enable_query_log
+SET GLOBAL wsrep_max_ws_rows = 100;
+SELECT COUNT(*) = 100 FROM t1;
+DELETE FROM t1 WHERE f2 < 101;
+SELECT COUNT(*) = 0 FROM t1;
+
+# Test large statements
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 = 2;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+DELETE FROM t1 WHERE f2 = 2;
+
+SELECT COUNT(*) = 0 FROM t1;
+
+
+# Test that wsrep_max_ws_rows is reset when switching autocommit mode
+
+SET AUTOCOMMIT = ON;
+SET GLOBAL wsrep_max_ws_rows = 1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+
+
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+
+# Test that wsrep_max_ws_rows is reset on implicit commits
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+DROP TABLE t1;
+DROP TABLE ten;
+
+--echo #
+--echo # MDEV-11817: Altering a table with more rows than
+--echo # wsrep_max_ws_rows causes cluster to break when running
+--echo # Galera cluster in TOI mode
+--echo #
+--connection node_1
+CREATE TABLE t1(c1 INT)ENGINE = INNODB;
+SET GLOBAL wsrep_max_ws_rows= DEFAULT;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 SELECT * FROM t1;
+SET GLOBAL wsrep_max_ws_rows= 1;
+ALTER TABLE t1 CHANGE COLUMN c1 c1 BIGINT;
+
+--connection node_2
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
+
+--connection node_1
+
+--disable_query_log
+--eval SET GLOBAL wsrep_max_ws_rows = $wsrep_max_ws_rows_orig
+--enable_query_log
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera_var_max_ws_size.test b/mysql-test/suite/galera/t/galera_var_max_ws_size.test
new file mode 100644
index 00000000000..8eb93bda9be
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_max_ws_size.test
@@ -0,0 +1,46 @@
+#
+# This test sets wsrep_max_ws_size to a very low value and checks that the transaction is rejected
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine=InnoDB;
+
+--let $wsrep_max_ws_size_orig = `SELECT @@wsrep_max_ws_size`
+SET GLOBAL wsrep_max_ws_size = 1024;
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
+SELECT COUNT(*) = 0 FROM t1;
+
+#
+# Changing repl.max_ws_size also changes wsrep_max_ws_size
+#
+
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SELECT @@wsrep_max_ws_size = 10000;
+
+
+#
+# Changing wsrep_max_ws_size is equivalent to changing repl.max_ws_size
+#
+
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=20000';
+--let $provider_options = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+
+SET GLOBAL wsrep_max_ws_size = 20000;
+--let $provider_options_updated = `SELECT @@wsrep_provider_options`
+
+--disable_query_log
+--eval SELECT STRCMP('$provider_options', '$provider_options_updated') = 0 AS provider_options_match
+--enable_query_log
+
+--disable_query_log
+--eval SET GLOBAL wsrep_max_ws_size = $wsrep_max_ws_size_orig
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test b/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test
new file mode 100644
index 00000000000..642d939692c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test
@@ -0,0 +1,30 @@
+#
+# Simple test for the operation on the wsrep-mysql-replication-bundle
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_mysql_replication_bundle_orig = `SELECT @@wsrep_mysql_replication_bundle`
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+
+SET GLOBAL wsrep_mysql_replication_bundle = 2;
+
+--connection node_1
+# This statement will not be replicated immediately
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+
+--connection node_1
+--eval SET GLOBAL wsrep_mysql_replication_bundle = $wsrep_mysql_replication_bundle_orig
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_node_address.cnf b/mysql-test/suite/galera/t/galera_var_node_address.cnf
new file mode 100644
index 00000000000..0de0edaa396
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_node_address.cnf
@@ -0,0 +1,10 @@
+!include ../galera_4nodes.cnf
+
+[mysqld.2]
+wsrep_node_address=127.0.0.1
+
+[mysqld.3]
+wsrep_node_address=localhost
+
+[mysqld.4]
+wsrep_node_address=lo
diff --git a/mysql-test/suite/galera/t/galera_var_node_address.test b/mysql-test/suite/galera/t/galera_var_node_address.test
new file mode 100644
index 00000000000..3353652d8b9
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_node_address.test
@@ -0,0 +1,25 @@
+#
+# Test wsrep_node_address . The galera_var_node_address.cnf contains various settings for
+# wsrep_node_address, so in this test we simply confirm that the cluster has started up correctly.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+call mtr.add_suppression("WSREP: Stray state UUID msg: .* current group state WAIT_STATE_UUID .*");
+call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .* is not in state transfer (.*). Message ignored.");
+
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt b/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt
new file mode 100644
index 00000000000..70dfc98736b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt
@@ -0,0 +1 @@
+--wsrep_notify_cmd=$MYSQL_TEST_DIR/std_data/wsrep_notify.sh --wsrep-sync-wait=0
diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd.test b/mysql-test/suite/galera/t/galera_var_notify_cmd.test
new file mode 100644
index 00000000000..4fea69f62bb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_notify_cmd.test
@@ -0,0 +1,14 @@
+#
+# Test wsrep_notify_cmd. We use a version of the support-files/wsrep_notify.sh script that writes
+# notifications into a table.
+#
+
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+--connection node_1
+SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
+SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status;
+SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status;
+
+DROP SCHEMA mtr_wsrep_notify;
diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test
new file mode 100644
index 00000000000..a9811283918
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test
@@ -0,0 +1,21 @@
+#
+# Simple test for wsrep-replicate-myisam = FALSE
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam`
+
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test
new file mode 100644
index 00000000000..90c786f0af0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test
@@ -0,0 +1,149 @@
+#
+# Simple test for wsrep-replicate-myisam = ON
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam`
+
+--connection node_1
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+--connection node_2
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+
+#
+# Simple INSERT
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2), (3);
+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
+
+--connection node_2
+SELECT COUNT(*) = 5 FROM t1;
+
+DROP TABLE t1;
+
+#
+# REPLACE
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(100)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1, 'abc'),(2,'abc'), (3, 'xxx');
+REPLACE INTO t1 VALUES (1, 'klm'), (2,'xyz');
+REPLACE INTO t1 SELECT 3, 'yyy' FROM DUAL;
+
+--connection node_2
+SELECT COUNT(*) = 3 FROM t1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1 AND f2 = 'klm';
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2 AND f2 = 'xyz';
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3 AND f2 = 'yyy';
+
+#
+# UPDATE
+#
+
+--connection node_1
+UPDATE t1 SET f2 = 'zzz' WHERE f2 = 'yyy';
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'zzz';
+
+#
+# DELETE
+#
+
+--connection node_1
+DELETE FROM t1 WHERE f2 = 'zzz';
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'zzz';
+
+#
+# TRUNCATE
+#
+
+--connection node_1
+TRUNCATE TABLE t1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+DROP TABLE t1;
+
+#
+# Transaction
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+COMMIT;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+
+#
+# Transaction rollback
+#
+
+--connection node_1
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t2 VALUES (2);
+ROLLBACK;
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+#
+# Transaction conflict
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (f2 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+# The MyISAM update is replicated immediately, so a duplicate key error happens even before the COMMIT
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1);
+
+--connection node_1
+COMMIT;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #
+--echo # MDEV-11152: wsrep_replicate_myisam: SELECT gets replicated using TO
+--echo #
+--connection node_1
+CREATE TABLE t1 (i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+# This command should not get replicated.
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--connection node_1
+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
+
+--connection node_2
+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
new file mode 100644
index 00000000000..bf4da3234c5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
@@ -0,0 +1,98 @@
+#
+# Test that the wsrep_retry_autocommit variable is respected. We use an INSERT that
+# proceeds very slowly due to extra SLEEP() in a trigger
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5);
+
+#
+# With wsrep_retry_autocommit = 0, error is certain
+#
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 0;
+--send INSERT INTO t1 (f1) VALUES (1),(2);
+
+--connection node_2
+--sleep 1
+TRUNCATE TABLE t1;
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+#
+# With wsrep_retry_autocommit = 1, success against one TRUNCATE
+#
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 1;
+--send INSERT INTO t1 (f1) VALUES (3),(4);
+
+--connection node_2
+--sleep 1
+TRUNCATE TABLE t1;
+
+--connection node_1
+--error 0
+--reap
+SELECT * FROM test.t1;
+
+#
+# With wsrep_retry_autocommit = 1, failure against multiple TRUNCATEs
+#
+
+--connection node_2
+DELIMITER |;
+CREATE PROCEDURE repeated_truncate ()
+BEGIN
+ DECLARE i INT;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+
+ SET i = 0;
+ WHILE i <= 1000 DO
+ TRUNCATE TABLE t1;
+ SET i = i + 1;
+ END WHILE;
+END|
+DELIMITER ;|
+
+# Begin streaming TRUNCATEs
+--let $truncate_connection_id = `SELECT CONNECTION_ID()`
+--send CALL repeated_truncate()
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 1;
+--sleep 1
+--error ER_LOCK_DEADLOCK
+INSERT INTO t1 (f1) VALUES (5),(6);
+
+#
+# With wsrep_retry_autocommit = 1024, success against multiple TRUNCATEs
+#
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 1024;
+--send INSERT INTO t1 (f1) VALUES (7),(8);
+
+--sleep 6
+
+# Once he stream of TRUNCATEs is complete
+--connection node_2
+--reap
+
+# the INSERT will eventually be sucessfull
+--connection node_1
+--error 0
+--reap
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+DROP TABLE t1;
+DROP PROCEDURE repeated_truncate;
diff --git a/mysql-test/suite/galera/t/galera_var_slave_threads.test b/mysql-test/suite/galera/t/galera_var_slave_threads.test
new file mode 100644
index 00000000000..5e56800c5d6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_slave_threads.test
@@ -0,0 +1,84 @@
+#
+# This tests the very basic operations around wsrep-slave-threads
+# More complex scenarios will be tested separately in the context of
+# parallel replication
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+CALL mtr.add_suppression("WSREP: Refusing exit for the last slave thread.");
+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
+
+--connection node_1
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+CREATE TABLE t2 (f1 INT AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB;
+
+--connection node_2
+
+# Setting wsrep_slave_threads to zero triggers a warning
+SET GLOBAL wsrep_slave_threads = 0;
+SHOW WARNINGS;
+SELECT @@wsrep_slave_threads = 1;
+
+SET GLOBAL wsrep_slave_threads = 1;
+# There is a separate wsrep_aborter thread at all times
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
+
+#
+# Increase the number of slave threads. The change takes effect immediately
+#
+
+SET GLOBAL wsrep_slave_threads = 64;
+--sleep 0.5
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
+
+#
+# Reduce the number of slave threads. The change is not immediate -- a thread will only exit after a replication event
+#
+
+SET GLOBAL wsrep_slave_threads = 1;
+
+--connection node_1
+
+# Generate 64 replication events
+--let $count = 64
+while ($count)
+{
+ INSERT INTO t2 VALUES (DEFAULT);
+ --dec $count
+}
+
+--connection node_2
+SELECT COUNT(*) = 64 FROM t2;
+
+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
+
+
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #
+--echo # lp:1372840 - Changing wsrep_slave_threads causes future connections to hang
+--echo #
+
+--connection node_1
+CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=INNODB;
+
+--connection node_2
+SET GLOBAL wsrep_slave_threads = 4;
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
+
+--echo # End of tests
diff --git a/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-test/suite/galera/t/galera_var_sync_wait.test
new file mode 100644
index 00000000000..ecb0d92b891
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test
@@ -0,0 +1,53 @@
+#
+# Simple test for the various levels of wsrep-sync-wait
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file
+--echo #
+# galera_2nodes.cnf sets wsrep_sync_wait to 7
+SELECT @@global.wsrep_sync_wait;
+SELECT @@global.wsrep_causal_reads;
+
+--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait`
+
+--connection node_1
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+
+--connection node_2
+SET GLOBAL wsrep_sync_wait = 1;
+# Those statements should see the table
+
+# MW-86 SHOW commands have now their own bitmask
+# SHOW TABLES LIKE '%t1';
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+CREATE TABLE t2 (f1 INT PRIMARY KEY) Engine=InnoDB;
+
+--connection node_2
+SET GLOBAL wsrep_sync_wait = 4;
+# This insert should see the table and succeed
+INSERT INTO t2 VALUES (1);
+
+--connection node_1
+CREATE TABLE t3 (f1 INT PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t3 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_sync_wait = 2;
+# This statement should see and update 1 row
+--enable_info
+UPDATE t3 SET f1 = 2;
+--disable_info
+
+--connection node_2
+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test
new file mode 100644
index 00000000000..783b78792e6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test
@@ -0,0 +1,32 @@
+#
+# Test wsrep_on = OFF. Some events will not be replicated
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_on = FALSE;
+
+# This statement will not be replicated
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+SET GLOBAL wsrep_on = TRUE;
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+
+# Middle insert is not replicated
+SELECT COUNT(*) = 0 FROM t1 WHERE f1 = 2;
+
+# Final insert is replicated
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/galera/t/galera_wan.cnf b/mysql-test/suite/galera/t/galera_wan.cnf
new file mode 100644
index 00000000000..0effd59403b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wan.cnf
@@ -0,0 +1,14 @@
+!include ../galera_4nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;gmcast.segment=1'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;gmcast.segment=1'
+
+[mysqld.3]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;gmcast.segment=2'
+
+[mysqld.4]
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M;gmcast.segment=3'
+
diff --git a/mysql-test/suite/galera/t/galera_wan.test b/mysql-test/suite/galera/t/galera_wan.test
new file mode 100644
index 00000000000..a8fd351b168
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wan.test
@@ -0,0 +1,30 @@
+#
+# Test WAN replication and the gmcast.segment functionality.
+# The galera_wan.cnf file partitions 4 Galera nodes into 3 WAN segments
+#
+# We can not test any of the actual WAN optimizations from inside MTR and no
+# status variables are provided. So we only check that simple replication works.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+INSERT INTO t1 VALUES (1);
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+--connection node_4
+SELECT VARIABLE_VALUE LIKE '%gmcast.segment = 3%' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_provider_options';
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
diff --git a/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf b/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf
new file mode 100644
index 00000000000..3f7d2a2448f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf
@@ -0,0 +1,14 @@
+!include ../galera_4nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1'
+
+[mysqld.3]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2'
+
+[mysqld.4]
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2'
+
diff --git a/mysql-test/suite/galera/t/galera_wan_restart_ist.test b/mysql-test/suite/galera/t/galera_wan_restart_ist.test
new file mode 100644
index 00000000000..1cf5d4c7f74
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wan_restart_ist.test
@@ -0,0 +1,161 @@
+#
+# Test that even after multiple restarts in a WAN context with two segments, the cluster continues to operate correctly.
+#
+# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
+# to be down at the same time, so restarts are sequential.
+#
+# We can not test any of the actual WAN optimizations from inside MTR and no
+# status variables are provided. So we only check that simple replication works.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--let $node_3=node_3
+--let $node_4=node_4
+--source include/auto_increment_offset_save.inc
+
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+INSERT INTO t1 VALUES (2);
+
+--connection node_3
+INSERT INTO t1 VALUES (3);
+
+--connection node_4
+INSERT INTO t1 VALUES (4);
+
+#
+# Restart node #3
+#
+
+--connection node_3
+INSERT INTO t1 VALUES (13);
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+--sleep 5
+
+--connection node_1
+INSERT INTO t1 VALUES (11);
+
+--connection node_2
+INSERT INTO t1 VALUES (12);
+
+--connection node_4
+INSERT INTO t1 VALUES (14);
+
+--connection node_3
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (131);
+
+#
+# Restart node #2
+#
+
+--connection node_2
+INSERT INTO t1 VALUES (22);
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+--sleep 5
+
+--connection node_1
+INSERT INTO t1 VALUES (21);
+
+--connection node_3
+INSERT INTO t1 VALUES (23);
+
+--connection node_4
+INSERT INTO t1 VALUES (24);
+
+--connection node_2
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (221);
+
+#
+# Restart node #4
+#
+
+--connection node_4
+INSERT INTO t1 VALUES (34);
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+--sleep 5
+
+--connection node_1
+INSERT INTO t1 VALUES (31);
+
+--connection node_2
+INSERT INTO t1 VALUES (32);
+
+--connection node_3
+INSERT INTO t1 VALUES (33);
+
+--connection node_4
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (341);
+
+
+#
+# Check all nodes
+#
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_2
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_3
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_4
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_1
+DROP TABLE t1;
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+
+--connection node_2
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_3
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_4
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf b/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf
new file mode 100644
index 00000000000..3f7d2a2448f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf
@@ -0,0 +1,14 @@
+!include ../galera_4nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1'
+
+[mysqld.3]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2'
+
+[mysqld.4]
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2'
+
diff --git a/mysql-test/suite/galera/t/galera_wan_restart_sst.test b/mysql-test/suite/galera/t/galera_wan_restart_sst.test
new file mode 100644
index 00000000000..9b12eeed1ac
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wan_restart_sst.test
@@ -0,0 +1,149 @@
+#
+# Test that even after multiple restarts in a WAN context with two segments, the cluster continues to operate correctly.
+#
+# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
+# to be down at the same time, so restarts are sequential.
+#
+# We can not test any of the actual WAN optimizations from inside MTR and no
+# status variables are provided. So we only check that simple replication works.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+INSERT INTO t1 VALUES (2);
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+INSERT INTO t1 VALUES (3);
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+--connection node_4
+INSERT INTO t1 VALUES (4);
+
+#
+# Restart node #3
+#
+
+--connection node_3
+INSERT INTO t1 VALUES (13);
+
+--source include/kill_galera.inc
+--sleep 5
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (11);
+
+--connection node_2
+INSERT INTO t1 VALUES (12);
+
+--connection node_4
+INSERT INTO t1 VALUES (14);
+
+--connection node_3
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (131);
+
+#
+# Restart node #2
+#
+
+--connection node_2
+INSERT INTO t1 VALUES (22);
+
+--source include/kill_galera.inc
+--sleep 5
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (21);
+
+--connection node_3
+INSERT INTO t1 VALUES (23);
+
+--connection node_4
+INSERT INTO t1 VALUES (24);
+
+--connection node_2
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (221);
+
+#
+# Restart node #4
+#
+
+--connection node_4
+INSERT INTO t1 VALUES (34);
+
+--source include/kill_galera.inc
+--sleep 5
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (31);
+
+--connection node_2
+INSERT INTO t1 VALUES (32);
+
+--connection node_3
+INSERT INTO t1 VALUES (33);
+
+--connection node_4
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (341);
+
+
+#
+# Check all nodes
+#
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_2
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_3
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_4
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_1
+DROP TABLE t1;
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+CALL mtr.add_suppression("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+
+--connection node_2
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_3
+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_4
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
diff --git a/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test b/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test
new file mode 100644
index 00000000000..3c7988a4924
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test
@@ -0,0 +1,57 @@
+#
+# Test the wsrep_desync + wsrep_on method for schema upgrades discussed at
+# http://www.slideshare.net/Severalnines/schema-upgrades-codershippresodec2013 , slide 30
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+# Insert some values before the ALTER
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+SET GLOBAL wsrep_desync = TRUE;
+SET SESSION wsrep_on = FALSE;
+
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+
+SET SESSION wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+
+# Insert even more data after the ALTER has completed
+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+SELECT COUNT(*) = 200000 FROM t1;
+SELECT MAX(f1) = 199999 FROM t1;
+
+--connection node_1
+SELECT COUNT(*) = 200000 FROM t1;
+SELECT MAX(f1) = 199999 FROM t1;
+
+SET GLOBAL wsrep_desync = TRUE;
+SET SESSION wsrep_on = FALSE;
+
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+
+SET SESSION wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+
+# Insert some conflicting values after the ALTER has been applied on all nodes.
+
+--connection node_2
+--error ER_DUP_ENTRY
+INSERT INTO t1 (f1) VALUES (1);
+
+--connection node_1
+--error ER_DUP_ENTRY
+INSERT INTO t1 (f1) VALUES (100);
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt b/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt
new file mode 100644
index 00000000000..930c483bd64
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt
@@ -0,0 +1 @@
+--wsrep_log_conflicts=ON
diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts.test b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.test
new file mode 100644
index 00000000000..3af08cbf637
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.test
@@ -0,0 +1,55 @@
+#
+# Test --wsrep_log_conflicts=ON
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (
+ f1 VARCHAR(255) PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 VALUES ('abc');
+
+--connection node_2
+SELECT f1 = 'abc' FROM t1;
+
+#
+# Provoke a conflict
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'klm';
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'xyz';
+
+--connection node_1
+COMMIT;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--let $wait_condition = SELECT f1 = 'klm' FROM t1;
+--source include/wait_condition.inc
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+#
+# We can not really check the log output very much because it is quite variable
+#
+
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = CURRENT_TEST
+
+--let $assert_text = cluster conflict due to high priority abort for threads
+--let $assert_select = cluster conflict due to high priority abort for threads
+--let $assert_match = cluster conflict due to high priority abort for threads
+--source include/assert_grep.inc
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt b/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt
new file mode 100644
index 00000000000..c31150c46af
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt
@@ -0,0 +1 @@
+--wsrep-new-cluster
diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
new file mode 100644
index 00000000000..6ba8ce786c8
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
@@ -0,0 +1,24 @@
+#
+# Test the --wsrep-new-cluster option by putting it in the galera_wsrep_new_cluster-master.opt file
+#
+# In MTR, running two nodes, the result is two separate clusters of size 1
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+--connection node_2
+
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
diff --git a/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test
new file mode 100644
index 00000000000..fe1abcf6c35
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test
@@ -0,0 +1,20 @@
+#
+# PXC-318: Typo in wsrep_provider_options causes an unhandled exception
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--let LOGF=$MYSQLTEST_VARDIR/log/mysqld.1.err
+--disable_info
+call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
+call mtr.add_suppression("WSREP\: Set options returned 7");
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
+# Search for unhandled exception message.
+perl;
+ use strict;
+ my $logf= $ENV{'LOGF'} or die "LOGF not set";
+ open(FILE, "$logf") or die("Unable to open $logf: $!\n");
+ my $count_warnings=grep(/terminate called after throwing an instance of /gi,<FILE>);
+ print "Unhandled exceptions: $count_warnings\n";
+ close(FILE);
+EOF
diff --git a/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test b/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test
new file mode 100644
index 00000000000..7f91495fcc4
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test
@@ -0,0 +1,50 @@
+#
+# Test that wsrep_provider can be unset and then set back to its original value
+# and replication will continue except for any updates made while the value was 'none'
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--let $wsrep_provider_orig = `SELECT @@wsrep_provider`
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+SET SESSION wsrep_sync_wait = 0;
+
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+
+INSERT INTO t1 VALUES (4);
+
+# Node #2 has all the inserts
+SELECT COUNT(*) = 4 FROM t1;
+
+--connection node_1
+# Node #1 is missing the insert made while Node #2 was not replicated
+SELECT COUNT(*) = 3 FROM t1;
+
+DROP TABLE t1;
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_zero_length_column.test b/mysql-test/suite/galera/t/galera_zero_length_column.test
new file mode 100644
index 00000000000..6ae81a83271
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_zero_length_column.test
@@ -0,0 +1,41 @@
+#
+# Test columns with size zero. This is known to have tripped other storage engines.
+# Keys are not allowed on such columns
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY , f2 VARCHAR(0)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 VARCHAR(0)) ENGINE=InnoDB;
+
+
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, '');
+
+INSERT INTO t2 VALUES (NULL);
+INSERT INTO t2 VALUES ('');
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+SELECT f2 IS NULL FROM t1 WHERE f1 = 1;
+SELECT f2 = '' FROM t1 WHERE f1 = 2;
+
+SELECT COUNT(*) = 2 FROM t2;
+SELECT f1 IS NULL FROM t2 WHERE f1 IS NULL;
+SELECT f1 = '' FROM t2 WHERE f1 IS NOT NULL;
+
+UPDATE t1 SET f2 = '' WHERE f1 = 1;
+UPDATE t1 SET f2 = NULL WHERE f1 = 2;
+
+UPDATE t2 SET f1 = '' WHERE f1 IS NULL;
+
+--connection node_1
+SELECT f2 = '' FROM t1 WHERE f1 = 1;
+SELECT f2 IS NULL FROM t1 WHERE f1 = 2;
+
+SELECT COUNT(*) = 2 FROM t2 WHERE f1 = '';
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/grant.test b/mysql-test/suite/galera/t/grant.test
new file mode 100644
index 00000000000..de1c202cfbb
--- /dev/null
+++ b/mysql-test/suite/galera/t/grant.test
@@ -0,0 +1,25 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV#6266: Changing password fails on galera cluster
+--echo #
+
+--echo
+--echo # On node_1
+--connection node_1
+GRANT SELECT ON *.* TO 'user_6266'@'localhost' IDENTIFIED BY 'pass';
+--echo
+--echo # Now, try changing password for 'user_6266'. This command should also
+--echo # execute successfully on the other node.
+SET PASSWORD FOR 'user_6266'@'localhost' = PASSWORD('newpass');
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT user FROM mysql.user WHERE user='user_6266';
+# cleanup
+DROP USER 'user_6266'@'localhost';
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/lp1276424.test b/mysql-test/suite/galera/t/lp1276424.test
new file mode 100644
index 00000000000..a37e950b6a1
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp1276424.test
@@ -0,0 +1,17 @@
+#
+# LP:1276424 Deadlock with insertion of NULL unique ke
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INT DEFAULT NULL, UNIQUE KEY i1 (f1)) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+SELECT f1 IS NULL FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/lp1347768.test b/mysql-test/suite/galera/t/lp1347768.test
new file mode 100644
index 00000000000..96d42867c6a
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp1347768.test
@@ -0,0 +1,24 @@
+#
+# LP:1347768 Assertion failure in file ha_innodb.cc line 6759
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE `r8kmb_redirect_links` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `old_url` varchar(255) DEFAULT NULL,
+ `new_url` varchar(255) NOT NULL,
+ `referer` varchar(150) NOT NULL,
+ `comment` varchar(255) NOT NULL,
+ `published` tinyint(4) NOT NULL,
+ `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_link_old` (`old_url`),
+ KEY `idx_link_modifed` (`modified_date`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO r8kmb_redirect_links VALUES (550,'http://mysite.com/images/download/ßуñûічýøù_ôþóþòір_þфõÑ.doc','','','',0,'2013-07-15 14:29:42','0000-00-00 00:00:00');
+
+DROP TABLE r8kmb_redirect_links;
diff --git a/mysql-test/suite/galera/t/lp1376747-2.test b/mysql-test/suite/galera/t/lp1376747-2.test
new file mode 100644
index 00000000000..360681d7674
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp1376747-2.test
@@ -0,0 +1,22 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/lp1376747-3.test b/mysql-test/suite/galera/t/lp1376747-3.test
new file mode 100644
index 00000000000..75fe7d276cd
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp1376747-3.test
@@ -0,0 +1,28 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLE WITH READ LOCK;
+--echo ### This shouldn't block.
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+
+--connection node_1
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/lp1376747-4.test b/mysql-test/suite/galera/t/lp1376747-4.test
new file mode 100644
index 00000000000..0c707d6d681
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp1376747-4.test
@@ -0,0 +1,53 @@
+#
+# Test Flush tables with read lock along with
+# flush tables <table> with read lock for compatibility.
+# Also, making sure all DDL and DMLs are propagated
+# after provider is unpaused
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+FLUSH TABLE WITH READ LOCK;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2a
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+SHOW CREATE TABLE t1;
+--sleep 1
+--send FLUSH TABLES t1 WITH READ LOCK;
+
+--connection node_2
+# let the flush table wait in pause state before we unlock
+# table otherwise there is window where-in flush table is
+# yet to wait in pause and unlock allows alter table to proceed.
+# this is because send in asynchronous.
+--sleep 3
+# this will release existing lock but will not resume
+# the cluster as there is new FTRL that is still pausing it.
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+
+--connection node_2a
+--reap
+UNLOCK TABLES;
+--sleep 2
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/lp1376747.test b/mysql-test/suite/galera/t/lp1376747.test
new file mode 100644
index 00000000000..769bb665c77
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp1376747.test
@@ -0,0 +1,24 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLES t1 WITH READ LOCK;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--sleep 2
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/lp1438990.test b/mysql-test/suite/galera/t/lp1438990.test
new file mode 100644
index 00000000000..5d54c3338e5
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp1438990.test
@@ -0,0 +1,38 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+
+
+DELIMITER |;
+
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK TO event_logging;
+ INSERT t3 VALUES (x);
+ END;
+ SAVEPOINT event_logging;
+
+ INSERT INTO t2 VALUES (x);
+
+ RELEASE SAVEPOINT event_logging;
+END|
+DELIMITER ;|
+
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+DROP PROCEDURE p1;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-test/suite/galera/t/lp959512.test b/mysql-test/suite/galera/t/lp959512.test
new file mode 100644
index 00000000000..bcc0db24ea7
--- /dev/null
+++ b/mysql-test/suite/galera/t/lp959512.test
@@ -0,0 +1,26 @@
+#
+# LP#959512 IO cache not reset at trx cleanup if write set was empty Edit
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+DROP TABLE IF EXISTS variable;
+DROP TABLE IF EXISTS foo;
+CREATE TABLE variable (
+ name varchar(128) NOT NULL DEFAULT '' COMMENT 'The name of the variable.',
+ value longblob NOT NULL COMMENT 'The value of the variable.',
+ PRIMARY KEY (name)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Named variable/value pairs created by Drupal core or any...';
+CREATE TABLE foo (a int);
+INSERT INTO variable (name, value) VALUES ('menu_expanded', 'a:0:{}');
+START TRANSACTION;
+SELECT 1 AS expression FROM variable variable
+ WHERE ( (name = 'menu_expanded') ) FOR UPDATE;
+UPDATE variable SET value='a:0:{}' WHERE ( (name = 'menu_expanded') );
+COMMIT;
+INSERT INTO foo VALUES (1);
+UPDATE foo SET a = 2 WHERE a = 1;
+
+DROP TABLE foo;
+DROP TABLE variable;
diff --git a/mysql-test/suite/galera/t/mdev_10518.cnf b/mysql-test/suite/galera/t/mdev_10518.cnf
new file mode 100644
index 00000000000..482334c2f8a
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev_10518.cnf
@@ -0,0 +1,17 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+log-bin
+log-slave-updates
+
+[mysqld.1]
+gtid_domain_id=1
+wsrep_gtid_mode=ON
+# Maximum allowed wsrep_gtid_domain_id.
+wsrep_gtid_domain_id=4294967295
+
+[mysqld.2]
+gtid_domain_id=2
+wsrep_gtid_mode=ON
+#wsrep_gitd_domain_id value will be inherited from donor node (mysqld.1)
+#wsrep_gitd_domain_id=X
diff --git a/mysql-test/suite/galera/t/mdev_10518.test b/mysql-test/suite/galera/t/mdev_10518.test
new file mode 100644
index 00000000000..c4127b4f655
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev_10518.test
@@ -0,0 +1,53 @@
+# Test for @@wsrep_gtid_mode and @@wsrep_gtid_domain_id variables
+#
+# When @@wsrep_gtid_mode=ON, all DDL/DML commands and transactions that
+# are meant to be replicated over Galera cluster nodes are tagged with
+# galera gtid_domain_id (@@wsrep_gtid_domain_id), while others are tagged
+# with the local domain_id (@@gtid_domain_id).
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo # On node_1
+--connection node_1
+# print initial GTIDs
+source include/print_gtid.inc;
+
+--echo # On node_2
+--connection node_2
+# print initial GTIDs
+source include/print_gtid.inc;
+
+--echo # On node_1
+--connection node_1
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(i INT) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+SELECT * FROM t2;
+source include/print_gtid.inc;
+
+--echo # On node_2
+--connection node_2
+SELECT * FROM t1;
+source include/print_gtid.inc;
+
+--echo # On node_1
+--connection node_1
+INSERT INTO t2 VALUES(1);
+SELECT * FROM t2;
+source include/print_gtid.inc;
+
+--echo # On node_2
+--connection node_2
+SELECT * FROM t2;
+source include/print_gtid.inc;
+
+--echo # On node_1
+--connection node_1
+# Cleanup
+DROP TABLE t1, t2;
+
+--source include/galera_end.inc
+--echo # End of test
+
diff --git a/mysql-test/suite/galera/t/mdev_9290.test b/mysql-test/suite/galera/t/mdev_9290.test
new file mode 100644
index 00000000000..39e02011a09
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev_9290.test
@@ -0,0 +1,24 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-9290 : InnoDB: Assertion failure in file trx0sys.cc line 353
+--echo # InnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno
+--echo #
+
+--connection node_1
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+
+--connection node_2
+# Note: a multi-statement transaction should always be the "first" one to execute
+# on this node.
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+COMMIT;
+
+--connection node_1
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#110.test b/mysql-test/suite/galera/t/mysql-wsrep#110.test
new file mode 100644
index 00000000000..43520f257a1
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#110.test
@@ -0,0 +1,51 @@
+#
+# codership/mysql-wsrep/110 - Assertion `table_found' failed in unpack_row() with SAVEPOINT, trigger, error handler
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+
+
+DELIMITER |;
+
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK TO event_logging;
+ INSERT t3 VALUES (x);
+ END;
+ SAVEPOINT event_logging;
+
+ INSERT INTO t2 VALUES (x);
+END|
+DELIMITER ;|
+
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+SELECT COUNT(*) = 1 FROM t3;
+
+--connection node_2
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+SELECT COUNT(*) = 1 FROM t3;
+
+--connection node_1
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#198.test b/mysql-test/suite/galera/t/mysql-wsrep#198.test
new file mode 100644
index 00000000000..a80d030a8b0
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#198.test
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+# Ensure that the tables have been created on node #2
+SELECT 1 FROM DUAL;
+
+LOCK TABLE t2 WRITE;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--send OPTIMIZE TABLE t1,t2;
+
+--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2b
+--send REPAIR TABLE t1,t2;
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+--connection node_1
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+UNLOCK TABLES;
+
+--connection node_2a
+--reap
+
+--connection node_2b
+--reap
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt b/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
new file mode 100644
index 00000000000..a00258bc48c
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
@@ -0,0 +1 @@
+--query_cache_type=1
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201.test b/mysql-test/suite/galera/t/mysql-wsrep#201.test
new file mode 100644
index 00000000000..21cf05db008
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#201.test
@@ -0,0 +1,32 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (DEFAULT);
+
+--connection node_2
+--let $qcache_size_orig = `SELECT @@GLOBAL.query_cache_size`
+SET GLOBAL query_cache_size=1355776;
+
+--disable_query_log
+
+--let $count = 500
+while ($count)
+{
+ --connection node_1
+ INSERT INTO t1 VALUES (DEFAULT);
+ --let $val1 = `SELECT LAST_INSERT_ID()`
+ --connection node_2
+ --let $val2 = `SELECT MAX(id) FROM t1`
+ --let $val3 = `SELECT $val1 != $val2`
+ if ($val3)
+ {
+ --echo $val1 $val2
+ --die wsrep_sync_wait failed
+ }
+ --dec $count
+}
+
+--eval SET GLOBAL query_cache_size = $qcache_size_orig
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#237.test b/mysql-test/suite/galera/t/mysql-wsrep#237.test
new file mode 100644
index 00000000000..cba8dfeb275
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#237.test
@@ -0,0 +1,34 @@
+# hang because of replicated FLUSH TABLE command
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
+--send INSERT INTO t values (1);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: wsrep_before_replication'
+--source include/wait_condition.inc
+
+--connection node_2
+FLUSH TABLES;
+
+
+--connection node_1a
+SELECT SLEEP(1);
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+# Cleanup
+DROP TABLE t;
+--connection node_1a
+SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#247.test b/mysql-test/suite/galera/t/mysql-wsrep#247.test
new file mode 100644
index 00000000000..8bcd58607a1
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#247.test
@@ -0,0 +1,23 @@
+#
+# codership/mysql-wsrep/247 MW-246 -
+# DDL with RSU fails if node is desynced upfont
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+SET GLOBAL wsrep_desync=1;
+
+SET wsrep_OSU_method=RSU;
+
+CREATE TABLE t1 (i int primary key);
+
+SHOW VARIABLES LIKE 'wsrep_desync';
+
+SET GLOBAL wsrep_desync=0;
+--sleep 1
+DROP TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#31.test b/mysql-test/suite/galera/t/mysql-wsrep#31.test
new file mode 100644
index 00000000000..c669d4834ba
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#31.test
@@ -0,0 +1,53 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES('test');
+CREATE DATABASE db;
+
+--connection node_2
+--let $expected_position_uuid = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_uuid'`
+--let $expected_position_seqno = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--let $expected_position = $expected_position_uuid:$expected_position_seqno
+
+--echo Shutting down server 2 ...
+--source include/shutdown_mysqld.inc
+
+--echo Recovering server 2 ...
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+if ($galera_wsrep_start_position != $expected_position)
+{
+ die(Expected position: $expected_position, found $galera_wsrep_start_position);
+}
+
+--echo Restarting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+--source include/wait_until_ready.inc
+
+--connection node_1
+DROP TABLE t1;
+DROP DATABASE db;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/wait_until_connected_again.inc
+
+# Restore original auto_increment_offset values.
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+
+
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#33.cnf b/mysql-test/suite/galera/t/mysql-wsrep#33.cnf
new file mode 100644
index 00000000000..f1c3d802e4b
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#33.cnf
@@ -0,0 +1,8 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#33.test b/mysql-test/suite/galera/t/mysql-wsrep#33.test
new file mode 100644
index 00000000000..acc7c735849
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#33.test
@@ -0,0 +1,18 @@
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source suite/galera/include/galera_sst_set_mysqldump.inc
+
+--source suite/galera/include/galera_st_disconnect_slave.inc
+
+--source suite/galera/include/galera_sst_restore.inc
+
+--connection node_2
+# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
+# Otherwise MTR's check_testcases complains
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#90.test b/mysql-test/suite/galera/t/mysql-wsrep#90.test
new file mode 100644
index 00000000000..5af86fb2872
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#90.test
@@ -0,0 +1,65 @@
+# Crash in galera_to_execute_end when wsrep_OSU_method is changed from RSU to TOI during a DDL
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_1
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (1,2);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (3,4);
+
+--connection node_1
+DROP TABLE t1;
+
+SET GLOBAL WSREP_OSU_METHOD = TOI;
diff --git a/mysql-test/suite/galera/t/partition.test b/mysql-test/suite/galera/t/partition.test
new file mode 100644
index 00000000000..bb5a02411c3
--- /dev/null
+++ b/mysql-test/suite/galera/t/partition.test
@@ -0,0 +1,207 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_partition.inc
+
+--echo #
+--echo # MDEV#4953 Galera: DELETE from a partitioned table is not replicated
+--echo #
+
+USE test;
+CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,100), (2,200);
+SELECT * FROM t1;
+
+DELETE FROM t1;
+SELECT * FROM t1;
+
+--echo
+--echo # On node_1
+--connection node_1
+SELECT * FROM t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM t1;
+
+# Cleanup
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV#7501 : alter table exchange partition is not replicated in
+--echo # galera cluster
+--echo #
+
+--echo
+--echo # On node_1
+--connection node_1
+
+CREATE TABLE test.t1 (
+ i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (i)
+ ) ENGINE=INNODB
+ PARTITION BY RANGE (i)
+ (PARTITION p1 VALUES LESS THAN (10) ENGINE = INNODB,
+ PARTITION p2 VALUES LESS THAN (20) ENGINE = INNODB,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = INNODB);
+
+INSERT INTO test.t1 (i) VALUE (9),(19);
+CREATE TABLE test.p1 LIKE test.t1;
+ALTER TABLE test.p1 REMOVE PARTITIONING;
+
+ALTER TABLE test.t1 EXCHANGE PARTITION p1 WITH TABLE test.p1;
+SELECT * FROM test.t1;
+SELECT * FROM test.p1;
+
+--echo
+--echo # On node_2
+--connection node_2
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE p1;
+
+SELECT * FROM test.t1;
+SELECT * FROM test.p1;
+
+--echo
+--echo # On node_1
+--connection node_1
+ALTER TABLE t1 TRUNCATE PARTITION p2;
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_1
+--connection node_1
+ALTER TABLE t1 DROP PARTITION p2;
+SHOW CREATE TABLE t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SHOW CREATE TABLE t1;
+
+
+# Cleanup
+DROP TABLE t1, p1;
+
+--echo #
+--echo # MDEV-5146: Bulk loads into partitioned table not working
+--echo #
+
+# Create 2 files with 20002 & 101 entries in each.
+--perl
+open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/mdev-5146-1.dat") or die;
+foreach my $i (1..20002) {
+ print FILE "$i\n";
+}
+
+open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/mdev-5146-2.dat") or die;
+foreach my $i (1..101) {
+ print FILE "$i\n";
+}
+EOF
+
+--connection node_1
+
+--let $wsrep_load_data_splitting_orig = `SELECT @@wsrep_load_data_splitting`
+
+--echo # Case 1: wsrep_load_data_splitting = ON & LOAD DATA with 20002
+--echo # entries.
+
+SET GLOBAL wsrep_load_data_splitting = ON;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+
+# Record wsrep_last_committed as it was before LOAD DATA
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat' INTO TABLE t1;
+--enable_query_log
+
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_2
+SELECT COUNT(*) = 20002 FROM t1;
+
+# LOAD-ing 20002 rows causes 3 commits to be registered
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 3 AS wsrep_last_committed_diff;
+--enable_query_log
+
+DROP TABLE t1;
+
+--echo # Case 2: wsrep_load_data_splitting = ON & LOAD DATA with 101 entries.
+
+--connection node_1
+
+SET GLOBAL wsrep_load_data_splitting = ON;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+
+# Record wsrep_last_committed as it was before LOAD DATA
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-5146-2.dat' INTO TABLE t1;
+--enable_query_log
+
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_2
+SELECT COUNT(*) = 101 FROM t1;
+
+# LOAD-ing 101 rows causes 1 commit to be registered
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+DROP TABLE t1;
+
+--echo # Case 3: wsrep_load_data_splitting = OFF & LOAD DATA with 20002
+--echo # entries.
+
+--connection node_1
+
+SET GLOBAL wsrep_load_data_splitting = OFF;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+
+# Record wsrep_last_committed as it was before LOAD DATA
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat' INTO TABLE t1;
+--enable_query_log
+
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_2
+SELECT COUNT(*) = 20002 FROM t1;
+
+# LOAD-ing 20002 rows causes 1 commit to be registered
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+DROP TABLE t1;
+
+--connection node_1
+# Restore the original value
+--eval SET GLOBAL wsrep_load_data_splitting = $wsrep_load_data_splitting_orig;
+
+# Cleanup
+remove_file '$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat';
+remove_file '$MYSQLTEST_VARDIR/tmp/mdev-5146-2.dat';
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/pxc-421.test b/mysql-test/suite/galera/t/pxc-421.test
new file mode 100644
index 00000000000..381f9bb4494
--- /dev/null
+++ b/mysql-test/suite/galera/t/pxc-421.test
@@ -0,0 +1,65 @@
+#
+# PXC-421: Test deadlock involving updates of
+# wsrep_provider, wsrep_cluster_address and wsrep_slave_threads.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $wsrep_slave_1 = `SELECT @@wsrep_slave_threads`
+set GLOBAL wsrep_slave_threads=26;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+
+--connection node_2
+--let $wsrep_slave_2 = `SELECT @@wsrep_slave_threads`
+set GLOBAL wsrep_slave_threads=16;
+--let $wsrep_provider_orig = `SELECT @@wsrep_provider`
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+set SESSION wsrep_sync_wait=0;
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+
+INSERT INTO t1 VALUES (4);
+set GLOBAL wsrep_slave_threads=5;
+
+# Node #2 has all the inserts
+SELECT COUNT(*) = 5 FROM t1;
+
+--connection node_1
+set GLOBAL wsrep_slave_threads=12;
+# Node #1 is missing the insert made while Node #2 was not replicated
+SELECT COUNT(*) = 4 FROM t1;
+INSERT INTO t1 VALUES (100), (101), (102);
+
+--connection node_2
+set GLOBAL wsrep_slave_threads=5;
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+show global variables like 'wsrep_slave_threads';
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_2
+SELECT COUNT(*) FROM t1;
+
+SET GLOBAL auto_increment_offset = 2;
+
+--connection node_1
+SELECT COUNT(*) FROM t1;
+show global variables like 'wsrep_slave_threads';
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_1
+DROP TABLE t1;
+
+SET GLOBAL auto_increment_offset = 1;
diff --git a/mysql-test/suite/galera/t/query_cache.opt b/mysql-test/suite/galera/t/query_cache.opt
new file mode 100644
index 00000000000..a00258bc48c
--- /dev/null
+++ b/mysql-test/suite/galera/t/query_cache.opt
@@ -0,0 +1 @@
+--query_cache_type=1
diff --git a/mysql-test/suite/galera/t/query_cache.test b/mysql-test/suite/galera/t/query_cache.test
new file mode 100644
index 00000000000..24ed8ecd077
--- /dev/null
+++ b/mysql-test/suite/galera/t/query_cache.test
@@ -0,0 +1,1002 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+--echo
+--echo # Execute FLUSH/RESET commands.
+--echo # On node-1
+--connection node_1
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache; # This crashed in some versions
+reset query cache;
+flush status;
+
+--echo # On node-2
+--connection node_2
+SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
+SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
+set GLOBAL query_cache_size=1355776;
+flush query cache; # This crashed in some versions
+reset query cache;
+flush status;
+
+#
+# INSERT/UPDATE/DELETE/DROP/SELECT
+#
+
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+select * from t1;
+select sql_no_cache * from t1;
+select length(now()) from t1;
+
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+
+select * from t1;
+select * from t1;
+select sql_no_cache * from t1;
+select length(now()) from t1;
+
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+# DELETE should invalidate cache on both the nodes.
+--echo # On node-1
+--connection node_1
+delete from t1 where a=1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# Add a SELECT to the cache.
+--echo # On node-1
+--connection node_1
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# UPDATE should invalidate cache on both the nodes.
+--echo # On node-1
+--connection node_1
+update t1 set a=1 where a=3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# Add a SELECT to the cache.
+--echo # On node-1
+--connection node_1
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+# DROP should invalidate cache on both the nodes.
+--echo # On node-1
+--connection node_1
+drop table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# MERGE TABLES with INSERT/UPDATE and DELETE
+#
+--echo
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) ENGINE=MyISAM;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) ENGINE=MyISAM;
+insert into t2 values (4),(5),(6);
+create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
+# insert
+select * from t3;
+select * from t3;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert into t2 values (7);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+select * from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert into t3 values (8);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+# update
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+update t2 set a=9 where a=7;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+update t3 set a=10 where a=1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+#delete
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+delete from t2 where a=9;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+delete from t3 where a=10;
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+# MERGE table, expect no records.
+select * from t3;
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+drop table t1, t2, t3;
+
+#
+# SELECT SQL_CACHE ...
+#
+--echo # On node-1
+--connection node_1
+set query_cache_type=demand;
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select sql_cache * from t1 union select * from t1;
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+set query_cache_type=on;
+
+--echo # On node-2
+--connection node_2
+set query_cache_type=demand;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select sql_cache * from t1 union select * from t1;
+set query_cache_type=2;
+select sql_cache * from t1 union select * from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+set query_cache_type=on;
+
+#
+# RESET QUERY CACHE
+#
+--echo # On node-1
+--connection node_1
+reset query cache;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--echo # On node-2
+--connection node_2
+reset query cache;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# SELECT SQL_NO_CACHE
+#
+--echo # On node-1
+--connection node_1
+select sql_no_cache * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--echo # On node-2
+--connection node_2
+select sql_no_cache * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Check that queries that uses NOW(), LAST_INSERT_ID()... are not cached.
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a text not null) engine=innodb;
+select CONNECTION_ID() from t1;
+select FOUND_ROWS();
+select NOW() from t1;
+select CURDATE() from t1;
+select CURTIME() from t1;
+select DATABASE() from t1;
+select ENCRYPT("test") from t1;
+select LAST_INSERT_ID() from t1;
+select RAND() from t1;
+select UNIX_TIMESTAMP() from t1;
+select USER() from t1;
+select CURRENT_USER() from t1;
+select benchmark(1,1) from t1;
+explain extended select benchmark(1,1) from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--echo # On node-2
+--connection node_2
+select CONNECTION_ID() from t1;
+select FOUND_ROWS();
+select NOW() from t1;
+select CURDATE() from t1;
+select CURTIME() from t1;
+select DATABASE() from t1;
+select ENCRYPT("test") from t1;
+select LAST_INSERT_ID() from t1;
+select RAND() from t1;
+select UNIX_TIMESTAMP() from t1;
+select USER() from t1;
+select CURRENT_USER() from t1;
+select benchmark(1,1) from t1;
+explain extended select benchmark(1,1) from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Non-cachable ODBC work around (and prepare cache for drop database)
+#
+--echo # On node-1
+--connection node_1
+create database mysqltest;
+create table mysqltest.t1 (i int not null auto_increment, a int, primary key
+ (i)) engine=innodb;
+insert into mysqltest.t1 values (1, 1);
+select * from mysqltest.t1 where i is null;
+create table t1(a int) engine=innodb;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from mysqltest.t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from mysqltest.t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+#
+# drop db
+#
+drop database mysqltest;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Charset conversion (cp1251_koi8 always present)
+# Note: Queries using different default character sets are cached separately.
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a char(1) not null collate koi8r_general_ci) engine=innodb;
+insert into t1 values(_koi8r"á");
+set CHARACTER SET koi8r;
+select * from t1;
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+set CHARACTER SET koi8r;
+select * from t1;
+set CHARACTER SET cp1251_koi8;
+select * from t1;
+set CHARACTER SET DEFAULT;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Same tables in different dbs
+#
+--echo # On node-1
+--connection node_1
+create database if not exists mysqltest;
+create table mysqltest.t1 (i int not null) engine=innodb;
+create table t1 (i int not null) engine=innodb;
+insert into mysqltest.t1 (i) values (1);
+insert into t1 (i) values (2);
+
+select * from t1;
+use mysqltest;
+select * from t1;
+select * from t1;
+use test;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+use mysqltest;
+select * from t1;
+select * from t1;
+use test;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop database mysqltest;
+drop table t1;
+
+#
+# FOUND_ROWS()
+#
+--echo # On node-1
+--connection node_1
+create table t1 (i int not null) engine=innodb;
+insert into t1 (i) values (1),(2),(3),(4);
+
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+--echo # On node-2
+--connection node_2
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select SQL_CALC_FOUND_ROWS * from t1 limit 2;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select * from t1 where i=1;
+select FOUND_ROWS();
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+drop table t1;
+
+#
+# Test insert delayed (MYISAM)
+#
+
+--echo # On node-2
+--connection node_2
+flush query cache;
+reset query cache;
+
+--echo # On node-1
+--connection node_1
+flush query cache;
+reset query cache;
+
+create table t1 (a int not null) ENGINE=MYISAM;
+insert into t1 values (1),(2),(3);
+select * from t1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert delayed into t1 values (4);
+--sleep 5 # Wait for insert delayed to be executed.
+select a from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+insert delayed into t1 values (4);
+--sleep 5 # Wait for insert delayed to be executed.
+select a from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+drop table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-1
+--connection node_1
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# Test of min result data unit size changing
+#
+--echo # On node-2
+--connection node_2
+show global variables like "query_cache_min_res_unit";
+set GLOBAL query_cache_min_res_unit=1001;
+show global variables like "query_cache_min_res_unit";
+
+--echo # On node-1
+--connection node_1
+show global variables like "query_cache_min_res_unit";
+set GLOBAL query_cache_min_res_unit=1001;
+show global variables like "query_cache_min_res_unit";
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null) engine=innodb;
+insert into t2 values (1),(2),(3);
+select * from t1;
+select * from t1;
+select * from t2;
+select * from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+select * from t1;
+select * from t2;
+select * from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+drop table t1;
+select a from t2;
+select a from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+
+--echo # On node-1
+--connection node_1
+select a from t2;
+select a from t2;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+drop table t2;
+set GLOBAL query_cache_min_res_unit=default;
+show global variables like "query_cache_min_res_unit";
+
+#
+# Case sensitive test
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) engine=innodb;
+insert into t1 values (1);
+select "aaa" from t1;
+select "AAA" from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select "aaa" from t1;
+select "AAA" from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+
+#
+# Test of query cache resizing
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+set GLOBAL query_cache_size=1000;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=1024;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=10240;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=20480;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=40960;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+select * from t1;
+
+--echo # On node-2
+--connection node_2
+set GLOBAL query_cache_size=1000;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=1024;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=10240;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=20480;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=40960;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=51200;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=61440;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=81920;
+show global variables like "query_cache_size";
+select * from t1;
+set GLOBAL query_cache_size=102400;
+show global variables like "query_cache_size";
+select * from t1;
+
+drop table t1;
+
+#
+# Temporary tables (ignored by Galera)
+#
+--echo # On node-1
+--connection node_1
+set GLOBAL query_cache_size=1048576;
+create table t1 (i int not null) engine=innodb;
+create table t2 (i int not null) engine=innodb;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+create temporary table t3 (i int not null);
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t3;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+update t1 set i=(select distinct 1 from (select * from t2) a);
+drop table t3;
+
+--echo # On node-2
+--connection node_2
+set GLOBAL query_cache_size=1048576;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+drop table t1, t2;
+
+#
+# System databse test (no need to perform it on node_2)
+# Note: Queries on system tables are not cached.
+#
+--echo # On node-1
+--connection node_1
+use mysql;
+disable_result_log;
+select * from db;
+enable_result_log;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+use test;
+disable_result_log;
+select * from mysql.db;
+enable_result_log;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+#
+# Simple rename test
+#
+--echo # On node-1
+--connection node_1
+create table t1(id int auto_increment primary key) engine=innodb;
+insert into t1 values (1), (2), (3);
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-1
+--connection node_1
+alter table t1 rename to t2;
+--error ER_NO_SUCH_TABLE
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+--error ER_NO_SUCH_TABLE
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t2;
+
+#
+# Load data invalidation test
+#
+--echo # On node-1
+--connection node_1
+create table t1 (word char(20) not null) engine=innodb;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select count(*) from t1;
+
+# Wait for "load data" to replicate.
+--sleep 5
+
+--echo # On node-2
+--connection node_2
+select count(*) from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select count(*) from t1;
+
+drop table t1;
+
+#
+# INTO OUTFILE/DUMPFILE test
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2),(3);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1 into outfile "query_cache.out.file";
+--error ER_FILE_EXISTS_ERROR
+select * from t1 into outfile "query_cache.out.file";
+select * from t1 limit 1 into dumpfile "query_cache.dump.file";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+drop table t1;
+let $datadir=`select @@datadir`;
+--remove_file $datadir/test/query_cache.dump.file
+--remove_file $datadir/test/query_cache.out.file
+
+#
+# Test of SQL_SELECT_LIMIT
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+SET SQL_SELECT_LIMIT=DEFAULT;
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+select * from t1;
+SET SQL_SELECT_LIMIT=1;
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+SET SQL_SELECT_LIMIT=DEFAULT;
+
+drop table t1;
+
+#
+# WRITE LOCK & QC
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int not null) engine=innodb;
+create table t2 (a int not null) engine=innodb;
+
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+select * from t1;
+# Implicit locking of t1 does not invalidate QC
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+
+--echo # On node-2
+--connection node_2
+set query_cache_wlock_invalidate=1;
+create view v1 as select * from t1;
+select * from t1;
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+select * from t1;
+# Implicit locking of t1 does not invalidate QC
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+lock table v1 write;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+unlock table;
+drop view v1;
+set query_cache_wlock_invalidate=default;
+
+drop table t1,t2;
+
+#
+# Hiding real table stored in query cache by temporary table
+#
+--echo # On node-1
+--connection node_1
+create table t1 (id int primary key) engine=innodb;
+insert into t1 values (1),(2),(3);
+select * from t1;
+create temporary table t1 (a int not null auto_increment primary key);
+select * from t1;
+drop table t1;
+drop table t1;
+
+#
+# Test character set related variables:
+# character_set_result
+# character_set_client
+# charactet_set_connection/collation_connection
+# If at least one of the above variables has changed,
+# the cached query can't be reused. In the below test
+# absolutely the same query is used several times,
+# SELECT should fetch different results for every instance.
+# No hits should be produced.
+# New cache entry should appear for every SELECT.
+#
+
+--echo # On node-1
+--connection node_1
+SET NAMES koi8r;
+CREATE TABLE t1 (a char(1) character set koi8r) engine=innodb;
+INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Ã');
+#
+# Run select
+#
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Change collation_connection and run the same query again
+#
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Now change character_set_client and run the same query again
+#
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# And finally change character_set_results and run the same query again
+#
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+SET NAMES default;
+
+--echo # On node-2
+--connection node_2
+#
+# Run select
+#
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Change collation_connection and run the same query again
+#
+set collation_connection=koi8r_bin;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# Now change character_set_client and run the same query again
+#
+set character_set_client=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+#
+# And finally change character_set_results and run the same query again
+#
+set character_set_results=cp1251;
+SELECT a,'Â','â'='Â' FROM t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+drop table t1;
+
+#
+# Comments before command
+#
+--echo # On node-1
+--connection node_1
+create table t1 (a int) engine=innodb;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+/**/ select * from t1;
+/**/ select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+/**/ select * from t1;
+/**/ select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+drop table t1;
+
+#
+# Information schema & query cache test
+#
+--echo # On node-1
+--connection node_1
+set session query_cache_type = 2;
+create table t1(a int) engine=innodb;
+select table_name from information_schema.tables
+where table_schema="test";
+drop table t1;
+select table_name from information_schema.tables
+where table_schema="test";
+# Bug #8480: REPAIR TABLE needs to flush the table from the query cache
+set session query_cache_type = 1;
+set global query_cache_size=1024*1024;
+flush query cache;
+create table t1 ( a int ) engine=myisam; # myisam for repair tables
+insert into t1 values (1);
+select a from t1;
+select a from t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+repair table t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+
+--echo # On node-2
+--connection node_2
+select a from t1;
+select a from t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+repair table t1;
+show status like 'qcache_queries_in_cache';
+show status like "Qcache_hits";
+drop table t1;
+
+--echo # Restore original settings.
+--echo # On node-1
+--connection node_1
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+--echo
+--echo # On node-2
+--connection node_2
+SET GLOBAL query_cache_size=@query_cache_size_saved;
+SET GLOBAL query_cache_type=@query_cache_type_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/rename.test b/mysql-test/suite/galera/t/rename.test
new file mode 100644
index 00000000000..326d64d3b8a
--- /dev/null
+++ b/mysql-test/suite/galera/t/rename.test
@@ -0,0 +1,53 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-8598 : Failed MySQL DDL commands and Galera replication
+--echo #
+--echo # On node 1
+--connection node_1
+USE test;
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUE(1);
+SELECT * FROM t1;
+
+--echo # Create a new user 'foo' with limited privileges
+CREATE USER foo@localhost;
+GRANT SELECT on test.* TO foo@localhost;
+
+--echo # Open connection to the 1st node using 'test_user1' user.
+--let $port_1= \$NODE_MYPORT_1
+--connect(foo_node_1,localhost,foo,,test,$port_1,)
+
+--connection foo_node_1
+SELECT * FROM t1;
+--echo # Following RENAME should not replicate to other node.
+--error ER_TABLEACCESS_DENIED_ERROR
+RENAME TABLE t1 TO t2;
+
+--echo # On node 2
+--connection node_2
+USE test;
+SELECT * FROM t1;
+
+--echo # On node_1
+--connection node_1
+RENAME TABLE t1 TO t2;
+SHOW TABLES;
+
+--echo # On node 2
+--connection node_2
+USE test;
+SELECT * FROM t2;
+
+# Cleanup
+--connection node_1
+DROP USER foo@localhost;
+DROP TABLE t2;
+
+--echo # End of tests
+
diff --git a/mysql-test/suite/galera/t/rpl_row_annotate.cnf b/mysql-test/suite/galera/t/rpl_row_annotate.cnf
new file mode 100644
index 00000000000..1f1d83dfa0b
--- /dev/null
+++ b/mysql-test/suite/galera/t/rpl_row_annotate.cnf
@@ -0,0 +1,6 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+log-bin
+log-slave-updates
+binlog-annotate-row-events=ON
diff --git a/mysql-test/suite/galera/t/rpl_row_annotate.test b/mysql-test/suite/galera/t/rpl_row_annotate.test
new file mode 100644
index 00000000000..b1cfdb36639
--- /dev/null
+++ b/mysql-test/suite/galera/t/rpl_row_annotate.test
@@ -0,0 +1,42 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo # On node_2
+--connection node_2
+RESET MASTER;
+
+--echo # On node_1
+--connection node_1
+RESET MASTER;
+CREATE TABLE t1(i INT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+DELETE FROM t1 WHERE i = 1;
+
+--echo # On node_2
+--connection node_2
+INSERT INTO t1 VALUES(2);
+DELETE FROM t1 WHERE i = 2;
+
+--echo # On node_1
+--connection node_1
+--source include/binlog_start_pos.inc
+let $start_pos= `select @binlog_start_pos`;
+--replace_column 2 # 5 #
+--replace_result $start_pos <start_pos>
+--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
+--eval SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM $start_pos
+
+--echo # On node_2
+--connection node_2
+--source include/binlog_start_pos.inc
+let $start_pos= `select @binlog_start_pos`;
+--replace_column 2 # 5 #
+--replace_result $start_pos <start_pos>
+--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
+--eval SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM $start_pos
+
+# Cleanup
+DROP TABLE t1;
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/sql_log_bin.test b/mysql-test/suite/galera/t/sql_log_bin.test
new file mode 100644
index 00000000000..9f8f7c84486
--- /dev/null
+++ b/mysql-test/suite/galera/t/sql_log_bin.test
@@ -0,0 +1,56 @@
+# Test to check the behavior of galera cluster with sql_log_bin=ON|OFF & binary
+# logging is disabled. sql_bin_log should not affect galera replication.
+#
+# The following bugfixes are tested:
+#
+# MDEV-9510: Segmentation fault in binlog thread.
+# A scenario otherwise causing a similar segfault is replayed.
+# The test must pass having no crashes.
+# The sequence of sql statements is provided by original
+# sql_log_bin.test augmented with a FLUSH BINLOG LOGS, below.
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo
+--echo # On node_1
+--connection node_1
+
+USE test;
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1);
+
+--echo # Disable binary logging for current session
+SET SQL_LOG_BIN=OFF;
+INSERT INTO t1 VALUES (2);
+
+# MDEV-9510: the following binlog rotation due to FLUSH segfaults wo/ the fixes
+FLUSH BINARY LOGS;
+
+CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t2 VALUES (1);
+CREATE TABLE test.t3 AS SELECT * from t1;
+
+--echo # Enable binary logging for current session
+SET SQL_LOG_BIN=ON;
+INSERT INTO t2 VALUES (2);
+CREATE TABLE t4 AS SELECT * from t2;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+SELECT * FROM t4;
+
+--echo
+--echo # On node_2
+--connection node_2
+USE test;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+SELECT * FROM t4;
+
+# Cleanup
+DROP TABLE t1, t2, t3, t4;
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/unique_key.test b/mysql-test/suite/galera/t/unique_key.test
new file mode 100644
index 00000000000..00b85d57165
--- /dev/null
+++ b/mysql-test/suite/galera/t/unique_key.test
@@ -0,0 +1,54 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV#5552 Deadlock when inserting NULL column value in column with
+--echo # UNIQUE index
+--echo #
+
+USE test;
+--echo
+--echo # On node_1
+--connection node_1
+CREATE TABLE t1(c1 INT DEFAULT NULL, UNIQUE KEY c1(c1)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM test.t1;
+
+
+--echo
+--echo # On node_1
+--connection node_1
+INSERT INTO t1 VALUES (1);
+UPDATE t1 SET c1=NULL WHERE c1=1;
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_1
+--connection node_1
+DELETE FROM t1 WHERE c1<=>NULL;
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM test.t1;
+
+--let $galera_diff_statement = SELECT * FROM t1
+--source include/galera_diff.inc
+
+# Cleanup
+DROP TABLE t1;
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/view.test b/mysql-test/suite/galera/t/view.test
new file mode 100644
index 00000000000..fa2cd8b2a67
--- /dev/null
+++ b/mysql-test/suite/galera/t/view.test
@@ -0,0 +1,50 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-7222: Cluster Node Crash at CREATE DEFINER statement
+--echo #
+USE test;
+CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+
+--echo #
+--echo # MDEV-8464 : ALTER VIEW not replicated in some cases
+--echo #
+--echo # On node_1
+--connection node_1
+USE test;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT * FROM t1;
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t1;
+CREATE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t1;
+CREATE ALGORITHM=UNDEFINED DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
+
+--echo # On node_2
+--connection node_2
+USE test;
+SHOW CREATE VIEW v1;
+SHOW CREATE VIEW v2;
+SHOW CREATE VIEW v3;
+SHOW CREATE VIEW v4;
+
+--echo # On node_1
+--connection node_1
+ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
+ALTER ALGORITHM=UNDEFINED VIEW v2 AS SELECT * FROM t1;
+ALTER DEFINER=CURRENT_USER VIEW v3 AS SELECT * FROM t1;
+ALTER ALGORITHM=TEMPTABLE DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
+
+--echo # On node_2
+--connection node_2
+SHOW CREATE VIEW v1;
+SHOW CREATE VIEW v2;
+SHOW CREATE VIEW v3;
+SHOW CREATE VIEW v4;
+
+--echo # Cleanup
+DROP VIEW v1, v2, v3, v4;
+DROP TABLE t1;
+
+--echo # End of tests
+
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
new file mode 100644
index 00000000000..a9b9b00b40c
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -0,0 +1,3 @@
+galera_slave_options_do :MDEV-8798
+galera_slave_options_ignore : MDEV-8798
+
diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
new file mode 100644
index 00000000000..3f39b82f7b7
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
@@ -0,0 +1,122 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+log-bin
+log-slave-updates
+binlog-format=row
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep_gtid_mode=1
+gtid_ignore_duplicates
+
+wsrep-on=1
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+# enforce read-committed characteristics across the cluster
+# wsrep-causal-reads=ON
+# wsrep-sync-wait=15
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep-cluster-address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+[mysqld.3]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
+
+
+[mysqld.4]
+wsrep_cluster_name=cluster2
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+wsrep-cluster-address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
+
+[mysqld.5]
+wsrep_cluster_name=cluster2
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
+wsrep_provider_options='base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.5.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.5.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.5.#sst_port'
+
+[mysqld.6]
+wsrep_cluster_name=cluster2
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
+wsrep_provider_options='base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.6.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.6.#sst_port'
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+NODE_MYPORT_5= @mysqld.5.port
+NODE_MYSOCK_5= @mysqld.5.socket
+
+NODE_MYPORT_6= @mysqld.6.port
+NODE_MYSOCK_6= @mysqld.6.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+NODE_GALERAPORT_4= @mysqld.4.#galera_port
+NODE_GALERAPORT_5= @mysqld.5.#galera_port
+NODE_GALERAPORT_6= @mysqld.6.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
+NODE_SSTPORT_4= @mysqld.4.#sst_port
+NODE_SSTPORT_5= @mysqld.5.#sst_port
+NODE_SSTPORT_6= @mysqld.6.#sst_port
diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
new file mode 100644
index 00000000000..91aa53ad7b1
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
@@ -0,0 +1,66 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+binlog-format=row
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+
+wsrep-on=1
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+# enforce read-committed characteristics across the cluster
+wsrep-causal-reads=ON
+wsrep-sync-wait=15
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep-cluster-address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+[mysqld.3]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
+
diff --git a/mysql-test/suite/galera_3nodes/include/galera_suspend.inc b/mysql-test/suite/galera_3nodes/include/galera_suspend.inc
new file mode 100644
index 00000000000..3495ad2342b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/include/galera_suspend.inc
@@ -0,0 +1,14 @@
+#
+# This macro suspends the current node
+#
+
+--let _SUSPEND_NODE_PIDFILE = `SELECT @@pid_file`
+--echo Suspending node ...
+
+--perl
+ my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'};
+ my $mysqld_pid = `cat $pid_filename`;
+ chomp($mysqld_pid);
+ system("kill -19 $mysqld_pid");
+ exit(0);
+EOF
diff --git a/mysql-test/suite/galera_3nodes/my.cnf b/mysql-test/suite/galera_3nodes/my.cnf
new file mode 100644
index 00000000000..bb25b95ceea
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/my.cnf
@@ -0,0 +1 @@
+!include galera_3nodes.cnf
diff --git a/mysql-test/suite/galera_3nodes/r/GAL-501.result b/mysql-test/suite/galera_3nodes/r/GAL-501.result
new file mode 100644
index 00000000000..a2bf5f4d98c
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/GAL-501.result
@@ -0,0 +1,14 @@
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result b/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result
new file mode 100644
index 00000000000..96a2bec0d7f
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SET GLOBAL wsrep_cluster_address = '';
+INSERT INTO t1 VALUES (2);
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+COMMIT;
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result
new file mode 100644
index 00000000000..9dc735d5d3d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result
new file mode 100644
index 00000000000..1464222a079
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result
@@ -0,0 +1,19 @@
+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';
+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';
+Suspending node ...
+SET SESSION wsrep_sync_wait = 0;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+Resuming node ...
+CALL mtr.add_suppression("WSREP: gcs_caused() returned -1 \\(Operation not permitted\\)");
diff --git a/mysql-test/suite/galera_3nodes/r/galera_garbd.result b/mysql-test/suite/galera_3nodes/r/galera_garbd.result
new file mode 100644
index 00000000000..180aade029c
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_garbd.result
@@ -0,0 +1,17 @@
+Killing node #3 to free ports for garbd ...
+Starting garbd ...
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+Killing garbd ...
+INSERT INTO t1 VALUES (2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
+Restarting node #3 to satisfy MTR's end-of-test checks
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
diff --git a/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result
new file mode 100644
index 00000000000..35ca84119e7
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result
@@ -0,0 +1,231 @@
+cluster 1 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 1 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 1 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 2 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 2 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 2 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+cluster 1 node 1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 1
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+select * from t1;
+cluster_domain_id node_server_id seq_no
+1 11 2
+2 21 1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 1
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+drop table t1;
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+cluster 2 node 1
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+reset master;
+reset master;
+reset master;
+reset master;
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+cluster 1 node 1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 1
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+select * from t1;
+cluster_domain_id node_server_id seq_no
+1 11 2
+2 21 1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 1
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+drop table t1;
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+cluster 2 node 1
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+reset master;
+reset master;
+reset master;
+reset master;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result b/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result
new file mode 100644
index 00000000000..85000db8e77
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result
@@ -0,0 +1,11 @@
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+Killing server ...
+INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
+SELECT COUNT(*) = 20 FROM t1;
+COUNT(*) = 20
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result
new file mode 100644
index 00000000000..f519654952b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result
@@ -0,0 +1,26 @@
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+Loading wsrep provider ...
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+DROP USER sst;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
+CALL mtr.add_suppression("InnoDB: New log files created");
+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+CALL mtr.add_suppression("Can't open and lock time zone table");
+CALL mtr.add_suppression("Can't open and lock privilege tables");
+CALL mtr.add_suppression("Info table is not ready to be used");
+CALL mtr.add_suppression("Native table .* has the wrong structure");
+CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort");
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result
new file mode 100644
index 00000000000..a2bf5f4d98c
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result
@@ -0,0 +1,14 @@
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result
new file mode 100644
index 00000000000..53e35939a79
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result
@@ -0,0 +1,18 @@
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+include/assert_grep.inc [Streaming the backup to joiner at \[::1\]]
+include/assert_grep.inc [async IST sender starting to serve tcp://\[::1\]:]
+include/assert_grep.inc [IST receiver addr using tcp://\[::1\]]
+include/assert_grep.inc [Prepared IST receiver, listening at: tcp://\[::1\]]
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
new file mode 100644
index 00000000000..6c66bf4a891
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
@@ -0,0 +1,46 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
+INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
+SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers';
+INSERT INTO t1 VALUES (31), (32), (33), (34), (35);
+SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
+Variable_name Value
+wsrep_debug_sync_waiters ist_sender_send_after_get_buffers ist_sender_send_after_get_buffers
+INSERT INTO t1 VALUES (41), (42), (43), (44), (45);
+CREATE TABLE t2 (f1 LONGTEXT);
+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
+INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
+SELECT COUNT(*) = 30 FROM t1;
+COUNT(*) = 30
+1
+SELECT COUNT(*) = 3 FROM t2;
+COUNT(*) = 3
+1
+SELECT LENGTH(f1) = 512 * 1024 FROM t2;
+LENGTH(f1) = 512 * 1024
+1
+1
+1
+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
+SELECT COUNT(*) = 30 FROM t1;
+COUNT(*) = 30
+1
+SELECT COUNT(*) = 3 FROM t2;
+COUNT(*) = 3
+1
+SELECT LENGTH(f1) = 512 * 1024 FROM t2;
+LENGTH(f1) = 512 * 1024
+1
+1
+1
+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result
new file mode 100644
index 00000000000..ec97d392c0f
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result
@@ -0,0 +1,13 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_slave_threads = 2;
+UPDATE t1 SET f1 = f1 + 10;;
+UPDATE t1 SET f1 = f1 + 100;;
+SELECT f1 = 111 FROM t1;
+f1 = 111
+1
+SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
+COUNT(*) IN (1, 2)
+1
+SET GLOBAL wsrep_slave_threads = 1;;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result b/mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result
new file mode 100644
index 00000000000..69995acb982
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result
@@ -0,0 +1,26 @@
+CREATE TABLE t1 (f1 INTEGER);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'pc.bootstrap=1';
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 1
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status Primary
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
new file mode 100644
index 00000000000..6fb931638ef
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
@@ -0,0 +1,121 @@
+SET GLOBAL wsrep_provider_options = 'pc.weight=3';
+Suspending node ...
+SET SESSION wsrep_sync_wait=0;
+SET SESSION wsrep_on=OFF;
+SET SESSION wsrep_on=ON;
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 2
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status non-Primary
+SHOW STATUS LIKE 'wsrep_connected';
+Variable_name Value
+wsrep_connected ON
+SHOW STATUS LIKE 'wsrep_ready';
+Variable_name Value
+wsrep_ready OFF
+SHOW STATUS LIKE 'wsrep_local_state';
+Variable_name Value
+wsrep_local_state 0
+SHOW STATUS LIKE 'wsrep_local_state_comment';
+Variable_name Value
+wsrep_local_state_comment Initialized
+SET SESSION wsrep_sync_wait=0;
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 2
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status non-Primary
+SHOW STATUS LIKE 'wsrep_connected';
+Variable_name Value
+wsrep_connected ON
+SHOW STATUS LIKE 'wsrep_ready';
+Variable_name Value
+wsrep_ready OFF
+SHOW STATUS LIKE 'wsrep_local_state';
+Variable_name Value
+wsrep_local_state 0
+SHOW STATUS LIKE 'wsrep_local_state_comment';
+Variable_name Value
+wsrep_local_state_comment Initialized
+Resuming node ...
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+VARIABLE_VALUE = 4
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+SET SESSION wsrep_sync_wait=0;
+SET SESSION wsrep_sync_wait=0;
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+VARIABLE_VALUE = 4
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+VARIABLE_VALUE = 4
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE = 'Primary'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+VARIABLE_VALUE = 'ON'
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+VARIABLE_VALUE = 4
+1
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
+CALL mtr.add_suppression('overriding reported weight for');
+CALL mtr.add_suppression('WSREP: user message in state LEAVING');
+CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
+CALL mtr.add_suppression('overriding reported weight for');
diff --git a/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
new file mode 100644
index 00000000000..21f747d280b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
@@ -0,0 +1,26 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 1']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+SET SESSION wsrep_on = OFF;
+Killing server ...
+safe_to_bootstrap: 1
+safe_to_bootstrap: 0
+safe_to_bootstrap: 0
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_slave_options_do.result b/mysql-test/suite/galera_3nodes/r/galera_slave_options_do.result
new file mode 100644
index 00000000000..7185e92863d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_slave_options_do.result
@@ -0,0 +1,28 @@
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM db2.t2A;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2A;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_slave_options_ignore.result b/mysql-test/suite/galera_3nodes/r/galera_slave_options_ignore.result
new file mode 100644
index 00000000000..7185e92863d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_slave_options_ignore.result
@@ -0,0 +1,28 @@
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM db2.t2A;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2A;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result b/mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result
new file mode 100644
index 00000000000..88780a2c87f
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result
@@ -0,0 +1,48 @@
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_dirty_reads = 1;
+SELECT f1 FROM t1;
+f1
+1
+USE test;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+LOCK TABLE t1 WRITE;
+UNLOCK TABLES;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+PREPARE stmt_select FROM 'SELECT f1 FROM t1';
+EXECUTE stmt_select;
+f1
+1
+PREPARE stmt_update FROM 'UPDATE t1 SET f1 = f1 + f1';
+SET GLOBAL wsrep_dirty_reads = 1;
+SET GLOBAL wsrep_sync_wait = 0;
+SET GLOBAL wsrep_dirty_reads = 0;
+SET GLOBAL wsrep_sync_wait = 15;
+SET SESSION wsrep_dirty_reads = 1;
+INSERT INTO t1 SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+DELETE FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+UPDATE t1 SET f1 = f1 + 1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+DROP TABLE t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+EXECUTE stmt_update;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SET SESSION wsrep_dirty_reads = 0;
+SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+EXECUTE stmt_select;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.PROCESSLIST;
+COUNT(*) > 0
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm
new file mode 100644
index 00000000000..c91e6e07d76
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/suite.pm
@@ -0,0 +1,55 @@
+package My::Suite::GALERA_3NODES;
+use File::Basename;
+use My::Find;
+
+@ISA = qw(My::Suite);
+
+return "Not run for embedded server" if $::opt_embedded_server;
+
+return "WSREP is not compiled in" unless defined $::mysqld_variables{'wsrep-on'};
+
+my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
+ "/usr/lib/galera/libgalera_smm.so",
+ "/usr/lib64/galera/libgalera_smm.so";
+
+return "No wsrep provider library" unless -f $provider;
+
+$ENV{WSREP_PROVIDER} = $provider;
+
+my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
+return "No SST scripts" unless $spath;
+
+my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
+return "No my_print_defaults" unless $epath;
+
+push @::global_suppressions,
+ (
+ qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1),
+ qr(WSREP: Could not open saved state file for reading: ),
+ qr(WSREP: Could not open state file for reading: ),
+ qr(WSREP: Gap in state sequence. Need state transfer.),
+ qr(WSREP: Failed to prepare for incremental state transfer:),
+ qr(WSREP:.*down context.*),
+ qr(WSREP: Failed to send state UUID:),
+ qr(WSREP: last inactive check more than .* skipping check),
+ qr(WSREP: SQL statement was ineffective),
+ qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.),
+ qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|,
+ qr(WSREP: Quorum: No node with complete state),
+ qr(WSREP: Initial position was provided by configuration or SST, avoiding override),
+ qr|WSREP: discarding established \(time wait\) .*|,
+ qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.),
+ qr(WSREP: evs::proto.*),
+ qr|WSREP: Ignoring possible split-brain (allowed by configuration) from view:.*|,
+ qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable),
+ qr(WSREP: Could not find peer:),
+ qr(WSREP: Protocol violation. JOIN message sender .*),
+ qr(WSREP: JOIN message from member [0-9]* in non-primary configuration. Ignored.),
+ );
+
+
+$ENV{PATH}="$epath:$ENV{PATH}";
+$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
+
+bless { };
+
diff --git a/mysql-test/suite/galera_3nodes/t/GAL-501.cnf b/mysql-test/suite/galera_3nodes/t/GAL-501.cnf
new file mode 100644
index 00000000000..7002cb5bdfd
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/GAL-501.cnf
@@ -0,0 +1,26 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_node_address=[::1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_node_address=[::1]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_node_address=[::1]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
diff --git a/mysql-test/suite/galera_3nodes/t/GAL-501.test b/mysql-test/suite/galera_3nodes/t/GAL-501.test
new file mode 100644
index 00000000000..60ed5989227
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/GAL-501.test
@@ -0,0 +1,38 @@
+#
+# Test GAL-501 Improved URI parsing for IPv6 addresses
+# The .cnf file contains
+# wsrep_node_address=[::1]
+# ist.recv_addr=[::1]
+
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Force IST
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test
new file mode 100644
index 00000000000..b4fe10bff0d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test
@@ -0,0 +1,53 @@
+#
+# Test that a cluster configuration change during a transaction does not cause a failure
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+
+# 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
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_3
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+SET GLOBAL wsrep_cluster_address = '';
+--sleep 5
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+COMMIT;
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+
+--connection node_3
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+--sleep 5
+--source include/wait_until_ready.inc
+
+--connection node_1
+DROP TABLE t1;
+
+# Restore original auto_increment_offset values.
+--source ../galera/include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+
diff --git a/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test b/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test
new file mode 100644
index 00000000000..a2ad0765028
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test
@@ -0,0 +1,33 @@
+#
+# This test creates a transaction whose certification will fail on two separate nodes
+# for two different reasons.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+
+--connection node_3
+INSERT INTO t2 VALUES (1);
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test
new file mode 100644
index 00000000000..a87f19ac94e
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test
@@ -0,0 +1,67 @@
+#
+# Test the operation of evs.suspect_timeout.
+#
+# We set evs.inactive_timeout to a very high value so that evs.suspect_timeout can kick in instead.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $wsrep_provider_options_node1 = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';
+
+--connection node_2
+--source include/wait_until_connected_again.inc
+--let $wsrep_provider_options_node2 = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+--connection node_3
+--source include/wait_until_connected_again.inc
+--let $wsrep_cluster_address_node3 = `SELECT @@wsrep_cluster_address`
+
+# Suspend node #3
+
+--source include/galera_suspend.inc
+--sleep 5
+
+# Confirm that the other nodes have booted it out
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+SET SESSION wsrep_sync_wait = 0;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node1';
+--enable_query_log
+
+--source include/wait_until_connected_again.inc
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2';
+--enable_query_log
+
+--source include/wait_until_connected_again.inc
+SELECT COUNT(*) = 1 FROM t1;
+DROP TABLE t1;
+
+# Reconnect node #3 so that MTR's end-of-test checks can run
+
+--connection node_3
+--source include/galera_resume.inc
+--source include/wait_until_connected_again.inc
+
+CALL mtr.add_suppression("WSREP: gcs_caused() returned -1 \\(Operation not permitted\\)");
+
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node3';
+--enable_query_log
+--source include/wait_until_connected_again.inc
diff --git a/mysql-test/suite/galera_3nodes/t/galera_garbd.test b/mysql-test/suite/galera_3nodes/t/galera_garbd.test
new file mode 100644
index 00000000000..a68ba8ce15b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_garbd.test
@@ -0,0 +1,64 @@
+#
+# A very basic test for the galera arbitrator. We shut down node #3 and use its port allocation to start garbd.
+# As MTR does not allow multiple servers to be down at the same time, we are limited as to what we can test.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+--echo Killing node #3 to free ports for garbd ...
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--echo Starting garbd ...
+--exec `dirname $WSREP_PROVIDER`/garb/garbd --address "gcomm://127.0.0.1:$NODE_GALERAPORT_1" --group my_wsrep_cluster --options 'base_port=$NODE_GALERAPORT_3' > $MYSQL_TMP_DIR/garbd.log 2>&1 &
+
+--sleep 5
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+--echo Killing garbd ...
+--exec pkill --oldest --full garbd.*$NODE_GALERAPORT_3
+
+--sleep 5
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
+
+--echo Restarting node #3 to satisfy MTR's end-of-test checks
+--connection node_3
+--source include/start_mysqld.inc
+
+
+# Workaround for galera#101
+
+--connection node_1
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+
+--connection node_2
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+
+--connection node_3
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf
new file mode 100644
index 00000000000..dc5535ef34a
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf
@@ -0,0 +1,28 @@
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# following tests such as galera_3nodes.galera_var_dirty_reads2
+
+!include ../galera_2x3nodes.cnf
+[mysqld.1]
+wsrep_gtid_domain_id=1
+server-id=11
+
+[mysqld.2]
+wsrep_gtid_domain_id=1
+server-id=12
+
+[mysqld.3]
+wsrep_gtid_domain_id=1
+server-id=13
+
+[mysqld.4]
+wsrep_gtid_domain_id=2
+server-id=21
+
+[mysqld.5]
+wsrep_gtid_domain_id=2
+server-id=22
+
+[mysqld.6]
+wsrep_gtid_domain_id=2
+server-id=23
diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test
new file mode 100644
index 00000000000..c679db1305d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test
@@ -0,0 +1,292 @@
+#
+# This test creates 2x 3 nodes galera cluster.
+# The whole test case
+# A <-> B <-> C {Galera cluster 1}
+# | {Circular Async replication}
+# D <-> E <-> F {Galera cluster 2}
+# We will write on any random node to see if gtid is consitent or not
+# Then we will kill node D and set up the replication between A and E
+# To see whether fail over works or not.
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--echo cluster 1 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connection node_2
+--echo cluster 1 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+--echo cluster 1 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+--connection node_4
+--echo cluster 2 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5
+--connection node_5
+--echo cluster 2 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6
+--connection node_6
+--echo cluster 2 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+#--disable_parsing
+--connection node_1
+--replace_result $NODE_MYPORT_4 NODE_MYPORT_4
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--connection node_4
+--replace_result $NODE_MYPORT_1 NODE_MYPORT_1
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--echo cluster 1 node 1
+--connection node_1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 1
+--connection node_4
+select @@gtid_binlog_state;
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+select * from t1;
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 2
+--connection node_2
+select @@gtid_binlog_state;
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 1 node 3
+--connection node_3
+select @@gtid_binlog_state;
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 2
+--connection node_5
+select @@gtid_binlog_state;
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 3
+--connection node_6
+select @@gtid_binlog_state;
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 1
+--connection node_1
+select @@gtid_binlog_state;
+drop table t1;
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+--sleep 2
+
+--echo cluster 2 node 1
+--connection node_4
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+
+--connection node_2
+reset master;
+--connection node_3
+reset master;
+--connection node_5
+reset master;
+--connection node_6
+reset master;
+#--enable_parsing
+#
+# This test creates 2x 3 nodes galera cluster.
+# The whole test case
+# A <-> B <-> C {Galera cluster 1}
+# \ /
+# \ /
+# / {C->D, F->A , Async normal slave repl}
+# / \
+# | \
+# D <-> E <-> F {Galera cluster 2}
+# We will write on any random node to see if gtid is consitent or not
+# Then we will kill node D and set up the replication between A and E
+# To see whether fail over works or not.
+--connection node_1
+--replace_result $NODE_MYPORT_6 NODE_MYPORT_6
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--connection node_4
+--replace_result $NODE_MYPORT_3 NODE_MYPORT_3
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--echo cluster 1 node 1
+--connection node_1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+--sleep 2
+--echo cluster 2 node 1
+--connection node_4
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+select * from t1;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 2
+--connection node_2
+select @@gtid_binlog_state;
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 1 node 3
+--connection node_3
+select @@gtid_binlog_state;
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 2
+--connection node_5
+select @@gtid_binlog_state;
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 3
+--connection node_6
+select @@gtid_binlog_state;
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 1
+--connection node_1
+select @@gtid_binlog_state;
+drop table t1;
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+
+--echo cluster 2 node 1
+--connection node_4
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+
+--connection node_2
+reset master;
+--connection node_3
+reset master;
+--connection node_5
+reset master;
+--connection node_6
+reset master;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test
new file mode 100644
index 00000000000..a6660bd08d1
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test
@@ -0,0 +1,58 @@
+#
+# This test uses innobackupex to take a backup on node #2 and then restores that node from backup
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+--connection node_2
+SELECT COUNT(*) = 10 FROM t1;
+
+--exec rm -rf $MYSQL_TMP_DIR/innobackupex_backup
+--exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 $MYSQL_TMP_DIR/innobackupex_backup --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp > $MYSQL_TMP_DIR/innobackupex-backup.log
+--exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 $MYSQL_TMP_DIR/innobackupex_backup --apply-log --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp > $MYSQL_TMP_DIR/innobackupex-apply.log
+
+--source include/kill_galera.inc
+--sleep 1
+
+--connection node_1
+INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
+
+--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/*
+--exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --copy-back $MYSQL_TMP_DIR/innobackupex_backup --port=$NODE_MYPORT_2 --host=127.0.0.1 > $MYSQL_TMP_DIR/innobackupex-restore.log
+
+#
+# Convert the xtrabackup_galera_info into a grastate.dat file
+#
+
+--perl
+ use strict;
+ my $xtrabackup_galera_info_file = $ENV{'MYSQL_TMP_DIR'}.'/innobackupex_backup/xtrabackup_galera_info';
+ open(XTRABACKUP_GALERA_INFO, $xtrabackup_galera_info_file) or die "Can not open $xtrabackup_galera_info_file: $!";
+ my $xtrabackup_galera_info = <XTRABACKUP_GALERA_INFO>;
+ my ($uuid, $seqno) = split(':', $xtrabackup_galera_info);
+
+ my $grastate_dat_file = $ENV{'MYSQLTEST_VARDIR'}.'/mysqld.2/data/grastate.dat';
+ die "grastate.dat already exists" if -e $grastate_dat_file;
+
+ open(GRASTATE_DAT, ">$grastate_dat_file") or die "Can not write to $grastate_dat_file: $!";
+ print GRASTATE_DAT "version: 2.1\n";
+ print GRASTATE_DAT "uuid: $uuid\n";
+ print GRASTATE_DAT "seqno: $seqno\n";
+ print GRASTATE_DAT "cert_index:\n";
+ exit(0);
+EOF
+
+--source include/start_mysqld.inc
+--sleep 5
+
+--source include/wait_until_connected_again.inc
+SELECT COUNT(*) = 20 FROM t1;
+
+DROP TABLE t1;
+
+--sleep 10
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
new file mode 100644
index 00000000000..3728e1ce005
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
@@ -0,0 +1,22 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test
new file mode 100644
index 00000000000..5b06e617eef
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test
@@ -0,0 +1,56 @@
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+--connection node_1
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+
+--let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth`
+SET GLOBAL wsrep_sst_auth = 'sst:';
+
+--connection node_2
+--source include/wait_until_connected_again.inc
+--let $wsrep_sst_method_orig = `SELECT @@wsrep_sst_method`
+--let $wsrep_sst_receive_address_orig = `SELECT @@wsrep_sst_receive_address`
+
+--disable_query_log
+--eval SET GLOBAL wsrep_sst_receive_address = '[::1]:$NODE_MYPORT_2';
+--enable_query_log
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+
+
+#
+# Force mysqldump SST
+#
+
+--connection node_2
+--source suite/galera/include/galera_unload_provider.inc
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+
+--connection node_2
+--source suite/galera/include/galera_load_provider.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+
+--source suite/galera/include/galera_sst_restore.inc
+--connection node_2
+CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort");
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
new file mode 100644
index 00000000000..3728e1ce005
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
@@ -0,0 +1,22 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test
new file mode 100644
index 00000000000..7ee209d8e72
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test
@@ -0,0 +1,32 @@
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Force IST
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf
new file mode 100644
index 00000000000..8a80be0d2a9
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf
@@ -0,0 +1,26 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
+
+[SST]
+sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test
new file mode 100644
index 00000000000..84eee017700
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test
@@ -0,0 +1,62 @@
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Force IST
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+# Confirm that key messages around SST and IST reference IPv6
+
+--connection node_1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST
+
+--let $assert_count = 2
+--let $assert_text = Streaming the backup to joiner at \[::1\]
+--let $assert_select = Streaming the backup to joiner at \[::1\]
+--source include/assert_grep.inc
+
+--let $assert_count = 1
+--let $assert_text = async IST sender starting to serve tcp://\[::1\]:
+--let $assert_select = async IST sender starting to serve tcp://\[::1\]:
+--source include/assert_grep.inc
+
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+
+--let $assert_text = IST receiver addr using tcp://\[::1\]
+--let $assert_select = IST receiver addr using tcp://\[::1\]
+--source include/assert_grep.inc
+
+--let $assert_text = Prepared IST receiver, listening at: tcp://\[::1\]
+--let $assert_select = Prepared IST receiver, listening at: tcp://\[::1\]
+--source include/assert_grep.inc
+
+
+
+
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf
new file mode 100644
index 00000000000..821175220ac
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf
@@ -0,0 +1,11 @@
+!include ../galera_3nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true;gcache.size=1M'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true;gcache.size=1M'
+
+[mysqld.3]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;pc.ignore_sb=true;gcache.size=1M'
+
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
new file mode 100644
index 00000000000..8575d99f066
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
@@ -0,0 +1,101 @@
+#
+# Test that if the gcache rolls over while IST is in progress, IST will still complete.
+# This is achieved by using the ist_sender_send_after_get_buffers Galera dbug sync point to block the donor after
+# the first gcache buffer has been locked for IST.
+#
+# After IST blocks, we roll over the gcache and resume IST to confirm that it completes successfully.
+#
+# Two nodes perform IST at the same time in order to make the test more stressfull
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
+
+# Disconnect nodes #2 and #3
+--connection node_2
+--source suite/galera/include/galera_unload_provider.inc
+
+--connection node_3
+--source suite/galera/include/galera_unload_provider.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
+
+# Wait until nodes #2 and #3 have left
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
+
+# Make sure IST will block ...
+--let $galera_sync_point = ist_sender_send_after_get_buffers
+--source include/galera_set_sync_point.inc
+
+# ... and restart providers to force IST
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--connection node_1
+INSERT INTO t1 VALUES (31), (32), (33), (34), (35);
+
+--connection node_3
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--connection node_1
+--sleep 2
+SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
+
+INSERT INTO t1 VALUES (41), (42), (43), (44), (45);
+
+# Roll over gcache by writing a lot of information to it
+
+CREATE TABLE t2 (f1 LONGTEXT);
+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
+
+# Unlock IST and wait for it to complete
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
+
+--connection node_2
+--source include/wait_until_connected_again.inc
+
+--connection node_3
+--source include/wait_until_connected_again.inc
+
+sleep 5;
+
+# Final checks
+--connection node_2
+SELECT COUNT(*) = 30 FROM t1;
+SELECT COUNT(*) = 3 FROM t2;
+SELECT LENGTH(f1) = 512 * 1024 FROM t2;
+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
+
+# Final checks
+--connection node_3
+SELECT COUNT(*) = 30 FROM t1;
+SELECT COUNT(*) = 3 FROM t2;
+SELECT LENGTH(f1) = 512 * 1024 FROM t2;
+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test
new file mode 100644
index 00000000000..7d80d8036a1
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test
@@ -0,0 +1,38 @@
+#
+# This test performs two dependent updates on two nodes and checks the results on the third where
+# parallel apply is enabled.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_3
+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
+SET GLOBAL wsrep_slave_threads = 2;
+
+--connection node_1
+--send UPDATE t1 SET f1 = f1 + 10;
+
+--connection node_2
+--send UPDATE t1 SET f1 = f1 + 100;
+
+--connection node_1
+--reap
+
+--connection node_2
+--reap
+
+--connection node_3
+SELECT f1 = 111 FROM t1;
+SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
+
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.cnf b/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.cnf
new file mode 100644
index 00000000000..d560b675427
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.cnf
@@ -0,0 +1,5 @@
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# prior tests such as galera_3nodes.galera_innobackupex_backup
+
+!include ../galera_3nodes.cnf
diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test b/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test
new file mode 100644
index 00000000000..f8381a3324b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test
@@ -0,0 +1,91 @@
+#
+# Test the operation of pc.bootstrap
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER);
+
+# Force all nodes to become non-primary
+--connection node_1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--sleep 10
+
+# Node #2 should be non-primary
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT variable_value = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Signal node #2 to bootstrap
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'pc.bootstrap=1';
+
+# Wait until node becomes available for queries again
+--source include/wait_until_connected_again.inc
+
+# Node #2 should now be a primary of a 1-node cluster
+
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_status';
+
+# Perform an insert on node #2
+INSERT INTO t1 VALUES (1);
+
+# Reconnect all nodes
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--sleep 10
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+
+--connection node_1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+
+--connection node_3
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--sleep 10
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Check that all nodes have the same view of the database
+
+--connection node_1
+SELECT COUNT(*) FROM t1;
+
+--connection node_2
+SELECT COUNT(*) FROM t1;
+
+--connection node_3
+SELECT COUNT(*) FROM t1;
+
+# Test cleanup
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.cnf b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.cnf
new file mode 100644
index 00000000000..57026ce6928
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.cnf
@@ -0,0 +1,5 @@
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# following tests such as galera_3nodes.galera_var_dirty_reads2
+
+!include ../galera_3nodes.cnf
diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
new file mode 100644
index 00000000000..c118b7481bc
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
@@ -0,0 +1,128 @@
+#
+# Test the pc.weight wsrep provider option. We set Node #1 to have a high weight and then
+# suspend it. This will cause Nodes #2 and #3 to transition to non-primary component.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+SET GLOBAL wsrep_provider_options = 'pc.weight=3';
+
+--source include/wait_until_connected_again.inc
+--source include/galera_suspend.inc
+--sleep 10
+
+--connection node_2
+# Do not wait for causality as we are no longer in the primary component
+SET SESSION wsrep_sync_wait=0;
+--source include/wait_until_connected_again.inc
+
+SET SESSION wsrep_on=OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
+--source include/wait_condition.inc
+SET SESSION wsrep_on=ON;
+
+# We can not use SELECT queries here, as only SHOW is allowed to run.
+# For nodes #2 and #3, we expect a non-primary component of size 2
+
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_status';
+SHOW STATUS LIKE 'wsrep_connected';
+SHOW STATUS LIKE 'wsrep_ready';
+SHOW STATUS LIKE 'wsrep_local_state';
+SHOW STATUS LIKE 'wsrep_local_state_comment';
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+--connection node_3
+SET SESSION wsrep_sync_wait=0;
+--source include/wait_until_connected_again.inc
+
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_status';
+SHOW STATUS LIKE 'wsrep_connected';
+SHOW STATUS LIKE 'wsrep_ready';
+SHOW STATUS LIKE 'wsrep_local_state';
+SHOW STATUS LIKE 'wsrep_local_state_comment';
+
+--connection node_1
+--source include/galera_resume.inc
+--sleep 10
+--source include/wait_until_connected_again.inc
+
+# For Node #1, we expect a primary component of size 1
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+
+# Restore the cluster by resetting wsrep_cluster_address on nodes #1 and #2
+
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
+--enable_query_log
+
+SET SESSION wsrep_sync_wait=0;
+--source include/wait_until_connected_again.inc
+
+--connection node_3
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
+--enable_query_log
+
+SET SESSION wsrep_sync_wait=0;
+--source include/wait_until_connected_again.inc
+
+# On all nodes, we now expect a Primary component of size 3, Synced and ready
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+--connection node_2
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+--connection node_3
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
+--connection node_1
+
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+--let $wait_condition = SELECT @@wsrep_provider_options LIKE '%pc.weight = 1%'
+--source include/wait_condition.inc
+
+CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
+
+--connection node_2
+CALL mtr.add_suppression('overriding reported weight for');
+
+--connection node_3
+CALL mtr.add_suppression('WSREP: user message in state LEAVING');
+CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
+CALL mtr.add_suppression('overriding reported weight for');
diff --git a/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
new file mode 100644
index 00000000000..7c9991e68c4
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
@@ -0,0 +1,163 @@
+#
+# Test the safe_to_bootstrap in grastate.dat
+#
+
+--source include/galera_cluster.inc
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+#
+# At start, all grastate.dat files have safe_to_boostrap: 0
+#
+
+--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0'
+--let $assert_select= safe_to_bootstrap: 0
+--let $assert_count= 1
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+#
+# Shut down one node
+#
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Still, all grastate.dat files should have safe_to_boostrap: 0
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+#
+# Shut down one more node
+#
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Now, nodes 2,3 should have safe_to_boostrap: 0
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+# But node #1 should have safe_to_boostrap: 1
+
+--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 1'
+--let $assert_select= safe_to_bootstrap: 1
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+# Restart one node
+
+--connection node_2
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# All nodes should be back to 'safe_to_bootstrap: 0'
+
+--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0'
+--let $assert_select= safe_to_bootstrap: 0
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+#
+# Kill the cluster
+#
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--source include/kill_galera.inc
+
+#
+# Only node #1 should have safe_to_bootstrap: 1
+# include/assert_grep.inc requires a running server, so we revert to simple grep
+#
+
+--error 0
+--exec grep 'safe_to_bootstrap: 1' $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+
+--error 0
+--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--error 0
+--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+
+#
+# Attempt to bootstrap nodes #2, #3, should fail
+#
+
+--error 1
+--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
+--error 1
+--exec $MYSQLD --defaults-group-suffix=.3 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
+
+#
+# Attempt to bootstrap starting from node #1, should succeed
+#
+
+--connection node_1
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--connection node_2
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_3
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+
+--connection node_3
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.cnf b/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.cnf
new file mode 100644
index 00000000000..1ebde6186c1
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.cnf
@@ -0,0 +1,7 @@
+!include ../galera_3nodes.cnf
+
+[mysqld.1]
+binlog-do-db=db2
+
+[mysqld.2]
+replicate-wild-do-table=db2.t2B
diff --git a/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.test b/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.test
new file mode 100644
index 00000000000..1437c90c670
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.test
@@ -0,0 +1,34 @@
+#
+# This tests checks the operation of binlog-do-db , replicate-wild-do-table
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 0 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 1 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+--connection node_1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.cnf b/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.cnf
new file mode 100644
index 00000000000..9b78d47e254
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.cnf
@@ -0,0 +1,7 @@
+!include ../galera_3nodes.cnf
+
+[mysqld.1]
+binlog-ignore-db=db1
+
+[mysqld.2]
+replicate-wild-ignore-table=db2.t2A
diff --git a/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.test b/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.test
new file mode 100644
index 00000000000..3e8b1557e7b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.test
@@ -0,0 +1,34 @@
+#
+# This tests checks the operation of binlog-ignore-db , replicate-wild-ignore-table
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 0 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 1 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+--connection node_1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test b/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test
new file mode 100644
index 00000000000..129ba2e1f38
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test
@@ -0,0 +1,112 @@
+#
+# Additional tests for wsrep_dirty_reads
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+SET SESSION wsrep_dirty_reads = 1;
+
+# Those statements should succeed
+
+--error 0
+SELECT f1 FROM t1;
+
+--error 0
+USE test;
+
+--error 0
+SHOW CREATE TABLE t1;
+
+--error 0
+LOCK TABLE t1 WRITE;
+
+--error 0
+UNLOCK TABLES;
+
+--error 0
+FLUSH TABLES WITH READ LOCK;
+
+--error 0
+UNLOCK TABLES;
+
+--error 0
+PREPARE stmt_select FROM 'SELECT f1 FROM t1';
+
+--error 0
+EXECUTE stmt_select;
+
+--error 0
+PREPARE stmt_update FROM 'UPDATE t1 SET f1 = f1 + f1';
+
+# Mysqldump should succeed
+
+SET GLOBAL wsrep_dirty_reads = 1;
+SET GLOBAL wsrep_sync_wait = 0;
+--error 0
+--exec $MYSQL_DUMP -u root -S $NODE_MYSOCK_2 test >/dev/null
+SET GLOBAL wsrep_dirty_reads = 0;
+SET GLOBAL wsrep_sync_wait = 15;
+
+# Those statements should fail
+
+SET SESSION wsrep_dirty_reads = 1;
+
+--error ER_UNKNOWN_COM_ERROR
+INSERT INTO t1 SELECT * FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+DELETE FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+UPDATE t1 SET f1 = f1 + 1;
+
+--error ER_UNKNOWN_COM_ERROR
+DROP TABLE t1;
+
+--error ER_UNKNOWN_COM_ERROR
+EXECUTE stmt_update;
+
+# With wsrep_dirty_reads = 0 , even SELECTS are not allowed
+
+SET SESSION wsrep_dirty_reads = 0;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT * FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+EXECUTE stmt_select;
+
+# But reads from INFORMATION_SCHEMA are allowed
+
+--error 0
+SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Restore cluster
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result
index 78660b0ef9c..617b74ca714 100644
--- a/mysql-test/suite/handler/innodb.result
+++ b/mysql-test/suite/handler/innodb.result
@@ -543,7 +543,6 @@ optimize table t1;
proceed with the normal connection
handler t1 read next;
c1
-1
handler t1 close;
read the result from the other connection
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/innodb/include/ibd_convert.pl b/mysql-test/suite/innodb/include/ibd_convert.pl
new file mode 100644
index 00000000000..bb9dfbe74b8
--- /dev/null
+++ b/mysql-test/suite/innodb/include/ibd_convert.pl
@@ -0,0 +1,24 @@
+# Convert tablespace flags to the format understood by MariaDB 10.1.0..10.1.20,
+# with the assumption that the flags were correct.
+
+sub convert_to_mariadb_101
+{
+ my ($file, $page_size) = @_;
+ open(FILE, "+<", $file) or die "Unable to open $file\n";
+ sysread(FILE, $_, $page_size)==$page_size||die "Unable to read $file\n";
+ sysseek(FILE, 0, 0)||die "Unable to seek $file\n";
+
+ # FIL_PAGE_DATA + FSP_SPACE_FLAGS = 38 + 16 = 54 bytes from the start
+ my($flags) = unpack "x[54]N", $_;
+ my $badflags = ($flags & 0x3f);
+ my $compression_level=3;
+ $badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
+ $badflags |= ($flags & 15 << 6) << 7; # PAGE_SSIZE
+
+ substr ($_, 54, 4) = pack("N", $badflags);
+ # Replace the innodb_checksum_algorithm=none checksum
+ substr ($_, 0, 4) = pack("N", 0xdeadbeef);
+ substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
+ syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n";
+ close(FILE);
+}
diff --git a/mysql-test/suite/innodb/include/innodb-page-compression.inc b/mysql-test/suite/innodb/include/innodb-page-compression.inc
new file mode 100644
index 00000000000..3acbeaf0988
--- /dev/null
+++ b/mysql-test/suite/innodb/include/innodb-page-compression.inc
@@ -0,0 +1,131 @@
+--disable_warnings
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+--enable_warnings
+
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+
+--disable_query_log
+begin;
+let $i = 2000;
+while ($i)
+{
+ insert into innodb_normal(b) values(REPEAT('Aa',50));
+ insert into innodb_normal(b) values(REPEAT('a',100));
+ insert into innodb_normal(b) values(REPEAT('b',100));
+ insert into innodb_normal(b) values(REPEAT('0',100));
+ insert into innodb_normal(b) values(REPEAT('1',100));
+ dec $i;
+}
+
+insert into innodb_page_compressed1 select * from innodb_normal;
+insert into innodb_page_compressed2 select * from innodb_normal;
+insert into innodb_page_compressed3 select * from innodb_normal;
+insert into innodb_page_compressed4 select * from innodb_normal;
+insert into innodb_page_compressed5 select * from innodb_normal;
+insert into innodb_page_compressed6 select * from innodb_normal;
+insert into innodb_page_compressed7 select * from innodb_normal;
+insert into innodb_page_compressed8 select * from innodb_normal;
+insert into innodb_page_compressed9 select * from innodb_normal;
+commit;
+--enable_query_log
+
+select count(*) from innodb_page_compressed1;
+select count(*) from innodb_page_compressed3;
+select count(*) from innodb_page_compressed4;
+select count(*) from innodb_page_compressed5;
+select count(*) from innodb_page_compressed6;
+select count(*) from innodb_page_compressed6;
+select count(*) from innodb_page_compressed7;
+select count(*) from innodb_page_compressed8;
+select count(*) from innodb_page_compressed9;
+
+#
+# Wait until pages are really compressed
+#
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
+--source include/wait_condition.inc
+
+--let $MYSQLD_DATADIR=`select @@datadir`
+
+# shutdown before grep
+
+--source include/shutdown_mysqld.inc
+
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_normal.ibd
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=AaAaAaAa
+--echo # innodb_normal expected FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed1.ibd
+--echo # innodb_page_compressed1 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed2.ibd
+--echo # innodb_page_compressed2 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed3.ibd
+--echo # innodb_page_compressed3 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed4.ibd
+--echo # innodb_page_compressed4 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed5.ibd
+--echo # innodb_page_compressed5 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed6.ibd
+--echo # innodb_page_compressed6 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed7.ibd
+--echo # innodb_page_compressed7 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed8.ibd
+--echo # innodb_page_compressed8 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed9.ibd
+--echo # innodb_page_compressed9 page compressed expected NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+
+-- source include/start_mysqld.inc
+
+select count(*) from innodb_page_compressed1;
+select count(*) from innodb_page_compressed3;
+select count(*) from innodb_page_compressed4;
+select count(*) from innodb_page_compressed5;
+select count(*) from innodb_page_compressed6;
+select count(*) from innodb_page_compressed6;
+select count(*) from innodb_page_compressed7;
+select count(*) from innodb_page_compressed8;
+select count(*) from innodb_page_compressed9;
+
+let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_DECOMPRESSED';
+--source include/wait_condition.inc
+
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
diff --git a/mysql-test/suite/innodb/include/innodb-wl6045.inc b/mysql-test/suite/innodb/include/innodb-wl6045.inc
new file mode 100644
index 00000000000..33a2ecd731f
--- /dev/null
+++ b/mysql-test/suite/innodb/include/innodb-wl6045.inc
@@ -0,0 +1,22 @@
+--echo ===> Testing size=$size
+--disable_warnings
+--eval CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$size
+--enable_warnings
+
+insert into t1 values(1,"I");
+insert into t1 values(2,"AM");
+insert into t1 values(3,"COMPRESSED");
+
+--source include/shutdown_mysqld.inc
+
+#STOP;
+
+--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/t1.ibd
+--exec $INNOCHECKSUM --write=crc32 $MYSQLD_DATADIR/test/t1.ibd
+--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/t1.ibd
+--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/t1.ibd
+--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/t1.ibd
+
+--source include/start_mysqld.inc
+select * from t1;
+drop table t1;
diff --git a/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc b/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc
index 47494d60375..bc64937669a 100644
--- a/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc
+++ b/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc
@@ -30,6 +30,8 @@ SET GLOBAL innodb_simulate_comp_failures = 25;
--disable_result_log
let $num_inserts_ind = $num_inserts;
+let $commit_iterations=50;
+
while ($num_inserts_ind)
{
let $repeat = `select floor(rand() * 10)`;
@@ -49,6 +51,9 @@ SELECT COUNT(*) FROM t1;
# do random ops, making sure that some pages will get fragmented and reorganized.
let $num_ops_ind = $num_ops;
+let $commit_count= $commit_iterations;
+
+BEGIN;
while($num_ops_ind)
{
@@ -133,9 +138,19 @@ while($num_ops_ind)
}
}
+ dec $commit_count;
+ if (!$commit_count)
+ {
+ let $commit_count= $commit_iterations;
+ COMMIT;
+ BEGIN;
+ }
+
dec $num_ops_ind;
}
+COMMIT;
+
# final cleanup
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/include/no_checkpoint_end.inc b/mysql-test/suite/innodb/include/no_checkpoint_end.inc
new file mode 100644
index 00000000000..7ca81f8ade0
--- /dev/null
+++ b/mysql-test/suite/innodb/include/no_checkpoint_end.inc
@@ -0,0 +1,35 @@
+# Check that the latest checkpoint in the redo log files
+# is not newer than the checkpoint sampled by no_checkpoint_start.inc
+
+--source include/kill_mysqld.inc
+
+perl;
+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*", $_);
+close(LOG);
+
+my $cp1 = $cp1hi << 32 | $cp1lo;
+my $cp2 = $cp2hi << 32 | $cp2lo;
+
+open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die;
+
+if ($cp1 > $cp || $cp2 > $cp) {
+ print OUT "--source include/start_mysqld.inc\n";
+ print OUT "$ENV{CLEANUP_IF_CHECKPOINT}\n";
+ print OUT "--skip Extra checkpoint 1 after $cp";
+ print OUT " ($no1hi:$no1lo=$cp1,$no2hi:$no2lo=$cp2)\n";
+}
+
+close(OUT);
+EOF
+
+--source $MYSQLTEST_VARDIR/log/check.txt
+--remove_file $MYSQLTEST_VARDIR/log/check.txt
diff --git a/mysql-test/suite/innodb/include/no_checkpoint_start.inc b/mysql-test/suite/innodb/include/no_checkpoint_start.inc
new file mode 100644
index 00000000000..a903fee67d4
--- /dev/null
+++ b/mysql-test/suite/innodb/include/no_checkpoint_start.inc
@@ -0,0 +1,5 @@
+# Preparation for using no_checkpoint_end.inc
+
+let MYSQLD_DATADIR= `select @@datadir`;
+--replace_regex /.*Last checkpoint at[ ]*([0-9]+).*/\1/
+let CHECKPOINT_LSN=`SHOW ENGINE INNODB STATUS`;
diff --git a/mysql-test/suite/innodb/r/101_compatibility.result b/mysql-test/suite/innodb/r/101_compatibility.result
new file mode 100644
index 00000000000..7ec8bb19c10
--- /dev/null
+++ b/mysql-test/suite/innodb/r/101_compatibility.result
@@ -0,0 +1,45 @@
+#
+# MDEV-11623 MariaDB 10.1 fails to start datadir created with
+# MariaDB 10.0/MySQL 5.6 using innodb-page-size!=16K
+#
+CREATE TABLE tr(a INT)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+CREATE TABLE tc(a INT)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+CREATE TABLE td(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE TABLE tz(a INT)ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+CREATE TABLE tdd(a INT) ENGINE=InnoDB, DATA DIRECTORY='MYSQL_TMP_DIR';
+CREATE TABLE tp(a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC PAGE_COMPRESSED=1;
+CREATE TABLE ti(a INT) ENGINE=InnoDB;
+FLUSH TABLES ti FOR EXPORT;
+backup: ti
+UNLOCK TABLES;
+ALTER TABLE ti DISCARD TABLESPACE;
+restore: ti .ibd and .cfg files
+ALTER TABLE ti IMPORT TABLESPACE;
+BEGIN;
+INSERT INTO tr VALUES(1);
+INSERT INTO tc VALUES(1);
+INSERT INTO td VALUES(1);
+INSERT INTO tz VALUES(1);
+INSERT INTO tdd VALUES(1);
+INSERT INTO tp VALUES(1);
+INSERT INTO ti VALUES(1);
+# Kill the server
+CHECK TABLE tr,tc,td,tz,tdd,tp,ti;
+Table Op Msg_type Msg_text
+test.tr check status OK
+test.tc check status OK
+test.td check status OK
+test.tz check status OK
+test.tdd check status OK
+test.tp check status OK
+test.ti check status OK
+CHECK TABLE tr,tc,td,tz,tdd,tp,ti;
+Table Op Msg_type Msg_text
+test.tr check status OK
+test.tc check status OK
+test.td check status OK
+test.tz check status OK
+test.tdd check status OK
+test.tp check status OK
+test.ti check status OK
+DROP TABLE tr,tc,td,tz,tdd,tp,ti;
diff --git a/mysql-test/suite/innodb/r/binlog_consistent.result b/mysql-test/suite/innodb/r/binlog_consistent.result
index 47f9900c449..1e095c6596e 100644
--- a/mysql-test/suite/innodb/r/binlog_consistent.result
+++ b/mysql-test/suite/innodb/r/binlog_consistent.result
@@ -3,11 +3,11 @@ RESET MASTER;
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 486
+master-bin.000001 <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000001
-Binlog_snapshot_position 486
+Binlog_snapshot_position <pos>
BEGIN;
INSERT INTO t1 VALUES (0, "");
# Connection con1
@@ -38,10 +38,10 @@ a b
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000001
-Binlog_snapshot_position 988
+Binlog_snapshot_position <pos>
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 1340
+master-bin.000001 <pos>
SELECT * FROM t2 ORDER BY a;
a
2
@@ -60,50 +60,47 @@ a b
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000001
-Binlog_snapshot_position 988
+Binlog_snapshot_position <pos>
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000002 367
+master-bin.000002 <pos>
COMMIT;
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000002
-Binlog_snapshot_position 367
+Binlog_snapshot_position <pos>
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000002 367
-SHOW BINLOG EVENTS;
+master-bin.000002 <pos>
+include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 248 Server ver: #, Binlog ver: #
-master-bin.000001 248 Gtid_list 1 273 []
-master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001
-master-bin.000001 313 Gtid 1 351 GTID 0-1-1
-master-bin.000001 351 Query 1 486 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
-master-bin.000001 486 Gtid 1 524 GTID 0-1-2
-master-bin.000001 524 Query 1 636 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
-master-bin.000001 636 Gtid 1 674 BEGIN GTID 0-1-3
-master-bin.000001 674 Query 1 762 use `test`; INSERT INTO t2 VALUES (2)
-master-bin.000001 762 Query 1 831 COMMIT
-master-bin.000001 831 Gtid 1 869 BEGIN GTID 0-1-4
-master-bin.000001 869 Query 1 961 use `test`; INSERT INTO t1 VALUES (0, "")
-master-bin.000001 961 Xid 1 988 COMMIT /* XID */
-master-bin.000001 988 Gtid 1 1026 BEGIN GTID 0-1-5
-master-bin.000001 1026 Query 1 1114 use `test`; INSERT INTO t2 VALUES (3)
-master-bin.000001 1114 Query 1 1183 COMMIT
-master-bin.000001 1183 Gtid 1 1221 BEGIN GTID 0-1-6
-master-bin.000001 1221 Query 1 1313 use `test`; INSERT INTO t1 VALUES (4, "")
-master-bin.000001 1313 Xid 1 1340 COMMIT /* XID */
-master-bin.000001 1340 Gtid 1 1378 BEGIN GTID 0-1-7
-master-bin.000001 1378 Query 1 1470 use `test`; INSERT INTO t1 VALUES (1, "")
-master-bin.000001 1470 Xid 1 1497 COMMIT /* XID */
-master-bin.000001 1497 Gtid 1 1535 BEGIN GTID 0-1-8
-master-bin.000001 1535 Query 1 1632 use `test`; INSERT INTO t1 VALUES (2, "first")
-master-bin.000001 1632 Query 1 1730 use `test`; INSERT INTO t1 VALUES (2, "second")
-master-bin.000001 1730 Xid 1 1757 COMMIT /* XID */
-master-bin.000001 1757 Gtid 1 1795 BEGIN GTID 0-1-9
-master-bin.000001 1795 Query 1 1887 use `test`; INSERT INTO t1 VALUES (3, "")
-master-bin.000001 1887 Xid 1 1914 COMMIT /* XID */
-master-bin.000001 1914 Rotate 1 1958 master-bin.000002;pos=4
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (2)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (0, "")
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (3)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4, "")
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1, "")
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2, "first")
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2, "second")
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3, "")
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Rotate # # master-bin.000002;pos=POS
*** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit ***
SET @old_size= @@GLOBAL.max_binlog_size;
SET GLOBAL max_binlog_size=4096;
diff --git a/mysql-test/suite/innodb/r/create_isl_with_direct.result b/mysql-test/suite/innodb/r/create_isl_with_direct.result
new file mode 100644
index 00000000000..87544e6dcdf
--- /dev/null
+++ b/mysql-test/suite/innodb/r/create_isl_with_direct.result
@@ -0,0 +1,10 @@
+SHOW VARIABLES LIKE 'innodb_flush_method';
+Variable_name Value
+innodb_flush_method O_DIRECT
+CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='MYSQL_TMP_DIR';
+# Contents of tmp/test directory containing .ibd file
+t1.ibd
+# Contents of the 'test' database directory containing .isl and .frm files
+t1.frm
+t1.isl
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/data_types.result b/mysql-test/suite/innodb/r/data_types.result
index c026d44eb79..446d37527e5 100644
--- a/mysql-test/suite/innodb/r/data_types.result
+++ b/mysql-test/suite/innodb/r/data_types.result
@@ -112,7 +112,7 @@ t1_BLOB DATA_BLOB
t1_CHAR_100 DATA_CHAR
t1_CHAR_100_BINARY DATA_MYSQL
t1_DATE DATA_INT
-t1_DATETIME DATA_INT
+t1_DATETIME DATA_FIXBINARY
t1_DATETIME_6 DATA_FIXBINARY
t1_DECIMAL_10_3 DATA_FIXBINARY
t1_DECIMAL_10_3_UNSIGNED DATA_FIXBINARY UNSIGNED
@@ -137,8 +137,8 @@ t1_SET_BINARY DATA_INT UNSIGNED
t1_SMALLINT DATA_INT
t1_SMALLINT_UNSIGNED DATA_INT UNSIGNED
t1_TEXT DATA_BLOB
-t1_TIME DATA_INT
-t1_TIMESTAMP DATA_INT UNSIGNED
+t1_TIME DATA_FIXBINARY
+t1_TIMESTAMP DATA_FIXBINARY UNSIGNED
t1_TIMESTAMP_5 DATA_FIXBINARY UNSIGNED
t1_TIME_4 DATA_FIXBINARY
t1_TINYBLOB DATA_BLOB
diff --git a/mysql-test/suite/innodb/r/defrag_mdl-9155.result b/mysql-test/suite/innodb/r/defrag_mdl-9155.result
new file mode 100644
index 00000000000..36cafd305ba
--- /dev/null
+++ b/mysql-test/suite/innodb/r/defrag_mdl-9155.result
@@ -0,0 +1,15 @@
+set global innodb_defragment=1;
+create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb;
+insert t1 select null, repeat('a', 256) from seq_1_to_100;
+select count(*) from t1;
+count(*)
+100
+start transaction;
+select count(*) from t1;
+count(*)
+100
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+drop table t1;
+set global innodb_defragment=default;
diff --git a/mysql-test/suite/innodb/r/doublewrite.result b/mysql-test/suite/innodb/r/doublewrite.result
new file mode 100644
index 00000000000..7cc4a436e5c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/doublewrite.result
@@ -0,0 +1,251 @@
+#
+# Bug #17335427 INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY
+# Bug #18144349 INNODB CANNOT USE THE DOUBLEWRITE BUFFER FOR THE FIRST
+# PAGE OF SYSTEM TABLESPACE
+#
+SET GLOBAL innodb_fast_shutdown = 0;
+show variables like 'innodb_doublewrite';
+Variable_name Value
+innodb_doublewrite ON
+show variables like 'innodb_fil_make_page_dirty_debug';
+Variable_name Value
+innodb_fil_make_page_dirty_debug 0
+show variables like 'innodb_saved_page_number_debug';
+Variable_name Value
+innodb_saved_page_number_debug 0
+create table t1 (f1 int primary key, f2 blob) engine=innodb;
+start transaction;
+insert into t1 values(1, repeat('#',12));
+insert into t1 values(2, repeat('+',12));
+insert into t1 values(3, repeat('/',12));
+insert into t1 values(4, repeat('-',12));
+insert into t1 values(5, repeat('.',12));
+commit work;
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if first page of user
+# tablespace is full of zeroes.
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+# Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+begin;
+insert into t1 values (6, repeat('%', 12));
+# Make the first page dirty for table t1
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+# Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Make the first page (page_no=0) of the user tablespace
+# full of zeroes.
+#
+# MDEV-11623: Use old FSP_SPACE_FLAGS in the doublewrite buffer.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+# Test End
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if first page of user
+# tablespace is corrupted.
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+# Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+begin;
+insert into t1 values (6, repeat('%', 12));
+# Make the first page dirty for table t1
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+# Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Corrupt the first page (page_no=0) of the user tablespace.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+# Test End
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if 2nd page of user
+# tablespace is full of zeroes.
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+# Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+begin;
+insert into t1 values (6, repeat('%', 400));
+# Make the 2nd page dirty for table t1
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+# Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Make the 2nd page (page_no=1) of the tablespace all zeroes.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+# Test End
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if 2nd page of user
+# tablespace is corrupted.
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+# Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+begin;
+insert into t1 values (6, repeat('%', 400));
+# Make the 2nd page dirty for table t1
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+# Ensure that the dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Corrupt the 2nd page (page_no=1) of the user tablespace.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+# Test End
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if first page of
+# system tablespace is full of zeroes.
+begin;
+insert into t1 values (6, repeat('%', 400));
+# Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Make the first page dirty for system tablespace
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = 0;
+# Ensure that the dirty page of system tablespace is also flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Make the first page (page_no=0) of the system tablespace
+# all zeroes.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+# Test End
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if first page of
+# system tablespace is corrupted.
+begin;
+insert into t1 values (6, repeat('%', 400));
+# Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Make the first page dirty for system tablespace
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = 0;
+# Ensure that the dirty page of system tablespace is also flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Corrupt the first page (page_no=0) of the system tablespace.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+# Test End
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if 2nd page of
+# system tablespace is full of zeroes.
+begin;
+insert into t1 values (6, repeat('%', 400));
+# Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Make the second page dirty for system tablespace
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = 0;
+# Ensure that the dirty page of system tablespace is also flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Make the 2nd page (page_no=1) of the system tablespace
+# all zeroes.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+# Test End
+# ---------------------------------------------------------------
+# Test Begin: Test if recovery works if 2nd page of
+# system tablespace is corrupted.
+begin;
+insert into t1 values (6, repeat('%', 400));
+# Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+# Make the second page dirty for system tablespace
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = 0;
+# Ensure that the dirty page of system tablespace is also flushed.
+set global innodb_buf_flush_list_now = 1;
+# Kill the server
+# Make the 2nd page (page_no=1) of the system tablespace
+# all zeroes.
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+FOUND /\[ERROR\] InnoDB: .* in tablespace.*test.t1.*/ in mysqld.1.err
+select f1, f2 from t1;
+f1 f2
+1 ############
+2 ++++++++++++
+3 ////////////
+4 ------------
+5 ............
+drop table t1;
+#
+# MDEV-12600 crash during install_db with innodb_page_size=32K
+# and ibdata1=3M
+#
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+FOUND /\[ERROR\] InnoDB: Cannot create doublewrite buffer/ in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/fake_changes-7000.result b/mysql-test/suite/innodb/r/fake_changes-7000.result
new file mode 100644
index 00000000000..e41020b7d74
--- /dev/null
+++ b/mysql-test/suite/innodb/r/fake_changes-7000.result
@@ -0,0 +1,6 @@
+create table t1 (i int) engine=InnoDB;
+set innodb_fake_changes = 1;
+insert into t1 values (1);
+ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
+set innodb_fake_changes = 0;
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/group_commit.result b/mysql-test/suite/innodb/r/group_commit.result
index 1009a83637f..5321715df36 100644
--- a/mysql-test/suite/innodb/r/group_commit.result
+++ b/mysql-test/suite/innodb/r/group_commit.result
@@ -3,11 +3,11 @@ SELECT variable_value INTO @commits FROM information_schema.global_status
WHERE variable_name = 'binlog_commits';
SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits';
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group1_running WAIT_FOR group2_queued";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group1_running WAIT_FOR group2_queued";
INSERT INTO t1 VALUES ("con1");
set DEBUG_SYNC= "now WAIT_FOR group1_running";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2";
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group2_running";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group2_running";
SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed";
SET DEBUG_SYNC= "commit_after_group_run_commit_ordered SIGNAL group2_visible WAIT_FOR group2_checked";
INSERT INTO t1 VALUES ("con2");
@@ -25,7 +25,7 @@ SET DEBUG_SYNC= "now SIGNAL group2_queued";
SELECT * FROM t1 ORDER BY a;
a
con1
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group3_con5";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group3_con5";
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued";
set DEBUG_SYNC= "now WAIT_FOR group2_running";
INSERT INTO t1 VALUES ("con5");
diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
index 23f80b01a8d..8a0eed2bf3c 100644
--- a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
+++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
@@ -31,6 +31,6 @@ a
1
2
3
-InnoDB: Last MySQL binlog file position 0 926, file name ./master-bin.000001
+InnoDB: Last MySQL binlog file position 0 <pos>, file name ./master-bin.000001
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
index 3ef8a4acc0f..d85b6681360 100644
--- a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
@@ -32,6 +32,6 @@ a
1
2
3
-InnoDB: Last MySQL binlog file position 0 926, file name ./master-bin.000001
+InnoDB: Last MySQL binlog file position 0 <pos>, file name ./master-bin.000001
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/group_commit_crash.result b/mysql-test/suite/innodb/r/group_commit_crash.result
index 5d5dffab33e..005049df281 100644
--- a/mysql-test/suite/innodb/r/group_commit_crash.result
+++ b/mysql-test/suite/innodb/r/group_commit_crash.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
c CHAR(255),
diff --git a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
index 542ce9d496e..846500ad2b1 100644
--- a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
c CHAR(255),
diff --git a/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result
index 34a638da2d5..dd152fd3c9c 100644
--- a/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result
@@ -3,11 +3,11 @@ SELECT variable_value INTO @commits FROM information_schema.global_status
WHERE variable_name = 'binlog_commits';
SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits';
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group1_running WAIT_FOR group2_queued";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group1_running WAIT_FOR group2_queued";
INSERT INTO t1 VALUES ("con1");
set DEBUG_SYNC= "now WAIT_FOR group1_running";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2";
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group2_running";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group2_running";
SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed";
INSERT INTO t1 VALUES ("con2");
SET DEBUG_SYNC= "now WAIT_FOR group2_con2";
@@ -25,7 +25,7 @@ SET DEBUG_SYNC= "now SIGNAL group2_queued";
SELECT * FROM t1 ORDER BY a;
a
con1
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group3_con5";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group3_con5";
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued";
set DEBUG_SYNC= "now WAIT_FOR group2_running";
INSERT INTO t1 VALUES ("con5");
diff --git a/mysql-test/suite/innodb/r/innochecksum.result b/mysql-test/suite/innodb/r/innochecksum.result
index c75e83e5ed7..6fc613f3d1f 100644
--- a/mysql-test/suite/innodb/r/innochecksum.result
+++ b/mysql-test/suite/innodb/r/innochecksum.result
@@ -15,17 +15,8 @@ INSERT INTO t3(b) SELECT b from t1;
# We want SQL to initiate the first access to t1.ibd.
# Wait until disconnected.
# Run innochecksum on t1
-InnoDB offline file checksum utility.
-Table is uncompressed
-Page size is 16384
# Run innochecksum on t2
-InnoDB offline file checksum utility.
-Table is compressed
-Key block size is 8192
# Run innochecksum on t3
-InnoDB offline file checksum utility.
-Table is compressed
-Key block size is 16384
# Write file to make mysql-test-run.pl start up the server again
# Cleanup
DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/innodb/r/innodb-16k.result b/mysql-test/suite/innodb/r/innodb-16k.result
new file mode 100644
index 00000000000..77ff688f130
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-16k.result
@@ -0,0 +1,981 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# Test 1) Show the page size from Information Schema
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_page_size';
+variable_value
+16384
+# Test 4) The maximum row size is dependent upon the page size.
+# Redundant: 8123, Compact: 8126.
+# Compressed: 8126, Dynamic: 8126.
+# Each row format has its own amount of overhead that
+# varies depending on number of fields and other overhead.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212)
+) ROW_FORMAT=redundant;
+ERROR 42000: Row size too large (> 8123). 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.
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+) ROW_FORMAT=compact;
+ERROR 42000: 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.
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(157)
+) ROW_FORMAT=compressed;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160)
+) ROW_FORMAT=compressed;
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+) ROW_FORMAT=dynamic;
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(4) character set utf8,
+PRIMARY KEY (a,b,c,d,e))
+ENGINE=innodb;
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(5) character set utf8,
+PRIMARY KEY (a,b,c,d,e))
+ENGINE=innodb;
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(255) character set utf8,
+f varchar(4) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e,f))
+ENGINE=innodb;
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(255) character set utf8,
+f varchar(5) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e,f))
+ENGINE=innodb;
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+# Test 5) Make sure that KEY_BLOCK_SIZE=16, 8, 4, 2 & 1
+# are all accepted.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=16
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=8
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED
+DROP TABLE t1;
+SET SESSION innodb_strict_mode = OFF;
+CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=16
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=8
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED key_block_size=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT table_name, row_format, create_options
+FROM information_schema.tables WHERE table_name = 't1';
+table_name row_format create_options
+t1 Compressed row_format=COMPRESSED
+DROP TABLE t1;
+SET GLOBAL innodb_file_format = `Barracuda`;
+CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8;
+CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t3 VALUES (22),(44),(33),(55),(66);
+INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'),
+('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
+CREATE TABLE t1(a int, b blob, c text, d text NOT NULL)
+ENGINE=innodb DEFAULT CHARSET=utf8;
+INSERT INTO t1
+SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3;
+DROP TABLE t2, t3;
+SELECT COUNT(*) FROM t1 WHERE a=44;
+COUNT(*)
+5
+SELECT a,
+LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1;
+a LENGTH(b) b=LEFT(REPEAT(d,100*a),65535) LENGTH(c) c=REPEAT(d,20*a) d
+22 22000 1 4400 1 adfd72nh9k
+22 35200 1 7040 1 adfdijn0loKNHJik
+22 28600 1 5720 1 adfdijnmnb78k
+22 26400 1 5280 1 adfdpplkeock
+22 22000 1 4400 1 jejdkrun87
+33 33000 1 6600 1 adfd72nh9k
+33 52800 1 10560 1 adfdijn0loKNHJik
+33 42900 1 8580 1 adfdijnmnb78k
+33 39600 1 7920 1 adfdpplkeock
+33 33000 1 6600 1 jejdkrun87
+44 44000 1 8800 1 adfd72nh9k
+44 65535 1 14080 1 adfdijn0loKNHJik
+44 57200 1 11440 1 adfdijnmnb78k
+44 52800 1 10560 1 adfdpplkeock
+44 44000 1 8800 1 jejdkrun87
+55 55000 1 11000 1 adfd72nh9k
+55 65535 1 17600 1 adfdijn0loKNHJik
+55 65535 1 14300 1 adfdijnmnb78k
+55 65535 1 13200 1 adfdpplkeock
+55 55000 1 11000 1 jejdkrun87
+66 65535 1 13200 1 adfd72nh9k
+66 65535 1 21120 1 adfdijn0loKNHJik
+66 65535 1 17160 1 adfdijnmnb78k
+66 65535 1 15840 1 adfdpplkeock
+66 65535 1 13200 1 jejdkrun87
+ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+DELETE FROM t1 WHERE d='null';
+ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+DELETE FROM t1 WHERE a%2;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767));
+SELECT COUNT(*) FROM t1 WHERE a=44;
+COUNT(*)
+5
+SELECT a,
+LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1;
+a LENGTH(b) b=LEFT(REPEAT(d,100*a), 65535) LENGTH(c) c=REPEAT(d,20*a) d
+22 22000 1 4400 1 adfd72nh9k
+22 35200 1 7040 1 adfdijn0loKNHJik
+22 28600 1 5720 1 adfdijnmnb78k
+22 26400 1 5280 1 adfdpplkeock
+22 22000 1 4400 1 jejdkrun87
+44 44000 1 8800 1 adfd72nh9k
+44 65535 1 14080 1 adfdijn0loKNHJik
+44 57200 1 11440 1 adfdijnmnb78k
+44 52800 1 10560 1 adfdpplkeock
+44 44000 1 8800 1 jejdkrun87
+66 65535 1 13200 1 adfd72nh9k
+66 65535 1 21120 1 adfdijn0loKNHJik
+66 65535 1 17160 1 adfdijnmnb78k
+66 65535 1 15840 1 adfdpplkeock
+66 65535 1 13200 1 jejdkrun87
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` blob NOT NULL,
+ `c` text NOT NULL,
+ `d` text NOT NULL,
+ PRIMARY KEY (`a`,`b`(255),`c`(255)),
+ KEY `b` (`b`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+# Test 8) Test creating a table that could lead to undo log overflow.
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+o blob,p blob,q blob,r blob,s blob,t blob,u blob)
+ENGINE=InnoDB ROW_FORMAT=dynamic;
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
+CREATE INDEX t1f ON t1 (f(767));
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
+k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
+n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+COMMIT;
+CREATE INDEX t1g ON t1 (g(767));
+UPDATE t1 SET g=@e;
+CREATE INDEX t1h ON t1 (h(767));
+UPDATE t1 SET h=@e;
+CREATE INDEX t1i ON t1 (i(767));
+UPDATE t1 SET i=@e;
+CREATE INDEX t1j ON t1 (j(767));
+UPDATE t1 SET j=@e;
+CREATE INDEX t1k ON t1 (k(767));
+UPDATE t1 SET k=@e;
+CREATE INDEX t1l ON t1 (l(767));
+UPDATE t1 SET l=@e;
+CREATE INDEX t1m ON t1 (m(767));
+UPDATE t1 SET m=@e;
+CREATE INDEX t1n ON t1 (n(767));
+UPDATE t1 SET n=@e;
+CREATE INDEX t1o ON t1 (o(767));
+UPDATE t1 SET o=@e;
+CREATE INDEX t1p ON t1 (p(767));
+UPDATE t1 SET p=@e;
+CREATE INDEX t1q ON t1 (q(767));
+UPDATE t1 SET q=@e;
+CREATE INDEX t1r ON t1 (r(767));
+UPDATE t1 SET r=@e;
+CREATE INDEX t1s ON t1 (s(767));
+UPDATE t1 SET s=@e;
+CREATE INDEX t1t ON t1 (t(767));
+BEGIN;
+UPDATE t1 SET t=@e;
+ROLLBACK;
+CREATE INDEX t1u ON t1 (u(767));
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+CREATE INDEX t1ut ON t1 (u(767), t(767));
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+CREATE INDEX t1st ON t1 (s(767), t(767));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ `q` blob,
+ `r` blob,
+ `s` blob,
+ `t` blob,
+ `u` blob,
+ KEY `t1a` (`a`(767)),
+ KEY `t1b` (`b`(767)),
+ KEY `t1c` (`c`(767)),
+ KEY `t1d` (`d`(767)),
+ KEY `t1e` (`e`(767)),
+ KEY `t1f` (`f`(767)),
+ KEY `t1g` (`g`(767)),
+ KEY `t1h` (`h`(767)),
+ KEY `t1i` (`i`(767)),
+ KEY `t1j` (`j`(767)),
+ KEY `t1k` (`k`(767)),
+ KEY `t1l` (`l`(767)),
+ KEY `t1m` (`m`(767)),
+ KEY `t1n` (`n`(767)),
+ KEY `t1o` (`o`(767)),
+ KEY `t1p` (`p`(767)),
+ KEY `t1q` (`q`(767)),
+ KEY `t1r` (`r`(767)),
+ KEY `t1s` (`s`(767)),
+ KEY `t1t` (`t`(767)),
+ KEY `t1st` (`s`(767),`t`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+DROP TABLE t1;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+Test an assertion failure on purge.
+CREATE TABLE t1_purge (
+A int,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+CREATE TABLE t2_purge (
+A int PRIMARY KEY,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob, I blob,
+J blob, K blob, L blob,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+CREATE TABLE t3_purge (
+A int,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+CREATE TABLE t4_purge (
+A int PRIMARY KEY,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800), I varchar(800),
+J varchar(800), K varchar(800), L varchar(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+SET GLOBAL innodb_file_per_table=on;
+SET GLOBAL innodb_file_format='Barracuda';
+SET @r=REPEAT('a',500);
+CREATE TABLE tlong(a int,
+v1 varchar(500), v2 varchar(500), v3 varchar(500),
+v4 varchar(500), v5 varchar(500), v6 varchar(500),
+v7 varchar(500), v8 varchar(500), v9 varchar(500),
+v10 varchar(500), v11 varchar(500), v12 varchar(500),
+v13 varchar(500), v14 varchar(500), v15 varchar(500),
+v16 varchar(500), v17 varchar(500), v18 varchar(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON tlong(a,v1);
+INSERT INTO tlong VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE tlong SET a=1000;
+DELETE FROM tlong;
+CREATE TABLE tlong2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+ENGINE=innodb ROW_FORMAT=dynamic;
+SET @r = REPEAT('a', 767);
+INSERT INTO tlong2 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+CREATE INDEX ndx_a ON tlong2 (a(500));
+CREATE INDEX ndx_b ON tlong2 (b(500));
+CREATE INDEX ndx_c ON tlong2 (c(500));
+CREATE INDEX ndx_d ON tlong2 (d(500));
+CREATE INDEX ndx_e ON tlong2 (e(500));
+CREATE INDEX ndx_f ON tlong2 (f(500));
+CREATE INDEX ndx_k ON tlong2 (k(500));
+CREATE INDEX ndx_l ON tlong2 (l(500));
+SET @r = REPEAT('b', 500);
+UPDATE tlong2 set a=@r,b=@r,c=@r,d=@r;
+UPDATE tlong2 set e=@r,f=@r,g=@r,h=@r;
+UPDATE tlong2 set i=@r,j=@r,k=@r,l=@r;
+UPDATE tlong2 set m=@r,n=@r,o=@r,p=@r;
+ALTER TABLE tlong2 DROP INDEX ndx_a;
+ALTER TABLE tlong2 DROP INDEX ndx_b;
+CREATE INDEX ndx_g ON tlong2 (g(500));
+CREATE INDEX ndx_h ON tlong2 (h(500));
+CREATE INDEX ndx_i ON tlong2 (i(500));
+CREATE INDEX ndx_j ON tlong2 (j(500));
+CREATE INDEX ndx_m ON tlong2 (m(500));
+CREATE INDEX ndx_n ON tlong2 (n(500));
+CREATE INDEX ndx_o ON tlong2 (o(500));
+CREATE INDEX ndx_p ON tlong2 (p(500));
+SHOW CREATE TABLE tlong2;
+Table Create Table
+tlong2 CREATE TABLE `tlong2` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ KEY `ndx_c` (`c`(500)),
+ KEY `ndx_d` (`d`(500)),
+ KEY `ndx_e` (`e`(500)),
+ KEY `ndx_f` (`f`(500)),
+ KEY `ndx_k` (`k`(500)),
+ KEY `ndx_l` (`l`(500)),
+ KEY `ndx_g` (`g`(500)),
+ KEY `ndx_h` (`h`(500)),
+ KEY `ndx_i` (`i`(500)),
+ KEY `ndx_j` (`j`(500)),
+ KEY `ndx_m` (`m`(500)),
+ KEY `ndx_n` (`n`(500)),
+ KEY `ndx_o` (`o`(500)),
+ KEY `ndx_p` (`p`(500))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE bug12547647(
+a int NOT NULL, b blob NOT NULL, c text,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO bug12547647 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
+COMMIT;
+BEGIN;
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+SHOW WARNINGS;
+Level Code Message
+ROLLBACK;
+DROP TABLE bug12547647;
+SET SESSION innodb_strict_mode = off;
+CREATE TABLE t1(
+c text NOT NULL, d text NOT NULL,
+PRIMARY KEY (c(767),d(767)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1(
+c text NOT NULL, d text NOT NULL,
+PRIMARY KEY (c(767),d(767)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1(
+c text NOT NULL, d text NOT NULL,
+PRIMARY KEY (c(767),d(767)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
+drop table t1;
+CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
+INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
+DROP TABLE t1;
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE tlong;
+DROP TABLE tlong2;
+SET SESSION innodb_strict_mode = on;
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=dynamic,ENGINE=INNODB;
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=compact,ENGINE=INNODB;
+ERROR 42000: 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.
diff --git a/mysql-test/suite/innodb/r/innodb-32k-crash.result b/mysql-test/suite/innodb/r/innodb-32k-crash.result
new file mode 100644
index 00000000000..3286cc8d55c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-32k-crash.result
@@ -0,0 +1,291 @@
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+v blob, w blob, x blob, y blob, z blob,
+aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+va blob, wa blob, xa blob, ya blob, za blob)
+ENGINE=InnoDB ROW_FORMAT=dynamic;
+CREATE TABLE t2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+v blob, w blob, x blob, y blob, z blob,
+aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+va blob, wa blob, xa blob, ya blob, za blob)
+ENGINE=InnoDB ROW_FORMAT=compact;
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+SET @f = repeat('f', 767);
+SET @f = repeat('g', 767);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+SET @f = repeat('h', 500);
+SET @f = repeat('i', 500);
+SET @f = repeat('j', 500);
+SET @f = repeat('k', 500);
+SET @f = repeat('l', 500);
+SET @f = repeat('m', 500);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+v=@b,w=@b,x=@b,y=@b,z=@b,
+aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+va=@b,wa=@b,xa=@b,ya=@b,za=@b;
+UPDATE t2 SET a=@i,b=@i,c=@i,d=@i,e=@i,f=@i,g=@i,h=@i,i=@i,j=@i,
+k=@i,l=@i,m=@i,n=@i,o=@i,p=@i,q=@i,r=@i,s=@i,t=@i,u=@i,
+v=@i,w=@i,x=@i,y=@i,z=@i,
+aa=@i,ba=@i,ca=@i,da=@i,ea=@i,fa=@i,ga=@i,ha=@i,ia=@i,ja=@i,
+ka=@i,la=@i,ma=@i,na=@i,oa=@i,pa=@i,qa=@i,ra=@i,sa=@i,ta=@i,ua=@i,
+va=@i,wa=@i,xa=@i,ya=@i,za=@i;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+CREATE INDEX t1f1 ON t1 (f(767));
+CREATE INDEX t1f2 ON t1 (g(767));
+CREATE INDEX t1f3 ON t1 (h(767));
+CREATE INDEX t1f4 ON t1 (i(767));
+CREATE INDEX t1f5 ON t1 (j(767));
+CREATE INDEX t1a ON t2 (a(767));
+CREATE INDEX t1b ON t2 (b(767));
+CREATE INDEX t1c ON t2 (c(767));
+CREATE INDEX t1d ON t2 (d(767));
+CREATE INDEX t1e ON t2 (e(767));
+CREATE INDEX t1f1 ON t2 (f(767));
+CREATE INDEX t1f2 ON t2 (g(767));
+CREATE INDEX t1f3 ON t2 (h(767));
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+v=@c,w=@c,x=@b,y=@c,z=@c,
+aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@b,ua=@c,
+va=@c,wa=@c,xa=@c,ya=@c,za=@c;
+UPDATE t2 SET a=@k,b=@k,c=@k,d=@k,e=@k,f=@k,g=@k,h=@k,i=@k,j=@k,
+k=@k,l=@k,m=@k,n=@k,o=@k,p=@k,q=@k,r=@k,s=@k,t=@k,u=@k,
+v=@k,w=@k,x=@b,y=@k,z=@k,
+aa=@k,ba=@k,ca=@k,da=@k,ea=@k,fa=@k,ga=@k,ha=@k,ia=@k,ja=@k,
+ka=@k,la=@k,ma=@k,na=@k,oa=@k,pa=@k,qa=@k,ra=@k,sa=@k,ta=@b,ua=@k,
+va=@k,wa=@k,xa=@k,ya=@k,za=@k;
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+COMMIT;
+BEGIN;
+UPDATE t2 SET a=@l,b=@l,c=@l,d=@l,e=@l;
+UPDATE t2 SET f=@l,g=@l,h=@l,i=@l,j=@l;
+UPDATE t2 SET k=@l,l=@l,m=@l,n=@l,o=@l;
+UPDATE t2 SET p=@l,q=@l,r=@l,s=@l,t=@l,u=@l;
+UPDATE t2 SET v=@l,w=@l,x=@l,y=@l,z=@l;
+UPDATE t2 SET aa=@l,ba=@l,ca=@l,da=@l;
+UPDATE t2 SET ea=@l,fa=@l,ga=@l,ha=@l,ia=@l,ja=@l;
+UPDATE t2 SET ka=@l,la=@l,ma=@l,na=@l,oa=@l,pa=@l;
+UPDATE t2 SET qa=@l,ra=@l,sa=@l,ta=@l,ua=@l;
+UPDATE t2 SET va=@l,wa=@l,xa=@l,ya=@l,za=@l;
+COMMIT;
+BEGIN;
+INSERT INTO t1 SELECT * from t2;
+UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e;
+# Kill and restart
+UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f,f=@f,g=@f,h=@f,i=@f,j=@f,
+k=@f,l=@f,m=@f,n=@f,o=@f,p=@f,q=@f,r=@f,s=@f,t=@f,u=@f,
+v=@f,w=@f,x=@b,y=@f,z=@f,
+aa=@f,ba=@f,ca=@f,da=@f,ea=@f,fa=@f,ga=@f,ha=@f,ia=@f,ja=@f,
+ka=@f,la=@f,ma=@f,na=@f,oa=@f,pa=@f,qa=@f,ra=@f,sa=@f,ta=@b,ua=@f,
+va=@f,wa=@f,xa=@f,ya=@f,za=@f;
+UPDATE t2 SET a=@h,b=@h,c=@h,d=@h,e=@h,f=@h,g=@h,h=@h,i=@h,j=@h,
+k=@h,l=@h,m=@h,n=@h,o=@h,p=@h,q=@h,r=@h,s=@h,t=@h,u=@h,
+v=@h,w=@h,x=@b,y=@h,z=@h,
+aa=@h,ba=@h,ca=@h,da=@h,ea=@h,fa=@h,ga=@h,ha=@h,ia=@h,ja=@h,
+ka=@h,la=@h,ma=@h,na=@h,oa=@h,pa=@h,qa=@h,ra=@h,sa=@h,ta=@b,ua=@h,
+va=@h,wa=@h,xa=@h,ya=@h,za=@h;
+BEGIN;
+UPDATE t1 SET a=@g,b=@g,c=@g,d=@g,e=@g;
+UPDATE t1 SET f=@g,g=@g,h=@g,i=@g,j=@g;
+UPDATE t1 SET k=@g,l=@g,m=@g,n=@g,o=@g;
+UPDATE t1 SET p=@g,q=@g,r=@g,s=@g,t=@g,u=@g;
+UPDATE t1 SET v=@g,w=@g,x=@g,y=@g,z=@g;
+UPDATE t1 SET aa=@g,ba=@g,ca=@g,da=@g;
+UPDATE t1 SET ea=@g,fa=@g,ga=@g,ha=@g,ia=@g,ja=@g;
+UPDATE t1 SET ka=@g,la=@g,ma=@g,na=@g,oa=@g,pa=@g;
+UPDATE t1 SET qa=@g,ra=@g,sa=@g,ta=@g,ua=@g;
+UPDATE t1 SET va=@g,wa=@g,xa=@g,ya=@g,za=@g;
+COMMIT;
+BEGIN;
+UPDATE t2 SET a=@m,b=@m,c=@m,d=@m,e=@m;
+UPDATE t2 SET f=@m,g=@m,h=@m,i=@m,j=@m;
+UPDATE t2 SET k=@m,l=@m,m=@m,n=@m,o=@m;
+UPDATE t2 SET p=@m,q=@m,r=@m,s=@m,t=@m,u=@m;
+UPDATE t2 SET v=@m,w=@m,x=@m,y=@m,z=@m;
+UPDATE t2 SET aa=@m,ba=@m,ca=@m,da=@m;
+UPDATE t2 SET ea=@m,fa=@m,ga=@m,ha=@m,ia=@m,ja=@m;
+UPDATE t2 SET ka=@m,la=@m,ma=@m,na=@m,oa=@m,pa=@m;
+UPDATE t2 SET qa=@m,ra=@m,sa=@m,ta=@m,ua=@m;
+UPDATE t2 SET va=@m,wa=@m,xa=@m,ya=@m,za=@m;
+COMMIT;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ `q` blob,
+ `r` blob,
+ `s` blob,
+ `t` blob,
+ `u` blob,
+ `v` blob,
+ `w` blob,
+ `x` blob,
+ `y` blob,
+ `z` blob,
+ `aa` blob,
+ `ba` blob,
+ `ca` blob,
+ `da` blob,
+ `ea` blob,
+ `fa` blob,
+ `ga` blob,
+ `ha` blob,
+ `ia` blob,
+ `ja` blob,
+ `ka` blob,
+ `la` blob,
+ `ma` blob,
+ `na` blob,
+ `oa` blob,
+ `pa` blob,
+ `qa` blob,
+ `ra` blob,
+ `sa` blob,
+ `ta` blob,
+ `ua` blob,
+ `va` blob,
+ `wa` blob,
+ `xa` blob,
+ `ya` blob,
+ `za` blob,
+ KEY `t1a` (`a`(767)),
+ KEY `t1b` (`b`(767)),
+ KEY `t1c` (`c`(767)),
+ KEY `t1d` (`d`(767)),
+ KEY `t1e` (`e`(767)),
+ KEY `t1f1` (`f`(767)),
+ KEY `t1f2` (`g`(767)),
+ KEY `t1f3` (`h`(767)),
+ KEY `t1f4` (`i`(767)),
+ KEY `t1f5` (`j`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ `q` blob,
+ `r` blob,
+ `s` blob,
+ `t` blob,
+ `u` blob,
+ `v` blob,
+ `w` blob,
+ `x` blob,
+ `y` blob,
+ `z` blob,
+ `aa` blob,
+ `ba` blob,
+ `ca` blob,
+ `da` blob,
+ `ea` blob,
+ `fa` blob,
+ `ga` blob,
+ `ha` blob,
+ `ia` blob,
+ `ja` blob,
+ `ka` blob,
+ `la` blob,
+ `ma` blob,
+ `na` blob,
+ `oa` blob,
+ `pa` blob,
+ `qa` blob,
+ `ra` blob,
+ `sa` blob,
+ `ta` blob,
+ `ua` blob,
+ `va` blob,
+ `wa` blob,
+ `xa` blob,
+ `ya` blob,
+ `za` blob,
+ KEY `t1a` (`a`(767)),
+ KEY `t1b` (`b`(767)),
+ KEY `t1c` (`c`(767)),
+ KEY `t1d` (`d`(767)),
+ KEY `t1e` (`e`(767)),
+ KEY `t1f1` (`f`(767)),
+ KEY `t1f2` (`g`(767)),
+ KEY `t1f3` (`h`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+drop table t1,t2;
diff --git a/mysql-test/suite/innodb/r/innodb-32k.result b/mysql-test/suite/innodb/r/innodb-32k.result
new file mode 100644
index 00000000000..f9635fefccb
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-32k.result
@@ -0,0 +1,869 @@
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+call mtr.add_suppression("InnoDB: Resizing redo log from *");
+call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files.");
+call mtr.add_suppression("InnoDB: New log files created, LSN=*");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# Test 1) Show the page size from Information Schema
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_page_size';
+variable_value
+32768
+# Test 4) The maximum row size is dependent upon the page size.
+# Redundant: 16315, Compact: 16318.
+# Compressed: 16318, Dynamic: ?.
+# Each row format has its own amount of overhead that
+# varies depending on number of fields and other overhead.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(121)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(122)
+) ROW_FORMAT=redundant;
+ERROR 42000: Row size too large (> max_row_size). 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.
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(82)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(83)
+) ROW_FORMAT=compact;
+ERROR 42000: Row size too large (> max_row_size). 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.
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(63)
+) ROW_FORMAT=compressed;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(82)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(83)
+) ROW_FORMAT=dynamic;
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(4) character set utf8,
+PRIMARY KEY (a,b,c,d,e))
+ENGINE=innodb;
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(5) character set utf8,
+PRIMARY KEY (a,b,c,d,e))
+ENGINE=innodb;
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(255) character set utf8,
+f varchar(4) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e,f))
+ENGINE=innodb;
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(255) character set utf8,
+f varchar(5) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e,f))
+ENGINE=innodb;
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+# Test 8) Test creating a table that could lead to undo log overflow.
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+v blob, w blob, x blob, y blob, z blob,
+aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+va blob, wa blob, xa blob, ya blob, za blob)
+ENGINE=InnoDB ROW_FORMAT=dynamic;
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+v=@b,w=@b,x=@b,y=@b,z=@b,
+aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+va=@b,wa=@b,xa=@b,ya=@b,za=@b;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+CREATE INDEX t1f1 ON t1 (f(767));
+CREATE INDEX t1f2 ON t1 (g(767));
+CREATE INDEX t1f3 ON t1 (h(767));
+CREATE INDEX t1f4 ON t1 (i(767));
+CREATE INDEX t1f5 ON t1 (j(767));
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+v=@c,w=@c,x=@c,y=@c,z=@c,
+aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+va=@c,wa=@c,xa=@c,ya=@c,za=@c;
+CREATE INDEX t1f17 ON t1 (v(767));
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
+k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
+v=@d,w=@d,x=@d,y=@d,z=@d,
+aa=@d,ba=@d,ca=@d,da=@d,ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d,
+ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d,qa=@d,ra=@d,sa=@d,ta=@d,ua=@d,
+va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+COMMIT;
+CREATE INDEX t1k ON t1 (k(767));
+CREATE INDEX t1f7 ON t1 (m(767));
+CREATE INDEX t1f8 ON t1 (n(767));
+CREATE INDEX t1f9 ON t1 (o(767));
+CREATE INDEX t1f11 ON t1 (p(767));
+CREATE INDEX t1f12 ON t1 (q(767));
+CREATE INDEX t1f13 ON t1 (r(767));
+CREATE INDEX t1f14 ON t1 (s(767));
+CREATE INDEX t1f15 ON t1 (t(767));
+CREATE INDEX t1f16 ON t1 (u(767));
+CREATE INDEX t1f18 ON t1 (w(767));
+CREATE INDEX t1f19 ON t1 (x(767));
+CREATE INDEX t1f20 ON t1 (y(767));
+CREATE INDEX t1f21 ON t1 (z(767));
+CREATE INDEX ta1a ON t1 (aa(767));
+CREATE INDEX tb1b ON t1 (ba(767));
+CREATE INDEX tc1c ON t1 (ca(767));
+CREATE INDEX td1d ON t1 (da(767));
+CREATE INDEX te1e ON t1 (ea(767));
+CREATE INDEX tf1f1 ON t1 (fa(767));
+CREATE INDEX tg1f2 ON t1 (ga(767));
+CREATE INDEX th1f3 ON t1 (ha(767));
+CREATE INDEX ti1f4 ON t1 (ia(767));
+CREATE INDEX tj1f5 ON t1 (ka(767));
+CREATE INDEX tk1f6 ON t1 (la(767));
+CREATE INDEX tl1f7 ON t1 (ma(767));
+CREATE INDEX tm1f8 ON t1 (na(767));
+CREATE INDEX tn1f9 ON t1 (oa(767));
+CREATE INDEX to1f11 ON t1 (pa(767));
+UPDATE t1 SET t=@e;
+CREATE INDEX t1f6 ON t1 (l(767));
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 16318. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+drop table t1;
+Test an assertion failure on purge.
+CREATE TABLE t1_purge (
+A int,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+CREATE TABLE t2_purge (
+A int PRIMARY KEY,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob, I blob,
+J blob, K blob, L blob,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+CREATE TABLE t3_purge (
+A int,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+CREATE TABLE t4_purge (
+A int PRIMARY KEY,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800), I varchar(800),
+J varchar(800), K varchar(800), L varchar(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+SET GLOBAL innodb_file_per_table=on;
+SET GLOBAL innodb_file_format='Barracuda';
+SET @r=REPEAT('a',500);
+CREATE TABLE tlong(a int,
+v1 varchar(500), v2 varchar(500), v3 varchar(500),
+v4 varchar(500), v5 varchar(500), v6 varchar(500),
+v7 varchar(500), v8 varchar(500), v9 varchar(500),
+v10 varchar(500), v11 varchar(500), v12 varchar(500),
+v13 varchar(500), v14 varchar(500), v15 varchar(500),
+v16 varchar(500), v17 varchar(500), v18 varchar(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON tlong(a,v1);
+INSERT INTO tlong VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE tlong SET a=1000;
+DELETE FROM tlong;
+CREATE TABLE tlong2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+ENGINE=innodb ROW_FORMAT=dynamic;
+SET @r = REPEAT('a', 767);
+INSERT INTO tlong2 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+CREATE INDEX ndx_a ON tlong2 (a(500));
+CREATE INDEX ndx_b ON tlong2 (b(500));
+CREATE INDEX ndx_c ON tlong2 (c(500));
+CREATE INDEX ndx_d ON tlong2 (d(500));
+CREATE INDEX ndx_e ON tlong2 (e(500));
+CREATE INDEX ndx_f ON tlong2 (f(500));
+CREATE INDEX ndx_k ON tlong2 (k(500));
+CREATE INDEX ndx_l ON tlong2 (l(500));
+SET @r = REPEAT('b', 500);
+UPDATE tlong2 set a=@r,b=@r,c=@r,d=@r;
+UPDATE tlong2 set e=@r,f=@r,g=@r,h=@r;
+UPDATE tlong2 set i=@r,j=@r,k=@r,l=@r;
+UPDATE tlong2 set m=@r,n=@r,o=@r,p=@r;
+ALTER TABLE tlong2 DROP INDEX ndx_a;
+ALTER TABLE tlong2 DROP INDEX ndx_b;
+CREATE INDEX ndx_g ON tlong2 (g(500));
+CREATE INDEX ndx_h ON tlong2 (h(500));
+CREATE INDEX ndx_i ON tlong2 (i(500));
+CREATE INDEX ndx_j ON tlong2 (j(500));
+CREATE INDEX ndx_m ON tlong2 (m(500));
+CREATE INDEX ndx_n ON tlong2 (n(500));
+CREATE INDEX ndx_o ON tlong2 (o(500));
+CREATE INDEX ndx_p ON tlong2 (p(500));
+SHOW CREATE TABLE tlong2;
+Table Create Table
+tlong2 CREATE TABLE `tlong2` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ KEY `ndx_c` (`c`(500)),
+ KEY `ndx_d` (`d`(500)),
+ KEY `ndx_e` (`e`(500)),
+ KEY `ndx_f` (`f`(500)),
+ KEY `ndx_k` (`k`(500)),
+ KEY `ndx_l` (`l`(500)),
+ KEY `ndx_g` (`g`(500)),
+ KEY `ndx_h` (`h`(500)),
+ KEY `ndx_i` (`i`(500)),
+ KEY `ndx_j` (`j`(500)),
+ KEY `ndx_m` (`m`(500)),
+ KEY `ndx_n` (`n`(500)),
+ KEY `ndx_o` (`o`(500)),
+ KEY `ndx_p` (`p`(500))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t3(
+a int NOT NULL, b blob NOT NULL, c text,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
+COMMIT;
+UPDATE t3 SET c = REPEAT('b',16928);
+SHOW WARNINGS;
+Level Code Message
+UPDATE t3 SET c = REPEAT('b',32800);
+SHOW WARNINGS;
+Level Code Message
+DROP TABLE t3;
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE tlong;
+DROP TABLE tlong2;
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=dynamic,ENGINE=INNODB;
+set @a = repeat('0123456789', 800);
+set @b = repeat('9876543210', 800);
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+update t2 set col190=@b;
+set @a = repeat('0123456789', 1650);
+set @b = repeat('9876543210', 2000);
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+update t2 set col190=@b;
+set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650);
+set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `COL1` text,
+ `COL2` text,
+ `COL3` text,
+ `COL4` text,
+ `COL5` text,
+ `COL6` text,
+ `COL7` text,
+ `COL8` text,
+ `COL9` text,
+ `COL10` text,
+ `COL11` text,
+ `COL12` text,
+ `COL13` text,
+ `COL14` text,
+ `COL15` text,
+ `COL16` text,
+ `COL17` text,
+ `COL18` text,
+ `COL19` text,
+ `COL20` text,
+ `COL21` text,
+ `COL22` text,
+ `COL23` text,
+ `COL24` text,
+ `COL25` text,
+ `COL26` text,
+ `COL27` text,
+ `COL28` text,
+ `COL29` text,
+ `COL30` text,
+ `COL31` text,
+ `COL32` text,
+ `COL33` text,
+ `COL34` text,
+ `COL35` text,
+ `COL36` text,
+ `COL37` text,
+ `COL38` text,
+ `COL39` text,
+ `COL40` text,
+ `COL41` text,
+ `COL42` text,
+ `COL43` text,
+ `COL44` text,
+ `COL45` text,
+ `COL46` text,
+ `COL47` text,
+ `COL48` text,
+ `COL49` text,
+ `COL50` text,
+ `COL51` text,
+ `COL52` text,
+ `COL53` text,
+ `COL54` text,
+ `COL55` text,
+ `COL56` text,
+ `COL57` text,
+ `COL58` text,
+ `COL59` text,
+ `COL60` text,
+ `COL61` text,
+ `COL62` text,
+ `COL63` text,
+ `COL64` text,
+ `COL65` text,
+ `COL66` text,
+ `COL67` text,
+ `COL68` text,
+ `COL69` text,
+ `COL70` text,
+ `COL71` text,
+ `COL72` text,
+ `COL73` text,
+ `COL74` text,
+ `COL75` text,
+ `COL76` text,
+ `COL77` text,
+ `COL78` text,
+ `COL79` text,
+ `COL80` text,
+ `COL81` text,
+ `COL82` text,
+ `COL83` text,
+ `COL84` text,
+ `COL85` text,
+ `COL86` text,
+ `COL87` text,
+ `COL88` text,
+ `COL89` text,
+ `COL90` text,
+ `COL91` text,
+ `COL92` text,
+ `COL93` text,
+ `COL94` text,
+ `COL95` text,
+ `COL96` text,
+ `COL97` text,
+ `COL98` text,
+ `COL99` text,
+ `COL100` text,
+ `COL101` text,
+ `COL102` text,
+ `COL103` text,
+ `COL104` text,
+ `COL105` text,
+ `COL106` text,
+ `COL107` text,
+ `COL108` text,
+ `COL109` text,
+ `COL110` text,
+ `COL111` text,
+ `COL112` text,
+ `COL113` text,
+ `COL114` text,
+ `COL115` text,
+ `COL116` text,
+ `COL117` text,
+ `COL118` text,
+ `COL119` text,
+ `COL120` text,
+ `COL121` text,
+ `COL122` text,
+ `COL123` text,
+ `COL124` text,
+ `COL125` text,
+ `COL126` text,
+ `COL127` text,
+ `COL128` text,
+ `COL129` text,
+ `COL130` text,
+ `COL131` text,
+ `COL132` text,
+ `COL133` text,
+ `COL134` text,
+ `COL135` text,
+ `COL136` text,
+ `COL137` text,
+ `COL138` text,
+ `COL139` text,
+ `COL140` text,
+ `COL141` text,
+ `COL142` text,
+ `COL143` text,
+ `COL144` text,
+ `COL145` text,
+ `COL146` text,
+ `COL147` text,
+ `COL148` text,
+ `COL149` text,
+ `COL150` text,
+ `COL151` text,
+ `COL152` text,
+ `COL153` text,
+ `COL154` text,
+ `COL155` text,
+ `COL156` text,
+ `COL157` text,
+ `COL158` text,
+ `COL159` text,
+ `COL160` text,
+ `COL161` text,
+ `COL162` text,
+ `COL163` text,
+ `COL164` text,
+ `COL165` text,
+ `COL166` text,
+ `COL167` text,
+ `COL168` text,
+ `COL169` text,
+ `COL170` text,
+ `COL171` text,
+ `COL172` text,
+ `COL173` text,
+ `COL174` text,
+ `COL175` text,
+ `COL176` text,
+ `COL177` text,
+ `COL178` text,
+ `COL179` text,
+ `COL180` text,
+ `COL181` text,
+ `COL182` text,
+ `COL183` text,
+ `COL184` text,
+ `COL185` text,
+ `COL186` text,
+ `COL187` text,
+ `COL188` text,
+ `COL189` text,
+ `COL190` text,
+ `COL191` text,
+ `COL192` text,
+ `COL193` text,
+ `COL194` text,
+ `COL195` text,
+ `COL196` text,
+ `COL197` text
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+update t2 set col150=@a;
+update t2 set col145=@b;
+drop table t2;
diff --git a/mysql-test/suite/innodb/r/innodb-64k-crash.result b/mysql-test/suite/innodb/r/innodb-64k-crash.result
new file mode 100644
index 00000000000..cad855cae2b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-64k-crash.result
@@ -0,0 +1,594 @@
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+v blob, w blob, x blob, y blob, z blob,
+aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+va blob, wa blob, xa blob, ya blob, za blob,
+ab blob,bb blob,cb blob,db blob,eb blob,fb blob,gb blob,
+hb blob,ib blob,jb blob,kb blob,lb blob,mb blob,nb blob,
+ob blob,pb blob,qb blob,rb blob,sb blob,tb blob,ub blob,
+vb blob, wb blob, xb blob, yb blob, zb blob,
+ac blob, bc blob, cc blob, dc blob, ec blob,fc blob,gc blob,
+hc blob, ic blob, jc blob, kc blob, lc blob,mc blob,nc blob,
+oc blob, pc blob, qc blob, rc blob, sc blob,tc blob,uc blob,
+vc blob, wc blob, xc blob, yc blob, zc blob
+) ENGINE=InnoDB ROW_FORMAT=dynamic;
+CREATE TABLE t2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+v blob, w blob, x blob, y blob, z blob,
+aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+va blob, wa blob, xa blob, ya blob, za blob,
+ab blob,bb blob,cb blob,db blob,eb blob,fb blob,gb blob,
+hb blob,ib blob,jb blob,kb blob,lb blob,mb blob,nb blob,
+ob blob,pb blob,qb blob,rb blob,sb blob,tb blob,ub blob,
+vb blob, wb blob, xb blob, yb blob, zb blob,
+ac blob, bc blob, cc blob, dc blob, ec blob,fc blob,gc blob,
+hc blob, ic blob, jc blob, kc blob, lc blob,mc blob,nc blob,
+oc blob, pc blob, qc blob, rc blob, sc blob,tc blob,uc blob,
+vc blob, wc blob, xc blob, yc blob, zc blob
+) ENGINE=InnoDB ROW_FORMAT=compact;
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+SET @f = repeat('f', 767);
+SET @f = repeat('g', 767);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+SET @h = repeat('h', 100);
+SET @i = repeat('i', 100);
+SET @j = repeat('j', 100);
+SET @k = repeat('k', 100);
+SET @l = repeat('l', 100);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h
+);
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+v=@b,w=@b,x=@b,y=@b,z=@b,
+aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+va=@b,wa=@b,xa=@b,ya=@b,za=@b,
+ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ac=@b,bc=@b,cc=@b,dc=@b,ec=@b,fc=@b,gc=@b,hc=@b,ic=@b,jc=@b,
+kc=@b,lc=@b,mc=@b,nc=@b,oc=@b,pc=@b,qc=@b,rc=@b,sc=@b,tc=@b,uc=@b,
+vc=@b,wc=@b,xc=@b,yc=@b,zc=@b;
+UPDATE t2 SET a=@i,b=@i,c=@i,d=@i,e=@i,f=@i,g=@i,h=@i,i=@i,j=@i,
+k=@i,l=@i,m=@i,n=@i,o=@i,p=@i,q=@i,r=@i,s=@i,t=@i,u=@i,
+v=@i,w=@i,x=@i,y=@i,z=@i,
+aa=@i,ba=@i,ca=@i,da=@i,ea=@i,fa=@i,ga=@i,ha=@i,ia=@i,ja=@i,
+ka=@i,la=@i,ma=@i,na=@i,oa=@i,pa=@i,qa=@i,ra=@i,sa=@i,ta=@i,ua=@i,
+va=@i,wa=@i,xa=@i,ya=@i,za=@i,
+ab=@i,bb=@i,cb=@i,db=@i,eb=@i,fb=@i,gb=@i,hb=@i,ib=@i,jb=@i,
+kb=@i,lb=@i,mb=@i,nb=@i,ob=@i,pb=@i,qb=@i,rb=@i,sb=@i,tb=@i,ub=@i,
+vb=@i,wb=@i,xb=@i,yb=@i,zb=@i,
+ab=@i,bb=@i,cb=@i,db=@i,eb=@i,fb=@i,gb=@i,hb=@i,ib=@i,jb=@i,
+kb=@i,lb=@i,mb=@i,nb=@i,ob=@i,pb=@i,qb=@i,rb=@i,sb=@i,tb=@i,ub=@i,
+vb=@i,wb=@i,xb=@i,yb=@i,zb=@i,
+ac=@i,bc=@i,cc=@i,dc=@i,ec=@i,fc=@i,gc=@i,hc=@i,ic=@i,jc=@i,
+kc=@i,lc=@i,mc=@i,nc=@i,oc=@i,pc=@i,qc=@i,rc=@i,sc=@i,tc=@i,uc=@i,
+vc=@i,wc=@i,xc=@i,yc=@i,zc=@i;
+CREATE INDEX t1a ON t1 (a(767),b(767));
+CREATE INDEX t1c ON t1 (c(767),d(767));
+CREATE INDEX t1e ON t1 (e(767),f(767));
+CREATE INDEX t1f2 ON t1 (g(767),h(767));
+CREATE INDEX t1f4 ON t1 (i(767),j(767));
+CREATE INDEX t1k ON t1 (k(767),m(767));
+CREATE INDEX t1f8 ON t1 (n(767),o(767));
+CREATE INDEX t1f11 ON t1 (p(767),q(767));
+CREATE INDEX t1f13 ON t1 (r(767),s(767));
+CREATE INDEX t1f15 ON t1 (t(767),u(767));
+CREATE INDEX t1f18 ON t1 (w(767),x(767));
+CREATE INDEX t1f20 ON t1 (y(767),z(767));
+CREATE INDEX ta1a6 ON t1 (aa(767),ba(767));
+CREATE INDEX tc1c6 ON t1 (ca(767),da(767));
+CREATE INDEX te1e6 ON t1 (ea(767),fa(767));
+CREATE INDEX t2a ON t2 (a(767),b(767));
+CREATE INDEX t2c ON t2 (c(767),d(767));
+CREATE INDEX t2e ON t2 (e(767),f(767));
+CREATE INDEX t2f2 ON t2 (g(767),h(767));
+CREATE INDEX t2f4 ON t2 (i(767),j(767));
+CREATE INDEX t2k ON t2 (k(767),m(767));
+CREATE INDEX t2f8 ON t2 (n(767),o(767));
+CREATE INDEX t2f11 ON t2 (p(767),q(767));
+CREATE INDEX t2f13 ON t2 (r(767),s(767));
+CREATE INDEX t2f15 ON t2 (t(767),u(767));
+CREATE INDEX t2f18 ON t2 (w(767),x(767));
+CREATE INDEX t2f20 ON t2 (y(767),z(767));
+CREATE INDEX ta2a6 ON t2 (aa(767),ba(767));
+CREATE INDEX tc2c6 ON t2 (ca(767),da(767));
+CREATE INDEX te2e6 ON t2 (ea(767),fa(767));
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+v=@c,w=@c,x=@c,y=@c,z=@c,
+aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+va=@c,wa=@c,xa=@c,ya=@c,za=@c,
+ab=@c,bb=@c,cb=@c,db=@c,eb=@c,fb=@c,gb=@c,hb=@c,ib=@c,jb=@c,
+kb=@c,lb=@c,mb=@c,nb=@c,ob=@c,pb=@c,qb=@c,rb=@c,sb=@c,tb=@c,ub=@c,
+vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
+ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
+kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
+vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
+UPDATE t2 SET a=@k,b=@k,c=@k,d=@k,e=@k,f=@k,g=@k,h=@k,i=@k,j=@k,
+k=@k,l=@k,m=@k,n=@k,o=@k,p=@k,q=@k,r=@k,s=@k,t=@k,u=@k,
+v=@k,w=@k,x=@k,y=@k,z=@k,
+aa=@k,ba=@k,ca=@k,da=@k,ea=@k,fa=@k,ga=@k,ha=@k,ia=@k,ja=@k,
+ka=@k,la=@k,ma=@k,na=@k,oa=@k,pa=@k,qa=@k,ra=@k,sa=@k,ta=@k,ua=@k,
+va=@k,wa=@k,xa=@k,ya=@k,za=@k,
+ab=@k,bb=@k,cb=@k,db=@k,eb=@k,fb=@k,gb=@k,hb=@k,ib=@k,jb=@k,
+kb=@k,lb=@k,mb=@k,nb=@k,ob=@k,pb=@k,qb=@k,rb=@k,sb=@k,tb=@k,ub=@k,
+vb=@k,wb=@k,xb=@k,yb=@k,zb=@k,
+ac=@k,bc=@k,cc=@k,dc=@k,ec=@k,fc=@k,gc=@k,hc=@k,ic=@k,jc=@k,
+kc=@k,lc=@k,mc=@k,nc=@k,oc=@k,pc=@k,qc=@k,rc=@k,sc=@k,tc=@k,uc=@k,
+vc=@k,wc=@k,xc=@k,yc=@k,zc=@k;
+COMMIT;
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+UPDATE t1 SET ab=@d,bb=@d,cb=@d,db=@d;
+UPDATE t1 SET eb=@d,fb=@d,gb=@d,hb=@d,ib=@d,ja=@d;
+UPDATE t1 SET kb=@d,lb=@d,mb=@d,nb=@d,ob=@d,pa=@d;
+UPDATE t1 SET qb=@d,rb=@d,sb=@d,tb=@d,ub=@d;
+UPDATE t1 SET vb=@d,wb=@d,xb=@d,yb=@d,zb=@d;
+UPDATE t1 SET ac=@d,bc=@d,cc=@d,dc=@d;
+UPDATE t1 SET ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d;
+UPDATE t1 SET kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d;
+UPDATE t1 SET qc=@d,rc=@d,sc=@d,tc=@d,uc=@d;
+UPDATE t1 SET vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
+COMMIT;
+BEGIN;
+UPDATE t2 SET a=@i,b=@i,c=@i,d=@i,e=@i;
+UPDATE t2 SET f=@i,g=@i,h=@i,i=@i,j=@i;
+UPDATE t2 SET k=@i,l=@i,m=@i,n=@i,o=@i;
+UPDATE t2 SET p=@i,q=@i,r=@i,s=@i,t=@i,u=@i;
+UPDATE t2 SET v=@i,w=@i,x=@i,y=@i,z=@i;
+UPDATE t2 SET aa=@i,ba=@i,ca=@i,da=@i;
+UPDATE t2 SET ea=@i,fa=@i,ga=@i,ha=@i,ia=@i,ja=@i;
+UPDATE t2 SET ka=@i,la=@i,ma=@i,na=@i,oa=@i,pa=@i;
+UPDATE t2 SET qa=@i,ra=@i,sa=@i,ta=@i,ua=@i;
+UPDATE t2 SET va=@i,wa=@i,xa=@i,ya=@i,za=@i;
+UPDATE t2 SET ab=@i,bb=@i,cb=@i,db=@i;
+UPDATE t2 SET eb=@i,fb=@i,gb=@i,hb=@i,ib=@i,ja=@i;
+UPDATE t2 SET kb=@i,lb=@i,mb=@i,nb=@i,ob=@i,pa=@i;
+UPDATE t2 SET qb=@i,rb=@i,sb=@i,tb=@i,ub=@i;
+UPDATE t2 SET vb=@i,wb=@i,xb=@i,yb=@i,zb=@i;
+UPDATE t2 SET ac=@i,bc=@i,cc=@i,dc=@i;
+UPDATE t2 SET ec=@i,fc=@i,gc=@i,hc=@i,ic=@i,jc=@i;
+UPDATE t2 SET kc=@i,lc=@i,mc=@i,nc=@i,oc=@i,pc=@i;
+UPDATE t2 SET qc=@i,rc=@i,sc=@i,tc=@i,uc=@i;
+UPDATE t2 SET vc=@i,wc=@i,xc=@i,yc=@i,zc=@i;
+COMMIT;
+BEGIN;
+INSERT INTO t1 SELECT * from t2;
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+v=@c,w=@c,x=@c,y=@c,z=@c,
+aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+va=@c,wa=@c,xa=@c,ya=@c,za=@c,
+ab=@c,bb=@c,cb=@c,db=@c,eb=@c,fb=@c,gb=@c,hb=@c,ib=@c,jb=@c,
+kb=@c,lb=@c,mb=@c,nb=@c,ob=@c,pb=@c,qb=@c,rb=@c,sb=@c,tb=@c,ub=@c,
+vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
+ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
+kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
+vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
+# Kill and restart
+UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e,f=@e,g=@e,h=@e,i=@e,j=@e,
+k=@e,l=@e,m=@e,n=@e,o=@e,p=@e,q=@e,r=@e,s=@e,t=@e,u=@e,
+v=@e,w=@e,x=@e,y=@e,z=@e,
+aa=@e,ba=@e,ca=@e,da=@e,ea=@e,fa=@e,ga=@e,ha=@e,ia=@e,ja=@e,
+ka=@e,la=@e,ma=@e,na=@e,oa=@e,pa=@e,qa=@e,ra=@e,sa=@e,ta=@e,ua=@e,
+va=@e,wa=@e,xa=@e,ya=@e,za=@e,
+ab=@e,bb=@e,cb=@e,db=@e,eb=@e,fb=@e,gb=@e,hb=@e,ib=@e,jb=@e,
+kb=@e,lb=@e,mb=@e,nb=@e,ob=@e,pb=@e,qb=@e,rb=@e,sb=@e,tb=@e,ub=@e,
+vb=@e,wb=@e,xb=@e,yb=@e,zb=@e,
+ac=@e,bc=@e,cc=@e,dc=@e,ec=@e,fc=@e,gc=@e,hc=@e,ic=@e,jc=@e,
+kc=@e,lc=@e,mc=@e,nc=@e,oc=@e,pc=@e,qc=@e,rc=@e,sc=@e,tc=@e,uc=@e,
+vc=@e,wc=@e,xc=@e,yc=@e,zc=@e;
+UPDATE t2 SET a=@l,b=@l,c=@l,d=@l,e=@l,f=@l,g=@l,h=@l,i=@l,j=@l,
+k=@l,l=@l,m=@l,n=@l,o=@l,p=@l,q=@l,r=@l,s=@l,t=@l,u=@l,
+v=@l,w=@l,x=@l,y=@l,z=@l,
+aa=@l,ba=@l,ca=@l,da=@l,ea=@l,fa=@l,ga=@l,ha=@l,ia=@l,ja=@l,
+ka=@l,la=@l,ma=@l,na=@l,oa=@l,pa=@l,qa=@l,ra=@l,sa=@l,ta=@l,ua=@l,
+va=@l,wa=@l,xa=@l,ya=@l,za=@l,
+ab=@l,bb=@l,cb=@l,db=@l,eb=@l,fb=@l,gb=@l,hb=@l,ib=@l,jb=@l,
+kb=@l,lb=@l,mb=@l,nb=@l,ob=@l,pb=@l,qb=@l,rb=@l,sb=@l,tb=@l,ub=@l,
+vb=@l,wb=@l,xb=@l,yb=@l,zb=@l,
+ac=@l,bc=@l,cc=@l,dc=@l,ec=@l,fc=@l,gc=@l,hc=@l,ic=@l,jc=@l,
+kc=@l,lc=@l,mc=@l,nc=@l,oc=@l,pc=@l,qc=@l,rc=@l,sc=@l,tc=@l,uc=@l,
+vc=@l,wc=@l,xc=@l,yc=@l,zc=@l;
+COMMIT;
+BEGIN;
+UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f;
+UPDATE t1 SET f=@f,g=@f,h=@f,i=@f,j=@f;
+UPDATE t1 SET k=@f,l=@f,m=@f,n=@f,o=@f;
+UPDATE t1 SET p=@f,q=@f,r=@f,s=@f,t=@f,u=@f;
+UPDATE t1 SET v=@f,w=@f,x=@f,y=@f,z=@f;
+UPDATE t1 SET aa=@f,ba=@f,ca=@f,da=@f;
+UPDATE t1 SET ea=@f,fa=@f,ga=@f,ha=@f,ia=@f,ja=@f;
+UPDATE t1 SET ka=@f,la=@f,ma=@f,na=@f,oa=@f,pa=@f;
+UPDATE t1 SET qa=@f,ra=@f,sa=@f,ta=@f,ua=@f;
+UPDATE t1 SET va=@f,wa=@f,xa=@f,ya=@f,za=@f;
+UPDATE t1 SET ab=@f,bb=@f,cb=@f,db=@f;
+UPDATE t1 SET eb=@f,fb=@f,gb=@f,hb=@f,ib=@f,ja=@f;
+UPDATE t1 SET kb=@f,lb=@f,mb=@f,nb=@f,ob=@f,pa=@f;
+UPDATE t1 SET qb=@f,rb=@f,sb=@f,tb=@f,ub=@f;
+UPDATE t1 SET vb=@f,wb=@f,xb=@f,yb=@f,zb=@f;
+UPDATE t1 SET ac=@f,bc=@f,cc=@f,dc=@f;
+UPDATE t1 SET ec=@f,fc=@f,gc=@f,hc=@f,ic=@f,jc=@f;
+UPDATE t1 SET kc=@f,lc=@f,mc=@f,nc=@f,oc=@f,pc=@f;
+UPDATE t1 SET qc=@f,rc=@f,sc=@f,tc=@f,uc=@f;
+UPDATE t1 SET vc=@f,wc=@f,xc=@f,yc=@f,zc=@f;
+COMMIT;
+BEGIN;
+UPDATE t2 SET a=@f,b=@f,c=@f,d=@f,e=@f;
+UPDATE t2 SET f=@f,g=@f,h=@f,i=@f,j=@f;
+UPDATE t2 SET k=@f,l=@f,m=@f,n=@f,o=@f;
+UPDATE t2 SET p=@f,q=@f,r=@f,s=@f,t=@f,u=@f;
+UPDATE t2 SET v=@f,w=@f,x=@f,y=@f,z=@f;
+UPDATE t2 SET aa=@f,ba=@f,ca=@f,da=@f;
+UPDATE t2 SET ea=@f,fa=@f,ga=@f,ha=@f,ia=@f,ja=@f;
+UPDATE t2 SET ka=@f,la=@f,ma=@f,na=@f,oa=@f,pa=@f;
+UPDATE t2 SET qa=@f,ra=@f,sa=@f,ta=@f,ua=@f;
+UPDATE t2 SET va=@f,wa=@f,xa=@f,ya=@f,za=@f;
+UPDATE t2 SET ab=@f,bb=@f,cb=@f,db=@f;
+UPDATE t2 SET eb=@f,fb=@f,gb=@f,hb=@f,ib=@f,ja=@f;
+UPDATE t2 SET kb=@f,lb=@f,mb=@f,nb=@f,ob=@f,pa=@f;
+UPDATE t2 SET qb=@f,rb=@f,sb=@f,tb=@f,ub=@f;
+UPDATE t2 SET vb=@f,wb=@f,xb=@f,yb=@f,zb=@f;
+UPDATE t2 SET ac=@f,bc=@f,cc=@f,dc=@f;
+UPDATE t2 SET ec=@f,fc=@f,gc=@f,hc=@f,ic=@f,jc=@f;
+UPDATE t2 SET kc=@f,lc=@f,mc=@f,nc=@f,oc=@f,pc=@f;
+UPDATE t2 SET qc=@f,rc=@f,sc=@f,tc=@f,uc=@f;
+UPDATE t2 SET vc=@f,wc=@f,xc=@f,yc=@f,zc=@f;
+COMMIT;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ `q` blob,
+ `r` blob,
+ `s` blob,
+ `t` blob,
+ `u` blob,
+ `v` blob,
+ `w` blob,
+ `x` blob,
+ `y` blob,
+ `z` blob,
+ `aa` blob,
+ `ba` blob,
+ `ca` blob,
+ `da` blob,
+ `ea` blob,
+ `fa` blob,
+ `ga` blob,
+ `ha` blob,
+ `ia` blob,
+ `ja` blob,
+ `ka` blob,
+ `la` blob,
+ `ma` blob,
+ `na` blob,
+ `oa` blob,
+ `pa` blob,
+ `qa` blob,
+ `ra` blob,
+ `sa` blob,
+ `ta` blob,
+ `ua` blob,
+ `va` blob,
+ `wa` blob,
+ `xa` blob,
+ `ya` blob,
+ `za` blob,
+ `ab` blob,
+ `bb` blob,
+ `cb` blob,
+ `db` blob,
+ `eb` blob,
+ `fb` blob,
+ `gb` blob,
+ `hb` blob,
+ `ib` blob,
+ `jb` blob,
+ `kb` blob,
+ `lb` blob,
+ `mb` blob,
+ `nb` blob,
+ `ob` blob,
+ `pb` blob,
+ `qb` blob,
+ `rb` blob,
+ `sb` blob,
+ `tb` blob,
+ `ub` blob,
+ `vb` blob,
+ `wb` blob,
+ `xb` blob,
+ `yb` blob,
+ `zb` blob,
+ `ac` blob,
+ `bc` blob,
+ `cc` blob,
+ `dc` blob,
+ `ec` blob,
+ `fc` blob,
+ `gc` blob,
+ `hc` blob,
+ `ic` blob,
+ `jc` blob,
+ `kc` blob,
+ `lc` blob,
+ `mc` blob,
+ `nc` blob,
+ `oc` blob,
+ `pc` blob,
+ `qc` blob,
+ `rc` blob,
+ `sc` blob,
+ `tc` blob,
+ `uc` blob,
+ `vc` blob,
+ `wc` blob,
+ `xc` blob,
+ `yc` blob,
+ `zc` blob,
+ KEY `t1a` (`a`(767),`b`(767)),
+ KEY `t1c` (`c`(767),`d`(767)),
+ KEY `t1e` (`e`(767),`f`(767)),
+ KEY `t1f2` (`g`(767),`h`(767)),
+ KEY `t1f4` (`i`(767),`j`(767)),
+ KEY `t1k` (`k`(767),`m`(767)),
+ KEY `t1f8` (`n`(767),`o`(767)),
+ KEY `t1f11` (`p`(767),`q`(767)),
+ KEY `t1f13` (`r`(767),`s`(767)),
+ KEY `t1f15` (`t`(767),`u`(767)),
+ KEY `t1f18` (`w`(767),`x`(767)),
+ KEY `t1f20` (`y`(767),`z`(767)),
+ KEY `ta1a6` (`aa`(767),`ba`(767)),
+ KEY `tc1c6` (`ca`(767),`da`(767)),
+ KEY `te1e6` (`ea`(767),`fa`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ `q` blob,
+ `r` blob,
+ `s` blob,
+ `t` blob,
+ `u` blob,
+ `v` blob,
+ `w` blob,
+ `x` blob,
+ `y` blob,
+ `z` blob,
+ `aa` blob,
+ `ba` blob,
+ `ca` blob,
+ `da` blob,
+ `ea` blob,
+ `fa` blob,
+ `ga` blob,
+ `ha` blob,
+ `ia` blob,
+ `ja` blob,
+ `ka` blob,
+ `la` blob,
+ `ma` blob,
+ `na` blob,
+ `oa` blob,
+ `pa` blob,
+ `qa` blob,
+ `ra` blob,
+ `sa` blob,
+ `ta` blob,
+ `ua` blob,
+ `va` blob,
+ `wa` blob,
+ `xa` blob,
+ `ya` blob,
+ `za` blob,
+ `ab` blob,
+ `bb` blob,
+ `cb` blob,
+ `db` blob,
+ `eb` blob,
+ `fb` blob,
+ `gb` blob,
+ `hb` blob,
+ `ib` blob,
+ `jb` blob,
+ `kb` blob,
+ `lb` blob,
+ `mb` blob,
+ `nb` blob,
+ `ob` blob,
+ `pb` blob,
+ `qb` blob,
+ `rb` blob,
+ `sb` blob,
+ `tb` blob,
+ `ub` blob,
+ `vb` blob,
+ `wb` blob,
+ `xb` blob,
+ `yb` blob,
+ `zb` blob,
+ `ac` blob,
+ `bc` blob,
+ `cc` blob,
+ `dc` blob,
+ `ec` blob,
+ `fc` blob,
+ `gc` blob,
+ `hc` blob,
+ `ic` blob,
+ `jc` blob,
+ `kc` blob,
+ `lc` blob,
+ `mc` blob,
+ `nc` blob,
+ `oc` blob,
+ `pc` blob,
+ `qc` blob,
+ `rc` blob,
+ `sc` blob,
+ `tc` blob,
+ `uc` blob,
+ `vc` blob,
+ `wc` blob,
+ `xc` blob,
+ `yc` blob,
+ `zc` blob,
+ KEY `t2a` (`a`(767),`b`(767)),
+ KEY `t2c` (`c`(767),`d`(767)),
+ KEY `t2e` (`e`(767),`f`(767)),
+ KEY `t2f2` (`g`(767),`h`(767)),
+ KEY `t2f4` (`i`(767),`j`(767)),
+ KEY `t2k` (`k`(767),`m`(767)),
+ KEY `t2f8` (`n`(767),`o`(767)),
+ KEY `t2f11` (`p`(767),`q`(767)),
+ KEY `t2f13` (`r`(767),`s`(767)),
+ KEY `t2f15` (`t`(767),`u`(767)),
+ KEY `t2f18` (`w`(767),`x`(767)),
+ KEY `t2f20` (`y`(767),`z`(767)),
+ KEY `ta2a6` (`aa`(767),`ba`(767)),
+ KEY `tc2c6` (`ca`(767),`da`(767)),
+ KEY `te2e6` (`ea`(767),`fa`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+drop table t1,t2;
diff --git a/mysql-test/suite/innodb/r/innodb-64k.result b/mysql-test/suite/innodb/r/innodb-64k.result
new file mode 100644
index 00000000000..dc938f236cd
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-64k.result
@@ -0,0 +1,1086 @@
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+call mtr.add_suppression("InnoDB: Resizing redo log from *");
+call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files.");
+call mtr.add_suppression("InnoDB: New log files created, LSN=*");
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# Test 1) Show the page size from Information Schema
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_page_size';
+variable_value
+65536
+# Test 4) The maximum row size is dependent upon the page size.
+SET SESSION innodb_strict_mode = ON;
+SELECT @@innodb_strict_mode;
+@@innodb_strict_mode
+1
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+ERROR 42000: Row size too large (> 16382). 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.
+show warnings;
+Level Code Message
+Error 1118 Row size too large (> 16382). 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.
+Warning 1030 Got error 139 "Too big row" from storage engine InnoDB
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(156)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(157)
+) ROW_FORMAT=compact;
+ERROR 42000: Row size too large (> max_row_size). 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.
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(156)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(157)
+) ROW_FORMAT=dynamic;
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+# Test 8) Test creating a table that could lead to undo log overflow.
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+v blob, w blob, x blob, y blob, z blob,
+aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+va blob, wa blob, xa blob, ya blob, za blob,
+ab blob,bb blob,cb blob,db blob,eb blob,fb blob,gb blob,
+hb blob,ib blob,jb blob,kb blob,lb blob,mb blob,nb blob,
+ob blob,pb blob,qb blob,rb blob,sb blob,tb blob,ub blob,
+vb blob, wb blob, xb blob, yb blob, zb blob,
+ac blob, bc blob, cc blob, dc blob, ec blob,fc blob,gc blob,
+hc blob, ic blob, jc blob, kc blob, lc blob,mc blob,nc blob,
+oc blob, pc blob, qc blob, rc blob, sc blob,tc blob,uc blob,
+vc blob, wc blob, xc blob, yc blob, zc blob
+) ENGINE=InnoDB ROW_FORMAT=dynamic;
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+v=@b,w=@b,x=@b,y=@b,z=@b,
+aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+va=@b,wa=@b,xa=@b,ya=@b,za=@b,
+ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ac=@b,bc=@b,cc=@b,dc=@b,ec=@b,fc=@b,gc=@b,hc=@b,ic=@b,jc=@b,
+kc=@b,lc=@b,mc=@b,nc=@b,oc=@b,pc=@b,qc=@b,rc=@b,sc=@b,tc=@b,uc=@b,
+vc=@b,wc=@b,xc=@b,yc=@b,zc=@b;
+CREATE INDEX t1a ON t1 (a(767),b(767));
+CREATE INDEX t1c ON t1 (c(767),d(767));
+CREATE INDEX t1e ON t1 (e(767),f(767));
+CREATE INDEX t1f2 ON t1 (g(767),h(767));
+CREATE INDEX t1f4 ON t1 (i(767),j(767));
+CREATE INDEX t1k ON t1 (k(767),m(767));
+CREATE INDEX t1f8 ON t1 (n(767),o(767));
+CREATE INDEX t1f11 ON t1 (p(767),q(767));
+CREATE INDEX t1f13 ON t1 (r(767),s(767));
+CREATE INDEX t1f15 ON t1 (t(767),u(767));
+CREATE INDEX t1f18 ON t1 (w(767),x(767));
+CREATE INDEX t1f20 ON t1 (y(767),z(767));
+CREATE INDEX ta1a6 ON t1 (aa(767),ba(767));
+CREATE INDEX tc1c6 ON t1 (ca(767),da(767));
+CREATE INDEX te1e6 ON t1 (ea(767),fa(767));
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+v=@c,w=@c,x=@c,y=@c,z=@c,
+aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+va=@c,wa=@c,xa=@c,ya=@c,za=@c,
+ab=@c,bb=@c,cb=@c,db=@c,eb=@c,fb=@c,gb=@c,hb=@c,ib=@c,jb=@c,
+kb=@c,lb=@c,mb=@c,nb=@c,ob=@c,pb=@c,qb=@c,rb=@c,sb=@c,tb=@c,ub=@c,
+vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
+ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
+kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
+vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
+COMMIT;
+CREATE INDEX tg1f2 ON t1 (ia(767),ja(767));
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
+k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
+v=@d,w=@d,x=@d,y=@d,z=@d,
+aa=@d,ba=@d,ca=@d,da=@d,ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d,
+ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d,qa=@d,ra=@d,sa=@d,ta=@d,ua=@d,
+va=@d,wa=@d,xa=@d,ya=@d,za=@d,
+ab=@d,bb=@d,cb=@d,db=@d,eb=@d,fb=@d,gb=@d,hb=@d,ib=@d,jb=@d,
+kb=@d,lb=@d,mb=@d,nb=@d,ob=@d,pb=@d,qb=@d,rb=@d,sb=@d,tb=@d,ub=@d,
+vb=@d,wb=@d,xb=@d,yb=@d,zb=@d,
+ac=@d,bc=@d,cc=@d,dc=@d,ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d,
+kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d,qc=@d,rc=@d,sc=@d,tc=@d,uc=@d,
+vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+UPDATE t1 SET ab=@d,bb=@d,cb=@d,db=@d;
+UPDATE t1 SET eb=@d,fb=@d,gb=@d,hb=@d,ib=@d,ja=@d;
+UPDATE t1 SET kb=@d,lb=@d,mb=@d,nb=@d,ob=@d,pa=@d;
+UPDATE t1 SET qb=@d,rb=@d,sb=@d,tb=@d,ub=@d;
+UPDATE t1 SET vb=@d,wb=@d,xb=@d,yb=@d,zb=@d;
+UPDATE t1 SET ac=@d,bc=@d,cc=@d,dc=@d;
+UPDATE t1 SET ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d;
+UPDATE t1 SET kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d;
+UPDATE t1 SET qc=@d,rc=@d,sc=@d,tc=@d,uc=@d;
+UPDATE t1 SET vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
+COMMIT;
+CREATE INDEX ti1f4 ON t1 (ia(767),ka(767));
+CREATE INDEX tk1f6 ON t1 (la(767),ma(767));
+CREATE INDEX tm1f8 ON t1 (na(767),oa(767));
+CREATE INDEX to1f11 ON t1 (pa(767),qa(767));
+CREATE INDEX tq1f13 ON t1 (ra(767),sa(767));
+CREATE INDEX ts1f15 ON t1 (ta(767),ua(767));
+CREATE INDEX tu1f18 ON t1 (wa(767),xa(767));
+CREATE INDEX tx1f20 ON t1 (ya(767),za(767));
+CREATE INDEX ta1a5 ON t1 (ab(767),bb(767));
+CREATE INDEX tc1c5 ON t1 (cb(767),db(767));
+CREATE INDEX te1e5 ON t1 (eb(767),fb(767));
+CREATE INDEX t5g1f2 ON t1 (gb(767),hb(767));
+CREATE INDEX t5i1f4 ON t1 (ib(767),kb(767));
+CREATE INDEX t5k1f6 ON t1 (lb(767),mb(767));
+CREATE INDEX t5m1f8 ON t1 (nb(767),ob(767));
+CREATE INDEX t5o1f11 ON t1 (pb(767),qb(767));
+CREATE INDEX t65q1f13 ON t1 (rb(767),sb(767));
+CREATE INDEX t65s1f15 ON t1 (tb(767),ub(767));
+CREATE INDEX t65u1f18 ON t1 (wb(767),xb(767));
+CREATE INDEX t65x1f20 ON t1 (yb(767),zb(767));
+CREATE INDEX xta1a5 ON t1 (ac(767),bc(767));
+CREATE INDEX xt5g1f2 ON t1 (gc(767),hc(767));
+CREATE INDEX xt5i1f4 ON t1 (ic(767));
+CREATE INDEX xtc1c5 ON t1 (cc(767),dc(767));
+CREATE INDEX xte1e5 ON t1 (ec(767),fc(767));
+UPDATE t1 SET t=@e;
+CREATE INDEX xt5k1f6 ON t1 (lc(767),mc(767));
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 16383. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ `q` blob,
+ `r` blob,
+ `s` blob,
+ `t` blob,
+ `u` blob,
+ `v` blob,
+ `w` blob,
+ `x` blob,
+ `y` blob,
+ `z` blob,
+ `aa` blob,
+ `ba` blob,
+ `ca` blob,
+ `da` blob,
+ `ea` blob,
+ `fa` blob,
+ `ga` blob,
+ `ha` blob,
+ `ia` blob,
+ `ja` blob,
+ `ka` blob,
+ `la` blob,
+ `ma` blob,
+ `na` blob,
+ `oa` blob,
+ `pa` blob,
+ `qa` blob,
+ `ra` blob,
+ `sa` blob,
+ `ta` blob,
+ `ua` blob,
+ `va` blob,
+ `wa` blob,
+ `xa` blob,
+ `ya` blob,
+ `za` blob,
+ `ab` blob,
+ `bb` blob,
+ `cb` blob,
+ `db` blob,
+ `eb` blob,
+ `fb` blob,
+ `gb` blob,
+ `hb` blob,
+ `ib` blob,
+ `jb` blob,
+ `kb` blob,
+ `lb` blob,
+ `mb` blob,
+ `nb` blob,
+ `ob` blob,
+ `pb` blob,
+ `qb` blob,
+ `rb` blob,
+ `sb` blob,
+ `tb` blob,
+ `ub` blob,
+ `vb` blob,
+ `wb` blob,
+ `xb` blob,
+ `yb` blob,
+ `zb` blob,
+ `ac` blob,
+ `bc` blob,
+ `cc` blob,
+ `dc` blob,
+ `ec` blob,
+ `fc` blob,
+ `gc` blob,
+ `hc` blob,
+ `ic` blob,
+ `jc` blob,
+ `kc` blob,
+ `lc` blob,
+ `mc` blob,
+ `nc` blob,
+ `oc` blob,
+ `pc` blob,
+ `qc` blob,
+ `rc` blob,
+ `sc` blob,
+ `tc` blob,
+ `uc` blob,
+ `vc` blob,
+ `wc` blob,
+ `xc` blob,
+ `yc` blob,
+ `zc` blob,
+ KEY `t1a` (`a`(767),`b`(767)),
+ KEY `t1c` (`c`(767),`d`(767)),
+ KEY `t1e` (`e`(767),`f`(767)),
+ KEY `t1f2` (`g`(767),`h`(767)),
+ KEY `t1f4` (`i`(767),`j`(767)),
+ KEY `t1k` (`k`(767),`m`(767)),
+ KEY `t1f8` (`n`(767),`o`(767)),
+ KEY `t1f11` (`p`(767),`q`(767)),
+ KEY `t1f13` (`r`(767),`s`(767)),
+ KEY `t1f15` (`t`(767),`u`(767)),
+ KEY `t1f18` (`w`(767),`x`(767)),
+ KEY `t1f20` (`y`(767),`z`(767)),
+ KEY `ta1a6` (`aa`(767),`ba`(767)),
+ KEY `tc1c6` (`ca`(767),`da`(767)),
+ KEY `te1e6` (`ea`(767),`fa`(767)),
+ KEY `tg1f2` (`ia`(767),`ja`(767)),
+ KEY `ti1f4` (`ia`(767),`ka`(767)),
+ KEY `tk1f6` (`la`(767),`ma`(767)),
+ KEY `tm1f8` (`na`(767),`oa`(767)),
+ KEY `to1f11` (`pa`(767),`qa`(767)),
+ KEY `tq1f13` (`ra`(767),`sa`(767)),
+ KEY `ts1f15` (`ta`(767),`ua`(767)),
+ KEY `tu1f18` (`wa`(767),`xa`(767)),
+ KEY `tx1f20` (`ya`(767),`za`(767)),
+ KEY `ta1a5` (`ab`(767),`bb`(767)),
+ KEY `tc1c5` (`cb`(767),`db`(767)),
+ KEY `te1e5` (`eb`(767),`fb`(767)),
+ KEY `t5g1f2` (`gb`(767),`hb`(767)),
+ KEY `t5i1f4` (`ib`(767),`kb`(767)),
+ KEY `t5k1f6` (`lb`(767),`mb`(767)),
+ KEY `t5m1f8` (`nb`(767),`ob`(767)),
+ KEY `t5o1f11` (`pb`(767),`qb`(767)),
+ KEY `t65q1f13` (`rb`(767),`sb`(767)),
+ KEY `t65s1f15` (`tb`(767),`ub`(767)),
+ KEY `t65u1f18` (`wb`(767),`xb`(767)),
+ KEY `t65x1f20` (`yb`(767),`zb`(767)),
+ KEY `xta1a5` (`ac`(767),`bc`(767)),
+ KEY `xt5g1f2` (`gc`(767),`hc`(767)),
+ KEY `xt5i1f4` (`ic`(767)),
+ KEY `xtc1c5` (`cc`(767),`dc`(767)),
+ KEY `xte1e5` (`ec`(767),`fc`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+SHOW WARNINGS;
+Level Code Message
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=dynamic,ENGINE=INNODB;
+set @a = repeat('0123456789', 800);
+set @b = repeat('9876543210', 800);
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+update t2 set col190=@b;
+set @a = repeat('0123456789', 1650);
+set @b = repeat('9876543210', 2000);
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+update t2 set col190=@b;
+set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650);
+set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000);
+update t2 set col189 = @b;
+insert into t2 select * from t2;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ `q` blob,
+ `r` blob,
+ `s` blob,
+ `t` blob,
+ `u` blob,
+ `v` blob,
+ `w` blob,
+ `x` blob,
+ `y` blob,
+ `z` blob,
+ `aa` blob,
+ `ba` blob,
+ `ca` blob,
+ `da` blob,
+ `ea` blob,
+ `fa` blob,
+ `ga` blob,
+ `ha` blob,
+ `ia` blob,
+ `ja` blob,
+ `ka` blob,
+ `la` blob,
+ `ma` blob,
+ `na` blob,
+ `oa` blob,
+ `pa` blob,
+ `qa` blob,
+ `ra` blob,
+ `sa` blob,
+ `ta` blob,
+ `ua` blob,
+ `va` blob,
+ `wa` blob,
+ `xa` blob,
+ `ya` blob,
+ `za` blob,
+ `ab` blob,
+ `bb` blob,
+ `cb` blob,
+ `db` blob,
+ `eb` blob,
+ `fb` blob,
+ `gb` blob,
+ `hb` blob,
+ `ib` blob,
+ `jb` blob,
+ `kb` blob,
+ `lb` blob,
+ `mb` blob,
+ `nb` blob,
+ `ob` blob,
+ `pb` blob,
+ `qb` blob,
+ `rb` blob,
+ `sb` blob,
+ `tb` blob,
+ `ub` blob,
+ `vb` blob,
+ `wb` blob,
+ `xb` blob,
+ `yb` blob,
+ `zb` blob,
+ `ac` blob,
+ `bc` blob,
+ `cc` blob,
+ `dc` blob,
+ `ec` blob,
+ `fc` blob,
+ `gc` blob,
+ `hc` blob,
+ `ic` blob,
+ `jc` blob,
+ `kc` blob,
+ `lc` blob,
+ `mc` blob,
+ `nc` blob,
+ `oc` blob,
+ `pc` blob,
+ `qc` blob,
+ `rc` blob,
+ `sc` blob,
+ `tc` blob,
+ `uc` blob,
+ `vc` blob,
+ `wc` blob,
+ `xc` blob,
+ `yc` blob,
+ `zc` blob,
+ KEY `t1a` (`a`(767),`b`(767)),
+ KEY `t1c` (`c`(767),`d`(767)),
+ KEY `t1e` (`e`(767),`f`(767)),
+ KEY `t1f2` (`g`(767),`h`(767)),
+ KEY `t1f4` (`i`(767),`j`(767)),
+ KEY `t1k` (`k`(767),`m`(767)),
+ KEY `t1f8` (`n`(767),`o`(767)),
+ KEY `t1f11` (`p`(767),`q`(767)),
+ KEY `t1f13` (`r`(767),`s`(767)),
+ KEY `t1f15` (`t`(767),`u`(767)),
+ KEY `t1f18` (`w`(767),`x`(767)),
+ KEY `t1f20` (`y`(767),`z`(767)),
+ KEY `ta1a6` (`aa`(767),`ba`(767)),
+ KEY `tc1c6` (`ca`(767),`da`(767)),
+ KEY `te1e6` (`ea`(767),`fa`(767)),
+ KEY `tg1f2` (`ia`(767),`ja`(767)),
+ KEY `ti1f4` (`ia`(767),`ka`(767)),
+ KEY `tk1f6` (`la`(767),`ma`(767)),
+ KEY `tm1f8` (`na`(767),`oa`(767)),
+ KEY `to1f11` (`pa`(767),`qa`(767)),
+ KEY `tq1f13` (`ra`(767),`sa`(767)),
+ KEY `ts1f15` (`ta`(767),`ua`(767)),
+ KEY `tu1f18` (`wa`(767),`xa`(767)),
+ KEY `tx1f20` (`ya`(767),`za`(767)),
+ KEY `ta1a5` (`ab`(767),`bb`(767)),
+ KEY `tc1c5` (`cb`(767),`db`(767)),
+ KEY `te1e5` (`eb`(767),`fb`(767)),
+ KEY `t5g1f2` (`gb`(767),`hb`(767)),
+ KEY `t5i1f4` (`ib`(767),`kb`(767)),
+ KEY `t5k1f6` (`lb`(767),`mb`(767)),
+ KEY `t5m1f8` (`nb`(767),`ob`(767)),
+ KEY `t5o1f11` (`pb`(767),`qb`(767)),
+ KEY `t65q1f13` (`rb`(767),`sb`(767)),
+ KEY `t65s1f15` (`tb`(767),`ub`(767)),
+ KEY `t65u1f18` (`wb`(767),`xb`(767)),
+ KEY `t65x1f20` (`yb`(767),`zb`(767)),
+ KEY `xta1a5` (`ac`(767),`bc`(767)),
+ KEY `xt5g1f2` (`gc`(767),`hc`(767)),
+ KEY `xt5i1f4` (`ic`(767)),
+ KEY `xtc1c5` (`cc`(767),`dc`(767)),
+ KEY `xte1e5` (`ec`(767),`fc`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `COL1` text,
+ `COL2` text,
+ `COL3` text,
+ `COL4` text,
+ `COL5` text,
+ `COL6` text,
+ `COL7` text,
+ `COL8` text,
+ `COL9` text,
+ `COL10` text,
+ `COL11` text,
+ `COL12` text,
+ `COL13` text,
+ `COL14` text,
+ `COL15` text,
+ `COL16` text,
+ `COL17` text,
+ `COL18` text,
+ `COL19` text,
+ `COL20` text,
+ `COL21` text,
+ `COL22` text,
+ `COL23` text,
+ `COL24` text,
+ `COL25` text,
+ `COL26` text,
+ `COL27` text,
+ `COL28` text,
+ `COL29` text,
+ `COL30` text,
+ `COL31` text,
+ `COL32` text,
+ `COL33` text,
+ `COL34` text,
+ `COL35` text,
+ `COL36` text,
+ `COL37` text,
+ `COL38` text,
+ `COL39` text,
+ `COL40` text,
+ `COL41` text,
+ `COL42` text,
+ `COL43` text,
+ `COL44` text,
+ `COL45` text,
+ `COL46` text,
+ `COL47` text,
+ `COL48` text,
+ `COL49` text,
+ `COL50` text,
+ `COL51` text,
+ `COL52` text,
+ `COL53` text,
+ `COL54` text,
+ `COL55` text,
+ `COL56` text,
+ `COL57` text,
+ `COL58` text,
+ `COL59` text,
+ `COL60` text,
+ `COL61` text,
+ `COL62` text,
+ `COL63` text,
+ `COL64` text,
+ `COL65` text,
+ `COL66` text,
+ `COL67` text,
+ `COL68` text,
+ `COL69` text,
+ `COL70` text,
+ `COL71` text,
+ `COL72` text,
+ `COL73` text,
+ `COL74` text,
+ `COL75` text,
+ `COL76` text,
+ `COL77` text,
+ `COL78` text,
+ `COL79` text,
+ `COL80` text,
+ `COL81` text,
+ `COL82` text,
+ `COL83` text,
+ `COL84` text,
+ `COL85` text,
+ `COL86` text,
+ `COL87` text,
+ `COL88` text,
+ `COL89` text,
+ `COL90` text,
+ `COL91` text,
+ `COL92` text,
+ `COL93` text,
+ `COL94` text,
+ `COL95` text,
+ `COL96` text,
+ `COL97` text,
+ `COL98` text,
+ `COL99` text,
+ `COL100` text,
+ `COL101` text,
+ `COL102` text,
+ `COL103` text,
+ `COL104` text,
+ `COL105` text,
+ `COL106` text,
+ `COL107` text,
+ `COL108` text,
+ `COL109` text,
+ `COL110` text,
+ `COL111` text,
+ `COL112` text,
+ `COL113` text,
+ `COL114` text,
+ `COL115` text,
+ `COL116` text,
+ `COL117` text,
+ `COL118` text,
+ `COL119` text,
+ `COL120` text,
+ `COL121` text,
+ `COL122` text,
+ `COL123` text,
+ `COL124` text,
+ `COL125` text,
+ `COL126` text,
+ `COL127` text,
+ `COL128` text,
+ `COL129` text,
+ `COL130` text,
+ `COL131` text,
+ `COL132` text,
+ `COL133` text,
+ `COL134` text,
+ `COL135` text,
+ `COL136` text,
+ `COL137` text,
+ `COL138` text,
+ `COL139` text,
+ `COL140` text,
+ `COL141` text,
+ `COL142` text,
+ `COL143` text,
+ `COL144` text,
+ `COL145` text,
+ `COL146` text,
+ `COL147` text,
+ `COL148` text,
+ `COL149` text,
+ `COL150` text,
+ `COL151` text,
+ `COL152` text,
+ `COL153` text,
+ `COL154` text,
+ `COL155` text,
+ `COL156` text,
+ `COL157` text,
+ `COL158` text,
+ `COL159` text,
+ `COL160` text,
+ `COL161` text,
+ `COL162` text,
+ `COL163` text,
+ `COL164` text,
+ `COL165` text,
+ `COL166` text,
+ `COL167` text,
+ `COL168` text,
+ `COL169` text,
+ `COL170` text,
+ `COL171` text,
+ `COL172` text,
+ `COL173` text,
+ `COL174` text,
+ `COL175` text,
+ `COL176` text,
+ `COL177` text,
+ `COL178` text,
+ `COL179` text,
+ `COL180` text,
+ `COL181` text,
+ `COL182` text,
+ `COL183` text,
+ `COL184` text,
+ `COL185` text,
+ `COL186` text,
+ `COL187` text,
+ `COL188` text,
+ `COL189` text,
+ `COL190` text,
+ `COL191` text,
+ `COL192` text,
+ `COL193` text,
+ `COL194` text,
+ `COL195` text,
+ `COL196` text,
+ `COL197` text
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+BEGIN;
+update t2 set col150=@a;
+update t2 set col145=@b;
+COMMIT;
+drop table t2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-autoinc.result b/mysql-test/suite/innodb/r/innodb-alter-autoinc.result
index 452a3fbc46f..82eb448fe45 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-autoinc.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-autoinc.result
@@ -25,7 +25,7 @@ DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=COPY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
@@ -44,7 +44,7 @@ ROLLBACK;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
@@ -64,7 +64,7 @@ a id
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
@@ -86,7 +86,7 @@ a id
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
@@ -108,7 +108,7 @@ DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
@@ -127,7 +127,7 @@ ROLLBACK;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
@@ -144,7 +144,7 @@ a id
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
@@ -166,7 +166,7 @@ a id
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`,`a`)
diff --git a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
index 3cc973ca3a3..ce13ad0978b 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
@@ -4,10 +4,6 @@
# Temporary tablename will be unique. This makes sure that future
# in-place ALTERs of the same table will not be blocked due to
# temporary tablename.
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed
-");
-call mtr.add_suppression("InnoDB: file read of space .* page .*");
-call mtr.add_suppression("InnoDB: Trying to recover it from the doublewrite buffer.");
# Crash the server in ha_innobase::commit_inplace_alter_table()
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
SET debug='d,innodb_alter_commit_crash_before_commit';
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 0bad6c5e0c1..fadbcce332a 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -163,7 +163,7 @@ test/t1 test/t3
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c3` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -189,7 +189,7 @@ ALTER TABLE t3 CHANGE c3
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`1234567890123456789012345678901234567890123456789012345678901234` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -222,7 +222,7 @@ test/t1 test/t2
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c3` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -434,7 +434,7 @@ ID FOR_COL_NAME REF_COL_NAME POS
SHOW CREATE TABLE tt;
Table Create Table
tt CREATE TABLE `tt` (
- `pk` int(11) NOT NULL DEFAULT '0',
+ `pk` int(11) NOT NULL,
`c2` int(11) DEFAULT '42',
`ct` text,
PRIMARY KEY (`pk`),
@@ -514,7 +514,7 @@ ALGORITHM=INPLACE;
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c2` int(11) NOT NULL DEFAULT '0',
+ `c2` int(11) NOT NULL,
`ct` int(11) DEFAULT NULL,
`c1` text,
`cu` text,
@@ -527,7 +527,7 @@ ALGORITHM=COPY;
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c2` int(11) DEFAULT NULL,
`ct` text,
`cu` text,
@@ -543,7 +543,7 @@ ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c4` int(11) DEFAULT NULL,
`ct` text,
`cu` text,
@@ -559,7 +559,7 @@ ALTER TABLE t1n CHANGE c4 c11 INT, ADD INDEX(c11), ALGORITHM=INPLACE;
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c11` int(11) DEFAULT NULL,
`ct` text,
`cu` text,
@@ -717,7 +717,7 @@ ALTER TABLE t1 CHANGE COLUMN c1 C1 INT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `C1` int(11) NOT NULL DEFAULT '0',
+ `C1` int(11) NOT NULL,
PRIMARY KEY (`C1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
@@ -730,7 +730,7 @@ t2 CREATE TABLE `t2` (
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `C1` int(11) NOT NULL DEFAULT '0',
+ `C1` int(11) NOT NULL,
PRIMARY KEY (`C1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result
index 4af674adc6a..7d50ed00a92 100644
--- a/mysql-test/suite/innodb/r/innodb-autoinc.result
+++ b/mysql-test/suite/innodb/r/innodb-autoinc.result
@@ -197,7 +197,7 @@ c1 c2
5 9
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
@@ -230,7 +230,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -269,7 +269,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -282,7 +282,7 @@ SELECT * FROM t1;
c1
-1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
@@ -315,7 +315,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -330,7 +330,7 @@ SELECT * FROM t1;
c1
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
@@ -370,7 +370,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -385,7 +385,7 @@ SELECT * FROM t1;
c1
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
@@ -419,7 +419,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -434,7 +434,7 @@ c1
1
9223372036854775794
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 2
auto_increment_offset 10
@@ -452,7 +452,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -467,7 +467,7 @@ c1
1
18446744073709551603
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 2
auto_increment_offset 10
@@ -480,7 +480,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -495,7 +495,7 @@ c1
1
18446744073709551603
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 5
auto_increment_offset 7
@@ -508,7 +508,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -527,7 +527,7 @@ c1
-9223372036854775806
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 3
auto_increment_offset 3
@@ -544,7 +544,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -562,7 +562,7 @@ SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCRE
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976'
Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976'
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 65535
auto_increment_offset 65535
@@ -575,7 +575,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -874,7 +874,7 @@ ERROR 22003: Out of range value for column 'c1' at row 1
DROP TABLE t1;
DROP TABLE t2;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -1264,7 +1264,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB AUTO_INCREMENT=18446744073709551615 DEFAULT CHARSET=latin1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=256;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 256
@@ -1282,7 +1282,7 @@ c1 c2
1 NULL
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
@@ -1298,7 +1298,7 @@ t1 CREATE TABLE `t1` (
SELECT * FROM t1;
c1 c2
2147483648 a
-ALTER TABLE t1 CHANGE c1 c1 INT;
+ALTER TABLE t1 CHANGE c1 c1 INT default 0;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-bigblob.result b/mysql-test/suite/innodb/r/innodb-bigblob.result
index 314bd3ed088..20fe0ce5c43 100644
--- a/mysql-test/suite/innodb/r/innodb-bigblob.result
+++ b/mysql-test/suite/innodb/r/innodb-bigblob.result
@@ -1,6 +1,7 @@
call mtr.add_suppression("Resizing redo log from *");
call mtr.add_suppression("Starting to delete and rewrite log files.");
call mtr.add_suppression("New log files created, LSN=*");
+call mtr.add_suppression("Writer thread is waiting this semaphore");
create table foo (id varchar(37) not null, content longblob) engine=INNODB;
insert into foo (id, content) values('xyz', '');
update foo set content=repeat('a', 43941888) where id='xyz';
diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result
index a90f83945e0..eca77972400 100644
--- a/mysql-test/suite/innodb/r/innodb-blob.result
+++ b/mysql-test/suite/innodb/r/innodb-blob.result
@@ -33,9 +33,9 @@ a
1
2
3
-SET DEBUG_DBUG='+d,crash_commit_before';
+BEGIN;
INSERT INTO t2 VALUES (42);
-ERROR HY000: Lost connection to MySQL server during query
+# Kill and restart
ERROR HY000: Lost connection to MySQL server during query
CHECK TABLE t1;
Table Op Msg_type Msg_text
@@ -70,9 +70,7 @@ SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: before_row_upd_extern';
info
UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2
-SET DEBUG_DBUG='+d,crash_commit_before';
-COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
+# Kill and restart
ERROR HY000: Lost connection to MySQL server during query
CHECK TABLE t1,t2,t3;
Table Op Msg_type Msg_text
@@ -97,9 +95,7 @@ SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: after_row_upd_extern';
info
UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2
-SET DEBUG_DBUG='+d,crash_commit_before';
-COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
+# Kill and restart
ERROR HY000: Lost connection to MySQL server during query
CHECK TABLE t1,t2,t3;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
index 07e13008e27..5b95742d0e8 100644
--- a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
+++ b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
@@ -8,7 +8,7 @@ a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(1),
c INT,
INDEX(b))
-ENGINE=InnoDB;
+ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 VALUES(0,'x',1);
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
@@ -21,6 +21,9 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
BEGIN;
SELECT b FROM t1 LIMIT 3;
b
diff --git a/mysql-test/suite/innodb/r/innodb-corrupted-table.result b/mysql-test/suite/innodb/r/innodb-corrupted-table.result
index 61d10fbb949..94203a794f8 100644
--- a/mysql-test/suite/innodb/r/innodb-corrupted-table.result
+++ b/mysql-test/suite/innodb/r/innodb-corrupted-table.result
@@ -40,7 +40,7 @@ Level Code Message
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `pk` int(11) NOT NULL DEFAULT '0',
+ `pk` int(11) NOT NULL,
`i` int(11) DEFAULT NULL,
`j` int(11) DEFAULT NULL,
PRIMARY KEY (`pk`),
diff --git a/mysql-test/suite/innodb/r/innodb-enlarge-blob.result b/mysql-test/suite/innodb/r/innodb-enlarge-blob.result
new file mode 100644
index 00000000000..8c8e9cf5007
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-enlarge-blob.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+SELECT * from t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+SELECT * from t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-flush-changed-page-bitmaps.result b/mysql-test/suite/innodb/r/innodb-flush-changed-page-bitmaps.result
new file mode 100644
index 00000000000..5f098b8ecbf
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-flush-changed-page-bitmaps.result
@@ -0,0 +1,4 @@
+FLUSH NO_WRITE_TO_BINLOG changed_page_bitmaps;
+select * from information_schema.changed_page_bitmaps;
+dummy
+0
diff --git a/mysql-test/suite/innodb/r/innodb-index-online,crypt.rdiff b/mysql-test/suite/innodb/r/innodb-index-online,crypt.rdiff
new file mode 100644
index 00000000000..767e36f3bfb
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-index-online,crypt.rdiff
@@ -0,0 +1,20 @@
+--- innodb-index-online.result
++++ innodb-index-online,crypt.reject
+@@ -260,7 +260,7 @@
+ @merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
+ @rowlog_encrypt_1>@rowlog_encrypt_0;
+ sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
+-0 0 0 0
++0 1 1 1
+ SET DEBUG_SYNC = 'now SIGNAL dml2_done';
+ ERROR HY000: Creating index 'c2e' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
+ SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
+@@ -364,7 +364,7 @@
+ @rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
+ @rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
+ sort_encrypted sort_decrypted log_encrypted log_decrypted
+-0 0 0 0
++1 1 1 1
+ SELECT COUNT(c22f) FROM t1;
+ COUNT(c22f)
+ 320
diff --git a/mysql-test/suite/innodb/r/innodb-index-online-fk.result b/mysql-test/suite/innodb/r/innodb-index-online-fk.result
index acd0c7ae317..f37cd844adb 100644
--- a/mysql-test/suite/innodb/r/innodb-index-online-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-index-online-fk.result
@@ -345,7 +345,7 @@ test/parent
SHOW CREATE TABLE child;
Table Create Table
child CREATE TABLE `child` (
- `a3` int(11) NOT NULL DEFAULT '0',
+ `a3` int(11) NOT NULL,
`a2` int(11) DEFAULT NULL,
PRIMARY KEY (`a3`),
KEY `tb` (`a2`),
diff --git a/mysql-test/suite/innodb/r/innodb-index-online.result b/mysql-test/suite/innodb/r/innodb-index-online.result
index 1dccc6ac4b8..efbc5c14e61 100644
--- a/mysql-test/suite/innodb/r/innodb-index-online.result
+++ b/mysql-test/suite/innodb/r/innodb-index-online.result
@@ -180,6 +180,15 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`),
KEY `c2d` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=1
+SET @merge_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2e_created WAIT_FOR dml2_done';
SET lock_wait_timeout = 10;
ALTER TABLE t1 DROP INDEX c2d, ADD INDEX c2e(c2),
@@ -209,6 +218,22 @@ BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
+BEGIN;
+DELETE FROM t1;
+ROLLBACK;
+UPDATE t1 SET c2 = c2 + 1;
+BEGIN;
+UPDATE t1 SET c2 = c2 + 1;
+DELETE FROM t1;
+ROLLBACK;
+BEGIN;
+DELETE FROM t1;
+ROLLBACK;
+UPDATE t1 SET c2 = c2 + 1;
+BEGIN;
+UPDATE t1 SET c2 = c2 + 1;
+DELETE FROM t1;
+ROLLBACK;
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
name count
ddl_background_drop_indexes 0
@@ -220,6 +245,22 @@ INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_FIELDS sf
ON si.index_id = sf.index_id WHERE si.name = '?c2e';
name pos
c2 0
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SELECT
+(@merge_encrypt_1-@merge_encrypt_0)-
+(@merge_decrypt_1-@merge_decrypt_0) as sort_balance,
+@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
+@rowlog_encrypt_1>@rowlog_encrypt_0;
+sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
+0 0 0 0
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
ERROR HY000: Creating index 'c2e' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
@@ -245,6 +286,18 @@ ddl_background_drop_indexes 0
ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done';
ALTER TABLE t1 ADD INDEX c2f(c2);
SET DEBUG_SYNC = 'now WAIT_FOR c2f_created';
@@ -262,6 +315,14 @@ BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
+BEGIN;
+INSERT INTO t1 SELECT 320 + c1, c2, c3 FROM t1 WHERE c1 > 160;
+DELETE FROM t1 WHERE c1 > 320;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET c2 = c2 + 1;
+DELETE FROM t1;
+ROLLBACK;
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
name count
ddl_background_drop_indexes 0
@@ -278,6 +339,32 @@ ddl_background_drop_indexes 0
ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
+SET @merge_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
+SELECT
+(@merge_encrypt_2-@merge_encrypt_1)-
+(@merge_decrypt_2-@merge_decrypt_1) as sort_balance,
+(@rowlog_encrypt_2-@rowlog_encrypt_1)-
+(@rowlog_decrypt_2-@rowlog_decrypt_1) as log_balance;
+sort_balance log_balance
+0 0
+SELECT
+@merge_encrypt_2-@merge_encrypt_1>0 as sort_encrypted,
+@merge_decrypt_2-@merge_decrypt_1>0 as sort_decrypted,
+@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
+@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
+sort_encrypted sort_decrypted log_encrypted log_decrypted
+0 0 0 0
SELECT COUNT(c22f) FROM t1;
COUNT(c22f)
320
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index 3d5a0f840c1..2b72f38a9d2 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -528,7 +528,7 @@ info: Records: 0 Duplicates: 0 Warnings: 0
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `alpha` int(11) NOT NULL DEFAULT '0',
+ `alpha` int(11) NOT NULL,
`beta` int(11) DEFAULT NULL,
`c` int(11) NOT NULL,
`d` int(11) DEFAULT NULL,
@@ -1166,7 +1166,7 @@ t2 CREATE TABLE `t2` (
show create table t2i;
Table Create Table
t2i CREATE TABLE `t2i` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`),
KEY `t2a` (`a`)
@@ -1174,7 +1174,7 @@ t2i CREATE TABLE `t2i` (
show create table t2c;
Table Create Table
t2c CREATE TABLE `t2c` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` char(1) NOT NULL,
PRIMARY KEY (`a`,`b`),
KEY `t2a` (`a`)
diff --git a/mysql-test/suite/innodb/r/innodb-lock-schedule-algorithm.result b/mysql-test/suite/innodb/r/innodb-lock-schedule-algorithm.result
new file mode 100644
index 00000000000..069ab3a1bf7
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-lock-schedule-algorithm.result
@@ -0,0 +1,89 @@
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * from t1;
+i1
+1
+2
+UPDATE t1 SET i1 = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+COMMIT;
+COMMIT;
+SELECT * FROM t1;
+i1
+SELECT * FROM t2;
+i2
+1
+2
+DROP TABLE t1, t2;
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * FROM t1;
+i1
+1
+2
+UPDATE t1 SET i1 = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+COMMIT;
+COMMIT;
+SELECT * FROM t1;
+i1
+SELECT * FROM t2;
+i2
+1
+2
+DROP TABLE t1, t2;
+# "restart: --loose-innodb-lock-schedule-algorithm=FCFS"
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * from t1;
+i1
+1
+2
+UPDATE t1 SET i1 = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+COMMIT;
+COMMIT;
+SELECT * FROM t1;
+i1
+SELECT * FROM t2;
+i2
+1
+2
+DROP TABLE t1, t2;
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * FROM t1;
+i1
+1
+2
+UPDATE t1 SET i1 = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+COMMIT;
+COMMIT;
+SELECT * FROM t1;
+i1
+SELECT * FROM t2;
+i2
+1
+2
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result b/mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result
new file mode 100644
index 00000000000..dba01945de3
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result
@@ -0,0 +1,10 @@
+call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
+SET @saved_debug = @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
+CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
+COMMIT;
+SET debug_dbug = @saved_debug;
+DROP TABLE t1;
+FOUND /InnoDB: Difficult to find free blocks / in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
new file mode 100644
index 00000000000..3a3d6f92cac
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
@@ -0,0 +1,98 @@
+set global innodb_compression_algorithm = bzip2;
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+# innodb_normal expected FOUND
+FOUND /AaAaAaAa/ in innodb_normal.ibd
+# innodb_page_compressed1 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
+# innodb_page_compressed2 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
+# innodb_page_compressed3 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
+# innodb_page_compressed4 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
+# innodb_page_compressed5 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
+# innodb_page_compressed6 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
+# innodb_page_compressed7 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
+# innodb_page_compressed8 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
+# innodb_page_compressed9 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+#done
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_default.result b/mysql-test/suite/innodb/r/innodb-page_compression_default.result
new file mode 100644
index 00000000000..18f7fb5e04a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_default.result
@@ -0,0 +1,98 @@
+call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+.");
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+# innodb_normal expected FOUND
+FOUND /AaAaAaAa/ in innodb_normal.ibd
+# innodb_page_compressed1 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
+# innodb_page_compressed2 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
+# innodb_page_compressed3 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
+# innodb_page_compressed4 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
+# innodb_page_compressed5 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
+# innodb_page_compressed6 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
+# innodb_page_compressed7 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
+# innodb_page_compressed8 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
+# innodb_page_compressed9 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+#done
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
new file mode 100644
index 00000000000..d60eb62ec15
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
@@ -0,0 +1,98 @@
+set global innodb_compression_algorithm = lz4;
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+# innodb_normal expected FOUND
+FOUND /AaAaAaAa/ in innodb_normal.ibd
+# innodb_page_compressed1 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
+# innodb_page_compressed2 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
+# innodb_page_compressed3 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
+# innodb_page_compressed4 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
+# innodb_page_compressed5 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
+# innodb_page_compressed6 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
+# innodb_page_compressed7 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
+# innodb_page_compressed8 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
+# innodb_page_compressed9 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+#done
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
new file mode 100644
index 00000000000..b3cc9c9b627
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
@@ -0,0 +1,98 @@
+set global innodb_compression_algorithm = lzma;
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+# innodb_normal expected FOUND
+FOUND /AaAaAaAa/ in innodb_normal.ibd
+# innodb_page_compressed1 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
+# innodb_page_compressed2 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
+# innodb_page_compressed3 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
+# innodb_page_compressed4 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
+# innodb_page_compressed5 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
+# innodb_page_compressed6 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
+# innodb_page_compressed7 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
+# innodb_page_compressed8 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
+# innodb_page_compressed9 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+#done
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
new file mode 100644
index 00000000000..b6c5bc32bb7
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
@@ -0,0 +1,98 @@
+set global innodb_compression_algorithm = lzo;
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+# innodb_normal expected FOUND
+FOUND /AaAaAaAa/ in innodb_normal.ibd
+# innodb_page_compressed1 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
+# innodb_page_compressed2 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
+# innodb_page_compressed3 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
+# innodb_page_compressed4 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
+# innodb_page_compressed5 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
+# innodb_page_compressed6 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
+# innodb_page_compressed7 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
+# innodb_page_compressed8 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
+# innodb_page_compressed9 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+#done
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
new file mode 100644
index 00000000000..74cfa9bce3a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
@@ -0,0 +1,99 @@
+call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+.");
+set global innodb_compression_algorithm = snappy;
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+# innodb_normal expected FOUND
+FOUND /AaAaAaAa/ in innodb_normal.ibd
+# innodb_page_compressed1 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
+# innodb_page_compressed2 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
+# innodb_page_compressed3 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
+# innodb_page_compressed4 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
+# innodb_page_compressed5 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
+# innodb_page_compressed6 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
+# innodb_page_compressed7 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
+# innodb_page_compressed8 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
+# innodb_page_compressed9 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+#done
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_tables.result b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
new file mode 100644
index 00000000000..072f1d1e440
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
@@ -0,0 +1,120 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1;
+ERROR HY000: Can't create table `test`.`innodb_compressed` (errno: 140 "Wrong create options")
+show warnings;
+Level Code Message
+Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=COMPRESSED
+Error 1005 Can't create table `test`.`innodb_compressed` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_compressed`=1
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_compressed`=1
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_compressed=1;
+ERROR HY000: Can't create table `test`.`innodb_redundant` (errno: 140 "Wrong create options")
+show warnings;
+Level Code Message
+Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT
+Error 1005 Can't create table `test`.`innodb_redundant` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+alter table innodb_redundant page_compressed=1;
+ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
+show warnings;
+Level Code Message
+Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT
+Error 1478 Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+alter table innodb_redundant row_format=compact page_compressed=1;
+show create table innodb_redundant;
+Table Create Table
+innodb_redundant CREATE TABLE `innodb_redundant` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_compressed`=1
+drop table innodb_redundant;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 0;
+alter table innodb_compact engine=innodb page_compressed=DEFAULT;
+alter table innodb_dynamic engine=innodb page_compressed=DEFAULT;
+show create table innodb_compact;
+Table Create Table
+innodb_compact CREATE TABLE `innodb_compact` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+show create table innodb_dynamic;
+Table Create Table
+innodb_dynamic CREATE TABLE `innodb_dynamic` (
+ `c1` bigint(20) NOT NULL,
+ `b` char(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
new file mode 100644
index 00000000000..3644890f921
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
@@ -0,0 +1,98 @@
+set global innodb_compression_algorithm = zlib;
+set global innodb_file_format = `Barracuda`;
+set global innodb_file_per_table = on;
+create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
+create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
+create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
+create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
+create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
+create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
+create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
+create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
+create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
+create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+# innodb_normal expected FOUND
+FOUND /AaAaAaAa/ in innodb_normal.ibd
+# innodb_page_compressed1 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
+# innodb_page_compressed2 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
+# innodb_page_compressed3 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
+# innodb_page_compressed4 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
+# innodb_page_compressed5 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
+# innodb_page_compressed6 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
+# innodb_page_compressed7 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
+# innodb_page_compressed8 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
+# innodb_page_compressed9 page compressed expected NOT FOUND
+NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
+select count(*) from innodb_page_compressed1;
+count(*)
+10000
+select count(*) from innodb_page_compressed3;
+count(*)
+10000
+select count(*) from innodb_page_compressed4;
+count(*)
+10000
+select count(*) from innodb_page_compressed5;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed6;
+count(*)
+10000
+select count(*) from innodb_page_compressed7;
+count(*)
+10000
+select count(*) from innodb_page_compressed8;
+count(*)
+10000
+select count(*) from innodb_page_compressed9;
+count(*)
+10000
+drop table innodb_normal;
+drop table innodb_page_compressed1;
+drop table innodb_page_compressed2;
+drop table innodb_page_compressed3;
+drop table innodb_page_compressed4;
+drop table innodb_page_compressed5;
+drop table innodb_page_compressed6;
+drop table innodb_page_compressed7;
+drop table innodb_page_compressed8;
+drop table innodb_page_compressed9;
+#done
diff --git a/mysql-test/suite/innodb/r/innodb-table-online,crypt.rdiff b/mysql-test/suite/innodb/r/innodb-table-online,crypt.rdiff
new file mode 100644
index 00000000000..443ec528cd8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-table-online,crypt.rdiff
@@ -0,0 +1,20 @@
+--- innodb-table-online.result
++++ innodb-table-online,crypt.reject
+@@ -254,7 +254,7 @@
+ @merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
+ @rowlog_encrypt_1>@rowlog_encrypt_0;
+ sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
+-0 0 0 0
++0 0 0 1
+ SET DEBUG_SYNC = 'now SIGNAL dml2_done';
+ # session con1
+ ERROR HY000: Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
+@@ -345,7 +345,7 @@
+ @rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
+ @rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
+ sort_encrypted sort_decrypted log_encrypted log_decrypted
+-0 0 0 0
++1 1 1 1
+ ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5));
+ ERROR 23000: Duplicate entry '' for key 'PRIMARY'
+ UPDATE t1 SET c3 = NULL WHERE c3 = '';
diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result
index eb55ba57e36..9b1097b3afa 100644
--- a/mysql-test/suite/innodb/r/innodb-table-online.result
+++ b/mysql-test/suite/innodb/r/innodb-table-online.result
@@ -3,7 +3,9 @@ call mtr.add_suppression("InnoDB: Error: table 'test/t1'");
call mtr.add_suppression("MySQL is trying to open a table handle but the .ibd file for");
SET @global_innodb_file_per_table_orig = @@global.innodb_file_per_table;
SET GLOBAL innodb_file_per_table = on;
-CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 TEXT NOT NULL)
+SET @file_format = @@GLOBAL.innodb_file_format;
+SET GLOBAL innodb_file_format = Barracuda;
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 CHAR(255) NOT NULL)
ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,1,''), (2,2,''), (3,3,''), (4,4,''), (5,5,'');
SET GLOBAL innodb_monitor_enable = module_ddl;
@@ -53,7 +55,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
- `c3` text NOT NULL,
+ `c3` char(255) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
BEGIN;
@@ -81,7 +83,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
- `c3` text NOT NULL,
+ `c3` char(255) NOT NULL,
UNIQUE KEY `c2` (`c2`),
UNIQUE KEY `c2_2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@@ -92,7 +94,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
- `c3` text NOT NULL,
+ `c3` char(255) NOT NULL,
UNIQUE KEY `c2` (`c2`),
UNIQUE KEY `c2_2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@@ -118,7 +120,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
- `c3` text NOT NULL,
+ `c3` char(255) NOT NULL,
UNIQUE KEY `c2` (`c2`),
UNIQUE KEY `c2_2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@@ -178,23 +180,33 @@ INSERT INTO t1 SELECT 20 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 40 + c1, c2, c3 FROM t1;
EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 80 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL ROWS Using where
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
+SET @merge_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
# session con1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
- `c3` text NOT NULL,
+ `c3` char(255) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done';
SET lock_wait_timeout = 10;
-ALTER TABLE t1 ROW_FORMAT=COMPACT, ALGORITHM = INPLACE;
+ALTER TABLE t1 ROW_FORMAT=COMPACT
+PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;
# session default
INSERT INTO t1 SELECT 80 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 160 + c1, c2, c3 FROM t1;
@@ -236,6 +248,22 @@ ddl_background_drop_indexes 0
ddl_background_drop_tables 0
ddl_online_create_index 1
ddl_pending_alter_table 1
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SELECT
+(@merge_encrypt_1-@merge_encrypt_0)-
+(@merge_decrypt_1-@merge_decrypt_0) as sort_balance,
+@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
+@rowlog_encrypt_1>@rowlog_encrypt_0;
+sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
+0 0 0 0
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
# session con1
ERROR HY000: Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
@@ -245,14 +273,26 @@ ddl_background_drop_indexes 0
ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt3 WAIT_FOR dml3_done';
ALTER TABLE t1 ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT;
ERROR 42000: Multiple primary key defined
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT;
ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c22f,c4(5)),
-CHANGE c2 c22f INT, CHANGE c3 c3 TEXT NULL, CHANGE c1 c1 INT AFTER c22f,
-ADD COLUMN c4 VARCHAR(6) DEFAULT 'Online';
+CHANGE c2 c22f INT, CHANGE c3 c3 CHAR(255) NULL, CHANGE c1 c1 INT AFTER c22f,
+ADD COLUMN c4 VARCHAR(6) DEFAULT 'Online', LOCK=NONE;
# session default
SET DEBUG_SYNC = 'now WAIT_FOR rebuilt3';
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
@@ -289,6 +329,32 @@ COUNT(c22f)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
+SET @merge_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
+SELECT
+(@merge_encrypt_2-@merge_encrypt_1)-
+(@merge_decrypt_2-@merge_decrypt_1) as sort_balance,
+(@rowlog_encrypt_2-@rowlog_encrypt_1)-
+(@rowlog_decrypt_2-@rowlog_decrypt_1) as log_balance;
+sort_balance log_balance
+0 0
+SELECT
+@merge_encrypt_2-@merge_encrypt_1>0 as sort_encrypted,
+@merge_decrypt_2-@merge_decrypt_1>0 as sort_decrypted,
+@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
+@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
+sort_encrypted sort_decrypted log_encrypted log_decrypted
+0 0 0 0
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5));
ERROR 23000: Duplicate entry '' for key 'PRIMARY'
UPDATE t1 SET c3 = NULL WHERE c3 = '';
@@ -300,13 +366,13 @@ SET @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
ALGORITHM = INPLACE;
ERROR 22004: Invalid use of NULL value
-ALTER TABLE t1 MODIFY c3 TEXT NOT NULL;
+ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
ERROR 22004: Invalid use of NULL value
SET @@sql_mode = @old_sql_mode;
-UPDATE t1 SET c3=CONCAT(c1,REPEAT('foo',c1)) WHERE c3 IS NULL;
+UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0';
SET @@sql_mode = 'STRICT_TRANS_TABLES';
-ALTER TABLE t1 MODIFY c3 TEXT NOT NULL, DROP COLUMN c22f,
+ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
ADD COLUMN c5 CHAR(5) DEFAULT 'tired' FIRST;
# session default
SET DEBUG_SYNC = 'now WAIT_FOR c3p5_created0';
@@ -320,7 +386,7 @@ SET @@sql_mode = @old_sql_mode;
# session default
ROLLBACK;
# session con1
-ALTER TABLE t1 MODIFY c3 TEXT NOT NULL;
+ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created WAIT_FOR ins_done';
ALTER TABLE t1 DROP PRIMARY KEY, DROP COLUMN c22f,
ADD COLUMN c6 VARCHAR(1000) DEFAULT
@@ -365,9 +431,9 @@ ALTER TABLE t1 DISCARD TABLESPACE;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c22f` int(11) NOT NULL DEFAULT '0',
- `c1` int(11) NOT NULL DEFAULT '0',
- `c3` text NOT NULL,
+ `c22f` int(11) NOT NULL,
+ `c1` int(11) NOT NULL,
+ `c3` char(255) NOT NULL,
`c4` varchar(6) NOT NULL DEFAULT 'Online',
PRIMARY KEY (`c1`,`c22f`,`c4`(5))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
@@ -375,5 +441,6 @@ SET DEBUG_SYNC = 'RESET';
SET GLOBAL innodb_monitor_disable = module_ddl;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
+SET GLOBAL innodb_file_format = @file_format;
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
diff --git a/mysql-test/suite/innodb/r/innodb-update-insert.result b/mysql-test/suite/innodb/r/innodb-update-insert.result
index cd0fed101ab..034a63bca6c 100644
--- a/mysql-test/suite/innodb/r/innodb-update-insert.result
+++ b/mysql-test/suite/innodb/r/innodb-update-insert.result
@@ -30,7 +30,7 @@ Warnings:
Warning 1366 Incorrect string value: '\xA3' for column 'f1' at row 1
select f1 from t1;
f1
-
+?
update t1 set f1=0x6a;
update t1 set f3=repeat(0xb1,8103);
update t1 set f1=0x4a;
@@ -39,5 +39,5 @@ Warnings:
Warning 1366 Incorrect string value: '\x82' for column 'f1' at row 1
select f1 from t1;
f1
-
+?
drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
index 43958f60578..66b7d246e30 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
@@ -894,7 +894,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported
+ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
diff --git a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
index 59d0921e31f..6cf3ad4fc08 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
@@ -265,7 +265,7 @@ test/t1 test/t3
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c3` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -307,7 +307,7 @@ t3.ibd
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`1234567890123456789012345678901234567890123456789012345678901234` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -388,7 +388,7 @@ test/t1 test/t2
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c3` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -729,7 +729,7 @@ ID FOR_COL_NAME REF_COL_NAME POS
SHOW CREATE TABLE tt;
Table Create Table
tt CREATE TABLE `tt` (
- `pk` int(11) NOT NULL DEFAULT '0',
+ `pk` int(11) NOT NULL,
`c2` int(11) DEFAULT '42',
`ct` text,
PRIMARY KEY (`pk`),
@@ -945,7 +945,7 @@ tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c2` int(11) NOT NULL DEFAULT '0',
+ `c2` int(11) NOT NULL,
`ct` int(11) DEFAULT NULL,
`c1` text,
PRIMARY KEY (`c2`),
@@ -999,7 +999,7 @@ tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c2` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -1056,7 +1056,7 @@ tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c4` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
@@ -1156,7 +1156,7 @@ tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
- `c1` int(11) NOT NULL DEFAULT '0',
+ `c1` int(11) NOT NULL,
`c11` int(11) DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index 7f7632fc594..3255b61d422 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -721,7 +721,8 @@ update t1 set sca_pic="test" where sca_pic is null;
delete from t1 where sca_code='pd';
drop table t1;
set @a:=now();
-CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
+CREATE TABLE t1 (a int not null, b timestamp not null default
+current_timestamp on update current_timestamp, primary key (a)) engine=innodb;
insert into t1 (a) values(1),(2),(3);
select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
a
@@ -2486,7 +2487,7 @@ INSERT INTO t2 VALUES(1);
DELETE FROM t1 WHERE id = 1;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
DROP TABLE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=1;
diff --git a/mysql-test/suite/innodb/r/innodb_blob_truncate.result b/mysql-test/suite/innodb/r/innodb_blob_truncate.result
new file mode 100644
index 00000000000..569e6b03452
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_blob_truncate.result
@@ -0,0 +1,19 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+create table t1(a blob) engine=innodb key_block_size=8;
+create function generate_blob()
+returns varchar(20000)
+begin
+declare x varchar(20000) default '';
+declare i int default 500;
+while i > 0 do
+set x = concat(sha1(i), x);
+set i = i - 1;
+end while;
+return x;
+end //
+insert into t1 select generate_blob();
+truncate t1;
+insert into t1 select generate_blob();
+drop table t1;
+drop function generate_blob;
diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result
index faf922ca5f8..989e433338e 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14147491.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result
@@ -1,28 +1,20 @@
-CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
-CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
+call mtr.add_suppression("InnoDB: Table \"test\".\"t1\" is corrupted. Please drop the table and recreate.");
+call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup.");
# Create and populate the table to be corrupted
+set global innodb_file_per_table=ON;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
INSERT INTO t1 (b) VALUES ('corrupt me');
-# Write file to make mysql-test-run.pl expect the "crash", but don't
-# start it until it's told to
-# We give 30 seconds to do a clean shutdown because we do not want
-# to redo apply the pages of t1.ibd at the time of recovery.
-# We want SQL to initiate the first access to t1.ibd.
-# Wait until disconnected.
-# Backup the t1.ibd before corrupting
# Corrupt the table
Munged a string.
Munged a string.
-# Write file to make mysql-test-run.pl start up the server again
-SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
-# Write file to make mysql-test-run.pl expect the "crash", but don't
-# start it until it's told to
-# The below SELECT query will crash the server because some pages
-# on the disk are corrupted
+# Now t1 is corrupted but we should not crash
SELECT * FROM t1;
-ERROR HY000: Lost connection to MySQL server during query
-# Restore the original t1.ibd
-# Write file to make mysql-test-run.pl start up the server again
-# Cleanup
+Got one of the listed errors
+INSERT INTO t1(b) VALUES('abcdef');
+Got one of the listed errors
+UPDATE t1 set b = 'deadbeef' where a = 1;
+Got one of the listed errors
+# Cleanup, this must be possible
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug21704.result b/mysql-test/suite/innodb/r/innodb_bug21704.result
index 239aeaa354d..c0bc3af2f20 100644
--- a/mysql-test/suite/innodb/r/innodb_bug21704.result
+++ b/mysql-test/suite/innodb/r/innodb_bug21704.result
@@ -54,14 +54,14 @@ info: Records: 0 Duplicates: 0 Warnings: 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `e` int(11) NOT NULL DEFAULT '0',
+ `e` int(11) NOT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`e`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `z` int(11) NOT NULL DEFAULT '0',
+ `z` int(11) NOT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`z`),
CONSTRAINT `fk1` FOREIGN KEY (`z`) REFERENCES `t1` (`e`)
@@ -69,7 +69,7 @@ t2 CREATE TABLE `t2` (
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `f` int(11) NOT NULL DEFAULT '0',
+ `f` int(11) NOT NULL,
`g` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
PRIMARY KEY (`f`),
diff --git a/mysql-test/suite/innodb/r/innodb_bug53756.result b/mysql-test/suite/innodb/r/innodb_bug53756.result
index 2a2a30e2482..bbaeb0b4060 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53756.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53756.result
@@ -1,4 +1,3 @@
-DROP TABLE IF EXISTS bug_53756 ;
CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
@@ -86,21 +85,9 @@ pk c1
2 22
3 77
4 44
-
-# connection default
-#
-# Crash server.
START TRANSACTION;
INSERT INTO bug_53756 VALUES (666,666);
-SET SESSION debug_dbug="+d,crash_commit_before";
-COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
-
-#
-# disconnect con1, con2, con3, con4, con5, con6.
-#
-# Restart server.
-
+# Kill and restart
#
# Select recovered data.
# Delete of row 1 was committed.
@@ -113,6 +100,4 @@ pk c1
2 22
3 77
4 44
-
-# Clean up.
DROP TABLE bug_53756;
diff --git a/mysql-test/suite/innodb/r/innodb_bug59641.result b/mysql-test/suite/innodb/r/innodb_bug59641.result
index f4c2199ae88..c7fa4870d91 100644
--- a/mysql-test/suite/innodb/r/innodb_bug59641.result
+++ b/mysql-test/suite/innodb/r/innodb_bug59641.result
@@ -41,9 +41,9 @@ a b
COMMIT;
XA RECOVER;
formatID gtrid_length bqual_length data
-1 3 0 789
-1 3 0 456
1 3 0 123
+1 3 0 456
+1 3 0 789
XA ROLLBACK '123';
XA ROLLBACK '456';
XA COMMIT '789';
diff --git a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result
index 0008de141dc..fefadb2ecb0 100644
--- a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result
+++ b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result
@@ -396,6 +396,7 @@ utf8mb4_test_400_ci utf8mb4 328 8
latin1_test2 latin1 332 1
utf8_bengali_standard_ci utf8 336 8
utf8_bengali_traditional_ci utf8 337 8
+utf8_implicit_weights_ci utf8 338 8
utf8_phone_ci utf8 352 8
utf8_test_ci utf8 353 8
utf8_5624_1 utf8 354 8
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_binlog.result b/mysql-test/suite/innodb/r/innodb_defrag_binlog.result
new file mode 100644
index 00000000000..6ff32726f57
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defrag_binlog.result
@@ -0,0 +1,29 @@
+include/master-slave.inc
+[connection master]
+drop table if exists t1;
+create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb;
+insert into t1 values (1, REPEAT("a", 256));
+insert into t1 values (2, REPEAT("a", 256));
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+drop table t1;
+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`; DROP TABLE IF EXISTS `t1` /* generated by server */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; optimize table t1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+include/rpl_end.inc
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
new file mode 100644
index 00000000000..d3ad9cc9065
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
@@ -0,0 +1,61 @@
+DROP TABLE if exists t1;
+select @@global.innodb_stats_persistent;
+@@global.innodb_stats_persistent
+0
+set global innodb_defragment_stats_accuracy = 80;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB;
+SET @@global.innodb_defragment_n_pages = 20;
+select count(*) from t1;
+count(*)
+20000
+select count(*) from t1 force index (second);
+count(*)
+20000
+select count(*) from t1 force index (third);
+count(*)
+20000
+select count(*) from t1;
+count(*)
+15800
+select count(*) from t1 force index (second);
+count(*)
+15800
+select count(*) from t1 force index (third);
+count(*)
+15800
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+0
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+optimize table t1;;
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000);;
+INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000);;
+DELETE FROM t1 where a between 1 and 100;;
+UPDATE t1 SET c = c + 1 where c between 2000 and 8000;;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select count(*) from t1;
+count(*)
+15723
+select count(*) from t1 force index (second);
+count(*)
+15723
+select count(*) from t1 force index (third);
+count(*)
+15723
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_stats.result b/mysql-test/suite/innodb/r/innodb_defrag_stats.result
new file mode 100644
index 00000000000..7092688f07b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defrag_stats.result
@@ -0,0 +1,175 @@
+DROP TABLE if exists t1;
+select @@global.innodb_stats_persistent;
+@@global.innodb_stats_persistent
+0
+set global innodb_defragment_stats_accuracy = 20;
+# Create table.
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
+# Populate data
+INSERT INTO t1 VALUES(1, REPEAT('A', 256));
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+# Not enough page splits to trigger persistent stats write yet.
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) = 0
+1
+INSERT INTO t1 (b) SELECT b from t1;
+# Persistent stats recorded.
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+# Delete some rows.
+delete from t1 where a between 100 * 20 and 100 * 20 + 30;
+delete from t1 where a between 100 * 19 and 100 * 19 + 30;
+delete from t1 where a between 100 * 18 and 100 * 18 + 30;
+delete from t1 where a between 100 * 17 and 100 * 17 + 30;
+delete from t1 where a between 100 * 16 and 100 * 16 + 30;
+delete from t1 where a between 100 * 15 and 100 * 15 + 30;
+delete from t1 where a between 100 * 14 and 100 * 14 + 30;
+delete from t1 where a between 100 * 13 and 100 * 13 + 30;
+delete from t1 where a between 100 * 12 and 100 * 12 + 30;
+delete from t1 where a between 100 * 11 and 100 * 11 + 30;
+delete from t1 where a between 100 * 10 and 100 * 10 + 30;
+delete from t1 where a between 100 * 9 and 100 * 9 + 30;
+delete from t1 where a between 100 * 8 and 100 * 8 + 30;
+delete from t1 where a between 100 * 7 and 100 * 7 + 30;
+delete from t1 where a between 100 * 6 and 100 * 6 + 30;
+delete from t1 where a between 100 * 5 and 100 * 5 + 30;
+delete from t1 where a between 100 * 4 and 100 * 4 + 30;
+delete from t1 where a between 100 * 3 and 100 * 3 + 30;
+delete from t1 where a between 100 * 2 and 100 * 2 + 30;
+delete from t1 where a between 100 * 1 and 100 * 1 + 30;
+# Server Restarted
+# Confirm persistent stats still there after restart.
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select sleep(2);
+sleep(2)
+0
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+set global innodb_defragment_stats_accuracy = 40;
+INSERT INTO t1 (b) SELECT b from t1;
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+INSERT INTO t1 (b) SELECT b from t1;
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+# Table rename should cause stats rename.
+rename table t1 to t2;
+select sleep(1);
+sleep(1)
+0
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) = 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+# Drop index should cause stats drop.
+drop index SECOND on t2;
+select sleep(3);
+sleep(3)
+0
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+Server Restarted
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) = 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+# Clean up
+DROP TABLE t2;
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) = 0
+1
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result b/mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result
new file mode 100644
index 00000000000..e668c38e059
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result
@@ -0,0 +1,38 @@
+DROP TABLE if exists t1;
+SET @start_table_definition_cache = @@global.table_definition_cache;
+SET @@global.table_definition_cache = 400;
+SET @start_flush_log_at_trx_commit = @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit=2;
+SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
+SET @@global.innodb_defragment_stats_accuracy = 80;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, REPEAT('A', 256));
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
+stat_value > 0
+Create 505 table to overflow the table cache.
+Sleep for a while to make sure t1 is evicted.
+select sleep(15);
+sleep(15)
+0
+Reload t1 to get defrag stats from persistent storage
+INSERT INTO t1 (b) SELECT b from t1;
+make sure the stats thread will wake up and do the write even if there's a race condition between set and reset.
+select sleep(15);
+sleep(15)
+0
+select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
+stat_value > 0
+SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
+SET @@global.table_definition_cache = @start_table_definition_cache;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defragment.result b/mysql-test/suite/innodb/r/innodb_defragment.result
new file mode 100644
index 00000000000..5d53fde3549
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defragment.result
@@ -0,0 +1,124 @@
+set global innodb_defragment_stats_accuracy = 80;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+create procedure defragment()
+begin
+set @i = 0;
+repeat
+set @i = @i + 1;
+optimize table t1;
+until @i = 3 end repeat;
+end //
+select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value)
+0
+select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value)
+2
+select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value)
+2
+select count(*) from t1;
+count(*)
+10004
+call defragment();
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select count(*) from t1;
+count(*)
+7904
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+0
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 0
+1
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 0
+1
+select count(*) from t1 force index (second);
+count(*)
+7904
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) = 0
+1
+SET @@global.innodb_defragment_n_pages = 3;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) < 3
+1
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) < 3
+1
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) < 3
+1
+select count(*) from t1;
+count(*)
+6904
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) < 3
+1
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) < 3
+1
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) < 3
+1
+select count(*) from t1 force index (second);
+count(*)
+6904
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) = 0
+1
+SET @@global.innodb_defragment_n_pages = 10;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+count(stat_value) > 1
+1
+select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+count(stat_value) > 1
+1
+select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) > 1
+1
+select count(*) from t1 force index (second);
+count(*)
+6904
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
+count(stat_value) = 0
+1
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
+count(stat_value) = 0
+1
+DROP PROCEDURE defragment;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result b/mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result
new file mode 100644
index 00000000000..e1e616a7e6f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result
@@ -0,0 +1,116 @@
+DROP TABLE if exists t1;
+DROP TABLE if exists t2;
+Testing tables with large records
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c VARCHAR(256), KEY SECOND(a, b,c)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1, REPEAT('A', 256), REPEAT('B', 256));
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select count(*) from t1;
+count(*)
+927
+select count(*) from t1 force index (second);
+count(*)
+927
+# A few more insertions on the page should not cause a page split.
+insert into t1 values (81, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (83, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (87, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (82, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (86, REPEAT('A', 256), REPEAT('B', 256));
+# Insert more rows to cause a page split
+insert into t1 values (180, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (181, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (182, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (183, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (184, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (185, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (186, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (187, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (188, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (189, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (190, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (191, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (192, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (193, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (194, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (195, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (196, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (197, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (198, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (199, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (200, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (201, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (202, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (203, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (204, REPEAT('A', 256), REPEAT('B', 256));
+DROP TABLE t1;
+Testing table with small records
+CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(16), c VARCHAR(32), KEY SECOND(a,b,c)) ENGINE=INNODB;
+optimize table t2;
+Table Op Msg_type Msg_text
+test.t2 optimize status OK
+select count(*) from t2;
+count(*)
+3701
+select count(*) from t2 force index(second);
+count(*)
+3701
+The page should have room for about 20 insertions
+insert into t2 values(1181, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1191, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1182, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1192, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1183, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1193, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1184, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1194, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1185, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1195, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1186, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1196, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1187, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1197, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1188, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1198, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1189, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1199, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1190, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1180, REPEAT('A', 16), REPEAT('B',32));
+# Insert more rows to cause a page split
+insert into t2 values (180, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (181, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (182, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (183, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (184, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (185, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (186, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (187, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (188, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (189, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (190, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (191, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (192, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (193, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (194, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (195, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (196, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (197, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (198, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (199, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (200, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (201, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (202, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (203, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (204, REPEAT('A', 16), REPEAT('B', 32));
+DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/r/innodb_defragment_small.result b/mysql-test/suite/innodb/r/innodb_defragment_small.result
new file mode 100644
index 00000000000..3f594f79e70
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defragment_small.result
@@ -0,0 +1,24 @@
+SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
+SET GLOBAL innodb_defragment = 1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), KEY(a, b)) ENGINE=INNODB;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
+#
+# MDEV-12198 innodb_defragment=1 crashes server on
+# OPTIMIZE TABLE when FULLTEXT index exists
+#
+CREATE TABLE t1 (c TEXT, FULLTEXT KEY (c)) ENGINE=InnoDB;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
+SET GLOBAL innodb_defragment = @innodb_defragment_orig;
diff --git a/mysql-test/suite/innodb/r/innodb_force_pk.result b/mysql-test/suite/innodb/r/innodb_force_pk.result
new file mode 100644
index 00000000000..867730a9247
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_force_pk.result
@@ -0,0 +1,65 @@
+create table t1(a integer) engine=innodb;
+ERROR 42000: This table type requires a primary key
+show warnings;
+Level Code Message
+Error 1173 This table type requires a primary key
+create table t1(a integer unique key) engine=innodb;
+ERROR 42000: This table type requires a primary key
+show warnings;
+Level Code Message
+Error 1173 This table type requires a primary key
+create table t1(a integer not null, b integer,
+unique key(a,b)) engine=innodb;
+ERROR 42000: This table type requires a primary key
+show warnings;
+Level Code Message
+Error 1173 This table type requires a primary key
+create table t1(a integer not null primary key) engine=innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show warnings;
+Level Code Message
+drop table t1;
+create table t1(a integer not null unique key) engine=innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ UNIQUE KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show warnings;
+Level Code Message
+drop table t1;
+set global innodb_force_primary_key = 0;
+create table t1(a integer) engine=innodb;
+show warnings;
+Level Code Message
+insert into t1 values (1),(2),(3);
+set global innodb_force_primary_key = 1;
+select * from t1;
+a
+1
+2
+3
+create table t2(a integer) engine=innodb;
+ERROR 42000: This table type requires a primary key
+show warnings;
+Level Code Message
+Error 1173 This table type requires a primary key
+drop table t1;
+create table t1 (i int not null, key(i)) engine=innodb;
+ERROR 42000: This table type requires a primary key
+create table t1 (i int not null, unique key(i)) engine=innodb;
+show warnings;
+Level Code Message
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) NOT NULL,
+ UNIQUE KEY `i` (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result
index f683195ac15..8270a7ad7ff 100644
--- a/mysql-test/suite/innodb/r/innodb_gis.result
+++ b/mysql-test/suite/innodb/r/innodb_gis.result
@@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
-120 120 1 1 0 1 0 1 1 0
+120 120 1 1 0 1 0 0 1 0
120 121 0 0 1 0 0 0 1 0
121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 1 1 0
+121 121 1 1 0 1 0 0 1 0
explain extended SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
@@ -494,7 +494,7 @@ mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
-big,center,down,down2,left,left2,right,right2,small,up,up2
+down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
@@ -515,7 +515,7 @@ overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
-big,center,down,down2,left,left2,right,right2,small,up,up2
+down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
diff --git a/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result b/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
index bd8760b8f79..26ed20ca730 100644
--- a/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
+++ b/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
@@ -140,16 +140,6 @@ key_len NULL
ref NULL
rows NULL
Extra No tables used
-id NULL
-select_type UNION RESULT
-table <union2,3>
-type ALL
-possible_keys NULL
-key NULL
-key_len NULL
-ref NULL
-rows NULL
-Extra
#
# Demonstrate that the reported SELECT statement
# no longer produces warnings.
@@ -344,16 +334,6 @@ key_len NULL
ref NULL
rows NULL
Extra No tables used
-id NULL
-select_type UNION RESULT
-table <union2,3>
-type ALL
-possible_keys NULL
-key NULL
-key_len NULL
-ref NULL
-rows NULL
-Extra
# Lock the record.
select 1 from t1 natural join (select 3 as a, 2 as b union all
select 3 as a, 1 as b) as t2 for update;
diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result
new file mode 100644
index 00000000000..d41eaf6db99
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result
@@ -0,0 +1,388 @@
+SELECT @@innodb_page_size;
+@@innodb_page_size
+32768
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=ON;
+SET @@innodb_strict_mode=ON;
+SELECT @@innodb_file_format;
+@@innodb_file_format
+Barracuda
+SELECT @@innodb_file_per_table;
+@@innodb_file_per_table
+1
+SELECT @@innodb_strict_mode;
+@@innodb_strict_mode
+1
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT= COMPACT;
+ERROR 42000: Row size too large (> 16318). 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.
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT= DYNAMIC;
+ERROR 42000: Row size too large (> 16318). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+show warnings;
+Level Code Message
+Error 1118 Row size too large (> 16318). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+Warning 1030 Got error 139 "Too big row" from storage engine InnoDB
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+ERROR 42000: Row size too large (> 16315). 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.
+show warnings;
+Level Code Message
+Error 1118 Row size too large (> 16315). 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.
+Warning 1030 Got error 139 "Too big row" from storage engine InnoDB
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=FIXED;
+ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+show warnings;
+Level Code Message
+Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
+Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+show warnings;
+Level Code Message
+Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k.
+Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+SET @@innodb_strict_mode=OFF;
+SELECT @@innodb_strict_mode;
+@@innodb_strict_mode
+0
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPACT;
+Warnings:
+Warning 139 Row size too large (> NNNN). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL);
+ERROR 42000: Row size too large (> 16318). 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.
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPACT;
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL);
+ERROR 42000: Row size too large (> 16318). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL);
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+ERROR 42000: Row size too large (> 16318). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL);
+ERROR 42000: Row size too large (> 16318). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL);
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+Warnings:
+Warning 139 Row size too large (> NNNN). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255));
+ERROR 42000: Row size too large (> 16315). 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.
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',89),NULL);
+ERROR 42000: Row size too large (> 16315). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',88),NULL);
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+Warnings:
+Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=COMPACT.
+DROP TABLE tab5;
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+LENGTH(col)
+16384
+32768
+65535
+FLUSH TABLE t;
+ANALYZE TABLE t;
+Table Op Msg_type Msg_text
+test.t analyze status OK
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+stat_value
+6
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+clustered_index_size
+7
+DROP TABLE t;
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+LENGTH(col)
+16384
+32768
+65535
+FLUSH TABLE t;
+ANALYZE TABLE t;
+Table Op Msg_type Msg_text
+test.t analyze status OK
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+stat_value
+4
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+clustered_index_size
+5
+DROP TABLE t;
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+LENGTH(col)
+16384
+32768
+65535
+FLUSH TABLE t;
+ANALYZE TABLE t;
+Table Op Msg_type Msg_text
+test.t analyze status OK
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+stat_value
+4
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+clustered_index_size
+5
+DROP TABLE t;
+# Success
diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result
new file mode 100644
index 00000000000..e7497047295
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result
@@ -0,0 +1,591 @@
+SELECT @@innodb_page_size;
+@@innodb_page_size
+65536
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=ON;
+SET @@innodb_strict_mode=ON;
+SELECT @@innodb_file_format;
+@@innodb_file_format
+Barracuda
+SELECT @@innodb_file_per_table;
+@@innodb_file_per_table
+1
+SELECT @@innodb_strict_mode;
+@@innodb_strict_mode
+1
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT= COMPACT;
+ERROR 42000: Row size too large (> 16383). 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.
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT= DYNAMIC;
+ERROR 42000: Row size too large (> 16383). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+ERROR 42000: Row size too large (> 16382). 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.
+show warnings;
+Level Code Message
+Error 1118 Row size too large (> 16382). 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.
+Warning 1030 Got error 139 "Too big row" from storage engine InnoDB
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=FIXED;
+ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+show warnings;
+Level Code Message
+Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
+Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+show warnings;
+Level Code Message
+Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k.
+Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+SET @@innodb_strict_mode=OFF;
+SELECT @@innodb_strict_mode;
+@@innodb_strict_mode
+0
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=COMPACT;
+Warnings:
+Warning 139 Row size too large (> NNNN). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL);
+ERROR 42000: Row size too large (> 16383). 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.
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255),
+ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255),
+ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255),
+ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255),
+ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255),
+ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255),
+ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255),
+ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255),
+ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255),
+ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255),
+ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255),
+ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=COMPACT;
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+ERROR 42000: Row size too large (> 16383). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+ERROR 42000: Row size too large (> 16383). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255),
+ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255),
+ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255),
+ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255),
+ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255),
+ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255),
+ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255),
+ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255),
+ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255),
+ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255),
+ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255),
+ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+ERROR 42000: Row size too large (> 16383). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+Warnings:
+Warning 139 Row size too large (> NNNN). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+ERROR 42000: Row size too large (> 16382). 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.
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255),
+ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255),
+ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255),
+ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255),
+ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255),
+ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255),
+ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255),
+ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255),
+ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255),
+ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255),
+ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255),
+ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',27),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+ERROR 42000: Row size too large (> 16382). 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 INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',26),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+SELECT * FROM tab5;
+col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+DROP TABLE tab5;
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+Warnings:
+Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=COMPACT.
+DROP TABLE tab5;
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+LENGTH(col)
+16384
+32768
+65535
+FLUSH TABLE t;
+ANALYZE TABLE t;
+Table Op Msg_type Msg_text
+test.t analyze status OK
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+stat_value
+4
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+clustered_index_size
+5
+DROP TABLE t;
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+LENGTH(col)
+16384
+32768
+65535
+FLUSH TABLE t;
+ANALYZE TABLE t;
+Table Op Msg_type Msg_text
+test.t analyze status OK
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+stat_value
+3
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+clustered_index_size
+4
+DROP TABLE t;
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+LENGTH(col)
+16384
+32768
+65535
+FLUSH TABLE t;
+ANALYZE TABLE t;
+Table Op Msg_type Msg_text
+test.t analyze status OK
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+stat_value
+3
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+clustered_index_size
+4
+DROP TABLE t;
+# Success
diff --git a/mysql-test/suite/innodb/r/innodb_monitor.result b/mysql-test/suite/innodb/r/innodb_monitor.result
index f8d24f4e6f5..33acfbdf996 100644
--- a/mysql-test/suite/innodb/r/innodb_monitor.result
+++ b/mysql-test/suite/innodb/r/innodb_monitor.result
@@ -37,7 +37,12 @@ buffer_pool_bytes_dirty disabled
buffer_pool_pages_free disabled
buffer_pages_created disabled
buffer_pages_written disabled
+buffer_index_pages_written disabled
+buffer_non_index_pages_written disabled
buffer_pages_read disabled
+buffer_pages0_read disabled
+buffer_index_sec_rec_cluster_reads disabled
+buffer_index_sec_rec_cluster_reads_avoided disabled
buffer_data_reads disabled
buffer_data_written disabled
buffer_flush_batch_scanned disabled
@@ -68,9 +73,12 @@ buffer_flush_background_pages disabled
buffer_LRU_batch_scanned disabled
buffer_LRU_batch_num_scan disabled
buffer_LRU_batch_scanned_per_call disabled
-buffer_LRU_batch_total_pages disabled
-buffer_LRU_batches disabled
-buffer_LRU_batch_pages disabled
+buffer_LRU_batch_flush_total_pages disabled
+buffer_LRU_batches_flush disabled
+buffer_LRU_batch_flush_pages disabled
+buffer_LRU_batch_evict_total_pages disabled
+buffer_LRU_batches_evict disabled
+buffer_LRU_batch_evict_pages disabled
buffer_LRU_single_flush_scanned disabled
buffer_LRU_single_flush_num_scan disabled
buffer_LRU_single_flush_scanned_per_call disabled
@@ -160,6 +168,21 @@ compress_pages_compressed disabled
compress_pages_decompressed disabled
compression_pad_increments disabled
compression_pad_decrements disabled
+compress_saved disabled
+compress_trim_sect512 disabled
+compress_trim_sect1024 disabled
+compress_trim_sect2048 disabled
+compress_trim_sect4096 disabled
+compress_trim_sect8192 disabled
+compress_trim_sect16384 disabled
+compress_trim_sect32768 disabled
+compress_pages_page_compressed disabled
+compress_page_compressed_trim_op disabled
+compress_page_compressed_trim_op_saved disabled
+compress_pages_page_decompressed disabled
+compress_pages_page_compression_error disabled
+compress_pages_encrypted disabled
+compress_pages_decrypted disabled
index_page_splits disabled
index_page_merge_attempts disabled
index_page_merge_successful disabled
@@ -193,6 +216,8 @@ innodb_log_flush_usec disabled
innodb_mem_validate_usec disabled
innodb_master_purge_usec disabled
innodb_dict_lru_usec disabled
+innodb_dict_lru_count_active disabled
+innodb_dict_lru_count_idle disabled
innodb_checkpoint_usec disabled
innodb_dblwr_writes disabled
innodb_dblwr_pages_written disabled
diff --git a/mysql-test/suite/innodb/r/innodb_multi_update.result b/mysql-test/suite/innodb/r/innodb_multi_update.result
index 558fc3938a8..64f9ebc2fc2 100644
--- a/mysql-test/suite/innodb/r/innodb_multi_update.result
+++ b/mysql-test/suite/innodb/r/innodb_multi_update.result
@@ -75,7 +75,7 @@ a b
5 15
drop table bug38999_1,bug38999_2;
#
-# Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb
+# Bug#54475 improper error handling causes cascading crashing failures in innodb
#
CREATE TABLE t1(f1 INT) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
diff --git a/mysql-test/suite/innodb/r/innodb_mutexes.result b/mysql-test/suite/innodb/r/innodb_mutexes.result
new file mode 100644
index 00000000000..129d7f0762b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_mutexes.result
@@ -0,0 +1,21 @@
+create table t1(a int not null primary key, b int, c int,d CHAR(100)) engine=innodb;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+declare current_num int;
+set current_num = 0;
+while current_num < repeat_count do
+insert into t1 values(current_num, RAND(), RAND(), substring(MD5(RAND()), -64));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(20000);
+commit;
+set autocommit=1;
+delete from t1 where a between 1000 and 1300;
+update t1 set b=b+1 where a between 2000 and 2600;
+insert into t1 select a+30000,b,c,d from t1 where a between 3000 and 4000;
+delete from t1 where a between 6000 and 7000;
+drop procedure innodb_insert_proc;
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index b7fb733b9fd..61eec8d4155 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -634,7 +634,7 @@ ERROR 42S02: Table 'test.bug29807' doesn't exist in engine
drop table t1;
drop table bug29807;
Warnings:
-Warning 155 Table 'test.bug29807' doesn't exist in engine
+Warning 1932 Table 'test.bug29807' doesn't exist in engine
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
switch to connection c1
@@ -694,7 +694,7 @@ EXPLAIN
SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge idx_b,idx_c idx_c,idx_b 8,4 NULL # Using sort_union(idx_c,idx_b); Using where
+1 SIMPLE t1 index_merge idx_b,idx_c idx_c,idx_b 5,4 NULL # Using sort_union(idx_c,idx_b); Using where
SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
COUNT(*)
@@ -934,7 +934,7 @@ EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
id 1
select_type SIMPLE
table t1
-type index
+type range
possible_keys bkey
key bkey
key_len 5
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
new file mode 100644
index 00000000000..0a1f0391250
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -0,0 +1,394 @@
+select * from information_schema.innodb_trx;
+trx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query trx_operation_state trx_tables_in_use trx_tables_locked trx_lock_structs trx_lock_memory_bytes trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks trx_last_foreign_key_error trx_adaptive_hash_latched trx_adaptive_hash_timeout trx_is_read_only trx_autocommit_non_locking
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_trx but the InnoDB storage engine is not installed
+select * from information_schema.innodb_locks;
+lock_id lock_trx_id lock_mode lock_type lock_table lock_index lock_space lock_page lock_rec lock_data
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_locks but the InnoDB storage engine is not installed
+select * from information_schema.innodb_lock_waits;
+requesting_trx_id requested_lock_id blocking_trx_id blocking_lock_id
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_lock_waits but the InnoDB storage engine is not installed
+select * from information_schema.innodb_cmp;
+page_size compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmp but the InnoDB storage engine is not installed
+select * from information_schema.innodb_cmp_reset;
+page_size compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmp_reset but the InnoDB storage engine is not installed
+select * from information_schema.innodb_cmp_per_index;
+database_name table_name index_name compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmp_per_index but the InnoDB storage engine is not installed
+select * from information_schema.innodb_cmp_per_index_reset;
+database_name table_name index_name compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmp_per_index_reset but the InnoDB storage engine is not installed
+select * from information_schema.innodb_cmpmem;
+page_size buffer_pool_instance pages_used pages_free relocation_ops relocation_time
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmpmem but the InnoDB storage engine is not installed
+select * from information_schema.innodb_cmpmem_reset;
+page_size buffer_pool_instance pages_used pages_free relocation_ops relocation_time
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmpmem_reset but the InnoDB storage engine is not installed
+select * from information_schema.innodb_metrics;
+NAME SUBSYSTEM COUNT MAX_COUNT MIN_COUNT AVG_COUNT COUNT_RESET MAX_COUNT_RESET MIN_COUNT_RESET AVG_COUNT_RESET TIME_ENABLED TIME_DISABLED TIME_ELAPSED TIME_RESET STATUS TYPE COMMENT
+metadata_table_handles_opened metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of table handles opened
+metadata_table_handles_closed metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of table handles closed
+metadata_table_reference_count metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Table reference counter
+metadata_mem_pool_size metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Size of a memory pool InnoDB uses to store data dictionary and internal data structures in bytes
+lock_deadlocks lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of deadlocks
+lock_timeouts lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of lock timeouts
+lock_rec_lock_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times enqueued into record lock wait queue
+lock_table_lock_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times enqueued into table lock wait queue
+lock_rec_lock_requests lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of record locks requested
+lock_rec_lock_created lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of record locks created
+lock_rec_lock_removed lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of record locks removed from the lock queue
+lock_rec_locks lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Current number of record locks on tables
+lock_table_lock_created lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of table locks created
+lock_table_lock_removed lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of table locks removed from the lock queue
+lock_table_locks lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Current number of table locks on tables
+lock_row_lock_current_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of row locks currently being waited for (innodb_row_lock_current_waits)
+lock_row_lock_time lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Time spent in acquiring row locks, in milliseconds (innodb_row_lock_time)
+lock_row_lock_time_max lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value The maximum time to acquire a row lock, in milliseconds (innodb_row_lock_time_max)
+lock_row_lock_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of times a row lock had to be waited for (innodb_row_lock_waits)
+lock_row_lock_time_avg lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value The average time to acquire a row lock, in milliseconds (innodb_row_lock_time_avg)
+buffer_pool_size server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Server buffer pool size (all buffer pools) in bytes
+buffer_pool_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of reads directly from disk (innodb_buffer_pool_reads)
+buffer_pool_read_requests buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of logical read requests (innodb_buffer_pool_read_requests)
+buffer_pool_write_requests buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of write requests (innodb_buffer_pool_write_requests)
+buffer_pool_wait_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of times waited for free buffer (innodb_buffer_pool_wait_free)
+buffer_pool_read_ahead buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages read as read ahead (innodb_buffer_pool_read_ahead)
+buffer_pool_read_ahead_evicted buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Read-ahead pages evicted without being accessed (innodb_buffer_pool_read_ahead_evicted)
+buffer_pool_pages_total buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Total buffer pool size in pages (innodb_buffer_pool_pages_total)
+buffer_pool_pages_misc buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer pages for misc use such as row locks or the adaptive hash index (innodb_buffer_pool_pages_misc)
+buffer_pool_pages_data buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer pages containing data (innodb_buffer_pool_pages_data)
+buffer_pool_bytes_data buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer bytes containing data (innodb_buffer_pool_bytes_data)
+buffer_pool_pages_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer pages currently dirty (innodb_buffer_pool_pages_dirty)
+buffer_pool_bytes_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer bytes currently dirty (innodb_buffer_pool_bytes_dirty)
+buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer pages currently free (innodb_buffer_pool_pages_free)
+buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages created (innodb_pages_created)
+buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages written (innodb_pages_written)
+buffer_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of index pages written (innodb_index_pages_written)
+buffer_non_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of non index pages written (innodb_non_index_pages_written)
+buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages read (innodb_pages_read)
+buffer_pages0_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of page 0 read (innodb_pages0_read)
+buffer_index_sec_rec_cluster_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of secondary record reads triggered cluster read
+buffer_index_sec_rec_cluster_reads_avoided buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of secondary record reads avoided triggering cluster read
+buffer_data_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Amount of data read in bytes (innodb_data_reads)
+buffer_data_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Amount of data written in bytes (innodb_data_written)
+buffer_flush_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages scanned as part of flush batch
+buffer_flush_batch_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of times buffer flush list flush is called
+buffer_flush_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages scanned per flush batch scan
+buffer_flush_batch_rescan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times rescan of flush list forced
+buffer_flush_batch_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages flushed as part of flush batch
+buffer_flush_batches buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of flush batches
+buffer_flush_batch_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages queued as a flush batch
+buffer_flush_neighbor_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total neighbors flushed as part of neighbor flush
+buffer_flush_neighbor buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of times neighbors flushing is invoked
+buffer_flush_neighbor_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages queued as a neighbor batch
+buffer_flush_n_to_flush_requested buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of pages requested for flushing.
+buffer_flush_avg_page_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Average number of pages at which flushing is happening
+buffer_flush_lsn_avg_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Average redo generation rate
+buffer_flush_pct_for_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Percent of IO capacity used to avoid max dirty page limit
+buffer_flush_pct_for_lsn buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Percent of IO capacity used to avoid reusable redo space limit
+buffer_flush_sync_waits buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times a wait happens due to sync flushing
+buffer_flush_adaptive_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages flushed as part of adaptive flushing
+buffer_flush_adaptive buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of adaptive batches
+buffer_flush_adaptive_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages queued as an adaptive batch
+buffer_flush_sync_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages flushed as part of sync batches
+buffer_flush_sync buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of sync batches
+buffer_flush_sync_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages queued as a sync batch
+buffer_flush_background_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages flushed as part of background batches
+buffer_flush_background buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of background batches
+buffer_flush_background_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages queued as a background batch
+buffer_LRU_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages scanned as part of LRU batch
+buffer_LRU_batch_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of times LRU batch is called
+buffer_LRU_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages scanned per LRU batch call
+buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages flushed as part of LRU batches
+buffer_LRU_batches_flush buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of LRU batches
+buffer_LRU_batch_flush_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages queued as an LRU batch
+buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages evicted as part of LRU batches
+buffer_LRU_batches_evict buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of LRU batches
+buffer_LRU_batch_evict_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Pages queued as an LRU batch
+buffer_LRU_single_flush_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages scanned as part of single page LRU flush
+buffer_LRU_single_flush_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of times single page LRU flush is called
+buffer_LRU_single_flush_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Page scanned per single LRU flush
+buffer_LRU_single_flush_failure_count Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times attempt to flush a single page from LRU failed
+buffer_LRU_get_free_search Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of searches performed for a clean page
+buffer_LRU_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages scanned as part of LRU search
+buffer_LRU_search_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of times LRU search is performed
+buffer_LRU_search_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Page scanned per single LRU search
+buffer_LRU_unzip_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_owner Total pages scanned as part of LRU unzip search
+buffer_LRU_unzip_search_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Number of times LRU unzip search is performed
+buffer_LRU_unzip_search_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled set_member Page scanned per single LRU unzip search
+buffer_page_read_index_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Index Leaf Pages read
+buffer_page_read_index_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Index Non-leaf Pages read
+buffer_page_read_index_ibuf_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Index Leaf Pages read
+buffer_page_read_index_ibuf_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Index Non-Leaf Pages read
+buffer_page_read_undo_log buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Undo Log Pages read
+buffer_page_read_index_inode buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Index Inode Pages read
+buffer_page_read_ibuf_free_list buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Free List Pages read
+buffer_page_read_ibuf_bitmap buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Bitmap Pages read
+buffer_page_read_system_page buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of System Pages read
+buffer_page_read_trx_system buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Transaction System Pages read
+buffer_page_read_fsp_hdr buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of File Space Header Pages read
+buffer_page_read_xdes buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Extent Descriptor Pages read
+buffer_page_read_blob buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Uncompressed BLOB Pages read
+buffer_page_read_zblob buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of First Compressed BLOB Pages read
+buffer_page_read_zblob2 buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Subsequent Compressed BLOB Pages read
+buffer_page_read_other buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of other/unknown (old version of InnoDB) Pages read
+buffer_page_written_index_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Index Leaf Pages written
+buffer_page_written_index_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Index Non-leaf Pages written
+buffer_page_written_index_ibuf_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Index Leaf Pages written
+buffer_page_written_index_ibuf_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Index Non-Leaf Pages written
+buffer_page_written_undo_log buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Undo Log Pages written
+buffer_page_written_index_inode buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Index Inode Pages written
+buffer_page_written_ibuf_free_list buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Free List Pages written
+buffer_page_written_ibuf_bitmap buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Insert Buffer Bitmap Pages written
+buffer_page_written_system_page buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of System Pages written
+buffer_page_written_trx_system buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Transaction System Pages written
+buffer_page_written_fsp_hdr buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of File Space Header Pages written
+buffer_page_written_xdes buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Extent Descriptor Pages written
+buffer_page_written_blob buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Uncompressed BLOB Pages written
+buffer_page_written_zblob buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of First Compressed BLOB Pages written
+buffer_page_written_zblob2 buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Subsequent Compressed BLOB Pages written
+buffer_page_written_other buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of other/unknown (old version InnoDB) Pages written
+os_data_reads os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of reads initiated (innodb_data_reads)
+os_data_writes os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of writes initiated (innodb_data_writes)
+os_data_fsyncs os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of fsync() calls (innodb_data_fsyncs)
+os_pending_reads os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of reads pending
+os_pending_writes os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of writes pending
+os_log_bytes_written os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled 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 disabled 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 disabled 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 disabled 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 disabled counter Number of read-write transactions committed
+trx_ro_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of read-only transactions committed
+trx_nl_ro_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of non-locking auto-commit read-only transactions committed
+trx_commits_insert_update transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of transactions committed with inserts and updates
+trx_rollbacks transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of transactions rolled back
+trx_rollbacks_savepoint transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of transactions rolled back to savepoint
+trx_rollback_active transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of resurrected active transactions rolled back
+trx_active_transactions transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of active transactions
+trx_rseg_history_len transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Length of the TRX_RSEG_HISTORY list
+trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of undo slots used
+trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of undo slots cached
+trx_rseg_current_size transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Current rollback segment size in pages
+purge_del_mark_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of delete-marked rows purged
+purge_upd_exist_or_extern_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of purges on updates of existing records and updates on delete marked record with externally stored field
+purge_invoked purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times purge was invoked
+purge_undo_log_pages purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of undo log pages handled by the purge
+purge_dml_delay_usec purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled 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 disabled value Number of times purge was stopped
+purge_resume_count purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Number of times purge was resumed
+log_checkpoints recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of checkpoints
+log_lsn_last_flush recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value LSN of Last flush
+log_lsn_last_checkpoint recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value LSN at last checkpoint
+log_lsn_current recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Current LSN value
+log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter 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 disabled 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 disabled value Maximum LSN difference; when exceeded, start asynchronous preflush
+log_max_modified_age_sync recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Maximum LSN difference; when exceeded, start synchronous preflush
+log_pending_log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending log writes
+log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending checkpoints
+log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of log I/Os
+log_waits recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled 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 disabled 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 disabled status_counter Number of log writes (innodb_log_writes)
+compress_pages_compressed compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of pages compressed
+compress_pages_decompressed compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of pages decompressed
+compression_pad_increments compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times padding is incremented to avoid compression failures
+compression_pad_decrements compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times padding is decremented due to good compressibility
+compress_saved compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of bytes saved by page compression
+compress_trim_sect512 compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of sect-512 TRIMed by page compression
+compress_trim_sect1024 compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of sect-1024 TRIMed by page compression
+compress_trim_sect2048 compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of sect-2048 TRIMed by page compression
+compress_trim_sect4096 compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of sect-4K TRIMed by page compression
+compress_trim_sect8192 compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of sect-8K TRIMed by page compression
+compress_trim_sect16384 compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of sect-16K TRIMed by page compression
+compress_trim_sect32768 compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of sect-32K TRIMed by page compression
+compress_pages_page_compressed compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of pages compressed by page compression
+compress_page_compressed_trim_op compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of TRIM operation performed by page compression
+compress_page_compressed_trim_op_saved compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of TRIM operation saved by page compression
+compress_pages_page_decompressed compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of pages decompressed by page compression
+compress_pages_page_compression_error compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of page compression errors
+compress_pages_encrypted compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of pages encrypted
+compress_pages_decrypted compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of pages decrypted
+index_page_splits index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of index page splits
+index_page_merge_attempts index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of index page merge attempts
+index_page_merge_successful index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of successful index page merges
+index_page_reorg_attempts index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of index page reorganization attempts
+index_page_reorg_successful index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of successful index page reorganizations
+index_page_discards index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of index pages discarded
+adaptive_hash_searches adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of successful searches using Adaptive Hash Index
+adaptive_hash_searches_btree adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of searches using B-tree on an index search
+adaptive_hash_pages_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of index pages on which the Adaptive Hash Index is built
+adaptive_hash_pages_removed adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of index pages whose corresponding Adaptive Hash Index entries were removed
+adaptive_hash_rows_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Adaptive Hash Index rows added
+adaptive_hash_rows_removed adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Adaptive Hash Index rows removed
+adaptive_hash_rows_deleted_no_hash_entry adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of rows deleted that did not have corresponding Adaptive Hash Index entries
+adaptive_hash_rows_updated adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of Adaptive Hash Index rows updated
+file_num_open_files file_system 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Number of files currently open (innodb_num_open_files)
+ibuf_merges_insert change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of inserted records merged by change buffering
+ibuf_merges_delete_mark change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of deleted records merged by change buffering
+ibuf_merges_delete change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of purge records merged by change buffering
+ibuf_merges_discard_insert change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of insert merged operations discarded
+ibuf_merges_discard_delete_mark change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of deleted merged operations discarded
+ibuf_merges_discard_delete change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of purge merged operations discarded
+ibuf_merges change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of change buffer merges
+ibuf_size change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Change buffer size in pages
+innodb_master_thread_sleeps server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times (seconds) master thread sleeps
+innodb_activity_count server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Current server activity count
+innodb_master_active_loops server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times master thread performs its tasks when server is active
+innodb_master_idle_loops server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of times master thread performs its tasks when server is idle
+innodb_background_drop_table_usec server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Time (in microseconds) spent to process drop table list
+innodb_ibuf_merge_usec server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Time (in microseconds) spent to process change buffer merge
+innodb_log_flush_usec server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Time (in microseconds) spent to flush log records
+innodb_mem_validate_usec server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Time (in microseconds) spent to do memory validation
+innodb_master_purge_usec server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Time (in microseconds) spent by master thread to purge records
+innodb_dict_lru_usec server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Time (in microseconds) spent to process DICT LRU list
+innodb_dict_lru_count_active server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of tables evicted from DICT LRU list in the active loop
+innodb_dict_lru_count_idle server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of tables evicted from DICT LRU list in the idle loop
+innodb_checkpoint_usec server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Time (in microseconds) spent by master thread to do checkpoint
+innodb_dblwr_writes server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of doublewrite operations that have been performed (innodb_dblwr_writes)
+innodb_dblwr_pages_written server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages that have been written for doublewrite operations (innodb_dblwr_pages_written)
+innodb_page_size server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value InnoDB page size in bytes (innodb_page_size)
+innodb_rwlock_s_spin_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rwlock spin waits due to shared latch request
+innodb_rwlock_x_spin_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rwlock spin waits due to exclusive latch request
+innodb_rwlock_s_spin_rounds server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rwlock spin loop rounds due to shared latch request
+innodb_rwlock_x_spin_rounds server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rwlock spin loop rounds due to exclusive latch request
+innodb_rwlock_s_os_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of OS waits due to shared latch request
+innodb_rwlock_x_os_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of OS waits due to exclusive latch request
+dml_reads dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rows read
+dml_inserts dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rows inserted
+dml_deletes dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rows deleted
+dml_updates dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of rows updated
+dml_system_reads dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of system rows read
+dml_system_inserts dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of system rows inserted
+dml_system_deletes dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of system rows deleted
+dml_system_updates dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of system rows updated
+ddl_background_drop_indexes ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of indexes waiting to be dropped after failed index creation
+ddl_background_drop_tables ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of tables in background drop table list
+ddl_online_create_index ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of indexes being created online
+ddl_pending_alter_table ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of ALTER TABLE, CREATE INDEX, DROP INDEX in progress
+icp_attempts icp 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of attempts for index push-down condition checks
+icp_no_match icp 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Index push-down condition does not match
+icp_out_of_range icp 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Index push-down condition out of range
+icp_match icp 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Index push-down condition matches
+select * from information_schema.innodb_ft_default_stopword;
+value
+a
+about
+an
+are
+as
+at
+be
+by
+com
+de
+en
+for
+from
+how
+i
+in
+is
+it
+la
+of
+on
+or
+that
+the
+this
+to
+was
+what
+when
+where
+who
+will
+with
+und
+the
+www
+select * from information_schema.innodb_ft_deleted;
+DOC_ID
+select * from information_schema.innodb_ft_being_deleted;
+DOC_ID
+select * from information_schema.innodb_ft_index_cache;
+WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
+select * from information_schema.innodb_ft_index_table;
+WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
+select * from information_schema.innodb_ft_config;
+KEY VALUE
+select * from information_schema.innodb_buffer_page;
+POOL_ID BLOCK_ID SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE PAGE_STATE IO_FIX IS_OLD FREE_PAGE_CLOCK
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_buffer_page but the InnoDB storage engine is not installed
+select * from information_schema.innodb_buffer_page_lru;
+POOL_ID LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_buffer_page_lru but the InnoDB storage engine is not installed
+select * from information_schema.innodb_buffer_stats;
+select * from information_schema.innodb_sys_tables;
+TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_tables but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_tablestats;
+TABLE_ID NAME STATS_INITIALIZED NUM_ROWS CLUST_INDEX_SIZE OTHER_INDEX_SIZE MODIFIED_COUNTER AUTOINC REF_COUNT
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_tablestats but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_indexes;
+INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_indexes but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_columns;
+TABLE_ID NAME POS MTYPE PRTYPE LEN
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_columns but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_fields;
+INDEX_ID NAME POS
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_fields but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_foreign;
+ID FOR_NAME REF_NAME N_COLS TYPE
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_foreign but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_foreign_cols;
+ID FOR_COL_NAME REF_COL_NAME POS
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_foreign_cols but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_tablespaces;
+SPACE NAME FLAG FILE_FORMAT ROW_FORMAT PAGE_SIZE ZIP_PAGE_SIZE
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_tablespaces but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_datafiles;
+SPACE PATH
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_datafiles but the InnoDB storage engine is not installed
+select * from information_schema.innodb_changed_pages;
+space_id page_id start_lsn end_lsn
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_changed_pages but the InnoDB storage engine is not installed
+select * from information_schema.innodb_tablespaces_encryption;
+SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER CURRENT_KEY_ID ROTATING_OR_FLUSHING
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_encryption but the InnoDB storage engine is not installed
+select * from information_schema.innodb_tablespaces_scrubbing;
+SPACE NAME COMPRESSED LAST_SCRUB_COMPLETED CURRENT_SCRUB_STARTED CURRENT_SCRUB_ACTIVE_THREADS CURRENT_SCRUB_PAGE_NUMBER CURRENT_SCRUB_MAX_PAGE_NUMBER
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_scrubbing but the InnoDB storage engine is not installed
+select * from information_schema.innodb_mutexes;
+NAME CREATE_FILE CREATE_LINE OS_WAITS
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_mutexes but the InnoDB storage engine is not installed
+select * from information_schema.innodb_sys_semaphore_waits;
+THREAD_ID OBJECT_NAME FILE LINE WAIT_TIME WAIT_OBJECT WAIT_TYPE HOLDER_THREAD_ID HOLDER_FILE HOLDER_LINE CREATED_FILE CREATED_LINE WRITER_THREAD RESERVATION_MODE READERS WAITERS_FLAG LOCK_WORD LAST_READER_FILE LAST_READER_LINE LAST_WRITER_FILE LAST_WRITER_LINE OS_WAIT_COUNT
+Warnings:
+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_semaphore_waits but the InnoDB storage engine is not installed
diff --git a/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result b/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result
index befbb709c19..6093fbae86b 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result
@@ -1,4 +1,4 @@
-call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table*");
+call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table *");
CREATE TABLE test_ps_fetch_nonexistent
(a INT, PRIMARY KEY (a))
ENGINE=INNODB STATS_PERSISTENT=1;
diff --git a/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result b/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
new file mode 100644
index 00000000000..4164e043b2c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
@@ -0,0 +1,26 @@
+# Establish connection con1 (user=root)
+# Establish connection con2 (user=root)
+drop table if exists t1;
+# Switch to connection con1
+create table t1 (id integer, x integer) engine = InnoDB;
+insert into t1 values(0, 0);
+set DEBUG_DBUG='+d,fatal-semaphore-timeout';
+set autocommit=0;
+# Sending query on con1,
+# the session will hold lock table mutex and sleep
+SELECT * from t1 where id = 0 FOR UPDATE;
+# Switch to connection con2
+set autocommit=0;
+# Sending query on con2,
+# the session will be blocked on the lock table mutex and
+# thus be put into sync arry
+SELECT * from t1 where id = 0 FOR UPDATE;
+# Switched to the default connection
+# Waitting for mysqld to crash
+# Mysqld crash was detected
+# Waitting for reconnect after mysqld restarts
+# Reconnected after mysqld was successfully restarted
+# Cleaning up before exit
+set DEBUG_DBUG=NULL;
+drop table if exists t1;
+# Clean exit
diff --git a/mysql-test/suite/innodb/r/innodb_uninstall.result b/mysql-test/suite/innodb/r/innodb_uninstall.result
index 2064269a02e..5a2c6f5c2be 100644
--- a/mysql-test/suite/innodb/r/innodb_uninstall.result
+++ b/mysql-test/suite/innodb/r/innodb_uninstall.result
@@ -9,8 +9,8 @@ sleep(1)
0
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
-drop table t1;
install plugin innodb soname 'ha_innodb';
+drop table t1;
create table t2(a int not null primary key) engine=innodb;
insert into t2 values(1);
drop table t2;
diff --git a/mysql-test/suite/innodb/r/innodb_zip_innochecksum.result b/mysql-test/suite/innodb/r/innodb_zip_innochecksum.result
new file mode 100644
index 00000000000..ff1bccfb60c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_zip_innochecksum.result
@@ -0,0 +1,91 @@
+# Set the environmental variables
+call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
+call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
+CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
+CREATE INDEX idx1 ON tab1(c2(10));
+INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+insert into t1 values(1,"i");
+insert into t1 values(2,"am");
+insert into t1 values(3,"compressed table");
+# Shutdown the Server
+# Server Default checksum = innodb
+[1b]: check the innochecksum without --strict-check
+[2]: check the innochecksum with full form --strict-check=crc32
+[3]: check the innochecksum with short form -C crc32
+[4]: check the innochecksum with --no-check ignores algorithm check, warning is expected
+FOUND /Error: --no-check must be associated with --write option./ in my_restart.err
+[5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected
+FOUND /Error: --no-check must be associated with --write option./ in my_restart.err
+[6]: check the innochecksum with full form strict-check & no-check , an error is expected
+FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
+[7]: check the innochecksum with short form strict-check & no-check , an error is expected
+FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
+[8]: check the innochecksum with short & full form combination
+# strict-check & no-check, an error is expected
+FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
+[9]: check the innochecksum with full form --strict-check=innodb
+[10]: check the innochecksum with full form --strict-check=none
+# when server Default checksum=crc32
+[11]: check the innochecksum with short form -C innodb
+# when server Default checksum=crc32
+[12]: check the innochecksum with short form -C none
+# when server Default checksum=crc32
+[13]: check strict-check with invalid values
+FOUND /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'crc\' to \'strict-check\'/ in my_restart.err
+FOUND /Error while setting value \'no\' to \'strict-check\'/ in my_restart.err
+[14a]: when server default checksum=crc32 rewrite new checksum=crc32 with innochecksum
+# Also check the long form of write option.
+[14b]: when server default checksum=crc32 rewrite new checksum=innodb with innochecksum
+# Also check the long form of write option.
+# start the server with innodb_checksum_algorithm=InnoDB
+INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
+SELECT c1,c2 FROM tab1 order by c1,c2;
+c1 c2
+1 Innochecksum InnoDB1
+2 Innochecksum CRC32
+# Stop the server
+[15]: when server default checksum=crc32 rewrite new checksum=none with innochecksum
+# Also check the short form of write option.
+# Start the server with checksum algorithm=none
+INSERT INTO tab1 VALUES(3, 'Innochecksum None');
+SELECT c1,c2 FROM tab1 order by c1,c2;
+c1 c2
+1 Innochecksum InnoDB1
+2 Innochecksum CRC32
+3 Innochecksum None
+DROP TABLE t1;
+# Stop the server
+[16]: rewrite into new checksum=crc32 with innochecksum
+# Restart the DB server with innodb_checksum_algorithm=crc32
+SELECT * FROM tab1;
+c1 c2
+1 Innochecksum InnoDB1
+2 Innochecksum CRC32
+3 Innochecksum None
+DELETE FROM tab1 where c1=3;
+SELECT c1,c2 FROM tab1 order by c1,c2;
+c1 c2
+1 Innochecksum InnoDB1
+2 Innochecksum CRC32
+# Stop server
+[17]: rewrite into new checksum=InnoDB
+# Restart the DB server with innodb_checksum_algorithm=InnoDB
+DELETE FROM tab1 where c1=2;
+SELECT * FROM tab1;
+c1 c2
+1 Innochecksum InnoDB1
+# Stop server
+[18]:check Innochecksum with invalid write options
+FOUND /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
+FOUND /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
+FOUND /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
+DROP TABLE tab1;
diff --git a/mysql-test/suite/innodb/r/innodb_zip_innochecksum2.result b/mysql-test/suite/innodb/r/innodb_zip_innochecksum2.result
new file mode 100644
index 00000000000..582bb42f0cb
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_zip_innochecksum2.result
@@ -0,0 +1,160 @@
+SET GLOBAL innodb_compression_level=0;
+SELECT @@innodb_compression_level;
+@@innodb_compression_level
+0
+CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+INSERT INTO t1 SELECT * from t1;
+# stop the server
+
+Variables (--variable-name=value)
+and boolean options {FALSE|TRUE} Value (after reading options)
+--------------------------------- ----------------------------------------
+verbose TRUE
+debug FALSE
+count FALSE
+start-page 0
+end-page 0
+page 0
+strict-check crc32
+no-check FALSE
+allow-mismatches 0
+write crc32
+page-type-summary FALSE
+page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt
+per-page-details FALSE
+log (No default value)
+leaf FALSE
+merge 0
+[1]:# check the both short and long options for "help"
+[2]:# Run the innochecksum when file isn't provided.
+# It will print the innochecksum usage similar to --help option.
+innochecksum Ver #.#.#
+Copyright (c) YEAR, YEAR , Oracle, MariaDB Corporation Ab and others.
+
+InnoDB offline file checksum utility.
+Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] [-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] [-l <log>] [-l] [-m <merge pages>] <filename or [-]>
+ -?, --help Displays this help and exits.
+ -I, --info Synonym for --help.
+ -V, --version Displays version information and exits.
+ -v, --verbose Verbose (prints progress every 5 seconds).
+ -c, --count Print the count of pages in the file and exits.
+ -s, --start-page=# Start on this page number (0 based).
+ -e, --end-page=# End at this page number (0 based).
+ -p, --page=# Check only this page (0 based).
+ -C, --strict-check=name
+ Specify the strict checksum algorithm by the user.. One
+ of: crc32, crc32, innodb, innodb, none, none
+ -n, --no-check Ignore the checksum verification.
+ -a, --allow-mismatches=#
+ Maximum checksum mismatch allowed.
+ -w, --write=name Rewrite the checksum algorithm by the user.. One of:
+ crc32, crc32, innodb, innodb, none, none
+ -S, --page-type-summary
+ Display a count of each page type in a tablespace.
+ -D, --page-type-dump=name
+ Dump the page type info for each page in a tablespace.
+ -i, --per-page-details
+ Print out per-page detail information.
+ -l, --log=name log output.
+ -f, --leaf Examine leaf index pages
+ -m, --merge=# leaf page count if merge given number of consecutive
+ pages
+
+Variables (--variable-name=value)
+and boolean options {FALSE|TRUE} Value (after reading options)
+--------------------------------- ----------------------------------------
+verbose FALSE
+count FALSE
+start-page 0
+end-page 0
+page 0
+strict-check crc32
+no-check FALSE
+allow-mismatches 0
+write crc32
+page-type-summary FALSE
+page-type-dump (No default value)
+per-page-details FALSE
+log (No default value)
+leaf FALSE
+merge 0
+[3]:# check the both short and long options for "count" and exit
+Number of pages:#
+Number of pages:#
+[4]:# Print the version of innochecksum and exit
+innochecksum Ver #.#.## Restart the DB server
+DROP TABLE t1;
+[5]:# Check the innochecksum for compressed table t1 with different key_block_size
+# Test for KEY_BLOCK_SIZE=1
+===> Testing size=1
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+insert into t1 values(1,"I");
+insert into t1 values(2,"AM");
+insert into t1 values(3,"COMPRESSED");
+select * from t1;
+id msg
+1 I
+2 AM
+3 COMPRESSED
+drop table t1;
+# Test for KEY_BLOCK_SIZE=2
+===> Testing size=2
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
+insert into t1 values(1,"I");
+insert into t1 values(2,"AM");
+insert into t1 values(3,"COMPRESSED");
+select * from t1;
+id msg
+1 I
+2 AM
+3 COMPRESSED
+drop table t1;
+# Test for for KEY_BLOCK_SIZE=4
+===> Testing size=4
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+insert into t1 values(1,"I");
+insert into t1 values(2,"AM");
+insert into t1 values(3,"COMPRESSED");
+select * from t1;
+id msg
+1 I
+2 AM
+3 COMPRESSED
+drop table t1;
+set innodb_strict_mode=off;
+# Test for for KEY_BLOCK_SIZE=8
+===> Testing size=8
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+insert into t1 values(1,"I");
+insert into t1 values(2,"AM");
+insert into t1 values(3,"COMPRESSED");
+select * from t1;
+id msg
+1 I
+2 AM
+3 COMPRESSED
+drop table t1;
+set innodb_strict_mode=off;
+# Test for KEY_BLOCK_SIZE=16
+===> Testing size=16
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+insert into t1 values(1,"I");
+insert into t1 values(2,"AM");
+insert into t1 values(3,"COMPRESSED");
+select * from t1;
+id msg
+1 I
+2 AM
+3 COMPRESSED
+drop table t1;
+# Test[5] completed
diff --git a/mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result b/mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result
new file mode 100644
index 00000000000..03e8b5df75f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result
@@ -0,0 +1,227 @@
+# Set the environmental variables
+call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
+call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to.*");
+[1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
+CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
+linestring_key GEOMETRY NOT NULL,
+linestring_nokey GEOMETRY NOT NULL)
+ENGINE=InnoDB ;
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) '));
+CREATE INDEX linestring_index ON tab1(linestring_nokey(5));
+ALTER TABLE tab1 ADD KEY (linestring_key(5));
+# create a compressed table
+CREATE TABLE tab2(col_1 CHAR (255) ,
+col_2 VARCHAR (255), col_3 longtext,
+col_4 longtext,col_5 longtext,
+col_6 longtext , col_7 int )
+engine = innodb row_format=compressed key_block_size=4;
+CREATE INDEX idx1 ON tab2(col_3(10));
+CREATE INDEX idx2 ON tab2(col_4(10));
+CREATE INDEX idx3 ON tab2(col_5(10));
+SET @col_1 = repeat('a', 5);
+SET @col_2 = repeat('b', 20);
+SET @col_3 = repeat('c', 100);
+SET @col_4 = repeat('d', 100);
+SET @col_5 = repeat('e', 100);
+SET @col_6 = repeat('f', 100);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,5);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,4);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,3);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,2);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,1);
+SELECT * FROM tab2 ORDER BY col_7;
+# stop the server
+[1(a)]: Rewrite into new checksum=InnoDB for all *.ibd file and ibdata1
+: start the server with innodb_checksum_algorithm=strict_innodb
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (2, ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'), ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'));
+SET @col_1 = repeat('a', 5);
+SET @col_2 = repeat('b', 20);
+SET @col_3 = repeat('c', 100);
+SET @col_4 = repeat('d', 100);
+SET @col_5 = repeat('e', 100);
+SET @col_6 = repeat('f', 100);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,6);
+SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
+FROM tab1 ORDER BY pk;
+SELECT * FROM tab2 ORDER BY col_7;
+# stop the server
+[1(b)]: Rewrite into new checksum=crc32 for all *.ibd file and ibdata1
+# start the server with innodb_checksum_algorithm=strict_crc32
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (3, ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'),
+ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'));
+SET @col_1 = repeat('g', 5);
+SET @col_2 = repeat('h', 20);
+SET @col_3 = repeat('i', 100);
+SET @col_4 = repeat('j', 100);
+SET @col_5 = repeat('k', 100);
+SET @col_6 = repeat('l', 100);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,7);
+SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
+FROM tab1 ORDER BY pk;
+SELECT * FROM tab2 ORDER BY col_7;
+# stop the server
+[1(c)]: Rewrite into new checksum=none for all *.ibd file and ibdata1
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (4, ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '), ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '));
+SET @col_1 = repeat('m', 5);
+SET @col_2 = repeat('n', 20);
+SET @col_3 = repeat('o', 100);
+SET @col_4 = repeat('p', 100);
+SET @col_5 = repeat('q', 100);
+SET @col_6 = repeat('r', 100);
+INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,8);
+SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
+FROM tab1 ORDER BY pk;
+SELECT * FROM tab2 ORDER BY col_7;
+# stop the server
+[2]: Check the page type summary with shortform for tab1.ibd
+
+File::tab#.ibd
+================PAGE TYPE SUMMARY==============
+#PAGE_COUNT PAGE_TYPE
+===============================================
+ # Index page
+ # Undo log page
+ # Inode page
+ # Insert buffer free list page
+ # Freshly allocated page
+ # Insert buffer bitmap
+ # System page
+ # Transaction system page
+ # File Space Header
+ # Extent descriptor page
+ # BLOB page
+ # Compressed BLOB page
+ # Page compressed page
+ # Page compressed encrypted page
+ # Other type of page
+
+===============================================
+Additional information:
+Undo page type: # insert, # update, # other
+Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other
+index_id #pages #leaf_pages #recs_per_page #bytes_per_page
+# # # # #
+# # # # #
+# # # # #
+
+index_id page_data_bytes_histgram(empty,...,oversized)
+# # # # # # # # # # # # #
+# # # # # # # # # # # # #
+# # # # # # # # # # # # #
+[3]: Check the page type summary with longform for tab1.ibd
+
+File::tab#.ibd
+================PAGE TYPE SUMMARY==============
+#PAGE_COUNT PAGE_TYPE
+===============================================
+ # Index page
+ # Undo log page
+ # Inode page
+ # Insert buffer free list page
+ # Freshly allocated page
+ # Insert buffer bitmap
+ # System page
+ # Transaction system page
+ # File Space Header
+ # Extent descriptor page
+ # BLOB page
+ # Compressed BLOB page
+ # Page compressed page
+ # Page compressed encrypted page
+ # Other type of page
+
+===============================================
+Additional information:
+Undo page type: # insert, # update, # other
+Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other
+index_id #pages #leaf_pages #recs_per_page #bytes_per_page
+# # # # #
+# # # # #
+# # # # #
+
+index_id page_data_bytes_histgram(empty,...,oversized)
+# # # # # # # # # # # # #
+# # # # # # # # # # # # #
+# # # # # # # # # # # # #
+[4]: Page type dump for with longform for tab1.ibd
+# Print the contents stored in dump.txt
+
+
+Filename::tab#.ibd
+==============================================================================
+ PAGE_NO | PAGE_TYPE | EXTRA INFO
+==============================================================================
+#::# | File Space Header | -
+#::# | Insert Buffer Bitmap | -
+#::# | Inode page | -
+#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
+#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
+#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
+#::# | Freshly allocated page | -
+#::# | Freshly allocated page | -
+# Variables used by page type dump for ibdata1
+
+Variables (--variable-name=value)
+and boolean options {FALSE|TRUE} Value (after reading options)
+--------------------------------- ----------------------------------------
+verbose TRUE
+count FALSE
+start-page 0
+end-page 0
+page 0
+strict-check crc32
+no-check FALSE
+allow-mismatches 0
+write crc32
+page-type-summary FALSE
+page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt
+per-page-details FALSE
+log (No default value)
+leaf FALSE
+merge 0
+[5]: Page type dump for with shortform for tab1.ibd
+
+
+Filename::tab#.ibd
+==============================================================================
+ PAGE_NO | PAGE_TYPE | EXTRA INFO
+==============================================================================
+#::# | File Space Header | -
+#::# | Insert Buffer Bitmap | -
+#::# | Inode page | -
+#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
+#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
+#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
+#::# | Freshly allocated page | -
+#::# | Freshly allocated page | -
+[6]: check the valid lower bound values for option
+# allow-mismatches,page,start-page,end-page
+[9]: check the both short and long options "page" and "start-page" when
+# seek value is larger than file size.
+FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
+FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
+FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
+FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
+[34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
+# innochecksum will fail with error code: 1
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
+DROP TABLE tab1,tab2;
diff --git a/mysql-test/suite/innodb/r/log_data_file_size.result b/mysql-test/suite/innodb/r/log_data_file_size.result
new file mode 100644
index 00000000000..7e994cbe1e2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/log_data_file_size.result
@@ -0,0 +1,9 @@
+SET GLOBAL innodb_file_per_table=0;
+SET GLOBAL innodb_file_format=barracuda;
+CREATE TABLE t(a INT)ENGINE=InnoDB;
+SET GLOBAL innodb_file_per_table=1;
+CREATE TABLE ibd4(a INT UNIQUE)ENGINE=InnoDB;
+CREATE TABLE ibd4f(a INT UNIQUE)ENGINE=InnoDB;
+CREATE TABLE ibd5(a INT UNIQUE, b INT UNIQUE)ENGINE=InnoDB;
+# Kill the server
+DROP TABLE t,ibd4,ibd4f,ibd5;
diff --git a/mysql-test/suite/innodb/r/table_flags,32k.rdiff b/mysql-test/suite/innodb/r/table_flags,32k.rdiff
new file mode 100644
index 00000000000..a6665e85f49
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,32k.rdiff
@@ -0,0 +1,96 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,32k.reject
+@@ -4,6 +4,8 @@
+ CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+ KEY_BLOCK_SIZE=1;
++Warnings:
++Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=COMPACT.
+ CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+ SYS_TABLES clustered index root page (8):
+@@ -11,7 +13,7 @@
+ header=0x01000003016e (NAME=0x696e66696d756d00)
+ header=0x00002815008d (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320194,
++ DB_ROLL_PTR=0x81000001310194,
+ ID=0x000000000000000e,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+@@ -21,7 +23,7 @@
+ SPACE=0x00000000)
+ header=0x0000101500d5 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0110,
++ DB_ROLL_PTR=0x800000012c0110,
+ ID=0x000000000000000b,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -31,7 +33,7 @@
+ SPACE=0x00000000)
+ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0201,
++ DB_ROLL_PTR=0x800000012c0201,
+ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -41,7 +43,7 @@
+ SPACE=0x00000000)
+ header=0x0400201501fc (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320110,
++ DB_ROLL_PTR=0x81000001310110,
+ ID=0x000000000000000d,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+@@ -51,7 +53,7 @@
+ SPACE=0x00000000)
+ header=0x000038150240 (NAME='test/tc',
+ DB_TRX_ID=0x000000000303,
+- DB_ROLL_PTR=0x83000001360110,
++ DB_ROLL_PTR=0x83000001350110,
+ ID=0x0000000000000010,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+@@ -61,7 +63,7 @@
+ SPACE=0x00000002)
+ header=0x0000401502c8 (NAME='test/td',
+ DB_TRX_ID=0x000000000304,
+- DB_ROLL_PTR=0x84000001370110,
++ DB_ROLL_PTR=0x84000001360110,
+ ID=0x0000000000000011,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -71,7 +73,7 @@
+ SPACE=0x00000003)
+ header=0x0000501501b8 (NAME='test/tp',
+ DB_TRX_ID=0x000000000306,
+- DB_ROLL_PTR=0x86000001390110,
++ DB_ROLL_PTR=0x86000001380110,
+ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+@@ -81,7 +83,7 @@
+ SPACE=0x00000005)
+ header=0x000030150284 (NAME='test/tr',
+ DB_TRX_ID=0x000000000302,
+- DB_ROLL_PTR=0x82000001350110,
++ DB_ROLL_PTR=0x82000001340110,
+ ID=0x000000000000000f,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+@@ -91,10 +93,10 @@
+ SPACE=0x00000001)
+ header=0x000048150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000305,
+- DB_ROLL_PTR=0x85000001380110,
++ DB_ROLL_PTR=0x85000001370110,
+ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+- TYPE=0x00000023,
++ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags,64k.rdiff b/mysql-test/suite/innodb/r/table_flags,64k.rdiff
new file mode 100644
index 00000000000..76cb6005780
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,64k.rdiff
@@ -0,0 +1,96 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,64k.reject
+@@ -4,6 +4,8 @@
+ CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+ KEY_BLOCK_SIZE=1;
++Warnings:
++Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=COMPACT.
+ CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+ SYS_TABLES clustered index root page (8):
+@@ -11,7 +13,7 @@
+ header=0x01000003016e (NAME=0x696e66696d756d00)
+ header=0x00002815008d (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320194,
++ DB_ROLL_PTR=0x81000001310194,
+ ID=0x000000000000000e,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+@@ -21,7 +23,7 @@
+ SPACE=0x00000000)
+ header=0x0000101500d5 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0110,
++ DB_ROLL_PTR=0x800000012c0110,
+ ID=0x000000000000000b,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -31,7 +33,7 @@
+ SPACE=0x00000000)
+ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0201,
++ DB_ROLL_PTR=0x800000012c0201,
+ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -41,7 +43,7 @@
+ SPACE=0x00000000)
+ header=0x0400201501fc (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320110,
++ DB_ROLL_PTR=0x81000001310110,
+ ID=0x000000000000000d,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+@@ -51,7 +53,7 @@
+ SPACE=0x00000000)
+ header=0x000038150240 (NAME='test/tc',
+ DB_TRX_ID=0x000000000303,
+- DB_ROLL_PTR=0x83000001360110,
++ DB_ROLL_PTR=0x83000001350110,
+ ID=0x0000000000000010,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+@@ -61,7 +63,7 @@
+ SPACE=0x00000002)
+ header=0x0000401502c8 (NAME='test/td',
+ DB_TRX_ID=0x000000000304,
+- DB_ROLL_PTR=0x84000001370110,
++ DB_ROLL_PTR=0x84000001360110,
+ ID=0x0000000000000011,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -71,7 +73,7 @@
+ SPACE=0x00000003)
+ header=0x0000501501b8 (NAME='test/tp',
+ DB_TRX_ID=0x000000000306,
+- DB_ROLL_PTR=0x86000001390110,
++ DB_ROLL_PTR=0x86000001380110,
+ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+@@ -81,7 +83,7 @@
+ SPACE=0x00000005)
+ header=0x000030150284 (NAME='test/tr',
+ DB_TRX_ID=0x000000000302,
+- DB_ROLL_PTR=0x82000001350110,
++ DB_ROLL_PTR=0x82000001340110,
+ ID=0x000000000000000f,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+@@ -91,10 +93,10 @@
+ SPACE=0x00000001)
+ header=0x000048150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000305,
+- DB_ROLL_PTR=0x85000001380110,
++ DB_ROLL_PTR=0x85000001370110,
+ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+- TYPE=0x00000023,
++ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result
index 8d79439764c..f926e27778e 100644
--- a/mysql-test/suite/innodb/r/table_flags.result
+++ b/mysql-test/suite/innodb/r/table_flags.result
@@ -6,8 +6,6 @@ CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
KEY_BLOCK_SIZE=1;
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-ERROR HY000: Unknown option 'PAGE_COMPRESSED'
-CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
SYS_TABLES clustered index root page (8):
N_RECS=9; LEVEL=0; INDEX_ID=0x0000000000000001
header=0x01000003016e (NAME=0x696e66696d756d00)
@@ -76,7 +74,7 @@ header=0x0000501501b8 (NAME='test/tp',
DB_ROLL_PTR=0x86000001390110,
ID=0x0000000000000013,
N_COLS=0x80000001,
- TYPE=0x00000021,
+ TYPE=0x000009a1,
MIX_ID=0x0000000000000000,
MIX_LEN=0x00000050,
CLUSTER_NAME=NULL(0 bytes),
@@ -117,7 +115,7 @@ SHOW CREATE TABLE tz;
ERROR 42S02: Table 'test.tz' doesn't exist in engine
SHOW CREATE TABLE tp;
ERROR 42S02: Table 'test.tp' doesn't exist in engine
-FOUND /InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023)/ in mysqld.1.err
+FOUND /InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|121|302[13])\b/ in mysqld.1.err
FOUND /InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB/ in mysqld.1.err
Restoring SYS_TABLES clustered index root page (8)
SHOW CREATE TABLE tr;
@@ -149,7 +147,7 @@ Table Create Table
tp CREATE TABLE `tp` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=9
BEGIN;
INSERT INTO tr VALUES(1);
INSERT INTO tc VALUES(1);
diff --git a/mysql-test/suite/innodb/r/trigger.result b/mysql-test/suite/innodb/r/trigger.result
new file mode 100644
index 00000000000..c54c14adbfe
--- /dev/null
+++ b/mysql-test/suite/innodb/r/trigger.result
@@ -0,0 +1,23 @@
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (b INT) ENGINE=InnoDB;
+CREATE TABLE t3 (c INT) ENGINE=InnoDB;
+CREATE TRIGGER tr BEFORE INSERT ON t3 FOR EACH ROW BEGIN SAVEPOINT sv; INSERT INTO t2 VALUES (0); END $$
+START TRANSACTION;
+DELETE FROM t1;
+START TRANSACTION;
+INSERT INTO t2 VALUES (2);
+UPDATE t2 SET b = b+1;
+INSERT INTO t1 VALUES (1);
+COMMIT;
+COMMIT;
+SELECT * FROM t1;
+a
+1
+SELECT * FROM t2;
+b
+3
+SELECT * FROM t3;
+c
+DROP TABLE t1, t2, t3;
+DROP TRIGGER tr;
+ERROR HY000: Trigger does not exist
diff --git a/mysql-test/suite/innodb/t/101_compatibility.test b/mysql-test/suite/innodb/t/101_compatibility.test
new file mode 100644
index 00000000000..df3261cebd1
--- /dev/null
+++ b/mysql-test/suite/innodb/t/101_compatibility.test
@@ -0,0 +1,104 @@
+--source include/innodb_page_size.inc
+--source include/not_embedded.inc
+
+-- echo #
+-- echo # MDEV-11623 MariaDB 10.1 fails to start datadir created with
+-- echo # MariaDB 10.0/MySQL 5.6 using innodb-page-size!=16K
+-- echo #
+
+# This is actually testing the opposite: starting the fixed 10.1 with
+# buggy 10.1 files (by manually converting the flags in the files).
+
+--disable_query_log
+call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of tablespace");
+FLUSH TABLES;
+SET GLOBAL innodb_file_per_table=1;
+SET GLOBAL innodb_file_format=Barracuda;
+--enable_query_log
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+
+CREATE TABLE tr(a INT)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+CREATE TABLE tc(a INT)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+CREATE TABLE td(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+--disable_warnings
+CREATE TABLE tz(a INT)ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+--enable_warnings
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+EVAL CREATE TABLE tdd(a INT) ENGINE=InnoDB, DATA DIRECTORY='$MYSQL_TMP_DIR';
+
+CREATE TABLE tp(a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC PAGE_COMPRESSED=1;
+CREATE TABLE ti(a INT) ENGINE=InnoDB;
+FLUSH TABLES ti FOR EXPORT;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "ti");
+EOF
+UNLOCK TABLES;
+ALTER TABLE ti DISCARD TABLESPACE;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "ti");
+ib_restore_tablespaces("test", "ti");
+do "$ENV{MTR_SUITE_DIR}/include/ibd_convert.pl";
+my $ps = $ENV{INNODB_PAGE_SIZE};
+my $dd = $ENV{MYSQLD_DATADIR};
+convert_to_mariadb_101("$dd/test/ti.ibd", $ps);
+EOF
+
+ALTER TABLE ti IMPORT TABLESPACE;
+
+BEGIN;
+INSERT INTO tr VALUES(1);
+INSERT INTO tc VALUES(1);
+INSERT INTO td VALUES(1);
+INSERT INTO tz VALUES(1);
+INSERT INTO tdd VALUES(1);
+INSERT INTO tp VALUES(1);
+INSERT INTO ti VALUES(1);
+
+--source include/kill_mysqld.inc
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/ibd_convert.pl";
+my $ps = $ENV{INNODB_PAGE_SIZE};
+my $dd = $ENV{MYSQLD_DATADIR};
+
+convert_to_mariadb_101("$dd/ibdata1", $ps);
+convert_to_mariadb_101("$dd/test/tr.ibd", $ps);
+convert_to_mariadb_101("$dd/test/tc.ibd", $ps);
+convert_to_mariadb_101("$dd/test/td.ibd", $ps);
+convert_to_mariadb_101("$dd/test/tz.ibd", 1024) if $ps<32768;
+convert_to_mariadb_101("$dd/test/tp.ibd", $ps);
+convert_to_mariadb_101("$dd/test/ti.ibd", $ps);
+convert_to_mariadb_101("$ENV{MYSQL_TMP_DIR}/test/tdd.ibd", $ps);
+EOF
+
+--source include/start_mysqld.inc
+CHECK TABLE tr,tc,td,tz,tdd,tp,ti;
+--source include/shutdown_mysqld.inc
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/ibd_convert.pl";
+my $ps = $ENV{INNODB_PAGE_SIZE};
+my $dd = $ENV{MYSQLD_DATADIR};
+
+convert_to_mariadb_101("$dd/ibdata1", $ps);
+convert_to_mariadb_101("$dd/test/tr.ibd", $ps);
+convert_to_mariadb_101("$dd/test/tc.ibd", $ps);
+convert_to_mariadb_101("$dd/test/td.ibd", $ps);
+convert_to_mariadb_101("$dd/test/tz.ibd", 1024) if $ps<32768;
+convert_to_mariadb_101("$dd/test/tp.ibd", $ps);
+convert_to_mariadb_101("$dd/test/ti.ibd", $ps);
+convert_to_mariadb_101("$ENV{MYSQL_TMP_DIR}/test/tdd.ibd", $ps);
+EOF
+
+--let $restart_parameters=--innodb-read-only
+--source include/start_mysqld.inc
+CHECK TABLE tr,tc,td,tz,tdd,tp,ti;
+--source include/shutdown_mysqld.inc
+
+--let $restart_parameters=
+--source include/start_mysqld.inc
+DROP TABLE tr,tc,td,tz,tdd,tp,ti;
diff --git a/mysql-test/suite/innodb/t/binlog_consistent.test b/mysql-test/suite/innodb/t/binlog_consistent.test
index a97bef4cf38..4ab2903e693 100644
--- a/mysql-test/suite/innodb/t/binlog_consistent.test
+++ b/mysql-test/suite/innodb/t/binlog_consistent.test
@@ -1,6 +1,7 @@
--source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/have_binlog_format_mixed_or_statement.inc
+--source include/binlog_start_pos.inc
RESET MASTER;
@@ -16,7 +17,10 @@ connection default;
--echo # Connection default
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
+let pos=`select $binlog_start_pos + 238`;
+--replace_result $pos <pos>
SHOW MASTER STATUS;
+--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
BEGIN;
INSERT INTO t1 VALUES (0, "");
@@ -56,7 +60,11 @@ COMMIT;
connection default;
--echo # Connection default
SELECT * FROM t1 ORDER BY a,b;
+let pos=`select $binlog_start_pos + 740`;
+--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
+let pos=`select $binlog_start_pos + 1092`;
+--replace_result $pos <pos>
SHOW MASTER STATUS;
SELECT * FROM t2 ORDER BY a;
@@ -77,14 +85,19 @@ FLUSH LOGS;
connection default;
--echo # Connection default
SELECT * FROM t1 ORDER BY a,b;
+let pos=`select $binlog_start_pos + 740`;
+--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
+let pos=`select $binlog_start_pos + 119`;
+--replace_result $pos <pos>
SHOW MASTER STATUS;
COMMIT;
+--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
+--replace_result $pos <pos>
SHOW MASTER STATUS;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
--echo *** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit ***
diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.opt b/mysql-test/suite/innodb/t/create_isl_with_direct.opt
new file mode 100644
index 00000000000..8f80f02e359
--- /dev/null
+++ b/mysql-test/suite/innodb/t/create_isl_with_direct.opt
@@ -0,0 +1 @@
+--innodb_flush_method=O_DIRECT
diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.test b/mysql-test/suite/innodb/t/create_isl_with_direct.test
new file mode 100644
index 00000000000..34ea9c77703
--- /dev/null
+++ b/mysql-test/suite/innodb/t/create_isl_with_direct.test
@@ -0,0 +1,28 @@
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/not_windows.inc
+
+--disable_query_log
+CALL mtr.add_suppression("\\[Warning\\] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662.");
+
+# The below mtr suppression to avoid failure in solaris platform.
+CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to set DIRECTIO_ON on file.*");
+--enable_query_log
+
+SHOW VARIABLES LIKE 'innodb_flush_method';
+
+let MYSQLD_DATADIR=`SELECT @@datadir`;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+
+# Create a table with explicit data directory option.
+EVAL CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='$MYSQL_TMP_DIR';
+
+--echo # Contents of tmp/test directory containing .ibd file
+--list_files $MYSQL_TMP_DIR/test
+
+--echo # Contents of the 'test' database directory containing .isl and .frm files
+--list_files $MYSQLD_DATADIR/test
+
+DROP TABLE t1;
+ \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/defrag_mdl-9155.test b/mysql-test/suite/innodb/t/defrag_mdl-9155.test
new file mode 100644
index 00000000000..1e1efb9c4c6
--- /dev/null
+++ b/mysql-test/suite/innodb/t/defrag_mdl-9155.test
@@ -0,0 +1,22 @@
+#
+# MDEV-9155 Enabling Defragmenting in 10.1.8 still causes OPTIMIZE TABLE to take metadatalocks
+#
+source include/have_innodb.inc;
+source include/have_sequence.inc;
+
+set global innodb_defragment=1;
+create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb;
+insert t1 select null, repeat('a', 256) from seq_1_to_100;
+select count(*) from t1;
+
+connect (con1,localhost,root);
+start transaction;
+select count(*) from t1;
+
+connection default;
+optimize table t1;
+
+connection con1;
+drop table t1;
+
+set global innodb_defragment=default;
diff --git a/mysql-test/suite/innodb/t/doublewrite.test b/mysql-test/suite/innodb/t/doublewrite.test
new file mode 100644
index 00000000000..aba3d6ecff5
--- /dev/null
+++ b/mysql-test/suite/innodb/t/doublewrite.test
@@ -0,0 +1,435 @@
+--echo #
+--echo # Bug #17335427 INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY
+--echo # Bug #18144349 INNODB CANNOT USE THE DOUBLEWRITE BUFFER FOR THE FIRST
+--echo # PAGE OF SYSTEM TABLESPACE
+--echo #
+
+--source include/innodb_page_size.inc
+--source include/have_debug.inc
+--source include/not_embedded.inc
+
+# Slow shutdown and restart to make sure ibuf merge is finished
+SET GLOBAL innodb_fast_shutdown = 0;
+--disable_query_log
+call mtr.add_suppression("space header page consists of zero bytes.*test.t1");
+call mtr.add_suppression("checksum mismatch in tablespace.*test.t1");
+call mtr.add_suppression("Current page size .* != page size on page");
+call mtr.add_suppression("innodb-page-size mismatch in tablespace.*test.t1");
+call mtr.add_suppression("InnoDB: New log files created");
+call mtr.add_suppression("InnoDB: Cannot create doublewrite buffer: the first file in innodb_data_file_path must be at least (3|6|12)M\\.");
+call mtr.add_suppression("InnoDB: Database creation was aborted");
+call mtr.add_suppression("Plugin 'InnoDB' (init function returned error|registration as a STORAGE ENGINE failed)");
+--enable_query_log
+--source include/restart_mysqld.inc
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_RANGE= -50000;
+
+show variables like 'innodb_doublewrite';
+show variables like 'innodb_fil_make_page_dirty_debug';
+show variables like 'innodb_saved_page_number_debug';
+
+create table t1 (f1 int primary key, f2 blob) engine=innodb;
+
+start transaction;
+insert into t1 values(1, repeat('#',12));
+insert into t1 values(2, repeat('+',12));
+insert into t1 values(3, repeat('/',12));
+insert into t1 values(4, repeat('-',12));
+insert into t1 values(5, repeat('.',12));
+commit work;
+
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if first page of user
+--echo # tablespace is full of zeroes.
+
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+
+--echo # Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+
+begin;
+insert into t1 values (6, repeat('%', 12));
+
+--source ../include/no_checkpoint_start.inc
+
+--echo # Make the first page dirty for table t1
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+
+--echo # Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--let CLEANUP_IF_CHECKPOINT=drop table t1;
+--source ../include/no_checkpoint_end.inc
+
+--echo # Make the first page (page_no=0) of the user tablespace
+--echo # full of zeroes.
+--echo #
+--echo # MDEV-11623: Use old FSP_SPACE_FLAGS in the doublewrite buffer.
+
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
+my $page_size = $ENV{INNODB_PAGE_SIZE};
+my $page;
+open(FILE, "+<", $fname) or die;
+sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $name\n";
+sysseek(FILE, 0, 0)||die "Unable to seek $fname\n";
+die unless syswrite(FILE, chr(0) x $page_size, $page_size) == $page_size;
+close FILE;
+
+open(FILE, "+<", "$ENV{MYSQLD_DATADIR}ibdata1")||die "cannot open ibdata1\n";
+sysseek(FILE, 6 * $page_size - 190, 0)||die "Unable to seek ibdata1\n";
+sysread(FILE, $_, 12) == 12||die "Unable to read TRX_SYS\n";
+my($magic,$d1,$d2)=unpack "NNN", $_;
+die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64;
+sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n";
+# Find the page in the doublewrite buffer
+for (my $d = $d1; $d < $d2 + 64; $d++)
+{
+ sysread(FILE, $_, $page_size)==$page_size||die "Cannot read doublewrite\n";
+ next unless $_ eq $page;
+ sysseek(FILE, $d * $page_size, 0)||die "Unable to seek ibdata1\n";
+ # Write buggy MariaDB 10.1.x FSP_SPACE_FLAGS to the doublewrite buffer
+ my($flags) = unpack "x[54]N", $_;
+ my $badflags = ($flags & 0x3f);
+ my $compression_level=6;
+ $badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
+ $badflags |= ($flags & 15 << 6) << 7; # PAGE_SSIZE
+
+ substr ($_, 54, 4) = pack("N", $badflags);
+ # Replace the innodb_checksum_algorithm=none checksum
+ substr ($_, 0, 4) = pack("N", 0xdeadbeef);
+ substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
+ syswrite(FILE, $_, $page_size)==$page_size||die;
+ close(FILE);
+ exit 0;
+}
+die "Did not find the page in the doublewrite buffer ($d1,$d2)\n";
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+select f1, f2 from t1;
+
+--echo # Test End
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if first page of user
+--echo # tablespace is corrupted.
+
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+
+--echo # Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+
+begin;
+insert into t1 values (6, repeat('%', 12));
+
+--source ../include/no_checkpoint_start.inc
+
+--echo # Make the first page dirty for table t1
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+
+--echo # Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--source include/no_checkpoint_end.inc
+
+--echo # Corrupt the first page (page_no=0) of the user tablespace.
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
+open(FILE, "+<", $fname) or die;
+FILE->autoflush(1);
+binmode FILE;
+print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2);
+close FILE;
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+select f1, f2 from t1;
+
+--echo # Test End
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if 2nd page of user
+--echo # tablespace is full of zeroes.
+
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+
+--echo # Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+
+begin;
+insert into t1 values (6, repeat('%', 400));
+
+--source ../include/no_checkpoint_start.inc
+
+--echo # Make the 2nd page dirty for table t1
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+
+--echo # Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--source include/no_checkpoint_end.inc
+
+--echo # Make the 2nd page (page_no=1) of the tablespace all zeroes.
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
+open(FILE, "+<", $fname) or die;
+FILE->autoflush(1);
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET);
+print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'});
+close FILE;
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+select f1, f2 from t1;
+
+--echo # Test End
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if 2nd page of user
+--echo # tablespace is corrupted.
+
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+
+--echo # Ensure that dirty pages of table t1 is flushed.
+flush tables t1 for export;
+unlock tables;
+
+begin;
+insert into t1 values (6, repeat('%', 400));
+
+--source ../include/no_checkpoint_start.inc
+
+--echo # Make the 2nd page dirty for table t1
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+
+--echo # Ensure that the dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--source include/no_checkpoint_end.inc
+
+--echo # Corrupt the 2nd page (page_no=1) of the user tablespace.
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
+open(FILE, "+<", $fname) or die;
+FILE->autoflush(1);
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET);
+print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2);
+close FILE;
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+select f1, f2 from t1;
+
+--echo # Test End
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if first page of
+--echo # system tablespace is full of zeroes.
+
+begin;
+insert into t1 values (6, repeat('%', 400));
+
+--echo # Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--echo # Make the first page dirty for system tablespace
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = 0;
+
+--echo # Ensure that the dirty page of system tablespace is also flushed.
+# We do this after the transaction starts and all dirty pages have been flushed
+# already. So flushing of this specified dirty page will surely keep the
+# copy in doublewrite buffer, and no more writes to doublewrite buffer would
+# overwrite the copy. Thus, we can safely modify the original page when server
+# is down. So do the following testings.
+set global innodb_buf_flush_list_now = 1;
+
+--source include/kill_mysqld.inc
+
+--echo # Make the first page (page_no=0) of the system tablespace
+--echo # all zeroes.
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1";
+open(FILE, "+<", $fname) or die;
+FILE->autoflush(1);
+binmode FILE;
+print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'});
+close FILE;
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+select f1, f2 from t1;
+
+--echo # Test End
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if first page of
+--echo # system tablespace is corrupted.
+
+begin;
+insert into t1 values (6, repeat('%', 400));
+
+--echo # Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--echo # Make the first page dirty for system tablespace
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = 0;
+
+--echo # Ensure that the dirty page of system tablespace is also flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--source include/kill_mysqld.inc
+
+--echo # Corrupt the first page (page_no=0) of the system tablespace.
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1";
+open(FILE, "+<", $fname) or die;
+FILE->autoflush(1);
+binmode FILE;
+print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2);
+close FILE;
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+select f1, f2 from t1;
+
+--echo # Test End
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if 2nd page of
+--echo # system tablespace is full of zeroes.
+
+begin;
+insert into t1 values (6, repeat('%', 400));
+
+--echo # Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--echo # Make the second page dirty for system tablespace
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = 0;
+
+--echo # Ensure that the dirty page of system tablespace is also flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--source include/kill_mysqld.inc
+
+--echo # Make the 2nd page (page_no=1) of the system tablespace
+--echo # all zeroes.
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1";
+open(FILE, "+<", $fname) or die;
+FILE->autoflush(1);
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET);
+print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'});
+close FILE;
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+select f1, f2 from t1;
+
+--echo # Test End
+--echo # ---------------------------------------------------------------
+--echo # Test Begin: Test if recovery works if 2nd page of
+--echo # system tablespace is corrupted.
+
+begin;
+insert into t1 values (6, repeat('%', 400));
+
+--echo # Ensure that all dirty pages in the system are flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--echo # Make the second page dirty for system tablespace
+set global innodb_saved_page_number_debug = 1;
+set global innodb_fil_make_page_dirty_debug = 0;
+
+--echo # Ensure that the dirty page of system tablespace is also flushed.
+set global innodb_buf_flush_list_now = 1;
+
+--source include/kill_mysqld.inc
+
+--echo # Make the 2nd page (page_no=1) of the system tablespace
+--echo # all zeroes.
+perl;
+use IO::Handle;
+my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1";
+open(FILE, "+<", $fname) or die;
+FILE->autoflush(1);
+binmode FILE;
+seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET);
+print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2);
+close FILE;
+EOF
+
+--source include/start_mysqld.inc
+
+check table t1;
+--let SEARCH_PATTERN= \[ERROR\] InnoDB: .* in tablespace.*test.t1.*
+--source include/search_pattern_in_file.inc
+
+select f1, f2 from t1;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-12600 crash during install_db with innodb_page_size=32K
+--echo # and ibdata1=3M
+--echo #
+let bugdir= $MYSQLTEST_VARDIR/tmp/doublewrite;
+--mkdir $bugdir
+
+let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+
+--let $ibp=--innodb-log-group-home-dir=$bugdir --innodb-data-home-dir=$bugdir
+--let $ibd=$ibp --innodb-undo-tablespaces=0 --innodb-log-files-in-group=2
+--let $ibp=$ibp --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend
+
+--let $restart_parameters= $ibp
+--source include/restart_mysqld.inc
+eval $check_no_innodb;
+--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot create doublewrite buffer
+--source include/search_pattern_in_file.inc
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+
+--remove_file $bugdir/ibdata1
+--remove_file $bugdir/ibdata2
+--remove_file $bugdir/ib_logfile0
+--remove_file $bugdir/ib_logfile1
+--rmdir $bugdir
diff --git a/mysql-test/suite/innodb/t/fake_changes-7000.test b/mysql-test/suite/innodb/t/fake_changes-7000.test
new file mode 100644
index 00000000000..2be6be2d476
--- /dev/null
+++ b/mysql-test/suite/innodb/t/fake_changes-7000.test
@@ -0,0 +1,9 @@
+--source include/have_log_bin.inc
+--source include/have_xtradb.inc
+
+create table t1 (i int) engine=InnoDB;
+set innodb_fake_changes = 1;
+--disable_abort_on_error
+insert into t1 values (1);
+set innodb_fake_changes = 0;
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/group_commit.test b/mysql-test/suite/innodb/t/group_commit.test
index 07aac2a619e..692e06f38b8 100644
--- a/mysql-test/suite/innodb/t/group_commit.test
+++ b/mysql-test/suite/innodb/t/group_commit.test
@@ -27,7 +27,7 @@ connect(con6,localhost,root,,);
# group2 to queue up before finishing.
connection con1;
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group1_running WAIT_FOR group2_queued";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group1_running WAIT_FOR group2_queued";
send INSERT INTO t1 VALUES ("con1");
# Make group2 (with three threads) queue up.
@@ -37,7 +37,7 @@ send INSERT INTO t1 VALUES ("con1");
connection con2;
set DEBUG_SYNC= "now WAIT_FOR group1_running";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2";
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group2_running";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group2_running";
SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed";
SET DEBUG_SYNC= "commit_after_group_run_commit_ordered SIGNAL group2_visible WAIT_FOR group2_checked";
send INSERT INTO t1 VALUES ("con2");
@@ -69,7 +69,7 @@ connection default;
SELECT * FROM t1 ORDER BY a;
connection con5;
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group3_con5";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group3_con5";
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued";
set DEBUG_SYNC= "now WAIT_FOR group2_running";
send INSERT INTO t1 VALUES ("con5");
diff --git a/mysql-test/suite/innodb/t/group_commit_binlog_pos.test b/mysql-test/suite/innodb/t/group_commit_binlog_pos.test
index 213dbc9d3d8..f1332d6dd6a 100644
--- a/mysql-test/suite/innodb/t/group_commit_binlog_pos.test
+++ b/mysql-test/suite/innodb/t/group_commit_binlog_pos.test
@@ -2,6 +2,7 @@
--source include/have_debug_sync.inc
--source include/have_log_bin.inc
--source include/have_binlog_format_mixed_or_statement.inc
+--source include/binlog_start_pos.inc
# Need DBUG to crash the server intentionally
--source include/have_debug.inc
@@ -96,6 +97,8 @@ SELECT * FROM t1 ORDER BY a;
# for the end of the second transaction (as can be checked with
# mysqlbinlog).
let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let pos=`select $binlog_start_pos + 678`;
+--replace_result $pos <pos>
--exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test
index 3ae3c50085d..db49c3a9a31 100644
--- a/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test
+++ b/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test
@@ -2,6 +2,7 @@
--source include/have_debug_sync.inc
--source include/have_log_bin.inc
--source include/have_binlog_format_mixed_or_statement.inc
+--source include/binlog_start_pos.inc
# Need DBUG to crash the server intentionally
--source include/have_debug.inc
@@ -97,7 +98,8 @@ SELECT * FROM t1 ORDER BY a;
# for the end of the second transaction (as can be checked with
# mysqlbinlog).
let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let pos=`select $binlog_start_pos + 678`;
+--replace_result $pos <pos>
--exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1
-
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/group_commit_crash.test b/mysql-test/suite/innodb/t/group_commit_crash.test
index cad349819bd..7ad0d9d1e74 100644
--- a/mysql-test/suite/innodb/t/group_commit_crash.test
+++ b/mysql-test/suite/innodb/t/group_commit_crash.test
@@ -9,8 +9,6 @@
--source include/have_debug.inc
--source include/have_log_bin.inc
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
-
let $file_format_max=`SELECT @@innodb_file_format_max`;
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
diff --git a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
index 8d1f460b64b..9dc2557e687 100644
--- a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
+++ b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
@@ -9,8 +9,6 @@
--source include/have_debug.inc
--source include/have_log_bin.inc
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
-
let $file_format_max=`SELECT @@innodb_file_format_max`;
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
diff --git a/mysql-test/suite/innodb/t/group_commit_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_no_optimize_thread.test
index 7bee6b8b177..85c0e295424 100644
--- a/mysql-test/suite/innodb/t/group_commit_no_optimize_thread.test
+++ b/mysql-test/suite/innodb/t/group_commit_no_optimize_thread.test
@@ -27,7 +27,7 @@ connect(con6,localhost,root,,);
# group2 to queue up before finishing.
connection con1;
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group1_running WAIT_FOR group2_queued";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group1_running WAIT_FOR group2_queued";
send INSERT INTO t1 VALUES ("con1");
# Make group2 (with three threads) queue up.
@@ -37,7 +37,7 @@ send INSERT INTO t1 VALUES ("con1");
connection con2;
set DEBUG_SYNC= "now WAIT_FOR group1_running";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2";
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group2_running";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group2_running";
SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed";
send INSERT INTO t1 VALUES ("con2");
connection con3;
@@ -69,7 +69,7 @@ connection default;
SELECT * FROM t1 ORDER BY a;
connection con5;
-SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group3_con5";
+SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group3_con5";
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued";
set DEBUG_SYNC= "now WAIT_FOR group2_running";
send INSERT INTO t1 VALUES ("con5");
diff --git a/mysql-test/suite/innodb/t/innochecksum.test b/mysql-test/suite/innodb/t/innochecksum.test
index 34df2801880..11720ce926d 100644
--- a/mysql-test/suite/innodb/t/innochecksum.test
+++ b/mysql-test/suite/innodb/t/innochecksum.test
@@ -53,13 +53,17 @@ shutdown_server 30;
--source include/wait_until_disconnected.inc
--echo # Run innochecksum on t1
+-- disable_result_log
--exec $INNOCHECKSUM $t1_IBD
--echo # Run innochecksum on t2
+
--exec $INNOCHECKSUM $t2_IBD
--echo # Run innochecksum on t3
+
--exec $INNOCHECKSUM $t3_IBD
+--enable_result_log
--echo # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
diff --git a/mysql-test/suite/innodb/t/innodb-16k-master.opt b/mysql-test/suite/innodb/t/innodb-16k-master.opt
new file mode 100644
index 00000000000..a99075f5329
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-16k-master.opt
@@ -0,0 +1 @@
+--default_storage_engine=InnoDB
diff --git a/mysql-test/suite/innodb/t/innodb-16k.test b/mysql-test/suite/innodb/t/innodb-16k.test
new file mode 100644
index 00000000000..d7922429f26
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-16k.test
@@ -0,0 +1,979 @@
+--source include/no_valgrind_without_big.inc
+# Tests for setting innodb-page-size=16k; default value
+--source include/have_innodb.inc
+--source include/have_innodb_16k.inc
+
+--disable_query_log
+let $MYSQLD_DATADIR= `select @@datadir`;
+# These values can change during the test
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $innodb_strict_mode_orig = `SELECT @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+
+--echo # Test 1) Show the page size from Information Schema
+SELECT variable_value FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_page_size';
+
+--echo # Test 4) The maximum row size is dependent upon the page size.
+--echo # Redundant: 8123, Compact: 8126.
+--echo # Compressed: 8126, Dynamic: 8126.
+--echo # Each row format has its own amount of overhead that
+--echo # varies depending on number of fields and other overhead.
+
+SET SESSION innodb_strict_mode = ON;
+
+# Redundant table; 8011 bytes with 40 char fields
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211)
+) ROW_FORMAT=redundant;
+
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212)
+) ROW_FORMAT=redundant;
+
+# Compact table; 8096 bytes with 40 CHAR fields
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+) ROW_FORMAT=compact;
+
+DROP TABLE t1;
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+) ROW_FORMAT=compact;
+
+# Compressed table; 7959 bytes with 40 CHAR fields
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(157)
+) ROW_FORMAT=compressed;
+
+DROP TABLE t1;
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160)
+) ROW_FORMAT=compressed;
+
+# Dynamic table; 8096 bytes with 40 CHAR fields
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+) ROW_FORMAT=dynamic;
+
+DROP TABLE t1;
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+) ROW_FORMAT=dynamic;
+
+#
+# Test the maximum key length
+# Max Key Length is 3072 for 16k pages.
+# Max key Part length is 767
+# InnoDB assumes 3 bytes for each UTF8 character.
+#
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(4) character set utf8,
+ PRIMARY KEY (a,b,c,d,e))
+ ENGINE=innodb;
+
+DROP TABLE t1;
+
+--error ER_TOO_LONG_KEY
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(5) character set utf8,
+ PRIMARY KEY (a,b,c,d,e))
+ ENGINE=innodb;
+
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(255) character set utf8,
+ f varchar(4) character set utf8,
+ PRIMARY KEY (a), KEY (b,c,d,e,f))
+ ENGINE=innodb;
+
+DROP TABLE t1;
+
+--error ER_TOO_LONG_KEY
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(255) character set utf8,
+ f varchar(5) character set utf8,
+ PRIMARY KEY (a), KEY (b,c,d,e,f))
+ ENGINE=innodb;
+
+--echo # Test 5) Make sure that KEY_BLOCK_SIZE=16, 8, 4, 2 & 1
+--echo # are all accepted.
+
+SET SESSION innodb_strict_mode = ON;
+
+CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+DROP TABLE t1;
+
+SET SESSION innodb_strict_mode = OFF;
+
+CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+
+SELECT table_name, row_format, create_options
+ FROM information_schema.tables WHERE table_name = 't1';
+
+DROP TABLE t1;
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+
+CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8;
+CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t3 VALUES (22),(44),(33),(55),(66);
+INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'),
+('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
+CREATE TABLE t1(a int, b blob, c text, d text NOT NULL)
+ENGINE=innodb DEFAULT CHARSET=utf8;
+INSERT INTO t1
+SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3;
+DROP TABLE t2, t3;
+SELECT COUNT(*) FROM t1 WHERE a=44;
+SELECT a,
+LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1;
+
+# in-place alter table should trigger ER_PRIMARY_CANT_HAVE_NULL
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
+DELETE FROM t1 WHERE d='null';
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
+DELETE FROM t1 WHERE a%2;
+CHECK TABLE t1;
+ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767));
+SELECT COUNT(*) FROM t1 WHERE a=44;
+SELECT a,
+LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1;
+SHOW CREATE TABLE t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+--echo # Test 8) Test creating a table that could lead to undo log overflow.
+
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+ h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+ o blob,p blob,q blob,r blob,s blob,t blob,u blob)
+ ENGINE=InnoDB ROW_FORMAT=dynamic;
+
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+
+# With no indexes defined, we can update all columns to max key part length.
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+ k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
+
+
+# With this many indexes defined, we can still update all fields.
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+ k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
+
+
+# Add one more index and the UNDO record becomes too big to update all columns.
+# But a single transaction can update the columns in separate statements.
+# because the UNDO records will be smaller.
+
+CREATE INDEX t1f ON t1 (f(767));
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
+ k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
+ n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+COMMIT;
+
+# More indexes can still be added and a single field can still be updated
+CREATE INDEX t1g ON t1 (g(767));
+UPDATE t1 SET g=@e;
+CREATE INDEX t1h ON t1 (h(767));
+UPDATE t1 SET h=@e;
+CREATE INDEX t1i ON t1 (i(767));
+UPDATE t1 SET i=@e;
+CREATE INDEX t1j ON t1 (j(767));
+UPDATE t1 SET j=@e;
+CREATE INDEX t1k ON t1 (k(767));
+UPDATE t1 SET k=@e;
+CREATE INDEX t1l ON t1 (l(767));
+UPDATE t1 SET l=@e;
+CREATE INDEX t1m ON t1 (m(767));
+UPDATE t1 SET m=@e;
+CREATE INDEX t1n ON t1 (n(767));
+UPDATE t1 SET n=@e;
+CREATE INDEX t1o ON t1 (o(767));
+UPDATE t1 SET o=@e;
+CREATE INDEX t1p ON t1 (p(767));
+UPDATE t1 SET p=@e;
+CREATE INDEX t1q ON t1 (q(767));
+UPDATE t1 SET q=@e;
+CREATE INDEX t1r ON t1 (r(767));
+UPDATE t1 SET r=@e;
+CREATE INDEX t1s ON t1 (s(767));
+UPDATE t1 SET s=@e;
+
+# Add one more index and we cannot update a column to its defined index length.
+# This is a problem. It means that the DDL is allowed to create a table
+# that CANNOT be updated.
+
+CREATE INDEX t1t ON t1 (t(767));
+BEGIN;
+UPDATE t1 SET t=@e;
+ROLLBACK;
+
+# The function dict_index_too_big_for_undo() prevents us from adding
+# one more index. But it is too late. The record is already too big.
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE INDEX t1u ON t1 (u(767));
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE INDEX t1ut ON t1 (u(767), t(767));
+CREATE INDEX t1st ON t1 (s(767), t(767));
+
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+--echo Test an assertion failure on purge.
+
+# This test is not in innodb_8k or innodb_4k since the bug is not about
+# page size. It just tests the condition that caused the assertion.
+
+CREATE TABLE t1_purge (
+A int,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+
+CREATE TABLE t2_purge (
+A int PRIMARY KEY,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob, I blob,
+J blob, K blob, L blob,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+
+CREATE TABLE t3_purge (
+A int,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+
+CREATE TABLE t4_purge (
+A int PRIMARY KEY,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800), I varchar(800),
+J varchar(800), K varchar(800), L varchar(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+
+# This would trigger the failure
+# if purge gets a chance to run before DROP TABLE t1_purge, ....
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+
+# A secondary index tuple is found to be too long to fit into a page.
+SET GLOBAL innodb_file_per_table=on;
+SET GLOBAL innodb_file_format='Barracuda';
+SET @r=REPEAT('a',500);
+
+CREATE TABLE tlong(a int,
+ v1 varchar(500), v2 varchar(500), v3 varchar(500),
+ v4 varchar(500), v5 varchar(500), v6 varchar(500),
+ v7 varchar(500), v8 varchar(500), v9 varchar(500),
+ v10 varchar(500), v11 varchar(500), v12 varchar(500),
+ v13 varchar(500), v14 varchar(500), v15 varchar(500),
+ v16 varchar(500), v17 varchar(500), v18 varchar(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+CREATE INDEX idx1 ON tlong(a,v1);
+INSERT INTO tlong VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE tlong SET a=1000;
+DELETE FROM tlong;
+
+# the number of indexes has changed since the UNDO record was logged.
+# page size. It just tests the condition that caused the crash.
+
+CREATE TABLE tlong2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+ i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+ ENGINE=innodb ROW_FORMAT=dynamic;
+
+SET @r = REPEAT('a', 767);
+INSERT INTO tlong2 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+CREATE INDEX ndx_a ON tlong2 (a(500));
+CREATE INDEX ndx_b ON tlong2 (b(500));
+CREATE INDEX ndx_c ON tlong2 (c(500));
+CREATE INDEX ndx_d ON tlong2 (d(500));
+CREATE INDEX ndx_e ON tlong2 (e(500));
+CREATE INDEX ndx_f ON tlong2 (f(500));
+CREATE INDEX ndx_k ON tlong2 (k(500));
+CREATE INDEX ndx_l ON tlong2 (l(500));
+
+SET @r = REPEAT('b', 500);
+UPDATE tlong2 set a=@r,b=@r,c=@r,d=@r;
+UPDATE tlong2 set e=@r,f=@r,g=@r,h=@r;
+UPDATE tlong2 set i=@r,j=@r,k=@r,l=@r;
+UPDATE tlong2 set m=@r,n=@r,o=@r,p=@r;
+
+ALTER TABLE tlong2 DROP INDEX ndx_a;
+ALTER TABLE tlong2 DROP INDEX ndx_b;
+CREATE INDEX ndx_g ON tlong2 (g(500));
+CREATE INDEX ndx_h ON tlong2 (h(500));
+CREATE INDEX ndx_i ON tlong2 (i(500));
+CREATE INDEX ndx_j ON tlong2 (j(500));
+CREATE INDEX ndx_m ON tlong2 (m(500));
+CREATE INDEX ndx_n ON tlong2 (n(500));
+CREATE INDEX ndx_o ON tlong2 (o(500));
+CREATE INDEX ndx_p ON tlong2 (p(500));
+SHOW CREATE TABLE tlong2;
+
+# InnoDB cannot know that this undo record would be too big for the undo
+# page. Too much of text field is stored in the clustered record in this
+# DYNAMIC row formatted record.
+
+SET SESSION innodb_strict_mode = ON;
+
+CREATE TABLE bug12547647(
+a int NOT NULL, b blob NOT NULL, c text,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO bug12547647 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
+COMMIT;
+
+# The following used to cause a hang while doing infinite undo log allocation.
+BEGIN;
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+SHOW WARNINGS;
+ROLLBACK;
+DROP TABLE bug12547647;
+
+
+
+# The following should fail in non-strict mode too.
+
+SET SESSION innodb_strict_mode = off;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1(
+ c text NOT NULL, d text NOT NULL,
+ PRIMARY KEY (c(767),d(767)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1(
+ c text NOT NULL, d text NOT NULL,
+ PRIMARY KEY (c(767),d(767)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
+
+CREATE TABLE t1(
+ c text NOT NULL, d text NOT NULL,
+ PRIMARY KEY (c(767),d(767)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
+
+drop table t1;
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
+
+CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
+ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
+
+INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
+
+DROP TABLE t1;
+
+# The tests that uses these tables required the purge thread to run.
+# Just in case it has not by now, provide a 10 second wait.
+
+--sleep 10
+
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE tlong;
+DROP TABLE tlong2;
+
+SET SESSION innodb_strict_mode = on;
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=dynamic,ENGINE=INNODB;
+
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=compact,ENGINE=INNODB;
+
+#
+# restore environment to the state it was before this test execution
+#
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-32k-crash-master.opt b/mysql-test/suite/innodb/t/innodb-32k-crash-master.opt
new file mode 100644
index 00000000000..4761ed67d1e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k-crash-master.opt
@@ -0,0 +1,5 @@
+--default_storage_engine=InnoDB
+--innodb-buffer-pool-size=32M
+--innodb-log-file-size=32M
+--innodb-page-size=32K
+
diff --git a/mysql-test/suite/innodb/t/innodb-32k-crash.test b/mysql-test/suite/innodb/t/innodb-32k-crash.test
new file mode 100644
index 00000000000..435ea3646f8
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k-crash.test
@@ -0,0 +1,195 @@
+--source include/have_innodb.inc
+--source include/have_innodb_32k.inc
+# Embedded server does not support restarting
+--source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+ h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+ o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+ v blob, w blob, x blob, y blob, z blob,
+ aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+ oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+ va blob, wa blob, xa blob, ya blob, za blob)
+ ENGINE=InnoDB ROW_FORMAT=dynamic;
+
+CREATE TABLE t2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+ h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+ o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+ v blob, w blob, x blob, y blob, z blob,
+ aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+ oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+ va blob, wa blob, xa blob, ya blob, za blob)
+ ENGINE=InnoDB ROW_FORMAT=compact;
+
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+SET @f = repeat('f', 767);
+SET @f = repeat('g', 767);
+
+# With no indexes defined, we can update all columns to max key part length.
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+
+SET @f = repeat('h', 500);
+SET @f = repeat('i', 500);
+SET @f = repeat('j', 500);
+SET @f = repeat('k', 500);
+SET @f = repeat('l', 500);
+SET @f = repeat('m', 500);
+
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h,@h);
+
+
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+ k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+ v=@b,w=@b,x=@b,y=@b,z=@b,
+ aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+ va=@b,wa=@b,xa=@b,ya=@b,za=@b;
+
+UPDATE t2 SET a=@i,b=@i,c=@i,d=@i,e=@i,f=@i,g=@i,h=@i,i=@i,j=@i,
+ k=@i,l=@i,m=@i,n=@i,o=@i,p=@i,q=@i,r=@i,s=@i,t=@i,u=@i,
+ v=@i,w=@i,x=@i,y=@i,z=@i,
+ aa=@i,ba=@i,ca=@i,da=@i,ea=@i,fa=@i,ga=@i,ha=@i,ia=@i,ja=@i,
+ ka=@i,la=@i,ma=@i,na=@i,oa=@i,pa=@i,qa=@i,ra=@i,sa=@i,ta=@i,ua=@i,
+ va=@i,wa=@i,xa=@i,ya=@i,za=@i;
+
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+CREATE INDEX t1f1 ON t1 (f(767));
+CREATE INDEX t1f2 ON t1 (g(767));
+CREATE INDEX t1f3 ON t1 (h(767));
+CREATE INDEX t1f4 ON t1 (i(767));
+CREATE INDEX t1f5 ON t1 (j(767));
+
+CREATE INDEX t1a ON t2 (a(767));
+CREATE INDEX t1b ON t2 (b(767));
+CREATE INDEX t1c ON t2 (c(767));
+CREATE INDEX t1d ON t2 (d(767));
+CREATE INDEX t1e ON t2 (e(767));
+CREATE INDEX t1f1 ON t2 (f(767));
+CREATE INDEX t1f2 ON t2 (g(767));
+CREATE INDEX t1f3 ON t2 (h(767));
+
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+ k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+ v=@c,w=@c,x=@b,y=@c,z=@c,
+ aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@b,ua=@c,
+ va=@c,wa=@c,xa=@c,ya=@c,za=@c;
+
+UPDATE t2 SET a=@k,b=@k,c=@k,d=@k,e=@k,f=@k,g=@k,h=@k,i=@k,j=@k,
+ k=@k,l=@k,m=@k,n=@k,o=@k,p=@k,q=@k,r=@k,s=@k,t=@k,u=@k,
+ v=@k,w=@k,x=@b,y=@k,z=@k,
+ aa=@k,ba=@k,ca=@k,da=@k,ea=@k,fa=@k,ga=@k,ha=@k,ia=@k,ja=@k,
+ ka=@k,la=@k,ma=@k,na=@k,oa=@k,pa=@k,qa=@k,ra=@k,sa=@k,ta=@b,ua=@k,
+ va=@k,wa=@k,xa=@k,ya=@k,za=@k;
+
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+COMMIT;
+
+BEGIN;
+UPDATE t2 SET a=@l,b=@l,c=@l,d=@l,e=@l;
+UPDATE t2 SET f=@l,g=@l,h=@l,i=@l,j=@l;
+UPDATE t2 SET k=@l,l=@l,m=@l,n=@l,o=@l;
+UPDATE t2 SET p=@l,q=@l,r=@l,s=@l,t=@l,u=@l;
+UPDATE t2 SET v=@l,w=@l,x=@l,y=@l,z=@l;
+UPDATE t2 SET aa=@l,ba=@l,ca=@l,da=@l;
+UPDATE t2 SET ea=@l,fa=@l,ga=@l,ha=@l,ia=@l,ja=@l;
+UPDATE t2 SET ka=@l,la=@l,ma=@l,na=@l,oa=@l,pa=@l;
+UPDATE t2 SET qa=@l,ra=@l,sa=@l,ta=@l,ua=@l;
+UPDATE t2 SET va=@l,wa=@l,xa=@l,ya=@l,za=@l;
+COMMIT;
+
+BEGIN;
+INSERT INTO t1 SELECT * from t2;
+UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e;
+
+--source include/kill_and_restart_mysqld.inc
+
+UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f,f=@f,g=@f,h=@f,i=@f,j=@f,
+ k=@f,l=@f,m=@f,n=@f,o=@f,p=@f,q=@f,r=@f,s=@f,t=@f,u=@f,
+ v=@f,w=@f,x=@b,y=@f,z=@f,
+ aa=@f,ba=@f,ca=@f,da=@f,ea=@f,fa=@f,ga=@f,ha=@f,ia=@f,ja=@f,
+ ka=@f,la=@f,ma=@f,na=@f,oa=@f,pa=@f,qa=@f,ra=@f,sa=@f,ta=@b,ua=@f,
+ va=@f,wa=@f,xa=@f,ya=@f,za=@f;
+
+UPDATE t2 SET a=@h,b=@h,c=@h,d=@h,e=@h,f=@h,g=@h,h=@h,i=@h,j=@h,
+ k=@h,l=@h,m=@h,n=@h,o=@h,p=@h,q=@h,r=@h,s=@h,t=@h,u=@h,
+ v=@h,w=@h,x=@b,y=@h,z=@h,
+ aa=@h,ba=@h,ca=@h,da=@h,ea=@h,fa=@h,ga=@h,ha=@h,ia=@h,ja=@h,
+ ka=@h,la=@h,ma=@h,na=@h,oa=@h,pa=@h,qa=@h,ra=@h,sa=@h,ta=@b,ua=@h,
+ va=@h,wa=@h,xa=@h,ya=@h,za=@h;
+
+BEGIN;
+UPDATE t1 SET a=@g,b=@g,c=@g,d=@g,e=@g;
+UPDATE t1 SET f=@g,g=@g,h=@g,i=@g,j=@g;
+UPDATE t1 SET k=@g,l=@g,m=@g,n=@g,o=@g;
+UPDATE t1 SET p=@g,q=@g,r=@g,s=@g,t=@g,u=@g;
+UPDATE t1 SET v=@g,w=@g,x=@g,y=@g,z=@g;
+UPDATE t1 SET aa=@g,ba=@g,ca=@g,da=@g;
+UPDATE t1 SET ea=@g,fa=@g,ga=@g,ha=@g,ia=@g,ja=@g;
+UPDATE t1 SET ka=@g,la=@g,ma=@g,na=@g,oa=@g,pa=@g;
+UPDATE t1 SET qa=@g,ra=@g,sa=@g,ta=@g,ua=@g;
+UPDATE t1 SET va=@g,wa=@g,xa=@g,ya=@g,za=@g;
+COMMIT;
+
+BEGIN;
+UPDATE t2 SET a=@m,b=@m,c=@m,d=@m,e=@m;
+UPDATE t2 SET f=@m,g=@m,h=@m,i=@m,j=@m;
+UPDATE t2 SET k=@m,l=@m,m=@m,n=@m,o=@m;
+UPDATE t2 SET p=@m,q=@m,r=@m,s=@m,t=@m,u=@m;
+UPDATE t2 SET v=@m,w=@m,x=@m,y=@m,z=@m;
+UPDATE t2 SET aa=@m,ba=@m,ca=@m,da=@m;
+UPDATE t2 SET ea=@m,fa=@m,ga=@m,ha=@m,ia=@m,ja=@m;
+UPDATE t2 SET ka=@m,la=@m,ma=@m,na=@m,oa=@m,pa=@m;
+UPDATE t2 SET qa=@m,ra=@m,sa=@m,ta=@m,ua=@m;
+UPDATE t2 SET va=@m,wa=@m,xa=@m,ya=@m,za=@m;
+COMMIT;
+
+show create table t1;
+show create table t2;
+drop table t1,t2;
diff --git a/mysql-test/suite/innodb/t/innodb-32k-master.opt b/mysql-test/suite/innodb/t/innodb-32k-master.opt
new file mode 100644
index 00000000000..322385f7f24
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k-master.opt
@@ -0,0 +1,4 @@
+--default_storage_engine=InnoDB
+--innodb-page-size=32K
+--innodb-log-file-size=32M
+--innodb-buffer-pool-size=32M
diff --git a/mysql-test/suite/innodb/t/innodb-32k.test b/mysql-test/suite/innodb/t/innodb-32k.test
new file mode 100644
index 00000000000..356746e8ec4
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k.test
@@ -0,0 +1,770 @@
+--source include/no_valgrind_without_big.inc
+# Tests for setting innodb-page-size=32k;
+--source include/have_innodb.inc
+--source include/have_innodb_32k.inc
+
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+call mtr.add_suppression("InnoDB: Resizing redo log from *");
+call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files.");
+call mtr.add_suppression("InnoDB: New log files created, LSN=*");
+
+--disable_query_log
+let $MYSQLD_DATADIR= `select @@datadir`;
+# These values can change during the test
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $innodb_strict_mode_orig = `SELECT @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+--echo # Test 1) Show the page size from Information Schema
+SELECT variable_value FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_page_size';
+
+--echo # Test 4) The maximum row size is dependent upon the page size.
+--echo # Redundant: 16315, Compact: 16318.
+--echo # Compressed: 16318, Dynamic: ?.
+--echo # Each row format has its own amount of overhead that
+--echo # varies depending on number of fields and other overhead.
+
+SET SESSION innodb_strict_mode = ON;
+
+# Redundant table; 16121 bytes with 81 char fields
+
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(121)
+) ROW_FORMAT=redundant;
+
+DROP TABLE t1;
+
+--replace_regex /> [0-9]*/> max_row_size/
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(122)
+) ROW_FORMAT=redundant;
+
+# Compact table; 16282 bytes with 82 CHAR fields
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(82)
+) ROW_FORMAT=compact;
+
+DROP TABLE t1;
+
+--replace_regex /> [0-9]*/> max_row_size/
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(83)
+) ROW_FORMAT=compact;
+
+--replace_regex /> [0-9]*/> max_row_size/
+--error 1005
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(63)
+) ROW_FORMAT=compressed;
+
+# Dynamic table; 16282 bytes with 82 CHAR fields
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(82)
+) ROW_FORMAT=dynamic;
+
+DROP TABLE t1;
+
+--replace_regex /> [0-9]*/> max_row_size/
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c81 char(200), c82 char(83)
+) ROW_FORMAT=dynamic;
+
+#
+# Test the maximum key length
+# Moved from innodb-index.test since each page size has its own max key length.
+# Max Key Length is 3072 for 16k pages.
+# Max key Part length is 767
+# InnoDB assumes 3 bytes for each UTF8 character.
+#
+
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(4) character set utf8,
+ PRIMARY KEY (a,b,c,d,e))
+ ENGINE=innodb;
+
+DROP TABLE t1;
+
+--error ER_TOO_LONG_KEY
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(5) character set utf8,
+ PRIMARY KEY (a,b,c,d,e))
+ ENGINE=innodb;
+
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(255) character set utf8,
+ f varchar(4) character set utf8,
+ PRIMARY KEY (a), KEY (b,c,d,e,f))
+ ENGINE=innodb;
+
+DROP TABLE t1;
+
+--error ER_TOO_LONG_KEY
+CREATE TABLE t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(255) character set utf8,
+ f varchar(5) character set utf8,
+ PRIMARY KEY (a), KEY (b,c,d,e,f))
+ ENGINE=innodb;
+
+
+
+--echo # Test 8) Test creating a table that could lead to undo log overflow.
+
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+ h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+ o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+ v blob, w blob, x blob, y blob, z blob,
+ aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+ oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+ va blob, wa blob, xa blob, ya blob, za blob)
+ ENGINE=InnoDB ROW_FORMAT=dynamic;
+
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+
+# With no indexes defined, we can update all columns to max key part length.
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
+
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+ k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+ v=@b,w=@b,x=@b,y=@b,z=@b,
+ aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+ va=@b,wa=@b,xa=@b,ya=@b,za=@b;
+
+
+# With this many indexes defined, we can still update all fields.
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+CREATE INDEX t1f1 ON t1 (f(767));
+CREATE INDEX t1f2 ON t1 (g(767));
+CREATE INDEX t1f3 ON t1 (h(767));
+CREATE INDEX t1f4 ON t1 (i(767));
+CREATE INDEX t1f5 ON t1 (j(767));
+
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+ k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+ v=@c,w=@c,x=@c,y=@c,z=@c,
+ aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+ va=@c,wa=@c,xa=@c,ya=@c,za=@c;
+
+# Add one more index and the UNDO record becomes too big to update all columns.
+# But a single transaction can update the columns in separate statements.
+# because the UNDO records will be smaller.
+
+CREATE INDEX t1f17 ON t1 (v(767));
+
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
+ k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
+ v=@d,w=@d,x=@d,y=@d,z=@d,
+ aa=@d,ba=@d,ca=@d,da=@d,ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d,
+ ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d,qa=@d,ra=@d,sa=@d,ta=@d,ua=@d,
+ va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+ROLLBACK;
+
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+COMMIT;
+
+# More indexes can still be added and a single field can still be updated
+CREATE INDEX t1k ON t1 (k(767));
+CREATE INDEX t1f7 ON t1 (m(767));
+CREATE INDEX t1f8 ON t1 (n(767));
+CREATE INDEX t1f9 ON t1 (o(767));
+CREATE INDEX t1f11 ON t1 (p(767));
+CREATE INDEX t1f12 ON t1 (q(767));
+CREATE INDEX t1f13 ON t1 (r(767));
+CREATE INDEX t1f14 ON t1 (s(767));
+CREATE INDEX t1f15 ON t1 (t(767));
+CREATE INDEX t1f16 ON t1 (u(767));
+CREATE INDEX t1f18 ON t1 (w(767));
+CREATE INDEX t1f19 ON t1 (x(767));
+CREATE INDEX t1f20 ON t1 (y(767));
+CREATE INDEX t1f21 ON t1 (z(767));
+CREATE INDEX ta1a ON t1 (aa(767));
+CREATE INDEX tb1b ON t1 (ba(767));
+CREATE INDEX tc1c ON t1 (ca(767));
+CREATE INDEX td1d ON t1 (da(767));
+CREATE INDEX te1e ON t1 (ea(767));
+CREATE INDEX tf1f1 ON t1 (fa(767));
+CREATE INDEX tg1f2 ON t1 (ga(767));
+CREATE INDEX th1f3 ON t1 (ha(767));
+CREATE INDEX ti1f4 ON t1 (ia(767));
+CREATE INDEX tj1f5 ON t1 (ka(767));
+CREATE INDEX tk1f6 ON t1 (la(767));
+CREATE INDEX tl1f7 ON t1 (ma(767));
+CREATE INDEX tm1f8 ON t1 (na(767));
+CREATE INDEX tn1f9 ON t1 (oa(767));
+CREATE INDEX to1f11 ON t1 (pa(767));
+UPDATE t1 SET t=@e;
+
+# One more index and row size is too big
+--replace_regex /> [0-9]*/> max_row_size/
+--error ER_TOO_BIG_ROWSIZE
+CREATE INDEX t1f6 ON t1 (l(767));
+
+drop table t1;
+
+--echo Test an assertion failure on purge.
+
+# This test is not in innodb_8k or innodb_4k since the bug is not about
+# page size. It just tests the condition that caused the assertion.
+
+CREATE TABLE t1_purge (
+A int,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+
+CREATE TABLE t2_purge (
+A int PRIMARY KEY,
+B blob, C blob, D blob, E blob,
+F blob, G blob, H blob, I blob,
+J blob, K blob, L blob,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+
+CREATE TABLE t3_purge (
+A int,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+
+CREATE TABLE t4_purge (
+A int PRIMARY KEY,
+B varchar(800), C varchar(800), D varchar(800), E varchar(800),
+F varchar(800), G varchar(800), H varchar(800), I varchar(800),
+J varchar(800), K varchar(800), L varchar(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+
+# This would trigger the failure
+# if purge gets a chance to run before DROP TABLE t1_purge, ....
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+
+# A secondary index tuple is found to be too long to fit into a page.
+SET GLOBAL innodb_file_per_table=on;
+SET GLOBAL innodb_file_format='Barracuda';
+SET @r=REPEAT('a',500);
+
+CREATE TABLE tlong(a int,
+ v1 varchar(500), v2 varchar(500), v3 varchar(500),
+ v4 varchar(500), v5 varchar(500), v6 varchar(500),
+ v7 varchar(500), v8 varchar(500), v9 varchar(500),
+ v10 varchar(500), v11 varchar(500), v12 varchar(500),
+ v13 varchar(500), v14 varchar(500), v15 varchar(500),
+ v16 varchar(500), v17 varchar(500), v18 varchar(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+CREATE INDEX idx1 ON tlong(a,v1);
+INSERT INTO tlong VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE tlong SET a=1000;
+DELETE FROM tlong;
+
+# the number of indexes has changed since the UNDO record was logged.
+# page size. It just tests the condition that caused the crash.
+
+CREATE TABLE tlong2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+ i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+ ENGINE=innodb ROW_FORMAT=dynamic;
+
+SET @r = REPEAT('a', 767);
+INSERT INTO tlong2 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+CREATE INDEX ndx_a ON tlong2 (a(500));
+CREATE INDEX ndx_b ON tlong2 (b(500));
+CREATE INDEX ndx_c ON tlong2 (c(500));
+CREATE INDEX ndx_d ON tlong2 (d(500));
+CREATE INDEX ndx_e ON tlong2 (e(500));
+CREATE INDEX ndx_f ON tlong2 (f(500));
+CREATE INDEX ndx_k ON tlong2 (k(500));
+CREATE INDEX ndx_l ON tlong2 (l(500));
+
+SET @r = REPEAT('b', 500);
+UPDATE tlong2 set a=@r,b=@r,c=@r,d=@r;
+UPDATE tlong2 set e=@r,f=@r,g=@r,h=@r;
+UPDATE tlong2 set i=@r,j=@r,k=@r,l=@r;
+UPDATE tlong2 set m=@r,n=@r,o=@r,p=@r;
+
+ALTER TABLE tlong2 DROP INDEX ndx_a;
+ALTER TABLE tlong2 DROP INDEX ndx_b;
+CREATE INDEX ndx_g ON tlong2 (g(500));
+CREATE INDEX ndx_h ON tlong2 (h(500));
+CREATE INDEX ndx_i ON tlong2 (i(500));
+CREATE INDEX ndx_j ON tlong2 (j(500));
+CREATE INDEX ndx_m ON tlong2 (m(500));
+CREATE INDEX ndx_n ON tlong2 (n(500));
+CREATE INDEX ndx_o ON tlong2 (o(500));
+CREATE INDEX ndx_p ON tlong2 (p(500));
+SHOW CREATE TABLE tlong2;
+
+# InnoDB cannot know that this undo record would be too big for the undo
+# page. Too much of text field is stored in the clustered record in this
+# DYNAMIC row formatted record.
+
+SET SESSION innodb_strict_mode = ON;
+
+CREATE TABLE t3(
+a int NOT NULL, b blob NOT NULL, c text,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
+COMMIT;
+
+UPDATE t3 SET c = REPEAT('b',16928);
+SHOW WARNINGS;
+UPDATE t3 SET c = REPEAT('b',32800);
+SHOW WARNINGS;
+DROP TABLE t3;
+
+# The tests that uses these tables required the purge thread to run.
+# Just in case it has not by now, provide a 10 second wait.
+
+--sleep 10
+
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE tlong;
+DROP TABLE tlong2;
+
+
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=dynamic,ENGINE=INNODB;
+
+set @a = repeat('0123456789', 800);
+set @b = repeat('9876543210', 800);
+
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+
+update t2 set col190=@b;
+
+set @a = repeat('0123456789', 1650);
+set @b = repeat('9876543210', 2000);
+
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+
+update t2 set col190=@b;
+#
+# Verify persistence and loading of flags in the ibd files.
+#
+
+--source include/restart_mysqld.inc
+
+set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650);
+set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000);
+show create table t2;
+update t2 set col150=@a;
+update t2 set col145=@b;
+drop table t2;
+#
+# restore environment to the state it was before this test execution
+#
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-64k-crash-master.opt b/mysql-test/suite/innodb/t/innodb-64k-crash-master.opt
new file mode 100644
index 00000000000..ce51caf3fb0
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k-crash-master.opt
@@ -0,0 +1,5 @@
+--default_storage_engine=InnoDB
+--innodb-buffer-pool-size=32M
+--innodb-page-size=64K
+--innodb-log-file-size=32M
+
diff --git a/mysql-test/suite/innodb/t/innodb-64k-crash.test b/mysql-test/suite/innodb/t/innodb-64k-crash.test
new file mode 100644
index 00000000000..a34dd313b30
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k-crash.test
@@ -0,0 +1,386 @@
+--source include/have_innodb.inc
+--source include/have_innodb_64k.inc
+# Embedded server does not support restarting
+--source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+ h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+ o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+ v blob, w blob, x blob, y blob, z blob,
+ aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+ oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+ va blob, wa blob, xa blob, ya blob, za blob,
+ ab blob,bb blob,cb blob,db blob,eb blob,fb blob,gb blob,
+ hb blob,ib blob,jb blob,kb blob,lb blob,mb blob,nb blob,
+ ob blob,pb blob,qb blob,rb blob,sb blob,tb blob,ub blob,
+ vb blob, wb blob, xb blob, yb blob, zb blob,
+ ac blob, bc blob, cc blob, dc blob, ec blob,fc blob,gc blob,
+ hc blob, ic blob, jc blob, kc blob, lc blob,mc blob,nc blob,
+ oc blob, pc blob, qc blob, rc blob, sc blob,tc blob,uc blob,
+ vc blob, wc blob, xc blob, yc blob, zc blob
+ ) ENGINE=InnoDB ROW_FORMAT=dynamic;
+
+CREATE TABLE t2(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+ h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+ o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+ v blob, w blob, x blob, y blob, z blob,
+ aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+ oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+ va blob, wa blob, xa blob, ya blob, za blob,
+ ab blob,bb blob,cb blob,db blob,eb blob,fb blob,gb blob,
+ hb blob,ib blob,jb blob,kb blob,lb blob,mb blob,nb blob,
+ ob blob,pb blob,qb blob,rb blob,sb blob,tb blob,ub blob,
+ vb blob, wb blob, xb blob, yb blob, zb blob,
+ ac blob, bc blob, cc blob, dc blob, ec blob,fc blob,gc blob,
+ hc blob, ic blob, jc blob, kc blob, lc blob,mc blob,nc blob,
+ oc blob, pc blob, qc blob, rc blob, sc blob,tc blob,uc blob,
+ vc blob, wc blob, xc blob, yc blob, zc blob
+ ) ENGINE=InnoDB ROW_FORMAT=compact;
+
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+SET @f = repeat('f', 767);
+SET @f = repeat('g', 767);
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+
+SET @h = repeat('h', 100);
+SET @i = repeat('i', 100);
+SET @j = repeat('j', 100);
+SET @k = repeat('k', 100);
+SET @l = repeat('l', 100);
+
+INSERT INTO t2 VALUES (@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h,@h,@h,
+@h,@h,@h,@h,@h
+);
+
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+ k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+ v=@b,w=@b,x=@b,y=@b,z=@b,
+ aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+ va=@b,wa=@b,xa=@b,ya=@b,za=@b,
+ ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+ kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+ vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+ kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+ vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ ac=@b,bc=@b,cc=@b,dc=@b,ec=@b,fc=@b,gc=@b,hc=@b,ic=@b,jc=@b,
+ kc=@b,lc=@b,mc=@b,nc=@b,oc=@b,pc=@b,qc=@b,rc=@b,sc=@b,tc=@b,uc=@b,
+ vc=@b,wc=@b,xc=@b,yc=@b,zc=@b;
+
+UPDATE t2 SET a=@i,b=@i,c=@i,d=@i,e=@i,f=@i,g=@i,h=@i,i=@i,j=@i,
+ k=@i,l=@i,m=@i,n=@i,o=@i,p=@i,q=@i,r=@i,s=@i,t=@i,u=@i,
+ v=@i,w=@i,x=@i,y=@i,z=@i,
+ aa=@i,ba=@i,ca=@i,da=@i,ea=@i,fa=@i,ga=@i,ha=@i,ia=@i,ja=@i,
+ ka=@i,la=@i,ma=@i,na=@i,oa=@i,pa=@i,qa=@i,ra=@i,sa=@i,ta=@i,ua=@i,
+ va=@i,wa=@i,xa=@i,ya=@i,za=@i,
+ ab=@i,bb=@i,cb=@i,db=@i,eb=@i,fb=@i,gb=@i,hb=@i,ib=@i,jb=@i,
+ kb=@i,lb=@i,mb=@i,nb=@i,ob=@i,pb=@i,qb=@i,rb=@i,sb=@i,tb=@i,ub=@i,
+ vb=@i,wb=@i,xb=@i,yb=@i,zb=@i,
+ ab=@i,bb=@i,cb=@i,db=@i,eb=@i,fb=@i,gb=@i,hb=@i,ib=@i,jb=@i,
+ kb=@i,lb=@i,mb=@i,nb=@i,ob=@i,pb=@i,qb=@i,rb=@i,sb=@i,tb=@i,ub=@i,
+ vb=@i,wb=@i,xb=@i,yb=@i,zb=@i,
+ ac=@i,bc=@i,cc=@i,dc=@i,ec=@i,fc=@i,gc=@i,hc=@i,ic=@i,jc=@i,
+ kc=@i,lc=@i,mc=@i,nc=@i,oc=@i,pc=@i,qc=@i,rc=@i,sc=@i,tc=@i,uc=@i,
+ vc=@i,wc=@i,xc=@i,yc=@i,zc=@i;
+
+# With this many indexes defined, we can still update all fields.
+CREATE INDEX t1a ON t1 (a(767),b(767));
+CREATE INDEX t1c ON t1 (c(767),d(767));
+CREATE INDEX t1e ON t1 (e(767),f(767));
+CREATE INDEX t1f2 ON t1 (g(767),h(767));
+CREATE INDEX t1f4 ON t1 (i(767),j(767));
+CREATE INDEX t1k ON t1 (k(767),m(767));
+CREATE INDEX t1f8 ON t1 (n(767),o(767));
+CREATE INDEX t1f11 ON t1 (p(767),q(767));
+CREATE INDEX t1f13 ON t1 (r(767),s(767));
+CREATE INDEX t1f15 ON t1 (t(767),u(767));
+CREATE INDEX t1f18 ON t1 (w(767),x(767));
+CREATE INDEX t1f20 ON t1 (y(767),z(767));
+CREATE INDEX ta1a6 ON t1 (aa(767),ba(767));
+CREATE INDEX tc1c6 ON t1 (ca(767),da(767));
+CREATE INDEX te1e6 ON t1 (ea(767),fa(767));
+
+
+CREATE INDEX t2a ON t2 (a(767),b(767));
+CREATE INDEX t2c ON t2 (c(767),d(767));
+CREATE INDEX t2e ON t2 (e(767),f(767));
+CREATE INDEX t2f2 ON t2 (g(767),h(767));
+CREATE INDEX t2f4 ON t2 (i(767),j(767));
+CREATE INDEX t2k ON t2 (k(767),m(767));
+CREATE INDEX t2f8 ON t2 (n(767),o(767));
+CREATE INDEX t2f11 ON t2 (p(767),q(767));
+CREATE INDEX t2f13 ON t2 (r(767),s(767));
+CREATE INDEX t2f15 ON t2 (t(767),u(767));
+CREATE INDEX t2f18 ON t2 (w(767),x(767));
+CREATE INDEX t2f20 ON t2 (y(767),z(767));
+CREATE INDEX ta2a6 ON t2 (aa(767),ba(767));
+CREATE INDEX tc2c6 ON t2 (ca(767),da(767));
+CREATE INDEX te2e6 ON t2 (ea(767),fa(767));
+
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+ k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+ v=@c,w=@c,x=@c,y=@c,z=@c,
+ aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+ va=@c,wa=@c,xa=@c,ya=@c,za=@c,
+ ab=@c,bb=@c,cb=@c,db=@c,eb=@c,fb=@c,gb=@c,hb=@c,ib=@c,jb=@c,
+ kb=@c,lb=@c,mb=@c,nb=@c,ob=@c,pb=@c,qb=@c,rb=@c,sb=@c,tb=@c,ub=@c,
+ vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
+ ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
+ kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
+ vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
+
+UPDATE t2 SET a=@k,b=@k,c=@k,d=@k,e=@k,f=@k,g=@k,h=@k,i=@k,j=@k,
+ k=@k,l=@k,m=@k,n=@k,o=@k,p=@k,q=@k,r=@k,s=@k,t=@k,u=@k,
+ v=@k,w=@k,x=@k,y=@k,z=@k,
+ aa=@k,ba=@k,ca=@k,da=@k,ea=@k,fa=@k,ga=@k,ha=@k,ia=@k,ja=@k,
+ ka=@k,la=@k,ma=@k,na=@k,oa=@k,pa=@k,qa=@k,ra=@k,sa=@k,ta=@k,ua=@k,
+ va=@k,wa=@k,xa=@k,ya=@k,za=@k,
+ ab=@k,bb=@k,cb=@k,db=@k,eb=@k,fb=@k,gb=@k,hb=@k,ib=@k,jb=@k,
+ kb=@k,lb=@k,mb=@k,nb=@k,ob=@k,pb=@k,qb=@k,rb=@k,sb=@k,tb=@k,ub=@k,
+ vb=@k,wb=@k,xb=@k,yb=@k,zb=@k,
+ ac=@k,bc=@k,cc=@k,dc=@k,ec=@k,fc=@k,gc=@k,hc=@k,ic=@k,jc=@k,
+ kc=@k,lc=@k,mc=@k,nc=@k,oc=@k,pc=@k,qc=@k,rc=@k,sc=@k,tc=@k,uc=@k,
+ vc=@k,wc=@k,xc=@k,yc=@k,zc=@k;
+
+COMMIT;
+
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+UPDATE t1 SET ab=@d,bb=@d,cb=@d,db=@d;
+UPDATE t1 SET eb=@d,fb=@d,gb=@d,hb=@d,ib=@d,ja=@d;
+UPDATE t1 SET kb=@d,lb=@d,mb=@d,nb=@d,ob=@d,pa=@d;
+UPDATE t1 SET qb=@d,rb=@d,sb=@d,tb=@d,ub=@d;
+UPDATE t1 SET vb=@d,wb=@d,xb=@d,yb=@d,zb=@d;
+UPDATE t1 SET ac=@d,bc=@d,cc=@d,dc=@d;
+UPDATE t1 SET ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d;
+UPDATE t1 SET kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d;
+UPDATE t1 SET qc=@d,rc=@d,sc=@d,tc=@d,uc=@d;
+UPDATE t1 SET vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
+COMMIT;
+
+BEGIN;
+UPDATE t2 SET a=@i,b=@i,c=@i,d=@i,e=@i;
+UPDATE t2 SET f=@i,g=@i,h=@i,i=@i,j=@i;
+UPDATE t2 SET k=@i,l=@i,m=@i,n=@i,o=@i;
+UPDATE t2 SET p=@i,q=@i,r=@i,s=@i,t=@i,u=@i;
+UPDATE t2 SET v=@i,w=@i,x=@i,y=@i,z=@i;
+UPDATE t2 SET aa=@i,ba=@i,ca=@i,da=@i;
+UPDATE t2 SET ea=@i,fa=@i,ga=@i,ha=@i,ia=@i,ja=@i;
+UPDATE t2 SET ka=@i,la=@i,ma=@i,na=@i,oa=@i,pa=@i;
+UPDATE t2 SET qa=@i,ra=@i,sa=@i,ta=@i,ua=@i;
+UPDATE t2 SET va=@i,wa=@i,xa=@i,ya=@i,za=@i;
+UPDATE t2 SET ab=@i,bb=@i,cb=@i,db=@i;
+UPDATE t2 SET eb=@i,fb=@i,gb=@i,hb=@i,ib=@i,ja=@i;
+UPDATE t2 SET kb=@i,lb=@i,mb=@i,nb=@i,ob=@i,pa=@i;
+UPDATE t2 SET qb=@i,rb=@i,sb=@i,tb=@i,ub=@i;
+UPDATE t2 SET vb=@i,wb=@i,xb=@i,yb=@i,zb=@i;
+UPDATE t2 SET ac=@i,bc=@i,cc=@i,dc=@i;
+UPDATE t2 SET ec=@i,fc=@i,gc=@i,hc=@i,ic=@i,jc=@i;
+UPDATE t2 SET kc=@i,lc=@i,mc=@i,nc=@i,oc=@i,pc=@i;
+UPDATE t2 SET qc=@i,rc=@i,sc=@i,tc=@i,uc=@i;
+UPDATE t2 SET vc=@i,wc=@i,xc=@i,yc=@i,zc=@i;
+COMMIT;
+
+BEGIN;
+INSERT INTO t1 SELECT * from t2;
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+ k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+ v=@c,w=@c,x=@c,y=@c,z=@c,
+ aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+ va=@c,wa=@c,xa=@c,ya=@c,za=@c,
+ ab=@c,bb=@c,cb=@c,db=@c,eb=@c,fb=@c,gb=@c,hb=@c,ib=@c,jb=@c,
+ kb=@c,lb=@c,mb=@c,nb=@c,ob=@c,pb=@c,qb=@c,rb=@c,sb=@c,tb=@c,ub=@c,
+ vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
+ ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
+ kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
+ vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
+
+--source include/kill_and_restart_mysqld.inc
+
+UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e,f=@e,g=@e,h=@e,i=@e,j=@e,
+ k=@e,l=@e,m=@e,n=@e,o=@e,p=@e,q=@e,r=@e,s=@e,t=@e,u=@e,
+ v=@e,w=@e,x=@e,y=@e,z=@e,
+ aa=@e,ba=@e,ca=@e,da=@e,ea=@e,fa=@e,ga=@e,ha=@e,ia=@e,ja=@e,
+ ka=@e,la=@e,ma=@e,na=@e,oa=@e,pa=@e,qa=@e,ra=@e,sa=@e,ta=@e,ua=@e,
+ va=@e,wa=@e,xa=@e,ya=@e,za=@e,
+ ab=@e,bb=@e,cb=@e,db=@e,eb=@e,fb=@e,gb=@e,hb=@e,ib=@e,jb=@e,
+ kb=@e,lb=@e,mb=@e,nb=@e,ob=@e,pb=@e,qb=@e,rb=@e,sb=@e,tb=@e,ub=@e,
+ vb=@e,wb=@e,xb=@e,yb=@e,zb=@e,
+ ac=@e,bc=@e,cc=@e,dc=@e,ec=@e,fc=@e,gc=@e,hc=@e,ic=@e,jc=@e,
+ kc=@e,lc=@e,mc=@e,nc=@e,oc=@e,pc=@e,qc=@e,rc=@e,sc=@e,tc=@e,uc=@e,
+ vc=@e,wc=@e,xc=@e,yc=@e,zc=@e;
+
+UPDATE t2 SET a=@l,b=@l,c=@l,d=@l,e=@l,f=@l,g=@l,h=@l,i=@l,j=@l,
+ k=@l,l=@l,m=@l,n=@l,o=@l,p=@l,q=@l,r=@l,s=@l,t=@l,u=@l,
+ v=@l,w=@l,x=@l,y=@l,z=@l,
+ aa=@l,ba=@l,ca=@l,da=@l,ea=@l,fa=@l,ga=@l,ha=@l,ia=@l,ja=@l,
+ ka=@l,la=@l,ma=@l,na=@l,oa=@l,pa=@l,qa=@l,ra=@l,sa=@l,ta=@l,ua=@l,
+ va=@l,wa=@l,xa=@l,ya=@l,za=@l,
+ ab=@l,bb=@l,cb=@l,db=@l,eb=@l,fb=@l,gb=@l,hb=@l,ib=@l,jb=@l,
+ kb=@l,lb=@l,mb=@l,nb=@l,ob=@l,pb=@l,qb=@l,rb=@l,sb=@l,tb=@l,ub=@l,
+ vb=@l,wb=@l,xb=@l,yb=@l,zb=@l,
+ ac=@l,bc=@l,cc=@l,dc=@l,ec=@l,fc=@l,gc=@l,hc=@l,ic=@l,jc=@l,
+ kc=@l,lc=@l,mc=@l,nc=@l,oc=@l,pc=@l,qc=@l,rc=@l,sc=@l,tc=@l,uc=@l,
+ vc=@l,wc=@l,xc=@l,yc=@l,zc=@l;
+
+COMMIT;
+
+BEGIN;
+UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f;
+UPDATE t1 SET f=@f,g=@f,h=@f,i=@f,j=@f;
+UPDATE t1 SET k=@f,l=@f,m=@f,n=@f,o=@f;
+UPDATE t1 SET p=@f,q=@f,r=@f,s=@f,t=@f,u=@f;
+UPDATE t1 SET v=@f,w=@f,x=@f,y=@f,z=@f;
+UPDATE t1 SET aa=@f,ba=@f,ca=@f,da=@f;
+UPDATE t1 SET ea=@f,fa=@f,ga=@f,ha=@f,ia=@f,ja=@f;
+UPDATE t1 SET ka=@f,la=@f,ma=@f,na=@f,oa=@f,pa=@f;
+UPDATE t1 SET qa=@f,ra=@f,sa=@f,ta=@f,ua=@f;
+UPDATE t1 SET va=@f,wa=@f,xa=@f,ya=@f,za=@f;
+UPDATE t1 SET ab=@f,bb=@f,cb=@f,db=@f;
+UPDATE t1 SET eb=@f,fb=@f,gb=@f,hb=@f,ib=@f,ja=@f;
+UPDATE t1 SET kb=@f,lb=@f,mb=@f,nb=@f,ob=@f,pa=@f;
+UPDATE t1 SET qb=@f,rb=@f,sb=@f,tb=@f,ub=@f;
+UPDATE t1 SET vb=@f,wb=@f,xb=@f,yb=@f,zb=@f;
+UPDATE t1 SET ac=@f,bc=@f,cc=@f,dc=@f;
+UPDATE t1 SET ec=@f,fc=@f,gc=@f,hc=@f,ic=@f,jc=@f;
+UPDATE t1 SET kc=@f,lc=@f,mc=@f,nc=@f,oc=@f,pc=@f;
+UPDATE t1 SET qc=@f,rc=@f,sc=@f,tc=@f,uc=@f;
+UPDATE t1 SET vc=@f,wc=@f,xc=@f,yc=@f,zc=@f;
+COMMIT;
+
+BEGIN;
+UPDATE t2 SET a=@f,b=@f,c=@f,d=@f,e=@f;
+UPDATE t2 SET f=@f,g=@f,h=@f,i=@f,j=@f;
+UPDATE t2 SET k=@f,l=@f,m=@f,n=@f,o=@f;
+UPDATE t2 SET p=@f,q=@f,r=@f,s=@f,t=@f,u=@f;
+UPDATE t2 SET v=@f,w=@f,x=@f,y=@f,z=@f;
+UPDATE t2 SET aa=@f,ba=@f,ca=@f,da=@f;
+UPDATE t2 SET ea=@f,fa=@f,ga=@f,ha=@f,ia=@f,ja=@f;
+UPDATE t2 SET ka=@f,la=@f,ma=@f,na=@f,oa=@f,pa=@f;
+UPDATE t2 SET qa=@f,ra=@f,sa=@f,ta=@f,ua=@f;
+UPDATE t2 SET va=@f,wa=@f,xa=@f,ya=@f,za=@f;
+UPDATE t2 SET ab=@f,bb=@f,cb=@f,db=@f;
+UPDATE t2 SET eb=@f,fb=@f,gb=@f,hb=@f,ib=@f,ja=@f;
+UPDATE t2 SET kb=@f,lb=@f,mb=@f,nb=@f,ob=@f,pa=@f;
+UPDATE t2 SET qb=@f,rb=@f,sb=@f,tb=@f,ub=@f;
+UPDATE t2 SET vb=@f,wb=@f,xb=@f,yb=@f,zb=@f;
+UPDATE t2 SET ac=@f,bc=@f,cc=@f,dc=@f;
+UPDATE t2 SET ec=@f,fc=@f,gc=@f,hc=@f,ic=@f,jc=@f;
+UPDATE t2 SET kc=@f,lc=@f,mc=@f,nc=@f,oc=@f,pc=@f;
+UPDATE t2 SET qc=@f,rc=@f,sc=@f,tc=@f,uc=@f;
+UPDATE t2 SET vc=@f,wc=@f,xc=@f,yc=@f,zc=@f;
+COMMIT;
+
+show create table t1;
+show create table t2;
+drop table t1,t2;
diff --git a/mysql-test/suite/innodb/t/innodb-64k-master.opt b/mysql-test/suite/innodb/t/innodb-64k-master.opt
new file mode 100644
index 00000000000..375b7fcd22f
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k-master.opt
@@ -0,0 +1,4 @@
+--default_storage_engine=InnoDB
+--innodb-buffer-pool-size=32M
+--innodb-page-size=64K
+--innodb-log-file-size=32M
diff --git a/mysql-test/suite/innodb/t/innodb-64k.test b/mysql-test/suite/innodb/t/innodb-64k.test
new file mode 100644
index 00000000000..0498544279b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k.test
@@ -0,0 +1,661 @@
+--source include/no_valgrind_without_big.inc
+# Tests for setting innodb-page-size=64k;
+--source include/have_innodb.inc
+--source include/have_innodb_64k.inc
+
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+call mtr.add_suppression("InnoDB: Resizing redo log from *");
+call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files.");
+call mtr.add_suppression("InnoDB: New log files created, LSN=*");
+
+--disable_query_log
+let $MYSQLD_DATADIR= `select @@datadir`;
+# These values can change during the test
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+let $innodb_strict_mode_orig = `SELECT @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+--echo # Test 1) Show the page size from Information Schema
+SELECT variable_value FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_page_size';
+
+--echo # Test 4) The maximum row size is dependent upon the page size.
+
+SET SESSION innodb_strict_mode = ON;
+SELECT @@innodb_strict_mode;
+
+# Redundant table
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+show warnings;
+
+# Compact table, 32701 bytes
+
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(156)
+) ROW_FORMAT=compact;
+
+DROP TABLE t1;
+
+--replace_regex /> [0-9]*/> max_row_size/
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(157)
+) ROW_FORMAT=compact;
+
+# Dynamic table, 32701 bytes
+
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(156)
+) ROW_FORMAT=dynamic;
+
+DROP TABLE t1;
+
+--replace_regex /> [0-9]*/> max_row_size/
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
+c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
+c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
+c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
+c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
+c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(200),
+c41 char(200), c42 char(200), c43 char(200), c44 char(200), c45 char(200),
+c46 char(200), c47 char(200), c48 char(200), c49 char(200), c50 char(200),
+c51 char(200), c52 char(200), c53 char(200), c54 char(200), c55 char(200),
+c56 char(200), c57 char(200), c58 char(200), c59 char(200), c60 char(200),
+c61 char(200), c62 char(200), c63 char(200), c64 char(200), c65 char(200),
+c66 char(200), c67 char(200), c68 char(200), c69 char(200), c70 char(200),
+c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
+c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
+c101 char(200), c102 char(200), c103 char(200), c104 char(200), c105 char(200),
+c106 char(200), c107 char(200), c108 char(200), c109 char(200), c110 char(200),
+c111 char(200), c112 char(200), c113 char(200), c114 char(200), c115 char(200),
+c116 char(200), c117 char(200), c118 char(200), c119 char(200), c120 char(200),
+c121 char(200), c122 char(200), c123 char(200), c124 char(200), c125 char(200),
+c126 char(200), c127 char(200), c128 char(200), c129 char(200), c130 char(200),
+c131 char(200), c132 char(200), c133 char(200), c134 char(200), c135 char(200),
+c136 char(200), c137 char(200), c138 char(200), c139 char(200), c140 char(200),
+c141 char(200), c142 char(200), c143 char(200), c144 char(200), c145 char(200),
+c146 char(200), c147 char(200), c148 char(200), c149 char(200), c150 char(200),
+c151 char(200), c152 char(200), c153 char(200), c154 char(200), c155 char(200),
+c156 char(200), c157 char(200), c158 char(200), c159 char(200), c160 char(200),
+c161 char(200), c162 char(200), c163 char(200), c164 char(200), c165 char(200),
+c166 char(200), c167 char(200), c168 char(200), c169 char(200), c170 char(200),
+c171 char(200), c172 char(200), c173 char(200), c174 char(200), c175 char(200),
+c176 char(200), c177 char(200), c178 char(200), c179 char(200), c180 char(200),
+c190 char(200), c191 char(200), c192 char(100),
+c81 char(157)
+) ROW_FORMAT=dynamic;
+
+--echo # Test 8) Test creating a table that could lead to undo log overflow.
+
+CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
+ h blob,i blob,j blob,k blob,l blob,m blob,n blob,
+ o blob,p blob,q blob,r blob,s blob,t blob,u blob,
+ v blob, w blob, x blob, y blob, z blob,
+ aa blob,ba blob,ca blob,da blob,ea blob,fa blob,ga blob,
+ ha blob,ia blob,ja blob,ka blob,la blob,ma blob,na blob,
+ oa blob,pa blob,qa blob,ra blob,sa blob,ta blob,ua blob,
+ va blob, wa blob, xa blob, ya blob, za blob,
+ ab blob,bb blob,cb blob,db blob,eb blob,fb blob,gb blob,
+ hb blob,ib blob,jb blob,kb blob,lb blob,mb blob,nb blob,
+ ob blob,pb blob,qb blob,rb blob,sb blob,tb blob,ub blob,
+ vb blob, wb blob, xb blob, yb blob, zb blob,
+ ac blob, bc blob, cc blob, dc blob, ec blob,fc blob,gc blob,
+ hc blob, ic blob, jc blob, kc blob, lc blob,mc blob,nc blob,
+ oc blob, pc blob, qc blob, rc blob, sc blob,tc blob,uc blob,
+ vc blob, wc blob, xc blob, yc blob, zc blob
+ ) ENGINE=InnoDB ROW_FORMAT=dynamic;
+
+SET @a = repeat('a', 767);
+SET @b = repeat('b', 767);
+SET @c = repeat('c', 767);
+SET @d = repeat('d', 767);
+SET @e = repeat('e', 767);
+
+# With no indexes defined, we can update all columns to max key part length.
+
+INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a
+);
+
+UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
+ k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b,
+ v=@b,w=@b,x=@b,y=@b,z=@b,
+ aa=@b,ba=@b,ca=@b,da=@b,ea=@b,fa=@b,ga=@b,ha=@b,ia=@b,ja=@b,
+ ka=@b,la=@b,ma=@b,na=@b,oa=@b,pa=@b,qa=@b,ra=@b,sa=@b,ta=@b,ua=@b,
+ va=@b,wa=@b,xa=@b,ya=@b,za=@b,
+ ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+ kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+ vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ ab=@b,bb=@b,cb=@b,db=@b,eb=@b,fb=@b,gb=@b,hb=@b,ib=@b,jb=@b,
+ kb=@b,lb=@b,mb=@b,nb=@b,ob=@b,pb=@b,qb=@b,rb=@b,sb=@b,tb=@b,ub=@b,
+ vb=@b,wb=@b,xb=@b,yb=@b,zb=@b,
+ ac=@b,bc=@b,cc=@b,dc=@b,ec=@b,fc=@b,gc=@b,hc=@b,ic=@b,jc=@b,
+ kc=@b,lc=@b,mc=@b,nc=@b,oc=@b,pc=@b,qc=@b,rc=@b,sc=@b,tc=@b,uc=@b,
+ vc=@b,wc=@b,xc=@b,yc=@b,zc=@b;
+
+# With this many indexes defined, we can still update all fields.
+CREATE INDEX t1a ON t1 (a(767),b(767));
+CREATE INDEX t1c ON t1 (c(767),d(767));
+CREATE INDEX t1e ON t1 (e(767),f(767));
+CREATE INDEX t1f2 ON t1 (g(767),h(767));
+CREATE INDEX t1f4 ON t1 (i(767),j(767));
+CREATE INDEX t1k ON t1 (k(767),m(767));
+CREATE INDEX t1f8 ON t1 (n(767),o(767));
+CREATE INDEX t1f11 ON t1 (p(767),q(767));
+CREATE INDEX t1f13 ON t1 (r(767),s(767));
+CREATE INDEX t1f15 ON t1 (t(767),u(767));
+CREATE INDEX t1f18 ON t1 (w(767),x(767));
+CREATE INDEX t1f20 ON t1 (y(767),z(767));
+CREATE INDEX ta1a6 ON t1 (aa(767),ba(767));
+CREATE INDEX tc1c6 ON t1 (ca(767),da(767));
+CREATE INDEX te1e6 ON t1 (ea(767),fa(767));
+
+UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
+ k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c,
+ v=@c,w=@c,x=@c,y=@c,z=@c,
+ aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
+ ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
+ va=@c,wa=@c,xa=@c,ya=@c,za=@c,
+ ab=@c,bb=@c,cb=@c,db=@c,eb=@c,fb=@c,gb=@c,hb=@c,ib=@c,jb=@c,
+ kb=@c,lb=@c,mb=@c,nb=@c,ob=@c,pb=@c,qb=@c,rb=@c,sb=@c,tb=@c,ub=@c,
+ vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
+ ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
+ kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
+ vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
+
+COMMIT;
+
+# Add one more index and the UNDO record becomes too big to update all columns.
+# But a single transaction can update the columns in separate statements.
+# because the UNDO records will be smaller.
+
+CREATE INDEX tg1f2 ON t1 (ia(767),ja(767));
+
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
+ k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
+ v=@d,w=@d,x=@d,y=@d,z=@d,
+ aa=@d,ba=@d,ca=@d,da=@d,ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d,
+ ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d,qa=@d,ra=@d,sa=@d,ta=@d,ua=@d,
+ va=@d,wa=@d,xa=@d,ya=@d,za=@d,
+ ab=@d,bb=@d,cb=@d,db=@d,eb=@d,fb=@d,gb=@d,hb=@d,ib=@d,jb=@d,
+ kb=@d,lb=@d,mb=@d,nb=@d,ob=@d,pb=@d,qb=@d,rb=@d,sb=@d,tb=@d,ub=@d,
+ vb=@d,wb=@d,xb=@d,yb=@d,zb=@d,
+ ac=@d,bc=@d,cc=@d,dc=@d,ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d,
+ kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d,qc=@d,rc=@d,sc=@d,tc=@d,uc=@d,
+ vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
+ROLLBACK;
+
+BEGIN;
+UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
+UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
+UPDATE t1 SET k=@d,l=@d,m=@d,n=@d,o=@d;
+UPDATE t1 SET p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
+UPDATE t1 SET v=@d,w=@d,x=@d,y=@d,z=@d;
+UPDATE t1 SET aa=@d,ba=@d,ca=@d,da=@d;
+UPDATE t1 SET ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d;
+UPDATE t1 SET ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d;
+UPDATE t1 SET qa=@d,ra=@d,sa=@d,ta=@d,ua=@d;
+UPDATE t1 SET va=@d,wa=@d,xa=@d,ya=@d,za=@d;
+UPDATE t1 SET ab=@d,bb=@d,cb=@d,db=@d;
+UPDATE t1 SET eb=@d,fb=@d,gb=@d,hb=@d,ib=@d,ja=@d;
+UPDATE t1 SET kb=@d,lb=@d,mb=@d,nb=@d,ob=@d,pa=@d;
+UPDATE t1 SET qb=@d,rb=@d,sb=@d,tb=@d,ub=@d;
+UPDATE t1 SET vb=@d,wb=@d,xb=@d,yb=@d,zb=@d;
+UPDATE t1 SET ac=@d,bc=@d,cc=@d,dc=@d;
+UPDATE t1 SET ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d;
+UPDATE t1 SET kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d;
+UPDATE t1 SET qc=@d,rc=@d,sc=@d,tc=@d,uc=@d;
+UPDATE t1 SET vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
+COMMIT;
+
+# More indexes can still be added and a single field can still be updated
+CREATE INDEX ti1f4 ON t1 (ia(767),ka(767));
+CREATE INDEX tk1f6 ON t1 (la(767),ma(767));
+CREATE INDEX tm1f8 ON t1 (na(767),oa(767));
+CREATE INDEX to1f11 ON t1 (pa(767),qa(767));
+CREATE INDEX tq1f13 ON t1 (ra(767),sa(767));
+CREATE INDEX ts1f15 ON t1 (ta(767),ua(767));
+CREATE INDEX tu1f18 ON t1 (wa(767),xa(767));
+CREATE INDEX tx1f20 ON t1 (ya(767),za(767));
+CREATE INDEX ta1a5 ON t1 (ab(767),bb(767));
+CREATE INDEX tc1c5 ON t1 (cb(767),db(767));
+CREATE INDEX te1e5 ON t1 (eb(767),fb(767));
+CREATE INDEX t5g1f2 ON t1 (gb(767),hb(767));
+CREATE INDEX t5i1f4 ON t1 (ib(767),kb(767));
+CREATE INDEX t5k1f6 ON t1 (lb(767),mb(767));
+CREATE INDEX t5m1f8 ON t1 (nb(767),ob(767));
+CREATE INDEX t5o1f11 ON t1 (pb(767),qb(767));
+CREATE INDEX t65q1f13 ON t1 (rb(767),sb(767));
+CREATE INDEX t65s1f15 ON t1 (tb(767),ub(767));
+CREATE INDEX t65u1f18 ON t1 (wb(767),xb(767));
+CREATE INDEX t65x1f20 ON t1 (yb(767),zb(767));
+CREATE INDEX xta1a5 ON t1 (ac(767),bc(767));
+CREATE INDEX xt5g1f2 ON t1 (gc(767),hc(767));
+CREATE INDEX xt5i1f4 ON t1 (ic(767));
+CREATE INDEX xtc1c5 ON t1 (cc(767),dc(767));
+CREATE INDEX xte1e5 ON t1 (ec(767),fc(767));
+UPDATE t1 SET t=@e;
+
+# One more index and row size is too big
+--replace_regex /> [0-9]*/> max_row_size/
+--error ER_TOO_BIG_ROWSIZE
+CREATE INDEX xt5k1f6 ON t1 (lc(767),mc(767));
+SHOW CREATE TABLE t1;
+SHOW WARNINGS;
+
+CREATE TABLE t2(COL1 TEXT,
+COL2 TEXT,
+COL3 TEXT,
+COL4 TEXT,
+COL5 TEXT,
+COL6 TEXT,
+COL7 TEXT,
+COL8 TEXT,
+COL9 TEXT,
+COL10 TEXT,
+COL11 TEXT,
+COL12 TEXT,
+COL13 TEXT,
+COL14 TEXT,
+COL15 TEXT,
+COL16 TEXT,
+COL17 TEXT,
+COL18 TEXT,
+COL19 TEXT,
+COL20 TEXT,
+COL21 TEXT,
+COL22 TEXT,
+COL23 TEXT,
+COL24 TEXT,
+COL25 TEXT,
+COL26 TEXT,
+COL27 TEXT,
+COL28 TEXT,
+COL29 TEXT,
+COL30 TEXT,
+COL31 TEXT,
+COL32 TEXT,
+COL33 TEXT,
+COL34 TEXT,
+COL35 TEXT,
+COL36 TEXT,
+COL37 TEXT,
+COL38 TEXT,
+COL39 TEXT,
+COL40 TEXT,
+COL41 TEXT,
+COL42 TEXT,
+COL43 TEXT,
+COL44 TEXT,
+COL45 TEXT,
+COL46 TEXT,
+COL47 TEXT,
+COL48 TEXT,
+COL49 TEXT,
+COL50 TEXT,
+COL51 TEXT,
+COL52 TEXT,
+COL53 TEXT,
+COL54 TEXT,
+COL55 TEXT,
+COL56 TEXT,
+COL57 TEXT,
+COL58 TEXT,
+COL59 TEXT,
+COL60 TEXT,
+COL61 TEXT,
+COL62 TEXT,
+COL63 TEXT,
+COL64 TEXT,
+COL65 TEXT,
+COL66 TEXT,
+COL67 TEXT,
+COL68 TEXT,
+COL69 TEXT,
+COL70 TEXT,
+COL71 TEXT,
+COL72 TEXT,
+COL73 TEXT,
+COL74 TEXT,
+COL75 TEXT,
+COL76 TEXT,
+COL77 TEXT,
+COL78 TEXT,
+COL79 TEXT,
+COL80 TEXT,
+COL81 TEXT,
+COL82 TEXT,
+COL83 TEXT,
+COL84 TEXT,
+COL85 TEXT,
+COL86 TEXT,
+COL87 TEXT,
+COL88 TEXT,
+COL89 TEXT,
+COL90 TEXT,
+COL91 TEXT,
+COL92 TEXT,
+COL93 TEXT,
+COL94 TEXT,
+COL95 TEXT,
+COL96 TEXT,
+COL97 TEXT,
+COL98 TEXT,
+COL99 TEXT,
+COL100 TEXT,
+COL101 TEXT,
+COL102 TEXT,
+COL103 TEXT,
+COL104 TEXT,
+COL105 TEXT,
+COL106 TEXT,
+COL107 TEXT,
+COL108 TEXT,
+COL109 TEXT,
+COL110 TEXT,
+COL111 TEXT,
+COL112 TEXT,
+COL113 TEXT,
+COL114 TEXT,
+COL115 TEXT,
+COL116 TEXT,
+COL117 TEXT,
+COL118 TEXT,
+COL119 TEXT,
+COL120 TEXT,
+COL121 TEXT,
+COL122 TEXT,
+COL123 TEXT,
+COL124 TEXT,
+COL125 TEXT,
+COL126 TEXT,
+COL127 TEXT,
+COL128 TEXT,
+COL129 TEXT,
+COL130 TEXT,
+COL131 TEXT,
+COL132 TEXT,
+COL133 TEXT,
+COL134 TEXT,
+COL135 TEXT,
+COL136 TEXT,
+COL137 TEXT,
+COL138 TEXT,
+COL139 TEXT,
+COL140 TEXT,
+COL141 TEXT,
+COL142 TEXT,
+COL143 TEXT,
+COL144 TEXT,
+COL145 TEXT,
+COL146 TEXT,
+COL147 TEXT,
+COL148 TEXT,
+COL149 TEXT,
+COL150 TEXT,
+COL151 TEXT,
+COL152 TEXT,
+COL153 TEXT,
+COL154 TEXT,
+COL155 TEXT,
+COL156 TEXT,
+COL157 TEXT,
+COL158 TEXT,
+COL159 TEXT,
+COL160 TEXT,
+COL161 TEXT,
+COL162 TEXT,
+COL163 TEXT,
+COL164 TEXT,
+COL165 TEXT,
+COL166 TEXT,
+COL167 TEXT,
+COL168 TEXT,
+COL169 TEXT,
+COL170 TEXT,
+COL171 TEXT,
+COL172 TEXT,
+COL173 TEXT,
+COL174 TEXT,
+COL175 TEXT,
+COL176 TEXT,
+COL177 TEXT,
+COL178 TEXT,
+COL179 TEXT,
+COL180 TEXT,
+COL181 TEXT,
+COL182 TEXT,
+COL183 TEXT,
+COL184 TEXT,
+COL185 TEXT,
+COL186 TEXT,
+COL187 TEXT,
+COL188 TEXT,
+COL189 TEXT,
+COL190 TEXT,
+COL191 TEXT,
+COL192 TEXT,
+COL193 TEXT,
+COL194 TEXT,
+COL195 TEXT,
+COL196 TEXT,
+COL197 TEXT)
+row_format=dynamic,ENGINE=INNODB;
+
+set @a = repeat('0123456789', 800);
+set @b = repeat('9876543210', 800);
+
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+
+update t2 set col190=@b;
+
+set @a = repeat('0123456789', 1650);
+set @b = repeat('9876543210', 2000);
+
+insert into t2 values(
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
+@a,@a,@a,@a,@a,@a,@a);
+
+update t2 set col190=@b;
+
+#
+# Verify persistence and loading of flags in the ibd files.
+#
+
+--source include/restart_mysqld.inc
+
+set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650);
+set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000);
+update t2 set col189 = @b;
+insert into t2 select * from t2;
+show create table t1;
+show create table t2;
+
+BEGIN;
+update t2 set col150=@a;
+update t2 set col145=@b;
+COMMIT;
+
+drop table t2;
+DROP TABLE t1;
+#
+# restore environment to the state it was before this test execution
+#
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
index 8813e50f24a..d3f34b12ea6 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
@@ -19,13 +19,6 @@
--echo # in-place ALTERs of the same table will not be blocked due to
--echo # temporary tablename.
-# As we intentionally crash below, there could be partially written
-# pages that are then recovered from the doublewrite buffer
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed
-");
-call mtr.add_suppression("InnoDB: file read of space .* page .*");
-call mtr.add_suppression("InnoDB: Trying to recover it from the doublewrite buffer.");
-
let datadir= `select @@datadir`;
--let $_server_id= `SELECT @@server_id`
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index 9835a9779cf..75b2e8984d9 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -156,7 +156,7 @@ DROP TABLE t1;
#
# Test changes to AUTOINC next value calculation
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(5),(NULL);
@@ -173,7 +173,7 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(0);
@@ -193,13 +193,13 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
@@ -214,13 +214,13 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (-2);
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (2);
@@ -240,13 +240,13 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
@@ -262,7 +262,7 @@ DROP TABLE t1;
# Check for overflow handling when increment is > 1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
@@ -271,7 +271,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
# This should just fit
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
SELECT * FROM t1;
@@ -281,7 +281,7 @@ DROP TABLE t1;
# Check for overflow handling when increment and offser are > 1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
@@ -290,7 +290,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
--error ER_AUTOINC_READ_FAILED
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
SELECT * FROM t1;
@@ -300,7 +300,7 @@ DROP TABLE t1;
# Check for overflow handling when increment and offset are odd numbers
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
@@ -309,7 +309,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
--error ER_AUTOINC_READ_FAILED
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
SELECT * FROM t1;
@@ -319,7 +319,7 @@ DROP TABLE t1;
# and check for large -ve numbers
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
@@ -330,7 +330,7 @@ INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1
INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
SELECT * FROM t1;
DROP TABLE t1;
@@ -339,7 +339,7 @@ DROP TABLE t1;
# large numbers 2^60
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
@@ -348,7 +348,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
--error 1467
INSERT INTO t1 VALUES (NULL),(NULL);
SELECT * FROM t1;
@@ -359,7 +359,7 @@ DROP TABLE t1;
#
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL, 1);
INSERT INTO t1 VALUES(NULL, 2);
@@ -446,7 +446,7 @@ DROP TABLE t2;
# If the user has specified negative values for an AUTOINC column then
# InnoDB should ignore those values when setting the table's max value.
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
# TINYINT
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
@@ -642,7 +642,7 @@ DROP TABLE t1;
# Check if we handle offset > column max value properly
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=256;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
# TINYINT
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
@@ -654,13 +654,13 @@ DROP TABLE t1;
# of the column. IMO, this should not be allowed and the assertion that fails
# is actually an invariant.
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
-SHOW VARIABLES LIKE "%auto_inc%";
+SHOW VARIABLES LIKE "auto_inc%";
# TINYINT
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (2147483648, 'a');
SHOW CREATE TABLE t1;
SELECT * FROM t1;
-ALTER TABLE t1 CHANGE c1 c1 INT;
+ALTER TABLE t1 CHANGE c1 c1 INT default 0;
SHOW CREATE TABLE t1;
INSERT INTO t1(c2) VALUES('b');
SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.opt b/mysql-test/suite/innodb/t/innodb-bigblob.opt
index 06cc9e2b979..39673297ce9 100644
--- a/mysql-test/suite/innodb/t/innodb-bigblob.opt
+++ b/mysql-test/suite/innodb/t/innodb-bigblob.opt
@@ -1,2 +1,3 @@
--max-allowed-packet=128M
--innodb-log-file-size=210M
+--skip-innodb-doublewrite
diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.test b/mysql-test/suite/innodb/t/innodb-bigblob.test
index 7665c890316..d72e20487e4 100644
--- a/mysql-test/suite/innodb/t/innodb-bigblob.test
+++ b/mysql-test/suite/innodb/t/innodb-bigblob.test
@@ -9,6 +9,7 @@ let $status_orig=`SELECT @@innodb_status_output`;
call mtr.add_suppression("Resizing redo log from *");
call mtr.add_suppression("Starting to delete and rewrite log files.");
call mtr.add_suppression("New log files created, LSN=*");
+call mtr.add_suppression("Writer thread is waiting this semaphore");
create table foo (id varchar(37) not null, content longblob) engine=INNODB;
insert into foo (id, content) values('xyz', '');
diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test
index 0c3e4366c94..775d52c9ce8 100644
--- a/mysql-test/suite/innodb/t/innodb-blob.test
+++ b/mysql-test/suite/innodb/t/innodb-blob.test
@@ -3,16 +3,13 @@
# columns are stored off-page.
--source include/have_innodb.inc
+--source include/have_innodb_16k.inc
# DEBUG_SYNC must be compiled in.
--source include/have_debug_sync.inc
-# Valgrind would complain about memory leaks when we crash on purpose.
---source include/not_valgrind.inc
-# Embedded server does not support crashing
+# Embedded server does not support restarting
--source include/not_embedded.inc
-# Avoid CrashReporter popup on Mac
---source include/not_crashrep.inc
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -67,11 +64,11 @@ SELECT a, RIGHT(b,20) FROM t1;
SELECT a FROM t1;
# Request a crash, and restart the server.
-SET DEBUG_DBUG='+d,crash_commit_before';
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---error 2013
+BEGIN;
INSERT INTO t2 VALUES (42);
+--source include/kill_and_restart_mysqld.inc
+
disconnect con1;
disconnect con2;
connection default;
@@ -79,7 +76,6 @@ connection default;
--error 2013
reap;
-# Write file to make mysql-test-run.pl restart the server
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
@@ -146,11 +142,7 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: before_row_upd_extern';
-# Request a crash, and restart the server.
-SET DEBUG_DBUG='+d,crash_commit_before';
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---error 2013
-COMMIT;
+--source include/kill_and_restart_mysqld.inc
disconnect con2;
connection default;
@@ -158,7 +150,6 @@ connection default;
--error 2013
reap;
-# Write file to make mysql-test-run.pl restart the server
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
@@ -190,11 +181,7 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: after_row_upd_extern';
-# Request a crash, and restart the server.
-SET DEBUG_DBUG='+d,crash_commit_before';
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---error 2013
-COMMIT;
+--source include/kill_and_restart_mysqld.inc
disconnect con2;
connection default;
@@ -202,11 +189,9 @@ connection default;
--error 2013
reap;
-# Write file to make mysql-test-run.pl restart the server
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
-
CHECK TABLE t1,t2,t3;
SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
SELECT a FROM t3;
diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
index 8cbe4938cab..18d7aa3be58 100644
--- a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
+++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
@@ -1,8 +1,3 @@
-if (`select plugin_auth_version < "5.6.17" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB before 5.6.17
-}
-
--echo #
--echo # Bug#69122 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE
--echo # OPERATION IF IT IS DONE IN-PLACE
@@ -14,8 +9,9 @@ if (`select plugin_auth_version < "5.6.17" from information_schema.plugins where
--source include/not_embedded.inc
# DBUG_SUICIDE() hangs under valgrind
--source include/not_valgrind.inc
-# No windows, need perl
---source include/not_windows.inc
+
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when
@@ -29,7 +25,7 @@ CREATE TABLE t1(
b CHAR(1),
c INT,
INDEX(b))
-ENGINE=InnoDB;
+ENGINE=InnoDB STATS_PERSISTENT=0;
# Create enough rows for the table, so that the change buffer will be
# used for modifying the secondary index page. There must be multiple
@@ -46,32 +42,31 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
BEGIN;
SELECT b FROM t1 LIMIT 3;
connect (con1,localhost,root,,);
-connection con1;
BEGIN;
DELETE FROM t1 WHERE a=1;
# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
INSERT INTO t1 VALUES(1,'X',1);
SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--exec echo "wait" > $_expect_file_name
--error 2013
# This should force a change buffer merge
SELECT b FROM t1 LIMIT 3;
+disconnect con1;
+connection default;
let SEARCH_PATTERN=Wrote log record for ibuf update in place operation;
--source include/search_pattern_in_file.inc
-
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
+--source include/start_mysqld.inc
CHECK TABLE t1;
-
-# Cleanup
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
new file mode 100644
index 00000000000..7cc886cb9e5
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
@@ -0,0 +1,5 @@
+--innodb-file-per-table
+--innodb-file-format='Barracuda'
+--innodb-buffer-pool-size=32M
+--innodb-page-size=64k
+--innodb-strict-mode=OFF
diff --git a/mysql-test/suite/innodb/t/innodb-enlarge-blob.test b/mysql-test/suite/innodb/t/innodb-enlarge-blob.test
new file mode 100644
index 00000000000..65a64d299be
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-enlarge-blob.test
@@ -0,0 +1,29 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-13227: Assertion failure len < 16384 in file rem0rec.cc line 1285
+# Crashes with innodb_page_size=64K. Does not crash at <= 32K.
+#
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+# random data no output we are only interested if fails
+--disable_result_log
+SELECT * from t1;
+--enable_result_log
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+INSERT INTO t1 SET a=CONCAT('A', SPACE(8000), 'B');
+INSERT INTO t1 SELECT a FROM t1;
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+UPDATE t1 SET a=CONCAT(a, RAND(), a);
+# random data no output we are only interested if fails
+--disable_result_log
+SELECT * from t1;
+--enable_result_log
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt b/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt
new file mode 100644
index 00000000000..afa6311a74b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt
@@ -0,0 +1,2 @@
+--changed-page-bitmaps
+--innodb-track-changed-pages
diff --git a/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.test b/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.test
new file mode 100644
index 00000000000..662bbbaacaf
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.test
@@ -0,0 +1,5 @@
+-- source include/have_xtradb.inc
+-- source include/not_embedded.inc
+
+FLUSH NO_WRITE_TO_BINLOG changed_page_bitmaps;
+select * from information_schema.changed_page_bitmaps;
diff --git a/mysql-test/suite/innodb/t/innodb-index-online.opt b/mysql-test/suite/innodb/t/innodb-index-online.opt
index 3f3c063b38f..820778b0004 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online.opt
+++ b/mysql-test/suite/innodb/t/innodb-index-online.opt
@@ -1,5 +1,5 @@
--innodb-sort-buffer-size=64k
---innodb-online-alter-log-max-size=64k
+--innodb-online-alter-log-max-size=128k
--innodb-buffer-pool-size=5M
--innodb-log-buffer-size=256k
--innodb-sys-indexes
diff --git a/mysql-test/suite/innodb/t/innodb-index-online.test b/mysql-test/suite/innodb/t/innodb-index-online.test
index 331541ea099..efe1c796cf1 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online.test
+++ b/mysql-test/suite/innodb/t/innodb-index-online.test
@@ -1,4 +1,5 @@
--source include/innodb_page_size_small.inc
+--source include/innodb_encrypt_log.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
@@ -201,6 +202,18 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3;
SHOW CREATE TABLE t1;
+connection default;
+SET @merge_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+connection con1;
+
# Exceed the configured innodb_online_alter_log_max_size.
# The actual limit is a multiple of innodb_sort_buf_size,
# because that is the size of the in-memory log buffers.
@@ -224,7 +237,7 @@ SET DEBUG_SYNC = 'now WAIT_FOR c2e_created';
# At this point, the clustered index scan must have completed,
# but the modification log keeps accumulating due to the DEBUG_SYNC.
eval $innodb_metrics_select;
-let $c= 2;
+let $c= 4;
while ($c)
{
BEGIN;
@@ -244,6 +257,22 @@ SELECT sf.name, sf.pos FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES si
INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_FIELDS sf
ON si.index_id = sf.index_id WHERE si.name = '?c2e';
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+
+SELECT
+(@merge_encrypt_1-@merge_encrypt_0)-
+(@merge_decrypt_1-@merge_decrypt_0) as sort_balance,
+@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
+@rowlog_encrypt_1>@rowlog_encrypt_0;
+
# Release con1.
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
@@ -271,6 +300,19 @@ ALTER TABLE t1 COMMENT 'testing if c2e will be dropped';
# Check that the 'zombie' index c2e was dropped.
eval $innodb_metrics_select;
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
+
connection con1;
# Accumulate and apply some modification log.
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done';
@@ -283,6 +325,9 @@ connection default;
SET DEBUG_SYNC = 'now WAIT_FOR c2f_created';
# Generate some log (delete-mark, delete-unmark, insert etc.)
eval $innodb_metrics_select;
+let $c= 2;
+while ($c)
+{
BEGIN;
INSERT INTO t1 SELECT 320 + c1, c2, c3 FROM t1 WHERE c1 > 160;
DELETE FROM t1 WHERE c1 > 320;
@@ -291,6 +336,8 @@ BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
+dec $c;
+}
eval $innodb_metrics_select;
# Release con1.
SET DEBUG_SYNC = 'now SIGNAL dml3_done';
@@ -301,6 +348,34 @@ reap;
ALTER TABLE t1 CHANGE c2 c22f INT;
eval $innodb_metrics_select;
+
+connection default;
+
+SET @merge_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
+
+SELECT
+(@merge_encrypt_2-@merge_encrypt_1)-
+(@merge_decrypt_2-@merge_decrypt_1) as sort_balance,
+(@rowlog_encrypt_2-@rowlog_encrypt_1)-
+(@rowlog_decrypt_2-@rowlog_decrypt_1) as log_balance;
+SELECT
+@merge_encrypt_2-@merge_encrypt_1>0 as sort_encrypted,
+@merge_decrypt_2-@merge_decrypt_1>0 as sort_decrypted,
+@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
+@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
+
+connection con1;
SELECT COUNT(c22f) FROM t1;
CHECK TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.opt b/mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.opt
new file mode 100644
index 00000000000..e5d34636ccb
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.opt
@@ -0,0 +1,2 @@
+--loose-innodb-lock-wait-timeout=1
+--loose-innodb-lock-schedule-algorithm=VATS
diff --git a/mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.test b/mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.test
new file mode 100644
index 00000000000..a14c156546a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-lock-schedule-algorithm.test
@@ -0,0 +1,106 @@
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+
+--connect (con1,localhost,root,,test)
+connection con1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * from t1;
+--error 1205
+UPDATE t1 SET i1 = 1;
+COMMIT;
+
+connection default;
+COMMIT;
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
+disconnect con1;
+
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+
+--connect (con1,localhost,root,,test)
+connection con1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * FROM t1;
+--error 1205
+UPDATE t1 SET i1 = 1;
+
+connection default;
+COMMIT;
+
+connection con1;
+COMMIT;
+
+connection default;
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
+disconnect con1;
+
+--echo # "restart: --loose-innodb-lock-schedule-algorithm=FCFS"
+--let $restart_parameters=--loose_innodb_lock_schedule_algorithm=FCFS
+-- source include/restart_mysqld.inc
+
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+
+--connect (con1,localhost,root,,test)
+connection con1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * from t1;
+--error 1205
+UPDATE t1 SET i1 = 1;
+COMMIT;
+
+connection default;
+COMMIT;
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
+disconnect con1;
+
+CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
+BEGIN;
+DELETE FROM t1;
+
+--connect (con1,localhost,root,,test)
+connection con1;
+BEGIN;
+INSERT INTO t2 VALUES (1),(2);
+SELECT * FROM t1;
+--error 1205
+UPDATE t1 SET i1 = 1;
+
+connection default;
+COMMIT;
+
+connection con1;
+COMMIT;
+
+connection default;
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
+disconnect con1;
+
diff --git a/mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test b/mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test
new file mode 100644
index 00000000000..fe04f4b7705
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test
@@ -0,0 +1,25 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
+
+SET @saved_debug = @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
+
+CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
+COMMIT;
+
+SET debug_dbug = @saved_debug;
+
+DROP TABLE t1;
+
+#
+# There should be only one message
+#
+let SEARCH_RANGE= -50000;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+--let SEARCH_PATTERN=InnoDB: Difficult to find free blocks
+--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
new file mode 100644
index 00000000000..8c4cee14453
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
@@ -0,0 +1,11 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_bzip2.inc
+-- source include/not_embedded.inc
+
+# bzip2
+set global innodb_compression_algorithm = bzip2;
+
+# All page compression test use the same
+--source include/innodb-page-compression.inc
+
+-- echo #done
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_default.test b/mysql-test/suite/innodb/t/innodb-page_compression_default.test
new file mode 100644
index 00000000000..1cc6c917548
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_default.test
@@ -0,0 +1,10 @@
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+.");
+
+# All page compression test use the same
+--source include/innodb-page-compression.inc
+
+-- echo #done
+
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
new file mode 100644
index 00000000000..9d6e2babbe7
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
@@ -0,0 +1,12 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_lz4.inc
+# disable embedded as it does not support restart
+-- source include/not_embedded.inc
+
+# lz4
+set global innodb_compression_algorithm = lz4;
+
+# All page compression test use the same
+--source include/innodb-page-compression.inc
+
+-- echo #done
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
new file mode 100644
index 00000000000..0b97c1578c6
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
@@ -0,0 +1,11 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_lzma.inc
+-- source include/not_embedded.inc
+
+# lzma
+set global innodb_compression_algorithm = lzma;
+
+# All page compression test use the same
+--source include/innodb-page-compression.inc
+
+-- echo #done
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
new file mode 100644
index 00000000000..aec07beeca6
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
@@ -0,0 +1,11 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_lzo.inc
+-- source include/not_embedded.inc
+
+# lzo
+set global innodb_compression_algorithm = lzo;
+
+# All page compression test use the same
+--source include/innodb-page-compression.inc
+
+-- echo #done
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test
new file mode 100644
index 00000000000..532ec294d28
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test
@@ -0,0 +1,13 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_snappy.inc
+--source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+.");
+
+# snappy
+set global innodb_compression_algorithm = snappy;
+
+# All page compression test use the same
+--source include/innodb-page-compression.inc
+
+-- echo #done
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_tables.test b/mysql-test/suite/innodb/t/innodb-page_compression_tables.test
new file mode 100644
index 00000000000..d8a85d7f273
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_tables.test
@@ -0,0 +1,101 @@
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+--disable_query_log
+let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# zlib
+set global innodb_compression_algorithm = 1;
+
+create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
+create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
+create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
+--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
+--error 1005
+create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1;
+--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
+show warnings;
+show create table innodb_compact;
+show create table innodb_dynamic;
+
+# MDEV-7133: InnoDB: Assertion failure in thread 140737091569408 in file dict0mem.cc line 74
+# InnoDB: Failing assertion: dict_tf_is_valid(flags)
+--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
+--error 1005
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_compressed=1;
+--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
+show warnings;
+create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
+show create table innodb_redundant;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+alter table innodb_redundant page_compressed=1;
+show warnings;
+show create table innodb_redundant;
+alter table innodb_redundant row_format=compact page_compressed=1;
+show create table innodb_redundant;
+drop table innodb_redundant;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+
+insert into innodb_compact select * from innodb_normal;
+insert into innodb_dynamic select * from innodb_normal;
+
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+
+--source include/restart_mysqld.inc
+
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# none
+set global innodb_compression_algorithm = 0;
+
+alter table innodb_compact engine=innodb page_compressed=DEFAULT;
+alter table innodb_dynamic engine=innodb page_compressed=DEFAULT;
+show create table innodb_compact;
+show create table innodb_dynamic;
+
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_compact where c1 < 1500000;
+select count(*) from innodb_dynamic where c1 < 1500000;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compact;
+drop table innodb_dynamic;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
new file mode 100644
index 00000000000..ed3a27ada7b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
@@ -0,0 +1,10 @@
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+# lz4
+set global innodb_compression_algorithm = zlib;
+
+# All page compression test use the same
+--source include/innodb-page-compression.inc
+
+-- echo #done
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 9ac01ffb5ad..92eea2b0d2e 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=64k --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 --innodb-log-buffer-size=256k
diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test
index 4e9f2f13344..b9c9dc085d6 100644
--- a/mysql-test/suite/innodb/t/innodb-table-online.test
+++ b/mysql-test/suite/innodb/t/innodb-table-online.test
@@ -1,4 +1,5 @@
---source include/innodb_page_size.inc
+--source include/innodb_page_size_small.inc
+--source include/innodb_encrypt_log.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
@@ -13,11 +14,14 @@ call mtr.add_suppression("MySQL is trying to open a table handle but the .ibd fi
# DISCARD TABLESPACE needs file-per-table
SET @global_innodb_file_per_table_orig = @@global.innodb_file_per_table;
SET GLOBAL innodb_file_per_table = on;
+# PAGE_COMPRESSED needs innodb_file_format!=Antelope
+SET @file_format = @@GLOBAL.innodb_file_format;
+SET GLOBAL innodb_file_format = Barracuda;
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
-CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 TEXT NOT NULL)
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 CHAR(255) NOT NULL)
ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,1,''), (2,2,''), (3,3,''), (4,4,''), (5,5,'');
@@ -188,10 +192,20 @@ INSERT INTO t1 SELECT 10 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 20 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 40 + c1, c2, c3 FROM t1;
# Purge may or may not have cleaned up the DELETE FROM t1 WHERE c1 = 7;
---replace_result 81 80
+--replace_column 9 ROWS
EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3;
ANALYZE TABLE t1;
+SET @merge_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_0=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+
--echo # session con1
connection con1;
SHOW CREATE TABLE t1;
@@ -204,7 +218,8 @@ SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done
# Ensure that the ALTER TABLE will be executed even with some concurrent DML.
SET lock_wait_timeout = 10;
--send
-ALTER TABLE t1 ROW_FORMAT=COMPACT, ALGORITHM = INPLACE;
+ALTER TABLE t1 ROW_FORMAT=COMPACT
+PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;
# Generate some log (delete-mark, delete-unmark, insert etc.)
# while the index creation is blocked. Some of this may run
@@ -234,6 +249,22 @@ while ($c)
# Temporary table should exist until the DDL thread notices the overflow.
eval $innodb_metrics_select;
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+
+SELECT
+(@merge_encrypt_1-@merge_encrypt_0)-
+(@merge_decrypt_1-@merge_decrypt_0) as sort_balance,
+@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
+@rowlog_encrypt_1>@rowlog_encrypt_0;
+
# Release con1.
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
@@ -247,6 +278,19 @@ reap;
# when the above error was noticed.
eval $innodb_metrics_select;
+SET @merge_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_1=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
+
# Accumulate and apply some modification log.
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt3 WAIT_FOR dml3_done';
--error ER_MULTIPLE_PRI_KEY
@@ -255,8 +299,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT;
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT;
--send
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c22f,c4(5)),
-CHANGE c2 c22f INT, CHANGE c3 c3 TEXT NULL, CHANGE c1 c1 INT AFTER c22f,
-ADD COLUMN c4 VARCHAR(6) DEFAULT 'Online';
+CHANGE c2 c22f INT, CHANGE c3 c3 CHAR(255) NULL, CHANGE c1 c1 INT AFTER c22f,
+ADD COLUMN c4 VARCHAR(6) DEFAULT 'Online', LOCK=NONE;
--echo # session default
connection default;
@@ -282,6 +326,30 @@ eval $innodb_metrics_select;
SELECT COUNT(c22f) FROM t1;
CHECK TABLE t1;
+SET @merge_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
+SET @merge_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
+SET @rowlog_encrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
+SET @rowlog_decrypt_2=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
+
+SELECT
+(@merge_encrypt_2-@merge_encrypt_1)-
+(@merge_decrypt_2-@merge_decrypt_1) as sort_balance,
+(@rowlog_encrypt_2-@rowlog_encrypt_1)-
+(@rowlog_decrypt_2-@rowlog_decrypt_1) as log_balance;
+SELECT
+@merge_encrypt_2-@merge_encrypt_1>0 as sort_encrypted,
+@merge_decrypt_2-@merge_decrypt_1>0 as sort_decrypted,
+@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
+@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
+
# Create a column prefix index.
--error ER_DUP_ENTRY
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5));
@@ -298,15 +366,15 @@ ALTER TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
ALGORITHM = INPLACE;
--error ER_INVALID_USE_OF_NULL
-ALTER TABLE t1 MODIFY c3 TEXT NOT NULL;
+ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
SET @@sql_mode = @old_sql_mode;
-UPDATE t1 SET c3=CONCAT(c1,REPEAT('foo',c1)) WHERE c3 IS NULL;
+UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0';
# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on.
SET @@sql_mode = 'STRICT_TRANS_TABLES';
--send
-ALTER TABLE t1 MODIFY c3 TEXT NOT NULL, DROP COLUMN c22f,
+ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
ADD COLUMN c5 CHAR(5) DEFAULT 'tired' FIRST;
--echo # session default
@@ -330,7 +398,7 @@ ROLLBACK;
--echo # session con1
connection con1;
-ALTER TABLE t1 MODIFY c3 TEXT NOT NULL;
+ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created WAIT_FOR ins_done';
--send
ALTER TABLE t1 DROP PRIMARY KEY, DROP COLUMN c22f,
@@ -379,6 +447,7 @@ DROP TABLE t1;
--source include/wait_until_count_sessions.inc
SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
+SET GLOBAL innodb_file_format = @file_format;
--disable_warnings
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
index e7bc705b89a..11bdd4305c2 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
@@ -1445,6 +1445,8 @@ call mtr.add_suppression("but tablespace with that id or name does not exist");
call mtr.add_suppression("Failed to find tablespace for table '\"test_wl5522\".\"t1\"' in the cache");
call mtr.add_suppression("Could not find a valid tablespace file for 'test_wl5522.*t1'");
call mtr.add_suppression("while reading index meta-data, expected to read 44 bytes but read only 0 bytes");
+call mtr.add_suppression("Page for tablespace.*that index is not found from configuration file");
+call mtr.add_suppression("Invalid FSP_SPACE_FLAGS=0x0");
--enable_query_log
#cleanup
diff --git a/mysql-test/suite/innodb/t/innodb.opt b/mysql-test/suite/innodb/t/innodb.opt
new file mode 100644
index 00000000000..59e43fea231
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb.opt
@@ -0,0 +1 @@
+--innodb-defragment=0 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index fc768ab197b..087d0c6a7dc 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
+-- source include/have_innodb_16k.inc
let $MYSQLD_DATADIR= `select @@datadir`;
@@ -445,7 +446,8 @@ drop table t1;
# Test of opening table twice and timestamps
#
set @a:=now();
-CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
+CREATE TABLE t1 (a int not null, b timestamp not null default
+current_timestamp on update current_timestamp, primary key (a)) engine=innodb;
insert into t1 (a) values(1),(2),(3);
select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
select a from t1 natural join t1 as t2 where b >= @a order by a;
@@ -1303,7 +1305,7 @@ drop table t1;
# Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...).
---replace_result 511 ok 512 ok 2047 ok 513 ok 515 ok
+--replace_result 511 ok 512 ok 2047 ok 513 ok 514 ok 515 ok
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
@@ -1539,7 +1541,7 @@ INSERT INTO t2 VALUES(1);
--error 1451
DELETE FROM t1 WHERE id = 1;
---error 1217
+--error 1451
DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=0;
diff --git a/mysql-test/suite/innodb/t/innodb_blob_truncate.test b/mysql-test/suite/innodb/t/innodb_blob_truncate.test
new file mode 100644
index 00000000000..8a4248c795e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_blob_truncate.test
@@ -0,0 +1,45 @@
+--source include/have_innodb.inc
+--source include/have_innodb_16k.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table t1(a blob) engine=innodb key_block_size=8;
+delimiter //;
+create function generate_blob()
+ returns varchar(20000)
+ begin
+ declare x varchar(20000) default '';
+ declare i int default 500;
+ while i > 0 do
+ set x = concat(sha1(i), x);
+ set i = i - 1;
+ end while;
+ return x;
+end //
+delimiter ;//
+insert into t1 select generate_blob();
+let $x = `select 20000 - length(a) from t1`;
+if ($x) {
+ echo Blob is truncated by $x bytes.;
+ die It must have been 20000 bytes.;
+}
+truncate t1;
+insert into t1 select generate_blob();
+let $x = `select 20000 - length(a) from t1`;
+if ($x) {
+ echo Blob is truncated by $x bytes.;
+ die It must have been 20000 bytes.;
+}
+drop table t1;
+drop function generate_blob;
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test
index 165e19b7cbc..235ece04a8c 100644
--- a/mysql-test/suite/innodb/t/innodb_bug12400341.test
+++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test
@@ -1,6 +1,7 @@
# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND
-- source include/have_innodb.inc
+-- source include/have_innodb_16k.inc
if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`)
{
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test
index 2efd3c5e56b..c21515e7d05 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test
@@ -2,24 +2,23 @@
# Test opening a corrupted table.
#
-# Don't test under valgrind, memory leaks will occur
-source include/not_valgrind.inc;
-# Avoid CrashReporter popup on Mac
-source include/not_crashrep.inc;
+-- source include/not_encrypted.inc
+
+call mtr.add_suppression("InnoDB: Table \"test\".\"t1\" is corrupted. Please drop the table and recreate.");
+call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup.");
+
# Don't test under embedded
source include/not_embedded.inc;
# Require InnoDB
source include/have_innodb.inc;
-# Require Debug for SET DEBUG
-source include/have_debug.inc;
-# Test could open crash reporter on Windows
-# if compiler set up
-source include/not_windows.inc;
-
-CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
-CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
--echo # Create and populate the table to be corrupted
+
+--disable_warnings
+set global innodb_file_per_table=ON;
+--enable_warnings
+
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
--disable_query_log
@@ -35,20 +34,7 @@ INSERT INTO t1 (b) VALUES ('corrupt me');
let $MYSQLD_DATADIR=`select @@datadir`;
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
---echo # Write file to make mysql-test-run.pl expect the "crash", but don't
---echo # start it until it's told to
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
---echo # We give 30 seconds to do a clean shutdown because we do not want
---echo # to redo apply the pages of t1.ibd at the time of recovery.
---echo # We want SQL to initiate the first access to t1.ibd.
-shutdown_server 30;
-
---echo # Wait until disconnected.
---source include/wait_until_disconnected.inc
-
---echo # Backup the t1.ibd before corrupting
---copy_file $t1_IBD $MYSQLD_DATADIR/test/t1.ibd.backup
+--source include/shutdown_mysqld.inc
--echo # Corrupt the table
@@ -77,35 +63,18 @@ while ($len = sysread IBD_FILE, $chunk, 1024)
close IBD_FILE;
EOF
---echo # Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
+--source include/start_mysqld.inc
-SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
+--echo # Now t1 is corrupted but we should not crash
---echo # Write file to make mysql-test-run.pl expect the "crash", but don't
---echo # start it until it's told to
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
---echo # The below SELECT query will crash the server because some pages
---echo # on the disk are corrupted
---error 2013
+--error 1712,1932
SELECT * FROM t1;
-# The below mtr command --remove_file fails randomly on windows with
-# error number 13 which is permission denied on nix systems. We sleep
-# 1 second hoping that any process holding lock on t1.ibd is released.
-SLEEP 1;
-
---echo # Restore the original t1.ibd
---remove_file $MYSQLD_DATADIR/test/t1.ibd
---move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
+--error 1034,1712,1932
+INSERT INTO t1(b) VALUES('abcdef');
---echo # Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
+--error 1712,1932
+UPDATE t1 set b = 'deadbeef' where a = 1;
---echo # Cleanup
+--echo # Cleanup, this must be possible
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test
index c298c945434..a9345440baa 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53756.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53756.test
@@ -6,24 +6,8 @@
# metadata in the function dict_load_table_on_id() during crash recovery.
#
-# innobackup needs to connect to the server. Not supported in embedded.
+# The embedded server test does not support restarting.
--source include/not_embedded.inc
-#
-# This test case needs to crash the server. Needs a debug server.
---source include/have_debug.inc
-#
-# Don't test this under valgrind, memory leaks will occur.
---source include/not_valgrind.inc
-
-# Avoid CrashReporter popup on Mac
---source include/not_crashrep.inc
-
-#
-# Precautionary clean up.
-#
---disable_warnings
-DROP TABLE IF EXISTS bug_53756 ;
---enable_warnings
#
# Create test data.
@@ -34,9 +18,6 @@ INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
--echo
--echo # Select a less restrictive isolation level.
-# Don't use user variables. They won't survive server crash.
---let $global_isolation= `SELECT @@global.tx_isolation`
---let $session_isolation= `SELECT @@session.tx_isolation`
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
COMMIT;
@@ -121,49 +102,16 @@ ROLLBACK;
--connection default
SELECT * FROM bug_53756;
---echo
---echo # connection default
---connection default
---echo #
---echo # Crash server.
-#
-# Write file to make mysql-test-run.pl expect the "crash", but don't start
-# it until it's told to
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-#
START TRANSACTION;
INSERT INTO bug_53756 VALUES (666,666);
-#
-# Request a crash on next execution of commit.
-SET SESSION debug_dbug="+d,crash_commit_before";
-#
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-#
-# Execute the statement that causes the crash.
---error 2013
-COMMIT;
---echo
---echo #
---echo # disconnect con1, con2, con3, con4, con5, con6.
+
+--source include/kill_and_restart_mysqld.inc
--disconnect con1
--disconnect con2
--disconnect con3
--disconnect con4
--disconnect con5
--disconnect con6
---echo #
---echo # Restart server.
-#
-# Turn on reconnect
---enable_reconnect
-#
-# Call script that will poll the server waiting for it to be back online again
---source include/wait_until_connected_again.inc
-#
-# Turn off reconnect again
---disable_reconnect
---echo
--echo #
--echo # Select recovered data.
@@ -174,12 +122,4 @@ COMMIT;
--echo # Delete of row 2 and insert of row 5 should be rolled back
SELECT * FROM bug_53756;
---echo
---echo # Clean up.
DROP TABLE bug_53756;
-
---disable_query_log
-eval SET GLOBAL tx_isolation= '$global_isolation';
-eval SET SESSION tx_isolation= '$session_isolation';
---enable_query_log
-
diff --git a/mysql-test/suite/innodb/t/innodb_bug59641.test b/mysql-test/suite/innodb/t/innodb_bug59641.test
index 7fa32d2ec35..5f7528cf01a 100644
--- a/mysql-test/suite/innodb/t/innodb_bug59641.test
+++ b/mysql-test/suite/innodb/t/innodb_bug59641.test
@@ -43,6 +43,7 @@ COMMIT;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
COMMIT;
+--sorted_result
XA RECOVER;
XA ROLLBACK '123';
XA ROLLBACK '456';
diff --git a/mysql-test/suite/innodb/t/innodb_bug60049.test b/mysql-test/suite/innodb/t/innodb_bug60049.test
index 6760d1a1f02..b1d56d16a5e 100644
--- a/mysql-test/suite/innodb/t/innodb_bug60049.test
+++ b/mysql-test/suite/innodb/t/innodb_bug60049.test
@@ -5,6 +5,7 @@
-- source include/not_embedded.inc
-- source include/have_innodb.inc
-- source include/have_innodb_16k.inc
+-- source include/not_encrypted.inc
call mtr.add_suppression('InnoDB: Error: Table "mysql"."innodb_(table|index)_stats" not found');
call mtr.add_suppression('InnoDB: Error: Fetch of persistent statistics requested');
diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.opt b/mysql-test/suite/innodb/t/innodb_corrupt_bit.opt
new file mode 100644
index 00000000000..683a276da2a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.opt
@@ -0,0 +1 @@
+--innodb-encryption-threads=0
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_binlog.opt b/mysql-test/suite/innodb/t/innodb_defrag_binlog.opt
new file mode 100644
index 00000000000..8a432b8c76e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_binlog.opt
@@ -0,0 +1,5 @@
+--loose-innodb-buffer-pool-stats
+--loose-innodb-buffer-page
+--loose-innodb-buffer-page-lru
+--binlog-format=row
+--innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_binlog.test b/mysql-test/suite/innodb/t/innodb_defrag_binlog.test
new file mode 100644
index 00000000000..db6849f8477
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_binlog.test
@@ -0,0 +1,21 @@
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+--source include/not_valgrind.inc
+--source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb;
+
+insert into t1 values (1, REPEAT("a", 256));
+insert into t1 values (2, REPEAT("a", 256));
+optimize table t1;
+
+drop table t1;
+
+--source include/show_binlog_events.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt
new file mode 100644
index 00000000000..6426bac41a0
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt
@@ -0,0 +1,4 @@
+--loose-innodb-buffer-pool-stats
+--loose-innodb-buffer-page
+--loose-innodb-buffer-page-lru
+--innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test
new file mode 100644
index 00000000000..f596fab2a15
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test
@@ -0,0 +1,122 @@
+--source include/have_innodb.inc
+--source include/big_test.inc
+--source include/not_valgrind.inc
+--source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE if exists t1;
+--enable_warnings
+
+--disable_query_log
+let $innodb_defragment_n_pages_orig=`select @@innodb_defragment_n_pages`;
+let $innodb_defragment_stats_accuracy_orig=`select @@innodb_defragment_stats_accuracy`;
+--enable_query_log
+
+select @@global.innodb_stats_persistent;
+set global innodb_defragment_stats_accuracy = 80;
+
+# Create table.
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB;
+
+connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connect (con3,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connect (con4,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+connection default;
+
+SET @@global.innodb_defragment_n_pages = 20;
+
+let $data_size = 20000;
+let $delete_size = 2000;
+
+# Populate table.
+let $i = $data_size;
+--disable_query_log
+while ($i)
+{
+ eval
+ INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256), $i);
+ dec $i;
+}
+--enable_query_log
+
+select count(*) from t1;
+select count(*) from t1 force index (second);
+select count(*) from t1 force index (third);
+
+# Delete some data
+--disable_query_log
+let $size = $delete_size;
+while ($size)
+{
+ let $j = 100 * $size;
+ eval delete from t1 where a between $j - 20 and $j;
+ dec $size;
+}
+--enable_query_log
+
+select count(*) from t1;
+select count(*) from t1 force index (second);
+select count(*) from t1 force index (third);
+
+# Above delete will free some pages and insert causes page split and these could cause defrag
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+connection con1;
+--send optimize table t1;
+
+connection default;
+--send INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000);
+
+connection con2;
+--send INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000);
+
+connection con3;
+--send DELETE FROM t1 where a between 1 and 100;
+
+connection con4;
+--send UPDATE t1 SET c = c + 1 where c between 2000 and 8000;
+
+connection con1;
+--disable_result_log
+--reap
+--enable_result_log
+
+connection con2;
+--reap
+
+connection con3;
+--reap
+
+connection con4;
+--reap
+
+connection default;
+--reap
+
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
+
+optimize table t1;
+
+select count(*) from t1;
+select count(*) from t1 force index (second);
+select count(*) from t1 force index (third);
+
+# Now pages are freed
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+drop table t1;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_defragment_n_pages = $innodb_defragment_n_pages_orig;
+EVAL SET GLOBAL innodb_defragment_stats_accuracy = $innodb_defragment_stats_accuracy_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats.opt b/mysql-test/suite/innodb/t/innodb_defrag_stats.opt
new file mode 100644
index 00000000000..d3525162f03
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_stats.opt
@@ -0,0 +1 @@
+--innodb-defragment=1
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats.test b/mysql-test/suite/innodb/t/innodb_defrag_stats.test
new file mode 100644
index 00000000000..2a5026a68e5
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_stats.test
@@ -0,0 +1,125 @@
+--source include/have_innodb.inc
+--source include/big_test.inc
+--source include/not_valgrind.inc
+--source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE if exists t1;
+--enable_warnings
+
+--disable_query_log
+let $innodb_defragment_stats_accuracy_orig=`select @@innodb_defragment_stats_accuracy`;
+--enable_query_log
+
+select @@global.innodb_stats_persistent;
+set global innodb_defragment_stats_accuracy = 20;
+
+--echo # Create table.
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
+
+--echo # Populate data
+INSERT INTO t1 VALUES(1, REPEAT('A', 256));
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+
+--echo # Not enough page splits to trigger persistent stats write yet.
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+INSERT INTO t1 (b) SELECT b from t1;
+
+--echo # Persistent stats recorded.
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+--echo # Delete some rows.
+let $num_delete = 20;
+while ($num_delete)
+{
+ let $j = 100 * $num_delete;
+ eval delete from t1 where a between $j and $j + 30;
+ dec $num_delete;
+}
+
+--source include/restart_mysqld.inc
+--echo # Server Restarted
+
+--echo # Confirm persistent stats still there after restart.
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+optimize table t1;
+select sleep(2);
+
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+set global innodb_defragment_stats_accuracy = 40;
+
+INSERT INTO t1 (b) SELECT b from t1;
+
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+
+INSERT INTO t1 (b) SELECT b from t1;
+
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+
+--echo # Table rename should cause stats rename.
+rename table t1 to t2;
+select sleep(1);
+
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+
+--echo # Drop index should cause stats drop.
+drop index SECOND on t2;
+select sleep(3);
+
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag');
+
+--source include/restart_mysqld.inc
+--echo Server Restarted
+
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+
+--echo # Clean up
+DROP TABLE t2;
+
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+
+--disable_query_log
+EVAL SET GLOBAL innodb_defragment_stats_accuracy = $innodb_defragment_stats_accuracy_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt b/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt
new file mode 100644
index 00000000000..d3525162f03
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt
@@ -0,0 +1 @@
+--innodb-defragment=1
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test b/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test
new file mode 100644
index 00000000000..a0f43fa6841
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test
@@ -0,0 +1,77 @@
+--source include/have_innodb.inc
+--source include/big_test.inc
+--source include/not_valgrind.inc
+--source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE if exists t1;
+--enable_warnings
+
+let $num_tables = 505;
+
+SET @start_table_definition_cache = @@global.table_definition_cache;
+SET @@global.table_definition_cache = 400;
+
+SET @start_flush_log_at_trx_commit = @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit=2;
+
+# set stats accuracy to be pretty high so stats sync is easily triggered.
+SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
+SET @@global.innodb_defragment_stats_accuracy = 80;
+
+# Create table.
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
+
+# Populate data
+INSERT INTO t1 VALUES(1, REPEAT('A', 256));
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+
+select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
+
+# Create many tables to over flow the table definition cache
+
+--echo Create $num_tables table to overflow the table cache.
+--disable_query_log
+let $count = $num_tables;
+while ($count)
+{
+ EVAL CREATE TABLE t_$count (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=INNODB;
+ EVAL INSERT INTO t_$count VALUES (1), (2);
+ dec $count;
+}
+--enable_query_log
+--echo Sleep for a while to make sure t1 is evicted.
+select sleep(15);
+
+--echo Reload t1 to get defrag stats from persistent storage
+INSERT INTO t1 (b) SELECT b from t1;
+
+--echo make sure the stats thread will wake up and do the write even if there's a race condition between set and reset.
+select sleep(15);
+
+select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
+
+
+# Clean up
+SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
+SET @@global.table_definition_cache = @start_table_definition_cache;
+--disable_query_log
+let $count = $num_tables;
+while ($count)
+{
+ EVAL DROP TABLE t_$count;
+ dec $count;
+}
+set @@global.innodb_flush_log_at_trx_commit = @start_flush_log_at_trx_commit;
+--enable_query_log
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_defragment.opt b/mysql-test/suite/innodb/t/innodb_defragment.opt
new file mode 100644
index 00000000000..aea3d480c24
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment.opt
@@ -0,0 +1,5 @@
+--loose-innodb-buffer-pool-stats
+--loose-innodb-buffer-page
+--loose-innodb-buffer-page-lru
+--innodb-file-per-table
+--innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defragment.test b/mysql-test/suite/innodb/t/innodb_defragment.test
new file mode 100644
index 00000000000..d9f5f56316e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment.test
@@ -0,0 +1,155 @@
+--source include/have_innodb.inc
+--source include/big_test.inc
+--source include/not_embedded.inc
+
+set global innodb_defragment_stats_accuracy = 80;
+
+# Create table.
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
+
+## Test-1 defragment an empty table
+optimize table t1;
+
+## Test-2 defragment a single page table
+INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
+
+optimize table t1;
+
+## Test-3 defragment (somewhat) in parallel with delete queries
+let $data_size = 10000;
+let $delete_size = 100;
+
+delimiter //;
+create procedure defragment()
+begin
+ set @i = 0;
+ repeat
+ set @i = @i + 1;
+ optimize table t1;
+ until @i = 3 end repeat;
+end //
+delimiter ;//
+
+
+# Populate table.
+let $i = $data_size;
+--disable_query_log
+BEGIN;
+while ($i)
+{
+ eval
+ INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256));
+ dec $i;
+}
+COMMIT;
+--enable_query_log
+
+select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+select count(*) from t1;
+
+connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+connection con1;
+--send call defragment()
+
+connection default;
+
+--disable_query_log
+let $size = $delete_size;
+while ($size)
+{
+ let $j = 100 * $size;
+ eval delete from t1 where a between $j - 20 and $j;
+ dec $size;
+}
+--enable_query_log
+
+connection con1;
+--disable_result_log
+--reap
+--enable_result_log
+
+connection default;
+disconnect con1;
+
+optimize table t1;
+
+--source include/restart_mysqld.inc
+select count(*) from t1;
+
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+select count(*) from t1 force index (second);
+
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
+
+## Test-4 defragment with larger n_pages
+
+# delete some more records
+--disable_query_log
+let $size = $delete_size;
+while ($size)
+{
+ let $j = 100 * $size;
+ eval delete from t1 where a between $j - 30 and $j - 20;
+ dec $size;
+}
+--enable_query_log
+
+SET @@global.innodb_defragment_n_pages = 3;
+
+# This will not reduce number of pages by a lot
+optimize table t1;
+
+--source include/restart_mysqld.inc
+
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+select count(*) from t1;
+
+# We didn't create large wholes with the previous deletion, so if innodb_defragment_n_pages = 3, we won't be able to free up many pages.
+
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+
+select count(*) from t1 force index (second);
+
+# Same holds for secondary index, not many pages are released.
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
+
+SET @@global.innodb_defragment_n_pages = 10;
+
+optimize table t1;
+
+--source include/restart_mysqld.inc
+
+select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
+select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
+select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+
+
+select count(*) from t1 force index (second);
+
+# Same holds for secondary index, not many pages are released.
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
+select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
+
+DROP PROCEDURE defragment;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_defragment_fill_factor.opt b/mysql-test/suite/innodb/t/innodb_defragment_fill_factor.opt
new file mode 100644
index 00000000000..6426bac41a0
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment_fill_factor.opt
@@ -0,0 +1,4 @@
+--loose-innodb-buffer-pool-stats
+--loose-innodb-buffer-page
+--loose-innodb-buffer-page-lru
+--innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test b/mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
new file mode 100644
index 00000000000..2edc8a45c02
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
@@ -0,0 +1,210 @@
+--source include/have_innodb.inc
+--source include/big_test.inc
+--source include/not_valgrind.inc
+--source include/not_embedded.inc
+--source include/have_innodb_16k.inc
+
+--disable_warnings
+DROP TABLE if exists t1;
+DROP TABLE if exists t2;
+--enable_warnings
+
+--echo Testing tables with large records
+# Create table.
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c VARCHAR(256), KEY SECOND(a, b,c)) ENGINE=INNODB;
+
+# Populate table.
+INSERT INTO t1 VALUES (1, REPEAT('A', 256), REPEAT('B', 256));
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 (b) SELECT b from t1;
+
+--disable_query_log
+let $size = 10;
+while ($size)
+{
+ let $j = 100 * $size;
+ eval delete from t1 where a between $j - 20 and $j + 5;
+ dec $size;
+}
+--enable_query_log
+
+--source include/wait_innodb_all_purged.inc
+--source include/restart_mysqld.inc
+optimize table t1;
+
+select count(*) from t1;
+
+--let $primary_before = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY', Value, 1)
+
+select count(*) from t1 force index (second);
+
+--let $second_before = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second', Value, 1)
+
+--echo # A few more insertions on the page should not cause a page split.
+insert into t1 values (81, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (83, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (87, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (82, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (86, REPEAT('A', 256), REPEAT('B', 256));
+--let $primary_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY', Value, 1)
+--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second', Value, 1)
+
+if ($primary_before != $primary_after) {
+ --echo Insertion caused page split on primary, which should be avoided by innodb_defragment_fill_factor.
+}
+
+if ($second_before != $second_after) {
+ --echo Insertion caused page split on second, which should be avoided by innodb_defragment_fill_factor.
+}
+
+--echo # Insert more rows to cause a page split
+insert into t1 values (180, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (181, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (182, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (183, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (184, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (185, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (186, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (187, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (188, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (189, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (190, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (191, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (192, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (193, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (194, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (195, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (196, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (197, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (198, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (199, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (200, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (201, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (202, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (203, REPEAT('A', 256), REPEAT('B', 256));
+insert into t1 values (204, REPEAT('A', 256), REPEAT('B', 256));
+
+--let $primary_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY', Value, 1)
+
+--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second', Value, 1)
+
+if ($primary_before == $primary_after) {
+ --echo Too little space is reserved on primary index.
+}
+
+if ($second_before == $second_after) {
+ --echo Too little space is reserved on second index.
+}
+
+DROP TABLE t1;
+
+--echo Testing table with small records
+CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(16), c VARCHAR(32), KEY SECOND(a,b,c)) ENGINE=INNODB;
+# Populate table.
+--disable_query_log
+INSERT INTO t2 VALUES (1, REPEAT('A', 16), REPEAT('B', 32));
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+INSERT INTO t2 (b) SELECT b from t2;
+--enable_query_log
+
+--disable_query_log
+let $size = 40;
+while ($size)
+{
+ let $j = 100 * $size;
+ eval delete from t2 where a between $j - 20 and $j;
+ dec $size;
+}
+--enable_query_log
+
+--source include/wait_innodb_all_purged.inc
+--source include/restart_mysqld.inc
+optimize table t2;
+
+select count(*) from t2;
+select count(*) from t2 force index(second);
+
+--let $second_before = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t2%' and index_name = 'second', Value, 1)
+
+--echo The page should have room for about 20 insertions
+insert into t2 values(1181, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1191, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1182, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1192, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1183, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1193, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1184, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1194, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1185, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1195, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1186, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1196, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1187, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1197, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1188, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1198, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1189, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1199, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1190, REPEAT('A', 16), REPEAT('B',32));
+insert into t2 values(1180, REPEAT('A', 16), REPEAT('B',32));
+
+--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t2%' and index_name = 'second', Value, 1)
+
+if ($second_before != $second_after) {
+ --echo Insertion caused page split on second, which should be avoided by innodb_defragment_fill_factor.
+}
+
+--echo # Insert more rows to cause a page split
+insert into t2 values (180, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (181, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (182, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (183, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (184, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (185, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (186, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (187, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (188, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (189, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (190, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (191, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (192, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (193, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (194, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (195, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (196, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (197, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (198, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (199, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (200, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (201, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (202, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (203, REPEAT('A', 16), REPEAT('B', 32));
+insert into t2 values (204, REPEAT('A', 16), REPEAT('B', 32));
+
+--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t2%' and index_name = 'second', Value, 1)
+
+if ($second_before == $second_after) {
+ --echo Too little space is reserved on second index.
+}
+
+DROP TABLE t2;
+
+--source include/wait_innodb_all_purged.inc
diff --git a/mysql-test/suite/innodb/t/innodb_defragment_small.test b/mysql-test/suite/innodb/t/innodb_defragment_small.test
new file mode 100644
index 00000000000..454333d6986
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment_small.test
@@ -0,0 +1,28 @@
+--source include/have_innodb.inc
+
+SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
+SET GLOBAL innodb_defragment = 1;
+
+# Small tests copied from innodb.innodb_defragment
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), KEY(a, b)) ENGINE=INNODB;
+OPTIMIZE TABLE t1;
+
+INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
+
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-12198 innodb_defragment=1 crashes server on
+--echo # OPTIMIZE TABLE when FULLTEXT index exists
+--echo #
+
+CREATE TABLE t1 (c TEXT, FULLTEXT KEY (c)) ENGINE=InnoDB;
+
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
+SET GLOBAL innodb_defragment = @innodb_defragment_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_force_pk.opt b/mysql-test/suite/innodb/t/innodb_force_pk.opt
new file mode 100644
index 00000000000..93d6393520c
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_force_pk.opt
@@ -0,0 +1 @@
+--innodb_force_primary_key=1
diff --git a/mysql-test/suite/innodb/t/innodb_force_pk.test b/mysql-test/suite/innodb/t/innodb_force_pk.test
new file mode 100644
index 00000000000..7dcab8eaead
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_force_pk.test
@@ -0,0 +1,49 @@
+-- source include/have_innodb.inc
+
+let $force_pk=`select @@innodb_force_primary_key`;
+
+-- error 1173
+create table t1(a integer) engine=innodb;
+show warnings;
+-- error 1173
+create table t1(a integer unique key) engine=innodb;
+show warnings;
+-- error 1173
+create table t1(a integer not null, b integer,
+unique key(a,b)) engine=innodb;
+show warnings;
+create table t1(a integer not null primary key) engine=innodb;
+show create table t1;
+show warnings;
+drop table t1;
+create table t1(a integer not null unique key) engine=innodb;
+show create table t1;
+show warnings;
+drop table t1;
+
+set global innodb_force_primary_key = 0;
+create table t1(a integer) engine=innodb;
+show warnings;
+insert into t1 values (1),(2),(3);
+
+set global innodb_force_primary_key = 1;
+select * from t1;
+-- error 1173
+create table t2(a integer) engine=innodb;
+show warnings;
+drop table t1;
+
+#
+# MDEV-8582: innodb_force_primary_key option does not
+# force PK or unique key
+#
+--error 1173
+create table t1 (i int not null, key(i)) engine=innodb;
+create table t1 (i int not null, unique key(i)) engine=innodb;
+show warnings;
+show create table t1;
+drop table t1;
+
+--disable_query_log
+eval set global innodb_force_primary_key=$force_pk;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_information_schema.test b/mysql-test/suite/innodb/t/innodb_information_schema.test
index 95b436d676c..da7ee016f29 100644
--- a/mysql-test/suite/innodb/t/innodb_information_schema.test
+++ b/mysql-test/suite/innodb/t/innodb_information_schema.test
@@ -5,6 +5,13 @@
-- source include/have_innodb.inc
+# lock data that is part of result set for this testcase
+# is retreived using buf_page_try_get. i.e only show if page
+# happen to be in buffer pool, with key rotation threads
+# chances are substantial that pages have been evicted and lock_data
+# get NULL
+-- source include/not_encrypted.inc
+
-- disable_query_log
-- disable_result_log
diff --git a/mysql-test/suite/innodb/t/innodb_information_schema_buffer.test b/mysql-test/suite/innodb/t/innodb_information_schema_buffer.test
index 6858b898649..5bfac22ec39 100644
--- a/mysql-test/suite/innodb/t/innodb_information_schema_buffer.test
+++ b/mysql-test/suite/innodb/t/innodb_information_schema_buffer.test
@@ -1,6 +1,11 @@
# Exercise the code path for INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS
# and INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
+# This test assumes that buffer pool is idle
+# with key rotation threads buffer pages gets evicted this
+# testcase gets flaky
+-- source include/not_encrypted.inc
+
-- source include/have_innodb.inc
-- disable_result_log
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt
new file mode 100644
index 00000000000..f543bd0da39
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt
@@ -0,0 +1,3 @@
+--innodb-page-size=32K
+--innodb_buffer_pool_size=32M
+--innodb-stats-persistent=ON
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test
new file mode 100644
index 00000000000..528a6b0390a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test
@@ -0,0 +1,400 @@
+--source include/have_innodb.inc
+--source include/have_innodb_32k.inc
+
+# Check page size 32k
+SELECT @@innodb_page_size;
+
+let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
+let $innodb_file_format = `SELECT @@innodb_file_format`;
+let $innodb_strict_mode = `SELECT @@innodb_strict_mode`;
+
+--disable_warnings
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=ON;
+SET @@innodb_strict_mode=ON;
+--enable_warnings
+
+SELECT @@innodb_file_format;
+SELECT @@innodb_file_per_table;
+SELECT @@innodb_strict_mode;
+
+# Check the error when the max record length > 16K for innodb_page_size=32k
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT= COMPACT;
+
+# Check the error when the max record length > 16K for innodb_page_size=32k
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT= DYNAMIC;
+show warnings;
+
+# Check the error when the max record length > 16K for innodb_page_size=32k
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+show warnings;
+
+# FIXED not supported
+-- error 1005
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=FIXED;
+show warnings;
+
+-- error 1005
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+show warnings;
+
+--disable_warnings
+SET @@innodb_strict_mode=OFF;
+SELECT @@innodb_strict_mode;
+--enable_warnings
+
+# Check the Warning | 139 | Row size too large (> 16318)
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPACT;
+
+# row size 16353 > 16K
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Warning | 139 | Row size too large (> 16318)
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPACT;
+
+# row size 16318 : expected to fail
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL);
+
+# row size 16317
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Error | 118 | Row size too large (> 16318)
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+
+# Check the Warning | 139 | Row size too large (> 16318)
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+
+# row size 16318 : expected to fail
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL);
+
+# row size 16317
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Warning | 139 | Row size too large (> 16318)
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+
+# 65 * 255 = 16575
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255));
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Warning | 139 | Row size too large (> 16318)
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+
+# row size 16315 : expected to fail
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',89),NULL);
+
+# row size 16314
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',88),NULL);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Warning | 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=COMPACT
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+
+DROP TABLE tab5;
+
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+FLUSH TABLE t;
+ANALYZE TABLE t;
+# retrieve the number of leaf pages
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+DROP TABLE t;
+
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+FLUSH TABLE t;
+ANALYZE TABLE t;
+# retrieve the number of leaf pages
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+DROP TABLE t;
+
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+FLUSH TABLE t;
+ANALYZE TABLE t;
+# retrieve the number of leaf pages
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+DROP TABLE t;
+
+# cleanup
+--disable_query_log
+--disable_warnings
+eval SET GLOBAL INNODB_FILE_FORMAT=$innodb_file_format;
+eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table;
+eval SET GLOBAL INNODB_STRICT_MODE=$innodb_strict_mode;
+--enable_warnings
+--enable_query_log
+
+--echo # Success
+
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt
new file mode 100644
index 00000000000..8c9b8ae1e48
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt
@@ -0,0 +1,3 @@
+--innodb-page-size=64K
+--innodb_buffer_pool_size=32M
+--innodb-stats-persistent=ON
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test
new file mode 100644
index 00000000000..3e529636968
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test
@@ -0,0 +1,604 @@
+--source include/have_innodb.inc
+--source include/have_innodb_64k.inc
+
+# Check page size 64k
+SELECT @@innodb_page_size;
+
+let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
+let $innodb_file_format = `SELECT @@innodb_file_format`;
+let $innodb_strict_mode = `SELECT @@innodb_strict_mode`;
+
+--disable_warnings
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=ON;
+SET @@innodb_strict_mode=ON;
+--enable_warnings
+
+SELECT @@innodb_file_format;
+SELECT @@innodb_file_per_table;
+SELECT @@innodb_strict_mode;
+
+# Check the error when the max record length > 32K for innodb_page_size=64k
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT= COMPACT;
+
+# Check the error when the max record length > 16K for innodb_page_size=64k
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT= DYNAMIC;
+
+# Check the error when the max record length > 16K for innodb_page_size=64k
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+show warnings;
+
+# FIXED not supported
+-- error 1005
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=FIXED;
+show warnings;
+
+-- error 1005
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+show warnings;
+
+--disable_warnings
+SET @@innodb_strict_mode=OFF;
+SELECT @@innodb_strict_mode;
+--enable_warnings
+
+# Check the Warning | 139 | Row size too large
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=COMPACT;
+
+# row size 32936 : should fail
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255),
+ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255),
+ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255),
+ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255),
+ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255),
+ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255),
+ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255),
+ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255),
+ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255),
+ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255),
+ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255),
+ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=COMPACT;
+
+# row size 16384 >= 16K : expected to fail
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+
+# row size 16383 < 16K : expected to pass
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Error | 118 | Row size too large (> 16318)
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+
+# Check the Warning | 139 | Row size too large (> 16318)
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255),
+ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255),
+ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255),
+ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255),
+ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255),
+ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255),
+ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255),
+ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255),
+ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255),
+ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255),
+ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255),
+ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=DYNAMIC;
+
+# row size 16384 >= 16K : expected to fail
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+
+# row size 16383 < 16K : expected to pass
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Warning | 139 | Row size too large
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255),
+col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255),
+col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255),
+col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255),
+col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255),
+col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255),
+col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255),
+col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255),
+col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255),
+col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255),
+col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255),
+ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255),
+ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255),
+ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255),
+ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255),
+ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255),
+ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255),
+ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255),
+ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255),
+ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255),
+ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255),
+ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+
+# 65 * 255 = 16575
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Warning | 139 | Row size too large
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255),
+ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255),
+ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255),
+ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255),
+ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255),
+ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255),
+ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255),
+ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255),
+ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255),
+ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255),
+ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255),
+ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255)
+)
+ENGINE = innodb ROW_FORMAT=REDUNDANT;
+
+# row size 16383 >= 16K-1 : expected to fail
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',27),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+
+# row size 16382 < 16K-1 : expected to pass
+INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),
+repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',26),NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL
+);
+
+SELECT * FROM tab5;
+DROP TABLE tab5;
+
+# Check the Warning | 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=COMPACT
+--replace_regex /> [0-9]+/> NNNN/
+CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255),
+col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255),
+col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255),
+col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255),
+col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255),
+col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255),
+col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255),
+col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255),
+col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255),
+col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255),
+col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255))
+ENGINE = innodb ROW_FORMAT=COMPRESSED;
+
+DROP TABLE tab5;
+
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+FLUSH TABLE t;
+ANALYZE TABLE t;
+# retrieve the number of leaf pages
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+DROP TABLE t;
+
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+FLUSH TABLE t;
+ANALYZE TABLE t;
+# retrieve the number of leaf pages
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+DROP TABLE t;
+
+CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+INSERT INTO t VALUES (REPEAT('a',16384));
+INSERT INTO t VALUES (REPEAT('a',32768));
+INSERT INTO t VALUES (REPEAT('a',65535));
+SELECT LENGTH(col) FROM t;
+FLUSH TABLE t;
+ANALYZE TABLE t;
+# retrieve the number of leaf pages
+SELECT stat_value FROM mysql.innodb_index_stats where database_name = 'test' and table_name= 't' and stat_name='n_leaf_pages';
+SELECT clustered_index_size from mysql.innodb_table_stats where database_name = 'test' and table_name= 't';
+DROP TABLE t;
+
+# cleanup
+--disable_query_log
+--disable_warnings
+eval SET GLOBAL INNODB_FILE_FORMAT=$innodb_file_format;
+eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table;
+eval SET GLOBAL INNODB_STRICT_MODE=$innodb_strict_mode;
+--enable_warnings
+--enable_query_log
+
+--echo # Success
+
diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test
index 73ca0ba51dd..8d5283a9ed5 100644
--- a/mysql-test/suite/innodb/t/innodb_multi_update.test
+++ b/mysql-test/suite/innodb/t/innodb_multi_update.test
@@ -29,7 +29,7 @@ select * from bug38999_2;
drop table bug38999_1,bug38999_2;
--echo #
---echo # Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb
+--echo # Bug#54475 improper error handling causes cascading crashing failures in innodb
--echo #
CREATE TABLE t1(f1 INT) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
diff --git a/mysql-test/suite/innodb/t/innodb_mutexes-master.opt b/mysql-test/suite/innodb/t/innodb_mutexes-master.opt
new file mode 100644
index 00000000000..493faf1903e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_mutexes-master.opt
@@ -0,0 +1 @@
+--innodb-mutexes \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_mutexes.test b/mysql-test/suite/innodb/t/innodb_mutexes.test
new file mode 100644
index 00000000000..3b6b949c25d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_mutexes.test
@@ -0,0 +1,66 @@
+--source include/have_innodb.inc
+
+connect(con1,localhost,root,,);
+connect(con2,localhost,root,,);
+connect(con3,localhost,root,,);
+
+create table t1(a int not null primary key, b int, c int,d CHAR(100)) engine=innodb;
+
+delimiter //;
+create procedure innodb_insert_proc (repeat_count int)
+begin
+ declare current_num int;
+ set current_num = 0;
+ while current_num < repeat_count do
+ insert into t1 values(current_num, RAND(), RAND(), substring(MD5(RAND()), -64));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(20000);
+commit;
+set autocommit=1;
+
+connection con1;
+send delete from t1 where a between 1000 and 1300;
+
+connection con2;
+send update t1 set b=b+1 where a between 2000 and 2600;
+
+connection con3;
+send insert into t1 select a+30000,b,c,d from t1 where a between 3000 and 4000;
+
+connection default;
+send delete from t1 where a between 6000 and 7000;
+
+connection con1;
+reap;
+
+connection con2;
+reap;
+
+connection con3;
+reap;
+
+connection default;
+reap;
+
+disconnect con1;
+disconnect con2;
+disconnect con3;
+
+# test that below does not crash, actual result is not
+# repeatable
+--disable_query_log
+--disable_result_log
+--disable_warnings
+select * from information_schema.innodb_mutexes;
+--enable_query_log
+--enable_result_log
+--enable_warnings
+
+drop procedure innodb_insert_proc;
+drop table t1; \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt
index fae32059249..39b205c9b68 100644
--- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt
@@ -1,2 +1,2 @@
--innodb-file-per-table
-
+--skip-innodb-doublewrite
diff --git a/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt
new file mode 100644
index 00000000000..c8a96d2fe93
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt
@@ -0,0 +1,67 @@
+--loose-skip-innodb
+--loose-innodb_trx
+--loose-innodb_locks
+--loose-innodb_lock_waits
+--loose-innodb_cmp
+--loose-innodb_cmp_reset
+--loose-innodb_cmp_per_index
+--loose-innodb_cmp_per_index_reset
+--loose-innodb_cmpmem
+--loose-innodb_cmpmem_reset
+--loose-innodb_metrics
+--loose-innodb_ft_default_stopword
+--loose-innodb_ft_deleted
+--loose-innodb_ft_being_deleted
+--loose-innodb_ft_index_cache
+--loose-innodb_ft_index_table
+--loose-innodb_ft_config
+--loose-innodb_buffer_page
+--loose-innodb_buffer_page_lru
+--loose-innodb_buffer_stats
+--loose-innodb_sys_tables
+--loose-innodb_sys_tablestats
+--loose-innodb_sys_indexes
+--loose-innodb_sys_columns
+--loose-innodb_sys_fields
+--loose-innodb_sys_foreign
+--loose-innodb_sys_foreign_cols
+--loose-innodb_sys_tablespaces
+--loose-innodb_sys_datafiles
+--loose-innodb_changed_pages
+--loose-innodb_tablespaces_encryption
+--loose-innodb_trx
+--loose-innodb_locks
+--loose-innodb_lock_waits
+--loose-innodb_cmp
+--loose-innodb_cmp_reset
+--loose-innodb_cmp_per_index
+--loose-innodb_cmp_per_index_reset
+--loose-innodb_cmpmem
+--loose-innodb_cmpmem_reset
+--loose-innodb_metrics
+--loose-innodb_ft_default_stopword
+--loose-innodb_ft_deleted
+--loose-innodb_ft_being_deleted
+--loose-innodb_ft_index_cache
+--loose-innodb_ft_index_table
+--loose-innodb_ft_config
+--loose-innodb_buffer_page
+--loose-innodb_buffer_page_lru
+--loose-innodb_buffer_stats
+--loose-innodb_sys_tables
+--loose-innodb_sys_tablestats
+--loose-innodb_sys_indexes
+--loose-innodb_sys_columns
+--loose-innodb_sys_fields
+--loose-innodb_sys_foreign
+--loose-innodb_sys_foreign_cols
+--loose-innodb_sys_tablespaces
+--loose-innodb_sys_datafiles
+--loose-innodb_changed_pages
+--loose-innodb_tablespaces_encryption
+--loose-innodb_tablespaces_scrubbing
+--loose-innodb_mutexes
+--loose-innodb_sys_semaphore_waits
+--loose-innodb_tablespaces_scrubbing
+--loose-innodb_mutexes
+--loose-innodb_sys_semaphore_waits
diff --git a/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test
new file mode 100644
index 00000000000..73cd8a26f6f
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test
@@ -0,0 +1,36 @@
+--source include/not_embedded.inc
+
+select * from information_schema.innodb_trx;
+select * from information_schema.innodb_locks;
+select * from information_schema.innodb_lock_waits;
+select * from information_schema.innodb_cmp;
+select * from information_schema.innodb_cmp_reset;
+select * from information_schema.innodb_cmp_per_index;
+select * from information_schema.innodb_cmp_per_index_reset;
+select * from information_schema.innodb_cmpmem;
+select * from information_schema.innodb_cmpmem_reset;
+select * from information_schema.innodb_metrics;
+select * from information_schema.innodb_ft_default_stopword;
+select * from information_schema.innodb_ft_deleted;
+select * from information_schema.innodb_ft_being_deleted;
+select * from information_schema.innodb_ft_index_cache;
+select * from information_schema.innodb_ft_index_table;
+select * from information_schema.innodb_ft_config;
+select * from information_schema.innodb_buffer_page;
+select * from information_schema.innodb_buffer_page_lru;
+--error 0,1109
+select * from information_schema.innodb_buffer_stats;
+select * from information_schema.innodb_sys_tables;
+select * from information_schema.innodb_sys_tablestats;
+select * from information_schema.innodb_sys_indexes;
+select * from information_schema.innodb_sys_columns;
+select * from information_schema.innodb_sys_fields;
+select * from information_schema.innodb_sys_foreign;
+select * from information_schema.innodb_sys_foreign_cols;
+select * from information_schema.innodb_sys_tablespaces;
+select * from information_schema.innodb_sys_datafiles;
+select * from information_schema.innodb_changed_pages;
+select * from information_schema.innodb_tablespaces_encryption;
+select * from information_schema.innodb_tablespaces_scrubbing;
+select * from information_schema.innodb_mutexes;
+select * from information_schema.innodb_sys_semaphore_waits;
diff --git a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
index de6026a23aa..c932e45591d 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
@@ -8,6 +8,7 @@
# functionality tested here is not related to the page size, so we only
# test with 16k page size.
-- source include/have_innodb_16k.inc
+-- source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Error: Table \"mysql\".\"innodb_index_stats\" not found");
call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table");
diff --git a/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test b/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test
index 4a3f7527c09..f69988175ab 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test
@@ -7,6 +7,8 @@
# functionality tested here is not related to the page size, so we only
# test with 16k page size.
-- source include/have_innodb_16k.inc
+# server restart
+-- source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Error: Table \"mysql\".\"innodb_index_stats\" not found");
call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table");
@@ -43,3 +45,6 @@ FROM information_schema.tables WHERE table_name = 'test_ps_fetch_corrupted';
ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats;
DROP TABLE test_ps_fetch_corrupted;
+
+# force server restart to clean up log from above error
+--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test b/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test
index dbafb33965c..b06abd307da 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test
@@ -4,7 +4,7 @@
-- source include/have_innodb.inc
-call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table*");
+call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table *");
-- vertical_results
diff --git a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt
new file mode 100644
index 00000000000..22272485540
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits-master.opt
@@ -0,0 +1,3 @@
+--innodb-fatal-semaphore-wait-threshold=1
+--innodb-sys-semaphore-waits=1
+--innodb-instrument-semaphores=1
diff --git a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
new file mode 100644
index 00000000000..800199dbc54
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
@@ -0,0 +1,119 @@
+--source include/have_innodb.inc
+--source include/not_windows.inc
+--source include/not_valgrind.inc
+--source include/not_embedded.inc
+# DEBUG_SYNC must be compiled in.
+--source include/have_debug_sync.inc
+
+--echo # Establish connection con1 (user=root)
+connect (con1,localhost,root,,);
+--echo # Establish connection con2 (user=root)
+connect (con2,localhost,root,,);
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+--echo # Switch to connection con1
+connection con1;
+eval create table t1 (id integer, x integer) engine = InnoDB;
+insert into t1 values(0, 0);
+
+# Enable the debug injection.
+set DEBUG_DBUG='+d,fatal-semaphore-timeout';
+set autocommit=0;
+
+# The following query will hang for an hour since the debug injection
+# code will sleep an hour after holding the lock table mutex
+--echo # Sending query on con1,
+--echo # the session will hold lock table mutex and sleep
+--send
+SELECT * from t1 where id = 0 FOR UPDATE;
+
+# To make sure con1 holding the lock table mutex and sleeping
+--sleep 2
+
+--echo # Switch to connection con2
+connection con2;
+set autocommit=0;
+
+# The following query will be blocked on the lock table mutex held by
+# con1 so it will be put into sync array.
+--echo # Sending query on con2,
+--echo # the session will be blocked on the lock table mutex and
+--echo # thus be put into sync arry
+--send
+SELECT * from t1 where id = 0 FOR UPDATE;
+
+# Waitting for mysqld to abort due to fatal semaphore timeout.
+# Please note that, in the master.opt file, the fatal timeout
+# was set to 1 second, but in mysqld debug mode, this timeout
+# value will be timed 10 because UNIV_DEBUG_VALGRIND is set
+# (see sync_array_print_long_waits_low() in storage/innobase/sync/sync0arr.cc)
+# so the actual timeout will be 1 * 10 = 10 seconds. Besides,
+# mysqld will abort after detecting this fatal timeout 10 times in
+# a loop with interval of 1 second (see srv_error_monitor_thread
+# thread in torage/innobase/srv/srv0srv.cc), so mysqld will abort
+# in 1 * 10 + 1 * 10 = 20 seconds after con2 being blocked on
+# the lock table mutex.
+#
+# P.S. the default fatal sempahore timeout is 600 seconds,
+# so mysqld will abort after 600 * 10 + 1 * 10 = 6010 seconds
+# in debug mode and 600 + 1 * 10 = 610 seconds in release mode.
+
+--echo # Switched to the default connection
+connection default;
+
+--disable_result_log
+--disable_query_log
+
+# Since this test generates lot of errors in log, suppress checking errors
+call mtr.add_suppression(".*");
+
+# The crash is expected
+exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+
+--echo # Waitting for mysqld to crash
+
+# It will take 20 seconds to detect the long semaphore and mysqld to abort.
+# This test will be treated as pass as long as mysqld crash/restart is dectected
+# in 80 seconds.
+let $counter= 80;
+let $mysql_errno= 0;
+while (!$mysql_errno)
+{
+ --error 0,1040,1053,2002,2003,2006,2013
+ show status;
+
+ --error 0,1040,1053,2002,2003,2006,2013
+ select * from information_schema.innodb_sys_semaphore_waits;
+
+ dec $counter;
+ if (!$counter)
+ {
+ # This will fail this test.
+ --die Server failed to dissapear
+ }
+ --sleep 1
+}
+
+--echo # Mysqld crash was detected
+--echo # Waitting for reconnect after mysqld restarts
+
+enable_reconnect;
+connection default;
+
+--exec echo "restart:--log-error=$error_log" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Call script that will poll the server waiting for it to be back online again
+source include/wait_until_connected_again.inc;
+
+--echo # Reconnected after mysqld was successfully restarted
+
+--echo # Cleaning up before exit
+--disable_warnings
+set DEBUG_DBUG=NULL;
+drop table if exists t1;
+--enable_warnings
+
+--echo # Clean exit
diff --git a/mysql-test/suite/innodb/t/innodb_uninstall.test b/mysql-test/suite/innodb/t/innodb_uninstall.test
index 34fc8345a02..1b65db8a28d 100644
--- a/mysql-test/suite/innodb/t/innodb_uninstall.test
+++ b/mysql-test/suite/innodb/t/innodb_uninstall.test
@@ -9,7 +9,13 @@ if (!$HA_INNODB_SO) {
# MDEV-8474: InnoDB sets per-connection data unsafely
# Below test caused hang
#
+# When mysqld is built with wsrep patch (WITH_WSREP=ON),
+# the following install command emits a warning about
+# server unable to enable tc-log at runtime.
+disable_warnings;
install plugin innodb soname 'ha_innodb';
+enable_warnings;
+
create table t1(a int not null primary key) engine=innodb;
connect (con1, localhost, root);
@@ -30,15 +36,17 @@ reap;
--source include/restart_mysqld.inc
-drop table t1;
-
#
# Another test that caused hang.
#
connect (con1, localhost, root);
connection con1;
+disable_warnings;
install plugin innodb soname 'ha_innodb';
+enable_warnings;
+
+drop table t1;
create table t2(a int not null primary key) engine=innodb;
insert into t2 values(1);
drop table t2;
diff --git a/mysql-test/suite/innodb/t/innodb_zip_innochecksum.opt b/mysql-test/suite/innodb/t/innodb_zip_innochecksum.opt
new file mode 100644
index 00000000000..f8c8c9d247d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_zip_innochecksum.opt
@@ -0,0 +1,4 @@
+--skip-innodb-doublewrite
+--innodb-file-per-table
+--innodb-file-format=Barracuda
+
diff --git a/mysql-test/suite/innodb/t/innodb_zip_innochecksum.test b/mysql-test/suite/innodb/t/innodb_zip_innochecksum.test
new file mode 100644
index 00000000000..63a4b418677
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_zip_innochecksum.test
@@ -0,0 +1,239 @@
+#************************************************************
+# WL6045:Improve Innochecksum
+#************************************************************
+--source include/innodb_page_size_small.inc
+--source include/no_valgrind_without_big.inc
+# Embedded server does not support crashing.
+--source include/not_embedded.inc
+
+# Avoid CrashReporter popup on Mac.
+--source include/not_crashrep.inc
+
+--echo # Set the environmental variables
+let MYSQLD_BASEDIR= `SELECT @@basedir`;
+let MYSQLD_DATADIR= `SELECT @@datadir`;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
+call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
+call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
+
+CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
+CREATE INDEX idx1 ON tab1(c2(10));
+INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+insert into t1 values(1,"i");
+insert into t1 values(2,"am");
+insert into t1 values(3,"compressed table");
+
+--echo # Shutdown the Server
+--source include/shutdown_mysqld.inc
+--echo # Server Default checksum = innodb
+
+#
+# Not repeatable with --parallel= >1
+#
+#--echo [1a]: check the innochecksum when file doesn't exists
+#--error 1
+#--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/aa.ibd 2> $SEARCH_FILE
+#let SEARCH_PATTERN= Error: $MYSQLD_DATADIR/test/aa.ibd cannot be found;
+#--source include/search_pattern_in_file.inc
+
+--echo [1b]: check the innochecksum without --strict-check
+--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/tab1.ibd
+
+--echo [2]: check the innochecksum with full form --strict-check=crc32
+--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/tab1.ibd
+
+--echo [3]: check the innochecksum with short form -C crc32
+--exec $INNOCHECKSUM -C crc32 $MYSQLD_DATADIR/test/tab1.ibd
+
+--echo [4]: check the innochecksum with --no-check ignores algorithm check, warning is expected
+--error 1
+--exec $INNOCHECKSUM --no-check $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: --no-check must be associated with --write option.;
+--source include/search_pattern_in_file.inc
+
+--echo [5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected
+--error 1
+--exec $INNOCHECKSUM -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: --no-check must be associated with --write option.;
+--source include/search_pattern_in_file.inc
+
+--echo [6]: check the innochecksum with full form strict-check & no-check , an error is expected
+--error 1
+--exec $INNOCHECKSUM --strict-check=innodb --no-check $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: --strict-check option cannot be used together with --no-check option.;
+--source include/search_pattern_in_file.inc
+
+--echo [7]: check the innochecksum with short form strict-check & no-check , an error is expected
+--error 1
+--exec $INNOCHECKSUM -C innodb -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: --strict-check option cannot be used together with --no-check option.;
+--source include/search_pattern_in_file.inc
+
+--echo [8]: check the innochecksum with short & full form combination
+--echo # strict-check & no-check, an error is expected
+--error 1
+--exec $INNOCHECKSUM --strict-check=innodb -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: --strict-check option cannot be used together with --no-check option.;
+--source include/search_pattern_in_file.inc
+
+--echo [9]: check the innochecksum with full form --strict-check=innodb
+# Server Default checksum = crc32
+--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+
+--echo [10]: check the innochecksum with full form --strict-check=none
+--echo # when server Default checksum=crc32
+--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+
+--echo [11]: check the innochecksum with short form -C innodb
+--echo # when server Default checksum=crc32
+--exec $INNOCHECKSUM -C innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+
+--echo [12]: check the innochecksum with short form -C none
+--echo # when server Default checksum=crc32
+--exec $INNOCHECKSUM -C none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+
+--echo [13]: check strict-check with invalid values
+--error 1
+--exec $INNOCHECKSUM --strict-check=strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'strict_innodb\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -C strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'strict_innodb\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --strict-check=strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'strict_crc32\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -C strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'strict_crc32\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --strict-check=strict_none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'strict_none\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -C strict_none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'strict_none\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --strict-check=InnoBD $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'InnoBD\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -C InnoBD $MYSQLD_DATADIR/test/tab1.ibd 2>$SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'InnoBD\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --strict-check=crc $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'crc\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --strict-check=no $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error while setting value \'no\' to \'strict-check\';
+--source include/search_pattern_in_file.inc
+
+--echo [14a]: when server default checksum=crc32 rewrite new checksum=crc32 with innochecksum
+--echo # Also check the long form of write option.
+--exec $INNOCHECKSUM --strict-check=crc32 --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --strict-check=crc32 --write=crc32 $MYSQLD_DATADIR/test/t1.ibd
+# Rewrite done, verify with --strict-check=crc32
+--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/t1.ibd
+
+--echo [14b]: when server default checksum=crc32 rewrite new checksum=innodb with innochecksum
+--echo # Also check the long form of write option.
+--exec $INNOCHECKSUM --no-check --write=innodb $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --strict-check=crc32 --write=innodb $MYSQLD_DATADIR/test/t1.ibd
+# Rewrite done, verify with --strict-check=innodb
+--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd
+
+--echo # start the server with innodb_checksum_algorithm=InnoDB
+--let $restart_parameters= --innodb_checksum_algorithm=innodb
+--source include/start_mysqld.inc
+
+INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
+SELECT c1,c2 FROM tab1 order by c1,c2;
+
+--echo # Stop the server
+--source include/shutdown_mysqld.inc
+
+--echo [15]: when server default checksum=crc32 rewrite new checksum=none with innochecksum
+--echo # Also check the short form of write option.
+--exec $INNOCHECKSUM --no-check -w none $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --no-check -w none $MYSQLD_DATADIR/test/t1.ibd
+# Rewrite done, verify with --strict-check=none
+--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/t1.ibd
+
+--echo # Start the server with checksum algorithm=none
+--let $restart_parameters= --innodb_checksum_algorithm=none
+--source include/start_mysqld.inc
+
+INSERT INTO tab1 VALUES(3, 'Innochecksum None');
+SELECT c1,c2 FROM tab1 order by c1,c2;
+DROP TABLE t1;
+
+--echo # Stop the server
+--source include/shutdown_mysqld.inc
+
+--echo [16]: rewrite into new checksum=crc32 with innochecksum
+--exec $INNOCHECKSUM --no-check --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
+
+--echo # Restart the DB server with innodb_checksum_algorithm=crc32
+--let $restart_parameters= --innodb_checksum_algorithm=crc32
+--source include/start_mysqld.inc
+
+SELECT * FROM tab1;
+DELETE FROM tab1 where c1=3;
+SELECT c1,c2 FROM tab1 order by c1,c2;
+
+--echo # Stop server
+--source include/shutdown_mysqld.inc
+
+--echo [17]: rewrite into new checksum=InnoDB
+--exec $INNOCHECKSUM --no-check --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
+
+--echo # Restart the DB server with innodb_checksum_algorithm=InnoDB
+--let $restart_parameters= --innodb_checksum_algorithm=innodb
+--source include/start_mysqld.inc
+
+DELETE FROM tab1 where c1=2;
+SELECT * FROM tab1;
+
+--echo # Stop server
+--source include/shutdown_mysqld.inc
+
+--echo [18]:check Innochecksum with invalid write options
+--error 1
+--exec $INNOCHECKSUM --no-check --write=strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN=Error while setting value \'strict_crc32\' to \'write\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --no-check --write=strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN=Error while setting value \'strict_innodb\' to \'write\';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --no-check --write=crc23 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN=Error while setting value \'crc23\' to \'write\';
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+
+# Cleanup
+--let $restart_parameters=
+--source include/start_mysqld.inc
+
+DROP TABLE tab1;
diff --git a/mysql-test/suite/innodb/t/innodb_zip_innochecksum2.opt b/mysql-test/suite/innodb/t/innodb_zip_innochecksum2.opt
new file mode 100644
index 00000000000..39d5c6d577c
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_zip_innochecksum2.opt
@@ -0,0 +1,4 @@
+--skip-innodb-doublewrite
+--innodb-file-per-table
+--innodb-file-format=Barracuda
+--innodb-change-buffering=none
diff --git a/mysql-test/suite/innodb/t/innodb_zip_innochecksum2.test b/mysql-test/suite/innodb/t/innodb_zip_innochecksum2.test
new file mode 100644
index 00000000000..330bb81ba75
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_zip_innochecksum2.test
@@ -0,0 +1,118 @@
+#************************************************************
+# WL6045:Improve Innochecksum
+#************************************************************
+--source include/innodb_page_size_small.inc
+--source include/have_debug.inc
+--source include/no_valgrind_without_big.inc
+# Avoid CrashReporter popup on Mac.
+--source include/not_crashrep.inc
+
+--source include/not_embedded.inc
+-- source include/big_test.inc
+
+--disable_query_log
+# This warning occurs due to small buffer pool size(i.e. 8MB). It doesn't occur
+# with --mysqld=--innodb_buffer_pool_size=10MB
+call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.*");
+--enable_query_log
+let MYSQLD_BASEDIR= `SELECT @@basedir`;
+let MYSQLD_DATADIR= `SELECT @@datadir`;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
+
+SET GLOBAL innodb_compression_level=0;
+SELECT @@innodb_compression_level;
+
+CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
+let $i=10;
+while ($i > 0) {
+ INSERT INTO t1 SELECT * from t1;
+ dec $i;
+}
+
+--echo # stop the server
+--source include/shutdown_mysqld.inc
+
+# Page_type_dump for t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $INNOCHECKSUM -v --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/t1.ibd
+--file_exists $MYSQLTEST_VARDIR/tmp/dump.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
+
+--echo [1]:# check the both short and long options for "help"
+--exec $INNOCHECKSUM --help $MYSQLD_DATADIR/test/t1.ibd > $MYSQLTEST_VARDIR/tmp/help_output_long.txt
+--exec $INNOCHECKSUM -I $MYSQLD_DATADIR/test/t1.ibd > $MYSQLTEST_VARDIR/tmp/help_output_short.txt
+--diff_files $MYSQLTEST_VARDIR/tmp/help_output_long.txt $MYSQLTEST_VARDIR/tmp/help_output_short.txt
+
+--echo [2]:# Run the innochecksum when file isn't provided.
+--echo # It will print the innochecksum usage similar to --help option.
+--error 1
+--exec $INNOCHECKSUM > $MYSQLTEST_VARDIR/tmp/usage.txt
+--diff_files $MYSQLTEST_VARDIR/tmp/help_output_long.txt $MYSQLTEST_VARDIR/tmp/usage.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/usage.txt
+
+perl;
+use strict;
+use warnings;
+use File::Copy;
+my $dir = $ENV{'MYSQLTEST_VARDIR'};
+my $file= 'help_output_long.txt';
+# open file in write mode
+open IN_FILE,"<", "$dir/tmp/$file" or die $!;
+open OUT_FILE, ">", "$dir/tmp/tmpfile" or die $!;
+while(<IN_FILE>) {
+ unless ($_=~ /^debug.*$/ || $_=~ /\-#, \-\-debug.*$/ || $_=~ /http:.*html/) {
+ $_=~ s/^\S*innochecksum.+Ver.+[0-9]*\.[0-9]*\.[0-9]*.+$/innochecksum Ver #.#.#/g;
+ $_=~ s/(Copyright\s\(c\))\s([0-9]*),\s([0-9]*)(.*)/$1 YEAR, YEAR $4/g;
+ $_=~ s/Usage:.*\[-c/Usage: innochecksum [-c/g;
+ print OUT_FILE $_;
+ }
+}
+close(IN_FILE);
+close(OUT_FILE);
+# move the new content from tmp file to the orginal file.
+move ("$dir/tmp/tmpfile", "$dir/tmp/$file");
+EOF
+
+--cat_file $MYSQLTEST_VARDIR/tmp/help_output_long.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/help_output_long.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/help_output_short.txt
+
+--echo [3]:# check the both short and long options for "count" and exit
+--replace_regex /[0-9]+/#/
+--exec $INNOCHECKSUM --count $MYSQLD_DATADIR/test/t1.ibd
+--replace_regex /[0-9]+/#/
+--exec $INNOCHECKSUM -c $MYSQLD_DATADIR/test/t1.ibd
+
+--echo [4]:# Print the version of innochecksum and exit
+--replace_regex /.*innochecksum.*Ver.*[0-9]*.[0-9]*.[0-9]*.*/innochecksum Ver #.#.#/
+--exec $INNOCHECKSUM -V $MYSQLD_DATADIR/test/t1.ibd
+
+--echo # Restart the DB server
+--source include/start_mysqld.inc
+
+DROP TABLE t1;
+
+--echo [5]:# Check the innochecksum for compressed table t1 with different key_block_size
+--echo # Test for KEY_BLOCK_SIZE=1
+--let $size=1
+--source ../include/innodb-wl6045.inc
+
+--echo # Test for KEY_BLOCK_SIZE=2
+--let $size=2
+--source ../include/innodb-wl6045.inc
+
+--echo # Test for for KEY_BLOCK_SIZE=4
+--let $size=4
+--source ../include/innodb-wl6045.inc
+
+set innodb_strict_mode=off;
+--echo # Test for for KEY_BLOCK_SIZE=8
+--let $size=8
+--source ../include/innodb-wl6045.inc
+
+set innodb_strict_mode=off;
+--echo # Test for KEY_BLOCK_SIZE=16
+--let $size=16
+--source ../include/innodb-wl6045.inc
+--echo # Test[5] completed
diff --git a/mysql-test/suite/innodb/t/innodb_zip_innochecksum3.opt b/mysql-test/suite/innodb/t/innodb_zip_innochecksum3.opt
new file mode 100644
index 00000000000..828a7cd67c8
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_zip_innochecksum3.opt
@@ -0,0 +1,2 @@
+--innodb-file-per-table
+--innodb-file-format=Barracuda
diff --git a/mysql-test/suite/innodb/t/innodb_zip_innochecksum3.test b/mysql-test/suite/innodb/t/innodb_zip_innochecksum3.test
new file mode 100644
index 00000000000..dab10dcc997
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_zip_innochecksum3.test
@@ -0,0 +1,406 @@
+#************************************************************
+# WL6045:Improve Innochecksum
+#************************************************************
+--source include/innodb_page_size_small.inc
+
+--source include/no_valgrind_without_big.inc
+
+# Embedded server does not support crashing.
+--source include/not_embedded.inc
+
+# Avoid CrashReporter popup on Mac.
+--source include/not_crashrep.inc
+
+--echo # Set the environmental variables
+let MYSQLD_BASEDIR= `SELECT @@basedir`;
+let MYSQLD_DATADIR= `SELECT @@datadir`;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
+
+call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
+call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to.*");
+
+--echo [1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
+
+CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
+linestring_key GEOMETRY NOT NULL,
+linestring_nokey GEOMETRY NOT NULL)
+ENGINE=InnoDB ;
+
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) '));
+
+CREATE INDEX linestring_index ON tab1(linestring_nokey(5));
+ALTER TABLE tab1 ADD KEY (linestring_key(5));
+
+--echo # create a compressed table
+CREATE TABLE tab2(col_1 CHAR (255) ,
+col_2 VARCHAR (255), col_3 longtext,
+col_4 longtext,col_5 longtext,
+col_6 longtext , col_7 int )
+engine = innodb row_format=compressed key_block_size=4;
+
+CREATE INDEX idx1 ON tab2(col_3(10));
+CREATE INDEX idx2 ON tab2(col_4(10));
+CREATE INDEX idx3 ON tab2(col_5(10));
+
+# load the with repeat function
+SET @col_1 = repeat('a', 5);
+SET @col_2 = repeat('b', 20);
+SET @col_3 = repeat('c', 100);
+SET @col_4 = repeat('d', 100);
+SET @col_5 = repeat('e', 100);
+SET @col_6 = repeat('f', 100);
+
+# insert 5 records
+let $i = 5;
+while ($i) {
+ eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+ VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
+ dec $i;
+}
+
+--disable_result_log
+SELECT * FROM tab2 ORDER BY col_7;
+
+--echo # stop the server
+--source include/shutdown_mysqld.inc
+
+--echo [1(a)]: Rewrite into new checksum=InnoDB for all *.ibd file and ibdata1
+--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/test/tab2.ibd
+--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/ibdata1
+perl;
+foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
+ system("$ENV{INNOCHECKSUM} --no-check --write=InnoDB $_")
+}
+EOF
+
+--echo : start the server with innodb_checksum_algorithm=strict_innodb
+--let $restart_parameters= --innodb_checksum_algorithm=strict_innodb
+--source include/start_mysqld.inc
+
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (2, ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'), ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'));
+
+# load the with repeat function
+SET @col_1 = repeat('a', 5);
+SET @col_2 = repeat('b', 20);
+SET @col_3 = repeat('c', 100);
+SET @col_4 = repeat('d', 100);
+SET @col_5 = repeat('e', 100);
+SET @col_6 = repeat('f', 100);
+
+# check the table status is GOOD with DML
+let $i = 6;
+eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
+
+-- disable_result_log
+SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
+FROM tab1 ORDER BY pk;
+
+-- disable_result_log
+SELECT * FROM tab2 ORDER BY col_7;
+
+--echo # stop the server
+--source include/shutdown_mysqld.inc
+
+--echo [1(b)]: Rewrite into new checksum=crc32 for all *.ibd file and ibdata1
+--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/test/tab2.ibd
+--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/ibdata1
+perl;
+foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
+ system("$ENV{INNOCHECKSUM} --no-check --write=crc32 $_")
+}
+EOF
+
+--echo # start the server with innodb_checksum_algorithm=strict_crc32
+--let $restart_parameters= --innodb_checksum_algorithm=strict_crc32
+--source include/start_mysqld.inc
+
+# check the table status is GOOD with DML
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (3, ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'),
+ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'));
+
+# load the with repeat function
+SET @col_1 = repeat('g', 5);
+SET @col_2 = repeat('h', 20);
+SET @col_3 = repeat('i', 100);
+SET @col_4 = repeat('j', 100);
+SET @col_5 = repeat('k', 100);
+SET @col_6 = repeat('l', 100);
+
+# check the table status is GOOD with DML
+let $i = 7;
+eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
+
+# check the records from table
+-- disable_result_log
+SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
+FROM tab1 ORDER BY pk;
+
+-- disable_result_log
+SELECT * FROM tab2 ORDER BY col_7;
+
+--echo # stop the server
+--source include/shutdown_mysqld.inc
+
+--echo [1(c)]: Rewrite into new checksum=none for all *.ibd file and ibdata1
+--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/tab2.ibd
+--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/ibdata1
+perl;
+foreach (glob("$ENV{MYSQLD_DATADIR}/undo*")) {
+ system("$ENV{INNOCHECKSUM} --no-check --write=NONE $_")
+}
+foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
+ system("$ENV{INNOCHECKSUM} --no-check --write=NONE $_")
+}
+EOF
+
+--let $restart_parameters= --innodb_checksum_algorithm=strict_none
+--source include/start_mysqld.inc
+--let $restart_parameters=
+# check the table status is GOOD with DML
+INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
+VALUES (4, ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '), ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '));
+
+# load the with repeat function
+SET @col_1 = repeat('m', 5);
+SET @col_2 = repeat('n', 20);
+SET @col_3 = repeat('o', 100);
+SET @col_4 = repeat('p', 100);
+SET @col_5 = repeat('q', 100);
+SET @col_6 = repeat('r', 100);
+
+# check the table status is GOOD with DML
+let $i = 8;
+eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
+VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
+
+# check the records from table
+-- disable_result_log
+SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
+FROM tab1 ORDER BY pk;
+
+--disable_result_log
+SELECT * FROM tab2 ORDER BY col_7;
+--enable_result_log
+
+--echo # stop the server
+--source include/shutdown_mysqld.inc
+
+--echo [2]: Check the page type summary with shortform for tab1.ibd
+--replace_regex /File.*.ibd/File::tab1.ibd/ /[0-9]+/#/
+--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/tab1.ibd 2>$MYSQLTEST_VARDIR/tmp/page_summary_short.txt
+
+--echo [3]: Check the page type summary with longform for tab1.ibd
+--replace_regex /File.*.ibd/File::tab1.ibd/ /[0-9]+/#/
+--exec $INNOCHECKSUM --page-type-summary $MYSQLD_DATADIR/test/tab1.ibd 2>$MYSQLTEST_VARDIR/tmp/page_summary_long.txt
+
+--remove_file $MYSQLTEST_VARDIR/tmp/page_summary_short.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/page_summary_long.txt
+--echo [4]: Page type dump for with longform for tab1.ibd
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $INNOCHECKSUM --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/tab1.ibd
+
+perl;
+use strict;
+use warnings;
+use File::Copy;
+my $dir = $ENV{'MYSQLTEST_VARDIR'};
+opendir(DIR, $dir) or die $!;
+my $file= 'dump.txt';
+# open file in write mode
+open IN_FILE,"<", "$dir/tmp/$file" or die $!;
+open OUT_FILE, ">", "$dir/tmp/innochecksum_3_tempfile" or die $!;
+while(<IN_FILE>)
+{
+ # Replace the intergers to # and complete file path to file name only.
+ $_=~ s/Filename.+/Filename::tab1.ibd/g;
+ $_=~ s/\d+/#/g;
+ print OUT_FILE $_;
+}
+close(IN_FILE);
+close(OUT_FILE);
+# move the new content from tmp file to the orginal file.
+move ("$dir/tmp/innochecksum_3_tempfile", "$dir/tmp/$file");
+closedir(DIR);
+EOF
+
+--echo # Print the contents stored in dump.txt
+cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
+--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
+
+--echo # Variables used by page type dump for ibdata1
+--exec $INNOCHECKSUM -v --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/ibdata1 > $MYSQLTEST_VARDIR/tmp/page_verbose_summary.txt
+
+--file_exists $MYSQLTEST_VARDIR/tmp/dump.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
+
+perl;
+use strict;
+use warnings;
+use File::Copy;
+my $dir = $ENV{'MYSQLTEST_VARDIR'};
+opendir(DIR, $dir) or die $!;
+my $file= 'page_verbose_summary.txt';
+# open file in write mode
+open IN_FILE,"<", "$dir/tmp/$file" or die $!;
+open OUT_FILE, ">", "$dir/tmp/innochecksum_3_tempfile" or die $!;
+while(<IN_FILE>)
+{
+ # Replace complete file path to file name only.
+ $_=~ s/$dir/MYSQLTEST_VARDIR/;
+ # Remove debug option, which is not in all builds
+ next if (/debug/);
+ print OUT_FILE $_;
+}
+close(IN_FILE);
+close(OUT_FILE);
+# move the new content from tmp file to the orginal file.
+move ("$dir/tmp/innochecksum_3_tempfile", "$dir/tmp/$file");
+closedir(DIR);
+EOF
+
+cat_file $MYSQLTEST_VARDIR/tmp/page_verbose_summary.txt;
+--remove_file $MYSQLTEST_VARDIR/tmp/page_verbose_summary.txt
+
+--echo [5]: Page type dump for with shortform for tab1.ibd
+--exec $INNOCHECKSUM -D $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/tab1.ibd
+
+perl;
+use strict;
+use warnings;
+use File::Copy;
+my $dir = $ENV{'MYSQLTEST_VARDIR'};
+opendir(DIR, $dir) or die $!;
+my $file= 'dump.txt';
+# open file in write mode
+open IN_FILE,"<", "$dir/tmp/$file" or die $!;
+open OUT_FILE, ">", "$dir/tmp/innochecksum_3_tempfile" or die $!;
+while(<IN_FILE>)
+{
+ # Replace the intergers to # and complete file path to file name only.
+ $_=~ s/Filename.+/Filename::tab1.ibd/g;
+ $_=~ s/\d+/#/g;
+ print OUT_FILE $_;
+}
+close(IN_FILE);
+close(OUT_FILE);
+# move the new content from tmp file to the orginal file.
+move ("$dir/tmp/innochecksum_3_tempfile", "$dir/tmp/$file");
+closedir(DIR);
+EOF
+
+# Print the contents stored in dump.txt
+cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
+--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
+
+--echo [6]: check the valid lower bound values for option
+--echo # allow-mismatches,page,start-page,end-page
+--exec $INNOCHECKSUM --allow-mismatches=0 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM -a 0 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --page=0 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM -p 0 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --start-page=0 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM -s 0 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM --end-page=0 $MYSQLD_DATADIR/test/tab1.ibd
+--exec $INNOCHECKSUM -e 0 $MYSQLD_DATADIR/test/tab1.ibd
+
+#
+# These produce now errors
+#
+#--echo [7]: check the negative values for option
+#--echo # allow-mismatches,page,start-page,end-page.
+#--echo # They will reset to zero for negative values.
+#--echo # check the invalid lower bound values
+#--exec $INNOCHECKSUM --allow-mismatches=-1 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM -a -1 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM --page=-1 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM -p -1 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM --start-page=-1 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM -s -1 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM --end-page=-1 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM -e -1 $MYSQLD_DATADIR/test/tab1.ibd
+#
+#--echo [8]: check the valid upper bound values for
+#--echo # both short and long options "allow-mismatches" and "end-page"
+#
+#--exec $INNOCHECKSUM --allow-mismatches=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM -a 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM --end-page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
+#--exec $INNOCHECKSUM -e 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
+
+--echo [9]: check the both short and long options "page" and "start-page" when
+--echo # seek value is larger than file size.
+--error 1
+--exec $INNOCHECKSUM --page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -p 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --start-page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -s 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
+--source include/search_pattern_in_file.inc
+
+--echo [34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
+--echo # innochecksum will fail with error code: 1
+--error 1
+--exec $INNOCHECKSUM --allow-mismatches=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -a 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --end-page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -e 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -p 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM --start-page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+
+--error 1
+--exec $INNOCHECKSUM -s 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
+let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+
+# Cleanup
+--source include/start_mysqld.inc
+
+DROP TABLE tab1,tab2;
diff --git a/mysql-test/suite/innodb/t/log_data_file_size.opt b/mysql-test/suite/innodb/t/log_data_file_size.opt
new file mode 100644
index 00000000000..d9a364a3287
--- /dev/null
+++ b/mysql-test/suite/innodb/t/log_data_file_size.opt
@@ -0,0 +1,2 @@
+--loose-innodb-sys-indexes
+--innodb-data-file-path=ibdata1:1M:autoextend
diff --git a/mysql-test/suite/innodb/t/log_data_file_size.test b/mysql-test/suite/innodb/t/log_data_file_size.test
new file mode 100644
index 00000000000..75e38673f69
--- /dev/null
+++ b/mysql-test/suite/innodb/t/log_data_file_size.test
@@ -0,0 +1,80 @@
+--source include/innodb_page_size.inc
+--source include/not_embedded.inc
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+let MYSQLD_IS_DEBUG=`select version() like '%debug%'`;
+--source include/no_checkpoint_start.inc
+SET GLOBAL innodb_file_per_table=0;
+SET GLOBAL innodb_file_format=barracuda;
+CREATE TABLE t(a INT)ENGINE=InnoDB;
+let INNODB_ROOT_PAGE= `SELECT page_no FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE name='GEN_CLUST_INDEX'`;
+SET GLOBAL innodb_file_per_table=1;
+
+CREATE TABLE ibd4(a INT UNIQUE)ENGINE=InnoDB;
+CREATE TABLE ibd4f(a INT UNIQUE)ENGINE=InnoDB;
+CREATE TABLE ibd5(a INT UNIQUE, b INT UNIQUE)ENGINE=InnoDB;
+
+let $drop_tables= DROP TABLE t,ibd4,ibd4f,ibd5;
+--let CLEANUP_IF_CHECKPOINT= $drop_tables;
+--source ../include/no_checkpoint_end.inc
+
+perl;
+use Fcntl 'SEEK_CUR', 'SEEK_END';
+
+my $page_size = $ENV{'INNODB_PAGE_SIZE'};
+my $restart;
+open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}ibdata1") or die;
+if ($ENV{'MYSQLD_IS_DEBUG'})
+{
+ # It is impractical to ensure that CREATE TABLE t will extend ibdata1.
+ # We rely on innodb_system_tablespace_extend_debug=1
+ # to recover from this fault injection if no size change was redo-logged.
+ my $root = $ENV{'INNODB_ROOT_PAGE'};
+ my $size = sysseek(FILE, 0, SEEK_END) / $page_size;
+ seek(FILE, $page_size * ($root + 1), SEEK_SET) or die;
+ my $empty_tail= 1;
+ while(<FILE>) { unless (/\0*/gso) { $empty_tail= 0; last } }
+ if ($empty_tail)
+ {
+ $restart = "--innodb-data-file-size-debug=$size";
+ truncate(FILE, $page_size * $root);
+ }
+}
+# Clear the doublewrite buffer entries for our tables.
+sysseek(FILE, 6 * $page_size - 190, 0)||die "Unable to seek ibdata1\n";
+sysread(FILE, $_, 12) == 12||die "Unable to read TRX_SYS\n";
+my($magic,$d1,$d2)=unpack "NNN", $_;
+die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64;
+sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n";
+# Find the pages in the doublewrite buffer
+for (my $d = $d1; $d < $d2 + 64; $d++) {
+ sysread(FILE, $_, $page_size)==$page_size||die "Cannot read doublewrite\n";
+ my($space_id,$offset)=unpack "x[4]Nx[26]N",$_;
+ next unless $space_id && $offset > 3;
+ sysseek(FILE, $d * $page_size, 0)||die "Unable to seek ibdata1\n";
+ syswrite(FILE, chr(0) x $page_size)==$page_size||die;
+}
+close FILE;
+open(FILE, ">$ENV{MYSQLTEST_VARDIR}/log/start_mysqld.txt") || die;
+print FILE "--let \$restart_parameters=$restart\n" if $restart;
+print FILE "--source include/start_mysqld.inc\n";
+close FILE;
+open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd4.ibd") or die;
+truncate(FILE, $page_size * 4);
+close FILE;
+open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd4f.ibd") or die;
+truncate(FILE, $page_size * 4 + 1234);
+# Work around MDEV-12699 and ensure that the truncated page is all-zero.
+sysseek(FILE, $page_size * 4, 0);
+syswrite(FILE, chr(0) x 1234);
+close FILE;
+open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd5.ibd") or die;
+truncate(FILE, $page_size * 5);
+close FILE;
+EOF
+
+--source $MYSQLTEST_VARDIR/log/start_mysqld.txt
+--remove_file $MYSQLTEST_VARDIR/log/start_mysqld.txt
+
+eval $drop_tables;
diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test
index 6c1003881cf..9cc7742f6a8 100644
--- a/mysql-test/suite/innodb/t/log_file_size.test
+++ b/mysql-test/suite/innodb/t/log_file_size.test
@@ -1,6 +1,6 @@
# Test resizing the InnoDB redo log.
---source include/innodb_page_size.inc
+--source include/innodb_page_size_small.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
diff --git a/mysql-test/suite/innodb/t/table_definition_cache_debug.opt b/mysql-test/suite/innodb/t/table_definition_cache_debug.opt
new file mode 100644
index 00000000000..c2db7e1df6e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/table_definition_cache_debug.opt
@@ -0,0 +1 @@
+--innodb-open-files=30
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
index 4d3afcb2dec..1e2b22235a2 100644
--- a/mysql-test/suite/innodb/t/table_flags.test
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -6,7 +6,7 @@
call mtr.add_suppression("InnoDB: New log files created, LSN=");
call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
call mtr.add_suppression("InnoDB: Error: .*innodb_table_stats. not found");
-call mtr.add_suppression("InnoDB: Table '.test.\\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023)");
+call mtr.add_suppression("InnoDB: Table '.test.\\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|121|302[13])\\r?$");
call mtr.add_suppression("InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB");
call mtr.add_suppression("InnoDB: Error: table 'test/t[cdzp]'");
FLUSH TABLES;
@@ -32,10 +32,8 @@ CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
KEY_BLOCK_SIZE=1;
# PAGE_COMPRESSED is supported starting with MariaDB 10.1.0
---error ER_UNKNOWN_OPTION
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
--source include/shutdown_mysqld.inc
--perl
@@ -83,7 +81,7 @@ for (my $offset= 0x65; $offset;
{
my $flags= 0;
if ($name eq 'test/tr') {
-# $flags= 0x40 # DATA_DIR mismatch causes 10.0 crash!
+ $flags= 0x40 # DATA_DIR (largely ignored by 10.1+)
} elsif ($name eq 'test/tc') {
$flags= 0x80 # 10.1 PAGE_COMPRESSED
} elsif ($name eq 'test/td') {
@@ -133,7 +131,7 @@ SHOW CREATE TABLE tp;
let SEARCH_RANGE= -50000;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
---let SEARCH_PATTERN= InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023)
+--let SEARCH_PATTERN= InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|121|302[13])\b
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB
--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/innodb/t/trigger.test b/mysql-test/suite/innodb/t/trigger.test
new file mode 100644
index 00000000000..fe0bab21497
--- /dev/null
+++ b/mysql-test/suite/innodb/t/trigger.test
@@ -0,0 +1,47 @@
+--source include/have_innodb.inc
+--source include/count_sessions.inc
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (b INT) ENGINE=InnoDB;
+CREATE TABLE t3 (c INT) ENGINE=InnoDB;
+
+--delimiter $$
+CREATE TRIGGER tr BEFORE INSERT ON t3 FOR EACH ROW BEGIN SAVEPOINT sv; INSERT INTO t2 VALUES (0); END $$
+--delimiter ;
+
+START TRANSACTION;
+DELETE FROM t1;
+
+connect (con1,localhost,root,,test);
+START TRANSACTION;
+INSERT INTO t2 VALUES (2);
+UPDATE t2 SET b = b+1;
+
+--send
+INSERT INTO t1 VALUES (1);
+
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'update' and info = 'INSERT INTO t1 VALUES (1)'
+--source include/wait_condition.inc
+
+--error ER_LOCK_DEADLOCK
+INSERT INTO t3 VALUES (2);
+COMMIT;
+
+connection con1;
+reap;
+COMMIT;
+disconnect con1;
+
+connection default;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+DROP TABLE t1, t2, t3;
+--error ER_TRG_DOES_NOT_EXIST
+DROP TRIGGER tr;
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb_fts/r/crash_recovery.result b/mysql-test/suite/innodb_fts/r/crash_recovery.result
new file mode 100644
index 00000000000..e21631471d2
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/r/crash_recovery.result
@@ -0,0 +1,78 @@
+CREATE TABLE articles (
+id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+body TEXT,
+FULLTEXT (title,body)
+) ENGINE=InnoDB;
+DROP INDEX title ON articles;
+INSERT INTO articles (title,body) VALUES
+('MySQL Tutorial','DBMS stands for DataBase ...') ,
+('How To Use MySQL Well','After you went through a ...'),
+('Optimizing MySQL','In this tutorial we will show ...'),
+('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+('MySQL vs. YourSQL','In the following database comparison ...'),
+('MySQL Security','When configured properly, MySQL ...');
+BEGIN;
+INSERT INTO articles (title,body) VALUES
+('MySQL Tutorial','DBMS stands for DataBase ...');
+# Kill and restart
+INSERT INTO articles (title,body) VALUES
+('MySQL Tutorial','DBMS stands for DataBase ...');
+CREATE FULLTEXT INDEX idx ON articles (title,body);
+SELECT * FROM articles
+WHERE MATCH (title,body)
+AGAINST ('Database' IN NATURAL LANGUAGE MODE);
+id title body
+1 MySQL Tutorial DBMS stands for DataBase ...
+5 MySQL vs. YourSQL In the following database comparison ...
+7 MySQL Tutorial DBMS stands for DataBase ...
+INSERT INTO articles (title,body) VALUES
+('MySQL Tutorial','DBMS stands for DataBase ...') ,
+('How To Use MySQL Well','After you went through a ...'),
+('Optimizing MySQL','In this tutorial we will show ...'),
+('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+('MySQL vs. YourSQL','In the following database comparison ...'),
+('MySQL Security','When configured properly, MySQL ...');
+BEGIN;
+INSERT INTO articles (title,body) VALUES
+('MySQL Tutorial','DBMS stands for DataBase ...');
+# Kill and restart
+INSERT INTO articles (title,body) VALUES
+('MySQL Tutorial','DBMS stands for DataBase ...');
+SELECT * FROM articles
+WHERE MATCH (title,body)
+AGAINST ('Database' IN NATURAL LANGUAGE MODE);
+id title body
+1 MySQL Tutorial DBMS stands for DataBase ...
+5 MySQL vs. YourSQL In the following database comparison ...
+7 MySQL Tutorial DBMS stands for DataBase ...
+8 MySQL Tutorial DBMS stands for DataBase ...
+12 MySQL vs. YourSQL In the following database comparison ...
+14 MySQL Tutorial DBMS stands for DataBase ...
+DROP TABLE articles;
+CREATE TABLE articles (
+id int PRIMARY KEY,
+FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+title VARCHAR(200),
+body TEXT
+) ENGINE=InnoDB;
+CREATE FULLTEXT INDEX idx1 on articles (title, body);
+INSERT INTO articles VALUES
+(1, 10, 'MySQL Tutorial','DBMS stands for DataBase ...') ,
+(2, 1, 'How To Use MySQL Well','After you went through a ...'),
+(3, 2, 'Optimizing MySQL','In this tutorial we will show ...'),
+(4, 11, '1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+(5, 6, 'MySQL vs. YourSQL','In the following database comparison ...'),
+(7, 4, 'MySQL Security','When configured properly, MySQL ...');
+BEGIN;
+INSERT INTO articles VALUES
+(100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
+# Kill and restart
+INSERT INTO articles VALUES (8, 12, 'MySQL Tutorial','DBMS stands for DataBase ...');
+SELECT * FROM articles WHERE MATCH (title, body)
+AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
+id FTS_DOC_ID title body
+3 2 Optimizing MySQL In this tutorial we will show ...
+1 10 MySQL Tutorial DBMS stands for DataBase ...
+8 12 MySQL Tutorial DBMS stands for DataBase ...
+DROP TABLE articles;
diff --git a/mysql-test/suite/innodb_fts/r/fulltext_misc.result b/mysql-test/suite/innodb_fts/r/fulltext_misc.result
index 7c342475eeb..ce7fe46f4e1 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext_misc.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext_misc.result
@@ -158,11 +158,18 @@ a
EXPLAIN EXTENDED
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
+2 UNION t1 ALL NULL NULL NULL NULL 2 100.00
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (match `a` against ('+abc' in boolean mode))
# Should not crash
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+a
+1
+2
# Should not crash
EXPLAIN EXTENDED
SELECT * FROM t1 UNION SELECT * FROM t1
@@ -174,7 +181,7 @@ NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #-1
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (select `a` from `test`.`t2` where (`test`.`t2`.`b` = 12))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by <expr_cache><`a`>((select `a` from `test`.`t2` where (`test`.`t2`.`b` = 12)))
# Should not crash
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY (SELECT a FROM t2 WHERE b = 12);
diff --git a/mysql-test/suite/innodb_fts/r/fulltext_order_by.result b/mysql-test/suite/innodb_fts/r/fulltext_order_by.result
index b99c6695ea0..503f117d02f 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext_order_by.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext_order_by.result
@@ -129,7 +129,7 @@ group by
a.text, b.id, b.betreff
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+ERROR 42000: Table 'b' from one of the SELECTs cannot be used in field list
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -145,7 +145,7 @@ where
match(c.beitrag) against ('+abc' in boolean mode)
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+ERROR 42000: Table 'b' from one of the SELECTs cannot be used in field list
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -161,7 +161,7 @@ where
match(c.beitrag) against ('+abc' in boolean mode)
order by
match(betreff) against ('+abc' in boolean mode) desc;
-ERROR 42000: Incorrect usage/placement of 'MATCH()'
+text id betreff
(select b.id, b.betreff from t3 b) union
(select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc' in boolean mode) desc;
diff --git a/mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result b/mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result
deleted file mode 100644
index e84971a43d9..00000000000
--- a/mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result
+++ /dev/null
@@ -1,5 +0,0 @@
-CREATE TABLE t (a INT, b TEXT) engine=innodb;
-SET debug_dbug='+d,alter_table_rollback_new_index';
-ALTER TABLE t ADD FULLTEXT INDEX (b(64));
-ERROR HY000: Unknown error
-DROP TABLE t;
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result
deleted file mode 100644
index 7115a761ea4..00000000000
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result
+++ /dev/null
@@ -1,97 +0,0 @@
-CREATE TABLE articles (
-id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
-title VARCHAR(200),
-body TEXT,
-FULLTEXT (title,body)
-) ENGINE=InnoDB;
-DROP INDEX title ON articles;
-INSERT INTO articles (title,body) VALUES
-('MySQL Tutorial','DBMS stands for DataBase ...') ,
-('How To Use MySQL Well','After you went through a ...'),
-('Optimizing MySQL','In this tutorial we will show ...'),
-('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
-('MySQL vs. YourSQL','In the following database comparison ...'),
-('MySQL Security','When configured properly, MySQL ...');
-BEGIN;
-INSERT INTO articles (title,body) VALUES
-('MySQL Tutorial','DBMS stands for DataBase ...');
-SET SESSION debug_dbug="+d,crash_commit_before";
-COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
-INSERT INTO articles (title,body) VALUES
-('MySQL Tutorial','DBMS stands for DataBase ...');
-CREATE FULLTEXT INDEX idx ON articles (title,body);
-SELECT * FROM articles
-WHERE MATCH (title,body)
-AGAINST ('Database' IN NATURAL LANGUAGE MODE);
-id title body
-1 MySQL Tutorial DBMS stands for DataBase ...
-5 MySQL vs. YourSQL In the following database comparison ...
-7 MySQL Tutorial DBMS stands for DataBase ...
-INSERT INTO articles (title,body) VALUES
-('MySQL Tutorial','DBMS stands for DataBase ...') ,
-('How To Use MySQL Well','After you went through a ...'),
-('Optimizing MySQL','In this tutorial we will show ...'),
-('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
-('MySQL vs. YourSQL','In the following database comparison ...'),
-('MySQL Security','When configured properly, MySQL ...');
-BEGIN;
-INSERT INTO articles (title,body) VALUES
-('MySQL Tutorial','DBMS stands for DataBase ...');
-SET SESSION debug_dbug="+d,crash_commit_before";
-COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
-INSERT INTO articles (title,body) VALUES
-('MySQL Tutorial','DBMS stands for DataBase ...');
-SELECT * FROM articles
-WHERE MATCH (title,body)
-AGAINST ('Database' IN NATURAL LANGUAGE MODE);
-id title body
-1 MySQL Tutorial DBMS stands for DataBase ...
-5 MySQL vs. YourSQL In the following database comparison ...
-7 MySQL Tutorial DBMS stands for DataBase ...
-8 MySQL Tutorial DBMS stands for DataBase ...
-12 MySQL vs. YourSQL In the following database comparison ...
-14 MySQL Tutorial DBMS stands for DataBase ...
-DROP TABLE articles;
-CREATE TABLE articles (
-id int PRIMARY KEY,
-FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
-title VARCHAR(200),
-body TEXT
-) ENGINE=InnoDB;
-CREATE FULLTEXT INDEX idx1 on articles (title, body);
-INSERT INTO articles VALUES
-(1, 10, 'MySQL Tutorial','DBMS stands for DataBase ...') ,
-(2, 1, 'How To Use MySQL Well','After you went through a ...'),
-(3, 2, 'Optimizing MySQL','In this tutorial we will show ...'),
-(4, 11, '1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
-(5, 6, 'MySQL vs. YourSQL','In the following database comparison ...'),
-(7, 4, 'MySQL Security','When configured properly, MySQL ...');
-BEGIN;
-INSERT INTO articles VALUES
-(100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
-SET SESSION debug_dbug="+d,crash_commit_before";
-COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
-INSERT INTO articles VALUES (8, 12, 'MySQL Tutorial','DBMS stands for DataBase ...');
-SELECT * FROM articles WHERE MATCH (title, body)
-AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
-id FTS_DOC_ID title body
-3 2 Optimizing MySQL In this tutorial we will show ...
-1 10 MySQL Tutorial DBMS stands for DataBase ...
-8 12 MySQL Tutorial DBMS stands for DataBase ...
-DROP TABLE articles;
-CREATE TABLE articles (
-id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
-title VARCHAR(200),
-body TEXT,
-FULLTEXT (title,body)
-) ENGINE=InnoDB;
-SET @saved_debug_dbug = @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,ib_dict_create_index_tree_fail";
-CREATE FULLTEXT INDEX idx ON articles(body);
-ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
-SET SESSION debug_dbug=@saved_debug_dbug;
-ALTER TABLE articles STATS_PERSISTENT=DEFAULT;
-DROP TABLE articles;
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result b/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result
index 3db84161e6a..40a38e62a1e 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result
@@ -16,6 +16,7 @@ INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
('where will Optimizing MySQL','what In this tutorial we will show ...');
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,fts_instrument_result_cache_limit";
SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('mysql' IN BOOLEAN MODE);
COUNT(*)
@@ -26,5 +27,6 @@ SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database"' IN BOOLEAN
ERROR HY000: Table handler out of memory
SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database" @ 5' IN BOOLEAN MODE);
ERROR HY000: Table handler out of memory
+SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
SET GLOBAL innodb_ft_result_cache_limit=default;
diff --git a/mysql-test/suite/innodb_fts/r/misc_debug.result b/mysql-test/suite/innodb_fts/r/misc_debug.result
new file mode 100644
index 00000000000..1fcc89b165b
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/r/misc_debug.result
@@ -0,0 +1,19 @@
+CREATE TABLE articles (
+id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+body TEXT,
+FULLTEXT (title,body)
+) ENGINE=InnoDB;
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,ib_dict_create_index_tree_fail";
+CREATE FULLTEXT INDEX idx ON articles(body);
+ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
+SET SESSION debug_dbug=@saved_debug_dbug;
+ALTER TABLE articles STATS_PERSISTENT=DEFAULT;
+DROP TABLE articles;
+CREATE TABLE t (a INT, b TEXT) engine=innodb;
+SET debug_dbug='+d,alter_table_rollback_new_index';
+ALTER TABLE t ADD FULLTEXT INDEX (b(64));
+ERROR HY000: Unknown error
+SET SESSION debug_dbug=@saved_debug_dbug;
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb_fts/t/crash_recovery.test b/mysql-test/suite/innodb_fts/t/crash_recovery.test
new file mode 100644
index 00000000000..ec055930672
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/crash_recovery.test
@@ -0,0 +1,118 @@
+# Crash recovery tests for FULLTEXT INDEX.
+# Note: These tests used to be part of a larger test, innodb_fts_misc_debug
+# or innodb_fts.misc_debug. The part of the test that actually needs debug
+# instrumentation been moved to innodb_fts.misc_debug.
+
+--source include/have_innodb.inc
+# The embedded server tests do not support restarting.
+--source include/not_embedded.inc
+
+# Following are test for crash recovery on FTS index, the first scenario
+# is for bug Bug #14586855 INNODB: FAILING ASSERTION: (DICT_INDEX_GET_N_UNIQUE(
+# PLAN->INDEX) <= PLAN->N_EXAC
+
+# Scenario 1: Hidden FTS_DOC_ID column, and FTS index dropped
+# Create FTS table
+CREATE TABLE articles (
+ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+ title VARCHAR(200),
+ body TEXT,
+ FULLTEXT (title,body)
+ ) ENGINE=InnoDB;
+
+# Drop the FTS index before more insertion. The FTS_DOC_ID should
+# be kept
+DROP INDEX title ON articles;
+
+# Insert six rows
+INSERT INTO articles (title,body) VALUES
+ ('MySQL Tutorial','DBMS stands for DataBase ...') ,
+ ('How To Use MySQL Well','After you went through a ...'),
+ ('Optimizing MySQL','In this tutorial we will show ...'),
+ ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+ ('MySQL vs. YourSQL','In the following database comparison ...'),
+ ('MySQL Security','When configured properly, MySQL ...');
+
+BEGIN;
+
+INSERT INTO articles (title,body) VALUES
+ ('MySQL Tutorial','DBMS stands for DataBase ...');
+
+--source include/kill_and_restart_mysqld.inc
+
+# This insert will re-initialize the Doc ID counter, it should not crash
+INSERT INTO articles (title,body) VALUES
+ ('MySQL Tutorial','DBMS stands for DataBase ...');
+
+# Recreate fulltext index to see if everything is OK
+CREATE FULLTEXT INDEX idx ON articles (title,body);
+
+# Should return 3 rows
+SELECT * FROM articles
+ WHERE MATCH (title,body)
+ AGAINST ('Database' IN NATURAL LANGUAGE MODE);
+
+# Scenario 2: Hidden FTS_DOC_ID column, with FTS index
+# Now let's do more insertion and test a crash with FTS on
+INSERT INTO articles (title,body) VALUES
+ ('MySQL Tutorial','DBMS stands for DataBase ...') ,
+ ('How To Use MySQL Well','After you went through a ...'),
+ ('Optimizing MySQL','In this tutorial we will show ...'),
+ ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+ ('MySQL vs. YourSQL','In the following database comparison ...'),
+ ('MySQL Security','When configured properly, MySQL ...');
+
+BEGIN;
+
+INSERT INTO articles (title,body) VALUES
+ ('MySQL Tutorial','DBMS stands for DataBase ...');
+
+--source include/kill_and_restart_mysqld.inc
+
+# This insert will re-initialize the Doc ID counter, it should not crash
+INSERT INTO articles (title,body) VALUES
+ ('MySQL Tutorial','DBMS stands for DataBase ...');
+
+# Should return 6 rows
+SELECT * FROM articles
+ WHERE MATCH (title,body)
+ AGAINST ('Database' IN NATURAL LANGUAGE MODE);
+
+DROP TABLE articles;
+
+# Scenario 3: explicit FTS_DOC_ID column with FTS index
+# Now let's test user defined FTS_DOC_ID
+
+CREATE TABLE articles (
+ id int PRIMARY KEY,
+ FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+ title VARCHAR(200),
+ body TEXT
+ ) ENGINE=InnoDB;
+
+CREATE FULLTEXT INDEX idx1 on articles (title, body);
+
+# Note the FTS_DOC_ID is not fully ordered with primary index
+INSERT INTO articles VALUES
+ (1, 10, 'MySQL Tutorial','DBMS stands for DataBase ...') ,
+ (2, 1, 'How To Use MySQL Well','After you went through a ...'),
+ (3, 2, 'Optimizing MySQL','In this tutorial we will show ...'),
+ (4, 11, '1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+ (5, 6, 'MySQL vs. YourSQL','In the following database comparison ...'),
+ (7, 4, 'MySQL Security','When configured properly, MySQL ...');
+
+BEGIN;
+
+INSERT INTO articles VALUES
+ (100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
+
+--source include/kill_and_restart_mysqld.inc
+
+# This would re-initialize the FTS index and do the re-tokenization
+# of above records
+INSERT INTO articles VALUES (8, 12, 'MySQL Tutorial','DBMS stands for DataBase ...');
+
+SELECT * FROM articles WHERE MATCH (title, body)
+ AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
+
+DROP TABLE articles;
diff --git a/mysql-test/suite/innodb_fts/t/fulltext_misc.test b/mysql-test/suite/innodb_fts/t/fulltext_misc.test
index 424cfda2f95..25690ddc1d9 100644
--- a/mysql-test/suite/innodb_fts/t/fulltext_misc.test
+++ b/mysql-test/suite/innodb_fts/t/fulltext_misc.test
@@ -177,13 +177,12 @@ SELECT * FROM t1 UNION SELECT * FROM t1 ORDER BY a + 12;
--echo # Should not crash
---error ER_CANT_USE_OPTION_HERE
EXPLAIN EXTENDED
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
--echo # Should not crash
---error ER_CANT_USE_OPTION_HERE
+--sorted_result
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
diff --git a/mysql-test/suite/innodb_fts/t/fulltext_order_by.test b/mysql-test/suite/innodb_fts/t/fulltext_order_by.test
index b8f64a2fe78..d2194f22e2a 100644
--- a/mysql-test/suite/innodb_fts/t/fulltext_order_by.test
+++ b/mysql-test/suite/innodb_fts/t/fulltext_order_by.test
@@ -93,7 +93,7 @@ CREATE TABLE t3 (
FULLTEXT KEY betreff (betreff)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=996 ;
---error ER_CANT_USE_OPTION_HERE
+--error ER_TABLENAME_NOT_ALLOWED_HERE
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -113,7 +113,7 @@ group by
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
---error ER_CANT_USE_OPTION_HERE
+--error ER_TABLENAME_NOT_ALLOWED_HERE
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -130,7 +130,6 @@ where
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
---error ER_CANT_USE_OPTION_HERE
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
diff --git a/mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test b/mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test
deleted file mode 100644
index 09383709f74..00000000000
--- a/mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Test innobase_drop_fts_index_table()
-#
-
--- source include/have_innodb.inc
-# Must have debug code to use SET SESSION debug
--- source include/have_debug.inc
--- source include/not_embedded.inc
-
-CREATE TABLE t (a INT, b TEXT) engine=innodb;
-
-SET debug_dbug='+d,alter_table_rollback_new_index';
-
--- error ER_UNKNOWN_ERROR
-ALTER TABLE t ADD FULLTEXT INDEX (b(64));
-
-DROP TABLE t;
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test
deleted file mode 100644
index 8be5ccb5c32..00000000000
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test
+++ /dev/null
@@ -1,210 +0,0 @@
-#------------------------------------------------------------------------------
-# Misc FTS test on debug servers only
-#------------------------------------------------------------------------------
---source include/have_innodb.inc
-
-# Must have debug code to use SET SESSION debug
---source include/have_debug.inc
-
-# Valgrind would complain about memory leaks when we crash on purpose.
---source include/not_valgrind.inc
-
-# Embedded server does not support crashing
---source include/not_embedded.inc
-
-# Avoid CrashReporter popup on Mac
---source include/not_crashrep.inc
-
-# Following are test for crash recovery on FTS index, the first scenario
-# is for bug Bug #14586855 INNODB: FAILING ASSERTION: (DICT_INDEX_GET_N_UNIQUE(
-# PLAN->INDEX) <= PLAN->N_EXAC
-
-# Scenario 1: Hidden FTS_DOC_ID column, and FTS index dropped
-# Create FTS table
-CREATE TABLE articles (
- id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
- title VARCHAR(200),
- body TEXT,
- FULLTEXT (title,body)
- ) ENGINE=InnoDB;
-
-# Drop the FTS index before more insertion. The FTS_DOC_ID should
-# be kept
-DROP INDEX title ON articles;
-
-# Insert six rows
-INSERT INTO articles (title,body) VALUES
- ('MySQL Tutorial','DBMS stands for DataBase ...') ,
- ('How To Use MySQL Well','After you went through a ...'),
- ('Optimizing MySQL','In this tutorial we will show ...'),
- ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
- ('MySQL vs. YourSQL','In the following database comparison ...'),
- ('MySQL Security','When configured properly, MySQL ...');
-
-BEGIN;
-
-INSERT INTO articles (title,body) VALUES
- ('MySQL Tutorial','DBMS stands for DataBase ...');
-
-# Request a crash on next execution of commit.
-SET SESSION debug_dbug="+d,crash_commit_before";
-#
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-#
-# Execute the statement that causes the crash.
---error 2013
-COMMIT;
-
---source include/wait_until_disconnected.inc
---sleep 2
-
-# Turn on reconnect
---enable_reconnect
-#
-# Call script that will poll the server waiting for it to be back online again
---source include/wait_until_connected_again.inc
-#
-# Turn off reconnect again
---disable_reconnect
-
-# This insert will re-initialize the Doc ID counter, it should not crash
-INSERT INTO articles (title,body) VALUES
- ('MySQL Tutorial','DBMS stands for DataBase ...');
-
-# Recreate fulltext index to see if everything is OK
-CREATE FULLTEXT INDEX idx ON articles (title,body);
-
-# Should return 3 rows
-SELECT * FROM articles
- WHERE MATCH (title,body)
- AGAINST ('Database' IN NATURAL LANGUAGE MODE);
-
-# Scenario 2: Hidden FTS_DOC_ID column, with FTS index
-# Now let's do more insertion and test a crash with FTS on
-INSERT INTO articles (title,body) VALUES
- ('MySQL Tutorial','DBMS stands for DataBase ...') ,
- ('How To Use MySQL Well','After you went through a ...'),
- ('Optimizing MySQL','In this tutorial we will show ...'),
- ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
- ('MySQL vs. YourSQL','In the following database comparison ...'),
- ('MySQL Security','When configured properly, MySQL ...');
-
-# Now let's crash the server with "crash_commit_before"
-BEGIN;
-
-INSERT INTO articles (title,body) VALUES
- ('MySQL Tutorial','DBMS stands for DataBase ...');
-
-# Request a crash on next execution of commit.
-SET SESSION debug_dbug="+d,crash_commit_before";
-#
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-#
-# Execute the statement that causes the crash.
---error 2013
-COMMIT;
-
---source include/wait_until_disconnected.inc
---sleep 2
-
-# Turn on reconnect
---enable_reconnect
-#
-# Call script that will poll the server waiting for it to be back online again
---source include/wait_until_connected_again.inc
-#
-# Turn off reconnect again
---disable_reconnect
-
-# This insert will re-initialize the Doc ID counter, it should not crash
-INSERT INTO articles (title,body) VALUES
- ('MySQL Tutorial','DBMS stands for DataBase ...');
-
-# Should return 6 rows
-SELECT * FROM articles
- WHERE MATCH (title,body)
- AGAINST ('Database' IN NATURAL LANGUAGE MODE);
-
-DROP TABLE articles;
-
-# Scenario 3: explicit FTS_DOC_ID column with FTS index
-# Now let's test user defined FTS_DOC_ID
-
-CREATE TABLE articles (
- id int PRIMARY KEY,
- FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
- title VARCHAR(200),
- body TEXT
- ) ENGINE=InnoDB;
-
-CREATE FULLTEXT INDEX idx1 on articles (title, body);
-
-# Note the FTS_DOC_ID is not fully ordered with primary index
-INSERT INTO articles VALUES
- (1, 10, 'MySQL Tutorial','DBMS stands for DataBase ...') ,
- (2, 1, 'How To Use MySQL Well','After you went through a ...'),
- (3, 2, 'Optimizing MySQL','In this tutorial we will show ...'),
- (4, 11, '1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
- (5, 6, 'MySQL vs. YourSQL','In the following database comparison ...'),
- (7, 4, 'MySQL Security','When configured properly, MySQL ...');
-
-# Now let's crash the server with "crash_commit_before"
-BEGIN;
-
-INSERT INTO articles VALUES
- (100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
-
-# Request a crash on next execution of commit.
-SET SESSION debug_dbug="+d,crash_commit_before";
-#
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-#
-# Execute the statement that causes the crash.
---error 2013
-COMMIT;
-
---source include/wait_until_disconnected.inc
---sleep 2
-
-# Turn on reconnect
---enable_reconnect
-#
-# Call script that will poll the server waiting for it to be back online again
---source include/wait_until_connected_again.inc
-#
-
-# This would re-initialize the FTS index and do the re-tokenization
-# of above records
-INSERT INTO articles VALUES (8, 12, 'MySQL Tutorial','DBMS stands for DataBase ...');
-
-SELECT * FROM articles WHERE MATCH (title, body)
- AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
-
-DROP TABLE articles;
-
-# Following test is for Bug 14668777 - ASSERT ON IB_VECTOR_SIZE(
-# TABLE->FTS->INDEXES, ALTER TABLE
-CREATE TABLE articles (
- id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
- title VARCHAR(200),
- body TEXT,
- FULLTEXT (title,body)
- ) ENGINE=InnoDB;
-
-# Abort the operation in dict_create_index_step by setting
-# return status of dict_create_index_tree_step() to DB_OUT_OF_MEMORY
-# The newly create dict_index_t should be removed from fts cache
-SET @saved_debug_dbug = @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,ib_dict_create_index_tree_fail";
---error ER_OUT_OF_RESOURCES
-CREATE FULLTEXT INDEX idx ON articles(body);
-SET SESSION debug_dbug=@saved_debug_dbug;
-
-# This simply go through ha_innobase::commit_inplace_alter_table
-# and do a fts_check_cached_index()
-ALTER TABLE articles STATS_PERSISTENT=DEFAULT;
-
-DROP TABLE articles;
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test b/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test
index 21e4b543647..669808edbf6 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test
@@ -27,6 +27,7 @@ INSERT INTO t1 (a,b) VALUES
('when To Use MySQL Well','After that you went through a ...'),
('where will Optimizing MySQL','what In this tutorial we will show ...');
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,fts_instrument_result_cache_limit";
# Simple term search
@@ -44,6 +45,8 @@ SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database"' IN BOOLEAN
--error 128
SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database" @ 5' IN BOOLEAN MODE);
+SET SESSION debug_dbug=@saved_debug_dbug;
+
DROP TABLE t1;
SET GLOBAL innodb_ft_result_cache_limit=default;
diff --git a/mysql-test/suite/innodb_fts/t/misc_debug.test b/mysql-test/suite/innodb_fts/t/misc_debug.test
new file mode 100644
index 00000000000..4b32afb848c
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/misc_debug.test
@@ -0,0 +1,41 @@
+# Miscellanous FULLTEXT INDEX tests for debug-instrumented servers.
+# Note: These tests used to be part of a larger test, innodb_fts_misc_debug
+# or innodb_fts.misc_debug. A large part of that test can be run on a
+# non-debug server and has been renamed to innodb_fts.crash_recovery.
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+# Following test is for Bug 14668777 - ASSERT ON IB_VECTOR_SIZE(
+# TABLE->FTS->INDEXES, ALTER TABLE
+CREATE TABLE articles (
+ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+ title VARCHAR(200),
+ body TEXT,
+ FULLTEXT (title,body)
+ ) ENGINE=InnoDB;
+
+# Abort the operation in dict_create_index_step by setting
+# return status of dict_create_index_tree_step() to DB_OUT_OF_MEMORY
+# The newly create dict_index_t should be removed from fts cache
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,ib_dict_create_index_tree_fail";
+--error ER_OUT_OF_RESOURCES
+CREATE FULLTEXT INDEX idx ON articles(body);
+SET SESSION debug_dbug=@saved_debug_dbug;
+
+# This simply go through ha_innobase::commit_inplace_alter_table
+# and do a fts_check_cached_index()
+ALTER TABLE articles STATS_PERSISTENT=DEFAULT;
+
+DROP TABLE articles;
+
+# This test used to be called innodb_fts.innobase_drop_fts_index_table:
+
+CREATE TABLE t (a INT, b TEXT) engine=innodb;
+SET debug_dbug='+d,alter_table_rollback_new_index';
+-- error ER_UNKNOWN_ERROR
+ALTER TABLE t ADD FULLTEXT INDEX (b(64));
+SET SESSION debug_dbug=@saved_debug_dbug;
+
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result b/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
index 6ac196770c4..474d36ea044 100644
--- a/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
@@ -1381,7 +1381,7 @@ info: Records: 0 Duplicates: 0 Warnings: 0
SHOW CREATE TABLE worklog5743;
Table Create Table
worklog5743 CREATE TABLE `worklog5743` (
- `col_1_varchar` varchar(4000) NOT NULL DEFAULT '',
+ `col_1_varchar` varchar(4000) NOT NULL,
`col_2_varchar` varchar(4000) DEFAULT NULL,
PRIMARY KEY (`col_1_varchar`(767)),
KEY `prefix_idx` (`col_1_varchar`(767))
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 1778437927e..a751736aba6 100644
--- a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
+++ b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
@@ -550,7 +550,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported
+ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
diff --git a/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test
index 4263e839c85..35e4b2c6bf3 100644
--- a/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test
@@ -1,5 +1,9 @@
--source include/have_innodb.inc
+# lazy evition might not be lazy enough when key rotation
+# scans through pages
+-- source include/not_encrypted.inc
+
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
diff --git a/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
index 0c049b77630..87f2fd3f467 100644
--- a/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
@@ -15,6 +15,8 @@
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
+--source include/big_test.inc
+--source include/not_valgrind.inc
# Save innodb variables
--disable_query_log
diff --git a/mysql-test/suite/jp/disabled.def b/mysql-test/suite/jp/disabled.def
index 888298bbb09..b74382895d2 100644
--- a/mysql-test/suite/jp/disabled.def
+++ b/mysql-test/suite/jp/disabled.def
@@ -9,3 +9,5 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
+
+binlog_index : codership/mysql-wsrep##71 Regression: Duplicate "file was not purged because it is the active log file" warning
diff --git a/mysql-test/suite/jp/r/jp_alter_sjis.result b/mysql-test/suite/jp/r/jp_alter_sjis.result
index 85d974df78e..20b71952197 100644
--- a/mysql-test/suite/jp/r/jp_alter_sjis.result
+++ b/mysql-test/suite/jp/r/jp_alter_sjis.result
@@ -31,14 +31,14 @@ NULL ³³³³³ NULL NULL
DESC `±±±`;
Field Type Null Key Default Extra
¶¶ char(1) YES MUL NULL
-··· char(6) NO PRI
+··· char(6) NO PRI NULL
¸¸¸ char(1) YES UNI NULL
¹¹¹ char(1) YES NULL
SHOW CREATE TABLE `±±±`;
Table Create Table
±±± CREATE TABLE `±±±` (
`¶¶` char(1) DEFAULT NULL,
- `···` char(6) NOT NULL DEFAULT '',
+ `···` char(6) NOT NULL,
`¸¸¸` char(1) DEFAULT NULL,
`¹¹¹` char(1) DEFAULT NULL,
PRIMARY KEY (`···`),
@@ -58,11 +58,11 @@ SELECT * FROM `±±±`;
³³³³³
DESC `±±±`;
Field Type Null Key Default Extra
-··· char(6) NO
+··· char(6) NO NULL
SHOW CREATE TABLE `±±±`;
Table Create Table
±±± CREATE TABLE `±±±` (
- `···` char(6) NOT NULL DEFAULT ''
+ `···` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=sjis
ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST;
ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`;
@@ -80,14 +80,14 @@ NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL
DESC `‚ ‚ ‚ `;
Field Type Null Key Default Extra
‚©‚© char(1) YES MUL NULL
-‚«‚«‚« char(6) NO PRI
+‚«‚«‚« char(6) NO PRI NULL
‚­‚­‚­ char(1) YES UNI NULL
‚¯‚¯‚¯ char(1) YES NULL
SHOW CREATE TABLE `‚ ‚ ‚ `;
Table Create Table
‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` (
`‚©‚©` char(1) DEFAULT NULL,
- `‚«‚«‚«` char(6) NOT NULL DEFAULT '',
+ `‚«‚«‚«` char(6) NOT NULL,
`‚­‚­‚­` char(1) DEFAULT NULL,
`‚¯‚¯‚¯` char(1) DEFAULT NULL,
PRIMARY KEY (`‚«‚«‚«`),
@@ -107,11 +107,11 @@ SELECT * FROM `‚ ‚ ‚ `;
‚¤‚¤‚¤‚¤‚¤
DESC `‚ ‚ ‚ `;
Field Type Null Key Default Extra
-‚«‚«‚« char(6) NO
+‚«‚«‚« char(6) NO NULL
SHOW CREATE TABLE `‚ ‚ ‚ `;
Table Create Table
‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` (
- `‚«‚«‚«` char(6) NOT NULL DEFAULT ''
+ `‚«‚«‚«` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=sjis
ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST;
ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`;
@@ -129,14 +129,14 @@ NULL •\•\•\•\•\ NULL NULL
DESC `ƒ\ƒ\ƒ\`;
Field Type Null Key Default Extra
\\ char(1) YES MUL NULL
-•\•\•\ char(6) NO PRI
+•\•\•\ char(6) NO PRI NULL
”\”\”\ char(1) YES UNI NULL
—\—\—\ char(1) YES NULL
SHOW CREATE TABLE `ƒ\ƒ\ƒ\`;
Table Create Table
ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` (
`\\` char(1) DEFAULT NULL,
- `•\•\•\` char(6) NOT NULL DEFAULT '',
+ `•\•\•\` char(6) NOT NULL,
`”\”\”\` char(1) DEFAULT NULL,
`—\—\—\` char(1) DEFAULT NULL,
PRIMARY KEY (`•\•\•\`),
@@ -156,11 +156,11 @@ SELECT * FROM `ƒ\ƒ\ƒ\`;
•\•\•\•\•\
DESC `ƒ\ƒ\ƒ\`;
Field Type Null Key Default Extra
-•\•\•\ char(6) NO
+•\•\•\ char(6) NO NULL
SHOW CREATE TABLE `ƒ\ƒ\ƒ\`;
Table Create Table
ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` (
- `•\•\•\` char(6) NOT NULL DEFAULT ''
+ `•\•\•\` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=sjis
DROP TABLE `±±±`;
DROP TABLE `²²²`;
@@ -193,14 +193,14 @@ NULL ³³³³³ NULL NULL
DESC `±±±`;
Field Type Null Key Default Extra
¶¶ char(1) YES MUL NULL
-··· char(6) NO PRI
+··· char(6) NO PRI NULL
¸¸¸ char(1) YES UNI NULL
¹¹¹ char(1) YES NULL
SHOW CREATE TABLE `±±±`;
Table Create Table
±±± CREATE TABLE `±±±` (
`¶¶` char(1) DEFAULT NULL,
- `···` char(6) NOT NULL DEFAULT '',
+ `···` char(6) NOT NULL,
`¸¸¸` char(1) DEFAULT NULL,
`¹¹¹` char(1) DEFAULT NULL,
PRIMARY KEY (`···`),
@@ -220,11 +220,11 @@ SELECT * FROM `±±±`;
³³³³³
DESC `±±±`;
Field Type Null Key Default Extra
-··· char(6) NO
+··· char(6) NO NULL
SHOW CREATE TABLE `±±±`;
Table Create Table
±±± CREATE TABLE `±±±` (
- `···` char(6) NOT NULL DEFAULT ''
+ `···` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis
ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST;
ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`;
@@ -242,14 +242,14 @@ NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL
DESC `‚ ‚ ‚ `;
Field Type Null Key Default Extra
‚©‚© char(1) YES MUL NULL
-‚«‚«‚« char(6) NO PRI
+‚«‚«‚« char(6) NO PRI NULL
‚­‚­‚­ char(1) YES UNI NULL
‚¯‚¯‚¯ char(1) YES NULL
SHOW CREATE TABLE `‚ ‚ ‚ `;
Table Create Table
‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` (
`‚©‚©` char(1) DEFAULT NULL,
- `‚«‚«‚«` char(6) NOT NULL DEFAULT '',
+ `‚«‚«‚«` char(6) NOT NULL,
`‚­‚­‚­` char(1) DEFAULT NULL,
`‚¯‚¯‚¯` char(1) DEFAULT NULL,
PRIMARY KEY (`‚«‚«‚«`),
@@ -269,11 +269,11 @@ SELECT * FROM `‚ ‚ ‚ `;
‚¤‚¤‚¤‚¤‚¤
DESC `‚ ‚ ‚ `;
Field Type Null Key Default Extra
-‚«‚«‚« char(6) NO
+‚«‚«‚« char(6) NO NULL
SHOW CREATE TABLE `‚ ‚ ‚ `;
Table Create Table
‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` (
- `‚«‚«‚«` char(6) NOT NULL DEFAULT ''
+ `‚«‚«‚«` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis
ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST;
ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`;
@@ -291,14 +291,14 @@ NULL ”\”\”\”\”\ NULL NULL
DESC `ƒ\ƒ\ƒ\`;
Field Type Null Key Default Extra
\\ char(1) YES MUL NULL
-•\•\•\ char(6) NO PRI
+•\•\•\ char(6) NO PRI NULL
”\”\”\ char(1) YES UNI NULL
—\—\—\ char(1) YES NULL
SHOW CREATE TABLE `ƒ\ƒ\ƒ\`;
Table Create Table
ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` (
`\\` char(1) DEFAULT NULL,
- `•\•\•\` char(6) NOT NULL DEFAULT '',
+ `•\•\•\` char(6) NOT NULL,
`”\”\”\` char(1) DEFAULT NULL,
`—\—\—\` char(1) DEFAULT NULL,
PRIMARY KEY (`•\•\•\`),
@@ -318,11 +318,11 @@ SELECT * FROM `ƒ\ƒ\ƒ\`;
”\”\”\”\”\
DESC `ƒ\ƒ\ƒ\`;
Field Type Null Key Default Extra
-•\•\•\ char(6) NO
+•\•\•\ char(6) NO NULL
SHOW CREATE TABLE `ƒ\ƒ\ƒ\`;
Table Create Table
ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` (
- `•\•\•\` char(6) NOT NULL DEFAULT ''
+ `•\•\•\` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis
DROP TABLE `±±±`;
DROP TABLE `²²²`;
@@ -355,14 +355,14 @@ NULL ³³³³³ NULL NULL
DESC `±±±`;
Field Type Null Key Default Extra
¶¶ char(1) YES MUL NULL
-··· char(6) NO PRI
+··· char(6) NO PRI NULL
¸¸¸ char(1) YES UNI NULL
¹¹¹ char(1) YES NULL
SHOW CREATE TABLE `±±±`;
Table Create Table
±±± CREATE TABLE `±±±` (
`¶¶` char(1) DEFAULT NULL,
- `···` char(6) NOT NULL DEFAULT '',
+ `···` char(6) NOT NULL,
`¸¸¸` char(1) DEFAULT NULL,
`¹¹¹` char(1) DEFAULT NULL,
PRIMARY KEY (`···`),
@@ -382,11 +382,11 @@ SELECT * FROM `±±±`;
³³³³³
DESC `±±±`;
Field Type Null Key Default Extra
-··· char(6) NO
+··· char(6) NO NULL
SHOW CREATE TABLE `±±±`;
Table Create Table
±±± CREATE TABLE `±±±` (
- `···` char(6) NOT NULL DEFAULT ''
+ `···` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=sjis
ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST;
ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`;
@@ -404,14 +404,14 @@ NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL
DESC `‚ ‚ ‚ `;
Field Type Null Key Default Extra
‚©‚© char(1) YES MUL NULL
-‚«‚«‚« char(6) NO PRI
+‚«‚«‚« char(6) NO PRI NULL
‚­‚­‚­ char(1) YES UNI NULL
‚¯‚¯‚¯ char(1) YES NULL
SHOW CREATE TABLE `‚ ‚ ‚ `;
Table Create Table
‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` (
`‚©‚©` char(1) DEFAULT NULL,
- `‚«‚«‚«` char(6) NOT NULL DEFAULT '',
+ `‚«‚«‚«` char(6) NOT NULL,
`‚­‚­‚­` char(1) DEFAULT NULL,
`‚¯‚¯‚¯` char(1) DEFAULT NULL,
PRIMARY KEY (`‚«‚«‚«`),
@@ -431,11 +431,11 @@ SELECT * FROM `‚ ‚ ‚ `;
‚¤‚¤‚¤‚¤‚¤
DESC `‚ ‚ ‚ `;
Field Type Null Key Default Extra
-‚«‚«‚« char(6) NO
+‚«‚«‚« char(6) NO NULL
SHOW CREATE TABLE `‚ ‚ ‚ `;
Table Create Table
‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` (
- `‚«‚«‚«` char(6) NOT NULL DEFAULT ''
+ `‚«‚«‚«` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=sjis
ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST;
ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`;
@@ -453,14 +453,14 @@ NULL ”\”\”\”\”\ NULL NULL
DESC `ƒ\ƒ\ƒ\`;
Field Type Null Key Default Extra
\\ char(1) YES MUL NULL
-•\•\•\ char(6) NO PRI
+•\•\•\ char(6) NO PRI NULL
”\”\”\ char(1) YES UNI NULL
—\—\—\ char(1) YES NULL
SHOW CREATE TABLE `ƒ\ƒ\ƒ\`;
Table Create Table
ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` (
`\\` char(1) DEFAULT NULL,
- `•\•\•\` char(6) NOT NULL DEFAULT '',
+ `•\•\•\` char(6) NOT NULL,
`”\”\”\` char(1) DEFAULT NULL,
`—\—\—\` char(1) DEFAULT NULL,
PRIMARY KEY (`•\•\•\`),
@@ -480,11 +480,11 @@ SELECT * FROM `ƒ\ƒ\ƒ\`;
”\”\”\”\”\
DESC `ƒ\ƒ\ƒ\`;
Field Type Null Key Default Extra
-•\•\•\ char(6) NO
+•\•\•\ char(6) NO NULL
SHOW CREATE TABLE `ƒ\ƒ\ƒ\`;
Table Create Table
ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` (
- `•\•\•\` char(6) NOT NULL DEFAULT ''
+ `•\•\•\` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=sjis
DROP TABLE `±±±`;
DROP TABLE `²²²`;
diff --git a/mysql-test/suite/jp/r/jp_alter_ucs2.result b/mysql-test/suite/jp/r/jp_alter_ucs2.result
index 7cbd8859ac1..204913250cc 100644
--- a/mysql-test/suite/jp/r/jp_alter_ucs2.result
+++ b/mysql-test/suite/jp/r/jp_alter_ucs2.result
@@ -32,14 +32,14 @@ NULL Ž³Ž³Ž³Ž³Ž³ NULL NULL
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
Ž¶Ž¶ char(1) YES MUL NULL
-Ž·Ž·Ž· char(6) NO PRI
+Ž·Ž·Ž· char(6) NO PRI NULL
Ž¸Ž¸Ž¸ char(1) YES UNI NULL
Ž¹Ž¹Ž¹ char(1) YES NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
`Ž¶Ž¶` char(1) DEFAULT NULL,
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT '',
+ `Ž·Ž·Ž·` char(6) NOT NULL,
`Ž¸Ž¸Ž¸` char(1) DEFAULT NULL,
`Ž¹Ž¹Ž¹` char(1) DEFAULT NULL,
PRIMARY KEY (`Ž·Ž·Ž·`),
@@ -59,11 +59,11 @@ SELECT * FROM `Ž±Ž±Ž±`;
Ž³Ž³Ž³Ž³Ž³
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
-Ž·Ž·Ž· char(6) NO
+Ž·Ž·Ž· char(6) NO NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT ''
+ `Ž·Ž·Ž·` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=ucs2
ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST;
ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`;
@@ -81,14 +81,14 @@ NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
¤«¤« char(1) YES MUL NULL
-¤­¤­¤­ char(6) NO PRI
+¤­¤­¤­ char(6) NO PRI NULL
¤¯¤¯¤¯ char(1) YES UNI NULL
¤±¤±¤± char(1) YES NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
`¤«¤«` char(1) DEFAULT NULL,
- `¤­¤­¤­` char(6) NOT NULL DEFAULT '',
+ `¤­¤­¤­` char(6) NOT NULL,
`¤¯¤¯¤¯` char(1) DEFAULT NULL,
`¤±¤±¤±` char(1) DEFAULT NULL,
PRIMARY KEY (`¤­¤­¤­`),
@@ -108,11 +108,11 @@ SELECT * FROM `¤¢¤¢¤¢`;
¤¦¤¦¤¦¤¦¤¦
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
-¤­¤­¤­ char(6) NO
+¤­¤­¤­ char(6) NO NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
- `¤­¤­¤­` char(6) NOT NULL DEFAULT ''
+ `¤­¤­¤­` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=ucs2
ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST;
ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`;
@@ -130,14 +130,14 @@ NULL °£°£°£°£°£ NULL NULL
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
°¢°¢ char(1) YES MUL NULL
-°¡°¡°¡ char(6) NO PRI
+°¡°¡°¡ char(6) NO PRI NULL
°£°£°£ char(1) YES UNI NULL
°´°´°´ char(1) YES NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
`°¢°¢` char(1) DEFAULT NULL,
- `°¡°¡°¡` char(6) NOT NULL DEFAULT '',
+ `°¡°¡°¡` char(6) NOT NULL,
`°£°£°£` char(1) DEFAULT NULL,
`°´°´°´` char(1) DEFAULT NULL,
PRIMARY KEY (`°¡°¡°¡`),
@@ -157,11 +157,11 @@ SELECT * FROM `íÝíÝíÝ`;
°£°£°£°£°£
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
-°¡°¡°¡ char(6) NO
+°¡°¡°¡ char(6) NO NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
- `°¡°¡°¡` char(6) NOT NULL DEFAULT ''
+ `°¡°¡°¡` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=ucs2
DROP TABLE `Ž±Ž±Ž±`;
DROP TABLE `Ž²Ž²Ž²`;
@@ -194,14 +194,14 @@ NULL Ž³Ž³Ž³Ž³Ž³ NULL NULL
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
Ž¶Ž¶ char(1) YES MUL NULL
-Ž·Ž·Ž· char(6) NO PRI
+Ž·Ž·Ž· char(6) NO PRI NULL
Ž¸Ž¸Ž¸ char(1) YES UNI NULL
Ž¹Ž¹Ž¹ char(1) YES NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
`Ž¶Ž¶` char(1) DEFAULT NULL,
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT '',
+ `Ž·Ž·Ž·` char(6) NOT NULL,
`Ž¸Ž¸Ž¸` char(1) DEFAULT NULL,
`Ž¹Ž¹Ž¹` char(1) DEFAULT NULL,
PRIMARY KEY (`Ž·Ž·Ž·`),
@@ -221,11 +221,11 @@ SELECT * FROM `Ž±Ž±Ž±`;
Ž³Ž³Ž³Ž³Ž³
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
-Ž·Ž·Ž· char(6) NO
+Ž·Ž·Ž· char(6) NO NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT ''
+ `Ž·Ž·Ž·` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ucs2
ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST;
ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`;
@@ -243,14 +243,14 @@ NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
¤«¤« char(1) YES MUL NULL
-¤­¤­¤­ char(6) NO PRI
+¤­¤­¤­ char(6) NO PRI NULL
¤¯¤¯¤¯ char(1) YES UNI NULL
¤±¤±¤± char(1) YES NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
`¤«¤«` char(1) DEFAULT NULL,
- `¤­¤­¤­` char(6) NOT NULL DEFAULT '',
+ `¤­¤­¤­` char(6) NOT NULL,
`¤¯¤¯¤¯` char(1) DEFAULT NULL,
`¤±¤±¤±` char(1) DEFAULT NULL,
PRIMARY KEY (`¤­¤­¤­`),
@@ -270,11 +270,11 @@ SELECT * FROM `¤¢¤¢¤¢`;
¤¦¤¦¤¦¤¦¤¦
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
-¤­¤­¤­ char(6) NO
+¤­¤­¤­ char(6) NO NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
- `¤­¤­¤­` char(6) NOT NULL DEFAULT ''
+ `¤­¤­¤­` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ucs2
ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST;
ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`;
@@ -292,14 +292,14 @@ NULL °£°£°£°£°£ NULL NULL
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
°¢°¢ char(1) YES MUL NULL
-°¡°¡°¡ char(6) NO PRI
+°¡°¡°¡ char(6) NO PRI NULL
°£°£°£ char(1) YES UNI NULL
°´°´°´ char(1) YES NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
`°¢°¢` char(1) DEFAULT NULL,
- `°¡°¡°¡` char(6) NOT NULL DEFAULT '',
+ `°¡°¡°¡` char(6) NOT NULL,
`°£°£°£` char(1) DEFAULT NULL,
`°´°´°´` char(1) DEFAULT NULL,
PRIMARY KEY (`°¡°¡°¡`),
@@ -319,11 +319,11 @@ SELECT * FROM `íÝíÝíÝ`;
°£°£°£°£°£
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
-°¡°¡°¡ char(6) NO
+°¡°¡°¡ char(6) NO NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
- `°¡°¡°¡` char(6) NOT NULL DEFAULT ''
+ `°¡°¡°¡` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ucs2
DROP TABLE `Ž±Ž±Ž±`;
DROP TABLE `Ž²Ž²Ž²`;
@@ -356,14 +356,14 @@ NULL Ž³Ž³Ž³Ž³Ž³ NULL NULL
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
Ž¶Ž¶ char(1) YES MUL NULL
-Ž·Ž·Ž· char(6) NO PRI
+Ž·Ž·Ž· char(6) NO PRI NULL
Ž¸Ž¸Ž¸ char(1) YES UNI NULL
Ž¹Ž¹Ž¹ char(1) YES NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
`Ž¶Ž¶` char(1) DEFAULT NULL,
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT '',
+ `Ž·Ž·Ž·` char(6) NOT NULL,
`Ž¸Ž¸Ž¸` char(1) DEFAULT NULL,
`Ž¹Ž¹Ž¹` char(1) DEFAULT NULL,
PRIMARY KEY (`Ž·Ž·Ž·`),
@@ -383,11 +383,11 @@ SELECT * FROM `Ž±Ž±Ž±`;
Ž³Ž³Ž³Ž³Ž³
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
-Ž·Ž·Ž· char(6) NO
+Ž·Ž·Ž· char(6) NO NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT ''
+ `Ž·Ž·Ž·` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=ucs2
ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST;
ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`;
@@ -405,14 +405,14 @@ NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
¤«¤« char(1) YES MUL NULL
-¤­¤­¤­ char(6) NO PRI
+¤­¤­¤­ char(6) NO PRI NULL
¤¯¤¯¤¯ char(1) YES UNI NULL
¤±¤±¤± char(1) YES NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
`¤«¤«` char(1) DEFAULT NULL,
- `¤­¤­¤­` char(6) NOT NULL DEFAULT '',
+ `¤­¤­¤­` char(6) NOT NULL,
`¤¯¤¯¤¯` char(1) DEFAULT NULL,
`¤±¤±¤±` char(1) DEFAULT NULL,
PRIMARY KEY (`¤­¤­¤­`),
@@ -432,11 +432,11 @@ SELECT * FROM `¤¢¤¢¤¢`;
¤¦¤¦¤¦¤¦¤¦
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
-¤­¤­¤­ char(6) NO
+¤­¤­¤­ char(6) NO NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
- `¤­¤­¤­` char(6) NOT NULL DEFAULT ''
+ `¤­¤­¤­` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=ucs2
ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST;
ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`;
@@ -454,14 +454,14 @@ NULL °£°£°£°£°£ NULL NULL
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
°¢°¢ char(1) YES MUL NULL
-°¡°¡°¡ char(6) NO PRI
+°¡°¡°¡ char(6) NO PRI NULL
°£°£°£ char(1) YES UNI NULL
°´°´°´ char(1) YES NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
`°¢°¢` char(1) DEFAULT NULL,
- `°¡°¡°¡` char(6) NOT NULL DEFAULT '',
+ `°¡°¡°¡` char(6) NOT NULL,
`°£°£°£` char(1) DEFAULT NULL,
`°´°´°´` char(1) DEFAULT NULL,
PRIMARY KEY (`°¡°¡°¡`),
@@ -481,11 +481,11 @@ SELECT * FROM `íÝíÝíÝ`;
°£°£°£°£°£
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
-°¡°¡°¡ char(6) NO
+°¡°¡°¡ char(6) NO NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
- `°¡°¡°¡` char(6) NOT NULL DEFAULT ''
+ `°¡°¡°¡` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=ucs2
DROP TABLE `Ž±Ž±Ž±`;
DROP TABLE `Ž²Ž²Ž²`;
diff --git a/mysql-test/suite/jp/r/jp_alter_ujis.result b/mysql-test/suite/jp/r/jp_alter_ujis.result
index 7e4f19342f6..a46da01e1cd 100644
--- a/mysql-test/suite/jp/r/jp_alter_ujis.result
+++ b/mysql-test/suite/jp/r/jp_alter_ujis.result
@@ -31,14 +31,14 @@ NULL Ž³Ž³Ž³Ž³Ž³ NULL NULL
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
Ž¶Ž¶ char(1) YES MUL NULL
-Ž·Ž·Ž· char(6) NO PRI
+Ž·Ž·Ž· char(6) NO PRI NULL
Ž¸Ž¸Ž¸ char(1) YES UNI NULL
Ž¹Ž¹Ž¹ char(1) YES NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
`Ž¶Ž¶` char(1) DEFAULT NULL,
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT '',
+ `Ž·Ž·Ž·` char(6) NOT NULL,
`Ž¸Ž¸Ž¸` char(1) DEFAULT NULL,
`Ž¹Ž¹Ž¹` char(1) DEFAULT NULL,
PRIMARY KEY (`Ž·Ž·Ž·`),
@@ -58,11 +58,11 @@ SELECT * FROM `Ž±Ž±Ž±`;
Ž³Ž³Ž³Ž³Ž³
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
-Ž·Ž·Ž· char(6) NO
+Ž·Ž·Ž· char(6) NO NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT ''
+ `Ž·Ž·Ž·` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=ujis
ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST;
ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`;
@@ -80,14 +80,14 @@ NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
¤«¤« char(1) YES MUL NULL
-¤­¤­¤­ char(6) NO PRI
+¤­¤­¤­ char(6) NO PRI NULL
¤¯¤¯¤¯ char(1) YES UNI NULL
¤±¤±¤± char(1) YES NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
`¤«¤«` char(1) DEFAULT NULL,
- `¤­¤­¤­` char(6) NOT NULL DEFAULT '',
+ `¤­¤­¤­` char(6) NOT NULL,
`¤¯¤¯¤¯` char(1) DEFAULT NULL,
`¤±¤±¤±` char(1) DEFAULT NULL,
PRIMARY KEY (`¤­¤­¤­`),
@@ -107,11 +107,11 @@ SELECT * FROM `¤¢¤¢¤¢`;
¤¦¤¦¤¦¤¦¤¦
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
-¤­¤­¤­ char(6) NO
+¤­¤­¤­ char(6) NO NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
- `¤­¤­¤­` char(6) NOT NULL DEFAULT ''
+ `¤­¤­¤­` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=ujis
ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST;
ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`;
@@ -129,14 +129,14 @@ NULL °£°£°£°£°£ NULL NULL
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
°¢°¢ char(1) YES MUL NULL
-°¡°¡°¡ char(6) NO PRI
+°¡°¡°¡ char(6) NO PRI NULL
°£°£°£ char(1) YES UNI NULL
°´°´°´ char(1) YES NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
`°¢°¢` char(1) DEFAULT NULL,
- `°¡°¡°¡` char(6) NOT NULL DEFAULT '',
+ `°¡°¡°¡` char(6) NOT NULL,
`°£°£°£` char(1) DEFAULT NULL,
`°´°´°´` char(1) DEFAULT NULL,
PRIMARY KEY (`°¡°¡°¡`),
@@ -156,11 +156,11 @@ SELECT * FROM `íÝíÝíÝ`;
°£°£°£°£°£
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
-°¡°¡°¡ char(6) NO
+°¡°¡°¡ char(6) NO NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
- `°¡°¡°¡` char(6) NOT NULL DEFAULT ''
+ `°¡°¡°¡` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=ujis
DROP TABLE `Ž±Ž±Ž±`;
DROP TABLE `Ž²Ž²Ž²`;
@@ -193,14 +193,14 @@ NULL Ž³Ž³Ž³Ž³Ž³ NULL NULL
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
Ž¶Ž¶ char(1) YES MUL NULL
-Ž·Ž·Ž· char(6) NO PRI
+Ž·Ž·Ž· char(6) NO PRI NULL
Ž¸Ž¸Ž¸ char(1) YES UNI NULL
Ž¹Ž¹Ž¹ char(1) YES NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
`Ž¶Ž¶` char(1) DEFAULT NULL,
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT '',
+ `Ž·Ž·Ž·` char(6) NOT NULL,
`Ž¸Ž¸Ž¸` char(1) DEFAULT NULL,
`Ž¹Ž¹Ž¹` char(1) DEFAULT NULL,
PRIMARY KEY (`Ž·Ž·Ž·`),
@@ -220,11 +220,11 @@ SELECT * FROM `Ž±Ž±Ž±`;
Ž³Ž³Ž³Ž³Ž³
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
-Ž·Ž·Ž· char(6) NO
+Ž·Ž·Ž· char(6) NO NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT ''
+ `Ž·Ž·Ž·` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ujis
ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST;
ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`;
@@ -242,14 +242,14 @@ NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
¤«¤« char(1) YES MUL NULL
-¤­¤­¤­ char(6) NO PRI
+¤­¤­¤­ char(6) NO PRI NULL
¤¯¤¯¤¯ char(1) YES UNI NULL
¤±¤±¤± char(1) YES NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
`¤«¤«` char(1) DEFAULT NULL,
- `¤­¤­¤­` char(6) NOT NULL DEFAULT '',
+ `¤­¤­¤­` char(6) NOT NULL,
`¤¯¤¯¤¯` char(1) DEFAULT NULL,
`¤±¤±¤±` char(1) DEFAULT NULL,
PRIMARY KEY (`¤­¤­¤­`),
@@ -269,11 +269,11 @@ SELECT * FROM `¤¢¤¢¤¢`;
¤¦¤¦¤¦¤¦¤¦
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
-¤­¤­¤­ char(6) NO
+¤­¤­¤­ char(6) NO NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
- `¤­¤­¤­` char(6) NOT NULL DEFAULT ''
+ `¤­¤­¤­` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ujis
ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST;
ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`;
@@ -291,14 +291,14 @@ NULL °£°£°£°£°£ NULL NULL
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
°¢°¢ char(1) YES MUL NULL
-°¡°¡°¡ char(6) NO PRI
+°¡°¡°¡ char(6) NO PRI NULL
°£°£°£ char(1) YES UNI NULL
°´°´°´ char(1) YES NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
`°¢°¢` char(1) DEFAULT NULL,
- `°¡°¡°¡` char(6) NOT NULL DEFAULT '',
+ `°¡°¡°¡` char(6) NOT NULL,
`°£°£°£` char(1) DEFAULT NULL,
`°´°´°´` char(1) DEFAULT NULL,
PRIMARY KEY (`°¡°¡°¡`),
@@ -318,11 +318,11 @@ SELECT * FROM `íÝíÝíÝ`;
°£°£°£°£°£
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
-°¡°¡°¡ char(6) NO
+°¡°¡°¡ char(6) NO NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
- `°¡°¡°¡` char(6) NOT NULL DEFAULT ''
+ `°¡°¡°¡` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ujis
DROP TABLE `Ž±Ž±Ž±`;
DROP TABLE `Ž²Ž²Ž²`;
@@ -355,14 +355,14 @@ NULL Ž³Ž³Ž³Ž³Ž³ NULL NULL
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
Ž¶Ž¶ char(1) YES MUL NULL
-Ž·Ž·Ž· char(6) NO PRI
+Ž·Ž·Ž· char(6) NO PRI NULL
Ž¸Ž¸Ž¸ char(1) YES UNI NULL
Ž¹Ž¹Ž¹ char(1) YES NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
`Ž¶Ž¶` char(1) DEFAULT NULL,
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT '',
+ `Ž·Ž·Ž·` char(6) NOT NULL,
`Ž¸Ž¸Ž¸` char(1) DEFAULT NULL,
`Ž¹Ž¹Ž¹` char(1) DEFAULT NULL,
PRIMARY KEY (`Ž·Ž·Ž·`),
@@ -382,11 +382,11 @@ SELECT * FROM `Ž±Ž±Ž±`;
Ž³Ž³Ž³Ž³Ž³
DESC `Ž±Ž±Ž±`;
Field Type Null Key Default Extra
-Ž·Ž·Ž· char(6) NO
+Ž·Ž·Ž· char(6) NO NULL
SHOW CREATE TABLE `Ž±Ž±Ž±`;
Table Create Table
Ž±Ž±Ž± CREATE TABLE `Ž±Ž±Ž±` (
- `Ž·Ž·Ž·` char(6) NOT NULL DEFAULT ''
+ `Ž·Ž·Ž·` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=ujis
ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST;
ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`;
@@ -404,14 +404,14 @@ NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
¤«¤« char(1) YES MUL NULL
-¤­¤­¤­ char(6) NO PRI
+¤­¤­¤­ char(6) NO PRI NULL
¤¯¤¯¤¯ char(1) YES UNI NULL
¤±¤±¤± char(1) YES NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
`¤«¤«` char(1) DEFAULT NULL,
- `¤­¤­¤­` char(6) NOT NULL DEFAULT '',
+ `¤­¤­¤­` char(6) NOT NULL,
`¤¯¤¯¤¯` char(1) DEFAULT NULL,
`¤±¤±¤±` char(1) DEFAULT NULL,
PRIMARY KEY (`¤­¤­¤­`),
@@ -431,11 +431,11 @@ SELECT * FROM `¤¢¤¢¤¢`;
¤¦¤¦¤¦¤¦¤¦
DESC `¤¢¤¢¤¢`;
Field Type Null Key Default Extra
-¤­¤­¤­ char(6) NO
+¤­¤­¤­ char(6) NO NULL
SHOW CREATE TABLE `¤¢¤¢¤¢`;
Table Create Table
¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` (
- `¤­¤­¤­` char(6) NOT NULL DEFAULT ''
+ `¤­¤­¤­` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=ujis
ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST;
ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`;
@@ -453,14 +453,14 @@ NULL °£°£°£°£°£ NULL NULL
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
°¢°¢ char(1) YES MUL NULL
-°¡°¡°¡ char(6) NO PRI
+°¡°¡°¡ char(6) NO PRI NULL
°£°£°£ char(1) YES UNI NULL
°´°´°´ char(1) YES NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
`°¢°¢` char(1) DEFAULT NULL,
- `°¡°¡°¡` char(6) NOT NULL DEFAULT '',
+ `°¡°¡°¡` char(6) NOT NULL,
`°£°£°£` char(1) DEFAULT NULL,
`°´°´°´` char(1) DEFAULT NULL,
PRIMARY KEY (`°¡°¡°¡`),
@@ -480,11 +480,11 @@ SELECT * FROM `íÝíÝíÝ`;
°£°£°£°£°£
DESC `íÝíÝíÝ`;
Field Type Null Key Default Extra
-°¡°¡°¡ char(6) NO
+°¡°¡°¡ char(6) NO NULL
SHOW CREATE TABLE `íÝíÝíÝ`;
Table Create Table
íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` (
- `°¡°¡°¡` char(6) NOT NULL DEFAULT ''
+ `°¡°¡°¡` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=ujis
DROP TABLE `Ž±Ž±Ž±`;
DROP TABLE `Ž²Ž²Ž²`;
diff --git a/mysql-test/suite/jp/r/jp_alter_utf8.result b/mysql-test/suite/jp/r/jp_alter_utf8.result
index b641e9de78d..847a5e628f5 100644
--- a/mysql-test/suite/jp/r/jp_alter_utf8.result
+++ b/mysql-test/suite/jp/r/jp_alter_utf8.result
@@ -31,14 +31,14 @@ NULL ウウウウウ NULL NULL
DESC `アアア`;
Field Type Null Key Default Extra
カカ char(1) YES MUL NULL
-ï½·ï½·ï½· char(6) NO PRI
+ï½·ï½·ï½· char(6) NO PRI NULL
ククク char(1) YES UNI NULL
ケケケ char(1) YES NULL
SHOW CREATE TABLE `アアア`;
Table Create Table
アアア CREATE TABLE `アアア` (
`カカ` char(1) DEFAULT NULL,
- `ï½·ï½·ï½·` char(6) NOT NULL DEFAULT '',
+ `ï½·ï½·ï½·` char(6) NOT NULL,
`ククク` char(1) DEFAULT NULL,
`ケケケ` char(1) DEFAULT NULL,
PRIMARY KEY (`ï½·ï½·ï½·`),
@@ -58,11 +58,11 @@ SELECT * FROM `アアア`;
ウウウウウ
DESC `アアア`;
Field Type Null Key Default Extra
-ï½·ï½·ï½· char(6) NO
+ï½·ï½·ï½· char(6) NO NULL
SHOW CREATE TABLE `アアア`;
Table Create Table
アアア CREATE TABLE `アアア` (
- `ï½·ï½·ï½·` char(6) NOT NULL DEFAULT ''
+ `ï½·ï½·ï½·` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST;
ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`;
@@ -80,14 +80,14 @@ NULL ã†ã†ã†ã†ã† NULL NULL
DESC `ã‚ã‚ã‚`;
Field Type Null Key Default Extra
ã‹ã‹ char(1) YES MUL NULL
-ããã char(6) NO PRI
+ããã char(6) NO PRI NULL
ããã char(1) YES UNI NULL
ã‘ã‘ã‘ char(1) YES NULL
SHOW CREATE TABLE `ã‚ã‚ã‚`;
Table Create Table
ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` (
`ã‹ã‹` char(1) DEFAULT NULL,
- `ããã` char(6) NOT NULL DEFAULT '',
+ `ããã` char(6) NOT NULL,
`ããã` char(1) DEFAULT NULL,
`ã‘ã‘ã‘` char(1) DEFAULT NULL,
PRIMARY KEY (`ããã`),
@@ -107,11 +107,11 @@ SELECT * FROM `ã‚ã‚ã‚`;
ã†ã†ã†ã†ã†
DESC `ã‚ã‚ã‚`;
Field Type Null Key Default Extra
-ããã char(6) NO
+ããã char(6) NO NULL
SHOW CREATE TABLE `ã‚ã‚ã‚`;
Table Create Table
ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` (
- `ããã` char(6) NOT NULL DEFAULT ''
+ `ããã` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
ALTER TABLE `龖龖龖` ADD `丄丄丄` char(1) FIRST;
ALTER TABLE `龖龖龖` ADD `丅丅丅` char(1) AFTER `丂丂丂`;
@@ -129,14 +129,14 @@ NULL 丅丅丅丅丅 NULL NULL
DESC `é¾–é¾–é¾–`;
Field Type Null Key Default Extra
丄丄 char(1) YES MUL NULL
-丂丂丂 char(6) NO PRI
+丂丂丂 char(6) NO PRI NULL
丅丅丅 char(1) YES UNI NULL
乚乚乚 char(1) YES NULL
SHOW CREATE TABLE `é¾–é¾–é¾–`;
Table Create Table
é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` (
`丄丄` char(1) DEFAULT NULL,
- `丂丂丂` char(6) NOT NULL DEFAULT '',
+ `丂丂丂` char(6) NOT NULL,
`丅丅丅` char(1) DEFAULT NULL,
`乚乚乚` char(1) DEFAULT NULL,
PRIMARY KEY (`丂丂丂`),
@@ -156,11 +156,11 @@ SELECT * FROM `é¾–é¾–é¾–`;
丅丅丅丅丅
DESC `é¾–é¾–é¾–`;
Field Type Null Key Default Extra
-丂丂丂 char(6) NO
+丂丂丂 char(6) NO NULL
SHOW CREATE TABLE `é¾–é¾–é¾–`;
Table Create Table
é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` (
- `丂丂丂` char(6) NOT NULL DEFAULT ''
+ `丂丂丂` char(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE `アアア`;
DROP TABLE `イイイ`;
@@ -193,14 +193,14 @@ NULL ウウウウウ NULL NULL
DESC `アアア`;
Field Type Null Key Default Extra
カカ char(1) YES MUL NULL
-ï½·ï½·ï½· char(6) NO PRI
+ï½·ï½·ï½· char(6) NO PRI NULL
ククク char(1) YES UNI NULL
ケケケ char(1) YES NULL
SHOW CREATE TABLE `アアア`;
Table Create Table
アアア CREATE TABLE `アアア` (
`カカ` char(1) DEFAULT NULL,
- `ï½·ï½·ï½·` char(6) NOT NULL DEFAULT '',
+ `ï½·ï½·ï½·` char(6) NOT NULL,
`ククク` char(1) DEFAULT NULL,
`ケケケ` char(1) DEFAULT NULL,
PRIMARY KEY (`ï½·ï½·ï½·`),
@@ -220,11 +220,11 @@ SELECT * FROM `アアア`;
ウウウウウ
DESC `アアア`;
Field Type Null Key Default Extra
-ï½·ï½·ï½· char(6) NO
+ï½·ï½·ï½· char(6) NO NULL
SHOW CREATE TABLE `アアア`;
Table Create Table
アアア CREATE TABLE `アアア` (
- `ï½·ï½·ï½·` char(6) NOT NULL DEFAULT ''
+ `ï½·ï½·ï½·` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST;
ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`;
@@ -242,14 +242,14 @@ NULL ã†ã†ã†ã†ã† NULL NULL
DESC `ã‚ã‚ã‚`;
Field Type Null Key Default Extra
ã‹ã‹ char(1) YES MUL NULL
-ããã char(6) NO PRI
+ããã char(6) NO PRI NULL
ããã char(1) YES UNI NULL
ã‘ã‘ã‘ char(1) YES NULL
SHOW CREATE TABLE `ã‚ã‚ã‚`;
Table Create Table
ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` (
`ã‹ã‹` char(1) DEFAULT NULL,
- `ããã` char(6) NOT NULL DEFAULT '',
+ `ããã` char(6) NOT NULL,
`ããã` char(1) DEFAULT NULL,
`ã‘ã‘ã‘` char(1) DEFAULT NULL,
PRIMARY KEY (`ããã`),
@@ -269,11 +269,11 @@ SELECT * FROM `ã‚ã‚ã‚`;
ã†ã†ã†ã†ã†
DESC `ã‚ã‚ã‚`;
Field Type Null Key Default Extra
-ããã char(6) NO
+ããã char(6) NO NULL
SHOW CREATE TABLE `ã‚ã‚ã‚`;
Table Create Table
ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` (
- `ããã` char(6) NOT NULL DEFAULT ''
+ `ããã` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
ALTER TABLE `龖龖龖` ADD `丄丄丄` char(1) FIRST;
ALTER TABLE `龖龖龖` ADD `丅丅丅` char(1) AFTER `丂丂丂`;
@@ -291,14 +291,14 @@ NULL 丅丅丅丅丅 NULL NULL
DESC `é¾–é¾–é¾–`;
Field Type Null Key Default Extra
丄丄 char(1) YES MUL NULL
-丂丂丂 char(6) NO PRI
+丂丂丂 char(6) NO PRI NULL
丅丅丅 char(1) YES UNI NULL
乚乚乚 char(1) YES NULL
SHOW CREATE TABLE `é¾–é¾–é¾–`;
Table Create Table
é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` (
`丄丄` char(1) DEFAULT NULL,
- `丂丂丂` char(6) NOT NULL DEFAULT '',
+ `丂丂丂` char(6) NOT NULL,
`丅丅丅` char(1) DEFAULT NULL,
`乚乚乚` char(1) DEFAULT NULL,
PRIMARY KEY (`丂丂丂`),
@@ -318,11 +318,11 @@ SELECT * FROM `é¾–é¾–é¾–`;
丅丅丅丅丅
DESC `é¾–é¾–é¾–`;
Field Type Null Key Default Extra
-丂丂丂 char(6) NO
+丂丂丂 char(6) NO NULL
SHOW CREATE TABLE `é¾–é¾–é¾–`;
Table Create Table
é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` (
- `丂丂丂` char(6) NOT NULL DEFAULT ''
+ `丂丂丂` char(6) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE `アアア`;
DROP TABLE `イイイ`;
@@ -355,14 +355,14 @@ NULL ウウウウウ NULL NULL
DESC `アアア`;
Field Type Null Key Default Extra
カカ char(1) YES MUL NULL
-ï½·ï½·ï½· char(6) NO PRI
+ï½·ï½·ï½· char(6) NO PRI NULL
ククク char(1) YES UNI NULL
ケケケ char(1) YES NULL
SHOW CREATE TABLE `アアア`;
Table Create Table
アアア CREATE TABLE `アアア` (
`カカ` char(1) DEFAULT NULL,
- `ï½·ï½·ï½·` char(6) NOT NULL DEFAULT '',
+ `ï½·ï½·ï½·` char(6) NOT NULL,
`ククク` char(1) DEFAULT NULL,
`ケケケ` char(1) DEFAULT NULL,
PRIMARY KEY (`ï½·ï½·ï½·`),
@@ -382,11 +382,11 @@ SELECT * FROM `アアア`;
ウウウウウ
DESC `アアア`;
Field Type Null Key Default Extra
-ï½·ï½·ï½· char(6) NO
+ï½·ï½·ï½· char(6) NO NULL
SHOW CREATE TABLE `アアア`;
Table Create Table
アアア CREATE TABLE `アアア` (
- `ï½·ï½·ï½·` char(6) NOT NULL DEFAULT ''
+ `ï½·ï½·ï½·` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST;
ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`;
@@ -404,14 +404,14 @@ NULL ã†ã†ã†ã†ã† NULL NULL
DESC `ã‚ã‚ã‚`;
Field Type Null Key Default Extra
ã‹ã‹ char(1) YES MUL NULL
-ããã char(6) NO PRI
+ããã char(6) NO PRI NULL
ããã char(1) YES UNI NULL
ã‘ã‘ã‘ char(1) YES NULL
SHOW CREATE TABLE `ã‚ã‚ã‚`;
Table Create Table
ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` (
`ã‹ã‹` char(1) DEFAULT NULL,
- `ããã` char(6) NOT NULL DEFAULT '',
+ `ããã` char(6) NOT NULL,
`ããã` char(1) DEFAULT NULL,
`ã‘ã‘ã‘` char(1) DEFAULT NULL,
PRIMARY KEY (`ããã`),
@@ -431,11 +431,11 @@ SELECT * FROM `ã‚ã‚ã‚`;
ã†ã†ã†ã†ã†
DESC `ã‚ã‚ã‚`;
Field Type Null Key Default Extra
-ããã char(6) NO
+ããã char(6) NO NULL
SHOW CREATE TABLE `ã‚ã‚ã‚`;
Table Create Table
ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` (
- `ããã` char(6) NOT NULL DEFAULT ''
+ `ããã` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
ALTER TABLE `龖龖龖` ADD `丄丄丄` char(1) FIRST;
ALTER TABLE `龖龖龖` ADD `丅丅丅` char(1) AFTER `丂丂丂`;
@@ -453,14 +453,14 @@ NULL 丅丅丅丅丅 NULL NULL
DESC `é¾–é¾–é¾–`;
Field Type Null Key Default Extra
丄丄 char(1) YES MUL NULL
-丂丂丂 char(6) NO PRI
+丂丂丂 char(6) NO PRI NULL
丅丅丅 char(1) YES UNI NULL
乚乚乚 char(1) YES NULL
SHOW CREATE TABLE `é¾–é¾–é¾–`;
Table Create Table
é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` (
`丄丄` char(1) DEFAULT NULL,
- `丂丂丂` char(6) NOT NULL DEFAULT '',
+ `丂丂丂` char(6) NOT NULL,
`丅丅丅` char(1) DEFAULT NULL,
`乚乚乚` char(1) DEFAULT NULL,
PRIMARY KEY (`丂丂丂`),
@@ -480,11 +480,11 @@ SELECT * FROM `é¾–é¾–é¾–`;
丅丅丅丅丅
DESC `é¾–é¾–é¾–`;
Field Type Null Key Default Extra
-丂丂丂 char(6) NO
+丂丂丂 char(6) NO NULL
SHOW CREATE TABLE `é¾–é¾–é¾–`;
Table Create Table
é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` (
- `丂丂丂` char(6) NOT NULL DEFAULT ''
+ `丂丂丂` char(6) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
DROP TABLE `アアア`;
DROP TABLE `イイイ`;
diff --git a/mysql-test/suite/jp/r/jp_convert_ucs2.result b/mysql-test/suite/jp/r/jp_convert_ucs2.result
index 5d5b0761ad8..842ddfa2ea7 100644
--- a/mysql-test/suite/jp/r/jp_convert_ucs2.result
+++ b/mysql-test/suite/jp/r/jp_convert_ucs2.result
@@ -160,6 +160,14 @@ SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`;
°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ????????????????????
í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ????????????????????
íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ????????????????????
+Warnings:
+Warning 1977 Cannot convert 'ucs2' character 0x02DB to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9EF8 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4E5A to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4EE1 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4F19 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9F2B to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9F57 to 'sjis'
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`;
£Ã£± CONVERT(`£Ã£±` using utf8)
Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯
@@ -235,6 +243,14 @@ SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`;
°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ????????????????????
í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ????????????????????
íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ????????????????????
+Warnings:
+Warning 1977 Cannot convert 'ucs2' character 0x02DB to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9EF8 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4E5A to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4EE1 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4F19 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9F2B to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9F57 to 'sjis'
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`;
£Ã£± CONVERT(`£Ã£±` using utf8)
PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_
@@ -310,6 +326,14 @@ SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`;
¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦???????????????????
í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ????????????????????
íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ????????????????????
+Warnings:
+Warning 1977 Cannot convert 'ucs2' character 0x02DB to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4E5A to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4EE1 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x4F19 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9EF8 to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9F2B to 'sjis'
+Warning 1977 Cannot convert 'ucs2' character 0x9F57 to 'sjis'
drop table `£Ô£±`;
drop table `£Ô£²`;
drop table `£Ô£³`;
diff --git a/mysql-test/suite/jp/r/jp_convert_ujis.result b/mysql-test/suite/jp/r/jp_convert_ujis.result
index 314a9e95086..d47f6b4ef25 100644
--- a/mysql-test/suite/jp/r/jp_convert_ujis.result
+++ b/mysql-test/suite/jp/r/jp_convert_ujis.result
@@ -393,6 +393,38 @@ SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`;
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0x8FA2F0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAADC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAF0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABDC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABF0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0B4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0DC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0F0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDDC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2B5 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA6F1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9A1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0A1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7F2 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA6E1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9C1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7C2 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2AF to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2EB to 'sjis'
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`;
£Ã£± CONVERT(`£Ã£±` using utf8)
!"#$%&'()*+,-./ !"#$%&'()*+,-./
@@ -759,6 +791,38 @@ SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`;
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0x8FA2F0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAADC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAF0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABDC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABF0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0B4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0DC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0F0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDDC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2B5 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA6F1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9A1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0A1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7F2 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA6E1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9C1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7C2 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2AF to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2EB to 'sjis'
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`;
£Ã£± CONVERT(`£Ã£±` using utf8)
!"#$%&'()*+,-./ !"#$%&'()*+,-./
@@ -1125,6 +1189,38 @@ SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`;
íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ????????????????????
íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
+Warnings:
+Warning 1977 Cannot convert 'ujis' character 0x8FA2AF to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2B5 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2EB to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA2F0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA6E1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA6F1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7C2 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA7F2 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9A1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9C1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FA9C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAADC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FAAF0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABDC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FABF0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0A1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0B4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0C8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0DC to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FB0F0 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDA1 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDB4 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDC8 to 'sjis'
+Warning 1977 Cannot convert 'ujis' character 0x8FEDDC to 'sjis'
drop table `£Ô£±`;
drop table `£Ô£²`;
drop table `£Ô£³`;
diff --git a/mysql-test/suite/jp/r/jp_convert_utf8.result b/mysql-test/suite/jp/r/jp_convert_utf8.result
index 5a47d5d687a..e33edfb1c3f 100644
--- a/mysql-test/suite/jp/r/jp_convert_utf8.result
+++ b/mysql-test/suite/jp/r/jp_convert_utf8.result
@@ -131,6 +131,8 @@ SELECT `C1`, CONVERT(`C1` using ujis) FROM `T2`;
456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG
HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・
ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBCBC to 'ujis'
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T2`;
C1 CONVERT(`C1` using ucs2)
θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・
@@ -267,6 +269,8 @@ SELECT `C1`, CONVERT(`C1` using sjis) FROM `T2`;
456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG
HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・
ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBCBC to 'sjis'
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T3`;
C1 CONVERT(`C1` using ujis)
êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ
@@ -309,6 +313,8 @@ SELECT `C1`, CONVERT(`C1` using ujis) FROM `T3`;
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖
齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’
龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBD9E to 'ujis'
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T3`;
C1 CONVERT(`C1` using ucs2)
êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ
@@ -393,6 +399,38 @@ SELECT `C1`, CONVERT(`C1` using sjis) FROM `T3`;
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ????????????????????
齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ????????????????????
龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xC3AA to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC38A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC4B4 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC4B5 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC59A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC59B to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC795 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC796 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC2A4 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC582 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD088 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC381 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC3A1 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC386 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCB9B to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCEAC to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD192 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCE86 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC3A6 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD082 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC2BA to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCB98 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4B882 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BBB8 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4B99A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BBA1 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BC99 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BD9F to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BCAB to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BD97 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BE94 to 'sjis'
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T4`;
C1 CONVERT(`C1` using ujis)
!"#$%&'()*+,-./ !"#$%&'()*+,-./
@@ -497,6 +535,8 @@ SELECT `C1`, CONVERT(`C1` using ujis) FROM `T5`;
456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG
HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・
ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBCBC to 'ujis'
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T5`;
C1 CONVERT(`C1` using ucs2)
θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・
@@ -633,6 +673,8 @@ SELECT `C1`, CONVERT(`C1` using sjis) FROM `T5`;
456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG
HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・
ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBCBC to 'sjis'
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T6`;
C1 CONVERT(`C1` using ujis)
êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ
@@ -675,6 +717,8 @@ SELECT `C1`, CONVERT(`C1` using ujis) FROM `T6`;
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖
齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’
龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBD9E to 'ujis'
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T6`;
C1 CONVERT(`C1` using ucs2)
êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ
@@ -759,6 +803,38 @@ SELECT `C1`, CONVERT(`C1` using sjis) FROM `T6`;
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ????????????????????
齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ????????????????????
龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xC3AA to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC38A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC4B4 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC4B5 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC59A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC59B to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC795 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC796 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC2A4 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC582 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD088 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC381 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC3A1 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC386 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCB9B to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCEAC to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD192 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCE86 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC3A6 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD082 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC2BA to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCB98 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4B882 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BBB8 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4B99A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BBA1 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BC99 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BD9F to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BCAB to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BD97 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BE94 to 'sjis'
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T7`;
C1 CONVERT(`C1` using ujis)
!"#$%&'()*+,-./ !"#$%&'()*+,-./
@@ -863,6 +939,8 @@ SELECT `C1`, CONVERT(`C1` using ujis) FROM `T8`;
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBCBC to 'ujis'
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T8`;
C1 CONVERT(`C1` using ucs2)
  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½
@@ -999,6 +1077,8 @@ SELECT `C1`, CONVERT(`C1` using sjis) FROM `T8`;
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBCBC to 'sjis'
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T9`;
C1 CONVERT(`C1` using ujis)
ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë
@@ -1041,6 +1121,8 @@ SELECT `C1`, CONVERT(`C1` using ujis) FROM `T9`;
齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’
龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xEFBD9E to 'ujis'
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T9`;
C1 CONVERT(`C1` using ucs2)
ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë
@@ -1125,6 +1207,38 @@ SELECT `C1`, CONVERT(`C1` using sjis) FROM `T9`;
齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ????????????????????
龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・
+Warnings:
+Warning 1977 Cannot convert 'utf8' character 0xCB98 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCB9B to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC2BA to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC2A4 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCE86 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xCEAC to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD082 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD088 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xD192 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC386 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC3A6 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC582 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC381 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC38A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC4B4 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC59A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC795 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC3A1 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC3AA to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC4B5 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC59B to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xC796 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4B882 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4B99A to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BBA1 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BC99 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE4BD9F to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BBB8 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BCAB to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BD97 to 'sjis'
+Warning 1977 Cannot convert 'utf8' character 0xE9BE94 to 'sjis'
drop table `T1`;
drop table `ï¼´ï¼’`;
drop table `T3`;
diff --git a/mysql-test/suite/maria/collations.result b/mysql-test/suite/maria/collations.result
new file mode 100644
index 00000000000..86f7117c378
--- /dev/null
+++ b/mysql-test/suite/maria/collations.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_croatian_ci, KEY(a)) ENGINE=ARIA;
+INSERT INTO t1 VALUES ('na'),('nj'),('nz'),('Z');
+explain SELECT a FROM t1 ORDER BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 33 NULL 4 Using index
+SELECT a FROM t1 ORDER BY a;
+a
+na
+nz
+nj
+Z
+ALTER TABLE t1 engine=myisam;
+explain SELECT a FROM t1 ORDER BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 33 NULL 4 Using index
+SELECT a FROM t1 ORDER BY a;
+a
+na
+nz
+nj
+Z
+drop table t1;
diff --git a/mysql-test/suite/maria/collations.test b/mysql-test/suite/maria/collations.test
new file mode 100644
index 00000000000..fe93e1913a7
--- /dev/null
+++ b/mysql-test/suite/maria/collations.test
@@ -0,0 +1,14 @@
+#
+# Test 2-byte collations
+#
+
+DROP TABLE IF EXISTS t1;
+
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_croatian_ci, KEY(a)) ENGINE=ARIA;
+INSERT INTO t1 VALUES ('na'),('nj'),('nz'),('Z');
+explain SELECT a FROM t1 ORDER BY a;
+SELECT a FROM t1 ORDER BY a;
+ALTER TABLE t1 engine=myisam;
+explain SELECT a FROM t1 ORDER BY a;
+SELECT a FROM t1 ORDER BY a;
+drop table t1;
diff --git a/mysql-test/suite/maria/encrypt-wrong-key.result b/mysql-test/suite/maria/encrypt-wrong-key.result
new file mode 100644
index 00000000000..bc22481296d
--- /dev/null
+++ b/mysql-test/suite/maria/encrypt-wrong-key.result
@@ -0,0 +1,16 @@
+call mtr.add_suppression("file_key_management");
+call mtr.add_suppression("System key id 1 is missing");
+call mtr.add_suppression("Unknown key id 1");
+call mtr.add_suppression("Failed to decrypt");
+CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria;
+INSERT INTO t1 VALUES (1);
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair info Wrong CRC on datapage at 1
+test.t1 repair warning Number of rows changed from 1 to 0
+test.t1 repair status OK
+INSERT INTO t1 VALUES (2);
+select * from t1;
+ERROR HY000: failed to decrypt './test/t1' rc: -1 dstlen: 0 size: 8172
+
+drop table t1;
diff --git a/mysql-test/suite/maria/encrypt-wrong-key.test b/mysql-test/suite/maria/encrypt-wrong-key.test
new file mode 100644
index 00000000000..6f59952c1fa
--- /dev/null
+++ b/mysql-test/suite/maria/encrypt-wrong-key.test
@@ -0,0 +1,54 @@
+--source include/not_embedded.inc
+
+#
+# Test what happens if one removes a decryption key for Aria
+#
+
+call mtr.add_suppression("file_key_management");
+call mtr.add_suppression("System key id 1 is missing");
+call mtr.add_suppression("Unknown key id 1");
+call mtr.add_suppression("Failed to decrypt");
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/keys1.txt
+1;770A8A65DA156D24EE2A093277530142
+EOF
+
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria;
+INSERT INTO t1 VALUES (1);
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/keys2.txt
+2;770A8A65DA156D24EE2A093277530143
+EOF
+
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+repair table t1;
+
+INSERT INTO t1 VALUES (2);
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--replace_result \\ /
+--error 192
+select * from t1;
+drop table t1;
diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result
index cc03898f054..e37877c8527 100644
--- a/mysql-test/suite/maria/icp.result
+++ b/mysql-test/suite/maria/icp.result
@@ -416,17 +416,11 @@ DROP TABLE t1;
# Bug#59259 "Incorrect rows returned for a correlated subquery
# when ICP is on"
#
-CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine Aria for table 't1'
+CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t1 VALUES (11,0);
INSERT INTO t1 VALUES (12,5);
INSERT INTO t1 VALUES (15,0);
-CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
-Warnings:
-Warning 1286 Unknown storage engine 'InnoDB'
-Warning 1266 Using storage engine Aria for table 't2'
+CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t2 VALUES (11,1);
INSERT INTO t2 VALUES (12,2);
INSERT INTO t2 VALUES (15,4);
@@ -606,6 +600,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
d1 pk i1
1 4 1
+EXPLAIN
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL k1 9 NULL 3 Using index
+1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+d1 pk i1
+1 4 1
DROP TABLE t1, t2;
#
# BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89
diff --git a/mysql-test/suite/maria/maria-recovery2-master.opt b/mysql-test/suite/maria/maria-recovery2-master.opt
index 9b232472a24..ca9560676a5 100644
--- a/mysql-test/suite/maria/maria-recovery2-master.opt
+++ b/mysql-test/suite/maria/maria-recovery2-master.opt
@@ -1 +1 @@
---skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp --myisam-recover=
+--skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp --myisam-recover-options=
diff --git a/mysql-test/suite/maria/maria-recovery3.result b/mysql-test/suite/maria/maria-recovery3.result
index d71a3f6c00a..84fd6fbb91e 100644
--- a/mysql-test/suite/maria/maria-recovery3.result
+++ b/mysql-test/suite/maria/maria-recovery3.result
@@ -78,7 +78,7 @@ ERROR HY000: Lost connection to MySQL server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
-mysqltest.t1 check warning Size of indexfile is: 372 Expected: 8192
+mysqltest.t1 check warning Size of indexfile is: <SIZE> Expected: 8192
mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
diff --git a/mysql-test/suite/maria/maria2.result b/mysql-test/suite/maria/maria2.result
index a0ec440b662..b4b27512054 100644
--- a/mysql-test/suite/maria/maria2.result
+++ b/mysql-test/suite/maria/maria2.result
@@ -46,12 +46,22 @@ drop table t1;
create table t1 (pk int primary key, apk int unique, data int) engine=aria;
insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
load data concurrent infile '../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+Warnings:
+Note 1265 Data truncated for column 'pk' at row 1
+Note 1265 Data truncated for column 'apk' at row 1
+Note 1265 Data truncated for column 'pk' at row 2
+Note 1265 Data truncated for column 'apk' at row 2
select * from t1 order by pk;
pk apk data
1 1 1
3 4 NULL
5 6 NULL
load data infile '../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+Warnings:
+Note 1265 Data truncated for column 'pk' at row 1
+Note 1265 Data truncated for column 'apk' at row 1
+Note 1265 Data truncated for column 'pk' at row 2
+Note 1265 Data truncated for column 'apk' at row 2
select * from t1 order by pk;
pk apk data
1 1 1
diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result
index 74eed530bd9..feb5fa82cd4 100644
--- a/mysql-test/suite/maria/maria3.result
+++ b/mysql-test/suite/maria/maria3.result
@@ -305,6 +305,7 @@ Variable_name Value
aria_block_size 8192
aria_checkpoint_interval 30
aria_checkpoint_log_activity 1048576
+aria_encrypt_tables OFF
aria_force_start_after_recovery_failures 0
aria_group_commit none
aria_group_commit_interval 0
diff --git a/mysql-test/suite/maria/ps_maria.result b/mysql-test/suite/maria/ps_maria.result
index 774bf8af54a..c5defa8ae54 100644
--- a/mysql-test/suite/maria/ps_maria.result
+++ b/mysql-test/suite/maria/ps_maria.result
@@ -10,7 +10,8 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
+c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -49,7 +50,7 @@ test_sequence
prepare stmt1 from ' select * from t9 order by c1 ' ;
execute stmt1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
+def test t9 t9 c1 c1 1 4 1 N 53251 0 63
def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
@@ -1156,9 +1157,9 @@ def id 8 3 1 Y 32928 0 63
def select_type 253 19 6 N 1 31 8
def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
+def possible_keys 253 4_OR_8_K 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 0 31 8
+def key_len 253 4_OR_8_K 0 Y 0 31 8
def ref 253 2048 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1775,21 +1776,21 @@ NULL as const12, @arg12 as param12,
show create table t5 ;
Table Create Table
t5 CREATE TABLE `t5` (
- `const01` int(1) NOT NULL DEFAULT '0',
+ `const01` int(1) NOT NULL,
`param01` bigint(20) DEFAULT NULL,
- `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `const02` decimal(2,1) NOT NULL,
`param02` decimal(65,30) DEFAULT NULL,
- `const03` double NOT NULL DEFAULT '0',
+ `const03` double NOT NULL,
`param03` double DEFAULT NULL,
- `const04` varchar(3) NOT NULL DEFAULT '',
+ `const04` varchar(3) NOT NULL,
`param04` longtext,
- `const05` varbinary(3) NOT NULL DEFAULT '',
+ `const05` varbinary(3) NOT NULL,
`param05` longblob,
- `const06` varchar(10) NOT NULL DEFAULT '',
+ `const06` varchar(10) NOT NULL,
`param06` longtext,
`const07` date DEFAULT NULL,
`param07` longtext,
- `const08` varchar(19) NOT NULL DEFAULT '',
+ `const08` varchar(19) NOT NULL,
`param08` longtext,
`const09` datetime DEFAULT NULL,
`param09` longtext,
@@ -1805,21 +1806,21 @@ t5 CREATE TABLE `t5` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 3 1 1 N 32769 0 63
+def test t5 t5 const01 const01 3 1 1 N 36865 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 const02 const02 246 4 3 N 36865 1 63
def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
-def test t5 t5 const03 const03 5 17 1 N 32769 31 63
+def test t5 t5 const03 const03 5 17 1 N 36865 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
-def test t5 t5 const04 const04 253 3 3 N 1 0 8
+def test t5 t5 const04 const04 253 3 3 N 4097 0 8
def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
-def test t5 t5 const05 const05 253 3 3 N 129 0 63
+def test t5 t5 const05 const05 253 3 3 N 4225 0 63
def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
+def test t5 t5 const06 const06 253 10 10 N 4097 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
+def test t5 t5 const08 const08 253 19 19 N 4097 0 8
def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.result b/mysql-test/suite/mariabackup/apply-log-only-incr.result
new file mode 100644
index 00000000000..f724d1d1fdc
--- /dev/null
+++ b/mysql-test/suite/mariabackup/apply-log-only-incr.result
@@ -0,0 +1,33 @@
+call mtr.add_suppression("InnoDB: New log files created");
+CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
+INSERT INTO t VALUES(0);
+COMMIT;
+start transaction;
+BEGIN;
+DELETE FROM t LIMIT 1;
+SET GLOBAL innodb_flush_log_at_trx_commit = 1;
+ROLLBACK;
+NOT FOUND /Rollback of trx with id/ in current_test
+# expect NOT FOUND
+NOT FOUND /Rollback of trx with id/ in current_test
+# expect NOT FOUND
+commit;
+SELECT count(*) FROM t;
+count(*)
+201
+# Restore and check results
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT COUNT(*) FROM t;
+COUNT(*)
+1
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT COUNT(*) FROM t;
+COUNT(*)
+201
+SELECT * FROM t;
+a
+0
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.test b/mysql-test/suite/mariabackup/apply-log-only-incr.test
new file mode 100644
index 00000000000..81c91d3c452
--- /dev/null
+++ b/mysql-test/suite/mariabackup/apply-log-only-incr.test
@@ -0,0 +1,70 @@
+--source include/have_innodb.inc
+
+call mtr.add_suppression("InnoDB: New log files created");
+
+let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
+let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+
+CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
+INSERT INTO t VALUES(0);
+COMMIT;
+
+start transaction;
+--disable_query_log
+let $n=100;
+while ($n) {
+eval INSERT t VALUES(101-$n);
+dec $n;
+}
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
+--enable_result_log
+let $n=100;
+while ($n) {
+eval INSERT t VALUES(201-$n);
+dec $n;
+}
+--enable_query_log
+connect (flush_log,localhost,root,,);
+BEGIN;
+DELETE FROM t LIMIT 1;
+SET GLOBAL innodb_flush_log_at_trx_commit = 1;
+ROLLBACK;
+disconnect flush_log;
+connection default;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ;
+--enable_result_log
+
+let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test;
+--let SEARCH_PATTERN= Rollback of trx with id
+--source include/search_pattern_in_file.inc
+--echo # expect NOT FOUND
+
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
+
+--source include/search_pattern_in_file.inc
+--echo # expect NOT FOUND
+
+commit;
+SELECT count(*) FROM t;
+echo # Restore and check results;
+--let $targetdir=$basedir
+--let $restart_parameters= --innodb-force-recovery=3
+--source include/restart_and_restore.inc
+
+rmdir $basedir;
+rmdir $incremental_dir;
+
+SELECT COUNT(*) FROM t;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT COUNT(*) FROM t;
+
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+
+SELECT * FROM t;
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/apply-log-only.result b/mysql-test/suite/mariabackup/apply-log-only.result
new file mode 100644
index 00000000000..04b9c0d8ee2
--- /dev/null
+++ b/mysql-test/suite/mariabackup/apply-log-only.result
@@ -0,0 +1,10 @@
+call mtr.add_suppression("InnoDB: New log files created");
+CREATE TABLE t(a varchar(60)) ENGINE INNODB;
+start transaction;
+INSERT INTO t VALUES(1);
+NOT FOUND /Rollback of trx with id/ in current_test
+# expect NOT FOUND
+SELECT count(*) FROM t;
+count(*)
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/apply-log-only.test b/mysql-test/suite/mariabackup/apply-log-only.test
new file mode 100644
index 00000000000..96a251fc03b
--- /dev/null
+++ b/mysql-test/suite/mariabackup/apply-log-only.test
@@ -0,0 +1,25 @@
+--source include/have_innodb.inc
+call mtr.add_suppression("InnoDB: New log files created");
+
+let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
+
+CREATE TABLE t(a varchar(60)) ENGINE INNODB;
+start transaction;
+INSERT INTO t VALUES(1);
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
+--enable_result_log
+
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ;
+
+let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test;
+--let SEARCH_PATTERN= Rollback of trx with id
+--source include/search_pattern_in_file.inc
+--echo # expect NOT FOUND
+
+SELECT count(*) FROM t;
+DROP TABLE t;
+
+# Cleanup
+rmdir $basedir;
diff --git a/mysql-test/suite/mariabackup/auth_plugin_win.opt b/mysql-test/suite/mariabackup/auth_plugin_win.opt
new file mode 100644
index 00000000000..e534ae1eae5
--- /dev/null
+++ b/mysql-test/suite/mariabackup/auth_plugin_win.opt
@@ -0,0 +1 @@
+--loose-enable-named-pipe
diff --git a/mysql-test/suite/mariabackup/auth_plugin_win.result b/mysql-test/suite/mariabackup/auth_plugin_win.result
new file mode 100644
index 00000000000..7a623be147f
--- /dev/null
+++ b/mysql-test/suite/mariabackup/auth_plugin_win.result
@@ -0,0 +1,5 @@
+INSTALL SONAME 'auth_named_pipe';
+CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
+GRANT ALL PRIVILEGES ON *.* to USERNAME;
+DROP USER 'USERNAME';
+UNINSTALL SONAME 'auth_named_pipe';
diff --git a/mysql-test/suite/mariabackup/auth_plugin_win.test b/mysql-test/suite/mariabackup/auth_plugin_win.test
new file mode 100644
index 00000000000..9c8cd5ad411
--- /dev/null
+++ b/mysql-test/suite/mariabackup/auth_plugin_win.test
@@ -0,0 +1,31 @@
+--source include/windows.inc
+--source include/not_embedded.inc
+
+if (!$AUTH_NAMED_PIPE_SO) {
+ skip No named pipe plugin;
+}
+
+if (!$USERNAME) {
+ skip USERNAME variable is undefined;
+}
+
+if (`SELECT count(*) <> 0 FROM mysql.user WHERE user = '$USERNAME'`) {
+ skip \$USER=$USER which exists in mysql.user;
+}
+
+INSTALL SONAME 'auth_named_pipe';
+
+--replace_result $USERNAME USERNAME
+eval CREATE USER '$USERNAME' IDENTIFIED WITH named_pipe;
+--replace_result $USERNAME USERNAME
+eval GRANT ALL PRIVILEGES ON *.* to $USERNAME;
+
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf -u $USERNAME --backup --protocol=pipe --target-dir=$targetdir;
+--enable_result_log
+--replace_result $USERNAME USERNAME
+eval DROP USER '$USERNAME';
+rmdir $targetdir;
+UNINSTALL SONAME 'auth_named_pipe';
+
diff --git a/mysql-test/suite/mariabackup/bug1509812-master.opt b/mysql-test/suite/mariabackup/bug1509812-master.opt
new file mode 100644
index 00000000000..de29ed41f59
--- /dev/null
+++ b/mysql-test/suite/mariabackup/bug1509812-master.opt
@@ -0,0 +1 @@
+--loose-skip-log-bin \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/compress_qpress.result b/mysql-test/suite/mariabackup/compress_qpress.result
new file mode 100644
index 00000000000..f8dfb46e4db
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compress_qpress.result
@@ -0,0 +1,15 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+INSERT INTO t VALUES(2);
+# xtrabackup prepare
+t.frm.qp
+t.ibd.qp
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/compress_qpress.test b/mysql-test/suite/mariabackup/compress_qpress.test
new file mode 100644
index 00000000000..f86efe44e5d
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compress_qpress.test
@@ -0,0 +1,24 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --compress --target-dir=$targetdir;
+--enable_result_log
+
+INSERT INTO t VALUES(2);
+
+
+echo # xtrabackup prepare;
+--disable_result_log
+list_files $targetdir/test *.qp;
+exec $XTRABACKUP --decompress --remove-original --target-dir=$targetdir;
+list_files $targetdir/test *.qp;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/data_directory.result b/mysql-test/suite/mariabackup/data_directory.result
new file mode 100644
index 00000000000..e7201918cbd
--- /dev/null
+++ b/mysql-test/suite/mariabackup/data_directory.result
@@ -0,0 +1,13 @@
+CREATE TABLE t(a INT) ENGINE=InnoDB DATA DIRECTORY='table_data_dir';
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+# xtrabackup prepare
+DROP TABLE t;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+a
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/data_directory.test b/mysql-test/suite/mariabackup/data_directory.test
new file mode 100644
index 00000000000..50789a34c78
--- /dev/null
+++ b/mysql-test/suite/mariabackup/data_directory.test
@@ -0,0 +1,23 @@
+let $table_data_dir=$MYSQLTEST_VARDIR/ddir;
+mkdir $table_data_dir;
+--replace_result $table_data_dir table_data_dir
+EVAL CREATE TABLE t(a INT) ENGINE=InnoDB DATA DIRECTORY='$table_data_dir';
+INSERT INTO t VALUES(1);
+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
+--source include/shutdown_mysqld.inc
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+--source include/start_mysqld.inc
+DROP TABLE t;
+rmdir $table_data_dir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
+rmdir $table_data_dir;
diff --git a/mysql-test/suite/mariabackup/filekeys-data.enc b/mysql-test/suite/mariabackup/filekeys-data.enc
new file mode 100644
index 00000000000..a8adb2f939c
--- /dev/null
+++ b/mysql-test/suite/mariabackup/filekeys-data.enc
Binary files differ
diff --git a/mysql-test/suite/mariabackup/filekeys-data.key b/mysql-test/suite/mariabackup/filekeys-data.key
new file mode 100644
index 00000000000..85fcd1fbb81
--- /dev/null
+++ b/mysql-test/suite/mariabackup/filekeys-data.key
@@ -0,0 +1,2 @@
+secret
+
diff --git a/mysql-test/suite/mariabackup/full_backup.result b/mysql-test/suite/mariabackup/full_backup.result
new file mode 100644
index 00000000000..c387f5328a7
--- /dev/null
+++ b/mysql-test/suite/mariabackup/full_backup.result
@@ -0,0 +1,13 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+INSERT INTO t VALUES(2);
+# xtrabackup prepare
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/full_backup.test b/mysql-test/suite/mariabackup/full_backup.test
new file mode 100644
index 00000000000..f987410cf76
--- /dev/null
+++ b/mysql-test/suite/mariabackup/full_backup.test
@@ -0,0 +1,22 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+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
+
+INSERT INTO t VALUES(2);
+
+
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
+
diff --git a/mysql-test/suite/mariabackup/huge_lsn.opt b/mysql-test/suite/mariabackup/huge_lsn.opt
new file mode 100644
index 00000000000..74a6450a1ef
--- /dev/null
+++ b/mysql-test/suite/mariabackup/huge_lsn.opt
@@ -0,0 +1,6 @@
+--innodb-encrypt-log=ON
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--loose-file-key-management
+--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/filekeys-data.key
+--loose-file-key-management-filename=$MTR_SUITE_DIR/filekeys-data.enc
+--loose-file-key-management-encryption-algorithm=aes_cbc
diff --git a/mysql-test/suite/mariabackup/huge_lsn.result b/mysql-test/suite/mariabackup/huge_lsn.result
new file mode 100644
index 00000000000..f2202c20968
--- /dev/null
+++ b/mysql-test/suite/mariabackup/huge_lsn.result
@@ -0,0 +1,19 @@
+#
+# MDEV-13416 mariabackup fails with EFAULT "Bad Address"
+#
+call mtr.add_suppression("InnoDB: New log files created");
+FOUND /InnoDB: New log files created, LSN=175964\d{8}/ in mysqld.1.err
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+INSERT INTO t VALUES(2);
+# xtrabackup prepare
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/huge_lsn.test b/mysql-test/suite/mariabackup/huge_lsn.test
new file mode 100644
index 00000000000..baf577769c0
--- /dev/null
+++ b/mysql-test/suite/mariabackup/huge_lsn.test
@@ -0,0 +1,54 @@
+--source include/not_embedded.inc
+--source include/have_file_key_management.inc
+
+--echo #
+--echo # MDEV-13416 mariabackup fails with EFAULT "Bad Address"
+--echo #
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+call mtr.add_suppression("InnoDB: New log files created");
+
+--source include/shutdown_mysqld.inc
+
+perl;
+my $file= "$ENV{MYSQLD_DATADIR}/ibdata1";
+open(FILE, "+<", $file) or die "Unable to open $file\n";
+binmode FILE;
+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);
+substr($page,0,4)=pack("N",0xdeadbeef);
+substr($page,$ps-8,4)=pack("N",0xdeadbeef);
+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";
+EOF
+
+--remove_files_wildcard $MYSQLD_DATADIR ib_logfile*
+
+--source include/start_mysqld.inc
+let SEARCH_RANGE= -50000;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+--let SEARCH_PATTERN= InnoDB: New log files created, LSN=175964\d{8}
+--source include/search_pattern_in_file.inc
+
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+
+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
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+INSERT INTO t VALUES(2);
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+--source include/restart_and_restore.inc
+--enable_result_log
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/include/have_file_key_management.inc b/mysql-test/suite/mariabackup/include/have_file_key_management.inc
new file mode 100644
index 00000000000..06fbb510d6b
--- /dev/null
+++ b/mysql-test/suite/mariabackup/include/have_file_key_management.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'file_key_management' AND PLUGIN_STATUS='ACTIVE'`)
+{
+ --skip Test requires file_key_management plugin
+}
diff --git a/mysql-test/suite/mariabackup/include/restart_and_restore.inc b/mysql-test/suite/mariabackup/include/restart_and_restore.inc
new file mode 100644
index 00000000000..9056867b07f
--- /dev/null
+++ b/mysql-test/suite/mariabackup/include/restart_and_restore.inc
@@ -0,0 +1,9 @@
+let $_datadir= `SELECT @@datadir`;
+echo # shutdown server;
+--source include/shutdown_mysqld.inc
+echo # remove datadir;
+rmdir $_datadir;
+echo # xtrabackup move back;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2 --throttle=1;
+echo # restart server;
+--source include/start_mysqld.inc
diff --git a/mysql-test/suite/mariabackup/incremental_backup.result b/mysql-test/suite/mariabackup/incremental_backup.result
new file mode 100644
index 00000000000..20d8cefbefb
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_backup.result
@@ -0,0 +1,26 @@
+call mtr.add_suppression("InnoDB: New log files created");
+CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB;
+BEGIN;
+INSERT INTO t VALUES(2);
+SET GLOBAL innodb_flush_log_at_trx_commit = 1;
+INSERT INTO t VALUES(1);
+# Create full backup , modify table, then create incremental/differential backup
+BEGIN;
+INSERT INTO t VALUES(0);
+DELETE FROM t WHERE i=0;
+COMMIT;
+SELECT * FROM t;
+i
+1
+2
+# Prepare full backup, apply incremental one
+# Restore and check results
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+2
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/incremental_backup.test b/mysql-test/suite/mariabackup/incremental_backup.test
new file mode 100644
index 00000000000..93582f047a7
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_backup.test
@@ -0,0 +1,43 @@
+call mtr.add_suppression("InnoDB: New log files created");
+
+
+let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
+let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+
+CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB;
+BEGIN;
+INSERT INTO t VALUES(2);
+connect (con1,localhost,root,,);
+SET GLOBAL innodb_flush_log_at_trx_commit = 1;
+INSERT INTO t VALUES(1);
+
+echo # Create full backup , modify table, then create incremental/differential backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
+--enable_result_log
+BEGIN;
+INSERT INTO t VALUES(0);
+DELETE FROM t WHERE i=0;
+connection default;
+COMMIT;
+SELECT * FROM t;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
+
+--disable_result_log
+echo # Prepare full backup, apply incremental one;
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
+
+disconnect con1;
+echo # Restore and check results;
+let $targetdir=$basedir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+SELECT * FROM t;
+DROP TABLE t;
+
+# Cleanup
+rmdir $basedir;
+rmdir $incremental_dir;
+
diff --git a/mysql-test/suite/mariabackup/incremental_encrypted.opt b/mysql-test/suite/mariabackup/incremental_encrypted.opt
new file mode 100644
index 00000000000..ea644cef6ce
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_encrypted.opt
@@ -0,0 +1,3 @@
+--innodb-tablespaces-encryption
+--plugin-load-add=$DEBUG_KEY_MANAGEMENT_SO
+--loose-debug_key_management_version=2
diff --git a/mysql-test/suite/mariabackup/incremental_encrypted.result b/mysql-test/suite/mariabackup/incremental_encrypted.result
new file mode 100644
index 00000000000..e8f81e9fa49
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_encrypted.result
@@ -0,0 +1,20 @@
+call mtr.add_suppression("InnoDB: New log files created");
+CREATE TABLE t(i INT) ENGINE INNODB ENCRYPTED=YES;
+INSERT INTO t VALUES(1);
+# Create full backup , modify table, then create incremental/differential backup
+INSERT INTO t VALUES(2);
+SELECT * FROM t;
+i
+1
+2
+# Prepare full backup, apply incremental one
+# Restore and check results
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+2
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/incremental_encrypted.test b/mysql-test/suite/mariabackup/incremental_encrypted.test
new file mode 100644
index 00000000000..04f4ba5d18a
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_encrypted.test
@@ -0,0 +1,40 @@
+if (!$EXAMPLE_KEY_MANAGEMENT_SO)
+{
+ --skip needs example_key_management plugin
+}
+call mtr.add_suppression("InnoDB: New log files created");
+
+
+let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
+let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+
+
+CREATE TABLE t(i INT) ENGINE INNODB ENCRYPTED=YES;
+INSERT INTO t VALUES(1);
+
+
+echo # Create full backup , modify table, then create incremental/differential backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
+--enable_result_log
+
+INSERT INTO t VALUES(2);
+SELECT * FROM t;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
+echo # Prepare full backup, apply incremental one;
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
+exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir;
+
+echo # Restore and check results;
+let $targetdir=$basedir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+SELECT * FROM t;
+DROP TABLE t;
+
+# Cleanup
+rmdir $basedir;
+rmdir $incremental_dir;
diff --git a/mysql-test/suite/mariabackup/mdev-14447.opt b/mysql-test/suite/mariabackup/mdev-14447.opt
new file mode 100644
index 00000000000..5ac67e950c4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/mdev-14447.opt
@@ -0,0 +1 @@
+--sequence --innodb-data-file-path=ibdata_first:3M;ibdata_second:1M:autoextend \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/mdev-14447.result b/mysql-test/suite/mariabackup/mdev-14447.result
new file mode 100644
index 00000000000..3bca7eb5701
--- /dev/null
+++ b/mysql-test/suite/mariabackup/mdev-14447.result
@@ -0,0 +1,19 @@
+call mtr.add_suppression("InnoDB: New log files created");
+CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
+# Create full backup , modify table, then create incremental/differential backup
+BEGIN;
+INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
+COMMIT;
+SELECT count(*) FROM t;
+count(*)
+100000
+# Prepare full backup, apply incremental one
+# Restore and check results
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT count(*) FROM t;
+count(*)
+100000
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/mdev-14447.test b/mysql-test/suite/mariabackup/mdev-14447.test
new file mode 100644
index 00000000000..48f37646231
--- /dev/null
+++ b/mysql-test/suite/mariabackup/mdev-14447.test
@@ -0,0 +1,46 @@
+call mtr.add_suppression("InnoDB: New log files created");
+
+let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
+let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+
+CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
+
+echo # Create full backup , modify table, then create incremental/differential backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
+--enable_result_log
+BEGIN;
+INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
+COMMIT;
+SELECT count(*) FROM t;
+
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
+
+--disable_result_log
+echo # Prepare full backup, apply incremental one;
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
+exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
+
+echo # Restore and check results;
+let $targetdir=$basedir;
+#-- source include/restart_and_restore.inc
+
+let $_datadir= `SELECT @@datadir`;
+let $innodb_data_file_path=`SELECT @@innodb_data_file_path`;
+echo # shutdown server;
+--source include/shutdown_mysqld.inc
+echo # remove datadir;
+rmdir $_datadir;
+echo # xtrabackup move back;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir "--innodb_data_file_path=$innodb_data_file_path" --target-dir=$targetdir;
+echo # restart server;
+--source include/start_mysqld.inc
+
+
+--enable_result_log
+SELECT count(*) FROM t;
+DROP TABLE t;
+
+# Cleanup
+rmdir $basedir;
+rmdir $incremental_dir;
diff --git a/mysql-test/suite/mariabackup/missing_ibd.result b/mysql-test/suite/mariabackup/missing_ibd.result
new file mode 100644
index 00000000000..53989be7c14
--- /dev/null
+++ b/mysql-test/suite/mariabackup/missing_ibd.result
@@ -0,0 +1,6 @@
+create table t1(c1 int) engine=InnoDB;
+INSERT INTO t1 VALUES(1);
+# xtrabackup backup
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
+drop table t1;
diff --git a/mysql-test/suite/mariabackup/missing_ibd.test b/mysql-test/suite/mariabackup/missing_ibd.test
new file mode 100644
index 00000000000..53ce397fd5e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/missing_ibd.test
@@ -0,0 +1,27 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-13499: Backing up table that "doesn't exist in engine" cause crash in mariabackup when using encryption
+#
+create table t1(c1 int) engine=InnoDB;
+INSERT INTO t1 VALUES(1);
+let MYSQLD_DATADIR=`select @@datadir`;
+
+--source include/shutdown_mysqld.inc
+
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+
+--source include/start_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
+
+rmdir $targetdir;
+
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+select * from t1;
+drop table t1;
+
diff --git a/mysql-test/suite/mariabackup/partial.result b/mysql-test/suite/mariabackup/partial.result
new file mode 100644
index 00000000000..98c59be91bb
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partial.result
@@ -0,0 +1,13 @@
+CREATE TABLE t1(i INT) ENGINE INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2(i int) ENGINE INNODB;
+# xtrabackup backup
+t1.ibd
+# xtrabackup prepare
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t1 IMPORT TABLESPACE;
+SELECT * FROM t1;
+i
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/mariabackup/partial.test b/mysql-test/suite/mariabackup/partial.test
new file mode 100644
index 00000000000..3b1de8ebc25
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partial.test
@@ -0,0 +1,31 @@
+# Export single table from backup
+# (xtrabackup with --prepare --export)
+
+CREATE TABLE t1(i INT) ENGINE INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2(i int) ENGINE INNODB;
+
+echo # xtrabackup backup;
+
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables=test.*1" --target-dir=$targetdir;
+--enable_result_log
+list_files $targetdir/test *.ibd;
+
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --export --target-dir=$targetdir;
+--enable_result_log
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+let $MYSQLD_DATADIR= `select @@datadir`;
+copy_file $targetdir/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd;
+copy_file $targetdir/test/t1.cfg $MYSQLD_DATADIR/test/t1.cfg;
+ALTER TABLE t1 IMPORT TABLESPACE;
+
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
+rmdir $targetdir;
+
diff --git a/mysql-test/suite/mariabackup/partial_exclude.result b/mysql-test/suite/mariabackup/partial_exclude.result
new file mode 100644
index 00000000000..0da9b547caa
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partial_exclude.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1(i INT) ENGINE INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2(i int) ENGINE INNODB;
+CREATE DATABASE db2;
+USE db2;
+CREATE TABLE t1(i INT) ENGINE INNODB;
+USE test;
+# xtrabackup backup
+t1.ibd
+DROP TABLE t1;
+DROP TABLE t2;
+DROP DATABASE db2;
diff --git a/mysql-test/suite/mariabackup/partial_exclude.test b/mysql-test/suite/mariabackup/partial_exclude.test
new file mode 100644
index 00000000000..631f9d7ee71
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partial_exclude.test
@@ -0,0 +1,30 @@
+# Test --databases-exclude and --tables-exclude feature of xtrabackup 2.3.8
+
+CREATE TABLE t1(i INT) ENGINE INNODB;
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2(i int) ENGINE INNODB;
+
+CREATE DATABASE db2;
+USE db2;
+CREATE TABLE t1(i INT) ENGINE INNODB;
+
+USE test;
+
+echo # xtrabackup backup;
+
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables-exclude=test.*2" "--databases-exclude=db2" --target-dir=$targetdir;
+--enable_result_log
+
+# check that only t1 table is in backup (t2 is excluded)
+list_files $targetdir/test *.ibd;
+# check that db2 database is not in the backup (excluded)
+--error 1
+list_files $targetdir/db2 *.ibd;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP DATABASE db2;
+rmdir $targetdir;
+
diff --git a/mysql-test/suite/mariabackup/partition_datadir.opt b/mysql-test/suite/mariabackup/partition_datadir.opt
new file mode 100644
index 00000000000..8a3240370eb
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partition_datadir.opt
@@ -0,0 +1 @@
+--partition \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/partition_datadir.result b/mysql-test/suite/mariabackup/partition_datadir.result
new file mode 100644
index 00000000000..3fc5fe30907
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partition_datadir.result
@@ -0,0 +1,22 @@
+CREATE TABLE t(i int)
+ENGINE=InnoDB
+PARTITION BY RANGE (i)
+(PARTITION p0 VALUES LESS THAN (100),
+PARTITION P1 VALUES LESS THAN (200),
+PARTITION p2 VALUES LESS THAN (300) DATA DIRECTORY = 'MYSQLTEST_VARDIR/partitdata',
+PARTITION p3 VALUES LESS THAN (400) DATA DIRECTORY = 'MYSQLTEST_VARDIR/partitdata',
+PARTITION p4 VALUES LESS THAN MAXVALUE);
+INSERT INTO t VALUES (1), (101), (201), (301), (401);
+DROP TABLE t;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+101
+201
+301
+401
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/partition_datadir.test b/mysql-test/suite/mariabackup/partition_datadir.test
new file mode 100644
index 00000000000..882b0111267
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partition_datadir.test
@@ -0,0 +1,24 @@
+let $targetdir=$MYSQLTEST_VARDIR/backup;
+mkdir $targetdir;
+mkdir $MYSQLTEST_VARDIR/partitdata;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t(i int)
+ENGINE=InnoDB
+PARTITION BY RANGE (i)
+(PARTITION p0 VALUES LESS THAN (100),
+ PARTITION P1 VALUES LESS THAN (200),
+ PARTITION p2 VALUES LESS THAN (300) DATA DIRECTORY = '$MYSQLTEST_VARDIR/partitdata',
+ PARTITION p3 VALUES LESS THAN (400) DATA DIRECTORY = '$MYSQLTEST_VARDIR/partitdata',
+ PARTITION p4 VALUES LESS THAN MAXVALUE);
+INSERT INTO t VALUES (1), (101), (201), (301), (401);
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+DROP TABLE t;
+rmdir $MYSQLTEST_VARDIR/partitdata;
+--source include/restart_and_restore.inc
+--enable_result_log
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
+rmdir $MYSQLTEST_VARDIR/partitdata;
diff --git a/mysql-test/suite/mariabackup/small_ibd.result b/mysql-test/suite/mariabackup/small_ibd.result
new file mode 100644
index 00000000000..1c840a7a1b6
--- /dev/null
+++ b/mysql-test/suite/mariabackup/small_ibd.result
@@ -0,0 +1 @@
+#backup
diff --git a/mysql-test/suite/mariabackup/small_ibd.test b/mysql-test/suite/mariabackup/small_ibd.test
new file mode 100644
index 00000000000..23d6b08c047
--- /dev/null
+++ b/mysql-test/suite/mariabackup/small_ibd.test
@@ -0,0 +1,18 @@
+# Check if ibd smaller than page size are skipped
+# It is possible, due to race conditions that new file
+# is created by server while xtrabackup is running
+# The first page in this file does not yet exist.
+# xtrabackup should skip such file.
+
+let $_datadir= `SELECT @@datadir`;
+write_file $_datadir/test/small.ibd;
+EOF
+echo #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
+remove_file $_datadir/test/small.ibd;
+rmdir $targetdir;
+
diff --git a/mysql-test/suite/mariabackup/suite.opt b/mysql-test/suite/mariabackup/suite.opt
new file mode 100644
index 00000000000..ec00a407620
--- /dev/null
+++ b/mysql-test/suite/mariabackup/suite.opt
@@ -0,0 +1 @@
+--innodb --changed_page_bitmaps --innodb-file-format=Barracuda \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/suite.pm b/mysql-test/suite/mariabackup/suite.pm
new file mode 100644
index 00000000000..9242bbc051f
--- /dev/null
+++ b/mysql-test/suite/mariabackup/suite.pm
@@ -0,0 +1,37 @@
+package My::Suite::MariaBackup;
+
+@ISA = qw(My::Suite);
+use My::Find;
+use File::Basename;
+use strict;
+
+return "Not run for embedded server" if $::opt_embedded_server;
+
+my $mariabackup_exe=
+::mtr_exe_maybe_exists(
+ "$::bindir/extra/mariabackup$::opt_vs_config/mariabackup",
+ "$::path_client_bindir/mariabackup");
+
+return "No mariabackup" if !$mariabackup_exe;
+
+
+$ENV{XTRABACKUP}= $mariabackup_exe;
+
+$ENV{XBSTREAM}= ::mtr_exe_maybe_exists(
+ "$::bindir/extra/mariabackup/$::opt_vs_config/mbstream",
+ "$::path_client_bindir/mbstream");
+
+$ENV{INNOBACKUPEX}= "$mariabackup_exe --innobackupex";
+
+my $have_qpress = index(`qpress 2>&1`,"Compression") > 0;
+
+
+sub skip_combinations {
+ my %skip;
+ $skip{'include/have_file_key_management.inc'} = 'needs file_key_management plugin' unless $ENV{FILE_KEY_MANAGEMENT_SO};
+ $skip{'compress_qpress.test'}= 'needs qpress executable in PATH' unless $have_qpress;
+ %skip;
+}
+
+bless { };
+
diff --git a/mysql-test/suite/mariabackup/xb_aws_key_management.opt b/mysql-test/suite/mariabackup/xb_aws_key_management.opt
new file mode 100644
index 00000000000..fceff3be28d
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_aws_key_management.opt
@@ -0,0 +1,3 @@
+--plugin-load-add=$AWS_KEY_MANAGEMENT_SO
+--loose-aws-key-management
+--loose-aws-key-management-mock=ON
diff --git a/mysql-test/suite/mariabackup/xb_aws_key_management.result b/mysql-test/suite/mariabackup/xb_aws_key_management.result
new file mode 100644
index 00000000000..6efc76a8be3
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_aws_key_management.result
@@ -0,0 +1,16 @@
+CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
+Warnings:
+Note 1105 AWS KMS plugin: generated encrypted datakey for key id=1, version=1
+Note 1105 AWS KMS plugin: loaded key 1, version 1, key length 128 bit
+INSERT INTO t VALUES('foobar1');
+# xtrabackup backup
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * from t;
+c
+foobar1
+Warnings:
+Note 1105 AWS KMS plugin: loaded key 1, version 1, key length 128 bit
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/xb_aws_key_management.test b/mysql-test/suite/mariabackup/xb_aws_key_management.test
new file mode 100644
index 00000000000..149e422c058
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_aws_key_management.test
@@ -0,0 +1,18 @@
+--source include/have_debug.inc
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'aws_key_management' AND PLUGIN_STATUS='ACTIVE'`)
+{
+ --skip needs aws_key_management plugin plugin
+}
+
+CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
+INSERT INTO t VALUES('foobar1');
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+SELECT * from t;
+DROP TABLE t;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
new file mode 100644
index 00000000000..e6cbe00bb7c
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
@@ -0,0 +1,9 @@
+--innodb-encryption-rotate-key-age=2
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--loose-file-key-management
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
+--innodb_strict_mode
+--innodb_file_per_table
+--innodb_file_format=Barracuda
diff --git a/mysql-test/suite/mariabackup/xb_compressed_encrypted.result b/mysql-test/suite/mariabackup/xb_compressed_encrypted.result
new file mode 100644
index 00000000000..c0eb0e70631
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_compressed_encrypted.result
@@ -0,0 +1,25 @@
+CREATE TABLE t1(c1 INT, b VARCHAR(2400), index(b(100),c1)) ENGINE=INNODB ROW_FORMAT=compressed ENCRYPTED=YES;
+CREATE PROCEDURE innodb_insert_proc (REPEAT_COUNT INT)
+BEGIN
+DECLARE CURRENT_NUM INT;
+SET CURRENT_NUM = 0;
+WHILE CURRENT_NUM < REPEAT_COUNT DO
+INSERT INTO t1 VALUES(CURRENT_NUM, concat(uuid(), CURRENT_NUM, repeat('ab', floor(rand()*100) ), uuid()));
+SET CURRENT_NUM = CURRENT_NUM + 1;
+END WHILE;
+END//
+COMMIT;
+SET AUTOCOMMIT=0;
+CALL innodb_insert_proc(50000);
+COMMIT;
+# xtrabackup backup
+drop table t1;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+select sum(c1) from t1;
+sum(c1)
+1249975000
+DROP TABLE t1;
+drop procedure innodb_insert_proc;
diff --git a/mysql-test/suite/mariabackup/xb_compressed_encrypted.test b/mysql-test/suite/mariabackup/xb_compressed_encrypted.test
new file mode 100644
index 00000000000..9a5be4b19d6
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_compressed_encrypted.test
@@ -0,0 +1,35 @@
+source include/have_file_key_management.inc;
+
+CREATE TABLE t1(c1 INT, b VARCHAR(2400), index(b(100),c1)) ENGINE=INNODB ROW_FORMAT=compressed ENCRYPTED=YES;
+
+DELIMITER //;
+CREATE PROCEDURE innodb_insert_proc (REPEAT_COUNT INT)
+BEGIN
+ DECLARE CURRENT_NUM INT;
+ SET CURRENT_NUM = 0;
+ WHILE CURRENT_NUM < REPEAT_COUNT DO
+ INSERT INTO t1 VALUES(CURRENT_NUM, concat(uuid(), CURRENT_NUM, repeat('ab', floor(rand()*100) ), uuid()));
+ SET CURRENT_NUM = CURRENT_NUM + 1;
+ END WHILE;
+END//
+DELIMITER ;//
+COMMIT;
+
+SET AUTOCOMMIT=0;
+CALL innodb_insert_proc(50000);
+COMMIT;
+
+
+echo # xtrabackup backup;
+--disable_result_log
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --no-timestamp $targetdir;
+drop table t1;
+exec $INNOBACKUPEX --apply-log $targetdir;
+
+-- source include/restart_and_restore.inc
+--enable_result_log
+select sum(c1) from t1;
+DROP TABLE t1;
+drop procedure innodb_insert_proc;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.opt b/mysql-test/suite/mariabackup/xb_file_key_management.opt
new file mode 100644
index 00000000000..74a6450a1ef
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_file_key_management.opt
@@ -0,0 +1,6 @@
+--innodb-encrypt-log=ON
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--loose-file-key-management
+--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/filekeys-data.key
+--loose-file-key-management-filename=$MTR_SUITE_DIR/filekeys-data.enc
+--loose-file-key-management-encryption-algorithm=aes_cbc
diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.result b/mysql-test/suite/mariabackup/xb_file_key_management.result
new file mode 100644
index 00000000000..30aa530698b
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_file_key_management.result
@@ -0,0 +1,17 @@
+CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
+INSERT INTO t VALUES('foobar1');
+# xtrabackup backup
+NOT FOUND /foobar1/ in xtrabackup_logfile
+# expect NOT FOUND
+INSERT INTO t VALUES('foobar2');
+# xtrabackup prepare
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+NOT FOUND /foobar1/ in xtrabackup_logfile
+# expect NOT FOUND
+SELECT * FROM t;
+c
+foobar1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.test b/mysql-test/suite/mariabackup/xb_file_key_management.test
new file mode 100644
index 00000000000..be0b15eb387
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_file_key_management.test
@@ -0,0 +1,39 @@
+source include/have_file_key_management.inc;
+
+CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
+INSERT INTO t VALUES('foobar1');
+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
+
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=foobar1
+--let SEARCH_FILE=$targetdir/xtrabackup_logfile
+--source include/search_pattern_in_file.inc
+--echo # expect NOT FOUND
+
+INSERT INTO t VALUES('foobar2');
+echo # xtrabackup prepare;
+
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+#
+# Recheck that plain text data (
+# in not in the log, after prepare
+# (MDEV-11538)
+
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=foobar1
+--let SEARCH_FILE=$targetdir/xtrabackup_logfile
+--source include/search_pattern_in_file.inc
+--echo # expect NOT FOUND
+
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
+
diff --git a/mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
new file mode 100644
index 00000000000..b3ef366361a
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
@@ -0,0 +1,8 @@
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--innodb_strict_mode
+--innodb_file_per_table
+--innodb-encryption-rotate-key-age=2
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
+--loose-file-key-management
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/xb_fulltext_encrypted.result b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.result
new file mode 100644
index 00000000000..01a99e59200
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.result
@@ -0,0 +1,14 @@
+CREATE TABLE film_text (
+film_id SMALLINT NOT NULL,
+title VARCHAR(255) NOT NULL,
+description TEXT,
+PRIMARY KEY (film_id),
+FULLTEXT KEY idx_title_description (title,description),
+FULLTEXT KEY (description),
+FULLTEXT KEY (title)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8 ENCRYPTED=YES;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+drop table film_text;
diff --git a/mysql-test/suite/mariabackup/xb_fulltext_encrypted.test b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.test
new file mode 100644
index 00000000000..a98d7802d76
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.test
@@ -0,0 +1,23 @@
+source include/have_file_key_management.inc;
+
+CREATE TABLE film_text (
+film_id SMALLINT NOT NULL,
+title VARCHAR(255) NOT NULL,
+description TEXT,
+PRIMARY KEY (film_id),
+FULLTEXT KEY idx_title_description (title,description),
+FULLTEXT KEY (description),
+FULLTEXT KEY (title)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8 ENCRYPTED=YES;
+
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+--disable_result_log
+
+exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --no-timestamp $targetdir;
+exec $INNOBACKUPEX --apply-log --rebuild-indexes --rebuild-threads=2 $targetdir;
+--source include/restart_and_restore.inc
+
+--enable_result_log
+
+drop table film_text;
diff --git a/mysql-test/suite/mariabackup/xb_history.result b/mysql-test/suite/mariabackup/xb_history.result
new file mode 100644
index 00000000000..b6a1ac21147
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_history.result
@@ -0,0 +1,5 @@
+SELECT COUNT(*) FROM PERCONA_SCHEMA.xtrabackup_history;
+COUNT(*)
+1
+DROP TABLE PERCONA_SCHEMA.xtrabackup_history;
+DROP DATABASE PERCONA_SCHEMA;
diff --git a/mysql-test/suite/mariabackup/xb_history.test b/mysql-test/suite/mariabackup/xb_history.test
new file mode 100644
index 00000000000..28de50127c6
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_history.test
@@ -0,0 +1,8 @@
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --history=foo --backup --target-dir=$targetdir;
+--enable_result_log
+SELECT COUNT(*) FROM PERCONA_SCHEMA.xtrabackup_history;
+DROP TABLE PERCONA_SCHEMA.xtrabackup_history;
+DROP DATABASE PERCONA_SCHEMA;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/xb_page_compress.result b/mysql-test/suite/mariabackup/xb_page_compress.result
new file mode 100644
index 00000000000..7380856f394
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_page_compress.result
@@ -0,0 +1,28 @@
+CREATE TABLE t1(c1 INT, b CHAR(20)) ENGINE=INNODB PAGE_COMPRESSED=1;
+CREATE PROCEDURE innodb_insert_proc (REPEAT_COUNT INT)
+BEGIN
+DECLARE CURRENT_NUM INT;
+SET CURRENT_NUM = 0;
+WHILE CURRENT_NUM < REPEAT_COUNT DO
+INSERT INTO t1 VALUES(CURRENT_NUM,'TESTING..');
+SET CURRENT_NUM = CURRENT_NUM + 1;
+END WHILE;
+END//
+COMMIT;
+SET AUTOCOMMIT=0;
+CALL innodb_insert_proc(5000);
+COMMIT;
+SELECT (VARIABLE_VALUE >= 0) AS HAVE_COMPRESSED_PAGES
+FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
+HAVE_COMPRESSED_PAGES
+1
+# xtrabackup backup
+# xtrabackup prepare
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t1 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1;
diff --git a/mysql-test/suite/mariabackup/xb_page_compress.test b/mysql-test/suite/mariabackup/xb_page_compress.test
new file mode 100644
index 00000000000..876aa1a2791
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_page_compress.test
@@ -0,0 +1,44 @@
+CREATE TABLE t1(c1 INT, b CHAR(20)) ENGINE=INNODB PAGE_COMPRESSED=1;
+
+DELIMITER //;
+CREATE PROCEDURE innodb_insert_proc (REPEAT_COUNT INT)
+BEGIN
+ DECLARE CURRENT_NUM INT;
+ SET CURRENT_NUM = 0;
+ WHILE CURRENT_NUM < REPEAT_COUNT DO
+ INSERT INTO t1 VALUES(CURRENT_NUM,'TESTING..');
+ SET CURRENT_NUM = CURRENT_NUM + 1;
+ END WHILE;
+END//
+DELIMITER ;//
+COMMIT;
+
+SET AUTOCOMMIT=0;
+CALL innodb_insert_proc(5000);
+COMMIT;
+
+SELECT (VARIABLE_VALUE >= 0) AS HAVE_COMPRESSED_PAGES
+ FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+ WHERE VARIABLE_NAME = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
+
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables=test.*1" --target-dir=$targetdir;
+echo # xtrabackup prepare;
+exec $XTRABACKUP --prepare --export --target-dir=$targetdir;
+--enable_result_log
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+let $MYSQLD_DATADIR= `select @@datadir`;
+copy_file $targetdir/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd;
+copy_file $targetdir/test/t1.cfg $MYSQLD_DATADIR/test/t1.cfg;
+ALTER TABLE t1 IMPORT TABLESPACE;
+
+SELECT COUNT(*) FROM t1;
+
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1;
+rmdir $targetdir;
+
diff --git a/mysql-test/suite/mariabackup/xb_partition.result b/mysql-test/suite/mariabackup/xb_partition.result
new file mode 100644
index 00000000000..f5b6ae0b24d
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_partition.result
@@ -0,0 +1,64 @@
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2), (3);
+CREATE TABLE t2(a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (4), (5), (6);
+CREATE TABLE p (
+a int
+) ENGINE=InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (100),
+PARTITION p1 VALUES LESS THAN (200),
+PARTITION p2 VALUES LESS THAN (300),
+PARTITION p3 VALUES LESS THAN (400));
+INSERT INTO p VALUES (1), (101), (201), (301);
+CREATE TABLE isam_t1(a INT) ENGINE=MyISAM;
+INSERT INTO isam_t1 VALUES (1), (2), (3);
+CREATE TABLE isam_t2(a INT) ENGINE=MyISAM;
+INSERT INTO isam_t2 VALUES (4), (5), (6);
+CREATE TABLE isam_p (
+a int
+) ENGINE=MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (100),
+PARTITION p1 VALUES LESS THAN (200),
+PARTITION p2 VALUES LESS THAN (300),
+PARTITION p3 VALUES LESS THAN (400));
+INSERT INTO isam_p VALUES (1), (101), (201), (301);
+DROP TABLE t1;
+DROP TABLE t2;
+CREATE TABLE t2(a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (40), (50), (60);
+ALTER TABLE p DROP PARTITION p0;
+ALTER TABLE p DROP PARTITION p1;
+ALTER TABLE p ADD PARTITION (PARTITION p4 VALUES LESS THAN (500));
+ALTER TABLE p ADD PARTITION (PARTITION p5 VALUES LESS THAN (600));
+INSERT INTO p VALUES (401), (501);
+DROP TABLE isam_t1;
+DROP TABLE isam_t2;
+CREATE TABLE isam_t2(a INT) ENGINE=MyISAM;
+INSERT INTO isam_t2 VALUES (40), (50), (60);
+ALTER TABLE isam_p DROP PARTITION p0;
+ALTER TABLE isam_p DROP PARTITION p1;
+ALTER TABLE isam_p ADD PARTITION (PARTITION p4 VALUES LESS THAN (500));
+ALTER TABLE isam_p ADD PARTITION (PARTITION p5 VALUES LESS THAN (600));
+INSERT INTO isam_p VALUES (401), (501);
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * from p;
+a
+201
+301
+401
+501
+SELECT * from isam_p;
+a
+201
+301
+401
+501
+DROP TABLE isam_p;
+DROP TABLE isam_t2;
+DROP TABLE p;
+DROP TABLE t2;
diff --git a/mysql-test/suite/mariabackup/xb_partition.test b/mysql-test/suite/mariabackup/xb_partition.test
new file mode 100644
index 00000000000..f051a52edbc
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xb_partition.test
@@ -0,0 +1,87 @@
+--source include/have_partition.inc
+
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2), (3);
+
+CREATE TABLE t2(a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (4), (5), (6);
+
+CREATE TABLE p (
+ a int
+) ENGINE=InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (100),
+ PARTITION p1 VALUES LESS THAN (200),
+ PARTITION p2 VALUES LESS THAN (300),
+ PARTITION p3 VALUES LESS THAN (400));
+
+INSERT INTO p VALUES (1), (101), (201), (301);
+
+CREATE TABLE isam_t1(a INT) ENGINE=MyISAM;
+INSERT INTO isam_t1 VALUES (1), (2), (3);
+
+CREATE TABLE isam_t2(a INT) ENGINE=MyISAM;
+INSERT INTO isam_t2 VALUES (4), (5), (6);
+
+CREATE TABLE isam_p (
+ a int
+) ENGINE=MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (100),
+ PARTITION p1 VALUES LESS THAN (200),
+ PARTITION p2 VALUES LESS THAN (300),
+ PARTITION p3 VALUES LESS THAN (400));
+
+INSERT INTO isam_p VALUES (1), (101), (201), (301);
+
+let $targetdir=$MYSQLTEST_VARDIR/tmp;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --no-timestamp --backup --target-dir=$targetdir/full;
+--enable_result_log
+
+DROP TABLE t1;
+DROP TABLE t2;
+CREATE TABLE t2(a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (40), (50), (60);
+
+ALTER TABLE p DROP PARTITION p0;
+ALTER TABLE p DROP PARTITION p1;
+ALTER TABLE p ADD PARTITION (PARTITION p4 VALUES LESS THAN (500));
+ALTER TABLE p ADD PARTITION (PARTITION p5 VALUES LESS THAN (600));
+
+INSERT INTO p VALUES (401), (501);
+
+
+DROP TABLE isam_t1;
+DROP TABLE isam_t2;
+CREATE TABLE isam_t2(a INT) ENGINE=MyISAM;
+
+INSERT INTO isam_t2 VALUES (40), (50), (60);
+
+ALTER TABLE isam_p DROP PARTITION p0;
+ALTER TABLE isam_p DROP PARTITION p1;
+ALTER TABLE isam_p ADD PARTITION (PARTITION p4 VALUES LESS THAN (500));
+ALTER TABLE isam_p ADD PARTITION (PARTITION p5 VALUES LESS THAN (600));
+
+INSERT INTO isam_p VALUES (401), (501);
+
+--disable_result_log
+exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --incremental --no-timestamp --incremental-basedir=$targetdir/full $targetdir/inc;
+exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log --redo-only $targetdir/full;
+exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log --redo-only --incremental-dir=$targetdir/inc $targetdir/full;
+exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log $targetdir/full;
+
+let $targetdir=$targetdir/full;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+SELECT * from p;
+SELECT * from isam_p;
+
+DROP TABLE isam_p;
+DROP TABLE isam_t2;
+DROP TABLE p;
+DROP TABLE t2;
+rmdir $MYSQLTEST_VARDIR/tmp/full;
+rmdir $MYSQLTEST_VARDIR/tmp/inc;
diff --git a/mysql-test/suite/mariabackup/xbstream.result b/mysql-test/suite/mariabackup/xbstream.result
new file mode 100644
index 00000000000..f340fedb861
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xbstream.result
@@ -0,0 +1,13 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+# xtrabackup backup to stream
+# xbstream extract
+# xtrabackup prepare
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/xbstream.test b/mysql-test/suite/mariabackup/xbstream.test
new file mode 100644
index 00000000000..f2b4704a87e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/xbstream.test
@@ -0,0 +1,22 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+mkdir $targetdir;
+let $streamfile=$MYSQLTEST_VARDIR/tmp/backup.xb;
+
+echo # xtrabackup backup to stream;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --stream=xbstream > $streamfile 2>$targetdir/backup_stream.log;
+echo # xbstream extract;
+--disable_result_log
+exec $XBSTREAM -x -C $targetdir < $streamfile;
+
+echo # xtrabackup prepare;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+
+-- source include/restart_and_restore.inc
+--enable_result_log
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
+
diff --git a/mysql-test/suite/multi_source/gtid.test b/mysql-test/suite/multi_source/gtid.test
index bebee66068f..c81ca20a254 100644
--- a/mysql-test/suite/multi_source/gtid.test
+++ b/mysql-test/suite/multi_source/gtid.test
@@ -150,22 +150,22 @@ SET GLOBAL gtid_domain_id=0;
--source include/wait_condition.inc
--sorted_result
STOP ALL SLAVES;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave1
--connection slave2
SET GLOBAL gtid_domain_id=0;
--sorted_result
STOP ALL SLAVES;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave2
--connection master1
SET GLOBAL gtid_domain_id=0;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
SET GLOBAL gtid_domain_id=0;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
index 4d98b5c2ee7..218d91aa7fb 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
@@ -431,20 +431,20 @@ SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
--connection server_1
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_1
--connection server_2
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_2
--connection server_3
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_3
--connection server_4
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_4
diff --git a/mysql-test/suite/multi_source/info_logs.result b/mysql-test/suite/multi_source/info_logs.result
index 57980be22f6..d644939bd6f 100644
--- a/mysql-test/suite/multi_source/info_logs.result
+++ b/mysql-test/suite/multi_source/info_logs.result
@@ -84,17 +84,17 @@ MASTER 2.2
# EOF
#
show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000002 601 master-bin.000001 Yes Yes 0 0 313 888 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000
-MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+ Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
+MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
include/wait_for_slave_to_start.inc
set default_master_connection = 'MASTER 2.2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000004 536 master-bin.000001 Yes Yes 0 0 313 823 None 0 No 0 No 0 0 1 No 0 1073741824 6 0 60.000
-MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000004 536 master-bin.000001 Yes Yes 0 0 313 842 None 0 No 0 No 0 0 2 No 0 1073741824 6 0 60.000
+Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+ Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 6 0 60.000
+MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No conservative 0 1073741824 6 0 60.000
#
# List of files matching '*info*' pattern
# after slave server restart
diff --git a/mysql-test/suite/multi_source/info_logs.test b/mysql-test/suite/multi_source/info_logs.test
index 569af8bd4a3..372cd66e5cc 100644
--- a/mysql-test/suite/multi_source/info_logs.test
+++ b/mysql-test/suite/multi_source/info_logs.test
@@ -3,6 +3,7 @@
#
--source include/not_embedded.inc
+--source include/binlog_start_pos.inc
--let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
@@ -136,8 +137,11 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
-
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
+let read_master_log_pos=`select $binlog_start_pos + 65`;
+let relay_log_pos=`select 2*$binlog_start_pos + 105`;
+let relay_log_space1=`select 3*$binlog_start_pos + 144`;
+let relay_log_space2=`select 3*$binlog_start_pos + 163`;
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
# Restart the slave server
@@ -160,7 +164,10 @@ let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
+let relay_log_pos=`select 2*$binlog_start_pos + 40`;
+let relay_log_space1=`select 3*$binlog_start_pos + 79`;
+let relay_log_space2=`select 3*$binlog_start_pos + 98`;
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
# Check the files
@@ -180,14 +187,14 @@ show all slaves status;
# Cleanup
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/load_data.test b/mysql-test/suite/multi_source/load_data.test
index ca2391a9c8d..94b328d56ae 100644
--- a/mysql-test/suite/multi_source/load_data.test
+++ b/mysql-test/suite/multi_source/load_data.test
@@ -61,11 +61,11 @@ drop table t2;
--sorted_result
stop all slaves;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/mdev-9544.cnf b/mysql-test/suite/multi_source/mdev-9544.cnf
new file mode 100644
index 00000000000..b43aca5370d
--- /dev/null
+++ b/mysql-test/suite/multi_source/mdev-9544.cnf
@@ -0,0 +1,22 @@
+!include my.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
+[mysqld.3]
+log-bin
+log-slave-updates
+
+[mysqld.4]
+server-id=4
+log-bin=server4-bin
+log-slave-updates
+
+[ENV]
+SERVER_MYPORT_4= @mysqld.4.port
+SERVER_MYSOCK_4= @mysqld.4.socket
diff --git a/mysql-test/suite/multi_source/mdev-9544.result b/mysql-test/suite/multi_source/mdev-9544.result
new file mode 100644
index 00000000000..e7e4bcda8ff
--- /dev/null
+++ b/mysql-test/suite/multi_source/mdev-9544.result
@@ -0,0 +1,78 @@
+create database a;
+use a;
+create table t1(a int);
+insert into t1 values(1);
+create table t2(a int);
+insert into t2 values(1);
+create database b;
+use b;
+create table t1(a int);
+insert into t1 values(1);
+create table t2(a int);
+insert into t2 values(1);
+create database c;
+use c;
+create table t1(a int);
+insert into t1 values(1);
+create table t2(a int);
+insert into t2 values(1);
+change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root';
+change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root';
+change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root';
+start all slaves;
+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 = '';
+include/wait_for_slave_to_start.inc
+use a;
+show tables;
+Tables_in_a
+t1
+t2
+use b;
+show tables;
+Tables_in_b
+t1
+t2
+use c;
+show tables;
+Tables_in_c
+t1
+t2
+#TEST
+SET default_master_connection = "m1";
+SET default_master_connection = "m2";
+SET default_master_connection = "";
+flush logs;
+SET default_master_connection = "m1";
+#log Rotated
+mysqld-relay-bin.000002
+mysqld-relay-bin.000003
+mysqld-relay-bin.index
+SET default_master_connection = "m2";
+#log Rotated
+mysqld-relay-bin-m1.000002
+mysqld-relay-bin-m1.000003
+mysqld-relay-bin-m1.index
+SET default_master_connection = "";
+#log Rotated
+mysqld-relay-bin-m2.000002
+mysqld-relay-bin-m2.000003
+mysqld-relay-bin-m2.index
+#CleanUp
+drop database a;
+drop database b;
+drop database c;
+stop all slaves;
+Warnings:
+Note 1938 SLAVE 'm2' stopped
+Note 1938 SLAVE '' stopped
+Note 1938 SLAVE 'm1' stopped
+SET default_master_connection = "m1";
+include/wait_for_slave_to_stop.inc
+SET default_master_connection = "m2";
+include/wait_for_slave_to_stop.inc
+SET default_master_connection = "";
+include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/multi_source/mdev-9544.test b/mysql-test/suite/multi_source/mdev-9544.test
new file mode 100644
index 00000000000..f532a63a585
--- /dev/null
+++ b/mysql-test/suite/multi_source/mdev-9544.test
@@ -0,0 +1,116 @@
+--source include/not_embedded.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)
+--connect (server_4,127.0.0.1,root,,,$SERVER_MYPORT_4)
+
+--connection server_1
+create database a;
+use a;
+create table t1(a int);
+insert into t1 values(1);
+create table t2(a int);
+insert into t2 values(1);
+--save_master_pos
+
+--connection server_2
+create database b;
+use b;
+create table t1(a int);
+insert into t1 values(1);
+create table t2(a int);
+insert into t2 values(1);
+--save_master_pos
+
+--connection server_3
+create database c;
+use c;
+create table t1(a int);
+insert into t1 values(1);
+create table t2(a int);
+insert into t2 values(1);
+--save_master_pos
+
+--connection server_4
+--disable_warnings
+--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';
+--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';
+--replace_result $SERVER_MYPORT_3 MYPORT_3
+eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root';
+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 = '';
+--source include/wait_for_slave_to_start.inc
+
+--enable_warnings
+--sync_with_master 0,'m1'
+--sync_with_master 0,'m2'
+--sync_with_master 0,''
+use a;
+show tables;
+use b;
+show tables;
+use c;
+show tables;
+--echo #TEST
+SET default_master_connection = "m1";
+--let $old_m1 = query_get_value("show relaylog events;", "Log_name",1)
+SET default_master_connection = "m2";
+--let $old_m2 = query_get_value("show relaylog events;", "Log_name",1)
+SET default_master_connection = "";
+--let $old__ = query_get_value("show relaylog events;", "Log_name",1)
+flush logs;
+--sleep 2
+--let $MYSQLD_DATADIR = `select @@datadir`
+SET default_master_connection = "m1";
+--let $new_m1 = query_get_value("show relaylog events;", "Log_name",1)
+--if ($new_m1 != $old_m1) {
+ --echo #log Rotated
+ --exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin\."
+}
+SET default_master_connection = "m2";
+--let $new_m2 = query_get_value("show relaylog events;", "Log_name",1)
+--if ($new_m2 != $old_m2) {
+ --echo #log Rotated
+ --exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin-m1"
+}
+SET default_master_connection = "";
+--let $new__ = query_get_value("show relaylog events;", "Log_name",1)
+--if ($new__ != $old__) {
+ --echo #log Rotated
+ --exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin-m2"
+}
+
+--echo #CleanUp
+--connection server_1
+drop database a;
+--save_master_pos
+
+--connection server_2
+drop database b;
+--save_master_pos
+
+--connection server_3
+drop database c;
+--save_master_pos
+
+--connection server_4
+--sync_with_master 0,'m1'
+--sync_with_master 0,'m2'
+--sync_with_master 0,''
+stop all slaves;
+SET default_master_connection = "m1";
+--source include/wait_for_slave_to_stop.inc
+SET default_master_connection = "m2";
+--source include/wait_for_slave_to_stop.inc
+SET default_master_connection = "";
+--source include/wait_for_slave_to_stop.inc
+
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index d9689f759bf..227e88f6d71 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -52,27 +52,27 @@ i f1
mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index
-show relaylog events;
+include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-relay-bin-master1.000001 4 Format_desc 3 248 Server version
-mysqld-relay-bin-master1.000001 248 Rotate 3 306 mysqld-relay-bin-master1.000002;pos=4
-show relaylog events in 'mysqld-relay-bin-master1.000002';
+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 4 Format_desc 3 248 Server version
-mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4
-mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version
-mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 []
-mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001
-mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1
-mysqld-relay-bin-master1.000002 639 Query 1 440 drop database if exists db1
-mysqld-relay-bin-master1.000002 728 Gtid 1 478 GTID 0-1-2
-mysqld-relay-bin-master1.000002 766 Query 1 559 create database db1
-mysqld-relay-bin-master1.000002 847 Gtid 1 597 GTID 0-1-3
-mysqld-relay-bin-master1.000002 885 Query 1 750 use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
-mysqld-relay-bin-master1.000002 1038 Gtid 1 788 BEGIN GTID 0-1-4
-mysqld-relay-bin-master1.000002 1076 Intvar 1 816 INSERT_ID=1
-mysqld-relay-bin-master1.000002 1104 Query 1 920 use `db1`; insert into t1 (f1) values ('one'),('two')
-mysqld-relay-bin-master1.000002 1208 Query 1 988 COMMIT
+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 'master1' to
master_port=MYPORT_2,
master_host='127.0.0.1',
@@ -138,7 +138,7 @@ flush logs;
purge binary logs to 'master-bin.000002';
show binary logs;
Log_name File_size
-master-bin.000002 367
+master-bin.000002 filesize
insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB;
#
@@ -167,27 +167,27 @@ i f1
2 two
3 three
4 four
-show relaylog events;
+include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-relay-bin.000001 4 Format_desc 3 248 Server version
-mysqld-relay-bin.000001 248 Rotate 3 298 mysqld-relay-bin.000002;pos=4
-show relaylog events in 'mysqld-relay-bin.000002';
+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 4 Format_desc 3 248 Server version
-mysqld-relay-bin.000002 248 Rotate 2 0 master-bin.000001;pos=4
-mysqld-relay-bin.000002 292 Format_desc 2 248 Server version
-mysqld-relay-bin.000002 536 Gtid_list 2 273 []
-mysqld-relay-bin.000002 561 Binlog_checkpoint 2 313 master-bin.000001
-mysqld-relay-bin.000002 601 Gtid 2 351 GTID 0-2-1
-mysqld-relay-bin.000002 639 Query 2 440 drop database if exists db2
-mysqld-relay-bin.000002 728 Gtid 2 478 GTID 0-2-2
-mysqld-relay-bin.000002 766 Query 2 559 create database db2
-mysqld-relay-bin.000002 847 Gtid 2 597 GTID 0-2-3
-mysqld-relay-bin.000002 885 Query 2 732 use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
-mysqld-relay-bin.000002 1020 Gtid 2 770 BEGIN GTID 0-2-4
-mysqld-relay-bin.000002 1058 Intvar 2 798 INSERT_ID=1
-mysqld-relay-bin.000002 1086 Query 2 894 use `db2`; insert into t1 (f1) values (1),(2)
-mysqld-relay-bin.000002 1182 Xid 2 921 COMMIT /* xid=<num> */
+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 */
stop slave io_thread;
show status like 'Slave_running';
Variable_name Value
diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test
index c99db802981..fc58fe81803 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -1,288 +1 @@
-#
-# Test basic replication functionality
-# in multi-source setup
-#
-
---source include/not_embedded.inc
---source include/have_innodb.inc
---let $rpl_server_count= 0
-
---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 'abc', check we do not free twice.
---error ER_RELAY_LOG_INIT
-change master 'abc' to relay_log_file='';
-# This fails before adding the new master, check that we do free it.
---error ER_WRONG_ARGUMENTS
-change master 'abc2' to master_host='';
-
-
-# Start replication from the first master
-
---replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'master1' to
-master_port=$SERVER_MYPORT_1,
-master_host='127.0.0.1',
-master_user='root';
-
-start slave '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 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'
---source include/show_slave_status.inc
---let $slave_name=
-
---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
-
---replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
-show relaylog events;
---replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
-show relaylog events in 'mysqld-relay-bin-master1.000002';
-
-
-# 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 'master1' to
-master_port=$SERVER_MYPORT_2,
-master_host='127.0.0.1',
-master_user='root';
-
-# 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 'master2' to
-master_port=$SERVER_MYPORT_1,
-master_host='127.0.0.1',
-master_user='root';
-
-
-# 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 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';
-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 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 #
-
---sorted_result
-select * from db1.t1;
-
-# This should show relay log events for the default master
-# (the one with the empty name)
---replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
-show relaylog events;
---replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
-show relaylog events in 'mysqld-relay-bin.000002';
-
-# 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';
-
-# Cleanup
-
-drop database db1;
-drop database db2;
-
---source reset_master_slave.inc
---disconnect slave
-
---connection master1
-drop database db1;
---source reset_master_slave.inc
---disconnect master1
-
---connection master2
-drop database db2;
---source reset_master_slave.inc
---disconnect master2
-
+--source extra/rpl_tests/multisource.inc
diff --git a/mysql-test/suite/multi_source/my.cnf b/mysql-test/suite/multi_source/my.cnf
index 826967b52f9..d98e6b62e29 100644
--- a/mysql-test/suite/multi_source/my.cnf
+++ b/mysql-test/suite/multi_source/my.cnf
@@ -17,6 +17,7 @@ server-id=3
log-warnings=2
[ENV]
+MASTER_MYPORT= @mysqld.1.port
SERVER_MYPORT_1= @mysqld.1.port
SERVER_MYSOCK_1= @mysqld.1.socket
SERVER_MYPORT_2= @mysqld.2.port
diff --git a/mysql-test/suite/multi_source/relaylog_events.result b/mysql-test/suite/multi_source/relaylog_events.result
index 970d7d20438..b96d71f4183 100644
--- a/mysql-test/suite/multi_source/relaylog_events.result
+++ b/mysql-test/suite/multi_source/relaylog_events.result
@@ -10,21 +10,21 @@ create table t1 (i int) engine=MyISAM;
mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index
-show relaylog events in 'mysqld-relay-bin-master1.000002';
+include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-relay-bin-master1.000002 4 Format_desc 3 248 Server version
-mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4
-mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version
-mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 []
-mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001
-mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1
-mysqld-relay-bin-master1.000002 639 Query 1 465 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
-mysqld-relay-bin-master1.000002 753 Gtid 1 503 GTID 0-1-2
-mysqld-relay-bin-master1.000002 791 Query 1 603 use `test`; create table t1 (i int) engine=MyISAM
-show relaylog events;
+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 # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin-master1.000002 # Query # # use `test`; create table t1 (i int) engine=MyISAM
+include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-relay-bin-master1.000001 4 Format_desc 3 248 Server version
-mysqld-relay-bin-master1.000001 248 Rotate 3 306 mysqld-relay-bin-master1.000002;pos=4
+mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
drop table t1;
include/reset_master_slave.inc
include/reset_master_slave.inc
diff --git a/mysql-test/suite/multi_source/relaylog_events.test b/mysql-test/suite/multi_source/relaylog_events.test
index a59dd706b94..7e5257af837 100644
--- a/mysql-test/suite/multi_source/relaylog_events.test
+++ b/mysql-test/suite/multi_source/relaylog_events.test
@@ -31,10 +31,11 @@ create table t1 (i int) engine=MyISAM;
--let $datadir = `SELECT @@datadir`
--list_files $datadir mysqld-relay-bin-master1.*
---replace_regex /Server ver:.*/Server version/
-show relaylog events in 'mysqld-relay-bin-master1.000002';
---replace_regex /Server ver:.*/Server version/
-show relaylog events;
+let binlog_start=4;
+let binlog_file= mysqld-relay-bin-master1.000002;
+source include/show_relaylog_events.inc;
+let binlog_file=;
+source include/show_relaylog_events.inc;
--connection master1
drop table t1;
@@ -43,10 +44,10 @@ drop table t1;
--connection slave
--sync_with_master 0,'master1'
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
diff --git a/mysql-test/suite/multi_source/reset_slave.result b/mysql-test/suite/multi_source/reset_slave.result
index b78566ea933..6a9dbcdc561 100644
--- a/mysql-test/suite/multi_source/reset_slave.result
+++ b/mysql-test/suite/multi_source/reset_slave.result
@@ -10,15 +10,15 @@ create table t1 (i int) engine=MyISAM;
insert into t1 values (1),(2);
stop slave 'master1';
show slave 'master1' status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
- 127.0.0.1 root MYPORT_1 60 master-bin.000001 802 mysqld-relay-bin-master1.000002 1090 master-bin.000001 No No 0 0 802 1396 None 0 No NULL No 0 0 1 No
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
+ 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-master1.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space> None 0 No NULL No 0 0 1 No conservative
mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index
reset slave 'master1';
show slave 'master1' status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
- 127.0.0.1 root MYPORT_1 60 4 1090 No No 0 0 0 1396 None 0 No NULL No 0 0 1 No
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
+ 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 No NULL No 0 0 1 No conservative
reset slave 'master1' all;
show slave 'master1' status;
ERROR HY000: There is no master connection 'master1'
diff --git a/mysql-test/suite/multi_source/reset_slave.test b/mysql-test/suite/multi_source/reset_slave.test
index 108941c0d1a..4f4b9617345 100644
--- a/mysql-test/suite/multi_source/reset_slave.test
+++ b/mysql-test/suite/multi_source/reset_slave.test
@@ -3,6 +3,7 @@
#
--source include/not_embedded.inc
+--source include/binlog_start_pos.inc
--let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
@@ -38,13 +39,16 @@ stop slave 'master1';
--let $datadir = `SELECT @@datadir`
---replace_result $SERVER_MYPORT_1 MYPORT_1
+let read_master_log_pos=`select $binlog_start_pos + 554`;
+let relay_log_pos=`select 2*$binlog_start_pos + 594`;
+let relay_log_space=`select 3*$binlog_start_pos + 652`;
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space <relay_log_space>
show slave 'master1' status;
--list_files $datadir mysqld*
reset slave 'master1';
---replace_result $SERVER_MYPORT_1 MYPORT_1
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $relay_log_pos <relay_log_pos> $relay_log_space <relay_log_space>
show slave 'master1' status;
--list_files $datadir mysqld*
@@ -57,12 +61,12 @@ show slave 'master1' status;
# Cleanup
drop table t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
drop table t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
diff --git a/mysql-test/suite/multi_source/simple.result b/mysql-test/suite/multi_source/simple.result
index 6e4bb9b6309..3bf25e8d788 100644
--- a/mysql-test/suite/multi_source/simple.result
+++ b/mysql-test/suite/multi_source/simple.result
@@ -10,9 +10,9 @@ Note 1937 SLAVE 'slave2' started
include/wait_for_slave_to_start.inc
set default_master_connection = '';
show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
-slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-slave1.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000
-slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave1.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
+slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
start all slaves;
stop slave 'slave1';
show slave 'slave1' status;
@@ -22,9 +22,9 @@ Master_User root
Master_Port MYPORT_1
Connect_Retry 60
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 313
+Read_Master_Log_Pos <read_master_log_pos>
Relay_Log_File mysqld-relay-bin-slave1.000002
-Relay_Log_Pos 601
+Relay_Log_Pos <relay_log_pos>
Relay_Master_Log_File master-bin.000001
Slave_IO_Running No
Slave_SQL_Running No
@@ -37,8 +37,8 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 313
-Relay_Log_Space 906
+Exec_Master_Log_Pos <read_master_log_pos>
+Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
@@ -60,21 +60,24 @@ Master_SSL_Crl
Master_SSL_Crlpath
Using_Gtid No
Gtid_IO_Pos
+Replicate_Do_Domain_Ids
+Replicate_Ignore_Domain_Ids
+Parallel_Mode conservative
reset slave 'slave1';
show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
-slave1 127.0.0.1 root MYPORT_1 60 4 601 No No 0 0 0 906 None 0 No NULL No 0 0 1 No 0 1073741824 7 0 60.000
-slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave1 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space1> None 0 No NULL No 0 0 1 No conservative 0 1073741824 7 0 60.000
+slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
reset slave 'slave1' all;
show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
-slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
stop all slaves;
Warnings:
Note 1938 SLAVE 'slave2' stopped
show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
-slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 No No 0 0 313 906 None 0 No NULL No 0 0 2 No 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space1> None 0 No NULL No 0 0 2 No conservative 0 1073741824 7 0 60.000
stop all slaves;
include/reset_master_slave.inc
include/reset_master_slave.inc
diff --git a/mysql-test/suite/multi_source/simple.test b/mysql-test/suite/multi_source/simple.test
index 6108d3043d5..179fb9a4933 100644
--- a/mysql-test/suite/multi_source/simple.test
+++ b/mysql-test/suite/multi_source/simple.test
@@ -3,6 +3,7 @@
#
--source include/not_embedded.inc
+--source include/binlog_start_pos.inc
--let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
@@ -40,7 +41,11 @@ let $condition = = 7;
let $wait_for_all = 1;
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
+let read_master_log_pos=`select $binlog_start_pos + 65`;
+let relay_log_pos=`select 2*$binlog_start_pos + 105`;
+let relay_log_space1=`select 3*$binlog_start_pos + 162`;
+let relay_log_space2=`select 3*$binlog_start_pos + 162`;
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
# Ensure that start all slaves doesn't do anything as all slaves are started
@@ -48,19 +53,19 @@ start all slaves;
stop slave 'slave1';
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
query_vertical show slave 'slave1' status;
reset slave 'slave1';
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
reset slave 'slave1' all;
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
stop all slaves;
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
+--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
# Ensure that start all slaves doesn't do anything as all slaves are stopped
@@ -70,12 +75,12 @@ stop all slaves;
# clean up
#
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/skip_counter.test b/mysql-test/suite/multi_source/skip_counter.test
index 937261350a8..e53d0276a91 100644
--- a/mysql-test/suite/multi_source/skip_counter.test
+++ b/mysql-test/suite/multi_source/skip_counter.test
@@ -134,16 +134,16 @@ drop database db;
--eval set global max_relay_log_size = $max_relay_log_size_saved
--eval set global max_binlog_size = $max_binlog_size_saved
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
drop database db;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
drop database db;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/status_vars.test b/mysql-test/suite/multi_source/status_vars.test
index d1cfda75d01..e76a403db33 100644
--- a/mysql-test/suite/multi_source/status_vars.test
+++ b/mysql-test/suite/multi_source/status_vars.test
@@ -127,13 +127,13 @@ show status like 'Slave_open_temp_tables';
# Cleanup
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/syntax.result b/mysql-test/suite/multi_source/syntax.result
index 5666e43c16e..55b124bf5a1 100644
--- a/mysql-test/suite/multi_source/syntax.result
+++ b/mysql-test/suite/multi_source/syntax.result
@@ -1,11 +1,11 @@
include/master-slave.inc
[connection master]
show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
show slave '' status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
#
# Check error handling
#
diff --git a/mysql-test/suite/ndb/r/ndb_restore_discover.result b/mysql-test/suite/ndb/r/ndb_restore_discover.result
deleted file mode 100644
index de10af87047..00000000000
--- a/mysql-test/suite/ndb/r/ndb_restore_discover.result
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# 18075170 - sql node restart required to avoid deadlock after
-# restore
-#
-CREATE TABLE t1 (id INT) ENGINE=NDBCluster;
-CREATE TABLE t2 (id INT) ENGINE=NDBCluster;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-DROP TABLE t1;
-DROP TABLE t2;
-SET autocommit = 0;
-SELECT * FROM t1;
-id
-1
-SELECT * FROM t2;
-id
-1
-ROLLBACK;
-SET autocommit = 1;
-drop table t1;
-drop table t2;
-SET autocommit = 0;
-SELECT * FROM t1;
-id
-1
-SELECT * FROM t2;
-id
-1
-ALTER TABLE t1 ADD val INT;
-ROLLBACK;
-SET autocommit = 1;
-drop table t1;
-drop table t2;
diff --git a/mysql-test/suite/ndb/t/ndb_restore_discover.test b/mysql-test/suite/ndb/t/ndb_restore_discover.test
deleted file mode 100644
index 6631c74d5c8..00000000000
--- a/mysql-test/suite/ndb/t/ndb_restore_discover.test
+++ /dev/null
@@ -1,70 +0,0 @@
--- source include/have_ndb.inc
--- source include/count_sessions.inc
-
---echo #
---echo # 18075170 - sql node restart required to avoid deadlock after
---echo # restore
---echo #
-# Test Auto Discover option within a transaction
-# and make sure the transaction is not broken.
-CREATE TABLE t1 (id INT) ENGINE=NDBCluster;
-CREATE TABLE t2 (id INT) ENGINE=NDBCluster;
-
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-
--- source include/ndb_backup.inc
-
-DROP TABLE t1;
-DROP TABLE t2;
-
--- source include/ndb_restore_master.inc
-
-SET autocommit = 0;
-SELECT * FROM t1;
-
-# Without fix below select was resulting in DEADLOCK error. With fix select
-# should succeed.
-SELECT * FROM t2;
-ROLLBACK;
-SET autocommit = 1;
-
-drop table t1;
-drop table t2;
-
-#
-# Checking lock preservation in transaction
-#
-# Using existing backup to create the scenario. Tables are deleted as part of
-# above test cleanup. Thus restoring the backup will bring the system to
-# required state.
--- source include/ndb_restore_master.inc
-
-SET autocommit = 0;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-connect(con2, localhost, root);
---SEND ALTER TABLE t1 ADD val INT
-
-connection default;
-# Alter from con2 will be in waiting state as there is a lock on t1 from
-# default connection due to active transaction. We check for this condition
-# then releasing the lock by rollbacking active transaction.
-let $wait_condition=
- SELECT count(*) = 1 FROM information_schema.processlist WHERE state
- LIKE "Waiting%" AND info = "ALTER TABLE t1 ADD val INT";
---source include/wait_condition.inc
-ROLLBACK;
-SET autocommit = 1;
-
-connection con2;
---REAP
-
-disconnect con2;
-connection default;
-drop table t1;
-drop table t2;
-
-# Wait till all disconnects are completed
--- source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
index 4586fe84d2d..e4fdf0d03a7 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
@@ -247,6 +247,8 @@ UNLOCK TABLES;
select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ;
col0 col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 col66 col67 col68 col69 col70 col71 col72 col73 col74 col75 col76 col77 col78 col79 col80 col81 col82 col83 col84 col85 col86 col87 col88 col89 col90 col91 col92 col93 col94 col95 col96 col97 col98 col99 col100 col101 col102 col103 col104 col105 col106 col107 col108 col109 col110 col111 col112 col113 col114 col115 col116 col117 col118 col119 col120 col121 col122 col123 col124 col125 col126 col127 col128 col129 col130 col131 col132 col133 col134 col135 col136 col137 col138 col139 col140 col141 col142 col143 col144 col145 col146 col147 col148 col149 col150 col151 col152 col153 col154 col155 col156 col157 col158 col159 col160 col161 col162 col163 col164 col165 col166 col167 col168 col169 col170 col171 col172 col173 col174 col175
Warnings:
-Warning 1366 Incorrect decimal value: 'd' for column 'col24' at row 1
-Warning 1366 Incorrect decimal value: 'd' for column 'col24' at row 1
+Warning 1292 Truncated incorrect DOUBLE value: 'd'
+Warning 1292 Truncated incorrect DOUBLE value: 'd'
+Warning 1292 Truncated incorrect DOUBLE value: 'd'
+Warning 1292 Truncated incorrect DOUBLE value: 'd'
drop table `table5`;
diff --git a/mysql-test/suite/parts/inc/part_exch_drop_tabs.inc b/mysql-test/suite/parts/inc/part_exch_drop_tabs.inc
index 5ffc5438a3e..7d6441b15ad 100644
--- a/mysql-test/suite/parts/inc/part_exch_drop_tabs.inc
+++ b/mysql-test/suite/parts/inc/part_exch_drop_tabs.inc
@@ -1,4 +1,3 @@
---disable_warnings
DROP TABLE IF EXISTS t_10;
DROP TABLE IF EXISTS t_100;
DROP TABLE IF EXISTS t_1000;
@@ -11,5 +10,3 @@ DROP TABLE IF EXISTS tsp_03;
DROP TABLE IF EXISTS tsp_04;
DROP TABLE IF EXISTS t_empty;
DROP TABLE IF EXISTS t_null;
---enable_warnings
-
diff --git a/mysql-test/suite/parts/inc/part_exch_tabs.inc b/mysql-test/suite/parts/inc/part_exch_tabs.inc
index 378e0c2278d..482c9d378e7 100644
--- a/mysql-test/suite/parts/inc/part_exch_tabs.inc
+++ b/mysql-test/suite/parts/inc/part_exch_tabs.inc
@@ -1,51 +1,27 @@
---disable_warnings
-DROP TABLE IF EXISTS t_10;
-DROP TABLE IF EXISTS t_100;
-DROP TABLE IF EXISTS t_1000;
-DROP TABLE IF EXISTS tp;
-DROP TABLE IF EXISTS tsp;
-DROP TABLE IF EXISTS t_empty;
-DROP TABLE IF EXISTS t_null;
---enable_warnings
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) $data_directory $index_directory ENGINE = $engine_table;
-eval CREATE TABLE t_10 (a INT,
- b VARCHAR(55),
- PRIMARY KEY (a)) $data_directory $index_directory
-ENGINE = $engine_table;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) $data_directory $index_directory ENGINE = $engine_table;
-eval CREATE TABLE t_100 (a INT,
- b VARCHAR(55),
- PRIMARY KEY (a)) $data_directory $index_directory
-ENGINE = $engine_table;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) $data_directory $index_directory ENGINE = $engine_table;
-eval CREATE TABLE t_1000 (a INT,
- b VARCHAR(55),
- PRIMARY KEY (a)) $data_directory $index_directory
-ENGINE = $engine_table;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) $data_directory $index_directory ENGINE = $engine_table;
-eval CREATE TABLE t_empty (a INT,
- b VARCHAR(55),
- PRIMARY KEY (a)) $data_directory $index_directory
-ENGINE = $engine_table;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) $data_directory $index_directory ENGINE = $engine_table;
-eval CREATE TABLE t_null (a INT,
- b VARCHAR(55),
- PRIMARY KEY (a)) $data_directory $index_directory
-ENGINE = $engine_table;
-
-eval CREATE TABLE tp (a INT,
- b VARCHAR(55),
- PRIMARY KEY (a)) $data_directory $index_directory
-ENGINE = $engine_part
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) $data_directory $index_directory ENGINE = $engine_part
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10) $p_data_directory $p_index_directory,
PARTITION p1 VALUES LESS THAN (100) $p_data_directory $p_index_directory,
PARTITION p2 VALUES LESS THAN (1000) $p_data_directory $p_index_directory);
-eval CREATE TABLE tsp (a INT,
- b VARCHAR(55),
- PRIMARY KEY (a)) $data_directory $index_directory
-ENGINE = $engine_subpart
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) $data_directory $index_directory ENGINE = $engine_subpart
PARTITION BY RANGE (a)
SUBPARTITION BY HASH(a)
(PARTITION p0 VALUES LESS THAN (10) $p_data_directory $p_index_directory
@@ -53,8 +29,7 @@ SUBPARTITION BY HASH(a)
SUBPARTITION sp01,
SUBPARTITION sp02,
SUBPARTITION sp03,
- SUBPARTITION sp04),
- PARTITION p1 VALUES LESS THAN (100)
+ SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
(SUBPARTITION sp10 $p_data_directory $p_index_directory,
SUBPARTITION sp11 $p_data_directory $p_index_directory,
SUBPARTITION sp12 $p_data_directory $p_index_directory,
@@ -99,41 +74,13 @@ INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four")
INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
-eval CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a))
- ENGINE = $engine_table $data_directory $index_directory
- AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
-eval CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a))
- ENGINE = $engine_table $data_directory $index_directory
- AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
-eval CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a))
- ENGINE = $engine_table $data_directory $index_directory
- AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
-eval CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a))
- ENGINE = $engine_table $data_directory $index_directory
- AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
-eval CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a))
- ENGINE = $engine_table $data_directory $index_directory
- AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
-
-SHOW CREATE TABLE t_10;
-SHOW CREATE TABLE t_100;
-SHOW CREATE TABLE t_1000;
-SHOW CREATE TABLE tp;
-SHOW CREATE TABLE tsp;
-
---sorted_result
-SELECT * FROM t_10;
---sorted_result
-SELECT * FROM t_100;
---sorted_result
-SELECT * FROM t_1000;
---sorted_result
-SELECT * FROM tp;
---sorted_result
-SELECT * FROM tp WHERE a< 10;
---sorted_result
-SELECT * FROM tp WHERE a BETWEEN 11 AND 100;
---sorted_result
-SELECT * FROM tp WHERE a BETWEEN 101 AND 200;
---sorted_result
-SELECT * FROM tsp;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = $engine_table $data_directory $index_directory AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = $engine_table $data_directory $index_directory AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = $engine_table $data_directory $index_directory AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = $engine_table $data_directory $index_directory AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+eval CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = $engine_table $data_directory $index_directory AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
diff --git a/mysql-test/suite/parts/inc/partition.pre b/mysql-test/suite/parts/inc/partition.pre
index f82916ae631..0fae04dddd4 100644
--- a/mysql-test/suite/parts/inc/partition.pre
+++ b/mysql-test/suite/parts/inc/partition.pre
@@ -25,23 +25,6 @@
# Set the session storage engine
eval SET @@session.default_storage_engine = $engine;
-##### Disabled/affected testcases, because of open bugs #####
-# --echo
-# --echo #------------------------------------------------------------------------
-# --echo # There are several testcases disabled because of the open bugs
-# if (`SELECT @@session.default_storage_engine IN('ndbcluster')`)
-# {
-# --echo # #18730
-# }
-# --echo #------------------------------------------------------------------------
-# # Attention: Only bugs appearing in all storage engines should be mentioned above.
-# # The top level test wrapper (example: t/partition_basic_ndb.test)
-# # may set the $fixed_bug<nnnnn> variable to 0 after sourcing
-# # this file.
-# # Bug#18730: Partitions: NDB, crash on SELECT MIN(<unique column>)
-# # Attention: NDB testcases set this variable later to 0
-# let $fixed_bug18730= 1;
-
--echo
--echo #------------------------------------------------------------------------
--echo # 0. Setting of auxiliary variables + Creation of an auxiliary tables
@@ -121,24 +104,13 @@ let $insert_all= INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Column list with definition for all tables to be checked
-let $column_list= f_int1 INTEGER,
-f_int2 INTEGER,
+let $column_list= f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000);
-# Currently (April 2006) the default compiled NDB cannot manage
-# no_of_partitions (no subpartitioning) > 8
-# no_of_partitions * no_of_subpartitions > 8
-# This NDB specific limitation will cause
-# 1005: Can't create table 'test.t1' (errno: 1224)
-# in partition_methods[1|2].inc and partition_alter_1[1|3].inc
-# when $sub_part_no is set to >= 3.
let $sub_part_no= 3;
-if (`SELECT @@session.default_storage_engine = 'ndbcluster'`)
-{
- let $sub_part_no= 2;
-}
# Auxiliary table used for many experiments (INSERT INTO t1 ... SELECT ...)
# on the tables to be checked
@@ -297,16 +269,11 @@ if (0)
# Examples for the main rgression tests:
# InnoDB - The PRIMARY KEY is a clustered index where the data for the
# rows are stored. $do_pk_tests= 1
-# NDB - The PRIMARY KEY is used for implicit partitioning (NDB).
-# $do_pk_tests= 1
# MyISAM - AFAIK there is no effect on the tree containing the rows.
# $do_pk_tests= 0
#
# Assign a big number smaller than the maximum value for partitions
# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-# $MAX_VALUE= (2147483646);
#
#
# 2. Typical architecture of a test:
diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc
index 034460d49ac..e3a8d681275 100644
--- a/mysql-test/suite/parts/inc/partition_auto_increment.inc
+++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc
@@ -3,6 +3,9 @@
# auto_increment test
# used variables: $engine
#
+--disable_query_log
+set sql_mode="";
+--enable_query_log
-- disable_warnings
DROP TABLE IF EXISTS t1;
@@ -575,7 +578,7 @@ INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
INSERT INTO t1 VALUES (2, 2);
if (!$mysql_errno)
{
- echo # ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY;
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
echo # mysql_errno: $mysql_errno;
}
INSERT INTO t1 VALUES (2, 22), (2, NULL);
diff --git a/mysql-test/suite/parts/inc/partition_check.inc b/mysql-test/suite/parts/inc/partition_check.inc
index 235764a034f..ed323dfa245 100644
--- a/mysql-test/suite/parts/inc/partition_check.inc
+++ b/mysql-test/suite/parts/inc/partition_check.inc
@@ -324,7 +324,6 @@ FROM t1;
# DEBUG SELECT COUNT(*),MIN(f_int1),MAX(f_int1) FROM t1;
#
# 3.4 (mass) Update @max_row_div4 * 2 + 1 records
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
UPDATE t1 SET f_int1 = f_int1 + @max_row
WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
AND @max_row_div2 + @max_row_div4;
@@ -431,7 +430,6 @@ WHERE f_int1 = @cur_value AND f_int2 = @cur_value
# record to another partition/subpartition might appear.
SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
UPDATE t1 SET f_int1 = @cur_value2
WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
# Check of preceding statement via Select
@@ -451,8 +449,6 @@ WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
SET @cur_value1= -1;
SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
# Bug#15968: Partitions: crash when INSERT with f_int1 = -1 into PARTITION BY HASH(f_int1)
-# Bug#16385: Partitions: crash when updating a range partitioned NDB table
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
UPDATE t1 SET f_int1 = @cur_value1
WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
# Check of preceding statement via Select
@@ -538,7 +534,6 @@ eval DELETE FROM t1 WHERE f_charbig = '#$max_int_4##';
# Let's INSERT a record where the result of the partitioning function is
# probably (depends on function currently used) zero and look if there are
# any strange effects during the execution of the next statements.
-# Bug#17891: Partitions: NDB, crash on select .. where col is null or col = value
# Bug#18659: Partitions: wrong result on WHERE <col. used in part. function> IS NULL
DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
# Attention: Zero should be tested
@@ -965,7 +960,6 @@ let $tab_has_trigg= t0_aux;
let $tab_in_trigg= t1;
# Insert three records, which will be updated by the trigger
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
eval INSERT INTO $tab_in_trigg(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
@@ -1136,7 +1130,6 @@ CHECKSUM TABLE t1 EXTENDED;
# ... , it is mapped to ALTER TABLE, which rebuilds the table.
# Rebuilding updates index statistics and frees unused space in the
# clustered index.
-# FIXME What will happen with NDB ?
OPTIMIZE TABLE t1;
--source suite/parts/inc/partition_layout_check2.inc
# 10.2 REPAIR TABLE
diff --git a/mysql-test/suite/parts/inc/partition_mgm.inc b/mysql-test/suite/parts/inc/partition_mgm.inc
index 75834228d7a..5386a929db0 100644
--- a/mysql-test/suite/parts/inc/partition_mgm.inc
+++ b/mysql-test/suite/parts/inc/partition_mgm.inc
@@ -9,10 +9,8 @@
# Uses following variables: #
# engine Use specified storage engine #
# can_only_key Storage engine only able to use HASH/KEY (not range/list) #
-# (E.g. not ndbcluster) #
# part_optA-D Extra partitioning options (E.g. INDEX/DATA DIR) #
# #
-# have_bug33158 NDB case insensitive create, but case sensitive rename #
# no_truncate No support for truncate partition #
#------------------------------------------------------------------------------#
# Original Author: mattiasj #
@@ -144,8 +142,6 @@ SHOW CREATE TABLE tablea;
}
if (!$lower_case_table_names)
{
-if (!$have_bug33158)
-{
eval CREATE TABLE tablea (a INT)
ENGINE = $engine
PARTITION BY KEY (a)
@@ -164,7 +160,6 @@ RENAME TABLE tableA to TableA;
SHOW CREATE TABLE tablea;
DROP TABLE tablea;
}
-}
--echo # Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
diff --git a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
index 0de6bd7d2f5..867bff4e98e 100644
--- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
+++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
@@ -10,8 +10,6 @@
# Original Date: 2006-11-22 #
# Change Author: MattiasJ #
# Change Date: 2008-05-15 #
-# Change: Added $max_8_partitions since ndb only capable of 8 partitions #
-# and $no_reorg_partition since ndb does not support that #
################################################################################
--echo -------------------------------------------------------------------------
--echo --- $sqlfunc in partition with coltype $coltype
diff --git a/mysql-test/suite/parts/inc/partition_syntax_2.inc b/mysql-test/suite/parts/inc/partition_syntax_2.inc
index b8e728ee79b..f7e201bbf55 100644
--- a/mysql-test/suite/parts/inc/partition_syntax_2.inc
+++ b/mysql-test/suite/parts/inc/partition_syntax_2.inc
@@ -12,8 +12,6 @@
# Change: #
################################################################################
-if (`SELECT @@session.storage_engine NOT IN('ndbcluster')`)
-{
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
@@ -26,23 +24,3 @@ if (`SELECT @@session.storage_engine NOT IN('ndbcluster')`)
PRIMARY KEY(f_int1,f_int2), $unique_index
)
$partition_scheme;
-}
-if (`SELECT @@session.storage_engine IN('ndbcluster')`)
-{
- eval CREATE TABLE t1 (
- $column_list,
- $unique_index
- )
- $partition_scheme;
- eval $insert_all;
- --source suite/parts/inc/partition_check.inc
- DROP TABLE t1;
- eval CREATE TABLE t1 (
- $column_list,
- PRIMARY KEY(f_int1,f_int2), $unique_index
- )
- $partition_scheme;
- eval $insert_all;
- --source suite/parts/inc/partition_check.inc
- DROP TABLE t1;
-}
diff --git a/mysql-test/suite/parts/inc/partition_timestamp.inc b/mysql-test/suite/parts/inc/partition_timestamp.inc
index 47db67f04a5..fb1bf391999 100644
--- a/mysql-test/suite/parts/inc/partition_timestamp.inc
+++ b/mysql-test/suite/parts/inc/partition_timestamp.inc
@@ -1,4 +1,4 @@
-eval create table t1 (a timestamp not null, primary key(a)) engine=$engine
+eval create table t1 (a timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key(a)) engine=$engine
partition by key (a) (
partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
@@ -12,7 +12,7 @@ delete from t1 where a=19801014030300;
select * from t1;
drop table t1;
-eval create table t2 (a timestamp not null, primary key(a)) engine=$engine
+eval create table t2 (a timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key(a)) engine=$engine
partition by key (a) partitions 12;
show create table t2;
insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
diff --git a/mysql-test/suite/parts/inc/partition_trigg3.inc b/mysql-test/suite/parts/inc/partition_trigg3.inc
index b56847ada44..34dbf4e2cd1 100644
--- a/mysql-test/suite/parts/inc/partition_trigg3.inc
+++ b/mysql-test/suite/parts/inc/partition_trigg3.inc
@@ -45,7 +45,7 @@ END|
delimiter ;|
# Additional statements because of Bug(limitation)#17704
SET @counter = 1;
-# Bug#18730 Partitions: NDB, crash on SELECT MIN(<unique column>)
+# Bug#18730 Partitions: crash on SELECT MIN(<unique column>)
SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
# Additional statements end
eval $statement;
diff --git a/mysql-test/suite/parts/inc/partition_value.inc b/mysql-test/suite/parts/inc/partition_value.inc
index 3e25e740de6..79c4d6b8187 100644
--- a/mysql-test/suite/parts/inc/partition_value.inc
+++ b/mysql-test/suite/parts/inc/partition_value.inc
@@ -80,11 +80,6 @@ eval INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
VALUES(NULL,NULL,NULL,NULL,NULL);
eval SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 IS NULL;
DROP TABLE t1;
-#
-# The NDB handler only supports 32 bit integers in VALUES
-# therefor we have to skip the next test for NDB.
-if (`SELECT @@session.storage_engine NOT IN('ndbcluster')`)
-{
--echo # 3. LIST(<check value>)
eval CREATE TABLE t1 (
$column_list
@@ -111,7 +106,6 @@ eval INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
VALUES(NULL,NULL,NULL,NULL,NULL);
eval SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 IS NULL;
DROP TABLE t1;
-}
#
--echo # 4. Partition by RANGE(...) subpartition by HASH(<check value>)
eval CREATE TABLE t1 (
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
index 00ef7527059..34fcba6ae87 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 1.2.1 PRIMARY KEY consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -540,8 +540,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1032,8 +1032,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1539,8 +1539,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2040,8 +2040,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2539,8 +2539,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3049,8 +3049,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3561,8 +3561,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4062,8 +4062,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4554,8 +4554,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5046,8 +5046,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5553,8 +5553,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6054,8 +6054,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6553,8 +6553,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7063,8 +7063,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7575,8 +7575,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8077,8 +8077,8 @@ DROP TABLE t1;
# 1.2.2 UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8097,8 +8097,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8585,8 +8585,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8605,8 +8605,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9093,8 +9093,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9121,8 +9121,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9616,8 +9616,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9642,8 +9642,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10133,8 +10133,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10157,8 +10157,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10648,8 +10648,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10676,8 +10676,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11174,8 +11174,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11202,8 +11202,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11702,8 +11702,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11726,8 +11726,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12219,8 +12219,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12239,8 +12239,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12727,8 +12727,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12747,8 +12747,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13235,8 +13235,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13263,8 +13263,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13758,8 +13758,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13784,8 +13784,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14275,8 +14275,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14299,8 +14299,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14790,8 +14790,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14818,8 +14818,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15316,8 +15316,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15344,8 +15344,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15844,8 +15844,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15868,8 +15868,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -16362,8 +16362,8 @@ DROP TABLE t1;
# 1.2.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16855,8 +16855,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17348,8 +17348,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17856,8 +17856,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18358,8 +18358,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18858,8 +18858,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19369,8 +19369,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19882,8 +19882,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20384,8 +20384,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20877,8 +20877,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21370,8 +21370,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21878,8 +21878,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22380,8 +22380,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22880,8 +22880,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23391,8 +23391,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23904,8 +23904,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24406,8 +24406,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24899,8 +24899,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25392,8 +25392,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25900,8 +25900,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26402,8 +26402,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26902,8 +26902,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27413,8 +27413,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27926,8 +27926,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
index bc737289895..018bc4e9287 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 1.2.2 UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68,8 +68,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -565,8 +565,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -585,8 +585,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -1088,8 +1088,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1116,8 +1116,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -1632,8 +1632,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1658,8 +1658,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -2166,8 +2166,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2190,8 +2190,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -2702,8 +2702,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2730,8 +2730,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -3249,8 +3249,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3277,8 +3277,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -3798,8 +3798,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3822,8 +3822,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4338,8 +4338,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4358,8 +4358,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4855,8 +4855,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4875,8 +4875,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5378,8 +5378,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5406,8 +5406,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5922,8 +5922,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5948,8 +5948,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6456,8 +6456,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6480,8 +6480,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6992,8 +6992,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7020,8 +7020,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7539,8 +7539,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7567,8 +7567,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8088,8 +8088,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8112,8 +8112,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
index 0a7b284a15c..c05abfbcaed 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -47,8 +47,8 @@ SET @@session.sql_mode= '';
#------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62,8 +62,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -77,8 +77,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -100,8 +100,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -121,8 +121,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -140,8 +140,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -163,8 +163,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -186,8 +186,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -206,8 +206,8 @@ ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -221,8 +221,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -236,8 +236,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -259,8 +259,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -280,8 +280,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -299,8 +299,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -322,8 +322,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -345,8 +345,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -366,8 +366,8 @@ DROP TABLE t1;
# 1.1.3 PRIMARY KEY consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -858,8 +858,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1350,8 +1350,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1857,8 +1857,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2358,8 +2358,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2859,8 +2859,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3369,8 +3369,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3881,8 +3881,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4382,8 +4382,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4874,8 +4874,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5366,8 +5366,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5873,8 +5873,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6374,8 +6374,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6875,8 +6875,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7385,8 +7385,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7897,8 +7897,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8399,8 +8399,8 @@ DROP TABLE t1;
# 1.1.4 UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8419,8 +8419,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8907,8 +8907,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8927,8 +8927,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9415,8 +9415,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9443,8 +9443,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9938,8 +9938,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9964,8 +9964,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10455,8 +10455,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10479,8 +10479,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10972,8 +10972,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11000,8 +11000,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11498,8 +11498,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11526,8 +11526,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12026,8 +12026,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12050,8 +12050,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12543,8 +12543,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12563,8 +12563,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13051,8 +13051,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13071,8 +13071,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13559,8 +13559,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13587,8 +13587,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14082,8 +14082,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14108,8 +14108,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14599,8 +14599,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14623,8 +14623,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15116,8 +15116,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15144,8 +15144,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15642,8 +15642,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15670,8 +15670,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -16170,8 +16170,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16194,8 +16194,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
index 26450b28620..514afd88a20 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -47,8 +47,8 @@ SET @@session.sql_mode= '';
#------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62,8 +62,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -77,8 +77,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -100,8 +100,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -121,8 +121,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -140,8 +140,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -163,8 +163,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -186,8 +186,8 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -207,8 +207,8 @@ DROP TABLE t1;
# 1.1.4 UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -227,8 +227,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -724,8 +724,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -744,8 +744,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -1247,8 +1247,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1275,8 +1275,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -1791,8 +1791,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1817,8 +1817,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -2325,8 +2325,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2349,8 +2349,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -2863,8 +2863,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2891,8 +2891,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -3410,8 +3410,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3438,8 +3438,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -3959,8 +3959,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3983,8 +3983,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4499,8 +4499,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4519,8 +4519,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5016,8 +5016,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5036,8 +5036,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5539,8 +5539,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5567,8 +5567,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6083,8 +6083,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6109,8 +6109,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6617,8 +6617,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6641,8 +6641,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7155,8 +7155,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7183,8 +7183,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7702,8 +7702,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7730,8 +7730,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8251,8 +8251,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8275,8 +8275,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
index 22d24bd50fe..8ab37aafcbe 100644
--- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -47,8 +47,8 @@ SET @@session.sql_mode= '';
# 2.1.5 DROP PRIMARY KEY + UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -487,8 +487,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -927,8 +927,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1382,8 +1382,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1831,8 +1831,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2280,8 +2280,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2738,8 +2738,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3198,8 +3198,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3647,8 +3647,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4087,8 +4087,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4527,8 +4527,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4982,8 +4982,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5431,8 +5431,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5880,8 +5880,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6338,8 +6338,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6798,8 +6798,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7247,8 +7247,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7267,8 +7267,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7703,8 +7703,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7723,8 +7723,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8159,8 +8159,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8187,8 +8187,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8630,8 +8630,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8656,8 +8656,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9095,8 +9095,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9119,8 +9119,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9560,8 +9560,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9588,8 +9588,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10034,8 +10034,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10062,8 +10062,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10510,8 +10510,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10534,8 +10534,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10979,8 +10979,8 @@ DROP TABLE t1;
# 2.2.1 DROP PRIMARY KEY consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11419,8 +11419,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11859,8 +11859,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12314,8 +12314,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12763,8 +12763,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13210,8 +13210,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13668,8 +13668,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14128,8 +14128,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14577,8 +14577,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15017,8 +15017,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15457,8 +15457,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15912,8 +15912,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16361,8 +16361,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16808,8 +16808,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17266,8 +17266,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17726,8 +17726,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18176,8 +18176,8 @@ DROP TABLE t1;
# 2.2.2 DROP UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18196,8 +18196,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -18632,8 +18632,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18652,8 +18652,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -19088,8 +19088,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19116,8 +19116,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -19559,8 +19559,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19585,8 +19585,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20024,8 +20024,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20048,8 +20048,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20487,8 +20487,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20515,8 +20515,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20961,8 +20961,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20989,8 +20989,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -21437,8 +21437,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21461,8 +21461,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -21902,8 +21902,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21922,8 +21922,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -22358,8 +22358,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22378,8 +22378,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -22814,8 +22814,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22842,8 +22842,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -23285,8 +23285,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23311,8 +23311,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -23750,8 +23750,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23774,8 +23774,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -24213,8 +24213,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24241,8 +24241,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -24687,8 +24687,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24715,8 +24715,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -25163,8 +25163,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25187,8 +25187,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -25629,8 +25629,8 @@ DROP TABLE t1;
# 2.2.3 DROP PRIMARY KEY + UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26069,8 +26069,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26509,8 +26509,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26964,8 +26964,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27413,8 +27413,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27860,8 +27860,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28318,8 +28318,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28778,8 +28778,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29227,8 +29227,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29667,8 +29667,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30107,8 +30107,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30562,8 +30562,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31011,8 +31011,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31458,8 +31458,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31916,8 +31916,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -32376,8 +32376,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -32825,8 +32825,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -32845,8 +32845,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -33281,8 +33281,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -33301,8 +33301,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -33737,8 +33737,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -33765,8 +33765,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -34208,8 +34208,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -34234,8 +34234,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -34673,8 +34673,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -34697,8 +34697,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -35136,8 +35136,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -35164,8 +35164,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -35610,8 +35610,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -35638,8 +35638,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -36086,8 +36086,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -36110,8 +36110,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
index 72545e89bae..d998e264522 100644
--- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -46,8 +46,8 @@ SET @@session.sql_mode= '';
#------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66,8 +66,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -511,8 +511,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -531,8 +531,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -982,8 +982,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1010,8 +1010,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1474,8 +1474,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1500,8 +1500,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1956,8 +1956,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1980,8 +1980,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2442,8 +2442,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2470,8 +2470,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2937,8 +2937,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2965,8 +2965,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3434,8 +3434,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3458,8 +3458,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3926,8 +3926,8 @@ DROP TABLE t1;
# 2.2.2 DROP UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3946,8 +3946,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4391,8 +4391,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4411,8 +4411,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4862,8 +4862,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4890,8 +4890,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5354,8 +5354,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5380,8 +5380,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5836,8 +5836,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5860,8 +5860,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6320,8 +6320,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6348,8 +6348,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6815,8 +6815,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6843,8 +6843,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7312,8 +7312,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7336,8 +7336,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7800,8 +7800,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7820,8 +7820,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8265,8 +8265,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8285,8 +8285,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8736,8 +8736,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8764,8 +8764,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9228,8 +9228,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9254,8 +9254,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9710,8 +9710,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9734,8 +9734,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10194,8 +10194,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10222,8 +10222,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10689,8 +10689,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10717,8 +10717,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -11186,8 +11186,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11210,8 +11210,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -11674,8 +11674,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11694,8 +11694,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -12139,8 +12139,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12159,8 +12159,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -12610,8 +12610,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12638,8 +12638,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -13102,8 +13102,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13128,8 +13128,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -13584,8 +13584,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13608,8 +13608,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -14068,8 +14068,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14096,8 +14096,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -14563,8 +14563,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14591,8 +14591,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -15060,8 +15060,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15084,8 +15084,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result
index f3d5314643b..efc81603b5a 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68,7 +68,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -504,8 +504,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -524,7 +524,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -960,8 +960,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -988,7 +988,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1431,8 +1431,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1457,7 +1457,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1896,8 +1896,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1920,7 +1920,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2361,8 +2361,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2389,7 +2389,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2835,8 +2835,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2863,7 +2863,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3311,8 +3311,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3335,7 +3335,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3777,8 +3777,8 @@ DROP TABLE t1;
# 1.1.2 PRIMARY KEY exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3798,7 +3798,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4237,6 +4237,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4269,8 +4271,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4290,7 +4292,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4729,6 +4731,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4761,8 +4765,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4790,7 +4794,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5236,6 +5240,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5268,8 +5274,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5295,7 +5301,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5737,6 +5743,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5769,8 +5777,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5794,7 +5802,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6238,6 +6246,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6270,8 +6280,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6299,7 +6309,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6748,6 +6758,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6780,8 +6792,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6809,7 +6821,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7260,6 +7272,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7292,8 +7306,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7317,7 +7331,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7760,6 +7774,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7793,8 +7809,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7814,7 +7830,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8253,6 +8269,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8285,8 +8303,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8306,7 +8324,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8745,6 +8763,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8777,8 +8797,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8806,7 +8826,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9252,6 +9272,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9284,8 +9306,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9311,7 +9333,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9753,6 +9775,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9785,8 +9809,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9810,7 +9834,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10254,6 +10278,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10286,8 +10312,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10315,7 +10341,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10764,6 +10790,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10796,8 +10824,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10825,7 +10853,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11276,6 +11304,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11308,8 +11338,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11333,7 +11363,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11776,6 +11806,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11810,8 +11842,8 @@ DROP TABLE t1;
# 1.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11830,7 +11862,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12318,8 +12350,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12338,7 +12370,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12826,8 +12858,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12854,7 +12886,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -13349,8 +13381,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13375,7 +13407,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -13866,8 +13898,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13890,7 +13922,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -14383,8 +14415,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14411,7 +14443,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -14909,8 +14941,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14937,7 +14969,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -15437,8 +15469,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15461,7 +15493,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -15954,8 +15986,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15974,7 +16006,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -16462,8 +16494,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16482,7 +16514,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -16970,8 +17002,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16998,7 +17030,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -17493,8 +17525,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17519,7 +17551,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -18010,8 +18042,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18034,7 +18066,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -18527,8 +18559,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18555,7 +18587,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -19053,8 +19085,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19081,7 +19113,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -19581,8 +19613,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19605,7 +19637,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result
index eb662109cea..769abc32dff 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -44,8 +44,8 @@ SET @@session.sql_mode= '';
# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -500,8 +500,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -956,8 +956,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1427,8 +1427,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1892,8 +1892,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2355,8 +2355,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2829,8 +2829,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3305,8 +3305,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3771,8 +3771,8 @@ DROP TABLE t1;
# 1.3.2 PRIMARY KEY exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3791,8 +3791,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4231,6 +4231,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4263,8 +4266,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4283,8 +4286,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4723,6 +4726,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4755,8 +4761,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4783,8 +4789,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5230,6 +5236,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5262,8 +5271,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5288,8 +5297,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5731,6 +5740,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5763,8 +5775,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5787,8 +5799,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6230,6 +6242,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6262,8 +6277,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6290,8 +6305,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6740,6 +6755,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6772,8 +6790,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6800,8 +6818,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7252,6 +7270,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7284,8 +7305,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7308,8 +7329,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7752,6 +7773,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7785,8 +7809,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7805,8 +7829,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8245,6 +8269,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8277,8 +8304,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8297,8 +8324,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8737,6 +8764,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8769,8 +8799,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8797,8 +8827,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9244,6 +9274,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9276,8 +9309,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9302,8 +9335,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9745,6 +9778,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9777,8 +9813,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9801,8 +9837,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10244,6 +10280,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10276,8 +10315,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10304,8 +10343,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10754,6 +10793,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10786,8 +10828,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10814,8 +10856,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11266,6 +11308,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11298,8 +11343,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11322,8 +11367,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_int1` bigint(20) NOT NULL,
+ `f_int2` bigint(20) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11766,6 +11811,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11800,8 +11848,8 @@ DROP TABLE t1;
# 1.3.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12308,8 +12356,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12816,8 +12864,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13339,8 +13387,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13856,8 +13904,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14371,8 +14419,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14897,8 +14945,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15425,8 +15473,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15942,8 +15990,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16450,8 +16498,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16958,8 +17006,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17481,8 +17529,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17998,8 +18046,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18513,8 +18561,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19039,8 +19087,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19567,8 +19615,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_maria.result b/mysql-test/suite/parts/r/partition_alter2_1_maria.result
index 0e7c1818fbc..1182794ff05 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_maria.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_maria.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68,7 +68,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -513,8 +513,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -533,7 +533,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -984,8 +984,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1012,7 +1012,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1476,8 +1476,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1502,7 +1502,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1958,8 +1958,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1982,7 +1982,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2444,8 +2444,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2472,7 +2472,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2939,8 +2939,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2967,7 +2967,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3436,8 +3436,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3460,7 +3460,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3925,8 +3925,8 @@ DROP TABLE t1;
# 1.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3945,7 +3945,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4442,8 +4442,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4462,7 +4462,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4965,8 +4965,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4993,7 +4993,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -5509,8 +5509,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5535,7 +5535,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6043,8 +6043,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6067,7 +6067,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6581,8 +6581,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6609,7 +6609,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7128,8 +7128,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7156,7 +7156,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7677,8 +7677,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7701,7 +7701,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8217,8 +8217,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8237,7 +8237,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8734,8 +8734,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8754,7 +8754,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9257,8 +9257,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9285,7 +9285,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9801,8 +9801,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9827,7 +9827,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10335,8 +10335,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10359,7 +10359,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10873,8 +10873,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10901,7 +10901,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -11420,8 +11420,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11448,7 +11448,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -11969,8 +11969,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11993,7 +11993,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12514,8 +12514,8 @@ DROP TABLE t1;
# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12979,8 +12979,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13450,8 +13450,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13942,8 +13942,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14424,8 +14424,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14908,8 +14908,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15403,8 +15403,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15900,8 +15900,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16389,8 +16389,8 @@ DROP TABLE t1;
# 1.3.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16906,8 +16906,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17429,8 +17429,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17973,8 +17973,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18507,8 +18507,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19043,8 +19043,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19590,8 +19590,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20139,8 +20139,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20679,8 +20679,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21196,8 +21196,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21719,8 +21719,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22263,8 +22263,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22797,8 +22797,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23333,8 +23333,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23880,8 +23880,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24429,8 +24429,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result
index c3e1b18841c..c6f68a5882e 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68,7 +68,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -513,8 +513,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -533,7 +533,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -984,8 +984,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1012,7 +1012,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1476,8 +1476,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1502,7 +1502,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1958,8 +1958,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1982,7 +1982,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2444,8 +2444,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2472,7 +2472,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2939,8 +2939,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2967,7 +2967,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3436,8 +3436,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3460,7 +3460,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3925,8 +3925,8 @@ DROP TABLE t1;
# 1.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3945,7 +3945,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4442,8 +4442,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4462,7 +4462,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4965,8 +4965,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4993,7 +4993,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -5509,8 +5509,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5535,7 +5535,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6043,8 +6043,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6067,7 +6067,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6581,8 +6581,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6609,7 +6609,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7128,8 +7128,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7156,7 +7156,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7677,8 +7677,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7701,7 +7701,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8217,8 +8217,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8237,7 +8237,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8734,8 +8734,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8754,7 +8754,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9257,8 +9257,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9285,7 +9285,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9801,8 +9801,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9827,7 +9827,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10335,8 +10335,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10359,7 +10359,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10873,8 +10873,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10901,7 +10901,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -11420,8 +11420,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11448,7 +11448,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -11969,8 +11969,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11993,7 +11993,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` bigint(20) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12514,8 +12514,8 @@ DROP TABLE t1;
# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12979,8 +12979,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13450,8 +13450,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13942,8 +13942,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14424,8 +14424,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14908,8 +14908,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15403,8 +15403,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15900,8 +15900,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16389,8 +16389,8 @@ DROP TABLE t1;
# 1.3.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16906,8 +16906,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17429,8 +17429,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17973,8 +17973,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18507,8 +18507,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19043,8 +19043,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19590,8 +19590,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20139,8 +20139,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20679,8 +20679,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21196,8 +21196,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21719,8 +21719,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22263,8 +22263,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22797,8 +22797,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23333,8 +23333,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23880,8 +23880,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24429,8 +24429,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result
index 1f4642f63ec..2c8ec37d844 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68,7 +68,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -506,8 +506,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -526,7 +526,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -964,8 +964,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -992,7 +992,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1437,8 +1437,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1463,7 +1463,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1902,8 +1902,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1926,7 +1926,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2369,8 +2369,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2397,7 +2397,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2843,8 +2843,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2871,7 +2871,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3321,8 +3321,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3345,7 +3345,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3788,8 +3788,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3809,7 +3809,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4250,6 +4250,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4282,8 +4284,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4303,7 +4305,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4744,6 +4746,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4776,8 +4780,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4805,7 +4809,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5253,6 +5257,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5285,8 +5291,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5312,7 +5318,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5754,6 +5760,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5786,8 +5794,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5811,7 +5819,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6257,6 +6265,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6289,8 +6299,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6318,7 +6328,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6767,6 +6777,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6799,8 +6811,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6828,7 +6840,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7281,6 +7293,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7313,8 +7327,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7338,7 +7352,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7783,6 +7797,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7816,8 +7832,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7837,7 +7853,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8278,6 +8294,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8310,8 +8328,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8331,7 +8349,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8772,6 +8790,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8804,8 +8824,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8833,7 +8853,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9281,6 +9301,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9313,8 +9335,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9340,7 +9362,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9782,6 +9804,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9814,8 +9838,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9839,7 +9863,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10285,6 +10309,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10317,8 +10343,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10346,7 +10372,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10795,6 +10821,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10827,8 +10855,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10856,7 +10884,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11309,6 +11337,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11341,8 +11371,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11366,7 +11396,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11811,6 +11841,8 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11845,8 +11877,8 @@ DROP TABLE t1;
# 2.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11865,7 +11897,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12355,8 +12387,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12375,7 +12407,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12865,8 +12897,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12893,7 +12925,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -13390,8 +13422,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13416,7 +13448,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -13907,8 +13939,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13931,7 +13963,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -14426,8 +14458,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14454,7 +14486,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -14952,8 +14984,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14980,7 +15012,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -15482,8 +15514,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15506,7 +15538,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -16001,8 +16033,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16021,7 +16053,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -16511,8 +16543,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16531,7 +16563,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -17021,8 +17053,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17049,7 +17081,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -17546,8 +17578,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17572,7 +17604,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -18063,8 +18095,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18087,7 +18119,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -18582,8 +18614,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18610,7 +18642,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -19108,8 +19140,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19136,7 +19168,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -19638,8 +19670,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19662,7 +19694,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result
index 0db5bf79c4d..c2e4d73cd0d 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -43,8 +43,8 @@ SET @@session.sql_mode= '';
# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -502,8 +502,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -961,8 +961,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1435,8 +1435,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1905,8 +1905,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2373,8 +2373,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2852,8 +2852,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3331,8 +3331,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3800,8 +3800,8 @@ DROP TABLE t1;
# 2.3.2 PRIMARY KEY exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3820,8 +3820,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4263,6 +4263,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4295,8 +4298,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4315,8 +4318,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -4758,6 +4761,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -4790,8 +4796,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4818,8 +4824,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5268,6 +5274,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5300,8 +5309,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5326,8 +5335,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -5774,6 +5783,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -5806,8 +5818,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5830,8 +5842,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6278,6 +6290,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6310,8 +6325,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6338,8 +6353,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -6793,6 +6808,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -6825,8 +6843,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6853,8 +6871,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7308,6 +7326,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7340,8 +7361,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7364,8 +7385,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -7811,6 +7832,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -7844,8 +7868,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7864,8 +7888,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8307,6 +8331,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8339,8 +8366,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8359,8 +8386,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8802,6 +8829,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -8834,8 +8864,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8862,8 +8892,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9312,6 +9342,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9344,8 +9377,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9370,8 +9403,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9818,6 +9851,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -9850,8 +9886,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9874,8 +9910,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10322,6 +10358,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10354,8 +10393,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10382,8 +10421,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10837,6 +10876,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -10869,8 +10911,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10897,8 +10939,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11352,6 +11394,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11384,8 +11429,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11408,8 +11453,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int1` mediumint(9) NOT NULL,
+ `f_int2` mediumint(9) NOT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11855,6 +11900,9 @@ SELECT CAST(f_int1 AS CHAR),
CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
ORDER BY f_int1;
+Warnings:
+Warning 1364 Field 'f_int1' doesn't have a default value
+Warning 1364 Field 'f_int2' doesn't have a default value
DROP TRIGGER trg_3;
# check trigger-12 success: 1
@@ -11889,8 +11937,8 @@ DROP TABLE t1;
# 2.3.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12400,8 +12448,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12911,8 +12959,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13437,8 +13485,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13959,8 +14007,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14479,8 +14527,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15010,8 +15058,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15541,8 +15589,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16061,8 +16109,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16572,8 +16620,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17083,8 +17131,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17609,8 +17657,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18131,8 +18179,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18651,8 +18699,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19182,8 +19230,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19713,8 +19761,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_maria.result b/mysql-test/suite/parts/r/partition_alter2_2_maria.result
index 2bb3683ad73..7eaffd200ce 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_maria.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_maria.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68,7 +68,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -515,8 +515,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -535,7 +535,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -988,8 +988,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1016,7 +1016,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1482,8 +1482,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1508,7 +1508,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1964,8 +1964,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1988,7 +1988,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2452,8 +2452,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2480,7 +2480,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2947,8 +2947,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2975,7 +2975,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3446,8 +3446,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3470,7 +3470,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3937,8 +3937,8 @@ DROP TABLE t1;
# 2.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3957,7 +3957,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4456,8 +4456,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4476,7 +4476,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4981,8 +4981,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5009,7 +5009,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -5527,8 +5527,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5553,7 +5553,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6061,8 +6061,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6085,7 +6085,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6601,8 +6601,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6629,7 +6629,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7148,8 +7148,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7176,7 +7176,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7699,8 +7699,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7723,7 +7723,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8241,8 +8241,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8261,7 +8261,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8760,8 +8760,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8780,7 +8780,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9285,8 +9285,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9313,7 +9313,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9831,8 +9831,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9857,7 +9857,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10365,8 +10365,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10389,7 +10389,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10905,8 +10905,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10933,7 +10933,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -11452,8 +11452,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11480,7 +11480,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12003,8 +12003,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12027,7 +12027,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12549,8 +12549,8 @@ DROP TABLE t1;
# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13017,8 +13017,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13491,8 +13491,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13986,8 +13986,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14473,8 +14473,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14962,8 +14962,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15462,8 +15462,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15962,8 +15962,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16454,8 +16454,8 @@ DROP TABLE t1;
# 2.3.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16974,8 +16974,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17500,8 +17500,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18047,8 +18047,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18586,8 +18586,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19127,8 +19127,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19679,8 +19679,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20231,8 +20231,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20774,8 +20774,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21294,8 +21294,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21820,8 +21820,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22367,8 +22367,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22906,8 +22906,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23447,8 +23447,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23999,8 +23999,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24551,8 +24551,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result
index 8d8e77ebbd3..85ace90e88c 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ SET @@session.sql_mode= '';
# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68,7 +68,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -515,8 +515,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -535,7 +535,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -988,8 +988,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1016,7 +1016,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1482,8 +1482,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1508,7 +1508,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -1964,8 +1964,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1988,7 +1988,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2452,8 +2452,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2480,7 +2480,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -2947,8 +2947,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2975,7 +2975,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3446,8 +3446,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3470,7 +3470,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -3937,8 +3937,8 @@ DROP TABLE t1;
# 2.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3957,7 +3957,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4456,8 +4456,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4476,7 +4476,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -4981,8 +4981,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5009,7 +5009,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -5527,8 +5527,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5553,7 +5553,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6061,8 +6061,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6085,7 +6085,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -6601,8 +6601,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6629,7 +6629,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7148,8 +7148,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7176,7 +7176,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -7699,8 +7699,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7723,7 +7723,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8241,8 +8241,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8261,7 +8261,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -8760,8 +8760,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8780,7 +8780,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9285,8 +9285,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9313,7 +9313,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -9831,8 +9831,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9857,7 +9857,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10365,8 +10365,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10389,7 +10389,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -10905,8 +10905,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10933,7 +10933,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -11452,8 +11452,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11480,7 +11480,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12003,8 +12003,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12027,7 +12027,7 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
`f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
@@ -12549,8 +12549,8 @@ DROP TABLE t1;
# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13017,8 +13017,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13491,8 +13491,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13986,8 +13986,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14473,8 +14473,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14962,8 +14962,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15462,8 +15462,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15962,8 +15962,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16454,8 +16454,8 @@ DROP TABLE t1;
# 2.3.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16974,8 +16974,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17500,8 +17500,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18047,8 +18047,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18586,8 +18586,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19127,8 +19127,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19679,8 +19679,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20231,8 +20231,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20774,8 +20774,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21294,8 +21294,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21820,8 +21820,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22367,8 +22367,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22906,8 +22906,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23447,8 +23447,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23999,8 +23999,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24551,8 +24551,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result
index fd67547f55b..a1718453c11 100644
--- a/mysql-test/suite/parts/r/partition_alter3_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -429,8 +429,8 @@ unified filelist
#========================================================================
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -440,8 +440,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -463,8 +463,8 @@ ALTER TABLE t1 PARTITION BY KEY(f_int1);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -489,8 +489,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -515,8 +515,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -543,8 +543,8 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -586,8 +586,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -619,8 +619,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -650,8 +650,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -679,8 +679,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -706,8 +706,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -731,8 +731,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -754,8 +754,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -779,8 +779,8 @@ ALTER TABLE t1 REMOVE PARTITIONING;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result
index dfb21ee17ba..8bee02a3096 100644
--- a/mysql-test/suite/parts/r/partition_alter3_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -471,8 +471,8 @@ DROP TABLE t1;
#========================================================================
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -482,8 +482,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -506,8 +506,8 @@ ALTER TABLE t1 PARTITION BY KEY(f_int1);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -533,8 +533,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -562,8 +562,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -594,8 +594,8 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -645,8 +645,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -685,8 +685,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -722,8 +722,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -756,8 +756,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -787,8 +787,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -815,8 +815,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -840,8 +840,8 @@ ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -866,8 +866,8 @@ ALTER TABLE t1 REMOVE PARTITIONING;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result
index e4dacbc663c..f51d6e5cb02 100644
--- a/mysql-test/suite/parts/r/partition_alter4_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -47,8 +47,8 @@ SET @@session.sql_mode= '';
# 1.1 ALTER ... ANALYZE PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -69,8 +69,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -506,8 +506,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -528,8 +528,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -968,8 +968,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -998,8 +998,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1441,8 +1441,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1469,8 +1469,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1908,8 +1908,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1934,8 +1934,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2375,8 +2375,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2405,8 +2405,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2851,8 +2851,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2881,8 +2881,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3329,8 +3329,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3355,8 +3355,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3797,8 +3797,8 @@ DROP TABLE t1;
# 1.2 ALTER ... ANALYZE PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3819,8 +3819,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4256,8 +4256,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4278,8 +4278,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4718,8 +4718,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4748,8 +4748,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5191,8 +5191,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5219,8 +5219,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5658,8 +5658,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5684,8 +5684,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6125,8 +6125,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6155,8 +6155,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6601,8 +6601,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6631,8 +6631,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7079,8 +7079,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7105,8 +7105,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7547,8 +7547,8 @@ DROP TABLE t1;
# 1.3 ALTER ... ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7569,8 +7569,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8006,8 +8006,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8028,8 +8028,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8468,8 +8468,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8498,8 +8498,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8941,8 +8941,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8969,8 +8969,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9408,8 +9408,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9434,8 +9434,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9875,8 +9875,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9905,8 +9905,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10351,8 +10351,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10381,8 +10381,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10829,8 +10829,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10855,8 +10855,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -11297,8 +11297,8 @@ DROP TABLE t1;
# 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11319,8 +11319,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -11756,8 +11756,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11778,8 +11778,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -12218,8 +12218,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12248,8 +12248,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -12691,8 +12691,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12719,8 +12719,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -13158,8 +13158,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13184,8 +13184,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -13625,8 +13625,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13655,8 +13655,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -14101,8 +14101,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14131,8 +14131,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -14579,8 +14579,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14605,8 +14605,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -15047,8 +15047,8 @@ DROP TABLE t1;
# 1.5 ALTER ... ANALYZE PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15069,8 +15069,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -15506,8 +15506,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15528,8 +15528,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -15968,8 +15968,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15998,8 +15998,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -16441,8 +16441,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16469,8 +16469,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -16908,8 +16908,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16934,8 +16934,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -17375,8 +17375,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17405,8 +17405,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -17851,8 +17851,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17881,8 +17881,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -18329,8 +18329,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18355,8 +18355,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -18800,8 +18800,8 @@ DROP TABLE t1;
# 2.1 ALTER ... CHECK PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18822,8 +18822,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -19259,8 +19259,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19281,8 +19281,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -19721,8 +19721,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19751,8 +19751,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20194,8 +20194,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20222,8 +20222,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20661,8 +20661,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20687,8 +20687,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -21128,8 +21128,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21158,8 +21158,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -21604,8 +21604,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21634,8 +21634,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -22082,8 +22082,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22108,8 +22108,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -22550,8 +22550,8 @@ DROP TABLE t1;
# 2.2 ALTER ... CHECK PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22572,8 +22572,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -23009,8 +23009,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23031,8 +23031,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -23471,8 +23471,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23501,8 +23501,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -23944,8 +23944,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23972,8 +23972,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -24411,8 +24411,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24437,8 +24437,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -24878,8 +24878,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24908,8 +24908,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -25354,8 +25354,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25384,8 +25384,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -25832,8 +25832,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25858,8 +25858,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -26300,8 +26300,8 @@ DROP TABLE t1;
# 2.3 ALTER ... CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26322,8 +26322,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -26759,8 +26759,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26781,8 +26781,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -27221,8 +27221,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27251,8 +27251,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -27694,8 +27694,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27722,8 +27722,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -28161,8 +28161,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28187,8 +28187,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -28628,8 +28628,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28658,8 +28658,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -29104,8 +29104,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29134,8 +29134,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -29582,8 +29582,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29608,8 +29608,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -30050,8 +30050,8 @@ DROP TABLE t1;
# 2.4 ALTER ... CHECK PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30072,8 +30072,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -30509,8 +30509,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30531,8 +30531,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -30971,8 +30971,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31001,8 +31001,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -31444,8 +31444,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31472,8 +31472,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -31911,8 +31911,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31937,8 +31937,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -32378,8 +32378,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -32408,8 +32408,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -32854,8 +32854,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -32884,8 +32884,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -33332,8 +33332,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -33358,8 +33358,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -33800,8 +33800,8 @@ DROP TABLE t1;
# 2.5 ALTER ... CHECK PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -33822,8 +33822,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -34259,8 +34259,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -34281,8 +34281,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -34721,8 +34721,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -34751,8 +34751,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -35194,8 +35194,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -35222,8 +35222,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -35661,8 +35661,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -35687,8 +35687,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -36128,8 +36128,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -36158,8 +36158,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -36604,8 +36604,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -36634,8 +36634,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -37082,8 +37082,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -37108,8 +37108,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -37553,8 +37553,8 @@ DROP TABLE t1;
# 3.1 ALTER ... OPTIMIZE PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -37576,8 +37576,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -38013,8 +38013,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -38036,8 +38036,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -38476,8 +38476,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -38507,8 +38507,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -38950,8 +38950,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -38979,8 +38979,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -39418,8 +39418,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -39445,8 +39445,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -39886,8 +39886,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -39917,8 +39917,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -40363,8 +40363,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -40394,8 +40394,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -40842,8 +40842,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -40869,8 +40869,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -41311,8 +41311,8 @@ DROP TABLE t1;
# 3.2 ALTER ... OPTIMIZE PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -41334,8 +41334,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -41771,8 +41771,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -41794,8 +41794,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -42234,8 +42234,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -42265,8 +42265,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -42708,8 +42708,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -42737,8 +42737,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -43176,8 +43176,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -43203,8 +43203,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -43644,8 +43644,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -43675,8 +43675,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -44121,8 +44121,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -44152,8 +44152,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -44600,8 +44600,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -44627,8 +44627,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -45069,8 +45069,8 @@ DROP TABLE t1;
# 3.3 ALTER ... OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -45091,8 +45091,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -45528,8 +45528,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -45550,8 +45550,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -45990,8 +45990,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -46020,8 +46020,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -46463,8 +46463,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -46491,8 +46491,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -46930,8 +46930,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -46956,8 +46956,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -47397,8 +47397,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -47427,8 +47427,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -47873,8 +47873,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -47903,8 +47903,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -48351,8 +48351,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -48377,8 +48377,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -48819,8 +48819,8 @@ DROP TABLE t1;
# 3.4 ALTER ... OPTIMIZE PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -48841,8 +48841,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -49278,8 +49278,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -49300,8 +49300,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -49740,8 +49740,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -49770,8 +49770,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -50213,8 +50213,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -50241,8 +50241,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -50680,8 +50680,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -50706,8 +50706,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -51147,8 +51147,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -51177,8 +51177,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -51623,8 +51623,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -51653,8 +51653,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -52101,8 +52101,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -52127,8 +52127,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -52569,8 +52569,8 @@ DROP TABLE t1;
# 3.5 ALTER ... OPTIMIZE PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -52592,8 +52592,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -53029,8 +53029,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -53052,8 +53052,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -53492,8 +53492,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -53523,8 +53523,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -53966,8 +53966,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -53995,8 +53995,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -54434,8 +54434,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -54461,8 +54461,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -54902,8 +54902,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -54933,8 +54933,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -55379,8 +55379,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -55410,8 +55410,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -55858,8 +55858,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -55885,8 +55885,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -56330,8 +56330,8 @@ DROP TABLE t1;
# 4.1 ALTER ... REBUILD PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -56350,8 +56350,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -56787,8 +56787,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -56807,8 +56807,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -57247,8 +57247,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -57275,8 +57275,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -57718,8 +57718,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -57744,8 +57744,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -58183,8 +58183,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -58207,8 +58207,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -58648,8 +58648,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -58676,8 +58676,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -59122,8 +59122,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -59150,8 +59150,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -59598,8 +59598,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -59622,8 +59622,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -60064,8 +60064,8 @@ DROP TABLE t1;
# 4.2 ALTER ... REBUILD PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -60084,8 +60084,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -60521,8 +60521,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -60541,8 +60541,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -60981,8 +60981,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -61009,8 +61009,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -61452,8 +61452,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -61478,8 +61478,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -61917,8 +61917,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -61941,8 +61941,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -62382,8 +62382,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62410,8 +62410,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -62856,8 +62856,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62884,8 +62884,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -63332,8 +63332,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63356,8 +63356,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -63798,8 +63798,8 @@ DROP TABLE t1;
# 4.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63813,8 +63813,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63828,8 +63828,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63851,8 +63851,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63872,8 +63872,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63891,8 +63891,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63914,8 +63914,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63937,8 +63937,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63958,8 +63958,8 @@ DROP TABLE t1;
# 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63973,8 +63973,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63988,8 +63988,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64011,8 +64011,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64032,8 +64032,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64051,8 +64051,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64074,8 +64074,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64097,8 +64097,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64118,8 +64118,8 @@ DROP TABLE t1;
# 4.5 ALTER ... REBUILD PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64138,8 +64138,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -64575,8 +64575,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64595,8 +64595,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -65035,8 +65035,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -65063,8 +65063,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -65506,8 +65506,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -65532,8 +65532,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -65971,8 +65971,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -65995,8 +65995,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -66436,8 +66436,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66464,8 +66464,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -66910,8 +66910,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66938,8 +66938,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -67386,8 +67386,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -67410,8 +67410,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -67855,8 +67855,8 @@ DROP TABLE t1;
# 5.1 ALTER ... REPAIR PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -67877,8 +67877,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -68314,8 +68314,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68336,8 +68336,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -68776,8 +68776,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68806,8 +68806,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -69249,8 +69249,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -69277,8 +69277,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -69716,8 +69716,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -69742,8 +69742,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -70183,8 +70183,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -70213,8 +70213,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -70659,8 +70659,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -70689,8 +70689,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -71137,8 +71137,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -71163,8 +71163,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -71605,8 +71605,8 @@ DROP TABLE t1;
# 5.2 ALTER ... REPAIR PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -71627,8 +71627,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -72064,8 +72064,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -72086,8 +72086,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -72526,8 +72526,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -72556,8 +72556,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -72999,8 +72999,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -73027,8 +73027,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -73466,8 +73466,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -73492,8 +73492,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -73933,8 +73933,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -73963,8 +73963,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -74409,8 +74409,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -74439,8 +74439,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -74887,8 +74887,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -74913,8 +74913,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -75355,8 +75355,8 @@ DROP TABLE t1;
# 5.3 ALTER ... REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -75377,8 +75377,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -75814,8 +75814,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -75836,8 +75836,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -76276,8 +76276,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -76306,8 +76306,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -76749,8 +76749,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -76777,8 +76777,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -77216,8 +77216,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -77242,8 +77242,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -77683,8 +77683,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -77713,8 +77713,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -78159,8 +78159,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -78189,8 +78189,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -78637,8 +78637,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -78663,8 +78663,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -79105,8 +79105,8 @@ DROP TABLE t1;
# 5.4 ALTER ... REPAIR PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -79127,8 +79127,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -79564,8 +79564,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -79586,8 +79586,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -80026,8 +80026,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -80056,8 +80056,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -80499,8 +80499,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -80527,8 +80527,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -80966,8 +80966,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -80992,8 +80992,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -81433,8 +81433,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -81463,8 +81463,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -81909,8 +81909,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -81939,8 +81939,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -82387,8 +82387,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -82413,8 +82413,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -82855,8 +82855,8 @@ DROP TABLE t1;
# 5.5 ALTER ... REPAIR PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -82877,8 +82877,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -83314,8 +83314,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -83336,8 +83336,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -83776,8 +83776,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -83806,8 +83806,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -84249,8 +84249,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -84277,8 +84277,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -84716,8 +84716,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -84742,8 +84742,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -85183,8 +85183,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -85213,8 +85213,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -85659,8 +85659,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -85689,8 +85689,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -86137,8 +86137,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -86163,8 +86163,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -86608,8 +86608,8 @@ DROP TABLE t1;
# 6.1 ALTER ... REMOVE PARTITIONING;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -86628,8 +86628,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -87062,8 +87062,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -87082,8 +87082,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -87516,8 +87516,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -87544,8 +87544,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -87978,8 +87978,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -88004,8 +88004,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -88438,8 +88438,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -88462,8 +88462,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -88896,8 +88896,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -88924,8 +88924,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -89358,8 +89358,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -89386,8 +89386,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -89820,8 +89820,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -89844,8 +89844,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result
index 8aba07874aa..c49b4229519 100644
--- a/mysql-test/suite/parts/r/partition_alter4_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -47,8 +47,8 @@ SET @@session.sql_mode= '';
# 1.1 ALTER ... ANALYZE PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -69,8 +69,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -515,8 +515,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -537,8 +537,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -992,8 +992,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1022,8 +1022,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1486,8 +1486,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1514,8 +1514,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1970,8 +1970,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1996,8 +1996,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2458,8 +2458,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2488,8 +2488,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2955,8 +2955,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2985,8 +2985,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3454,8 +3454,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3480,8 +3480,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3945,8 +3945,8 @@ DROP TABLE t1;
# 1.2 ALTER ... ANALYZE PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3967,8 +3967,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4413,8 +4413,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4435,8 +4435,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4890,8 +4890,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4920,8 +4920,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5384,8 +5384,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5412,8 +5412,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5868,8 +5868,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5894,8 +5894,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6356,8 +6356,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6386,8 +6386,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6853,8 +6853,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6883,8 +6883,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7352,8 +7352,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7378,8 +7378,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7843,8 +7843,8 @@ DROP TABLE t1;
# 1.3 ALTER ... ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7865,8 +7865,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8311,8 +8311,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8333,8 +8333,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8788,8 +8788,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8818,8 +8818,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9282,8 +9282,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9310,8 +9310,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -9766,8 +9766,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9792,8 +9792,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10254,8 +10254,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10284,8 +10284,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -10751,8 +10751,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10781,8 +10781,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -11250,8 +11250,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11276,8 +11276,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -11741,8 +11741,8 @@ DROP TABLE t1;
# 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11763,8 +11763,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -12209,8 +12209,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12231,8 +12231,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -12686,8 +12686,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12716,8 +12716,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -13180,8 +13180,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13208,8 +13208,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -13664,8 +13664,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13690,8 +13690,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -14152,8 +14152,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14182,8 +14182,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -14649,8 +14649,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14679,8 +14679,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -15148,8 +15148,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15174,8 +15174,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -15639,8 +15639,8 @@ DROP TABLE t1;
# 1.5 ALTER ... ANALYZE PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15661,8 +15661,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -16107,8 +16107,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16129,8 +16129,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -16584,8 +16584,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16614,8 +16614,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -17078,8 +17078,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17106,8 +17106,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -17562,8 +17562,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17588,8 +17588,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -18050,8 +18050,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18080,8 +18080,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -18547,8 +18547,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18577,8 +18577,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -19046,8 +19046,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19072,8 +19072,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -19540,8 +19540,8 @@ DROP TABLE t1;
# 2.1 ALTER ... CHECK PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19562,8 +19562,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20008,8 +20008,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20030,8 +20030,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20485,8 +20485,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20515,8 +20515,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -20979,8 +20979,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21007,8 +21007,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -21463,8 +21463,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21489,8 +21489,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -21951,8 +21951,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21981,8 +21981,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -22448,8 +22448,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22478,8 +22478,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -22947,8 +22947,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22973,8 +22973,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -23438,8 +23438,8 @@ DROP TABLE t1;
# 2.2 ALTER ... CHECK PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23460,8 +23460,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -23906,8 +23906,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23928,8 +23928,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -24383,8 +24383,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24413,8 +24413,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -24877,8 +24877,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24905,8 +24905,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -25361,8 +25361,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25387,8 +25387,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -25849,8 +25849,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25879,8 +25879,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -26346,8 +26346,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26376,8 +26376,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -26845,8 +26845,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26871,8 +26871,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -27336,8 +27336,8 @@ DROP TABLE t1;
# 2.3 ALTER ... CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27358,8 +27358,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -27804,8 +27804,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27826,8 +27826,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -28281,8 +28281,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28311,8 +28311,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -28775,8 +28775,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28803,8 +28803,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -29259,8 +29259,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29285,8 +29285,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -29747,8 +29747,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29777,8 +29777,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -30244,8 +30244,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30274,8 +30274,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -30743,8 +30743,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30769,8 +30769,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -31234,8 +31234,8 @@ DROP TABLE t1;
# 2.4 ALTER ... CHECK PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31256,8 +31256,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -31702,8 +31702,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31724,8 +31724,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -32179,8 +32179,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -32209,8 +32209,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -32673,8 +32673,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -32701,8 +32701,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -33157,8 +33157,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -33183,8 +33183,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -33645,8 +33645,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -33675,8 +33675,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -34142,8 +34142,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -34172,8 +34172,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -34641,8 +34641,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -34667,8 +34667,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -35132,8 +35132,8 @@ DROP TABLE t1;
# 2.5 ALTER ... CHECK PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -35154,8 +35154,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -35600,8 +35600,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -35622,8 +35622,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -36077,8 +36077,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -36107,8 +36107,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -36571,8 +36571,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -36599,8 +36599,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -37055,8 +37055,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -37081,8 +37081,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -37543,8 +37543,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -37573,8 +37573,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -38040,8 +38040,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -38070,8 +38070,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -38539,8 +38539,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -38565,8 +38565,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -39033,8 +39033,8 @@ DROP TABLE t1;
# 3.1 ALTER ... OPTIMIZE PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -39055,8 +39055,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -39501,8 +39501,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -39523,8 +39523,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -39978,8 +39978,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -40008,8 +40008,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -40472,8 +40472,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -40500,8 +40500,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -40956,8 +40956,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -40982,8 +40982,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -41444,8 +41444,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -41474,8 +41474,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -41941,8 +41941,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -41971,8 +41971,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -42440,8 +42440,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -42466,8 +42466,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -42931,8 +42931,8 @@ DROP TABLE t1;
# 3.2 ALTER ... OPTIMIZE PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -42953,8 +42953,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -43399,8 +43399,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -43421,8 +43421,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -43876,8 +43876,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -43906,8 +43906,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -44370,8 +44370,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -44398,8 +44398,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -44854,8 +44854,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -44880,8 +44880,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -45342,8 +45342,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -45372,8 +45372,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -45839,8 +45839,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -45869,8 +45869,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -46338,8 +46338,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -46364,8 +46364,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -46829,8 +46829,8 @@ DROP TABLE t1;
# 3.3 ALTER ... OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -46851,8 +46851,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -47297,8 +47297,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -47319,8 +47319,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -47774,8 +47774,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -47804,8 +47804,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -48268,8 +48268,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -48296,8 +48296,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -48752,8 +48752,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -48778,8 +48778,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -49240,8 +49240,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -49270,8 +49270,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -49737,8 +49737,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -49767,8 +49767,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -50236,8 +50236,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -50262,8 +50262,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -50727,8 +50727,8 @@ DROP TABLE t1;
# 3.4 ALTER ... OPTIMIZE PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -50749,8 +50749,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -51195,8 +51195,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -51217,8 +51217,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -51672,8 +51672,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -51702,8 +51702,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -52166,8 +52166,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -52194,8 +52194,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -52650,8 +52650,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -52676,8 +52676,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -53138,8 +53138,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -53168,8 +53168,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -53635,8 +53635,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -53665,8 +53665,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -54134,8 +54134,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -54160,8 +54160,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -54625,8 +54625,8 @@ DROP TABLE t1;
# 3.5 ALTER ... OPTIMIZE PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -54647,8 +54647,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -55093,8 +55093,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -55115,8 +55115,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -55570,8 +55570,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -55600,8 +55600,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -56064,8 +56064,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -56092,8 +56092,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -56548,8 +56548,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -56574,8 +56574,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -57036,8 +57036,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -57066,8 +57066,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -57533,8 +57533,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -57563,8 +57563,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -58032,8 +58032,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -58058,8 +58058,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -58526,8 +58526,8 @@ DROP TABLE t1;
# 4.1 ALTER ... REBUILD PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -58546,8 +58546,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -58992,8 +58992,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -59012,8 +59012,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -59467,8 +59467,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -59495,8 +59495,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -59959,8 +59959,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -59985,8 +59985,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -60441,8 +60441,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -60465,8 +60465,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -60927,8 +60927,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -60955,8 +60955,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -61422,8 +61422,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -61450,8 +61450,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -61919,8 +61919,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -61943,8 +61943,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -62408,8 +62408,8 @@ DROP TABLE t1;
# 4.2 ALTER ... REBUILD PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62428,8 +62428,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -62874,8 +62874,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62894,8 +62894,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -63349,8 +63349,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63377,8 +63377,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -63841,8 +63841,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -63867,8 +63867,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -64323,8 +64323,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64347,8 +64347,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -64809,8 +64809,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -64837,8 +64837,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -65304,8 +65304,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -65332,8 +65332,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -65801,8 +65801,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -65825,8 +65825,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -66290,8 +66290,8 @@ DROP TABLE t1;
# 4.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66305,8 +66305,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66320,8 +66320,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66343,8 +66343,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66364,8 +66364,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66383,8 +66383,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66406,8 +66406,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66429,8 +66429,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66450,8 +66450,8 @@ DROP TABLE t1;
# 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66465,8 +66465,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66480,8 +66480,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66503,8 +66503,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66524,8 +66524,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66543,8 +66543,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66566,8 +66566,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66589,8 +66589,8 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
ERROR HY000: Error in list of partitions to REBUILD
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66610,8 +66610,8 @@ DROP TABLE t1;
# 4.5 ALTER ... REBUILD PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -66630,8 +66630,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -67076,8 +67076,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -67096,8 +67096,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -67551,8 +67551,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -67579,8 +67579,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -68043,8 +68043,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68069,8 +68069,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -68525,8 +68525,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -68549,8 +68549,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -69011,8 +69011,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -69039,8 +69039,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -69506,8 +69506,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -69534,8 +69534,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -70003,8 +70003,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -70027,8 +70027,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -70495,8 +70495,8 @@ DROP TABLE t1;
# 5.1 ALTER ... REPAIR PARTITION part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -70517,8 +70517,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -70963,8 +70963,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -70985,8 +70985,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -71440,8 +71440,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -71470,8 +71470,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -71934,8 +71934,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -71962,8 +71962,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -72418,8 +72418,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -72444,8 +72444,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -72906,8 +72906,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -72936,8 +72936,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -73403,8 +73403,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -73433,8 +73433,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -73902,8 +73902,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -73928,8 +73928,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -74393,8 +74393,8 @@ DROP TABLE t1;
# 5.2 ALTER ... REPAIR PARTITION part_1,part_2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -74415,8 +74415,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -74861,8 +74861,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -74883,8 +74883,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -75338,8 +75338,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -75368,8 +75368,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -75832,8 +75832,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -75860,8 +75860,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -76316,8 +76316,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -76342,8 +76342,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -76804,8 +76804,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -76834,8 +76834,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -77301,8 +77301,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -77331,8 +77331,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -77800,8 +77800,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -77826,8 +77826,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -78291,8 +78291,8 @@ DROP TABLE t1;
# 5.3 ALTER ... REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -78313,8 +78313,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -78759,8 +78759,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -78781,8 +78781,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -79236,8 +79236,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -79266,8 +79266,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -79730,8 +79730,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -79758,8 +79758,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -80214,8 +80214,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -80240,8 +80240,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -80702,8 +80702,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -80732,8 +80732,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -81199,8 +81199,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -81229,8 +81229,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -81698,8 +81698,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -81724,8 +81724,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -82189,8 +82189,8 @@ DROP TABLE t1;
# 5.4 ALTER ... REPAIR PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -82211,8 +82211,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -82657,8 +82657,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -82679,8 +82679,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -83134,8 +83134,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -83164,8 +83164,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -83628,8 +83628,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -83656,8 +83656,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -84112,8 +84112,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -84138,8 +84138,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -84600,8 +84600,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -84630,8 +84630,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -85097,8 +85097,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -85127,8 +85127,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -85596,8 +85596,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -85622,8 +85622,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -86087,8 +86087,8 @@ DROP TABLE t1;
# 5.5 ALTER ... REPAIR PARTITION ALL;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -86109,8 +86109,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -86555,8 +86555,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -86577,8 +86577,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -87032,8 +87032,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -87062,8 +87062,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -87526,8 +87526,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -87554,8 +87554,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -88010,8 +88010,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -88036,8 +88036,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -88498,8 +88498,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -88528,8 +88528,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -88995,8 +88995,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -89025,8 +89025,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -89494,8 +89494,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -89520,8 +89520,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -89988,8 +89988,8 @@ DROP TABLE t1;
# 6.1 ALTER ... REMOVE PARTITIONING;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -90008,8 +90008,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -90448,8 +90448,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -90468,8 +90468,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -90908,8 +90908,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -90936,8 +90936,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -91376,8 +91376,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -91402,8 +91402,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -91842,8 +91842,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -91866,8 +91866,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -92306,8 +92306,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -92334,8 +92334,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -92774,8 +92774,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -92802,8 +92802,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -93242,8 +93242,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -93266,8 +93266,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_alter_myisam.result b/mysql-test/suite/parts/r/partition_alter_myisam.result
index 9f2381039d3..41af6af72fc 100644
--- a/mysql-test/suite/parts/r/partition_alter_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter_myisam.result
@@ -42,3 +42,16 @@ PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
+create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
+partition by key(c1) (
+partition p01 data directory = 'MYSQL_TMP_DIR'
+ index directory = 'MYSQL_TMP_DIR',
+partition p02 data directory = 'MYSQL_TMP_DIR'
+ index directory = 'MYSQL_TMP_DIR');
+insert into t1 values (1, 1, repeat('a', 100));
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+alter online table t1 delay_key_write=0;
+alter online table t1 delay_key_write=1;
+drop table t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
index 2344f03ce3f..03e87bc22fb 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
@@ -510,7 +510,7 @@ INSERT INTO t1 VALUES (2, NULL);
INSERT INTO t1 VALUES (3, NULL);
INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
INSERT INTO t1 VALUES (2, 2);
-# ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
# mysql_errno: 0
INSERT INTO t1 VALUES (2, 22), (2, NULL);
SELECT * FROM t1 ORDER BY c1,c2;
diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result
index 0bf2b8e8eaa..1a726229403 100644
--- a/mysql-test/suite/parts/r/partition_basic_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -52,8 +52,8 @@ SET @@session.sql_mode= '';
# 1.1 The partitioning function contains one column.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -67,8 +67,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -509,8 +509,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -524,8 +524,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -969,8 +969,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -992,8 +992,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1447,8 +1447,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1468,8 +1468,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1917,8 +1917,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1936,8 +1936,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2389,8 +2389,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2412,8 +2412,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2870,8 +2870,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2897,8 +2897,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3357,8 +3357,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3376,8 +3376,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3831,8 +3831,8 @@ DROP TABLE t1;
# 1.2 The partitioning function contains two columns.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3846,8 +3846,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4288,8 +4288,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4303,8 +4303,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4748,8 +4748,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4771,8 +4771,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5226,8 +5226,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5247,8 +5247,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5696,8 +5696,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5715,8 +5715,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6166,8 +6166,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6189,8 +6189,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6647,8 +6647,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6670,8 +6670,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7130,8 +7130,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7149,8 +7149,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7608,8 +7608,8 @@ DROP TABLE t1;
# 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8102,8 +8102,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8599,8 +8599,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9114,8 +9114,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9621,8 +9621,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10130,8 +10130,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10648,8 +10648,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11172,8 +11172,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11682,8 +11682,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12176,8 +12176,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12673,8 +12673,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13188,8 +13188,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13695,8 +13695,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14204,8 +14204,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14722,8 +14722,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15246,8 +15246,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15756,8 +15756,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15771,8 +15771,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -16266,8 +16266,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16281,8 +16281,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -16779,8 +16779,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16802,8 +16802,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -17310,8 +17310,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17331,8 +17331,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -17833,8 +17833,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17852,8 +17852,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -18358,8 +18358,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18381,8 +18381,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -18892,8 +18892,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18919,8 +18919,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -19432,8 +19432,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19451,8 +19451,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -19963,8 +19963,8 @@ DROP TABLE t1;
# 3.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20457,8 +20457,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20954,8 +20954,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21469,8 +21469,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -21976,8 +21976,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -22483,8 +22483,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23001,8 +23001,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -23521,8 +23521,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24031,8 +24031,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -24525,8 +24525,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25022,8 +25022,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -25537,8 +25537,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26044,8 +26044,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -26551,8 +26551,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27069,8 +27069,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -27589,8 +27589,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28099,8 +28099,8 @@ TRUNCATE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28114,8 +28114,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -28609,8 +28609,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -28624,8 +28624,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -29122,8 +29122,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29145,8 +29145,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -29653,8 +29653,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -29674,8 +29674,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -30176,8 +30176,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30195,8 +30195,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -30699,8 +30699,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -30722,8 +30722,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -31233,8 +31233,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31256,8 +31256,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -31769,8 +31769,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -31788,8 +31788,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result
index 8cddb7baca6..bade6841047 100644
--- a/mysql-test/suite/parts/r/partition_basic_myisam.result
+++ b/mysql-test/suite/parts/r/partition_basic_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -52,8 +52,8 @@ SET @@session.sql_mode= '';
# 1.1 The partitioning function contains one column.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -67,8 +67,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -512,8 +512,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -527,8 +527,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -978,8 +978,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1001,8 +1001,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1465,8 +1465,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1486,8 +1486,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1942,8 +1942,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1961,8 +1961,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2423,8 +2423,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2446,8 +2446,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2913,8 +2913,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2940,8 +2940,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3409,8 +3409,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3428,8 +3428,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3893,8 +3893,8 @@ DROP TABLE t1;
# 1.2 The partitioning function contains two columns.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3908,8 +3908,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4353,8 +4353,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4368,8 +4368,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4819,8 +4819,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4842,8 +4842,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5306,8 +5306,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5327,8 +5327,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5783,8 +5783,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5802,8 +5802,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6262,8 +6262,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6285,8 +6285,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6752,8 +6752,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6775,8 +6775,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7244,8 +7244,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7263,8 +7263,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7732,8 +7732,8 @@ DROP TABLE t1;
# 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7747,8 +7747,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8245,8 +8245,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8260,8 +8260,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8764,8 +8764,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8787,8 +8787,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9304,8 +9304,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9325,8 +9325,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9834,8 +9834,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9853,8 +9853,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10368,8 +10368,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10391,8 +10391,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10911,8 +10911,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10938,8 +10938,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11460,8 +11460,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11479,8 +11479,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12001,8 +12001,8 @@ DROP TABLE t1;
# 3.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12016,8 +12016,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12514,8 +12514,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12529,8 +12529,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13033,8 +13033,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13056,8 +13056,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13573,8 +13573,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13594,8 +13594,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14103,8 +14103,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14122,8 +14122,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14635,8 +14635,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14658,8 +14658,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15178,8 +15178,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15201,8 +15201,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15723,8 +15723,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15742,8 +15742,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
index 5f44fd138d9..006820d3f18 100644
--- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
+++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -56,8 +56,8 @@ SET @@session.sql_mode= '';
# 1.1 The partitioning function contains one column.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -77,8 +77,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -527,8 +527,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -557,8 +557,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1022,8 +1022,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1053,8 +1053,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1533,8 +1533,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1566,8 +1566,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2034,8 +2034,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2061,8 +2061,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2539,8 +2539,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2566,8 +2566,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3049,8 +3049,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3096,8 +3096,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3581,8 +3581,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3606,8 +3606,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4089,8 +4089,8 @@ DROP TABLE t1;
# 1.2 The partitioning function contains two columns.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4110,8 +4110,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4560,8 +4560,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4590,8 +4590,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5055,8 +5055,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5086,8 +5086,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -5566,8 +5566,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -5599,8 +5599,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6067,8 +6067,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6094,8 +6094,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -6570,8 +6570,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -6597,8 +6597,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7080,8 +7080,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7127,8 +7127,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -7612,8 +7612,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -7637,8 +7637,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -8124,8 +8124,8 @@ DROP TABLE t1;
# 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8145,8 +8145,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -8648,8 +8648,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -8678,8 +8678,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9196,8 +9196,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9227,8 +9227,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -9760,8 +9760,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -9793,8 +9793,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10314,8 +10314,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10341,8 +10341,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -10872,8 +10872,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -10899,8 +10899,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -11435,8 +11435,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -11482,8 +11482,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12020,8 +12020,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12045,8 +12045,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -12585,8 +12585,8 @@ DROP TABLE t1;
# 3.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -12606,8 +12606,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13109,8 +13109,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13139,8 +13139,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -13657,8 +13657,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -13688,8 +13688,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14221,8 +14221,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14254,8 +14254,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -14775,8 +14775,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -14802,8 +14802,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15331,8 +15331,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15358,8 +15358,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -15894,8 +15894,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -15941,8 +15941,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -16479,8 +16479,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -16504,8 +16504,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -17042,8 +17042,8 @@ DROP TABLE t1;
#========================================================================
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17061,8 +17061,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -17562,8 +17562,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -17587,8 +17587,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -18100,8 +18100,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18131,8 +18131,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -18657,8 +18657,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -18684,8 +18684,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -19199,8 +19199,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19222,8 +19222,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -19745,8 +19745,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -19773,8 +19773,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
@@ -20301,8 +20301,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -20316,8 +20316,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result
index 2e802d85b1f..558b5b3aae4 100644
--- a/mysql-test/suite/parts/r/partition_bit_innodb.result
+++ b/mysql-test/suite/parts/r/partition_bit_innodb.result
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT b'0',
+ `a` bit(64) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT b'0',
+ `a` bit(64) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT b'0'
+ `a` bit(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `a` bit(8) NOT NULL DEFAULT b'0',
+ `a` bit(8) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
- `a` bit(8) NOT NULL DEFAULT b'0',
+ `a` bit(8) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result
index c396cf66521..c101f44475d 100644
--- a/mysql-test/suite/parts/r/partition_bit_myisam.result
+++ b/mysql-test/suite/parts/r/partition_bit_myisam.result
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT b'0',
+ `a` bit(64) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT b'0',
+ `a` bit(64) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT b'0'
+ `a` bit(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT b'0',
+ `a` bit(1) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `a` bit(8) NOT NULL DEFAULT b'0',
+ `a` bit(8) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
- `a` bit(8) NOT NULL DEFAULT b'0',
+ `a` bit(8) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result
index 195263b8564..0a5e9775c36 100644
--- a/mysql-test/suite/parts/r/partition_datetime_innodb.result
+++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result
@@ -1,4 +1,4 @@
-create table t1 (a timestamp not null, primary key(a)) engine='InnoDB'
+create table t1 (a timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key(a)) engine='InnoDB'
partition by key (a) (
partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
@@ -32,7 +32,7 @@ a
2000-06-15 23:59:00
2020-12-31 12:10:30
drop table t1;
-create table t2 (a timestamp not null, primary key(a)) engine='InnoDB'
+create table t2 (a timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key(a)) engine='InnoDB'
partition by key (a) partitions 12;
show create table t2;
Table Create Table
diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result
index c715e0890bb..217fe9ace1d 100644
--- a/mysql-test/suite/parts/r/partition_datetime_myisam.result
+++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result
@@ -1,4 +1,4 @@
-create table t1 (a timestamp not null, primary key(a)) engine='MyISAM'
+create table t1 (a timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key(a)) engine='MyISAM'
partition by key (a) (
partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
@@ -32,7 +32,7 @@ a
2000-06-15 23:59:00
2020-12-31 12:10:30
drop table t1;
-create table t2 (a timestamp not null, primary key(a)) engine='MyISAM'
+create table t2 (a timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key(a)) engine='MyISAM'
partition by key (a) partitions 12;
show create table t2;
Table Create Table
diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result
index 8e5f7c43dd9..c3cb7cff083 100644
--- a/mysql-test/suite/parts/r/partition_engine_innodb.result
+++ b/mysql-test/suite/parts/r/partition_engine_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ DROP TABLE IF EXISTS t1;
# 1 Assignment of storage engine just after column list only
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62,8 +62,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -502,8 +502,8 @@ DROP TABLE t1;
# name only
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -519,8 +519,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -956,8 +956,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -978,8 +978,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1422,8 +1422,8 @@ DROP TABLE t1;
# engine assigned
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1434,8 +1434,8 @@ PARTITION part2
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1446,8 +1446,8 @@ PARTITION part2 STORAGE ENGINE = 'InnoDB'
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1463,8 +1463,8 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB')
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1480,8 +1480,8 @@ SUBPARTITION subpart22 )
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1503,8 +1503,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1947,8 +1947,8 @@ DROP TABLE t1;
# subpartitions belonging to another partition
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1964,8 +1964,8 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB')
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1982,8 +1982,8 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB')
);
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2004,8 +2004,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2444,8 +2444,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2466,8 +2466,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2911,8 +2911,8 @@ DROP TABLE t1;
# 5.1 Storage engine assignment after column list + after partition
# or subpartition name
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2928,8 +2928,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3365,8 +3365,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3387,8 +3387,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3830,8 +3830,8 @@ DROP TABLE t1;
# subpartition name
# in partition part + in sub partition part
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3852,8 +3852,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4296,8 +4296,8 @@ DROP TABLE t1;
#------------------------------------------------------------------------
SET SESSION storage_engine='MEMORY';
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4310,8 +4310,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4746,8 +4746,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4764,8 +4764,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result
index e63f9ee2fff..02f8649692d 100644
--- a/mysql-test/suite/parts/r/partition_engine_myisam.result
+++ b/mysql-test/suite/parts/r/partition_engine_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ DROP TABLE IF EXISTS t1;
# 1 Assignment of storage engine just after column list only
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -62,8 +62,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -511,8 +511,8 @@ DROP TABLE t1;
# name only
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -528,8 +528,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -974,8 +974,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -996,8 +996,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1453,8 +1453,8 @@ DROP TABLE t1;
# engine assigned
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1465,8 +1465,8 @@ PARTITION part2
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1477,8 +1477,8 @@ PARTITION part2 STORAGE ENGINE = 'MyISAM'
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1494,8 +1494,8 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM')
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1511,8 +1511,8 @@ SUBPARTITION subpart22 )
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1534,8 +1534,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1991,8 +1991,8 @@ DROP TABLE t1;
# subpartitions belonging to another partition
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2008,8 +2008,8 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM')
);
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2026,8 +2026,8 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM')
);
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2048,8 +2048,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2501,8 +2501,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2523,8 +2523,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -2981,8 +2981,8 @@ DROP TABLE t1;
# 5.1 Storage engine assignment after column list + after partition
# or subpartition name
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -2998,8 +2998,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3444,8 +3444,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3466,8 +3466,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -3922,8 +3922,8 @@ DROP TABLE t1;
# subpartition name
# in partition part + in sub partition part
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -3944,8 +3944,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4401,8 +4401,8 @@ DROP TABLE t1;
#------------------------------------------------------------------------
SET SESSION storage_engine='MEMORY';
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4415,8 +4415,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -4858,8 +4858,8 @@ TRUNCATE t1;
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -4876,8 +4876,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
diff --git a/mysql-test/suite/parts/r/partition_exch_innodb.result b/mysql-test/suite/parts/r/partition_exch_innodb.result
index d444e2e3558..d444e2e3558 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_innodb.result
diff --git a/mysql-test/suite/parts/r/partition_exch_myisam.result b/mysql-test/suite/parts/r/partition_exch_myisam.result
index d444e2e3558..d444e2e3558 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_myisam.result
diff --git a/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result b/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result
index 9ff4afcfe35..a2a58c22c42 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result
@@ -1,3 +1,58 @@
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) ,
+PARTITION p1 VALUES LESS THAN (100) ,
+PARTITION p2 VALUES LESS THAN (1000) );
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10)
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 ,
+SUBPARTITION sp11 ,
+SUBPARTITION sp12 ,
+SUBPARTITION sp13 ,
+SUBPARTITION sp14 ),
+PARTITION p2 VALUES LESS THAN (1000)
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
DROP TABLE IF EXISTS t_10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa.result b/mysql-test/suite/parts/r/partition_exch_qa.result
index d444e2e3558..d444e2e3558 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_10.result b/mysql-test/suite/parts/r/partition_exch_qa_10.result
index 77b91f19e8f..7193a6c99a1 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_10.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_10.result
@@ -23,7 +23,7 @@ a b
DROP PROCEDURE test_p1;
SET @save_autocommit= @@autocommit;
SET @@autocommit= OFF;
-SHOW VARIABLES LIKE '%autocommit%';
+SHOW VARIABLES LIKE 'autocommit%';
Variable_name Value
autocommit OFF
CREATE TRIGGER test_trg_1 BEFORE UPDATE ON tp FOR EACH ROW
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_11.result b/mysql-test/suite/parts/r/partition_exch_qa_11.result
index 2fe6c05e29c..2fe6c05e29c 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_11.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_11.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_14.result b/mysql-test/suite/parts/r/partition_exch_qa_14.result
index f6866727184..1420982436a 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_14.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_14.result
@@ -1,4 +1,198 @@
-use test;
+# === Data/Index directories are identical
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+PARTITION p1 VALUES LESS THAN (100) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir');
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp13 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp14 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'),
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
+DROP TABLE IF EXISTS t_10;
+DROP TABLE IF EXISTS t_100;
+DROP TABLE IF EXISTS t_1000;
+DROP TABLE IF EXISTS tp;
+DROP TABLE IF EXISTS tsp;
+DROP TABLE IF EXISTS tsp_00;
+DROP TABLE IF EXISTS tsp_01;
+DROP TABLE IF EXISTS tsp_02;
+DROP TABLE IF EXISTS tsp_03;
+DROP TABLE IF EXISTS tsp_04;
+DROP TABLE IF EXISTS t_empty;
+DROP TABLE IF EXISTS t_null;
+# === partition has directories, the table does not
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+PARTITION p1 VALUES LESS THAN (100) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir');
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp13 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp14 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'),
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
+ERROR HY000: Tables have different definitions
+DROP TABLE IF EXISTS t_10;
+DROP TABLE IF EXISTS t_100;
+DROP TABLE IF EXISTS t_1000;
+DROP TABLE IF EXISTS tp;
+DROP TABLE IF EXISTS tsp;
+DROP TABLE IF EXISTS tsp_00;
+DROP TABLE IF EXISTS tsp_01;
+DROP TABLE IF EXISTS tsp_02;
+DROP TABLE IF EXISTS tsp_03;
+DROP TABLE IF EXISTS tsp_04;
+DROP TABLE IF EXISTS t_empty;
+DROP TABLE IF EXISTS t_null;
+# === the table has directories, partition does not
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) ,
+PARTITION p1 VALUES LESS THAN (100) ,
+PARTITION p2 VALUES LESS THAN (1000) );
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10)
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 ,
+SUBPARTITION sp11 ,
+SUBPARTITION sp12 ,
+SUBPARTITION sp13 ,
+SUBPARTITION sp14 ),
+PARTITION p2 VALUES LESS THAN (1000)
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR HY000: Tables have different definitions
DROP TABLE IF EXISTS t_10;
@@ -13,7 +207,62 @@ DROP TABLE IF EXISTS tsp_03;
DROP TABLE IF EXISTS tsp_04;
DROP TABLE IF EXISTS t_empty;
DROP TABLE IF EXISTS t_null;
-use test;
+# === data directory differs
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+PARTITION p1 VALUES LESS THAN (100) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir');
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp13 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
+SUBPARTITION sp14 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'),
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR HY000: Tables have different definitions
DROP TABLE IF EXISTS t_10;
@@ -28,7 +277,62 @@ DROP TABLE IF EXISTS tsp_03;
DROP TABLE IF EXISTS tsp_04;
DROP TABLE IF EXISTS t_empty;
DROP TABLE IF EXISTS t_null;
-use test;
+# === index directory differs
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
+PARTITION p1 VALUES LESS THAN (100) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir');
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
+SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
+SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
+SUBPARTITION sp13 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
+SUBPARTITION sp14 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'),
+PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR HY000: Tables have different definitions
DROP TABLE IF EXISTS t_10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_15.result b/mysql-test/suite/parts/r/partition_exch_qa_15.result
index 87671a74253..355cf43d886 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_15.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_15.result
@@ -1,10 +1,65 @@
use test;
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) ,
+PARTITION p1 VALUES LESS THAN (100) ,
+PARTITION p2 VALUES LESS THAN (1000) );
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10)
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 ,
+SUBPARTITION sp11 ,
+SUBPARTITION sp12 ,
+SUBPARTITION sp13 ,
+SUBPARTITION sp14 ),
+PARTITION p2 VALUES LESS THAN (1000)
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = InnoDB AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = InnoDB AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = InnoDB AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = InnoDB AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = InnoDB AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
CREATE TABLE t_11 (a INT, b VARCHAR(55),
FOREIGN KEY (a) REFERENCES t_10 (a) ON DELETE CASCADE)
ENGINE= InnoDB;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
ERROR HY000: Table to exchange with partition has foreign key references: 't_11'
-DROP TABLE IF EXISTS t_11;
+DROP TABLE t_11;
DROP TABLE IF EXISTS t_10;
DROP TABLE IF EXISTS t_100;
DROP TABLE IF EXISTS t_1000;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result
index 574518bff38..5fe5b7cbfcd 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result
@@ -115,7 +115,7 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
show create table t_10;
Table Create Table
t_10 CREATE TABLE `t_10` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`) USING BTREE
@@ -123,7 +123,7 @@ t_10 CREATE TABLE `t_10` (
show create table tp ;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`) USING BTREE
@@ -140,7 +140,7 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
show create table t_10;
Table Create Table
t_10 CREATE TABLE `t_10` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`,`b`) USING BTREE
@@ -148,7 +148,7 @@ t_10 CREATE TABLE `t_10` (
show create table tp ;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`,`b`) USING BTREE
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result
index f15e56e76aa..8a9ffd0479a 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result
@@ -115,7 +115,7 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
show create table t_10;
Table Create Table
t_10 CREATE TABLE `t_10` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`) USING BTREE
@@ -123,7 +123,7 @@ t_10 CREATE TABLE `t_10` (
show create table tp ;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`) USING BTREE
@@ -140,7 +140,7 @@ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
show create table t_10;
Table Create Table
t_10 CREATE TABLE `t_10` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`,`b`) USING BTREE
@@ -148,7 +148,7 @@ t_10 CREATE TABLE `t_10` (
show create table tp ;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`,`b`) USING BTREE
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_2.result b/mysql-test/suite/parts/r/partition_exch_qa_2.result
index ea4983db3dc..956cb0af695 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_2.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_2.result
@@ -1,4 +1,59 @@
use test;
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) ,
+PARTITION p1 VALUES LESS THAN (100) ,
+PARTITION p2 VALUES LESS THAN (1000) );
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10)
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 ,
+SUBPARTITION sp11 ,
+SUBPARTITION sp12 ,
+SUBPARTITION sp13 ,
+SUBPARTITION sp14 ),
+PARTITION p2 VALUES LESS THAN (1000)
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
SELECT * FROM t_10;
a b
1 One
@@ -102,20 +157,20 @@ a b
CREATE TABLE t_11(a INT,b VARCHAR(55)) SELECT * FROM t_10;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
ERROR HY000: Tables have different definitions
-DROP TABLE IF EXISTS t_11;
+DROP TABLE t_11;
CREATE TABLE t_11(a INT,b CHAR(55),PRIMARY KEY(a)) ENGINE= MYISAM SELECT * FROM t_10;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
ERROR HY000: Tables have different definitions
-DROP TABLE IF EXISTS t_11;
+DROP TABLE t_11;
CREATE TABLE t_11(a INT,b VARCHAR(55),PRIMARY KEY(a)) ENGINE= MEMORY SELECT * FROM t_10;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
-DROP TABLE IF EXISTS t_11;
+DROP TABLE t_11;
CREATE TABLE t_11(a INT,b CHAR(55),PRIMARY KEY(a)) ENGINE= MYISAM
PARTITION BY KEY() AS SELECT * FROM t_10;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
ERROR HY000: Table to exchange with partition is partitioned: 't_11'
-DROP TABLE IF EXISTS t_11;
+DROP TABLE t_11;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE tsp;
ERROR HY000: Table to exchange with partition is partitioned: 'tsp'
ALTER TABLE tsp EXCHANGE PARTITION p0 WITH TABLE t_10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_3.result b/mysql-test/suite/parts/r/partition_exch_qa_3.result
index 9f4043a055a..791757c95f2 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_3.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_3.result
@@ -1,4 +1,159 @@
use test;
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) ,
+PARTITION p1 VALUES LESS THAN (100) ,
+PARTITION p2 VALUES LESS THAN (1000) );
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10)
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 ,
+SUBPARTITION sp11 ,
+SUBPARTITION sp12 ,
+SUBPARTITION sp13 ,
+SUBPARTITION sp14 ),
+PARTITION p2 VALUES LESS THAN (1000)
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
+SELECT * FROM t_10;
+a b
+1 One
+3 Three
+5 Five
+9 Nine
+SELECT * FROM t_100;
+a b
+11 Eleven
+13 Thirdteen
+15 Fifeteen
+19 Nineteen
+91 Ninety-one
+93 Ninety-three
+95 Ninety-five
+99 Ninety-nine
+SELECT * FROM t_1000;
+a b
+111 Hundred elven
+113 Hundred thirdteen
+115 Hundred fiveteen
+119 Hundred nineteen
+131 Hundred thirty-one
+133 Hundred thirty-three
+135 Hundred thirty-five
+139 Hundred thirty-nine
+151 Hundred fifty-one
+153 Hundred fifty-three
+155 Hundred fity-five
+159 Hundred fifty-nine
+191 Hundred ninety-one
+193 Hundred ninety-three
+195 Hundred ninety-five
+199 Hundred ninety-nine
+SELECT * FROM tp;
+a b
+112 Hundred twelve
+114 Hundred fourteen
+116 Hundred sixteen
+118 Hundred eightteen
+12 twelve
+122 Hundred twenty-two
+124 Hundred twenty-four
+126 Hundred twenty-six
+128 Hundred twenty-eight
+14 Fourteen
+16 Sixteen
+162 Hundred sixty-two
+164 Hundred sixty-four
+166 Hundred sixty-six
+168 Hundred sixty-eight
+18 Eightteen
+182 Hundred eighty-two
+184 Hundred eighty-four
+186 Hundred eighty-six
+188 Hundred eighty-eight
+2 Two
+4 Four
+6 Six
+8 Eight
+SELECT * FROM tsp;
+a b
+112 Hundred twelve
+114 Hundred fourteen
+116 Hundred sixteen
+118 Hundred eightteen
+12 twelve
+122 Hundred twenty-two
+124 Hundred twenty-four
+126 Hundred twenty-six
+128 Hundred twenty-eight
+14 Fourteen
+16 Sixteen
+162 Hundred sixty-two
+164 Hundred sixty-four
+166 Hundred sixty-six
+168 Hundred sixty-eight
+18 Eightteen
+182 Hundred eight-two
+184 Hundred eighty-four
+186 Hundred eighty-six
+188 Hundred eighty-eight
+2 Two
+4 Four
+6 Six
+8 Eight
+SELECT * FROM tsp_00;
+a b
+5 Five
+SELECT * FROM tsp_01;
+a b
+1 One
+SELECT * FROM tsp_02;
+a b
+SELECT * FROM tsp_03;
+a b
+3 Three
+SELECT * FROM tsp_04;
+a b
+9 Nine
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result
index 35f3499fce7..35f3499fce7 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result
index 35f3499fce7..35f3499fce7 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
index e539c37a0b4..e539c37a0b4 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
index e539c37a0b4..e539c37a0b4 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_6.result b/mysql-test/suite/parts/r/partition_exch_qa_6.result
index 92527ab1dd9..1d285a19390 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_6.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_6.result
@@ -1,8 +1,61 @@
CREATE USER test2@localhost;
+CREATE TABLE t_10 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_100 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_1000 (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_empty (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE t_null (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM;
+CREATE TABLE tp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) ,
+PARTITION p1 VALUES LESS THAN (100) ,
+PARTITION p2 VALUES LESS THAN (1000) );
+CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) ENGINE = MYISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH(a)
+(PARTITION p0 VALUES LESS THAN (10)
+(SUBPARTITION sp00,
+SUBPARTITION sp01,
+SUBPARTITION sp02,
+SUBPARTITION sp03,
+SUBPARTITION sp04), PARTITION p1 VALUES LESS THAN (100)
+(SUBPARTITION sp10 ,
+SUBPARTITION sp11 ,
+SUBPARTITION sp12 ,
+SUBPARTITION sp13 ,
+SUBPARTITION sp14 ),
+PARTITION p2 VALUES LESS THAN (1000)
+(SUBPARTITION sp20,
+SUBPARTITION sp21,
+SUBPARTITION sp22,
+SUBPARTITION sp23,
+SUBPARTITION sp24));
+INSERT INTO t_10 VALUES (1, "One"), (3, "Three"), (5, "Five"), (9, "Nine");
+INSERT INTO t_100 VALUES (11, "Eleven"), (13, "Thirdteen"), (15, "Fifeteen"), (19, "Nineteen");
+INSERT INTO t_100 VALUES (91, "Ninety-one"), (93, "Ninety-three"), (95, "Ninety-five"), (99, "Ninety-nine");
+INSERT INTO t_1000 VALUES (111, "Hundred elven"), (113, "Hundred thirdteen"), (115, "Hundred fiveteen"), (119, "Hundred nineteen");
+INSERT INTO t_1000 VALUES (131, "Hundred thirty-one"), (133, "Hundred thirty-three"), (135, "Hundred thirty-five"), (139, "Hundred thirty-nine");
+INSERT INTO t_1000 VALUES (151, "Hundred fifty-one"), (153, "Hundred fifty-three"), (155, "Hundred fity-five"), (159, "Hundred fifty-nine");
+INSERT INTO t_1000 VALUES (191, "Hundred ninety-one"), (193, "Hundred ninety-three"), (195, "Hundred ninety-five"), (199, "Hundred ninety-nine");
+INSERT INTO t_null VALUES (1, "NULL");
+INSERT INTO tp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tp VALUES (182, "Hundred eighty-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+INSERT INTO tsp VALUES (2, "Two"), (4, "Four"), (6, "Six"), (8, "Eight");
+INSERT INTO tsp VALUES (12, "twelve"), (14, "Fourteen"), (16, "Sixteen"), (18, "Eightteen");
+INSERT INTO tsp VALUES (112, "Hundred twelve"), (114, "Hundred fourteen"), (116, "Hundred sixteen"), (118, "Hundred eightteen");
+INSERT INTO tsp VALUES (122, "Hundred twenty-two"), (124, "Hundred twenty-four"), (126, "Hundred twenty-six"), (128, "Hundred twenty-eight");
+INSERT INTO tsp VALUES (162, "Hundred sixty-two"), (164, "Hundred sixty-four"), (166, "Hundred sixty-six"), (168, "Hundred sixty-eight");
+INSERT INTO tsp VALUES (182, "Hundred eight-two"), (184, "Hundred eighty-four"), (186, "Hundred eighty-six"), (188, "Hundred eighty-eight");
+CREATE TABLE tsp_01(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 1;
+CREATE TABLE tsp_02(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 2;
+CREATE TABLE tsp_03(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 3;
+CREATE TABLE tsp_04(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 4;
+CREATE TABLE tsp_00(a INT,b VARCHAR(55),PRIMARY KEY (a)) ENGINE = MYISAM AS SELECT a, b FROM t_10 WHERE MOD(a,5)= 0;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
-USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
@@ -53,10 +106,7 @@ a b
4 Four
6 Six
8 Eight
-disconnect test2;
-connection default;
REVOKE INSERT ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
@@ -64,11 +114,8 @@ GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 'tp'
-disconnect test2;
-connection default;
GRANT INSERT ON test.* TO test2@localhost;
REVOKE CREATE ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
@@ -76,20 +123,14 @@ GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, INSERT, UPDATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
ERROR 42000: CREATE command denied to user 'test2'@'localhost' for table 'tsp'
-disconnect test2;
-connection default;
GRANT CREATE ON test.* TO test2@localhost;
REVOKE DROP ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
-USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, INSERT, UPDATE, CREATE, ALTER ON `test`.* TO 'test2'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: DROP command denied to user 'test2'@'localhost' for table 'tp'
-disconnect test2;
-connection default;
DROP TABLE IF EXISTS t_10;
DROP TABLE IF EXISTS t_100;
DROP TABLE IF EXISTS t_1000;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
index 8ae4bfd3d3a..8ae4bfd3d3a 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
index 8ae4bfd3d3a..8ae4bfd3d3a 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
index b252fc616b1..b252fc616b1 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
index b252fc616b1..b252fc616b1 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
diff --git a/mysql-test/suite/parts/r/partition_exchange_innodb.result b/mysql-test/suite/parts/r/partition_exchange_innodb.result
index d3287310f73..f0e4923d39a 100644
--- a/mysql-test/suite/parts/r/partition_exchange_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exchange_innodb.result
@@ -183,14 +183,14 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@@ -226,14 +226,14 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@@ -301,14 +301,14 @@ SET DEBUG_SYNC= 'now SIGNAL test_done';
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@@ -334,14 +334,14 @@ SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
diff --git a/mysql-test/suite/parts/r/partition_exchange_memory.result b/mysql-test/suite/parts/r/partition_exchange_memory.result
index b6df8259b8c..9cc42791905 100644
--- a/mysql-test/suite/parts/r/partition_exchange_memory.result
+++ b/mysql-test/suite/parts/r/partition_exchange_memory.result
@@ -183,14 +183,14 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
@@ -226,14 +226,14 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
@@ -301,14 +301,14 @@ SET DEBUG_SYNC= 'now SIGNAL test_done';
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
@@ -334,14 +334,14 @@ SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
diff --git a/mysql-test/suite/parts/r/partition_exchange_myisam.result b/mysql-test/suite/parts/r/partition_exchange_myisam.result
index 932891d74fa..c31e2a6ee89 100644
--- a/mysql-test/suite/parts/r/partition_exchange_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exchange_myisam.result
@@ -183,14 +183,14 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -226,14 +226,14 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -301,14 +301,14 @@ SET DEBUG_SYNC= 'now SIGNAL test_done';
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -334,14 +334,14 @@ SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE tp;
Table Create Table
tp CREATE TABLE `tp` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`b` varchar(55) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 37bc3e49ab7..1a513aa3d5f 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -10,7 +10,7 @@ t1 CREATE TABLE `t1` (
`a` date NOT NULL,
`b` varchar(50) NOT NULL,
`c` varchar(50) NOT NULL,
- `d` enum('m','w') NOT NULL DEFAULT 'm',
+ `d` enum('m','w') NOT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a,b,c,d)
diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result
index 31868ea03ed..d300d6d2d44 100644
--- a/mysql-test/suite/parts/r/partition_special_myisam.result
+++ b/mysql-test/suite/parts/r/partition_special_myisam.result
@@ -10,7 +10,7 @@ t1 CREATE TABLE `t1` (
`a` date NOT NULL,
`b` varchar(50) NOT NULL,
`c` varchar(50) NOT NULL,
- `d` enum('m','w') NOT NULL DEFAULT 'm',
+ `d` enum('m','w') NOT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a,b,c,d)
diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result
index 92af6bc733f..3dba2873235 100644
--- a/mysql-test/suite/parts/r/partition_syntax_innodb.result
+++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ DROP TABLE IF EXISTS t1;
# PARTITION BY HASH/KEY/LIST/RANGE
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -58,8 +58,8 @@ PRIMARY KEY (f_int2)
PARTITION BY HASH(f_int1) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -68,8 +68,8 @@ PRIMARY KEY (f_int2)
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -78,8 +78,8 @@ PRIMARY KEY (f_int2)
PARTITION BY KEY(f_int1) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -88,8 +88,8 @@ PRIMARY KEY (f_int2)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -99,8 +99,8 @@ PARTITION BY LIST(f_int1)
(PARTITION part1 VALUES IN (1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -110,8 +110,8 @@ PARTITION BY LIST(f_int1 + f_int2)
(PARTITION part1 VALUES IN (1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -121,8 +121,8 @@ PARTITION BY RANGE(f_int1)
(PARTITION part1 VALUES LESS THAN (1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -140,8 +140,8 @@ ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning
# Variant 2) two columns in partitioning function
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -150,8 +150,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -160,8 +160,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -170,8 +170,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -180,8 +180,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -190,8 +190,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -200,8 +200,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -210,8 +210,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -220,8 +220,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -234,8 +234,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -248,8 +248,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -262,8 +262,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -276,8 +276,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -288,8 +288,8 @@ PARTITION BY RANGE(f_int1)
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -300,8 +300,8 @@ PARTITION BY RANGE(f_int1)
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -312,8 +312,8 @@ PARTITION BY RANGE(f_int1 + f_int2)
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -328,8 +328,8 @@ ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning
# PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -340,8 +340,8 @@ PARTITION BY RANGE(f_int2) SUBPARTITION BY HASH(f_int1)
(SUBPARTITION subpart1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -352,8 +352,8 @@ PARTITION BY RANGE(f_int2) SUBPARTITION BY KEY(f_int1)
(SUBPARTITION subpart1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -364,8 +364,8 @@ PARTITION BY LIST(f_int2) SUBPARTITION BY HASH(f_int1)
(SUBPARTITION subpart1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -382,8 +382,8 @@ ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning
# Variant b) With correct additional PRIMARY KEY
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -395,8 +395,8 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -408,8 +408,8 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -421,8 +421,8 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -434,8 +434,8 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -449,8 +449,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -464,8 +464,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -479,8 +479,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -502,8 +502,8 @@ ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning
#------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -517,8 +517,8 @@ ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY pa
# later releases.
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -539,8 +539,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
# 3.1 The constants in VALUES IN clauses must differ
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -569,8 +569,8 @@ ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partiti
# 3.3 LIST partitions must be defined with VALUES IN
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -584,8 +584,8 @@ ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition defin
# 3.4 RANGE partitions must be defined with VALUES LESS THAN
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -601,8 +601,8 @@ ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
# 3.5.1 NULL in RANGE partitioning clause
# 3.5.1.1 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -613,8 +613,8 @@ PARTITION part2 VALUES LESS THAN (1000));
ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -626,8 +626,8 @@ ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.2 NULL in LIST partitioning clause
# 3.5.2.1 VALUE IN (NULL)
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -639,8 +639,8 @@ PARTITION part3 VALUES IN (1));
DROP TABLE t1;
# 3.5.2.2 VALUE IN (NULL)
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -652,8 +652,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -665,8 +665,8 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
# 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0)
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -679,8 +679,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -702,8 +702,8 @@ DROP TABLE IF EXISTS t1;
#------------------------------------------------------------------------
# 4.1.1 no partition number, no named partitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -713,8 +713,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -724,8 +724,8 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
# 4.1.2 no partition number, named partitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -735,8 +735,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -748,31 +748,31 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
# 4.1.3 variations on no partition/subpartition number, named partitions,
# different subpartitions are/are not named
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
DROP TABLE t1;
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart31 , SUBPARTITION subpart32 ))' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -780,16 +780,16 @@ PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -798,8 +798,8 @@ PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31 , SUBPART' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -807,8 +807,8 @@ PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20)
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')' at line 8
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -820,8 +820,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -845,8 +845,8 @@ DROP TABLE t1;
DROP TABLE IF EXISTS t1;
# 4.2.1 partition/subpartition numbers INTEGER notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -856,8 +856,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -867,8 +867,8 @@ PARTITIONS 2 */
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -881,8 +881,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -895,8 +895,8 @@ SUBPARTITIONS 2
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -906,8 +906,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -917,8 +917,8 @@ PARTITIONS 1 */
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -931,8 +931,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -945,8 +945,8 @@ SUBPARTITIONS 1
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -954,8 +954,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0;
ERROR HY000: Number of partitions = 0 is not an allowed value
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -966,8 +966,8 @@ SUBPARTITIONS 0
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: Number of subpartitions = 0 is not an allowed value
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -975,8 +975,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS -1;
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 '-1' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -989,8 +989,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -998,8 +998,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1000000;
ERROR HY000: Too many partitions (including subpartitions) were defined
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1011,8 +1011,8 @@ PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: Too many partitions (including subpartitions) were defined
# 4.2.2 partition/subpartition numbers DECIMAL notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1020,8 +1020,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2.0;
ERROR 42000: Only integers allowed as number here near '2.0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1034,8 +1034,8 @@ ERROR 42000: Only integers allowed as number here near '2.0
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1043,8 +1043,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS -2.0;
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 '-2.0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1057,8 +1057,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1066,8 +1066,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.0;
ERROR 42000: Only integers allowed as number here near '0.0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1080,8 +1080,8 @@ ERROR 42000: Only integers allowed as number here near '0.0
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1089,8 +1089,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1.6;
ERROR 42000: Only integers allowed as number here near '1.6' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1103,8 +1103,8 @@ ERROR 42000: Only integers allowed as number here near '1.6
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1112,8 +1112,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 999999999999999999999999999999.999999999999999999999999999999;
ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1125,8 +1125,8 @@ PARTITION part2 VALUES LESS THAN (2147483646));
ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999
(PARTITION part1 V' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1134,8 +1134,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.000000000000000000000000000001;
ERROR 42000: Only integers allowed as number here near '0.000000000000000000000000000001' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1149,8 +1149,8 @@ ERROR 42000: Only integers allowed as number here near '0.0000000000000000000000
PARTITI' at line 9
# 4.2.3 partition/subpartition numbers FLOAT notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1158,8 +1158,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2.0E+0;
ERROR 42000: Only integers allowed as number here near '2.0E+0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1172,8 +1172,8 @@ ERROR 42000: Only integers allowed as number here near '2.0E+0
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN ' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1181,8 +1181,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.2E+1;
ERROR 42000: Only integers allowed as number here near '0.2E+1' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1195,8 +1195,8 @@ ERROR 42000: Only integers allowed as number here near '0.2E+1
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN ' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1204,8 +1204,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS -2.0E+0;
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 '-2.0E+0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1218,8 +1218,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1227,8 +1227,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.16E+1;
ERROR 42000: Only integers allowed as number here near '0.16E+1' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1241,8 +1241,8 @@ ERROR 42000: Only integers allowed as number here near '0.16E+1
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1250,8 +1250,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.0E+300;
ERROR 42000: Only integers allowed as number here near '0.0E+300' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1264,8 +1264,8 @@ ERROR 42000: Only integers allowed as number here near '0.0E+300
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THA' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1273,8 +1273,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1E+300;
ERROR 42000: Only integers allowed as number here near '1E+300' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1287,8 +1287,8 @@ ERROR 42000: Only integers allowed as number here near '1E+300
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN ' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1296,8 +1296,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1E-300;
ERROR 42000: Only integers allowed as number here near '1E-300' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1311,8 +1311,8 @@ ERROR 42000: Only integers allowed as number here near '1E-300
PARTITION part2 VALUES LESS THAN ' at line 9
# 4.2.4 partition/subpartition numbers STRING notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1320,8 +1320,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '2';
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 ''2'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1334,8 +1334,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1343,8 +1343,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '2.0';
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 ''2.0'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1357,8 +1357,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1366,8 +1366,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '0.2E+1';
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 ''0.2E+1'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1380,8 +1380,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THA' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1389,8 +1389,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '2A';
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 ''2A'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1403,8 +1403,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1412,8 +1412,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 'A2';
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 ''A2'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1426,8 +1426,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1435,8 +1435,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '';
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 '''' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1449,8 +1449,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1458,8 +1458,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 'GARBAGE';
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 ''GARBAGE'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1473,8 +1473,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
PARTITION part2 VALUES LESS TH' at line 9
# 4.2.5 partition/subpartition numbers other notations
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1482,8 +1482,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2A;
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 '2A' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1496,8 +1496,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1505,8 +1505,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS A2;
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 'A2' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1519,8 +1519,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1528,8 +1528,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS GARBAGE;
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 'GARBAGE' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1542,8 +1542,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1551,8 +1551,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "2";
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 '"2"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1565,8 +1565,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1574,8 +1574,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "2A";
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 '"2A"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1588,8 +1588,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1597,8 +1597,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "A2";
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 '"A2"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1611,8 +1611,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1620,8 +1620,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "GARBAGE";
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 '"GARBAGE"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1636,8 +1636,8 @@ PARTITION part2 VALUES LESS TH' at line 9
# 4.2.6 (negative) partition/subpartition numbers per @variables
SET @aux = 5;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1645,8 +1645,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS @aux;
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 '@aux' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1664,8 +1664,8 @@ PARTITION part2 VALUES LESS THA' at line 9
# 4.3.1 (positive) number of partition/subpartition
# = number of named partition/subpartition
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1675,8 +1675,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1687,8 +1687,8 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1704,8 +1704,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1726,8 +1726,8 @@ DROP TABLE t1;
# 4.3.3 (negative) number of partitions/subpartitions
# > number of named partitions/subpartitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1735,8 +1735,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2 ( PARTITION part1 ) ;
ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1752,8 +1752,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part2 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart21, SUBPAR' at line 11
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1771,8 +1771,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31, SUBPAR' at line 13
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1788,8 +1788,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
)' at line 13
# 4.3.4 (negative) number of partitions < number of named partitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1797,8 +1797,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1 ( PARTITION part1, PARTITION part2 ) ;
ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1814,8 +1814,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part2 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart21, SUBPAR' at line 11
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1833,8 +1833,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part2 VALUES LESS THAN (2000)
(SUBPARTITION subpart21 ' at line 11
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1860,8 +1860,8 @@ DROP TABLE IF EXISTS t1;
#------------------------------------------------------------------------
# 5.1.1 duplicate partition name
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1870,8 +1870,8 @@ PARTITION BY HASH(f_int1) (PARTITION part1, PARTITION part1);
ERROR HY000: Duplicate partition name part1
# 5.1.2 duplicate subpartition name
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result
index ae401e7f88a..7da964a1f8c 100644
--- a/mysql-test/suite/parts/r/partition_syntax_myisam.result
+++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result
@@ -11,8 +11,8 @@ SELECT @max_row DIV 4 INTO @max_row_div4;
SET @max_int_4 = 2147483647;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
@@ -27,8 +27,8 @@ file_list VARBINARY(10000),
PRIMARY KEY (state)
) ENGINE = MEMORY;
DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t0_aux ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -48,8 +48,8 @@ DROP TABLE IF EXISTS t1;
# PARTITION BY HASH/KEY/LIST/RANGE
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -58,8 +58,8 @@ PRIMARY KEY (f_int2)
PARTITION BY HASH(f_int1) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -68,8 +68,8 @@ PRIMARY KEY (f_int2)
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -78,8 +78,8 @@ PRIMARY KEY (f_int2)
PARTITION BY KEY(f_int1) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -88,8 +88,8 @@ PRIMARY KEY (f_int2)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -99,8 +99,8 @@ PARTITION BY LIST(f_int1)
(PARTITION part1 VALUES IN (1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -110,8 +110,8 @@ PARTITION BY LIST(f_int1 + f_int2)
(PARTITION part1 VALUES IN (1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -121,8 +121,8 @@ PARTITION BY RANGE(f_int1)
(PARTITION part1 VALUES LESS THAN (1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -140,8 +140,8 @@ ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning
# Variant 2) two columns in partitioning function
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -150,8 +150,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -160,8 +160,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -170,8 +170,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -180,8 +180,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -190,8 +190,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -200,8 +200,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -210,8 +210,8 @@ UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -220,8 +220,8 @@ PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -234,8 +234,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -248,8 +248,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -262,8 +262,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -276,8 +276,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -288,8 +288,8 @@ PARTITION BY RANGE(f_int1)
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -300,8 +300,8 @@ PARTITION BY RANGE(f_int1)
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -312,8 +312,8 @@ PARTITION BY RANGE(f_int1 + f_int2)
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -328,8 +328,8 @@ ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning
# PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -340,8 +340,8 @@ PARTITION BY RANGE(f_int2) SUBPARTITION BY HASH(f_int1)
(SUBPARTITION subpart1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -352,8 +352,8 @@ PARTITION BY RANGE(f_int2) SUBPARTITION BY KEY(f_int1)
(SUBPARTITION subpart1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -364,8 +364,8 @@ PARTITION BY LIST(f_int2) SUBPARTITION BY HASH(f_int1)
(SUBPARTITION subpart1));
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -382,8 +382,8 @@ ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning
# Variant b) With correct additional PRIMARY KEY
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -395,8 +395,8 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -408,8 +408,8 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -421,8 +421,8 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -434,8 +434,8 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -449,8 +449,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -464,8 +464,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -479,8 +479,8 @@ PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -502,8 +502,8 @@ ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning
#------------------------------------------------------------------------
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -517,8 +517,8 @@ ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY pa
# later releases.
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000),
@@ -539,8 +539,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
# 3.1 The constants in VALUES IN clauses must differ
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -569,8 +569,8 @@ ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partiti
# 3.3 LIST partitions must be defined with VALUES IN
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -584,8 +584,8 @@ ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition defin
# 3.4 RANGE partitions must be defined with VALUES LESS THAN
#------------------------------------------------------------------------
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -601,8 +601,8 @@ ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
# 3.5.1 NULL in RANGE partitioning clause
# 3.5.1.1 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -613,8 +613,8 @@ PARTITION part2 VALUES LESS THAN (1000));
ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -626,8 +626,8 @@ ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.2 NULL in LIST partitioning clause
# 3.5.2.1 VALUE IN (NULL)
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -639,8 +639,8 @@ PARTITION part3 VALUES IN (1));
DROP TABLE t1;
# 3.5.2.2 VALUE IN (NULL)
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -652,8 +652,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -673,8 +673,8 @@ t1.par
DROP TABLE t1;
# 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0)
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -687,8 +687,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -720,8 +720,8 @@ DROP TABLE IF EXISTS t1;
#------------------------------------------------------------------------
# 4.1.1 no partition number, no named partitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -731,8 +731,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -748,8 +748,8 @@ t1.par
DROP TABLE t1;
# 4.1.2 no partition number, named partitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -759,8 +759,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -780,31 +780,31 @@ t1.par
DROP TABLE t1;
# 4.1.3 variations on no partition/subpartition number, named partitions,
# different subpartitions are/are not named
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
DROP TABLE t1;
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart31 , SUBPARTITION subpart32 ))' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -812,16 +812,16 @@ PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS T' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -830,8 +830,8 @@ PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31 , SUBPART' at line 7
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -839,8 +839,8 @@ PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20)
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')' at line 8
-CREATE TABLE t1 ( f_int1 INTEGER,
-f_int2 INTEGER,
+CREATE TABLE t1 ( f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) )
@@ -852,8 +852,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -893,8 +893,8 @@ DROP TABLE t1;
DROP TABLE IF EXISTS t1;
# 4.2.1 partition/subpartition numbers INTEGER notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -904,8 +904,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -923,8 +923,8 @@ t1.par
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -937,8 +937,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -963,8 +963,8 @@ t1.par
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -974,8 +974,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -991,8 +991,8 @@ t1.par
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1005,8 +1005,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1027,8 +1027,8 @@ t1.par
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1036,8 +1036,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0;
ERROR HY000: Number of partitions = 0 is not an allowed value
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1048,8 +1048,8 @@ SUBPARTITIONS 0
PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: Number of subpartitions = 0 is not an allowed value
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1057,8 +1057,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS -1;
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 '-1' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1071,8 +1071,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1080,8 +1080,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1000000;
ERROR HY000: Too many partitions (including subpartitions) were defined
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1093,8 +1093,8 @@ PARTITION part2 VALUES LESS THAN (2147483646));
ERROR HY000: Too many partitions (including subpartitions) were defined
# 4.2.2 partition/subpartition numbers DECIMAL notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1102,8 +1102,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2.0;
ERROR 42000: Only integers allowed as number here near '2.0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1116,8 +1116,8 @@ ERROR 42000: Only integers allowed as number here near '2.0
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1125,8 +1125,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS -2.0;
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 '-2.0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1139,8 +1139,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1148,8 +1148,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.0;
ERROR 42000: Only integers allowed as number here near '0.0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1162,8 +1162,8 @@ ERROR 42000: Only integers allowed as number here near '0.0
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1171,8 +1171,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1.6;
ERROR 42000: Only integers allowed as number here near '1.6' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1185,8 +1185,8 @@ ERROR 42000: Only integers allowed as number here near '1.6
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1194,8 +1194,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 999999999999999999999999999999.999999999999999999999999999999;
ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1207,8 +1207,8 @@ PARTITION part2 VALUES LESS THAN (2147483646));
ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999
(PARTITION part1 V' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1216,8 +1216,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.000000000000000000000000000001;
ERROR 42000: Only integers allowed as number here near '0.000000000000000000000000000001' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1231,8 +1231,8 @@ ERROR 42000: Only integers allowed as number here near '0.0000000000000000000000
PARTITI' at line 9
# 4.2.3 partition/subpartition numbers FLOAT notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1240,8 +1240,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2.0E+0;
ERROR 42000: Only integers allowed as number here near '2.0E+0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1254,8 +1254,8 @@ ERROR 42000: Only integers allowed as number here near '2.0E+0
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN ' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1263,8 +1263,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.2E+1;
ERROR 42000: Only integers allowed as number here near '0.2E+1' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1277,8 +1277,8 @@ ERROR 42000: Only integers allowed as number here near '0.2E+1
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN ' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1286,8 +1286,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS -2.0E+0;
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 '-2.0E+0' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1300,8 +1300,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1309,8 +1309,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.16E+1;
ERROR 42000: Only integers allowed as number here near '0.16E+1' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1323,8 +1323,8 @@ ERROR 42000: Only integers allowed as number here near '0.16E+1
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1332,8 +1332,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 0.0E+300;
ERROR 42000: Only integers allowed as number here near '0.0E+300' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1346,8 +1346,8 @@ ERROR 42000: Only integers allowed as number here near '0.0E+300
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THA' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1355,8 +1355,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1E+300;
ERROR 42000: Only integers allowed as number here near '1E+300' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1369,8 +1369,8 @@ ERROR 42000: Only integers allowed as number here near '1E+300
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN ' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1378,8 +1378,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1E-300;
ERROR 42000: Only integers allowed as number here near '1E-300' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1393,8 +1393,8 @@ ERROR 42000: Only integers allowed as number here near '1E-300
PARTITION part2 VALUES LESS THAN ' at line 9
# 4.2.4 partition/subpartition numbers STRING notation
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1402,8 +1402,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '2';
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 ''2'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1416,8 +1416,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1425,8 +1425,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '2.0';
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 ''2.0'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1439,8 +1439,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1448,8 +1448,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '0.2E+1';
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 ''0.2E+1'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1462,8 +1462,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THA' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1471,8 +1471,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '2A';
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 ''2A'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1485,8 +1485,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1494,8 +1494,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 'A2';
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 ''A2'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1508,8 +1508,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1517,8 +1517,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS '';
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 '''' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1531,8 +1531,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1540,8 +1540,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 'GARBAGE';
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 ''GARBAGE'' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1555,8 +1555,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
PARTITION part2 VALUES LESS TH' at line 9
# 4.2.5 partition/subpartition numbers other notations
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1564,8 +1564,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2A;
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 '2A' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1578,8 +1578,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1587,8 +1587,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS A2;
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 'A2' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1601,8 +1601,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (214' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1610,8 +1610,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS GARBAGE;
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 'GARBAGE' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1624,8 +1624,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1633,8 +1633,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "2";
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 '"2"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1647,8 +1647,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (21' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1656,8 +1656,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "2A";
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 '"2A"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1670,8 +1670,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1679,8 +1679,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "A2";
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 '"A2"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1693,8 +1693,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
(PARTITION part1 VALUES LESS THAN (10),
PARTITION part2 VALUES LESS THAN (2' at line 9
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1702,8 +1702,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS "GARBAGE";
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 '"GARBAGE"' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1718,8 +1718,8 @@ PARTITION part2 VALUES LESS TH' at line 9
# 4.2.6 (negative) partition/subpartition numbers per @variables
SET @aux = 5;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1727,8 +1727,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS @aux;
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 '@aux' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1746,8 +1746,8 @@ PARTITION part2 VALUES LESS THA' at line 9
# 4.3.1 (positive) number of partition/subpartition
# = number of named partition/subpartition
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1757,8 +1757,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1777,8 +1777,8 @@ t1.par
DROP TABLE t1;
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1794,8 +1794,8 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT '0',
+ `f_int2` int(11) DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
@@ -1828,8 +1828,8 @@ DROP TABLE t1;
# 4.3.3 (negative) number of partitions/subpartitions
# > number of named partitions/subpartitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1837,8 +1837,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 2 ( PARTITION part1 ) ;
ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1854,8 +1854,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part2 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart21, SUBPAR' at line 11
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1873,8 +1873,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part3 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart31, SUBPAR' at line 13
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1890,8 +1890,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
)' at line 13
# 4.3.4 (negative) number of partitions < number of named partitions
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1899,8 +1899,8 @@ f_charbig VARCHAR(1000)
PARTITION BY HASH(f_int1) PARTITIONS 1 ( PARTITION part1, PARTITION part2 ) ;
ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1916,8 +1916,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part2 VALUES LESS THAN (2147483646)
(SUBPARTITION subpart21, SUBPAR' at line 11
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1935,8 +1935,8 @@ ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setti
PARTITION part2 VALUES LESS THAN (2000)
(SUBPARTITION subpart21 ' at line 11
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1962,8 +1962,8 @@ DROP TABLE IF EXISTS t1;
#------------------------------------------------------------------------
# 5.1.1 duplicate partition name
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
@@ -1972,8 +1972,8 @@ PARTITION BY HASH(f_int1) (PARTITION part1, PARTITION part1);
ERROR HY000: Duplicate partition name part1
# 5.1.2 duplicate subpartition name
CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
+f_int1 INTEGER DEFAULT 0,
+f_int2 INTEGER DEFAULT 0,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
diff --git a/mysql-test/suite/parts/t/partition_alter_myisam.test b/mysql-test/suite/parts/t/partition_alter_myisam.test
index a53fa333abd..b2bd0e72e4c 100644
--- a/mysql-test/suite/parts/t/partition_alter_myisam.test
+++ b/mysql-test/suite/parts/t/partition_alter_myisam.test
@@ -1,3 +1,22 @@
--source include/have_partition.inc
--let $engine=MyISAM
--source inc/part_alter_values.inc
+
+#
+# MDEV-14026 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for partitioned MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options
+#
+
+replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
+eval create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
+ partition by key(c1) (
+ partition p01 data directory = '$MYSQL_TMP_DIR'
+ index directory = '$MYSQL_TMP_DIR',
+ partition p02 data directory = '$MYSQL_TMP_DIR'
+ index directory = '$MYSQL_TMP_DIR');
+insert into t1 values (1, 1, repeat('a', 100));
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+alter online table t1 delay_key_write=0;
+alter online table t1 delay_key_write=1;
+drop table t1;
diff --git a/mysql-test/suite/parts/t/partition_debug_myisam-master.opt b/mysql-test/suite/parts/t/partition_debug_myisam-master.opt
index 24264558cf0..eadc9396657 100644
--- a/mysql-test/suite/parts/t/partition_debug_myisam-master.opt
+++ b/mysql-test/suite/parts/t/partition_debug_myisam-master.opt
@@ -1 +1 @@
---skip-stack-trace --skip-core-file --myisam-recover-option=off
+--skip-stack-trace --skip-core-file --myisam-recover-options=off
diff --git a/mysql-test/suite/parts/t/partition_exch_myisam_innodb.test b/mysql-test/suite/parts/t/partition_exch_myisam_innodb.test
index fa956f19aec..c625ad93775 100644
--- a/mysql-test/suite/parts/t/partition_exch_myisam_innodb.test
+++ b/mysql-test/suite/parts/t/partition_exch_myisam_innodb.test
@@ -1,21 +1,17 @@
# Author: Horst Hunger
# Created: 2010-07-05
---source include/have_innodb.inc
---source include/have_partition.inc
+source include/have_innodb.inc;
+source include/have_partition.inc;
let $engine_table= MYISAM;
let $engine_part= InnoDB;
let $engine_subpart= InnoDB;
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
---enable_result_log
---enable_query_log
+source suite/parts/inc/part_exch_tabs.inc;
---error 1497
+error ER_MIX_HANDLER_ERROR;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---source suite/parts/inc/part_exch_drop_tabs.inc
+source suite/parts/inc/part_exch_drop_tabs.inc;
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_10.test b/mysql-test/suite/parts/t/partition_exch_qa_10.test
index 4f569605f5f..a87d658cfb6 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_10.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_10.test
@@ -37,7 +37,7 @@ DROP PROCEDURE test_p1;
SET @save_autocommit= @@autocommit;
SET @@autocommit= OFF;
-SHOW VARIABLES LIKE '%autocommit%';
+SHOW VARIABLES LIKE 'autocommit%';
DELIMITER |;
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE TRIGGER test_trg_1 BEFORE UPDATE ON tp FOR EACH ROW
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_14.test b/mysql-test/suite/parts/t/partition_exch_qa_14.test
index 7c6699a0a72..8d9f201f1db 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_14.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_14.test
@@ -1,94 +1,66 @@
# Author: Horst Hunger
# Created: 2010-07-13
---source include/not_windows.inc
---source include/have_partition.inc
---source include/have_symlink.inc
+source include/not_windows.inc;
+source include/have_partition.inc;
+source include/have_symlink.inc;
let $engine_table= MYISAM;
let $engine_part= MYISAM;
let $engine_subpart= MYISAM;
-
-# DATA DIRECTORY
-# Make directory for partition data
-let $data_dir_path= $MYSQLTEST_VARDIR/mysql-test-data-dir;
---mkdir $data_dir_path
-let $p_data_directory= DATA DIRECTORY = '$data_dir_path';
-let $data_directory= DATA DIRECTORY = '$data_dir_path';
-
-# INDEX DIRECTORY
-# Make directory for partition index
-let $idx_dir_path= $MYSQLTEST_VARDIR/mysql-test-idx-dir;
---mkdir $idx_dir_path
-let $p_index_directory= INDEX DIRECTORY = '$idx_dir_path';
-let $index_directory= INDEX DIRECTORY = '$idx_dir_path';
-
-use test;
-
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
---enable_result_log
---enable_query_log
-
---error ER_TABLES_DIFFERENT_METADATA
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
-
---source suite/parts/inc/part_exch_drop_tabs.inc
---rmdir $data_dir_path
---rmdir $idx_dir_path
-
-# DATA DIRECTORY
-# Make directory for partition data
let $data_dir_path= $MYSQLTEST_VARDIR/mysql-test-data-dir;
---mkdir $data_dir_path
-let $p_data_directory= DATA DIRECTORY = '$data_dir_path';
-
-# INDEX DIRECTORY
-# Make directory for partition index
let $idx_dir_path= $MYSQLTEST_VARDIR/mysql-test-idx-dir;
---mkdir $idx_dir_path
-let $p_index_directory= INDEX DIRECTORY = '$idx_dir_path';
-
-use test;
-
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
---enable_result_log
---enable_query_log
-
---error ER_TABLES_DIFFERENT_METADATA
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
-
---source suite/parts/inc/part_exch_drop_tabs.inc
---rmdir $data_dir_path
---rmdir $idx_dir_path
-
-# DATA DIRECTORY
-# Make directory for partition data
-let $data_dir_path= $MYSQLTEST_VARDIR/mysql-test-data-dir;
---mkdir $data_dir_path
-let $data_directory= DATA DIRECTORY = '$data_dir_path';
-
-# INDEX DIRECTORY
-# Make directory for partition index
-let $idx_dir_path= $MYSQLTEST_VARDIR/mysql-test-idx-dir;
---mkdir $idx_dir_path
-let $index_directory= INDEX DIRECTORY = '$idx_dir_path';
-
-use test;
-
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
---enable_result_log
---enable_query_log
-
---error ER_TABLES_DIFFERENT_METADATA
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
-
---source suite/parts/inc/part_exch_drop_tabs.inc
---rmdir $data_dir_path
---rmdir $idx_dir_path
-
+mkdir $data_dir_path;
+mkdir $idx_dir_path;
+
+echo # === Data/Index directories are identical;
+ let $p_data_directory= DATA DIRECTORY = '$data_dir_path';
+ let $data_directory= DATA DIRECTORY = '$data_dir_path';
+ let $p_index_directory= INDEX DIRECTORY = '$idx_dir_path';
+ let $index_directory= INDEX DIRECTORY = '$idx_dir_path';
+ source suite/parts/inc/part_exch_tabs.inc;
+ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
+ source suite/parts/inc/part_exch_drop_tabs.inc;
+
+echo # === partition has directories, the table does not;
+ let $p_data_directory= DATA DIRECTORY = '$data_dir_path';
+ let $data_directory= ;
+ let $p_index_directory= INDEX DIRECTORY = '$idx_dir_path';
+ let $index_directory= ;
+ source suite/parts/inc/part_exch_tabs.inc;
+ error ER_TABLES_DIFFERENT_METADATA;
+ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
+ source suite/parts/inc/part_exch_drop_tabs.inc;
+
+echo # === the table has directories, partition does not;
+ let $p_data_directory= ;
+ let $data_directory= DATA DIRECTORY = '$data_dir_path';
+ let $p_index_directory= ;
+ let $index_directory= INDEX DIRECTORY = '$idx_dir_path';
+ source suite/parts/inc/part_exch_tabs.inc;
+ error ER_TABLES_DIFFERENT_METADATA;
+ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
+ source suite/parts/inc/part_exch_drop_tabs.inc;
+
+echo # === data directory differs;
+ let $p_data_directory= DATA DIRECTORY = '$data_dir_path';
+ let $data_directory= DATA DIRECTORY = '$idx_dir_path';
+ let $p_index_directory= INDEX DIRECTORY = '$idx_dir_path';
+ let $index_directory= INDEX DIRECTORY = '$idx_dir_path';
+ source suite/parts/inc/part_exch_tabs.inc;
+ error ER_TABLES_DIFFERENT_METADATA;
+ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
+ source suite/parts/inc/part_exch_drop_tabs.inc;
+
+echo # === index directory differs;
+ let $p_data_directory= DATA DIRECTORY = '$data_dir_path';
+ let $data_directory= DATA DIRECTORY = '$data_dir_path';
+ let $p_index_directory= DATA DIRECTORY = '$data_dir_path';
+ let $index_directory= DATA DIRECTORY = '$idx_dir_path';
+ source suite/parts/inc/part_exch_tabs.inc;
+ error ER_TABLES_DIFFERENT_METADATA;
+ ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
+ source suite/parts/inc/part_exch_drop_tabs.inc;
+
+rmdir $idx_dir_path;
+rmdir $data_dir_path;
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_15.test b/mysql-test/suite/parts/t/partition_exch_qa_15.test
index 51d09be5ed9..8ea641c8178 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_15.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_15.test
@@ -1,8 +1,8 @@
# Author: Horst Hunger
# Created: 2010-07-15
---source include/have_innodb.inc
---source include/have_partition.inc
+source include/have_innodb.inc;
+source include/have_partition.inc;
let $engine_table= InnoDB;
let $engine_part= InnoDB;
@@ -10,11 +10,7 @@ let $engine_subpart= InnoDB;
use test;
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
---enable_result_log
---enable_query_log
+source suite/parts/inc/part_exch_tabs.inc;
# 21) Foreign Key.
# Exchange of partition with table differing in structure.
@@ -22,10 +18,8 @@ CREATE TABLE t_11 (a INT, b VARCHAR(55),
FOREIGN KEY (a) REFERENCES t_10 (a) ON DELETE CASCADE)
ENGINE= InnoDB;
#--error ER_TABLES_DIFFERENT_METADATA
---error ER_PARTITION_EXCHANGE_FOREIGN_KEY
+error ER_PARTITION_EXCHANGE_FOREIGN_KEY;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
---disable_warnings
-DROP TABLE IF EXISTS t_11;
---enable_warnings
---source suite/parts/inc/part_exch_drop_tabs.inc
+DROP TABLE t_11;
+source suite/parts/inc/part_exch_drop_tabs.inc;
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_2.test b/mysql-test/suite/parts/t/partition_exch_qa_2.test
index 83dc0a81fca..1858131ce10 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_2.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_2.test
@@ -1,7 +1,7 @@
# Author: Horst Hunger
# Created: 2010-07-05
---source include/have_partition.inc
+source include/have_partition.inc;
let $engine_table= MYISAM;
let $engine_part= MYISAM;
@@ -9,72 +9,61 @@ let $engine_subpart= MYISAM;
use test;
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
---enable_result_log
---enable_query_log
+source suite/parts/inc/part_exch_tabs.inc;
---sorted_result
+sorted_result;
SELECT * FROM t_10;
---sorted_result
+sorted_result;
SELECT * FROM t_100;
---sorted_result
+sorted_result;
SELECT * FROM t_1000;
---sorted_result
+sorted_result;
SELECT * FROM tp;
---sorted_result
+sorted_result;
SELECT * FROM tsp;
---sorted_result
+sorted_result;
SELECT * FROM tsp_00;
---sorted_result
+sorted_result;
SELECT * FROM tsp_01;
---sorted_result
+sorted_result;
SELECT * FROM tsp_02;
---sorted_result
+sorted_result;
SELECT * FROM tsp_03;
---sorted_result
+sorted_result;
SELECT * FROM tsp_04;
# 3) Invalid exchanges.
# Exchange of partition with table differing in structure.
CREATE TABLE t_11(a INT,b VARCHAR(55)) SELECT * FROM t_10;
---error ER_TABLES_DIFFERENT_METADATA
+error ER_TABLES_DIFFERENT_METADATA;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
---disable_warnings
-DROP TABLE IF EXISTS t_11;
---enable_warnings
+DROP TABLE t_11;
eval CREATE TABLE t_11(a INT,b CHAR(55),PRIMARY KEY(a)) ENGINE= $engine_table SELECT * FROM t_10;
---error ER_TABLES_DIFFERENT_METADATA
+error ER_TABLES_DIFFERENT_METADATA;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
---disable_warnings
-DROP TABLE IF EXISTS t_11;
+DROP TABLE t_11;
CREATE TABLE t_11(a INT,b VARCHAR(55),PRIMARY KEY(a)) ENGINE= MEMORY SELECT * FROM t_10;
---error ER_MIX_HANDLER_ERROR
+error ER_MIX_HANDLER_ERROR;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
---disable_warnings
-DROP TABLE IF EXISTS t_11;
---enable_warnings
+DROP TABLE t_11;
# Exchange of partition with partitioned table.
eval CREATE TABLE t_11(a INT,b CHAR(55),PRIMARY KEY(a)) ENGINE= $engine_table
PARTITION BY KEY() AS SELECT * FROM t_10;
---error ER_PARTITION_EXCHANGE_PART_TABLE
+error ER_PARTITION_EXCHANGE_PART_TABLE;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
---disable_warnings
-DROP TABLE IF EXISTS t_11;
---enable_warnings
+DROP TABLE t_11;
# Exchange of subpartition with partitioned table.
---error ER_PARTITION_EXCHANGE_PART_TABLE
+error ER_PARTITION_EXCHANGE_PART_TABLE;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE tsp;
# Exchange of subpartitioned partition with table.
---error ER_PARTITION_INSTEAD_OF_SUBPARTITION
+error ER_PARTITION_INSTEAD_OF_SUBPARTITION;
ALTER TABLE tsp EXCHANGE PARTITION p0 WITH TABLE t_10;
# Exchange of values in partition not fitting the hash.
---error ER_ROW_DOES_NOT_MATCH_PARTITION
+error ER_ROW_DOES_NOT_MATCH_PARTITION;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_100;
# Exchange of values in subpartition not fitting the hash.
---error ER_ROW_DOES_NOT_MATCH_PARTITION
+error ER_ROW_DOES_NOT_MATCH_PARTITION;
ALTER TABLE tp EXCHANGE PARTITION p2 WITH TABLE t_10;
---source suite/parts/inc/part_exch_drop_tabs.inc
+source suite/parts/inc/part_exch_drop_tabs.inc;
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_3.test b/mysql-test/suite/parts/t/partition_exch_qa_3.test
index aa79e97adb6..fc49eb1da90 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_3.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_3.test
@@ -1,8 +1,8 @@
# Author: Horst Hunger
# Created: 2010-07-05
---source include/have_partition.inc
---source include/have_innodb.inc
+source include/have_partition.inc;
+source include/have_innodb.inc;
let $engine_table= MYISAM;
let $engine_part= InnoDB;
@@ -10,38 +10,34 @@ let $engine_subpart= InnoDB;
use test;
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
+source suite/parts/inc/part_exch_tabs.inc;
---sorted_result
+sorted_result;
SELECT * FROM t_10;
---sorted_result
+sorted_result;
SELECT * FROM t_100;
---sorted_result
+sorted_result;
SELECT * FROM t_1000;
---sorted_result
+sorted_result;
SELECT * FROM tp;
---sorted_result
+sorted_result;
SELECT * FROM tsp;
---sorted_result
+sorted_result;
SELECT * FROM tsp_00;
---sorted_result
+sorted_result;
SELECT * FROM tsp_01;
---sorted_result
+sorted_result;
SELECT * FROM tsp_02;
---sorted_result
+sorted_result;
SELECT * FROM tsp_03;
---sorted_result
+sorted_result;
SELECT * FROM tsp_04;
---enable_result_log
---enable_query_log
# 5) Exchanges with different engines.
---error ER_MIX_HANDLER_ERROR
+error ER_MIX_HANDLER_ERROR;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---error ER_MIX_HANDLER_ERROR
+error ER_MIX_HANDLER_ERROR;
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
---source suite/parts/inc/part_exch_drop_tabs.inc
+source suite/parts/inc/part_exch_drop_tabs.inc;
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_6.test b/mysql-test/suite/parts/t/partition_exch_qa_6.test
index bad1e134af7..7b6b42480b0 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_6.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_6.test
@@ -1,8 +1,8 @@
# Author: Horst Hunger
# Created: 2010-07-06
---source include/not_embedded.inc
---source include/have_partition.inc
+source include/not_embedded.inc;
+source include/have_partition.inc;
let $engine_table= MYISAM;
let $engine_part= MYISAM;
@@ -10,93 +10,75 @@ let $engine_subpart= MYISAM;
CREATE USER test2@localhost;
---disable_result_log
---disable_query_log
---source suite/parts/inc/part_exch_tabs.inc
---enable_result_log
---enable_query_log
+source suite/parts/inc/part_exch_tabs.inc;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-USE test;
SHOW GRANTS FOR CURRENT_USER;
# 9) Exchanges with different owner.
# Privilege for ALTER and SELECT
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---sorted_result
+sorted_result;
SELECT * FROM t_10;
---sorted_result
+sorted_result;
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
# Back to former values.
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---sorted_result
+sorted_result;
SELECT * FROM t_10;
---sorted_result
+sorted_result;
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
---sorted_result
+sorted_result;
SELECT * FROM tsp_00;
---sorted_result
+sorted_result;
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
# Back to former values.
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
---sorted_result
+sorted_result;
SELECT * FROM tsp_00;
---sorted_result
+sorted_result;
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
REVOKE INSERT ON test.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
# Privilege for ALTER and SELECT
---error ER_TABLEACCESS_DENIED_ERROR
+error ER_TABLEACCESS_DENIED_ERROR;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
GRANT INSERT ON test.* TO test2@localhost;
REVOKE CREATE ON test.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
---error ER_TABLEACCESS_DENIED_ERROR
+error ER_TABLEACCESS_DENIED_ERROR;
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
GRANT CREATE ON test.* TO test2@localhost;
REVOKE DROP ON test.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-USE test;
SHOW GRANTS FOR CURRENT_USER;
# Privilege for ALTER and SELECT
---error ER_TABLEACCESS_DENIED_ERROR
+error ER_TABLEACCESS_DENIED_ERROR;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
---source suite/parts/inc/part_exch_drop_tabs.inc
+source suite/parts/inc/part_exch_drop_tabs.inc;
DROP USER test2@localhost;
diff --git a/mysql-test/suite/parts/t/partition_recover_myisam-master.opt b/mysql-test/suite/parts/t/partition_recover_myisam-master.opt
index 787371a854a..ddbd7a0a8c5 100644
--- a/mysql-test/suite/parts/t/partition_recover_myisam-master.opt
+++ b/mysql-test/suite/parts/t/partition_recover_myisam-master.opt
@@ -1 +1 @@
---myisam-recover
+--myisam-recover-options
diff --git a/mysql-test/suite/parts/t/partition_repair_myisam-master.opt b/mysql-test/suite/parts/t/partition_repair_myisam-master.opt
index 44fc50f599c..c5f16ccfd5b 100644
--- a/mysql-test/suite/parts/t/partition_repair_myisam-master.opt
+++ b/mysql-test/suite/parts/t/partition_repair_myisam-master.opt
@@ -1 +1 @@
---myisam-recover=off
+--myisam-recover-options=off
diff --git a/mysql-test/suite/percona/innodb_sys_index.result b/mysql-test/suite/percona/innodb_sys_index.result
index 7573720f5ee..2bf2d576086 100644
--- a/mysql-test/suite/percona/innodb_sys_index.result
+++ b/mysql-test/suite/percona/innodb_sys_index.result
@@ -1,6 +1,3 @@
-drop table if exists t1;
-Warnings:
-Note 1051 Unknown table 'test.t1'
SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ;
SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
diff --git a/mysql-test/suite/percona/innodb_sys_index.test b/mysql-test/suite/percona/innodb_sys_index.test
index d8c22e7f5f9..8e242bda98e 100644
--- a/mysql-test/suite/percona/innodb_sys_index.test
+++ b/mysql-test/suite/percona/innodb_sys_index.test
@@ -1,7 +1,6 @@
--source include/big_test.inc
--source include/have_xtradb.inc
-drop table if exists t1;
#
# test for bug LP#875797 "Using 'innodb_sys_indexes' causes core dump"
#
diff --git a/mysql-test/suite/perfschema/include/connection_setup.inc b/mysql-test/suite/perfschema/include/connection_setup.inc
index a661d43d063..93b8e959ee3 100644
--- a/mysql-test/suite/perfschema/include/connection_setup.inc
+++ b/mysql-test/suite/perfschema/include/connection_setup.inc
@@ -53,10 +53,15 @@
--disable_query_log
+create user user1@localhost;
grant ALL on *.* to user1@localhost;
+create user user2@localhost;
grant ALL on *.* to user2@localhost;
+create user user3@localhost;
grant ALL on *.* to user3@localhost;
+create user user4@localhost;
grant ALL on *.* to user4@localhost;
+create user user5@localhost;
grant ALL on *.* to user5@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
index ec35e60d463..7dfefd25235 100644
--- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
+++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
@@ -66,10 +66,13 @@
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
-
+create user user1@localhost;
grant ALL on *.* to user1@localhost;
+create user user2@localhost;
grant ALL on *.* to user2@localhost;
+create user user3@localhost;
grant ALL on *.* to user3@localhost;
+create user user4@localhost;
grant ALL on *.* to user4@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc
index 639b1df8c02..85ade046939 100644
--- a/mysql-test/suite/perfschema/include/stage_setup.inc
+++ b/mysql-test/suite/perfschema/include/stage_setup.inc
@@ -28,9 +28,13 @@
--disable_query_log
+create user user1@localhost;
grant ALL on *.* to user1@localhost;
+create user user2@localhost;
grant ALL on *.* to user2@localhost;
+create user user3@localhost;
grant ALL on *.* to user3@localhost;
+create user user4@localhost;
grant ALL on *.* to user4@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
index 522cdb9346d..79aa5482838 100644
--- a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
+++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
@@ -71,9 +71,13 @@
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
+create user user1@localhost;
grant ALL on *.* to user1@localhost;
+create user user2@localhost;
grant ALL on *.* to user2@localhost;
+create user user3@localhost;
grant ALL on *.* to user3@localhost;
+create user user4@localhost;
grant ALL on *.* to user4@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/include/table_io_result_helper.inc b/mysql-test/suite/perfschema/include/table_io_result_helper.inc
index 789f7135a1a..4732806488e 100644
--- a/mysql-test/suite/perfschema/include/table_io_result_helper.inc
+++ b/mysql-test/suite/perfschema/include/table_io_result_helper.inc
@@ -14,7 +14,8 @@ eval select event_name,
order by thread_id, event_id;
# In case of failures, this will tell if table io are lost.
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+ Variable_name not like 'performance_schema_%_classes_lost';
# Cleanup
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
index 52d4cfd1e63..79a81311b05 100644
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -3,16 +3,14 @@
#
--source include/count_sessions.inc
---error 1
---exec $MYSQL_UPGRADE --skip-verbose --force > $out_file 2> $err_file
+--exec $MYSQL_UPGRADE --skip-verbose --force > $MYSQLTEST_VARDIR/tmp/out_file 2> $MYSQLTEST_VARDIR/tmp/err_file
--source include/wait_until_count_sessions.inc
-# Verify that mysql_upgrade complained about the performance_schema
+# Verify that mysql_upgrade does not complain about the performance_schema
--replace_regex /at line [0-9]+/at line ###/
---cat_file $err_file
---error 0,1
---remove_file $out_file
---error 0,1
---remove_file $err_file
+--cat_file $MYSQLTEST_VARDIR/tmp/err_file
+--remove_file $MYSQLTEST_VARDIR/tmp/out_file
+--remove_file $MYSQLTEST_VARDIR/tmp/err_file
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
diff --git a/mysql-test/suite/perfschema/r/bad_option_2.result b/mysql-test/suite/perfschema/r/bad_option_2.result
index d8fda2af3b6..b8fd2ff9a3c 100644
--- a/mysql-test/suite/perfschema/r/bad_option_2.result
+++ b/mysql-test/suite/perfschema/r/bad_option_2.result
@@ -1 +1 @@
-Found: ambiguous option '--performance-schema-max_=12'
+FOUND /ambiguous option '--performance-schema-max_=12'/ in bad_option_2.txt
diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result
index e4ad9200272..ea901484d7e 100644
--- a/mysql-test/suite/perfschema/r/column_privilege.result
+++ b/mysql-test/suite/perfschema/r/column_privilege.result
@@ -2,6 +2,7 @@ show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+create user 'pfs_user_5'@localhost;
grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION;
grant SELECT(thread_id, event_id) on performance_schema.events_waits_current
to 'pfs_user_5'@localhost;
diff --git a/mysql-test/suite/perfschema/r/csv_table_io.result b/mysql-test/suite/perfschema/r/csv_table_io.result
index f0b5a6bb935..84b39119dd8 100644
--- a/mysql-test/suite/perfschema/r/csv_table_io.result
+++ b/mysql-test/suite/perfschema/r/csv_table_io.result
@@ -111,29 +111,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result
index 70e4213ffcc..f52b78c9f7d 100644
--- a/mysql-test/suite/perfschema/r/digest_table_full.result
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result
@@ -109,11 +109,11 @@ DROP TRIGGER trg;
####################################
# QUERYING PS STATEMENT DIGEST
####################################
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
-SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
-NULL NULL NULL 55 32 1 2
-statements_digest 52e3729216b72a67a671ac3b93a1f1d3 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
+SCHEMA_NAME DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
+NULL NULL 55 32 1 2
+statements_digest TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
SHOW VARIABLES LIKE "performance_schema_digests_size";
Variable_name Value
performance_schema_digests_size 2
diff --git a/mysql-test/suite/perfschema/r/discovery.result b/mysql-test/suite/perfschema/r/discovery.result
new file mode 100644
index 00000000000..2f939cae154
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/discovery.result
@@ -0,0 +1,12 @@
+#
+# MDEV-7922 - ERROR 1939 (HY000): Engine PERFORMANCE_SCHEMA failed to
+# discover table
+#
+FLUSH TABLES;
+CREATE DATABASE test_drop;
+USE test_drop;
+DROP DATABASE test_drop;
+SELECT TABLE_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='performance_schema';
+SELECT @@warning_count;
+@@warning_count
+0
diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
index b264a075eba..ce1cdf1884e 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
@@ -11,9 +11,9 @@ wait/synch/mutex/sql/gtid_waiting::LOCK_gtid_waiting YES YES
wait/synch/mutex/sql/hash_filo::lock YES YES
wait/synch/mutex/sql/HA_DATA_PARTITION::LOCK_auto_inc YES YES
wait/synch/mutex/sql/LOCK_active_mi YES YES
+wait/synch/mutex/sql/LOCK_after_binlog_sync YES YES
wait/synch/mutex/sql/LOCK_audit_mask YES YES
wait/synch/mutex/sql/LOCK_binlog_state YES YES
-wait/synch/mutex/sql/LOCK_commit_ordered YES YES
select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Rwlock/sql/%'
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
@@ -24,11 +24,11 @@ wait/synch/rwlock/sql/LOCK_grant YES YES
wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES
wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES
wait/synch/rwlock/sql/LOCK_sys_init_slave YES YES
-wait/synch/rwlock/sql/LOCK_tdc YES YES
wait/synch/rwlock/sql/LOGGER::LOCK_logger YES YES
wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for YES YES
wait/synch/rwlock/sql/MDL_lock::rwlock YES YES
wait/synch/rwlock/sql/Query_cache_query::lock YES YES
+wait/synch/rwlock/sql/THR_LOCK_servers YES YES
select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Cond/sql/%'
and name not in (
diff --git a/mysql-test/suite/perfschema/r/dml_setup_objects.result b/mysql-test/suite/perfschema/r/dml_setup_objects.result
index 075114a9b5a..603c9ba6cc9 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_objects.result
@@ -17,7 +17,7 @@ OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
insert into performance_schema.setup_objects
set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
enabled='YES', timed='YES';
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
insert into performance_schema.setup_objects
set object_type='TABLE', object_schema='FOO', object_name='BAR',
enabled='YES', timed='YES';
diff --git a/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-test/suite/perfschema/r/func_mutex.result
index 86967a2a63f..1bd70b16811 100644
--- a/mysql-test/suite/perfschema/r/func_mutex.result
+++ b/mysql-test/suite/perfschema/r/func_mutex.result
@@ -5,9 +5,9 @@ WHERE name LIKE 'wait/synch/mutex/%'
truncate table performance_schema.events_statements_summary_by_digest;
flush status;
select NAME from performance_schema.mutex_instances
-where NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share' GROUP BY NAME;
+where NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex' GROUP BY NAME;
NAME
-wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share
+wait/synch/mutex/mysys/THR_LOCK::mutex
select NAME from performance_schema.rwlock_instances
where NAME = 'wait/synch/rwlock/sql/LOCK_grant';
NAME
@@ -24,7 +24,7 @@ id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
-WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT * FROM t1;
id b
1 initial value
@@ -37,12 +37,12 @@ id b
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
-WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed;
test_fm1_timed
Success
UPDATE performance_schema.setup_instruments SET enabled = 'NO'
-WHERE NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share';
+WHERE NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex';
TRUNCATE TABLE performance_schema.events_waits_history_long;
TRUNCATE TABLE performance_schema.events_waits_history;
TRUNCATE TABLE performance_schema.events_waits_current;
@@ -51,7 +51,7 @@ id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
-WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT * FROM t1;
id b
1 initial value
@@ -64,7 +64,7 @@ id b
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
-WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed;
test_fm2_timed
Success
diff --git a/mysql-test/suite/perfschema/r/global_read_lock.result b/mysql-test/suite/perfschema/r/global_read_lock.result
index f7ff4382261..dab22c79100 100644
--- a/mysql-test/suite/perfschema/r/global_read_lock.result
+++ b/mysql-test/suite/perfschema/r/global_read_lock.result
@@ -1,5 +1,6 @@
use performance_schema;
update performance_schema.setup_instruments set enabled='YES';
+create user pfsuser@localhost;
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
connect (con1, localhost, pfsuser, , test);
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
index ffe3dc2e0eb..d146f5324d0 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
index 7c658e17c55..6c1bce7c9a0 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
index 5657887e439..d04a565508f 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
index 115af4792c3..ea5e91307c8 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
@@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
index 6f5affadd2f..4eae65c4618 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
@@ -24,6 +24,7 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
select @@global.max_connect_errors into @saved_max_connect_errors;
set global max_connect_errors = 3;
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
create user 'quota'@'santa.claus.ipv4.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
index 6531f7e69f0..1c893320340 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
@@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
index 315f90ce3e5..68855bbc0ce 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
index 59a12495352..36d7692f824 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
index 904139875c6..37470bdc0bb 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
index f5b2f43ab91..410f116f4d0 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
index 9cc8a675fcc..6ccb3b66f22 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
@@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
index 5d1846f3354..a0c2d8bdfa6 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
@@ -24,6 +24,7 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
select @@global.max_connect_errors into @saved_max_connect_errors;
set global max_connect_errors = 3;
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
create user 'quota'@'santa.claus.ipv6.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
index a2107324c65..a2b9a32c764 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
@@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
index 809644cbe08..99b47be724f 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
@@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
select "Con1 is alive";
Con1 is alive
diff --git a/mysql-test/suite/perfschema/r/innodb_table_io.result b/mysql-test/suite/perfschema/r/innodb_table_io.result
index 460518aeb65..c37c1035e5a 100644
--- a/mysql-test/suite/perfschema/r/innodb_table_io.result
+++ b/mysql-test/suite/perfschema/r/innodb_table_io.result
@@ -112,29 +112,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/memory_table_io.result b/mysql-test/suite/perfschema/r/memory_table_io.result
index 230de713846..7942015f618 100644
--- a/mysql-test/suite/perfschema/r/memory_table_io.result
+++ b/mysql-test/suite/perfschema/r/memory_table_io.result
@@ -113,29 +113,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/merge_table_io.result b/mysql-test/suite/perfschema/r/merge_table_io.result
index 7f0b602778c..d390ba67b5f 100644
--- a/mysql-test/suite/perfschema/r/merge_table_io.result
+++ b/mysql-test/suite/perfschema/r/merge_table_io.result
@@ -143,29 +143,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result
index 2adf2cba851..7a097a27576 100644
--- a/mysql-test/suite/perfschema/r/misc.result
+++ b/mysql-test/suite/perfschema/r/misc.result
@@ -118,3 +118,19 @@ B
select count(*) from events_statements_history where sql_text like "%...";
count(*)
2
+use test;
+create table t1 (id int);
+insert into t1 values (1), (2), (3);
+truncate performance_schema.events_statements_history;
+select * from t1;
+id
+1
+2
+3
+insert into t1 select RAND()*10000 from t1;
+select sql_text, rows_examined from performance_schema.events_statements_history;
+sql_text rows_examined
+truncate performance_schema.events_statements_history 0
+select * from t1 3
+insert into t1 select RAND()*10000 from t1 6
+drop table t1;
diff --git a/mysql-test/suite/perfschema/r/multi_table_io.result b/mysql-test/suite/perfschema/r/multi_table_io.result
index 74c8b94c1d5..929e1791c61 100644
--- a/mysql-test/suite/perfschema/r/multi_table_io.result
+++ b/mysql-test/suite/perfschema/r/multi_table_io.result
@@ -72,29 +72,22 @@ wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test t1 delete NULL
wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test1 t2 delete NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/myisam_table_io.result b/mysql-test/suite/perfschema/r/myisam_table_io.result
index 432e5964802..97a099581d4 100644
--- a/mysql-test/suite/perfschema/r/myisam_table_io.result
+++ b/mysql-test/suite/perfschema/r/myisam_table_io.result
@@ -111,29 +111,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/nesting.result b/mysql-test/suite/perfschema/r/nesting.result
index f1f872f95f9..e17b3009758 100644
--- a/mysql-test/suite/perfschema/r/nesting.result
+++ b/mysql-test/suite/perfschema/r/nesting.result
@@ -107,7 +107,7 @@ and (end_event_id <= @marker_end)
) all_events
order by relative_event_id asc;
relative_event_id relative_end_event_id event_name comment nesting_event_type relative_nesting_event_id
-0 19 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL
+0 18 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL
1 4 stage/sql/init (stage) STATEMENT 0
2 2 wait/io/socket/sql/client_connection recv STAGE 1
3 3 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1
@@ -124,125 +124,120 @@ relative_event_id relative_end_event_id event_name comment nesting_event_type re
14 14 stage/sql/freeing items (stage) STATEMENT 0
15 15 wait/io/socket/sql/client_connection send STATEMENT 0
16 16 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 0
-17 17 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 0
-18 19 stage/sql/cleaning up (stage) STATEMENT 0
-19 19 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 18
-20 20 idle idle NULL NULL
-21 40 statement/sql/select select "This is simple statement one" as payload NULL NULL
-22 25 stage/sql/init (stage) STATEMENT 21
-23 23 wait/io/socket/sql/client_connection recv STAGE 22
-24 24 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 22
-25 25 wait/io/file/sql/query_log write STAGE 22
-26 26 stage/sql/checking permissions (stage) STATEMENT 21
-27 27 stage/sql/Opening tables (stage) STATEMENT 21
-28 28 stage/sql/After opening tables (stage) STATEMENT 21
-29 29 stage/sql/init (stage) STATEMENT 21
-30 30 stage/sql/optimizing (stage) STATEMENT 21
-31 31 stage/sql/executing (stage) STATEMENT 21
-32 32 stage/sql/end (stage) STATEMENT 21
-33 33 stage/sql/query end (stage) STATEMENT 21
-34 34 stage/sql/closing tables (stage) STATEMENT 21
-35 35 stage/sql/freeing items (stage) STATEMENT 21
-36 36 wait/io/socket/sql/client_connection send STATEMENT 21
-37 37 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 21
-38 38 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 21
-39 40 stage/sql/cleaning up (stage) STATEMENT 21
-40 40 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 39
-41 41 idle idle NULL NULL
-42 61 statement/sql/select select "This is simple statement two" as payload NULL NULL
-43 46 stage/sql/init (stage) STATEMENT 42
-44 44 wait/io/socket/sql/client_connection recv STAGE 43
-45 45 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 43
-46 46 wait/io/file/sql/query_log write STAGE 43
-47 47 stage/sql/checking permissions (stage) STATEMENT 42
-48 48 stage/sql/Opening tables (stage) STATEMENT 42
-49 49 stage/sql/After opening tables (stage) STATEMENT 42
-50 50 stage/sql/init (stage) STATEMENT 42
-51 51 stage/sql/optimizing (stage) STATEMENT 42
-52 52 stage/sql/executing (stage) STATEMENT 42
-53 53 stage/sql/end (stage) STATEMENT 42
-54 54 stage/sql/query end (stage) STATEMENT 42
-55 55 stage/sql/closing tables (stage) STATEMENT 42
-56 56 stage/sql/freeing items (stage) STATEMENT 42
-57 57 wait/io/socket/sql/client_connection send STATEMENT 42
-58 58 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 42
-59 59 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 42
-60 61 stage/sql/cleaning up (stage) STATEMENT 42
-61 61 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 60
-62 62 idle idle NULL NULL
-63 80 statement/sql/select select "This is the first part of a multi query" as payload;
+17 18 stage/sql/cleaning up (stage) STATEMENT 0
+18 18 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 17
+19 19 idle idle NULL NULL
+20 38 statement/sql/select select "This is simple statement one" as payload NULL NULL
+21 24 stage/sql/init (stage) STATEMENT 20
+22 22 wait/io/socket/sql/client_connection recv STAGE 21
+23 23 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 21
+24 24 wait/io/file/sql/query_log write STAGE 21
+25 25 stage/sql/checking permissions (stage) STATEMENT 20
+26 26 stage/sql/Opening tables (stage) STATEMENT 20
+27 27 stage/sql/After opening tables (stage) STATEMENT 20
+28 28 stage/sql/init (stage) STATEMENT 20
+29 29 stage/sql/optimizing (stage) STATEMENT 20
+30 30 stage/sql/executing (stage) STATEMENT 20
+31 31 stage/sql/end (stage) STATEMENT 20
+32 32 stage/sql/query end (stage) STATEMENT 20
+33 33 stage/sql/closing tables (stage) STATEMENT 20
+34 34 stage/sql/freeing items (stage) STATEMENT 20
+35 35 wait/io/socket/sql/client_connection send STATEMENT 20
+36 36 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 20
+37 38 stage/sql/cleaning up (stage) STATEMENT 20
+38 38 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 37
+39 39 idle idle NULL NULL
+40 58 statement/sql/select select "This is simple statement two" as payload NULL NULL
+41 44 stage/sql/init (stage) STATEMENT 40
+42 42 wait/io/socket/sql/client_connection recv STAGE 41
+43 43 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 41
+44 44 wait/io/file/sql/query_log write STAGE 41
+45 45 stage/sql/checking permissions (stage) STATEMENT 40
+46 46 stage/sql/Opening tables (stage) STATEMENT 40
+47 47 stage/sql/After opening tables (stage) STATEMENT 40
+48 48 stage/sql/init (stage) STATEMENT 40
+49 49 stage/sql/optimizing (stage) STATEMENT 40
+50 50 stage/sql/executing (stage) STATEMENT 40
+51 51 stage/sql/end (stage) STATEMENT 40
+52 52 stage/sql/query end (stage) STATEMENT 40
+53 53 stage/sql/closing tables (stage) STATEMENT 40
+54 54 stage/sql/freeing items (stage) STATEMENT 40
+55 55 wait/io/socket/sql/client_connection send STATEMENT 40
+56 56 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 40
+57 58 stage/sql/cleaning up (stage) STATEMENT 40
+58 58 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 57
+59 59 idle idle NULL NULL
+60 77 statement/sql/select select "This is the first part of a multi query" as payload;
select "And this is the second part of a multi query" as payload;
select "With a third part to make things complete" as payload NULL NULL
-64 67 stage/sql/init (stage) STATEMENT 63
-65 65 wait/io/socket/sql/client_connection recv STAGE 64
-66 66 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 64
-67 67 wait/io/file/sql/query_log write STAGE 64
-68 68 stage/sql/checking permissions (stage) STATEMENT 63
-69 69 stage/sql/Opening tables (stage) STATEMENT 63
-70 70 stage/sql/After opening tables (stage) STATEMENT 63
-71 71 stage/sql/init (stage) STATEMENT 63
-72 72 stage/sql/optimizing (stage) STATEMENT 63
-73 73 stage/sql/executing (stage) STATEMENT 63
-74 74 stage/sql/end (stage) STATEMENT 63
-75 75 stage/sql/query end (stage) STATEMENT 63
-76 76 stage/sql/closing tables (stage) STATEMENT 63
-77 80 stage/sql/freeing items (stage) STATEMENT 63
-78 78 wait/io/socket/sql/client_connection send STAGE 77
-79 79 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 77
-80 80 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 77
-81 96 statement/sql/select select "And this is the second part of a multi query" as payload;
+61 65 stage/sql/init (stage) STATEMENT 60
+62 62 wait/io/socket/sql/client_connection recv STAGE 61
+63 63 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 61
+64 64 wait/io/file/sql/query_log write STAGE 61
+65 65 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 61
+66 66 stage/sql/checking permissions (stage) STATEMENT 60
+67 67 stage/sql/Opening tables (stage) STATEMENT 60
+68 68 stage/sql/After opening tables (stage) STATEMENT 60
+69 69 stage/sql/init (stage) STATEMENT 60
+70 70 stage/sql/optimizing (stage) STATEMENT 60
+71 71 stage/sql/executing (stage) STATEMENT 60
+72 72 stage/sql/end (stage) STATEMENT 60
+73 73 stage/sql/query end (stage) STATEMENT 60
+74 74 stage/sql/closing tables (stage) STATEMENT 60
+75 77 stage/sql/freeing items (stage) STATEMENT 60
+76 76 wait/io/socket/sql/client_connection send STAGE 75
+77 77 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 75
+78 93 statement/sql/select select "And this is the second part of a multi query" as payload;
select "With a third part to make things complete" as payload NULL NULL
-82 83 stage/sql/init (stage) STATEMENT 81
-83 83 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 82
-84 84 stage/sql/checking permissions (stage) STATEMENT 81
-85 85 stage/sql/Opening tables (stage) STATEMENT 81
-86 86 stage/sql/After opening tables (stage) STATEMENT 81
-87 87 stage/sql/init (stage) STATEMENT 81
-88 88 stage/sql/optimizing (stage) STATEMENT 81
-89 89 stage/sql/executing (stage) STATEMENT 81
-90 90 stage/sql/end (stage) STATEMENT 81
-91 91 stage/sql/query end (stage) STATEMENT 81
-92 92 stage/sql/closing tables (stage) STATEMENT 81
-93 96 stage/sql/freeing items (stage) STATEMENT 81
-94 94 wait/io/socket/sql/client_connection send STAGE 93
-95 95 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 93
-96 96 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 93
-97 114 statement/sql/select select "With a third part to make things complete" as payload NULL NULL
-98 99 stage/sql/init (stage) STATEMENT 97
-99 99 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 98
-100 100 stage/sql/checking permissions (stage) STATEMENT 97
-101 101 stage/sql/Opening tables (stage) STATEMENT 97
-102 102 stage/sql/After opening tables (stage) STATEMENT 97
-103 103 stage/sql/init (stage) STATEMENT 97
-104 104 stage/sql/optimizing (stage) STATEMENT 97
-105 105 stage/sql/executing (stage) STATEMENT 97
-106 106 stage/sql/end (stage) STATEMENT 97
-107 107 stage/sql/query end (stage) STATEMENT 97
-108 108 stage/sql/closing tables (stage) STATEMENT 97
-109 109 stage/sql/freeing items (stage) STATEMENT 97
-110 110 wait/io/socket/sql/client_connection send STATEMENT 97
-111 111 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 97
-112 112 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 97
-113 114 stage/sql/cleaning up (stage) STATEMENT 97
-114 114 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 113
-115 115 idle idle NULL NULL
-116 135 statement/sql/select select "MARKER_END" as marker NULL NULL
-117 120 stage/sql/init (stage) STATEMENT 116
-118 118 wait/io/socket/sql/client_connection recv STAGE 117
-119 119 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 117
-120 120 wait/io/file/sql/query_log write STAGE 117
-121 121 stage/sql/checking permissions (stage) STATEMENT 116
-122 122 stage/sql/Opening tables (stage) STATEMENT 116
-123 123 stage/sql/After opening tables (stage) STATEMENT 116
-124 124 stage/sql/init (stage) STATEMENT 116
-125 125 stage/sql/optimizing (stage) STATEMENT 116
-126 126 stage/sql/executing (stage) STATEMENT 116
-127 127 stage/sql/end (stage) STATEMENT 116
-128 128 stage/sql/query end (stage) STATEMENT 116
-129 129 stage/sql/closing tables (stage) STATEMENT 116
-130 130 stage/sql/freeing items (stage) STATEMENT 116
-131 131 wait/io/socket/sql/client_connection send STATEMENT 116
-132 132 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 116
-133 133 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 116
-134 135 stage/sql/cleaning up (stage) STATEMENT 116
-135 135 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 134
+79 81 stage/sql/init (stage) STATEMENT 78
+80 80 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 79
+81 81 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 79
+82 82 stage/sql/checking permissions (stage) STATEMENT 78
+83 83 stage/sql/Opening tables (stage) STATEMENT 78
+84 84 stage/sql/After opening tables (stage) STATEMENT 78
+85 85 stage/sql/init (stage) STATEMENT 78
+86 86 stage/sql/optimizing (stage) STATEMENT 78
+87 87 stage/sql/executing (stage) STATEMENT 78
+88 88 stage/sql/end (stage) STATEMENT 78
+89 89 stage/sql/query end (stage) STATEMENT 78
+90 90 stage/sql/closing tables (stage) STATEMENT 78
+91 93 stage/sql/freeing items (stage) STATEMENT 78
+92 92 wait/io/socket/sql/client_connection send STAGE 91
+93 93 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 91
+94 110 statement/sql/select select "With a third part to make things complete" as payload NULL NULL
+95 96 stage/sql/init (stage) STATEMENT 94
+96 96 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 95
+97 97 stage/sql/checking permissions (stage) STATEMENT 94
+98 98 stage/sql/Opening tables (stage) STATEMENT 94
+99 99 stage/sql/After opening tables (stage) STATEMENT 94
+100 100 stage/sql/init (stage) STATEMENT 94
+101 101 stage/sql/optimizing (stage) STATEMENT 94
+102 102 stage/sql/executing (stage) STATEMENT 94
+103 103 stage/sql/end (stage) STATEMENT 94
+104 104 stage/sql/query end (stage) STATEMENT 94
+105 105 stage/sql/closing tables (stage) STATEMENT 94
+106 106 stage/sql/freeing items (stage) STATEMENT 94
+107 107 wait/io/socket/sql/client_connection send STATEMENT 94
+108 108 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 94
+109 110 stage/sql/cleaning up (stage) STATEMENT 94
+110 110 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 109
+111 111 idle idle NULL NULL
+112 130 statement/sql/select select "MARKER_END" as marker NULL NULL
+113 116 stage/sql/init (stage) STATEMENT 112
+114 114 wait/io/socket/sql/client_connection recv STAGE 113
+115 115 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 113
+116 116 wait/io/file/sql/query_log write STAGE 113
+117 117 stage/sql/checking permissions (stage) STATEMENT 112
+118 118 stage/sql/Opening tables (stage) STATEMENT 112
+119 119 stage/sql/After opening tables (stage) STATEMENT 112
+120 120 stage/sql/init (stage) STATEMENT 112
+121 121 stage/sql/optimizing (stage) STATEMENT 112
+122 122 stage/sql/executing (stage) STATEMENT 112
+123 123 stage/sql/end (stage) STATEMENT 112
+124 124 stage/sql/query end (stage) STATEMENT 112
+125 125 stage/sql/closing tables (stage) STATEMENT 112
+126 126 stage/sql/freeing items (stage) STATEMENT 112
+127 127 wait/io/socket/sql/client_connection send STATEMENT 112
+128 128 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 112
+129 130 stage/sql/cleaning up (stage) STATEMENT 112
+130 130 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 129
diff --git a/mysql-test/suite/perfschema/r/part_table_io.result b/mysql-test/suite/perfschema/r/part_table_io.result
index 2aa12851679..c71767bc24f 100644
--- a/mysql-test/suite/perfschema/r/part_table_io.result
+++ b/mysql-test/suite/perfschema/r/part_table_io.result
@@ -113,29 +113,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
index cbd684a6232..2bcebe06e96 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
@@ -1,61 +1,7 @@
-drop event if exists test.user_event;
"Testing mysql_upgrade with EVENT performance_schema.user_event"
create event test.user_event on schedule every 1 day do
select "not supposed to be here";
update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
select name from mysql.event where db='performance_schema';
name
user_event
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
index 6978e1ed0a8..b91cb5d14a8 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
@@ -1,61 +1,7 @@
-drop function if exists test.user_func;
"Testing mysql_upgrade with FUNCTION performance_schema.user_func"
create function test.user_func() returns integer
return 0;
update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
user_func
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
index f5a13fb445d..651bc506eee 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
@@ -1,61 +1,7 @@
-drop procedure if exists test.user_proc;
"Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
create procedure test.user_proc()
select "Not supposed to be here";
update mysql.proc set db='performance_schema' where name='user_proc';
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
user_proc
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
index bb5ba7060ae..5ff608a825f 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
@@ -1,63 +1,9 @@
-drop table if exists test.user_table;
"Testing mysql_upgrade with TABLE performance_schema.user_table"
create table test.user_table(a int);
use performance_schema;
show tables like "user_table";
Tables_in_performance_schema (user_table)
user_table
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
show tables like "user_table";
Tables_in_performance_schema (user_table)
user_table
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
index f9541680b6d..14a1d8deae4 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
@@ -1,63 +1,9 @@
-drop view if exists test.user_view;
"Testing mysql_upgrade with VIEW performance_schema.user_view"
create view test.user_view as select "Not supposed to be here";
use performance_schema;
show tables like "user_view";
Tables_in_performance_schema (user_view)
user_view
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
show tables like "user_view";
Tables_in_performance_schema (user_view)
user_view
diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result
index c5942273057..1f806d94991 100644
--- a/mysql-test/suite/perfschema/r/privilege.result
+++ b/mysql-test/suite/perfschema/r/privilege.result
@@ -2,6 +2,9 @@ show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+create user 'pfs_user_1'@localhost;
+create user 'pfs_user_2'@localhost;
+create user 'pfs_user_3'@localhost;
grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION;
grant ALL on performance_schema.* to 'pfs_user_2'@localhost
with GRANT OPTION;
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index f1f0946cb90..8b82518159d 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -12,6 +12,7 @@ optimize table mysql.host;
optimize table mysql.user;
optimize table mysql.db;
optimize table mysql.proxies_priv;
+optimize table mysql.roles_mapping;
optimize table mysql.tables_priv;
optimize table mysql.procs_priv;
optimize table mysql.servers;
@@ -113,29 +114,22 @@ wait/io/table/sql/handler handler.cc: TABLE mysql servers fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result
index 19108326f1b..b2502808821 100644
--- a/mysql-test/suite/perfschema/r/read_only.result
+++ b/mysql-test/suite/perfschema/r/read_only.result
@@ -1,5 +1,6 @@
use performance_schema;
set @start_read_only= @@global.read_only;
+create user pfsuser@localhost;
grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost;
flush privileges;
connect (con1, localhost, pfsuser, , test);
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index beabb968ac8..284b36e722f 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -63,6 +63,7 @@ where event_name like "%MYSQL_BIN_LOG%"
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_background_thread MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_end_pos MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xid_list MANY
"Expect no slave relay log"
@@ -141,6 +142,7 @@ where event_name like "%MYSQL_BIN_LOG%"
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_background_thread MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_end_pos MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xid_list MANY
"Expect a slave relay log"
diff --git a/mysql-test/suite/perfschema/r/rollback_table_io.result b/mysql-test/suite/perfschema/r/rollback_table_io.result
index f08d11e21d8..a9cc5b1da39 100644
--- a/mysql-test/suite/perfschema/r/rollback_table_io.result
+++ b/mysql-test/suite/perfschema/r/rollback_table_io.result
@@ -54,29 +54,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test t1 insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/rpl_gtid_func.result b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
index 962e3e19e47..d5f764013df 100644
--- a/mysql-test/suite/perfschema/r/rpl_gtid_func.result
+++ b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
@@ -33,11 +33,11 @@ TABLE information_schema % NO NO
TABLE master foo YES YES
TABLE mysql % NO NO
TABLE performance_schema % NO NO
-select digest, digest_text, count_star
+select digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
-digest digest_text count_star
-d4c0df8aac0e1b575629aad4534b5c7b SELECT ? AS `in_master_digest` 1
+digest_text count_star
+SELECT ? AS `in_master_digest` 1
insert into test.marker values (2);
**** On Slave ****
select * from test.marker;
@@ -60,11 +60,11 @@ TABLE information_schema % NO NO
TABLE mysql % NO NO
TABLE performance_schema % NO NO
TABLE slave foo YES YES
-select digest, digest_text, count_star
+select digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
-digest digest_text count_star
-aa6b10b84ad0f249ef4fcece8da6dd77 SELECT ? AS `in_slave_digest` 1
+digest_text count_star
+SELECT ? AS `in_slave_digest` 1
**** On Master ****
delete from performance_schema.setup_objects
where object_schema='master';
diff --git a/mysql-test/suite/perfschema/r/rpl_statements.result b/mysql-test/suite/perfschema/r/rpl_statements.result
index 42ced0f5e10..081710f1d54 100644
--- a/mysql-test/suite/perfschema/r/rpl_statements.result
+++ b/mysql-test/suite/perfschema/r/rpl_statements.result
@@ -11,7 +11,7 @@ include/master-slave.inc
*** Create test tables
-show variables like '%binlog_format%';
+show variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
drop table if exists test.marker;
@@ -55,7 +55,7 @@ Expect 1
*** MASTER ***
**************
-show variables like '%binlog_format%';
+show variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
*** Clear statement events
diff --git a/mysql-test/suite/perfschema/r/server_init.result b/mysql-test/suite/perfschema/r/server_init.result
index 20dc1309795..1bdb9884606 100644
--- a/mysql-test/suite/perfschema/r/server_init.result
+++ b/mysql-test/suite/perfschema/r/server_init.result
@@ -120,10 +120,6 @@ where name like "wait/synch/mutex/sql/LOCK_audit_mask";
count(name)
1
select count(name) from mutex_instances
-where name like "wait/synch/mutex/sql/LOCK_xid_cache";
-count(name)
-1
-select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_plugin";
count(name)
1
diff --git a/mysql-test/suite/perfschema/r/setup_actors.result b/mysql-test/suite/perfschema/r/setup_actors.result
index 038fb623ab6..187b558e827 100644
--- a/mysql-test/suite/perfschema/r/setup_actors.result
+++ b/mysql-test/suite/perfschema/r/setup_actors.result
@@ -17,10 +17,15 @@ hostb % %
hosta user1 %
% user2 %
localhost user3 %
+create user user1@localhost;
grant ALL on *.* to user1@localhost;
+create user user2@localhost;
grant ALL on *.* to user2@localhost;
+create user user3@localhost;
grant ALL on *.* to user3@localhost;
+create user user4@localhost;
grant ALL on *.* to user4@localhost;
+create user user5@localhost;
grant select on test.* to user5@localhost;
flush privileges;
# Switch to (con1, localhost, user1, , )
diff --git a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
index e502376b578..b0570d70602 100644
--- a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
+++ b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
@@ -5,14 +5,14 @@ SELECT * FROM performance_schema.setup_instruments
WHERE name IN (
'wait/synch/mutex/sql/LOCK_user_conn',
'wait/synch/mutex/sql/LOCK_uuid_generator',
-'wait/synch/mutex/sql/LOCK_xid_cache',
+'wait/synch/mutex/sql/LOCK_plugin',
'stage/sql/creating table')
AND enabled = 'yes' AND timed = 'no'
ORDER BY name;
NAME ENABLED TIMED
stage/sql/creating table YES NO
+wait/synch/mutex/sql/LOCK_plugin YES NO
wait/synch/mutex/sql/LOCK_user_conn YES NO
-wait/synch/mutex/sql/LOCK_xid_cache YES NO
SELECT * FROM performance_schema.setup_instruments
WHERE name = 'wait/synch/mutex/sql/LOCK_thread_count'
AND enabled = 'no' AND timed = 'no';
diff --git a/mysql-test/suite/perfschema/r/setup_objects.result b/mysql-test/suite/perfschema/r/setup_objects.result
index e623aeb8521..01744df940a 100644
--- a/mysql-test/suite/perfschema/r/setup_objects.result
+++ b/mysql-test/suite/perfschema/r/setup_objects.result
@@ -27,25 +27,25 @@ insert into performance_schema.setup_objects
values ('TABLE', 'db4', '%', 'YES', 'NO');
insert into performance_schema.setup_objects
values ('SOMETHING', 'bad1', 'bad1', 'YES', 'NO');
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
show warnings;
Level Code Message
Warning 1265 Data truncated for column 'OBJECT_TYPE' at row 1
-Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
+Error 1452 Cannot add or update a child row: a foreign key constraint fails
insert into performance_schema.setup_objects
values ('TABLE', 'bad2', 'bad2', 'MAYBE', 'NO');
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
show warnings;
Level Code Message
Warning 1265 Data truncated for column 'ENABLED' at row 1
-Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
+Error 1452 Cannot add or update a child row: a foreign key constraint fails
insert into performance_schema.setup_objects
values ('TABLE', 'bad3', 'bad3', 'YES', 'MAYBE NOT');
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
show warnings;
Level Code Message
Warning 1265 Data truncated for column 'TIMED' at row 1
-Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
+Error 1452 Cannot add or update a child row: a foreign key constraint fails
select * from performance_schema.setup_objects
order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
@@ -64,10 +64,10 @@ set OBJECT_TYPE='SOMETHING' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
ERROR HY000: Invalid performance_schema usage.
update performance_schema.setup_objects
set ENABLED='MAYBE' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
update performance_schema.setup_objects
set TIMED='MAYBE NOT' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
select * from performance_schema.setup_objects
order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
index d725009d8fd..21b99360e64 100644
--- a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
@@ -33,11 +33,13 @@ ERROR 28000: Access denied for user 'boot0123456789'@'localhost' (using password
# 2.5 Connect should pass, host = localhost
# length of user name = 10 character
# length of default db = 9 character
+CREATE USER 'root012345'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost';
DROP USER 'root012345'@'localhost';
# 2.6 Connect should pass, host = localhost
# length of user name = 14 character
# length of default db = 9 character
+CREATE USER 'root0123456789'@'localhost';
GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost';
DROP USER 'root0123456789'@'localhost';
# 2.7 Connect should pass, host = my_localhost
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_function.result b/mysql-test/suite/perfschema/r/stage_mdl_function.result
index d949b19586a..098ff4f2132 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_function.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_function.result
@@ -11,7 +11,6 @@ username event_name sql_text
user1 statement/sql/select select test.f1()
username event_name nesting_event_type
username event_name nesting_event_type
-user1 stage/sql/optimizing STATEMENT
user1 stage/sql/executing STATEMENT
user1 stage/sql/Opening tables STATEMENT
user1 stage/sql/After opening tables STATEMENT
@@ -19,6 +18,7 @@ user1 stage/sql/closing tables STATEMENT
user1 stage/sql/end STATEMENT
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/Unlocking tables STATEMENT
user1 stage/sql/freeing items STATEMENT
user1 stage/sql/cleaning up STATEMENT
call dump_one_thread('user2');
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_global.result b/mysql-test/suite/perfschema/r/stage_mdl_global.result
index fdcaafa6201..b476689338e 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_global.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_global.result
@@ -7,6 +7,8 @@ username event_name nesting_event_type
username event_name nesting_event_type
user1 stage/sql/init STATEMENT
user1 stage/sql/init STATEMENT
+user1 stage/sql/Waiting for query cache lock STATEMENT
+user1 stage/sql/init STATEMENT
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
user1 stage/sql/freeing items STATEMENT
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_procedure.result b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
index 263c00c98e6..1eeae4fc4fa 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
@@ -18,7 +18,6 @@ username event_name sql_text
user1 statement/sql/select select test.f1()
username event_name nesting_event_type
username event_name nesting_event_type
-user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
user1 stage/sql/Opening tables STATEMENT
user1 stage/sql/After opening tables STATEMENT
@@ -26,6 +25,7 @@ user1 stage/sql/closing tables STATEMENT
user1 stage/sql/end STATEMENT
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/Unlocking tables STATEMENT
user1 stage/sql/freeing items STATEMENT
user1 stage/sql/cleaning up STATEMENT
call dump_one_thread('user2');
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_table.result b/mysql-test/suite/perfschema/r/stage_mdl_table.result
index 60e83e8a179..0699c28ac47 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_table.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_table.result
@@ -13,7 +13,6 @@ username event_name sql_text
user1 statement/sql/select select * from test.t1 for update
username event_name nesting_event_type
username event_name nesting_event_type
-user1 stage/sql/optimizing STATEMENT
user1 stage/sql/statistics STATEMENT
user1 stage/sql/preparing STATEMENT
user1 stage/sql/executing STATEMENT
@@ -21,6 +20,7 @@ user1 stage/sql/Sending data STATEMENT
user1 stage/sql/end STATEMENT
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/Unlocking tables STATEMENT
user1 stage/sql/freeing items STATEMENT
user1 stage/sql/cleaning up STATEMENT
call dump_one_thread('user2');
diff --git a/mysql-test/suite/perfschema/r/start_server_low_digest.result b/mysql-test/suite/perfschema/r/start_server_low_digest.result
index eebebe5af88..6fc41fbb715 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_digest.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_digest.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/truncate c4afa12dd9165da1a5fe8b74cf43005d TRUNCATE TABLE truncate table events_statements_history_long
-statement/sql/select 719c3d02e550844d831d96809f405c39 SELECT ? + ? + 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+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
+statement/sql/truncate 6206ac02a54d832f55015e480e6f2213 TRUNCATE TABLE truncate table events_statements_history_long
+statement/sql/select 4cc1c447d79877c4e8df0423fd0cde9a SELECT ? + ? + 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+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
diff --git a/mysql-test/suite/perfschema/r/start_server_no_digests.result b/mysql-test/suite/perfschema/r/start_server_no_digests.result
index 4f6fa9bc5da..e4b389716a9 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_digests.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_digests.result
@@ -109,9 +109,9 @@ DROP TRIGGER trg;
####################################
# QUERYING PS STATEMENT DIGEST
####################################
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
-SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
+SCHEMA_NAME DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
SHOW VARIABLES LIKE "performance_schema_digests_size";
Variable_name Value
performance_schema_digests_size 0
diff --git a/mysql-test/suite/perfschema/r/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result
index 13a82fb31ad..6abe865f1aa 100644
--- a/mysql-test/suite/perfschema/r/statement_digest.result
+++ b/mysql-test/suite/perfschema/r/statement_digest.result
@@ -109,44 +109,44 @@ DROP TRIGGER trg;
####################################
# QUERYING PS STATEMENT DIGEST
####################################
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
-SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
-statements_digest 52e3729216b72a67a671ac3b93a1f1d3 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
-statements_digest a76073841b59a83de0fcdb6a0158b94a SELECT ? FROM `t1` 2 0 0 0
-statements_digest d91813c4d7a128822624a55b43bab7b2 SELECT ?, ... FROM `t1` 2 0 0 0
-statements_digest 8d1d0319e2ce41e1c41455a06b8905f8 SELECT ? FROM `t2` 1 0 0 0
-statements_digest 704f1e85525022d18028b3493bf61e65 SELECT ?, ... FROM `t2` 2 0 0 0
-statements_digest 7f60599ab03830f5571b306d71e47ba3 INSERT INTO `t1` VALUES (?) 2 2 0 0
-statements_digest 103d388f122df6a6a2c9f7fa01d90d7d INSERT INTO `t2` VALUES (?) 1 1 0 0
-statements_digest f1f56fda9303c1e2555bd67d431398ab INSERT INTO `t3` VALUES (...) 4 4 0 0
-statements_digest 08fc8813613c3cd44736a4abbb0cd095 INSERT INTO `t4` VALUES (...) 1 1 0 0
-statements_digest ab209b79451b94d03d8e20374ec18795 INSERT INTO `t5` VALUES (...) 1 1 0 0
-statements_digest 4729eb58cad3b77435bcd17864cfe322 INSERT INTO `t1` VALUES (?) /* , ... */ 2 7 0 0
-statements_digest 8e543c7785feeeb3e9a1957397a1033f INSERT INTO `t3` VALUES (...) /* , ... */ 1 3 0 0
-statements_digest 3dd587a1c42991bb323cbaa4c6fb61d0 INSERT INTO `t5` VALUES (...) /* , ... */ 1 3 0 0
-statements_digest 6f2f9f471f739d16b4ff4faf256e839e INSERT INTO `t6` VALUES (...) 5 5 0 0
-statements_digest 9701bfa1fb64563334f1a52953e065f3 SELECT ? + ? 3 0 0 0
-statements_digest b0785a540ffc1743c4e0879d193a4b10 SELECT ? 1 0 0 0
-statements_digest bee0eebfc340dbd233ee8c86270ac6ea CREATE SCHEMA `statements_digest_temp` 2 2 0 0
-statements_digest a35fd3ac67e64b9ac41a53781a7f5662 DROP SCHEMA `statements_digest_temp` 2 0 0 0
-statements_digest 52ec0213cba551f38d069c94a50cd2c7 SELECT ? FROM `no_such_table` 1 0 0 1
-statements_digest 27d4298be49de7a7606fcc8122ce7cd6 CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2 0 0 1
-statements_digest 8a9b185842f12475c7ffa350ade45408 DROP TABLE `dup_table` 1 0 0 0
-statements_digest bda68c0a1eca7b625a5158da41ebbcf9 INSERT INTO `t11` VALUES (?) 1 1 1 0
-statements_digest 196c9f451360b5e24e03aa82f86006ae SHOW WARNINGS 1 0 0 0
-statements_digest 3413dd64a34c2148e669e3283ca41ff5 PREPARE `stmt` FROM ? 1 0 0 0
-statements_digest fcec9dcf45c26dabade2c7a4ab818543 EXECUTE `stmt` 2 0 0 0
-statements_digest 9e5e4f78f8226cc853fa1ce62ae61f9d DEALLOCATE PREPARE `stmt` 1 0 0 0
-statements_digest c92f30dceb52f470a6c36400bdb372c6 CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1 0 0 0
-statements_digest db338b4f4a13d74acda7a7b9dae2b0b4 CALL `p1` ( ) 2 0 0 0
-statements_digest c2c92e9e7ac73741622d1f264e08c384 DROP PROCEDURE `p1` 1 0 0 0
-statements_digest c99aad5579088b31cdd53be4bfbc2b6e CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1 0 0 0
-statements_digest 1f4ce8758787f5aa5f51f1ee7f3b8119 SELECT `func` (...) 2 0 0 0
-statements_digest ab76a0821015fa000a1df9c684072e37 DROP FUNCTION `func` 1 0 0 0
-statements_digest ce5db6554a357045978a5572c84a7655 CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1 0 0 0
-statements_digest 801f02819c67e56fe3f22cc7dda99707 INSERT INTO `t12` VALUES (?) 2 2 0 0
-statements_digest dc3b07fe8e4d5fa91b383605f18512b0 DROP TRIGGER `trg` 1 0 0 0
+SCHEMA_NAME DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
+statements_digest TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
+statements_digest SELECT ? FROM `t1` 2 0 0 0
+statements_digest SELECT ?, ... FROM `t1` 2 0 0 0
+statements_digest SELECT ? FROM `t2` 1 0 0 0
+statements_digest SELECT ?, ... FROM `t2` 2 0 0 0
+statements_digest INSERT INTO `t1` VALUES (?) 2 2 0 0
+statements_digest INSERT INTO `t2` VALUES (?) 1 1 0 0
+statements_digest INSERT INTO `t3` VALUES (...) 4 4 0 0
+statements_digest INSERT INTO `t4` VALUES (...) 1 1 0 0
+statements_digest INSERT INTO `t5` VALUES (...) 1 1 0 0
+statements_digest INSERT INTO `t1` VALUES (?) /* , ... */ 2 7 0 0
+statements_digest INSERT INTO `t3` VALUES (...) /* , ... */ 1 3 0 0
+statements_digest INSERT INTO `t5` VALUES (...) /* , ... */ 1 3 0 0
+statements_digest INSERT INTO `t6` VALUES (...) 5 5 0 0
+statements_digest SELECT ? + ? 3 0 0 0
+statements_digest SELECT ? 1 0 0 0
+statements_digest CREATE SCHEMA `statements_digest_temp` 2 2 0 0
+statements_digest DROP SCHEMA `statements_digest_temp` 2 0 0 0
+statements_digest SELECT ? FROM `no_such_table` 1 0 0 1
+statements_digest CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2 0 0 1
+statements_digest DROP TABLE `dup_table` 1 0 0 0
+statements_digest INSERT INTO `t11` VALUES (?) 1 1 1 0
+statements_digest SHOW WARNINGS 1 0 0 0
+statements_digest PREPARE `stmt` FROM ? 1 0 0 0
+statements_digest EXECUTE `stmt` 2 0 0 0
+statements_digest DEALLOCATE PREPARE `stmt` 1 0 0 0
+statements_digest CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1 0 0 0
+statements_digest CALL `p1` ( ) 2 0 0 0
+statements_digest DROP PROCEDURE `p1` 1 0 0 0
+statements_digest CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1 0 0 0
+statements_digest SELECT `func` (...) 2 0 0 0
+statements_digest DROP FUNCTION `func` 1 0 0 0
+statements_digest CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1 0 0 0
+statements_digest INSERT INTO `t12` VALUES (?) 2 2 0 0
+statements_digest DROP TRIGGER `trg` 1 0 0 0
####################################
# CLEANUP
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
index a1c4fbe1d25..db60362dd92 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
@@ -123,45 +123,45 @@ DROP TRIGGER trg;
####################################
# QUERYING PS STATEMENT DIGEST
####################################
-SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
-schema_name digest digest_text count_star
-statements_digest 52e3729216b72a67a671ac3b93a1f1d3 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
-statements_digest a76073841b59a83de0fcdb6a0158b94a SELECT ? FROM `t1` 2
-statements_digest d91813c4d7a128822624a55b43bab7b2 SELECT ?, ... FROM `t1` 2
-statements_digest 8d1d0319e2ce41e1c41455a06b8905f8 SELECT ? FROM `t2` 1
-statements_digest 704f1e85525022d18028b3493bf61e65 SELECT ?, ... FROM `t2` 2
-statements_digest 7f60599ab03830f5571b306d71e47ba3 INSERT INTO `t1` VALUES (?) 2
-statements_digest 103d388f122df6a6a2c9f7fa01d90d7d INSERT INTO `t2` VALUES (?) 1
-statements_digest f1f56fda9303c1e2555bd67d431398ab INSERT INTO `t3` VALUES (...) 4
-statements_digest 08fc8813613c3cd44736a4abbb0cd095 INSERT INTO `t4` VALUES (...) 1
-statements_digest ab209b79451b94d03d8e20374ec18795 INSERT INTO `t5` VALUES (...) 1
-statements_digest 4729eb58cad3b77435bcd17864cfe322 INSERT INTO `t1` VALUES (?) /* , ... */ 2
-statements_digest 8e543c7785feeeb3e9a1957397a1033f INSERT INTO `t3` VALUES (...) /* , ... */ 1
-statements_digest 3dd587a1c42991bb323cbaa4c6fb61d0 INSERT INTO `t5` VALUES (...) /* , ... */ 1
-statements_digest 6f2f9f471f739d16b4ff4faf256e839e INSERT INTO `t6` VALUES (...) 5
-statements_digest 9701bfa1fb64563334f1a52953e065f3 SELECT ? + ? 3
-statements_digest b0785a540ffc1743c4e0879d193a4b10 SELECT ? 1
-statements_digest bee0eebfc340dbd233ee8c86270ac6ea CREATE SCHEMA `statements_digest_temp` 2
-statements_digest a35fd3ac67e64b9ac41a53781a7f5662 DROP SCHEMA `statements_digest_temp` 2
-statements_digest 52ec0213cba551f38d069c94a50cd2c7 SELECT ? FROM `no_such_table` 1
-statements_digest 27d4298be49de7a7606fcc8122ce7cd6 CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2
-statements_digest 8a9b185842f12475c7ffa350ade45408 DROP TABLE `dup_table` 1
-statements_digest bda68c0a1eca7b625a5158da41ebbcf9 INSERT INTO `t11` VALUES (?) 1
-statements_digest 196c9f451360b5e24e03aa82f86006ae SHOW WARNINGS 1
-statements_digest 3413dd64a34c2148e669e3283ca41ff5 PREPARE `stmt` FROM ? 1
-statements_digest fcec9dcf45c26dabade2c7a4ab818543 EXECUTE `stmt` 2
-statements_digest 9e5e4f78f8226cc853fa1ce62ae61f9d DEALLOCATE PREPARE `stmt` 1
-statements_digest c92f30dceb52f470a6c36400bdb372c6 CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1
-statements_digest db338b4f4a13d74acda7a7b9dae2b0b4 CALL `p1` ( ) 2
-statements_digest c2c92e9e7ac73741622d1f264e08c384 DROP PROCEDURE `p1` 1
-statements_digest c99aad5579088b31cdd53be4bfbc2b6e CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1
-statements_digest 1f4ce8758787f5aa5f51f1ee7f3b8119 SELECT `func` (...) 2
-statements_digest ab76a0821015fa000a1df9c684072e37 DROP FUNCTION `func` 1
-statements_digest ce5db6554a357045978a5572c84a7655 CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1
-statements_digest 801f02819c67e56fe3f22cc7dda99707 INSERT INTO `t12` VALUES (?) 2
-statements_digest dc3b07fe8e4d5fa91b383605f18512b0 DROP TRIGGER `trg` 1
-SELECT digest, digest_text FROM performance_schema.events_statements_current;
-digest digest_text
+SELECT schema_name,digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+schema_name digest_text count_star
+statements_digest TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+statements_digest SELECT ? FROM `t1` 2
+statements_digest SELECT ?, ... FROM `t1` 2
+statements_digest SELECT ? FROM `t2` 1
+statements_digest SELECT ?, ... FROM `t2` 2
+statements_digest INSERT INTO `t1` VALUES (?) 2
+statements_digest INSERT INTO `t2` VALUES (?) 1
+statements_digest INSERT INTO `t3` VALUES (...) 4
+statements_digest INSERT INTO `t4` VALUES (...) 1
+statements_digest INSERT INTO `t5` VALUES (...) 1
+statements_digest INSERT INTO `t1` VALUES (?) /* , ... */ 2
+statements_digest INSERT INTO `t3` VALUES (...) /* , ... */ 1
+statements_digest INSERT INTO `t5` VALUES (...) /* , ... */ 1
+statements_digest INSERT INTO `t6` VALUES (...) 5
+statements_digest SELECT ? + ? 3
+statements_digest SELECT ? 1
+statements_digest CREATE SCHEMA `statements_digest_temp` 2
+statements_digest DROP SCHEMA `statements_digest_temp` 2
+statements_digest SELECT ? FROM `no_such_table` 1
+statements_digest CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2
+statements_digest DROP TABLE `dup_table` 1
+statements_digest INSERT INTO `t11` VALUES (?) 1
+statements_digest SHOW WARNINGS 1
+statements_digest PREPARE `stmt` FROM ? 1
+statements_digest EXECUTE `stmt` 2
+statements_digest DEALLOCATE PREPARE `stmt` 1
+statements_digest CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1
+statements_digest CALL `p1` ( ) 2
+statements_digest DROP PROCEDURE `p1` 1
+statements_digest CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1
+statements_digest SELECT `func` (...) 2
+statements_digest DROP FUNCTION `func` 1
+statements_digest CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1
+statements_digest INSERT INTO `t12` VALUES (?) 2
+statements_digest DROP TRIGGER `trg` 1
+SELECT digest_text FROM performance_schema.events_statements_current;
+digest_text
####################################
# CLEANUP
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
index a723b8e9fa5..1c581085eef 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
@@ -6,7 +6,7 @@ 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
####################################
# QUERYING PS STATEMENT DIGEST
####################################
-SELECT schema_name, digest, digest_text, count_star FROM events_statements_summary_by_digest;
-schema_name digest digest_text count_star
-performance_schema 2f6bc98e6ca82311b17aac2f1e7cd85d TRUNCATE TABLE `events_statements_summary_by_digest` 1
-performance_schema 6c4b347800e3aa6bd3e41e3b97b3828a SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? 1
+SELECT schema_name, digest_text, count_star FROM events_statements_summary_by_digest;
+schema_name digest_text count_star
+performance_schema TRUNCATE TABLE `events_statements_summary_by_digest` 1
+performance_schema SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? 1
diff --git a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
deleted file mode 100644
index e9537e5474c..00000000000
--- a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
+++ /dev/null
@@ -1,6 +0,0 @@
-call mtr.add_suppression(
-"Column count of performance_schema.setup_instruments is wrong. "
-"Expected 4, found 3. The table is probably corrupted");
-select * from performance_schema.setup_instruments limit 1;
-ERROR HY000: Native table 'performance_schema'.'setup_instruments' has the wrong structure
-select * from performance_schema.setup_consumers limit 1;
diff --git a/mysql-test/suite/perfschema/r/temp_table_io.result b/mysql-test/suite/perfschema/r/temp_table_io.result
index c5de365dbf4..0e1bf01ef9a 100644
--- a/mysql-test/suite/perfschema/r/temp_table_io.result
+++ b/mysql-test/suite/perfschema/r/temp_table_io.result
@@ -84,29 +84,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result
index 6ab0b0641b0..9f9c46fe6a6 100644
--- a/mysql-test/suite/perfschema/r/threads_mysql.result
+++ b/mysql-test/suite/perfschema/r/threads_mysql.result
@@ -44,6 +44,16 @@ processlist_info NULL
unified_parent_thread_id unified parent_thread_id
role NULL
instrumented YES
+name thread/sql/slave_background
+type BACKGROUND
+processlist_user NULL
+processlist_host NULL
+processlist_db NULL
+processlist_command NULL
+processlist_info NULL
+unified_parent_thread_id unified parent_thread_id
+role NULL
+instrumented YES
CREATE TEMPORARY TABLE t1 AS
SELECT thread_id FROM performance_schema.threads
WHERE name LIKE 'thread/sql%';
@@ -105,4 +115,5 @@ parent_thread_name child_thread_name
thread/sql/event_scheduler thread/sql/event_worker
thread/sql/main thread/sql/one_connection
thread/sql/main thread/sql/signal_handler
+thread/sql/main thread/sql/slave_background
thread/sql/one_connection thread/sql/event_scheduler
diff --git a/mysql-test/suite/perfschema/r/trigger_table_io.result b/mysql-test/suite/perfschema/r/trigger_table_io.result
index e77e7d864f1..9fc63e69675 100644
--- a/mysql-test/suite/perfschema/r/trigger_table_io.result
+++ b/mysql-test/suite/perfschema/r/trigger_table_io.result
@@ -169,29 +169,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/view_table_io.result b/mysql-test/suite/perfschema/r/view_table_io.result
index db6acf65c73..5d8ad26ae77 100644
--- a/mysql-test/suite/perfschema/r/view_table_io.result
+++ b/mysql-test/suite/perfschema/r/view_table_io.result
@@ -120,29 +120,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
-show status like 'performance_schema_%';
+show status where Variable_name like 'performance_schema_%' and
+Variable_name not like 'performance_schema_%_classes_lost';
Variable_name Value
Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/t/bad_option_2.test b/mysql-test/suite/perfschema/t/bad_option_2.test
index 175767bb9f2..ce3e5c3243b 100644
--- a/mysql-test/suite/perfschema/t/bad_option_2.test
+++ b/mysql-test/suite/perfschema/t/bad_option_2.test
@@ -8,26 +8,9 @@ let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_2.txt;
--error 0,1
--remove_file $outfile
--error 3
---exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $outfile 2>&1
-
-perl;
- use strict;
- use warnings;
- my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_2.txt";
- open(FILE, "<", $fname) or die;
- my @lines= <FILE>;
- # those must be in the file for the test to pass
- my @patterns=
- ("ambiguous option '--performance-schema-max_=12'");
- foreach my $one_line (@lines)
- {
- foreach my $one_pattern (@patterns)
- {
- # print pattern, not line, to get a stable output
- print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
- }
- }
- close FILE;
-EOF
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --enable-getopt-prefix-matching --performance-schema-max_=12 > $outfile 2>&1
+--let SEARCH_PATTERN=ambiguous option '--performance-schema-max_=12'
+--let SEARCH_FILE=$outfile
+--source include/search_pattern_in_file.inc
--remove_file $outfile
diff --git a/mysql-test/suite/perfschema/t/column_privilege.test b/mysql-test/suite/perfschema/t/column_privilege.test
index 6fabdfb4229..004492c6145 100644
--- a/mysql-test/suite/perfschema/t/column_privilege.test
+++ b/mysql-test/suite/perfschema/t/column_privilege.test
@@ -7,6 +7,7 @@
show grants;
+create user 'pfs_user_5'@localhost;
grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION;
# Test per column privileges on performance_schema
diff --git a/mysql-test/suite/perfschema/t/digest_table_full.test b/mysql-test/suite/perfschema/t/digest_table_full.test
index cb9d7ea4ea8..dbbce662256 100644
--- a/mysql-test/suite/perfschema/t/digest_table_full.test
+++ b/mysql-test/suite/perfschema/t/digest_table_full.test
@@ -19,7 +19,7 @@ TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
--echo ####################################
--echo # QUERYING PS STATEMENT DIGEST
--echo ####################################
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
diff --git a/mysql-test/suite/perfschema/t/discovery.test b/mysql-test/suite/perfschema/t/discovery.test
new file mode 100644
index 00000000000..811e99da705
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/discovery.test
@@ -0,0 +1,15 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--echo #
+--echo # MDEV-7922 - ERROR 1939 (HY000): Engine PERFORMANCE_SCHEMA failed to
+--echo # discover table
+--echo #
+FLUSH TABLES;
+CREATE DATABASE test_drop;
+USE test_drop;
+DROP DATABASE test_drop;
+--disable_result_log
+SELECT TABLE_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='performance_schema';
+--enable_result_log
+SELECT @@warning_count;
diff --git a/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-test/suite/perfschema/t/func_mutex.test
index ca1feb68091..66bcb68accb 100644
--- a/mysql-test/suite/perfschema/t/func_mutex.test
+++ b/mysql-test/suite/perfschema/t/func_mutex.test
@@ -19,7 +19,7 @@ flush status;
# Make sure objects are instrumented
select NAME from performance_schema.mutex_instances
- where NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share' GROUP BY NAME;
+ where NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex' GROUP BY NAME;
select NAME from performance_schema.rwlock_instances
where NAME = 'wait/synch/rwlock/sql/LOCK_grant';
@@ -49,18 +49,18 @@ SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
- WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+ WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
- WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+ WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed;
UPDATE performance_schema.setup_instruments SET enabled = 'NO'
-WHERE NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share';
+WHERE NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex';
TRUNCATE TABLE performance_schema.events_waits_history_long;
TRUNCATE TABLE performance_schema.events_waits_history;
@@ -70,13 +70,13 @@ SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
- WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+ WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long
- WHERE (EVENT_NAME = 'wait/synch/mutex/sql/TABLE_SHARE::tdc.LOCK_table_share'));
+ WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed;
diff --git a/mysql-test/suite/perfschema/t/global_read_lock.test b/mysql-test/suite/perfschema/t/global_read_lock.test
index 1ab6005f7e2..0883ed1ed42 100644
--- a/mysql-test/suite/perfschema/t/global_read_lock.test
+++ b/mysql-test/suite/perfschema/t/global_read_lock.test
@@ -11,6 +11,7 @@ use performance_schema;
# Ensure that instrumentation is turned on when we create new connection.
update performance_schema.setup_instruments set enabled='YES';
+create user pfsuser@localhost;
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
index a96ccf86315..df82a5c047d 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
@@ -18,6 +18,7 @@ call mtr.add_suppression("santa.claus.ipv4.example.com");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
index 4bf041b1ada..08cbe8d15af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
@@ -20,6 +20,7 @@ call mtr.add_suppression("santa.claus.ipv4.example.com");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
index 9931fa5ffba..808a1b927d7 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
@@ -18,6 +18,7 @@ call mtr.add_suppression("192.0.2.4");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
index 283d3a5841d..6f763d8c666 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
@@ -18,7 +18,9 @@ call mtr.add_suppression("santa.claus.ipv4.example.com");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
index 7c89aa3d44e..b18dcd5f494 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
@@ -20,6 +20,7 @@ select @@global.max_connect_errors into @saved_max_connect_errors;
set global max_connect_errors = 3;
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
create user 'quota'@'santa.claus.ipv4.example.com';
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
index bce65b61cfc..ab72e0f4340 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
@@ -18,7 +18,9 @@ call mtr.add_suppression("192.0.2.4");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
+create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
index 52b696831af..06776de6b27 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
@@ -18,6 +18,7 @@ call mtr.add_suppression("192.0.2.4");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
index c1af8516b79..f276e759f75 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
@@ -19,6 +19,7 @@ call mtr.add_suppression("santa.claus.ipv6.example.com");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
index ae1de4f032e..9f951273e98 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
@@ -21,6 +21,7 @@ call mtr.add_suppression("santa.claus.ipv6.example.com");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
index 9dbd682681e..81427e86c5e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
@@ -19,6 +19,7 @@ call mtr.add_suppression("192.0.2.4");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
index b675b5089a8..7ce12639b7f 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
@@ -19,7 +19,9 @@ call mtr.add_suppression("santa.claus.ipv6.example.com");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
index cd78087dad1..0a04ec306cf 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
@@ -21,6 +21,7 @@ select @@global.max_connect_errors into @saved_max_connect_errors;
set global max_connect_errors = 3;
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
create user 'quota'@'santa.claus.ipv6.example.com';
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
index 143ad44c2f2..4b2088ce37f 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
@@ -1,2 +1,2 @@
---bind-addr=::
+--bind-address=::
--max-user-connections=1024
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
index 983a6e80ff7..7e49ed62b93 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
@@ -19,7 +19,9 @@ call mtr.add_suppression("2001:db8::6:6");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
+create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
index 3a30030413f..62876e859cb 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
@@ -19,6 +19,7 @@ call mtr.add_suppression("2001:db8::6:6");
--source ../include/wait_for_pfs_thread_count.inc
--source ../include/hostcache_set_state.inc
+create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
index a0a6079ec16..c2bb4d156af 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
@@ -1 +1 @@
---bind-addr=::
+--bind-address=::
diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test
index bf3e8afffdc..c9f7dc6bfc0 100644
--- a/mysql-test/suite/perfschema/t/misc.test
+++ b/mysql-test/suite/perfschema/t/misc.test
@@ -207,3 +207,18 @@ select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
select _utf8mb4 'òðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑòðÑÂÑ' as B;
select count(*) from events_statements_history where sql_text like "%...";
+
+
+#
+# MDEV-10486 MariaDB 10.x does not update rows_examined in performance_schema tables
+# Verify that the rows_examined counter is set properly.
+
+use test;
+create table t1 (id int);
+insert into t1 values (1), (2), (3);
+truncate performance_schema.events_statements_history;
+select * from t1;
+insert into t1 select RAND()*10000 from t1;
+select sql_text, rows_examined from performance_schema.events_statements_history;
+drop table t1;
+
diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test
index 29819770645..7f1c0b570ad 100644
--- a/mysql-test/suite/perfschema/t/nesting.test
+++ b/mysql-test/suite/perfschema/t/nesting.test
@@ -10,6 +10,7 @@
--disable_query_log
+create user user1@localhost;
grant ALL on *.* to user1@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_event.test b/mysql-test/suite/perfschema/t/pfs_upgrade_event.test
index db7613052d4..f16a073f212 100644
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_event.test
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_event.test
@@ -7,18 +7,7 @@
--source include/have_perfschema.inc
--source include/have_innodb.inc
-# Some initial settings + Preemptive cleanup
let $MYSQLD_DATADIR= `SELECT @@datadir`;
-let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_event.err;
-let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_event.out;
---error 0,1
---remove_file $out_file
---error 0,1
---remove_file $err_file
-
---disable_warnings
-drop event if exists test.user_event;
---enable_warnings
--echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
@@ -33,4 +22,3 @@ select name from mysql.event where db='performance_schema';
update mysql.event set db='test' where name='user_event';
drop event test.user_event;
-
diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_func.test b/mysql-test/suite/perfschema/t/pfs_upgrade_func.test
index 4f53aa1bdd1..da2bc371308 100644
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_func.test
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_func.test
@@ -7,18 +7,7 @@
--source include/have_perfschema.inc
--source include/have_innodb.inc
-# Some initial settings + Preemptive cleanup
let $MYSQLD_DATADIR= `SELECT @@datadir`;
-let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_func.err;
-let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_func.out;
---error 0,1
---remove_file $out_file
---error 0,1
---remove_file $err_file
-
---disable_warnings
-drop function if exists test.user_func;
---enable_warnings
--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
@@ -33,4 +22,3 @@ select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_func';
drop function test.user_func;
-
diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test b/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test
index 432cee6fb1a..99e0816ccbd 100644
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test
@@ -7,18 +7,7 @@
--source include/have_perfschema.inc
--source include/have_innodb.inc
-# Some initial settings + Preemptive cleanup
let $MYSQLD_DATADIR= `SELECT @@datadir`;
-let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_proc.err;
-let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_proc.out;
---error 0,1
---remove_file $out_file
---error 0,1
---remove_file $err_file
-
---disable_warnings
-drop procedure if exists test.user_proc;
---enable_warnings
--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
@@ -33,4 +22,3 @@ select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_proc';
drop procedure test.user_proc;
-
diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_table.test b/mysql-test/suite/perfschema/t/pfs_upgrade_table.test
index c68e156a2db..897ec23c552 100644
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_table.test
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_table.test
@@ -7,25 +7,12 @@
--source include/have_perfschema.inc
--source include/have_innodb.inc
-# Some initial settings + Preemptive cleanup
let $MYSQLD_DATADIR= `SELECT @@datadir`;
-let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_table.err;
-let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_table.out;
---error 0,1
---remove_file $out_file
---error 0,1
---remove_file $err_file
-
---disable_warnings
-drop table if exists test.user_table;
---enable_warnings
--echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
create table test.user_table(a int);
---error 0,1
---remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
# Make sure the table is visible
@@ -41,4 +28,3 @@ use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
drop table test.user_table;
-
diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_view.test b/mysql-test/suite/perfschema/t/pfs_upgrade_view.test
index 38ce377f235..0c9af73a1d4 100644
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_view.test
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_view.test
@@ -7,25 +7,12 @@
--source include/have_perfschema.inc
--source include/have_innodb.inc
-# Some initial settings + Preemptive cleanup
let $MYSQLD_DATADIR= `SELECT @@datadir`;
-let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_view.err;
-let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_view.out;
---error 0,1
---remove_file $out_file
---error 0,1
---remove_file $err_file
-
---disable_warnings
-drop view if exists test.user_view;
---enable_warnings
--echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
create view test.user_view as select "Not supposed to be here";
---error 0,1
---remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
# Make sure the view is visible
@@ -41,4 +28,3 @@ use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
drop view test.user_view;
-
diff --git a/mysql-test/suite/perfschema/t/privilege.test b/mysql-test/suite/perfschema/t/privilege.test
index 47a68602fa4..0e51d161934 100644
--- a/mysql-test/suite/perfschema/t/privilege.test
+++ b/mysql-test/suite/perfschema/t/privilege.test
@@ -5,6 +5,9 @@
show grants;
+create user 'pfs_user_1'@localhost;
+create user 'pfs_user_2'@localhost;
+create user 'pfs_user_3'@localhost;
grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION;
# Test denied privileges on performance_schema.*
diff --git a/mysql-test/suite/perfschema/t/privilege_table_io.test b/mysql-test/suite/perfschema/t/privilege_table_io.test
index 833fe85e8bb..c7928b7345b 100644
--- a/mysql-test/suite/perfschema/t/privilege_table_io.test
+++ b/mysql-test/suite/perfschema/t/privilege_table_io.test
@@ -18,6 +18,7 @@ optimize table mysql.host;
optimize table mysql.user;
optimize table mysql.db;
optimize table mysql.proxies_priv;
+optimize table mysql.roles_mapping;
optimize table mysql.tables_priv;
optimize table mysql.procs_priv;
optimize table mysql.servers;
diff --git a/mysql-test/suite/perfschema/t/read_only.test b/mysql-test/suite/perfschema/t/read_only.test
index 3050cee9e72..7b0284a7a48 100644
--- a/mysql-test/suite/perfschema/t/read_only.test
+++ b/mysql-test/suite/perfschema/t/read_only.test
@@ -11,6 +11,7 @@ use performance_schema;
set @start_read_only= @@global.read_only;
+create user pfsuser@localhost;
grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/t/rpl_gtid_func.test b/mysql-test/suite/perfschema/t/rpl_gtid_func.test
index 5a3fe0b7894..6373d4284dc 100644
--- a/mysql-test/suite/perfschema/t/rpl_gtid_func.test
+++ b/mysql-test/suite/perfschema/t/rpl_gtid_func.test
@@ -45,7 +45,7 @@ insert into performance_schema.setup_objects
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
-select digest, digest_text, count_star
+select digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
@@ -67,7 +67,7 @@ insert into performance_schema.setup_objects
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
-select digest, digest_text, count_star
+select digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test
index 1aa52efd937..4f65cdcbd7b 100644
--- a/mysql-test/suite/perfschema/t/rpl_statements.test
+++ b/mysql-test/suite/perfschema/t/rpl_statements.test
@@ -64,7 +64,7 @@ connection master;
--echo *** Create test tables
--echo
-show variables like '%binlog_format%';
+show variables like 'binlog_format%';
--disable_warnings
drop table if exists test.marker;
@@ -129,7 +129,7 @@ connection master;
--echo *** MASTER ***
--echo **************
--echo
-show variables like '%binlog_format%';
+show variables like 'binlog_format%';
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
diff --git a/mysql-test/suite/perfschema/t/server_init.test b/mysql-test/suite/perfschema/t/server_init.test
index d5a7e18827d..c6d25f18426 100644
--- a/mysql-test/suite/perfschema/t/server_init.test
+++ b/mysql-test/suite/perfschema/t/server_init.test
@@ -118,9 +118,6 @@ select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_audit_mask";
select count(name) from mutex_instances
- where name like "wait/synch/mutex/sql/LOCK_xid_cache";
-
-select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_plugin";
# Not a global variable, may be destroyed already.
diff --git a/mysql-test/suite/perfschema/t/setup_actors.test b/mysql-test/suite/perfschema/t/setup_actors.test
index e975fa96782..39d60b0ab03 100644
--- a/mysql-test/suite/perfschema/t/setup_actors.test
+++ b/mysql-test/suite/perfschema/t/setup_actors.test
@@ -33,10 +33,15 @@ values ('hostb', '%', '%');
select * from performance_schema.setup_actors
order by USER, HOST, ROLE;
+create user user1@localhost;
grant ALL on *.* to user1@localhost;
+create user user2@localhost;
grant ALL on *.* to user2@localhost;
+create user user3@localhost;
grant ALL on *.* to user3@localhost;
+create user user4@localhost;
grant ALL on *.* to user4@localhost;
+create user user5@localhost;
grant select on test.* to user5@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt b/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
index 408eb5c79d2..ed6702ed5ef 100644
--- a/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
+++ b/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
@@ -12,7 +12,7 @@
--loose-performance-schema-instrument='wait/synch/mutex/sql/LOCK_thread_count=OFF'
--loose-performance-schema-instrument=' wait/synch/mutex/sql/LOCK_user_conn = COUNTED'
--loose-performance-schema-instrument='wait%/synch/mutex/sql/LOCK_uu%_genera%/= COUNTED'
---loose-performance-schema-instrument='%%wait/synch/mutex/sql/LOCK_xid_cache=COUNTED'
+--loose-performance-schema-instrument='%%wait/synch/mutex/sql/LOCK_plugin=COUNTED'
--loose-performance-schema-instrument='%=FOO'
--loose-performance-schema-instrument='%=%'
--loose-performance-schema-instrument='%'
diff --git a/mysql-test/suite/perfschema/t/setup_instruments_defaults.test b/mysql-test/suite/perfschema/t/setup_instruments_defaults.test
index e1f61404d12..5e0a3a5067a 100644
--- a/mysql-test/suite/perfschema/t/setup_instruments_defaults.test
+++ b/mysql-test/suite/perfschema/t/setup_instruments_defaults.test
@@ -15,7 +15,7 @@ SELECT * FROM performance_schema.setup_instruments
WHERE name IN (
'wait/synch/mutex/sql/LOCK_user_conn',
'wait/synch/mutex/sql/LOCK_uuid_generator',
- 'wait/synch/mutex/sql/LOCK_xid_cache',
+ 'wait/synch/mutex/sql/LOCK_plugin',
'stage/sql/creating table')
AND enabled = 'yes' AND timed = 'no'
ORDER BY name;
diff --git a/mysql-test/suite/perfschema/t/short_option_1-master.opt b/mysql-test/suite/perfschema/t/short_option_1-master.opt
index 03c480fe90d..d3ad08d3d54 100644
--- a/mysql-test/suite/perfschema/t/short_option_1-master.opt
+++ b/mysql-test/suite/perfschema/t/short_option_1-master.opt
@@ -1 +1 @@
--a -Cutf8 --collation=utf8_bin -T12 -W3
+-a -Cutf8 --collation-server=utf8_bin -T12 -W3
diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
index 086d31113f8..99f89bd3225 100644
--- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
@@ -493,6 +493,7 @@ let $connect_user= root;
--echo # length of user name = 10 character
--echo # length of default db = 9 character
#========================================================================
+CREATE USER 'root012345'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost';
let $connect_host= localhost;
let $connect_db= mysqltest;
@@ -504,6 +505,7 @@ DROP USER 'root012345'@'localhost';
--echo # length of user name = 14 character
--echo # length of default db = 9 character
#========================================================================
+CREATE USER 'root0123456789'@'localhost';
GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost';
let $connect_host= localhost;
let $connect_db= mysqltest;
diff --git a/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt b/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt
index e59be3eb02f..c3a6012fbac 100644
--- a/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt
@@ -1 +1 @@
---performance-schema-digests-size=1
+--loose-performance-schema-digests-size=1
diff --git a/mysql-test/suite/perfschema/t/start_server_no_digests.test b/mysql-test/suite/perfschema/t/start_server_no_digests.test
index cb9d7ea4ea8..dbbce662256 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_digests.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_digests.test
@@ -19,7 +19,7 @@ TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
--echo ####################################
--echo # QUERYING PS STATEMENT DIGEST
--echo ####################################
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
diff --git a/mysql-test/suite/perfschema/t/start_server_nothing-master.opt b/mysql-test/suite/perfschema/t/start_server_nothing-master.opt
index d0cd757cac1..afd804c1bd0 100644
--- a/mysql-test/suite/perfschema/t/start_server_nothing-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_nothing-master.opt
@@ -35,5 +35,5 @@
--loose-performance_schema_events_statements_history_long_size=0
--loose-performance_schema_events_statements_history_size=0
---loose-performance_schema_session_connect_attrs=0
+--loose-performance_schema_session_connect_attrs_size=0
diff --git a/mysql-test/suite/perfschema/t/statement_digest.test b/mysql-test/suite/perfschema/t/statement_digest.test
index ed1f99e4318..59486ad61d8 100644
--- a/mysql-test/suite/perfschema/t/statement_digest.test
+++ b/mysql-test/suite/perfschema/t/statement_digest.test
@@ -16,7 +16,7 @@ TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
--echo ####################################
--echo # QUERYING PS STATEMENT DIGEST
--echo ####################################
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
# Cleanup for Digest
diff --git a/mysql-test/suite/perfschema/t/statement_digest_consumers.test b/mysql-test/suite/perfschema/t/statement_digest_consumers.test
index e7510e32049..16fa300b975 100644
--- a/mysql-test/suite/perfschema/t/statement_digest_consumers.test
+++ b/mysql-test/suite/perfschema/t/statement_digest_consumers.test
@@ -28,8 +28,8 @@ TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
--echo ####################################
--echo # QUERYING PS STATEMENT DIGEST
--echo ####################################
-SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
-SELECT digest, digest_text FROM performance_schema.events_statements_current;
+SELECT schema_name,digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+SELECT digest_text FROM performance_schema.events_statements_current;
# Cleanup for Digest
--source ../include/digest_cleanup.inc
diff --git a/mysql-test/suite/perfschema/t/statement_digest_long_query.test b/mysql-test/suite/perfschema/t/statement_digest_long_query.test
index b7ba18ef2cb..7a080f7a29f 100644
--- a/mysql-test/suite/perfschema/t/statement_digest_long_query.test
+++ b/mysql-test/suite/perfschema/t/statement_digest_long_query.test
@@ -20,4 +20,4 @@ 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
--echo ####################################
--echo # QUERYING PS STATEMENT DIGEST
--echo ####################################
-SELECT schema_name, digest, digest_text, count_star FROM events_statements_summary_by_digest;
+SELECT schema_name, digest_text, count_star FROM events_statements_summary_by_digest;
diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt b/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt
deleted file mode 100644
index 5f094e68be7..00000000000
--- a/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=+d,tampered_perfschema_table1
diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
deleted file mode 100644
index 09e3d3aaa2c..00000000000
--- a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
+++ /dev/null
@@ -1,25 +0,0 @@
-# Tests for PERFORMANCE_SCHEMA
-
-# This test uses error injection,
-# see PFS_engine_table_share::check_all_tables()
-
-# Verify that the server starts even when a performance schema table
-# is corrupted, with an incompatible change.
-# Verify that using that table nicely fails.
-# Verify that other tables are not affected.
-
---source include/have_debug.inc
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
-call mtr.add_suppression(
-"Column count of performance_schema.setup_instruments is wrong. "
-"Expected 4, found 3. The table is probably corrupted");
-
---error ER_WRONG_NATIVE_TABLE_STRUCTURE
-select * from performance_schema.setup_instruments limit 1;
-
---disable_result_log
-select * from performance_schema.setup_consumers limit 1;
---enable_result_log
-
diff --git a/mysql-test/suite/plugins/r/audit_null.result b/mysql-test/suite/plugins/r/audit_null.result
index 584d10e3a3b..75eb5a9f682 100644
--- a/mysql-test/suite/plugins/r/audit_null.result
+++ b/mysql-test/suite/plugins/r/audit_null.result
@@ -1,5 +1,6 @@
set @old_global_general_log=@@global.general_log;
set global general_log=OFF;
+create user testuser@localhost;
grant select on *.* to testuser@localhost;
install plugin audit_null soname 'adt_null';
select 1;
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result
new file mode 100644
index 00000000000..a3b85a11dea
--- /dev/null
+++ b/mysql-test/suite/plugins/r/auth_ed25519.result
@@ -0,0 +1,50 @@
+create function ed25519_password returns string soname "auth_ed25519.so";
+select ed25519_password();
+ERROR HY000: Can't initialize function 'ed25519_password'; Wrong arguments to ed25519_password()
+select ed25519_password(1);
+ERROR HY000: Can't initialize function 'ed25519_password'; Wrong arguments to ed25519_password()
+select ed25519_password("foo", "bar");
+ERROR HY000: Can't initialize function 'ed25519_password'; Wrong arguments to ed25519_password()
+select ed25519_password("foo");
+ERROR HY000: Can't initialize function 'ed25519_password'; Authentication plugin ed25519 is not loaded
+install soname 'auth_ed25519';
+select ed25519_password("foo");
+ed25519_password("foo")
+vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI
+select ed25519_password("foobar");
+ed25519_password("foobar")
+qv2mG6HWCuy32Slb5xhV4THStewNz2VINVPbgk+XAJ8
+select ed25519_password("foo bar");
+ed25519_password("foo bar")
+Y5fV74JAVRMOK2cdnUsYS+WW9sXaaL/o+6WGKOgqnzc
+select ed25519_password(NULL);
+ed25519_password(NULL)
+NULL
+select * from information_schema.plugins where plugin_name='ed25519';
+PLUGIN_NAME ed25519
+PLUGIN_VERSION 1.0
+PLUGIN_STATUS ACTIVE
+PLUGIN_TYPE AUTHENTICATION
+PLUGIN_TYPE_VERSION 2.1
+PLUGIN_LIBRARY auth_ed25519.so
+PLUGIN_LIBRARY_VERSION 1.13
+PLUGIN_AUTHOR Sergei Golubchik
+PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
+PLUGIN_LICENSE GPL
+LOAD_OPTION ON
+PLUGIN_MATURITY Beta
+PLUGIN_AUTH_VERSION 1.0-alpha
+create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
+show grants for test1@localhost;
+Grants for test1@localhost
+GRANT USAGE ON *.* TO 'test1'@'localhost' IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'
+connect(localhost,test1,public,test,PORT,SOCKET);
+ERROR 28000: Access denied for user 'test1'@'localhost' (using password: YES)
+select current_user();
+current_user()
+test1@localhost
+drop user test1@localhost;
+uninstall plugin ed25519;
+select ed25519_password("foo");
+ERROR HY000: Can't initialize function 'ed25519_password'; Authentication plugin ed25519 is not loaded
+drop function ed25519_password;
diff --git a/mysql-test/suite/plugins/r/auth_v0100.result b/mysql-test/suite/plugins/r/auth_v0100.result
index a72b8e209b0..325d3dd882c 100644
--- a/mysql-test/suite/plugins/r/auth_v0100.result
+++ b/mysql-test/suite/plugins/r/auth_v0100.result
@@ -4,6 +4,7 @@ plugin_type='authentication' and plugin_library is not null order by plugin_name
plugin_name plugin_type_version
auth_0x0100 1.0
create user tt identified via auth_0x0100;
+create user zzzzzzzzzzzzzzzz;
grant select on test.* to zzzzzzzzzzzzzzzz;
connect(localhost,tt,,test,MASTER_MYPORT,MASTER_MYSOCK);
ERROR 28000: Access denied for user 'tt'@'localhost' (using password: YES)
diff --git a/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result b/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result
new file mode 100644
index 00000000000..6c960ee325c
--- /dev/null
+++ b/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result
@@ -0,0 +1,19 @@
+INSTALL SONAME "simple_password_check";
+SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME='simple_password_check';
+PLUGIN_NAME
+simple_password_check
+#
+# MDEV-14031 Password policy causes replication failure
+#
+CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
+CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
+ERROR HY000: Your password does not satisfy the current policy requirements
+DROP USER user1@localhost;
+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 USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85'
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP USER user1@localhost
+UNINSTALL PLUGIN simple_password_check;
diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result
new file mode 100644
index 00000000000..6b4e30b3d81
--- /dev/null
+++ b/mysql-test/suite/plugins/r/cracklib_password_check.result
@@ -0,0 +1,50 @@
+install soname "cracklib_password_check";
+select * from information_schema.plugins where plugin_name='cracklib_password_check';
+PLUGIN_NAME cracklib_password_check
+PLUGIN_VERSION 1.0
+PLUGIN_STATUS ACTIVE
+PLUGIN_TYPE PASSWORD VALIDATION
+PLUGIN_TYPE_VERSION 1.0
+PLUGIN_LIBRARY cracklib_password_check.so
+PLUGIN_LIBRARY_VERSION 1.13
+PLUGIN_AUTHOR Sergei Golubchik
+PLUGIN_DESCRIPTION Password validation via CrackLib
+PLUGIN_LICENSE GPL
+LOAD_OPTION ON
+PLUGIN_MATURITY Stable
+PLUGIN_AUTH_VERSION 1.0
+grant select on *.* to foocar identified by 'foocar';
+ERROR HY000: Your password does not satisfy the current policy requirements
+show warnings;
+Level Code Message
+Warning 1819 cracklib: it is based on your username
+Error 1819 Your password does not satisfy the current policy requirements
+grant select on *.* to foocar identified by 'racoof';
+ERROR HY000: Your password does not satisfy the current policy requirements
+show warnings;
+Level Code Message
+Warning 1819 cracklib: it is based on your username
+Error 1819 Your password does not satisfy the current policy requirements
+grant select on *.* to foo@barbar identified by 'barbar';
+ERROR HY000: Your password does not satisfy the current policy requirements
+show warnings;
+Level Code Message
+Warning 1819 cracklib: it does not contain enough DIFFERENT characters
+Error 1819 Your password does not satisfy the current policy requirements
+grant select on *.* to foobar identified by 'qwerty';
+ERROR HY000: Your password does not satisfy the current policy requirements
+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
+grant select on *.* to foobar identified by 'q$%^&*rty';
+drop user foobar;
+#
+# MDEV-9851: CREATE USER w/o IDENTIFIED BY clause causes crash
+# when using cracklib plugin
+#
+create user 'newuser'@'localhost';
+ERROR HY000: Your password does not satisfy the current policy requirements
+uninstall plugin cracklib_password_check;
+create user foo1 identified by 'pwd';
+drop user foo1;
diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result
index 9c65f8d6034..881f91e0ac5 100644
--- a/mysql-test/suite/plugins/r/locales.result
+++ b/mysql-test/suite/plugins/r/locales.result
@@ -40,8 +40,8 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU
37 nb_NO Norwegian(Bokml) - Norway 9 7 , . norwegian
38 nl_NL Dutch - The Netherlands 9 9 , dutch
39 pl_PL Polish - Poland 11 12 , polish
-40 pt_BR Portugese - Brazil 9 7 , portuguese
-41 pt_PT Portugese - Portugal 9 7 , portuguese
+40 pt_BR Portuguese - Brazil 9 7 , portuguese
+41 pt_PT Portuguese - Portugal 9 7 , portuguese
42 ro_RO Romanian - Romania 10 8 , . romanian
43 ru_RU Russian - Russia 8 11 , russian
44 ru_UA Russian - Ukraine 8 11 , . russian
@@ -111,3 +111,142 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU
108 zh_HK Chinese - Hong Kong SAR 3 3 . , english
109 el_GR Greek - Greece 11 9 , . greek
110 rm_CH Romansh - Switzerland 9 9 , ' english
+show locales;
+Id Name Description Error_Message_Language
+0 en_US English - United States english
+1 en_GB English - United Kingdom english
+2 ja_JP Japanese - Japan japanese
+3 sv_SE Swedish - Sweden swedish
+4 de_DE German - Germany german
+5 fr_FR French - France french
+6 ar_AE Arabic - United Arab Emirates english
+7 ar_BH Arabic - Bahrain english
+8 ar_JO Arabic - Jordan english
+9 ar_SA Arabic - Saudi Arabia english
+10 ar_SY Arabic - Syria english
+11 be_BY Belarusian - Belarus english
+12 bg_BG Bulgarian - Bulgaria english
+13 ca_ES Catalan - Catalan english
+14 cs_CZ Czech - Czech Republic czech
+15 da_DK Danish - Denmark danish
+16 de_AT German - Austria german
+17 es_ES Spanish - Spain spanish
+18 et_EE Estonian - Estonia estonian
+19 eu_ES Basque - Basque english
+20 fi_FI Finnish - Finland english
+21 fo_FO Faroese - Faroe Islands english
+22 gl_ES Galician - Galician english
+23 gu_IN Gujarati - India english
+24 he_IL Hebrew - Israel english
+25 hi_IN Hindi - India english
+26 hr_HR Croatian - Croatia english
+27 hu_HU Hungarian - Hungary hungarian
+28 id_ID Indonesian - Indonesia english
+29 is_IS Icelandic - Iceland english
+30 it_CH Italian - Switzerland italian
+31 ko_KR Korean - Korea korean
+32 lt_LT Lithuanian - Lithuania english
+33 lv_LV Latvian - Latvia english
+34 mk_MK Macedonian - FYROM english
+35 mn_MN Mongolia - Mongolian english
+36 ms_MY Malay - Malaysia english
+37 nb_NO Norwegian(Bokml) - Norway norwegian
+38 nl_NL Dutch - The Netherlands dutch
+39 pl_PL Polish - Poland polish
+40 pt_BR Portuguese - Brazil portuguese
+41 pt_PT Portuguese - Portugal portuguese
+42 ro_RO Romanian - Romania romanian
+43 ru_RU Russian - Russia russian
+44 ru_UA Russian - Ukraine russian
+45 sk_SK Slovak - Slovakia slovak
+46 sl_SI Slovenian - Slovenia english
+47 sq_AL Albanian - Albania english
+48 sr_RS Serbian - Serbia serbian
+49 ta_IN Tamil - India english
+50 te_IN Telugu - India english
+51 th_TH Thai - Thailand english
+52 tr_TR Turkish - Turkey english
+53 uk_UA Ukrainian - Ukraine ukrainian
+54 ur_PK Urdu - Pakistan english
+55 vi_VN Vietnamese - Vietnam english
+56 zh_CN Chinese - Peoples Republic of China english
+57 zh_TW Chinese - Taiwan english
+58 ar_DZ Arabic - Algeria english
+59 ar_EG Arabic - Egypt english
+60 ar_IN Arabic - Iran english
+61 ar_IQ Arabic - Iraq english
+62 ar_KW Arabic - Kuwait english
+63 ar_LB Arabic - Lebanon english
+64 ar_LY Arabic - Libya english
+65 ar_MA Arabic - Morocco english
+66 ar_OM Arabic - Oman english
+67 ar_QA Arabic - Qatar english
+68 ar_SD Arabic - Sudan english
+69 ar_TN Arabic - Tunisia english
+70 ar_YE Arabic - Yemen english
+71 de_BE German - Belgium german
+72 de_CH German - Switzerland german
+73 de_LU German - Luxembourg german
+74 en_AU English - Australia english
+75 en_CA English - Canada english
+76 en_IN English - India english
+77 en_NZ English - New Zealand english
+78 en_PH English - Philippines english
+79 en_ZA English - South Africa english
+80 en_ZW English - Zimbabwe english
+81 es_AR Spanish - Argentina spanish
+82 es_BO Spanish - Bolivia spanish
+83 es_CL Spanish - Chile spanish
+84 es_CO Spanish - Columbia spanish
+85 es_CR Spanish - Costa Rica spanish
+86 es_DO Spanish - Dominican Republic spanish
+87 es_EC Spanish - Ecuador spanish
+88 es_GT Spanish - Guatemala spanish
+89 es_HN Spanish - Honduras spanish
+90 es_MX Spanish - Mexico spanish
+91 es_NI Spanish - Nicaragua spanish
+92 es_PA Spanish - Panama spanish
+93 es_PE Spanish - Peru spanish
+94 es_PR Spanish - Puerto Rico spanish
+95 es_PY Spanish - Paraguay spanish
+96 es_SV Spanish - El Salvador spanish
+97 es_US Spanish - United States spanish
+98 es_UY Spanish - Uruguay spanish
+99 es_VE Spanish - Venezuela spanish
+100 fr_BE French - Belgium french
+101 fr_CA French - Canada french
+102 fr_CH French - Switzerland french
+103 fr_LU French - Luxembourg french
+104 it_IT Italian - Italy italian
+105 nl_BE Dutch - Belgium dutch
+106 no_NO Norwegian - Norway norwegian
+107 sv_FI Swedish - Finland swedish
+108 zh_HK Chinese - Hong Kong SAR english
+109 el_GR Greek - Greece greek
+110 rm_CH Romansh - Switzerland english
+show locales like '%spanish%';
+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 'like '%spanish%'' at line 1
+show locales where description like '%spanish%';
+Id Name Description Error_Message_Language
+17 es_ES Spanish - Spain spanish
+81 es_AR Spanish - Argentina spanish
+82 es_BO Spanish - Bolivia spanish
+83 es_CL Spanish - Chile spanish
+84 es_CO Spanish - Columbia spanish
+85 es_CR Spanish - Costa Rica spanish
+86 es_DO Spanish - Dominican Republic spanish
+87 es_EC Spanish - Ecuador spanish
+88 es_GT Spanish - Guatemala spanish
+89 es_HN Spanish - Honduras spanish
+90 es_MX Spanish - Mexico spanish
+91 es_NI Spanish - Nicaragua spanish
+92 es_PA Spanish - Panama spanish
+93 es_PE Spanish - Peru spanish
+94 es_PR Spanish - Puerto Rico spanish
+95 es_PY Spanish - Paraguay spanish
+96 es_SV Spanish - El Salvador spanish
+97 es_US Spanish - United States spanish
+98 es_UY Spanish - Uruguay spanish
+99 es_VE Spanish - Venezuela spanish
+flush locales;
+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 'locales' at line 1
diff --git a/mysql-test/suite/plugins/r/pam_cleartext.result b/mysql-test/suite/plugins/r/pam_cleartext.result
index b9eee74ec3e..824e8329cc3 100644
--- a/mysql-test/suite/plugins/r/pam_cleartext.result
+++ b/mysql-test/suite/plugins/r/pam_cleartext.result
@@ -2,7 +2,7 @@ install plugin pam soname 'auth_pam.so';
create user test_pam identified via pam using 'mariadb_mtr';
create user pam_test;
grant proxy on pam_test to test_pam;
-show variables like 'pam%';
+show variables like 'pam_use_%';
Variable_name Value
pam_use_cleartext_plugin ON
#
diff --git a/mysql-test/suite/plugins/r/qc_info.result b/mysql-test/suite/plugins/r/qc_info.result
index ab646d74511..3115a372930 100644
--- a/mysql-test/suite/plugins/r/qc_info.result
+++ b/mysql-test/suite/plugins/r/qc_info.result
@@ -1,3 +1,5 @@
+set global query_cache_type=ON;
+set local query_cache_type=ON;
set global query_cache_size=1355776;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
@@ -9,10 +11,33 @@ a
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
statement_schema statement_text result_blocks_count result_blocks_size
test select * from t1 1 512
+select @@time_zone into @time_zone;
+select @@default_week_format into @default_week_format;
+select @@character_set_client into @character_set_client;
+select @@character_set_results into @character_set_results;
+select @@sql_mode into @sql_mode;
+select @@div_precision_increment into @div_precision_increment;
+select @@lc_time_names into @lc_time_names;
+select @@max_sort_length into @max_sort_length;
+select @@autocommit into @autocommit;
+select @@group_concat_max_len into @group_concat_max_len;
+select Name into @new_time_zone from mysql.time_zone_name limit 1;
+set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary',character_set_results='utf32',collation_connection='utf32_bin',sql_mode='STRICT_ALL_TABLES',div_precision_increment=7,lc_time_names='ar_SD',autocommit=0, group_concat_max_len=513, max_sort_length=1011;
+select * from t1;
+set time_zone= @time_zone, default_week_format= @default_week_format, character_set_client= @character_set_client,character_set_results= @character_set_results, sql_mode= @sql_mode, div_precision_increment= @div_precision_increment, lc_time_names= @lc_time_names, autocommit= @autocommit, group_concat_max_len= @group_concat_max_len, max_sort_length= @max_sort_length;
+select * from information_schema.query_cache_info;
+STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER
+test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 # 0 0 0 #
+test select * from t1 1 512 # -1 1024 1024 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 #
drop table t1;
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
statement_schema statement_text result_blocks_count result_blocks_size
set global query_cache_size = 0;
select * from information_schema.query_cache_info;
-STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED
+STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER
set global query_cache_size= default;
+set global query_cache_type=default;
+show query_cache_info;
+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 'query_cache_info' at line 1
+flush query_cache_info;
+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 'query_cache_info' at line 1
diff --git a/mysql-test/suite/plugins/r/qc_info_priv.result b/mysql-test/suite/plugins/r/qc_info_priv.result
index c723eca1ec0..9ac01ac31ad 100644
--- a/mysql-test/suite/plugins/r/qc_info_priv.result
+++ b/mysql-test/suite/plugins/r/qc_info_priv.result
@@ -1,3 +1,5 @@
+set global query_cache_type=ON;
+set local query_cache_type=ON;
set global query_cache_size=1355776;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
@@ -9,6 +11,24 @@ a
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
statement_schema statement_text result_blocks_count result_blocks_size
test select * from t1 1 512
+select @@time_zone into @time_zone;
+select @@default_week_format into @default_week_format;
+select @@character_set_client into @character_set_client;
+select @@character_set_results into @character_set_results;
+select @@sql_mode into @sql_mode;
+select @@div_precision_increment into @div_precision_increment;
+select @@lc_time_names into @lc_time_names;
+select @@max_sort_length into @max_sort_length;
+select @@autocommit into @autocommit;
+select @@group_concat_max_len into @group_concat_max_len;
+select Name into @new_time_zone from mysql.time_zone_name limit 1;
+set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary',character_set_results='utf32',collation_connection='utf32_bin',sql_mode='STRICT_ALL_TABLES',div_precision_increment=7,lc_time_names='ar_SD',autocommit=0, group_concat_max_len=513, max_sort_length=1011;
+select * from t1;
+set time_zone= @time_zone, default_week_format= @default_week_format, character_set_client= @character_set_client,character_set_results= @character_set_results, sql_mode= @sql_mode, div_precision_increment= @div_precision_increment, lc_time_names= @lc_time_names, autocommit= @autocommit, group_concat_max_len= @group_concat_max_len, max_sort_length= @max_sort_length;
+select * from information_schema.query_cache_info;
+STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER
+test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 # 0 0 0 #
+test select * from t1 1 512 # -1 1024 1024 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 #
create user mysqltest;
select a from t1;
a
@@ -21,3 +41,4 @@ count(*)
drop user mysqltest;
drop table t1;
set global query_cache_size= default;
+set global query_cache_type=default;
diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result
index 854eb339ce0..dd6cbfce4c4 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.8 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.8 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.13 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.13 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 1
@@ -21,11 +21,12 @@ Name Status Type Library License
EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL
UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL
daemon_example NOT INSTALLED DAEMON libdaemon_example.so GPL
+example_key_management NOT INSTALLED ENCRYPTION example_key_management.so GPL
three_attempts NOT INSTALLED AUTHENTICATION dialog_examples.so GPL
two_questions NOT INSTALLED AUTHENTICATION dialog_examples.so GPL
show status like '%libraries%';
Variable_name Value
-Opened_plugin_libraries 6
+Opened_plugin_libraries 7
show plugins soname where library = 'ha_example.so';
Name Status Type Library License
EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL
diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result
new file mode 100644
index 00000000000..672d0107492
--- /dev/null
+++ b/mysql-test/suite/plugins/r/simple_password_check.result
@@ -0,0 +1,160 @@
+install soname "simple_password_check";
+select * from information_schema.plugins where plugin_name='simple_password_check';
+PLUGIN_NAME simple_password_check
+PLUGIN_VERSION 1.0
+PLUGIN_STATUS ACTIVE
+PLUGIN_TYPE PASSWORD VALIDATION
+PLUGIN_TYPE_VERSION 1.0
+PLUGIN_LIBRARY simple_password_check.so
+PLUGIN_LIBRARY_VERSION 1.13
+PLUGIN_AUTHOR Sergei Golubchik
+PLUGIN_DESCRIPTION Simple password strength checks
+PLUGIN_LICENSE GPL
+LOAD_OPTION ON
+PLUGIN_MATURITY Stable
+PLUGIN_AUTH_VERSION 1.0
+select * from information_schema.system_variables where variable_name like 'simple_password_check%' order by 1;
+VARIABLE_NAME SIMPLE_PASSWORD_CHECK_DIGITS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimal required number of digits
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SIMPLE_PASSWORD_CHECK_LETTERS_SAME_CASE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimal required number of letters of the same letter case.This limit is applied separately to upper-case and lower-case letters
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SIMPLE_PASSWORD_CHECK_MINIMAL_LENGTH
+SESSION_VALUE NULL
+GLOBAL_VALUE 8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimal required password length
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SIMPLE_PASSWORD_CHECK_OTHER_CHARACTERS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimal required number of other (not letters or digits) characters
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+create user foo1 identified by 'pwd';
+ERROR HY000: Your password does not satisfy the current policy requirements
+create user foo1;
+ERROR HY000: Your password does not satisfy the current policy requirements
+grant select on *.* to foo1 identified by 'pwd';
+ERROR HY000: Your password does not satisfy the current policy requirements
+grant select on *.* to `FooBar1!` identified by 'FooBar1!';
+ERROR HY000: Your password does not satisfy the current policy requirements
+grant select on *.* to `BarFoo1!` identified by 'FooBar1!';
+drop user `BarFoo1!`;
+create user foo1 identified by 'aA.12345';
+grant select on *.* to foo1;
+drop user foo1;
+set global simple_password_check_digits=3;
+set global simple_password_check_letters_same_case=3;
+Warnings:
+Warning 1292 Adjusted the value of simple_password_check_minimal_length from 8 to 10
+set global simple_password_check_other_characters=3;
+Warnings:
+Warning 1292 Adjusted the value of simple_password_check_minimal_length from 10 to 12
+show variables like 'simple_password_check_%';
+Variable_name Value
+simple_password_check_digits 3
+simple_password_check_letters_same_case 3
+simple_password_check_minimal_length 12
+simple_password_check_other_characters 3
+create user foo1 identified by '123:qwe:ASD!';
+drop user foo1;
+create user foo1 identified by '-23:qwe:ASD!';
+ERROR HY000: Your password does not satisfy the current policy requirements
+create user foo1 identified by '123:4we:ASD!';
+ERROR HY000: Your password does not satisfy the current policy requirements
+create user foo1 identified by '123:qwe:4SD!';
+ERROR HY000: Your password does not satisfy the current policy requirements
+create user foo1 identified by '123:qwe:ASD4';
+ERROR HY000: Your password does not satisfy the current policy requirements
+create user foo1 identified by '123:qwe:ASD!';
+set password for foo1 = password('qwe:-23:ASD!');
+ERROR HY000: Your password does not satisfy the current policy requirements
+set password for foo1 = old_password('4we:123:ASD!');
+ERROR HY000: Your password does not satisfy the current policy requirements
+set password for foo1 = password('qwe:123:4SD!');
+ERROR HY000: Your password does not satisfy the current policy requirements
+set password for foo1 = old_password('qwe:123:ASD4');
+ERROR HY000: Your password does not satisfy the current policy requirements
+set password for foo1 = password('qwe:123:ASD!');
+select @@strict_password_validation;
+@@strict_password_validation
+1
+set password for foo1 = '';
+ERROR HY000: Your password does not satisfy the current policy requirements
+set password for foo1 = '2222222222222222';
+ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
+set password for foo1 = '11111111111111111111111111111111111111111';
+ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
+create user foo2 identified by password '11111111111111111111111111111111111111111';
+ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
+grant select on *.* to foo2 identified by password '2222222222222222';
+ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
+create user foo2 identified with mysql_native_password using '11111111111111111111111111111111111111111';
+ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
+grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
+ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
+create user foo2 identified with mysql_native_password using '';
+ERROR HY000: Your password does not satisfy the current policy requirements
+grant select on *.* to foo2 identified with mysql_old_password;
+ERROR 28000: Can't find any matching row in the user table
+update mysql.user set password='xxx' where user='foo1';
+set global strict_password_validation=0;
+set password for foo1 = '';
+ERROR HY000: Your password does not satisfy the current policy requirements
+set password for foo1 = '2222222222222222';
+set password for foo1 = '11111111111111111111111111111111111111111';
+create user foo2 identified by password '11111111111111111111111111111111111111111';
+drop user foo2;
+grant select on *.* to foo2 identified by password '2222222222222222';
+drop user foo2;
+create user foo2 identified with mysql_native_password using '11111111111111111111111111111111111111111';
+drop user foo2;
+grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
+drop user foo2;
+set global strict_password_validation=1;
+drop user foo1;
+create role r1;
+drop role r1;
+uninstall plugin simple_password_check;
+create user foo1 identified by 'pwd';
+drop user foo1;
diff --git a/mysql-test/suite/plugins/r/two_password_validations.result b/mysql-test/suite/plugins/r/two_password_validations.result
new file mode 100644
index 00000000000..dc6bab3c2d5
--- /dev/null
+++ b/mysql-test/suite/plugins/r/two_password_validations.result
@@ -0,0 +1,21 @@
+install soname "simple_password_check";
+grant select on *.* to Fff_fff1 identified by '1fff_ffF';
+drop user Fff_fff1;
+install soname "cracklib_password_check";
+grant select on *.* to foobar identified by 'q$%^&*R1234ty';
+drop user foobar;
+grant select on *.* to Fff_fff1 identified by '1fff_ffF';
+ERROR HY000: Your password does not satisfy the current policy requirements
+show warnings;
+Level Code Message
+Warning 1819 cracklib: it does not contain enough DIFFERENT characters
+Error 1819 Your password does not satisfy the current policy requirements
+grant select on *.* to foobar identified by 'q-%^&*rty';
+ERROR HY000: Your password does not satisfy the current policy requirements
+show warnings;
+Level Code Message
+Error 1819 Your password does not satisfy the current policy requirements
+uninstall plugin simple_password_check;
+grant select on *.* to foobar identified by 'q-%^&*rty';
+drop user foobar;
+uninstall plugin cracklib_password_check;
diff --git a/mysql-test/suite/plugins/r/unix_socket.result b/mysql-test/suite/plugins/r/unix_socket.result
index 45bf608cc93..0e08794fbe6 100644
--- a/mysql-test/suite/plugins/r/unix_socket.result
+++ b/mysql-test/suite/plugins/r/unix_socket.result
@@ -27,4 +27,5 @@ USER@localhost @% test
# name does not match = failure
#
delete from mysql.user where user='';
+FLUSH PRIVILEGES;
uninstall plugin unix_socket;
diff --git a/mysql-test/suite/plugins/t/audit_null.test b/mysql-test/suite/plugins/t/audit_null.test
index 3e32154ec3d..199e4ba154e 100644
--- a/mysql-test/suite/plugins/t/audit_null.test
+++ b/mysql-test/suite/plugins/t/audit_null.test
@@ -8,6 +8,7 @@ if (!$ADT_NULL_SO) {
set @old_global_general_log=@@global.general_log;
set global general_log=OFF;
+create user testuser@localhost;
grant select on *.* to testuser@localhost;
--disable_ps_protocol
diff --git a/mysql-test/suite/plugins/t/auth_ed25519.test b/mysql-test/suite/plugins/t/auth_ed25519.test
new file mode 100644
index 00000000000..3e02bdf97d2
--- /dev/null
+++ b/mysql-test/suite/plugins/t/auth_ed25519.test
@@ -0,0 +1,44 @@
+#
+# MDEV-12160 Modern alternative to the SHA1 authentication plugin
+#
+source include/not_embedded.inc;
+if (!$AUTH_ED25519_SO) {
+ skip No auth_ed25519 plugin;
+}
+
+replace_result dll so;
+eval create function ed25519_password returns string soname "$AUTH_ED25519_SO";
+error ER_CANT_INITIALIZE_UDF;
+select ed25519_password();
+error ER_CANT_INITIALIZE_UDF;
+select ed25519_password(1);
+error ER_CANT_INITIALIZE_UDF;
+select ed25519_password("foo", "bar");
+error ER_CANT_INITIALIZE_UDF;
+select ed25519_password("foo");
+
+install soname 'auth_ed25519';
+select ed25519_password("foo");
+select ed25519_password("foobar");
+select ed25519_password("foo bar");
+select ed25519_password(NULL);
+
+replace_result dll so;
+query_vertical select * from information_schema.plugins where plugin_name='ed25519';
+let $pwd=`select ed25519_password("secret")`;
+eval create user test1@localhost identified via ed25519 using '$pwd';
+show grants for test1@localhost;
+
+replace_result $MASTER_MYPORT PORT $MASTER_MYSOCK SOCKET;
+error ER_ACCESS_DENIED_ERROR;
+connect con1, localhost, test1, public;
+connect con1, localhost, test1, secret;
+select current_user();
+disconnect con1;
+connection default;
+
+drop user test1@localhost;
+uninstall plugin ed25519;
+error ER_CANT_INITIALIZE_UDF;
+select ed25519_password("foo");
+drop function ed25519_password;
diff --git a/mysql-test/suite/plugins/t/auth_v0100.test b/mysql-test/suite/plugins/t/auth_v0100.test
index c4333d376d3..5d0f6f40be9 100644
--- a/mysql-test/suite/plugins/t/auth_v0100.test
+++ b/mysql-test/suite/plugins/t/auth_v0100.test
@@ -10,6 +10,7 @@ select plugin_name, plugin_type_version from information_schema.plugins where
plugin_type='authentication' and plugin_library is not null order by plugin_name;
create user tt identified via auth_0x0100;
+create user zzzzzzzzzzzzzzzz;
grant select on test.* to zzzzzzzzzzzzzzzz;
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MASTER_MYPORT MASTER_MYPORT
diff --git a/mysql-test/suite/plugins/t/binlog-simple_plugin_check.test b/mysql-test/suite/plugins/t/binlog-simple_plugin_check.test
new file mode 100644
index 00000000000..773dafe8a81
--- /dev/null
+++ b/mysql-test/suite/plugins/t/binlog-simple_plugin_check.test
@@ -0,0 +1,31 @@
+--source include/not_embedded.inc
+--source include/have_binlog_format_statement.inc
+
+if (!$SIMPLE_PASSWORD_CHECK_SO) {
+ skip No SIMPLE_PASSWORD_CHECK plugin;
+}
+
+INSTALL SONAME "simple_password_check";
+SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME='simple_password_check';
+
+
+--echo #
+--echo # MDEV-14031 Password policy causes replication failure
+--echo #
+
+--disable_query_log
+RESET MASTER; # get rid of previous tests binlog
+--enable_query_log
+
+CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
+
+DROP USER user1@localhost;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+UNINSTALL PLUGIN simple_password_check;
diff --git a/mysql-test/suite/plugins/t/cracklib_password_check.test b/mysql-test/suite/plugins/t/cracklib_password_check.test
new file mode 100644
index 00000000000..89b53b656d6
--- /dev/null
+++ b/mysql-test/suite/plugins/t/cracklib_password_check.test
@@ -0,0 +1,45 @@
+--source include/not_embedded.inc
+
+if (!$CRACKLIB_PASSWORD_CHECK_SO) {
+ skip No CRACKLIB_PASSWORD_CHECK plugin;
+}
+
+install soname "cracklib_password_check";
+
+--vertical_results
+--replace_result .dll .so
+select * from information_schema.plugins where plugin_name='cracklib_password_check';
+--horizontal_results
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foocar identified by 'foocar';
+show warnings;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foocar identified by 'racoof';
+show warnings;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foo@barbar identified by 'barbar';
+show warnings;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foobar identified by 'qwerty';
+show warnings;
+
+grant select on *.* to foobar identified by 'q$%^&*rty';
+drop user foobar;
+
+--echo #
+--echo # MDEV-9851: CREATE USER w/o IDENTIFIED BY clause causes crash
+--echo # when using cracklib plugin
+--echo #
+
+--error ER_NOT_VALID_PASSWORD
+create user 'newuser'@'localhost';
+
+uninstall plugin cracklib_password_check;
+
+create user foo1 identified by 'pwd';
+drop user foo1;
+
diff --git a/mysql-test/suite/plugins/t/locales.test b/mysql-test/suite/plugins/t/locales.test
index 5cfbe697384..a3afe75046f 100644
--- a/mysql-test/suite/plugins/t/locales.test
+++ b/mysql-test/suite/plugins/t/locales.test
@@ -4,4 +4,10 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'lo
}
select * from information_schema.locales;
+show locales;
+--error ER_PARSE_ERROR
+show locales like '%spanish%';
+show locales where description like '%spanish%';
+--error ER_PARSE_ERROR
+flush locales;
diff --git a/mysql-test/suite/plugins/t/pam_cleartext.test b/mysql-test/suite/plugins/t/pam_cleartext.test
index 8476c39fd89..29ed7430649 100644
--- a/mysql-test/suite/plugins/t/pam_cleartext.test
+++ b/mysql-test/suite/plugins/t/pam_cleartext.test
@@ -1,7 +1,7 @@
--source pam_init.inc
-show variables like 'pam%';
+show variables like 'pam_use_%';
--write_file $MYSQLTEST_VARDIR/tmp/pam_good.txt
not very secret challenge
diff --git a/mysql-test/suite/plugins/t/qc_info.test b/mysql-test/suite/plugins/t/qc_info.test
index a081617c524..ef759ce8eb4 100644
--- a/mysql-test/suite/plugins/t/qc_info.test
+++ b/mysql-test/suite/plugins/t/qc_info.test
@@ -8,4 +8,10 @@ set global query_cache_size = 0;
select * from information_schema.query_cache_info;
set global query_cache_size= default;
+set global query_cache_type=default;
+
+--error ER_PARSE_ERROR
+show query_cache_info;
+--error ER_PARSE_ERROR
+flush query_cache_info;
diff --git a/mysql-test/suite/plugins/t/qc_info_init.inc b/mysql-test/suite/plugins/t/qc_info_init.inc
index 9422bd7f141..4f125432876 100644
--- a/mysql-test/suite/plugins/t/qc_info_init.inc
+++ b/mysql-test/suite/plugins/t/qc_info_init.inc
@@ -3,6 +3,8 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'qu
--skip QUERY_CACHE_INFO plugin is not active
}
+set global query_cache_type=ON;
+set local query_cache_type=ON;
set global query_cache_size=1355776;
create table t1 (a int not null);
@@ -10,3 +12,24 @@ insert into t1 values (1),(2),(3);
select * from t1;
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
+select @@time_zone into @time_zone;
+select @@default_week_format into @default_week_format;
+select @@character_set_client into @character_set_client;
+select @@character_set_results into @character_set_results;
+select @@sql_mode into @sql_mode;
+select @@div_precision_increment into @div_precision_increment;
+select @@lc_time_names into @lc_time_names;
+select @@max_sort_length into @max_sort_length;
+select @@autocommit into @autocommit;
+select @@group_concat_max_len into @group_concat_max_len;
+select Name into @new_time_zone from mysql.time_zone_name limit 1;
+set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary',character_set_results='utf32',collation_connection='utf32_bin',sql_mode='STRICT_ALL_TABLES',div_precision_increment=7,lc_time_names='ar_SD',autocommit=0, group_concat_max_len=513, max_sort_length=1011;
+--disable_result_log
+select * from t1;
+--enable_result_log
+set time_zone= @time_zone, default_week_format= @default_week_format, character_set_client= @character_set_client,character_set_results= @character_set_results, sql_mode= @sql_mode, div_precision_increment= @div_precision_increment, lc_time_names= @lc_time_names, autocommit= @autocommit, group_concat_max_len= @group_concat_max_len, max_sort_length= @max_sort_length;
+
+--sorted_result
+--replace_column 5 # 19 # 23 #
+select * from information_schema.query_cache_info;
+
diff --git a/mysql-test/suite/plugins/t/qc_info_priv.test b/mysql-test/suite/plugins/t/qc_info_priv.test
index 31c394107c1..adcf882be9f 100644
--- a/mysql-test/suite/plugins/t/qc_info_priv.test
+++ b/mysql-test/suite/plugins/t/qc_info_priv.test
@@ -12,4 +12,4 @@ drop user mysqltest;
drop table t1;
set global query_cache_size= default;
-
+set global query_cache_type=default;
diff --git a/mysql-test/suite/plugins/t/show_all_plugins.test b/mysql-test/suite/plugins/t/show_all_plugins.test
index 68928bc2b3b..74f9a99aef3 100644
--- a/mysql-test/suite/plugins/t/show_all_plugins.test
+++ b/mysql-test/suite/plugins/t/show_all_plugins.test
@@ -2,6 +2,8 @@ if (!$DIALOG_EXAMPLES_SO) { skip requires dialog_examples.so; }
if (!$HA_EXAMPLE_SO) { skip requires ha_examples.so; }
if (!$LIBDAEMON_EXAMPLE_SO) { skip requires libdaemon_examples.so; }
if (!$UDF_EXAMPLE_SO) { skip requires udf_example.so; }
+if (!$EXAMPLE_KEY_MANAGEMENT_SO) { skip requires example_key_management.so; }
+if (`SELECT VERSION() LIKE '%embedded%'`) { skip Disabled for embedded until MDEV-8664 is resolved; }
flush status;
show status like '%libraries%';
diff --git a/mysql-test/suite/plugins/t/simple_password_check.test b/mysql-test/suite/plugins/t/simple_password_check.test
new file mode 100644
index 00000000000..4965ee492d2
--- /dev/null
+++ b/mysql-test/suite/plugins/t/simple_password_check.test
@@ -0,0 +1,120 @@
+--source include/not_embedded.inc
+
+if (!$SIMPLE_PASSWORD_CHECK_SO) {
+ skip No SIMPLE_PASSWORD_CHECK plugin;
+}
+
+install soname "simple_password_check";
+
+--vertical_results
+--replace_result .dll .so
+select * from information_schema.plugins where plugin_name='simple_password_check';
+
+select * from information_schema.system_variables where variable_name like 'simple_password_check%' order by 1;
+--horizontal_results
+
+--error ER_NOT_VALID_PASSWORD
+create user foo1 identified by 'pwd';
+
+# Create user with no password.
+--error ER_NOT_VALID_PASSWORD
+create user foo1;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foo1 identified by 'pwd';
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to `FooBar1!` identified by 'FooBar1!';
+
+grant select on *.* to `BarFoo1!` identified by 'FooBar1!';
+drop user `BarFoo1!`;
+
+create user foo1 identified by 'aA.12345';
+grant select on *.* to foo1;
+drop user foo1;
+
+set global simple_password_check_digits=3;
+set global simple_password_check_letters_same_case=3;
+set global simple_password_check_other_characters=3;
+show variables like 'simple_password_check_%';
+
+create user foo1 identified by '123:qwe:ASD!';
+drop user foo1;
+
+--error ER_NOT_VALID_PASSWORD
+create user foo1 identified by '-23:qwe:ASD!';
+
+--error ER_NOT_VALID_PASSWORD
+create user foo1 identified by '123:4we:ASD!';
+
+--error ER_NOT_VALID_PASSWORD
+create user foo1 identified by '123:qwe:4SD!';
+
+--error ER_NOT_VALID_PASSWORD
+create user foo1 identified by '123:qwe:ASD4';
+
+create user foo1 identified by '123:qwe:ASD!';
+--error ER_NOT_VALID_PASSWORD
+set password for foo1 = password('qwe:-23:ASD!');
+--error ER_NOT_VALID_PASSWORD
+set password for foo1 = old_password('4we:123:ASD!');
+--error ER_NOT_VALID_PASSWORD
+set password for foo1 = password('qwe:123:4SD!');
+--error ER_NOT_VALID_PASSWORD
+set password for foo1 = old_password('qwe:123:ASD4');
+set password for foo1 = password('qwe:123:ASD!');
+
+# now, strict_password_validation
+select @@strict_password_validation;
+
+--error ER_NOT_VALID_PASSWORD
+set password for foo1 = '';
+--error ER_OPTION_PREVENTS_STATEMENT
+set password for foo1 = '2222222222222222';
+--error ER_OPTION_PREVENTS_STATEMENT
+set password for foo1 = '11111111111111111111111111111111111111111';
+--error ER_OPTION_PREVENTS_STATEMENT
+create user foo2 identified by password '11111111111111111111111111111111111111111';
+--error ER_OPTION_PREVENTS_STATEMENT
+grant select on *.* to foo2 identified by password '2222222222222222';
+--error ER_OPTION_PREVENTS_STATEMENT
+create user foo2 identified with mysql_native_password using '11111111111111111111111111111111111111111';
+--error ER_OPTION_PREVENTS_STATEMENT
+grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
+--error ER_NOT_VALID_PASSWORD
+create user foo2 identified with mysql_native_password using '';
+--error ER_PASSWORD_NO_MATCH
+grant select on *.* to foo2 identified with mysql_old_password;
+
+# direct updates are not protected
+update mysql.user set password='xxx' where user='foo1';
+
+set global strict_password_validation=0;
+
+--error ER_NOT_VALID_PASSWORD
+set password for foo1 = '';
+set password for foo1 = '2222222222222222';
+set password for foo1 = '11111111111111111111111111111111111111111';
+create user foo2 identified by password '11111111111111111111111111111111111111111';
+drop user foo2;
+grant select on *.* to foo2 identified by password '2222222222222222';
+drop user foo2;
+create user foo2 identified with mysql_native_password using '11111111111111111111111111111111111111111';
+drop user foo2;
+grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
+drop user foo2;
+
+set global strict_password_validation=1;
+drop user foo1;
+
+#
+# MDEV-9940 CREATE ROLE blocked by password validation plugin
+#
+create role r1;
+drop role r1;
+
+uninstall plugin simple_password_check;
+
+create user foo1 identified by 'pwd';
+drop user foo1;
+
diff --git a/mysql-test/suite/plugins/t/two_password_validations.test b/mysql-test/suite/plugins/t/two_password_validations.test
new file mode 100644
index 00000000000..89a5c7ae900
--- /dev/null
+++ b/mysql-test/suite/plugins/t/two_password_validations.test
@@ -0,0 +1,38 @@
+--source include/not_embedded.inc
+
+if (!$CRACKLIB_PASSWORD_CHECK_SO) {
+ skip No CRACKLIB_PASSWORD_CHECK plugin;
+}
+
+if (!$SIMPLE_PASSWORD_CHECK_SO) {
+ skip No SIMPLE_PASSWORD_CHECK plugin;
+}
+
+let $only_simple=grant select on *.* to Fff_fff1 identified by '1fff_ffF';
+let $only_crack=grant select on *.* to foobar identified by 'q-%^&*rty';
+
+install soname "simple_password_check";
+
+eval $only_simple;
+drop user Fff_fff1;
+
+install soname "cracklib_password_check";
+
+grant select on *.* to foobar identified by 'q$%^&*R1234ty';
+drop user foobar;
+
+--error ER_NOT_VALID_PASSWORD
+eval $only_simple;
+show warnings;
+
+--error ER_NOT_VALID_PASSWORD
+eval $only_crack;
+show warnings;
+
+uninstall plugin simple_password_check;
+
+eval $only_crack;
+drop user foobar;
+
+uninstall plugin cracklib_password_check;
+
diff --git a/mysql-test/suite/plugins/t/unix_socket.test b/mysql-test/suite/plugins/t/unix_socket.test
index 1522c9b7cbe..bd0323c0274 100644
--- a/mysql-test/suite/plugins/t/unix_socket.test
+++ b/mysql-test/suite/plugins/t/unix_socket.test
@@ -55,6 +55,6 @@ grant SELECT ON test.* TO '' identified via unix_socket;
# restoring mysql.user to the original state.
delete from mysql.user where user='';
+FLUSH PRIVILEGES;
uninstall plugin unix_socket;
--remove_file $MYSQLTEST_VARDIR/tmp/peercred_test.txt
-
diff --git a/mysql-test/suite/roles/acl_statistics.result b/mysql-test/suite/roles/acl_statistics.result
new file mode 100644
index 00000000000..bf74cbf2e85
--- /dev/null
+++ b/mysql-test/suite/roles/acl_statistics.result
@@ -0,0 +1,106 @@
+SHOW STATUS LIKE 'Acl%';
+Variable_name Value
+Acl_column_grants 0
+Acl_database_grants 2
+Acl_function_grants 0
+Acl_procedure_grants 0
+Acl_proxy_users 2
+Acl_role_grants 0
+Acl_roles 0
+Acl_table_grants 0
+Acl_users 4
+SELECT count(*) COLUMN_GRANTS from mysql.columns_priv;
+COLUMN_GRANTS
+0
+SELECT count(*) DATABASE_GRANTS from mysql.db;
+DATABASE_GRANTS
+2
+SELECT count(*) FUNCTION_GRANTS from mysql.procs_priv where routine_type='FUNCTION';
+FUNCTION_GRANTS
+0
+SELECT count(*) PROCEDURE_GRANTS from mysql.procs_priv where routine_type='PROCEDURE';
+PROCEDURE_GRANTS
+0
+SELECT count(*) PROXY_USERS from mysql.proxies_priv;
+PROXY_USERS
+2
+SELECT count(*) ROLE_GRANTS from mysql.roles_mapping;
+ROLE_GRANTS
+0
+SELECT count(*) ROLES from mysql.user where is_role='Y';
+ROLES
+0
+SELECT count(*) TABLE_GRANTS from mysql.tables_priv;
+TABLE_GRANTS
+0
+SELECT count(*) USERS from mysql.user where is_role='N';
+USERS
+4
+CREATE USER u1;
+CREATE ROLE r1;
+CREATE ROLE r2;
+GRANT PROXY ON root TO u1;
+GRANT SELECT ON *.* to u1;
+GRANT SELECT ON *.* to r1;
+GRANT DELETE ON mysql.* to u1;
+GRANT DELETE ON mysql.* to r1;
+GRANT INSERT ON mysql.user to u1;
+GRANT INSERT ON mysql.user to r1;
+GRANT UPDATE (host) ON mysql.user to u1;
+GRANT UPDATE (host) ON mysql.user to r1;
+GRANT r1 to u1;
+GRANT r2 to r1;
+create procedure mysql.test_proc (OUT param1 INT)
+begin
+select COUNT(*) into param1 from mysql.roles_mapping;
+end|
+GRANT EXECUTE ON PROCEDURE mysql.test_proc TO r1;
+GRANT EXECUTE ON PROCEDURE mysql.test_proc TO u1;
+CREATE FUNCTION mysql.test_func (param INT) RETURNS INT
+RETURN (SELECT COUNT(*) FROM mysql.user);
+GRANT EXECUTE ON FUNCTION mysql.test_func TO r1;
+GRANT EXECUTE ON FUNCTION mysql.test_func TO u1;
+GRANT EXECUTE ON FUNCTION mysql.test_func TO r2;
+SHOW STATUS LIKE 'Acl%';
+Variable_name Value
+Acl_column_grants 2
+Acl_database_grants 4
+Acl_function_grants 3
+Acl_procedure_grants 2
+Acl_proxy_users 3
+Acl_role_grants 4
+Acl_roles 2
+Acl_table_grants 2
+Acl_users 5
+SELECT count(*) COLUMN_GRANTS from mysql.columns_priv;
+COLUMN_GRANTS
+2
+SELECT count(*) DATABASE_GRANTS from mysql.db;
+DATABASE_GRANTS
+4
+SELECT count(*) FUNCTION_GRANTS from mysql.procs_priv where routine_type='FUNCTION';
+FUNCTION_GRANTS
+3
+SELECT count(*) PROCEDURE_GRANTS from mysql.procs_priv where routine_type='PROCEDURE';
+PROCEDURE_GRANTS
+2
+SELECT count(*) PROXY_USERS from mysql.proxies_priv;
+PROXY_USERS
+3
+SELECT count(*) ROLE_GRANTS from mysql.roles_mapping;
+ROLE_GRANTS
+4
+SELECT count(*) ROLES from mysql.user where is_role='Y';
+ROLES
+2
+SELECT count(*) TABLE_GRANTS from mysql.tables_priv;
+TABLE_GRANTS
+2
+SELECT count(*) USERS from mysql.user where is_role='N';
+USERS
+5
+DROP PROCEDURE mysql.test_proc;
+DROP FUNCTION mysql.test_func;
+DROP ROLE r2;
+DROP ROLE r1;
+DROP USER u1;
diff --git a/mysql-test/suite/roles/acl_statistics.test b/mysql-test/suite/roles/acl_statistics.test
new file mode 100644
index 00000000000..c76d3760959
--- /dev/null
+++ b/mysql-test/suite/roles/acl_statistics.test
@@ -0,0 +1,66 @@
+# Test case for validating acl statistics for the feedback plugin.
+--source include/not_embedded.inc
+
+# First get a baseline of the initial statistics.
+SHOW STATUS LIKE 'Acl%';
+SELECT count(*) COLUMN_GRANTS from mysql.columns_priv;
+SELECT count(*) DATABASE_GRANTS from mysql.db;
+SELECT count(*) FUNCTION_GRANTS from mysql.procs_priv where routine_type='FUNCTION';
+SELECT count(*) PROCEDURE_GRANTS from mysql.procs_priv where routine_type='PROCEDURE';
+SELECT count(*) PROXY_USERS from mysql.proxies_priv;
+SELECT count(*) ROLE_GRANTS from mysql.roles_mapping;
+SELECT count(*) ROLES from mysql.user where is_role='Y';
+SELECT count(*) TABLE_GRANTS from mysql.tables_priv;
+SELECT count(*) USERS from mysql.user where is_role='N';
+
+# Next add some users, roles and privileges to them.
+CREATE USER u1;
+CREATE ROLE r1;
+CREATE ROLE r2;
+GRANT PROXY ON root TO u1;
+GRANT SELECT ON *.* to u1;
+GRANT SELECT ON *.* to r1;
+GRANT DELETE ON mysql.* to u1;
+GRANT DELETE ON mysql.* to r1;
+GRANT INSERT ON mysql.user to u1;
+GRANT INSERT ON mysql.user to r1;
+GRANT UPDATE (host) ON mysql.user to u1;
+GRANT UPDATE (host) ON mysql.user to r1;
+
+GRANT r1 to u1;
+GRANT r2 to r1;
+
+delimiter |;
+create procedure mysql.test_proc (OUT param1 INT)
+begin
+ select COUNT(*) into param1 from mysql.roles_mapping;
+end|
+delimiter ;|
+GRANT EXECUTE ON PROCEDURE mysql.test_proc TO r1;
+GRANT EXECUTE ON PROCEDURE mysql.test_proc TO u1;
+
+CREATE FUNCTION mysql.test_func (param INT) RETURNS INT
+ RETURN (SELECT COUNT(*) FROM mysql.user);
+GRANT EXECUTE ON FUNCTION mysql.test_func TO r1;
+GRANT EXECUTE ON FUNCTION mysql.test_func TO u1;
+# Extra grant to differentiate procedure from function grants.
+GRANT EXECUTE ON FUNCTION mysql.test_func TO r2;
+
+# Recheck how statistics are updated. Make sure that both the information
+# schema and the actualy physical rows are the same.
+SHOW STATUS LIKE 'Acl%';
+SELECT count(*) COLUMN_GRANTS from mysql.columns_priv;
+SELECT count(*) DATABASE_GRANTS from mysql.db;
+SELECT count(*) FUNCTION_GRANTS from mysql.procs_priv where routine_type='FUNCTION';
+SELECT count(*) PROCEDURE_GRANTS from mysql.procs_priv where routine_type='PROCEDURE';
+SELECT count(*) PROXY_USERS from mysql.proxies_priv;
+SELECT count(*) ROLE_GRANTS from mysql.roles_mapping;
+SELECT count(*) ROLES from mysql.user where is_role='Y';
+SELECT count(*) TABLE_GRANTS from mysql.tables_priv;
+SELECT count(*) USERS from mysql.user where is_role='N';
+
+DROP PROCEDURE mysql.test_proc;
+DROP FUNCTION mysql.test_func;
+DROP ROLE r2;
+DROP ROLE r1;
+DROP USER u1;
diff --git a/mysql-test/suite/roles/admin.result b/mysql-test/suite/roles/admin.result
index ad3d4125252..838f2ea165d 100644
--- a/mysql-test/suite/roles/admin.result
+++ b/mysql-test/suite/roles/admin.result
@@ -1,3 +1,4 @@
+create user foo@localhost;
grant create user on *.* to foo@localhost;
create role role1;
create role role2 with admin current_user;
@@ -72,13 +73,13 @@ show grants for role4;
Grants for role4
GRANT USAGE ON *.* TO 'role4'
select * from information_schema.applicable_roles;
-GRANTEE ROLE_NAME IS_GRANTABLE
-role1 role2 NO
-role1 role3 YES
-role3 role4 YES
-root@localhost role1 YES
-root@localhost role2 YES
-root@localhost role4 YES
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 NO NULL
+role1 role3 YES NULL
+role3 role4 YES NULL
+root@localhost role1 YES NO
+root@localhost role2 YES NO
+root@localhost role4 YES NO
grant role2 to role1 with admin option;
revoke role1 from foo@localhost;
revoke admin option for role4 from role3;
@@ -131,13 +132,13 @@ show grants for role4;
Grants for role4
GRANT USAGE ON *.* TO 'role4'
select * from information_schema.applicable_roles;
-GRANTEE ROLE_NAME IS_GRANTABLE
-role1 role2 YES
-role1 role3 YES
-role3 role4 NO
-root@localhost role1 NO
-root@localhost role2 YES
-root@localhost role4 YES
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 YES NULL
+role1 role3 YES NULL
+role3 role4 NO NULL
+root@localhost role1 NO NO
+root@localhost role2 YES NO
+root@localhost role4 YES NO
grant role1 to role4;
ERROR 28000: Access denied for user 'root'@'localhost'
grant role1 to role4 with admin option;
diff --git a/mysql-test/suite/roles/admin.test b/mysql-test/suite/roles/admin.test
index 03f3449200b..242518eb13d 100644
--- a/mysql-test/suite/roles/admin.test
+++ b/mysql-test/suite/roles/admin.test
@@ -1,5 +1,6 @@
source include/not_embedded.inc;
+create user foo@localhost;
grant create user on *.* to foo@localhost;
########################################
@@ -99,4 +100,3 @@ grant role4 to current_user;
########################################
drop role role1, role2, role3, role4, role5, role6;
drop user foo@localhost;
-
diff --git a/mysql-test/suite/roles/create_and_drop_current.result b/mysql-test/suite/roles/create_and_drop_current.result
index 382e5d10248..7e847677364 100644
--- a/mysql-test/suite/roles/create_and_drop_current.result
+++ b/mysql-test/suite/roles/create_and_drop_current.result
@@ -1,3 +1,4 @@
+create user foo@localhost;
grant create user on *.* to foo@localhost;
create user current_user;
ERROR HY000: Operation CREATE USER failed for CURRENT_USER
diff --git a/mysql-test/suite/roles/create_and_drop_current.test b/mysql-test/suite/roles/create_and_drop_current.test
index 5250ef78f43..7ca8161a30c 100644
--- a/mysql-test/suite/roles/create_and_drop_current.test
+++ b/mysql-test/suite/roles/create_and_drop_current.test
@@ -12,6 +12,7 @@
--source include/not_embedded.inc
+create user foo@localhost;
grant create user on *.* to foo@localhost;
--change_user foo
diff --git a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result
index 2d5891f996e..27149c4bf17 100644
--- a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result
+++ b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result
@@ -1,5 +1,7 @@
use mysql;
alter table user drop column is_role;
+alter table user drop column default_role;
+alter table user drop column max_statement_time;
flush privileges;
create role test_role;
ERROR HY000: Column count of mysql.user is wrong. Expected 44, found 43. Created with MariaDB MYSQL_VERSION_ID, now running MYSQL_VERSION_ID. Please use mysql_upgrade to fix this error.
@@ -8,6 +10,18 @@ ERROR HY000: Operation DROP ROLE failed for 'test_role'
alter table user add column is_role enum('N', 'Y') default 'N' not null
COLLATE utf8_general_ci
after password_expired;
+create role test_role;
+create user test_user@localhost;
+grant test_role to test_user@localhost;
+set default role test_role for root@localhost;
+ERROR HY000: Column count of mysql.user is wrong. Expected 45, found 44. Created with MariaDB MYSQL_VERSION_ID, now running MYSQL_VERSION_ID. Please use mysql_upgrade to fix this error.
+drop role test_role;
+drop user test_user@localhost;
+alter table user add column default_role char(80) binary default '' not null
+COLLATE utf8_general_ci
+after is_role;
+alter table user add max_statement_time decimal(12,6) default 0 not null
+after default_role;
update user set is_role='N';
flush privileges;
create role test_role;
diff --git a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
index fddab717245..ebd75c34ca1 100644
--- a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
+++ b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
@@ -1,9 +1,18 @@
+#
+# Test that SET DEFAULT ROLE doesn't work on old privilege tables
+# that don't have 'default_role' column
+#
source include/not_embedded.inc;
connect (mysql, localhost, root,,);
use mysql;
+#
+# downgrade the table to pre-default-role structure
+#
alter table user drop column is_role;
+alter table user drop column default_role;
+alter table user drop column max_statement_time;
flush privileges;
@@ -16,11 +25,24 @@ alter table user add column is_role enum('N', 'Y') default 'N' not null
COLLATE utf8_general_ci
after password_expired;
-update user set is_role='N';
-
-flush privileges;
+# Test default role column
create role test_role;
+create user test_user@localhost;
+grant test_role to test_user@localhost;
+--replace_regex /10\d\d\d\d/MYSQL_VERSION_ID/
+--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
+set default role test_role for root@localhost;
drop role test_role;
+drop user test_user@localhost;
+alter table user add column default_role char(80) binary default '' not null
+ COLLATE utf8_general_ci
+after is_role;
+alter table user add max_statement_time decimal(12,6) default 0 not null
+after default_role;
+update user set is_role='N';
+flush privileges;
+create role test_role;
+drop role test_role;
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index f11b5565ffe..f2fca91f0ea 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -9,6 +9,7 @@ grant role1 to current_user;
create role role2;
grant insert,select on mysqltest1.t1 to role2;
grant event,execute,trigger on mysqltest1.* to role2;
+create user foo@localhost;
grant create view on mysqltest1.* to foo@localhost;
create role role4;
grant select on mysqltest1.t1 to role4;
@@ -78,6 +79,7 @@ Warnings:
Note 1449 The user specified as a definer ('role4'@'') does not exist
select * from test.v5;
ERROR HY000: The user specified as a definer ('role4'@'') does not exist
+create user role4;
grant select on mysqltest1.t1 to role4;
show create view test.v5;
View Create View character_set_client collation_connection
@@ -86,6 +88,7 @@ Warnings:
Note 1449 The user specified as a definer ('role4'@'') does not exist
select * from test.v5;
ERROR HY000: The user specified as a definer ('role4'@'') does not exist
+flush tables;
show create view test.v5;
View Create View character_set_client collation_connection
v5 CREATE ALGORITHM=UNDEFINED DEFINER=`role4`@`%` SQL SECURITY DEFINER VIEW `test`.`v5` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
@@ -103,7 +106,7 @@ create definer=current_role trigger tr1 before insert on t2 for each row
insert t1 values (111, 222, 333);
show create trigger tr1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-tr1 CREATE DEFINER=`role1` trigger tr1 before insert on t2 for each row
+tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` trigger tr1 before insert on t2 for each row
insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci
set role none;
insert t2 values (11,22,33);
@@ -120,7 +123,7 @@ create definer=role2 trigger tr2 before delete on t2 for each row
insert t1 values (111, 222, 333);
show create trigger tr2;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-tr2 CREATE DEFINER=`role2` trigger tr2 before delete on t2 for each row
+tr2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2` trigger tr2 before delete on t2 for each row
insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci
delete from t2 where a=1;
select * from t1;
@@ -138,7 +141,7 @@ Warnings:
Note 1449 The user specified as a definer ('role3'@'%') does not exist
show create trigger tr3;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-tr3 CREATE DEFINER=`role3`@`%` trigger tr3 before update on t2 for each row
+tr3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role3`@`%` trigger tr3 before update on t2 for each row
insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci
update t2 set b=2 where a=2;
ERROR HY000: The user specified as a definer ('role3'@'%') does not exist
@@ -152,7 +155,7 @@ a b c
flush tables;
show create trigger tr2;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
-tr2 CREATE DEFINER=`role2`@`` trigger tr2 before delete on t2 for each row
+tr2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2`@`` trigger tr2 before delete on t2 for each row
insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci
delete from t2 where a=2;
ERROR HY000: The user specified as a definer ('role2'@'%') does not exist
@@ -169,7 +172,7 @@ set role role1;
create definer=current_role procedure pr1() insert t1 values (111, 222, 333);
show create procedure pr1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pr1 CREATE DEFINER=`role1` PROCEDURE `pr1`()
+pr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr1`()
insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci
set role none;
call pr1();
@@ -181,7 +184,7 @@ a b c
create definer=role2 procedure pr2() insert t1 values (111, 222, 333);
show create procedure pr2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pr2 CREATE DEFINER=`role2` PROCEDURE `pr2`()
+pr2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2` PROCEDURE `pr2`()
insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci
call pr2();
select * from t1;
@@ -195,7 +198,7 @@ Warnings:
Note 1449 The user specified as a definer ('role3'@'%') does not exist
show create procedure pr3;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pr3 CREATE DEFINER=`role3`@`%` PROCEDURE `pr3`()
+pr3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role3`@`%` PROCEDURE `pr3`()
insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci
call pr3();
ERROR HY000: The user specified as a definer ('role3'@'%') does not exist
@@ -212,7 +215,7 @@ set role role1;
create definer=current_role function fn1() returns int return (select sum(a+b) from t1);
show create function fn1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn1 CREATE DEFINER=`role1` FUNCTION `fn1`() RETURNS int(11)
+fn1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` FUNCTION `fn1`() RETURNS int(11)
return (select sum(a+b) from t1) latin1 latin1_swedish_ci latin1_swedish_ci
set role none;
select fn1();
@@ -224,7 +227,7 @@ a b c
create definer=role2 function fn2() returns int return (select sum(a+b) from t1);
show create function fn2;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn2 CREATE DEFINER=`role2` FUNCTION `fn2`() RETURNS int(11)
+fn2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2` FUNCTION `fn2`() RETURNS int(11)
return (select sum(a+b) from t1) latin1 latin1_swedish_ci latin1_swedish_ci
select fn2();
fn2()
@@ -234,7 +237,7 @@ Warnings:
Note 1449 The user specified as a definer ('role3'@'%') does not exist
show create function fn3;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn3 CREATE DEFINER=`role3`@`%` FUNCTION `fn3`() RETURNS int(11)
+fn3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role3`@`%` FUNCTION `fn3`() RETURNS int(11)
return (select sum(a+b) from t1) latin1 latin1_swedish_ci latin1_swedish_ci
select fn3();
ERROR HY000: The user specified as a definer ('role3'@'%') does not exist
@@ -247,7 +250,7 @@ create definer=current_role event e1 on schedule every 1 second starts '2000-01-
insert t1 values (111, 2, 0);
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE DEFINER=`role1` EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 2, 0) latin1 latin1_swedish_ci latin1_swedish_ci
+e1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`role1` EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 2, 0) latin1 latin1_swedish_ci latin1_swedish_ci
set role none;
create definer=role3 event e3 on schedule every 1 second starts '2000-01-01' do
insert t1 values (111, 3, 0);
@@ -255,12 +258,12 @@ Warnings:
Note 1449 The user specified as a definer ('role3'@'%') does not exist
show create event e3;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e3 SYSTEM CREATE DEFINER=`role3`@`%` EVENT `e3` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 3, 0) latin1 latin1_swedish_ci latin1_swedish_ci
+e3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`role3`@`%` EVENT `e3` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 3, 0) latin1 latin1_swedish_ci latin1_swedish_ci
create definer=role2 event e2 on schedule every 1 second starts '2000-01-01' do
insert t1 values (111, 4, 0);
show create event e2;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e2 SYSTEM CREATE DEFINER=`role2` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 4, 0) latin1 latin1_swedish_ci latin1_swedish_ci
+e2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`role2` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 4, 0) latin1 latin1_swedish_ci latin1_swedish_ci
set global event_scheduler=off;
select distinct * from t1;
a b c
@@ -336,7 +339,7 @@ INSERT INTO `t2` VALUES (2,20,200);
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`role1`*/ /*!50003 trigger tr1 before insert on t2 for each row
insert t1 values (111, 222, 333) */;;
@@ -352,7 +355,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`role3`@`%`*/ /*!50003 trigger tr3 before update on t2 for each row
insert t1 values (111, 222, 333) */;;
@@ -368,7 +371,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`role2`@``*/ /*!50003 trigger tr2 before delete on t2 for each row
insert t1 values (111, 222, 333) */;;
@@ -386,7 +389,7 @@ DELIMITER ;;
/*!50003 SET character_set_results = latin1 */ ;;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
-/*!50003 SET sql_mode = '' */ ;;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
/*!50106 CREATE*/ /*!50117 DEFINER=`role1`*/ /*!50106 EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 2, 0) */ ;;
@@ -403,7 +406,7 @@ DELIMITER ;;
/*!50003 SET character_set_results = latin1 */ ;;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
-/*!50003 SET sql_mode = '' */ ;;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
/*!50106 CREATE*/ /*!50117 DEFINER=`role2`*/ /*!50106 EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 4, 0) */ ;;
@@ -420,7 +423,7 @@ DELIMITER ;;
/*!50003 SET character_set_results = latin1 */ ;;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
-/*!50003 SET sql_mode = '' */ ;;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
/*!50106 CREATE*/ /*!50117 DEFINER=`role3`@`%`*/ /*!50106 EVENT `e3` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 3, 0) */ ;;
@@ -438,7 +441,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`role1` FUNCTION `fn1`() RETURNS int(11)
return (select sum(a+b) from t1) ;;
@@ -454,7 +457,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`role2` FUNCTION `fn2`() RETURNS int(11)
return (select sum(a+b) from t1) ;;
@@ -470,7 +473,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`role3`@`%` FUNCTION `fn3`() RETURNS int(11)
return (select sum(a+b) from t1) ;;
@@ -486,7 +489,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`role1` PROCEDURE `pr1`()
insert t1 values (111, 222, 333) ;;
@@ -502,7 +505,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`role2`@`%` PROCEDURE `pr2`()
insert t1 values (111, 222, 333) ;;
@@ -518,7 +521,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = '' */ ;
+/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`role3`@`%` PROCEDURE `pr3`()
insert t1 values (111, 222, 333) ;;
@@ -646,7 +649,7 @@ END;//
set role r2;
show create procedure user1_proc;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-user1_proc CREATE DEFINER=`r2` PROCEDURE `user1_proc`()
+user1_proc NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`r2` PROCEDURE `user1_proc`()
SQL SECURITY INVOKER
BEGIN
SELECT NOW(), VERSION();
@@ -666,7 +669,7 @@ SELECT NOW(), VERSION();
END;//
show create procedure user1_proc2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-user1_proc2 CREATE DEFINER=`r1` PROCEDURE `user1_proc2`()
+user1_proc2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`r1` PROCEDURE `user1_proc2`()
SQL SECURITY INVOKER
BEGIN
SELECT NOW(), VERSION();
@@ -678,7 +681,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
set role r2;
show create procedure user1_proc2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-user1_proc2 CREATE DEFINER=`r1` PROCEDURE `user1_proc2`()
+user1_proc2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`r1` PROCEDURE `user1_proc2`()
SQL SECURITY INVOKER
BEGIN
SELECT NOW(), VERSION();
@@ -713,7 +716,7 @@ END;//
use rtest;
show create procedure sensitive_proc;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sensitive_proc CREATE DEFINER=`user_like_role`@`%` PROCEDURE `sensitive_proc`()
+sensitive_proc NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user_like_role`@`%` PROCEDURE `sensitive_proc`()
SQL SECURITY INVOKER
BEGIN
SELECT NOW(), VERSION();
diff --git a/mysql-test/suite/roles/definer.test b/mysql-test/suite/roles/definer.test
index 1a8be78fea8..89a1c90ee24 100644
--- a/mysql-test/suite/roles/definer.test
+++ b/mysql-test/suite/roles/definer.test
@@ -26,6 +26,7 @@ grant insert,select on mysqltest1.t1 to role2;
grant event,execute,trigger on mysqltest1.* to role2;
# create a non-priv user and a priv role granted to him
+create user foo@localhost;
grant create view on mysqltest1.* to foo@localhost;
create role role4;
grant select on mysqltest1.t1 to role4;
@@ -99,6 +100,7 @@ show create view test.v5;
--error ER_NO_SUCH_USER
select * from test.v5;
+create user role4;
grant select on mysqltest1.t1 to role4;
show create view test.v5;
--error ER_NO_SUCH_USER
@@ -115,6 +117,7 @@ open(F, '>', $f) or die "open(>$f): $!";
syswrite F, $_ or die "syswrite($f): $!"
EOF
+flush tables;
show create view test.v5;
select * from test.v5;
drop user role4;
diff --git a/mysql-test/suite/roles/drop_current_user-5176.result b/mysql-test/suite/roles/drop_current_user-5176.result
index 8e01bb10bd5..ea9f4fa4f92 100644
--- a/mysql-test/suite/roles/drop_current_user-5176.result
+++ b/mysql-test/suite/roles/drop_current_user-5176.result
@@ -1,7 +1,8 @@
+create user foo@localhost;
grant create user on *.* to foo@localhost;
drop user foo@localhost;
select * from information_schema.applicable_roles;
-GRANTEE ROLE_NAME IS_GRANTABLE
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
show grants;
ERROR 42000: There is no such grant defined for user 'foo' on host 'localhost'
select current_user();
diff --git a/mysql-test/suite/roles/drop_current_user-5176.test b/mysql-test/suite/roles/drop_current_user-5176.test
index e022d3e8a86..27051345e8b 100644
--- a/mysql-test/suite/roles/drop_current_user-5176.test
+++ b/mysql-test/suite/roles/drop_current_user-5176.test
@@ -3,6 +3,7 @@
#
--source include/not_embedded.inc
+create user foo@localhost;
grant create user on *.* to foo@localhost;
--connect (foo,localhost,foo,,)
drop user foo@localhost;
diff --git a/mysql-test/suite/roles/grant-5771.result b/mysql-test/suite/roles/grant-5771.result
index 4921641f3a5..5d79820e7a0 100644
--- a/mysql-test/suite/roles/grant-5771.result
+++ b/mysql-test/suite/roles/grant-5771.result
@@ -1,5 +1,6 @@
create database mysqltest1;
create database mysqltest2;
+create user foo@localhost;
create role r1, r2;
grant all on mysqltest1.* to r1;
grant all on mysqltest2.* to r2;
diff --git a/mysql-test/suite/roles/grant-5771.test b/mysql-test/suite/roles/grant-5771.test
index 84c625a6067..3c8f5d2f7c0 100644
--- a/mysql-test/suite/roles/grant-5771.test
+++ b/mysql-test/suite/roles/grant-5771.test
@@ -6,6 +6,7 @@
create database mysqltest1;
create database mysqltest2;
+create user foo@localhost;
create role r1, r2;
grant all on mysqltest1.* to r1;
grant all on mysqltest2.* to r2;
diff --git a/mysql-test/suite/roles/grant_revoke_current.result b/mysql-test/suite/roles/grant_revoke_current.result
index 644454685b4..d9798463965 100644
--- a/mysql-test/suite/roles/grant_revoke_current.result
+++ b/mysql-test/suite/roles/grant_revoke_current.result
@@ -24,4 +24,19 @@ revoke all, grant option from current_role;
show grants for current_role;
Grants for r1
GRANT USAGE ON *.* TO 'r1'
+set password=password('foobar');
+show grants;
+Grants for root@localhost
+GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO 'r1'
+grant r1 to current_user() identified by 'barfoo';
+show grants;
+Grants for root@localhost
+GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO 'r1'
+set password='';
drop role r1;
diff --git a/mysql-test/suite/roles/grant_revoke_current.test b/mysql-test/suite/roles/grant_revoke_current.test
index 96a27fd5697..0ebe0170782 100644
--- a/mysql-test/suite/roles/grant_revoke_current.test
+++ b/mysql-test/suite/roles/grant_revoke_current.test
@@ -20,5 +20,10 @@ show grants for current_role;
revoke all, grant option from current_role;
show grants for current_role;
-drop role r1;
+set password=password('foobar');
+show grants;
+grant r1 to current_user() identified by 'barfoo';
+show grants;
+set password='';
+drop role r1;
diff --git a/mysql-test/suite/roles/grant_role_auto_create_user.result b/mysql-test/suite/roles/grant_role_auto_create_user.result
index 81b25e5f527..dee07aa6b3c 100644
--- a/mysql-test/suite/roles/grant_role_auto_create_user.result
+++ b/mysql-test/suite/roles/grant_role_auto_create_user.result
@@ -1,8 +1,11 @@
create database db;
create role auto_create;
+create user auto_create;
grant all on db.* to auto_create;
+create user foo@localhost;
grant auto_create to foo@localhost;
-grant auto_create to bar@localhost identified by 'baz';
+create user bar@localhost identified by 'baz';
+grant auto_create to bar@localhost;
set role 'auto_create';
use db;
create table t1 (i int);
@@ -60,4 +63,5 @@ ERROR 42000: You are not allowed to create a user with GRANT
drop user foo@localhost;
drop user bar@localhost;
drop role auto_create;
+drop user auto_create;
drop database db;
diff --git a/mysql-test/suite/roles/grant_role_auto_create_user.test b/mysql-test/suite/roles/grant_role_auto_create_user.test
index d2489a4ea74..e673934775e 100644
--- a/mysql-test/suite/roles/grant_role_auto_create_user.test
+++ b/mysql-test/suite/roles/grant_role_auto_create_user.test
@@ -5,10 +5,12 @@
create database db;
create role auto_create;
+create user auto_create;
grant all on db.* to auto_create;
-
+create user foo@localhost;
grant auto_create to foo@localhost;
-grant auto_create to bar@localhost identified by 'baz';
+create user bar@localhost identified by 'baz';
+grant auto_create to bar@localhost;
# Test if the users have been created and the role has been granted to them
--connect (con1,localhost,foo,,)
@@ -117,5 +119,5 @@ grant auto_create to foo2@localhost identified by 'pass';
drop user foo@localhost;
drop user bar@localhost;
drop role auto_create;
+drop user auto_create;
drop database db;
-
diff --git a/mysql-test/suite/roles/i_s_applicable_roles_is_default.result b/mysql-test/suite/roles/i_s_applicable_roles_is_default.result
new file mode 100644
index 00000000000..63127f8b176
--- /dev/null
+++ b/mysql-test/suite/roles/i_s_applicable_roles_is_default.result
@@ -0,0 +1,80 @@
+create user foo;
+create role role1;
+create role role2;
+create role role3;
+grant role1 to foo;
+grant role2 to role1;
+grant role3 to foo;
+connect foo, localhost, foo;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+foo@% role1 NO NO
+foo@% role3 NO NO
+role1 role2 NO NULL
+set default role role3;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+foo@% role1 NO NO
+foo@% role3 NO YES
+role1 role2 NO NULL
+set default role role1;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+foo@% role1 NO YES
+foo@% role3 NO NO
+role1 role2 NO NULL
+disconnect foo;
+connection default;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 NO NULL
+root@localhost role1 YES NO
+root@localhost role2 YES NO
+root@localhost role3 YES NO
+set default role none for foo;
+connect foo, localhost, foo;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+foo@% role1 NO NO
+foo@% role3 NO NO
+role1 role2 NO NULL
+disconnect foo;
+connection default;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 NO NULL
+root@localhost role1 YES NO
+root@localhost role2 YES NO
+root@localhost role3 YES NO
+set default role role1;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 NO NULL
+root@localhost role1 YES YES
+root@localhost role2 YES NO
+root@localhost role3 YES NO
+set default role role2;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 NO NULL
+root@localhost role1 YES NO
+root@localhost role2 YES YES
+root@localhost role3 YES NO
+set default role role3;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 NO NULL
+root@localhost role1 YES NO
+root@localhost role2 YES NO
+root@localhost role3 YES YES
+set default role none;
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+role1 role2 NO NULL
+root@localhost role1 YES NO
+root@localhost role2 YES NO
+root@localhost role3 YES NO
+drop role role3;
+drop role role2;
+drop role role1;
+drop user foo;
diff --git a/mysql-test/suite/roles/i_s_applicable_roles_is_default.test b/mysql-test/suite/roles/i_s_applicable_roles_is_default.test
new file mode 100644
index 00000000000..4a844e39b87
--- /dev/null
+++ b/mysql-test/suite/roles/i_s_applicable_roles_is_default.test
@@ -0,0 +1,63 @@
+--source include/not_embedded.inc
+--enable_connect_log
+create user foo;
+create role role1;
+create role role2;
+create role role3;
+
+grant role1 to foo;
+grant role2 to role1;
+grant role3 to foo;
+
+
+connect (foo, localhost, foo);
+--sorted_result
+select * from information_schema.applicable_roles;
+
+set default role role3;
+--sorted_result
+select * from information_schema.applicable_roles;
+
+set default role role1;
+--sorted_result
+select * from information_schema.applicable_roles;
+
+
+disconnect foo;
+connection default;
+
+--sorted_result
+select * from information_schema.applicable_roles;
+
+set default role none for foo;
+connect (foo, localhost, foo);
+--sorted_result
+select * from information_schema.applicable_roles;
+
+disconnect foo;
+connection default;
+
+--sorted_result
+select * from information_schema.applicable_roles;
+
+set default role role1;
+--sorted_result
+select * from information_schema.applicable_roles;
+
+set default role role2;
+--sorted_result
+select * from information_schema.applicable_roles;
+
+set default role role3;
+--sorted_result
+select * from information_schema.applicable_roles;
+
+
+set default role none;
+--sorted_result
+select * from information_schema.applicable_roles;
+
+drop role role3;
+drop role role2;
+drop role role1;
+drop user foo;
diff --git a/mysql-test/suite/roles/password.result b/mysql-test/suite/roles/password.result
index 041a049ccec..2d54db2ca64 100644
--- a/mysql-test/suite/roles/password.result
+++ b/mysql-test/suite/roles/password.result
@@ -1,3 +1,4 @@
+set sql_mode='';
create role r1;
grant select on *.* to r1 identified by 'foobar';
drop user r1;
@@ -10,25 +11,25 @@ ERROR HY000: Plugin 'plugin' is not loaded
grant select on mysql.user to r1 identified via plugin using 'param';
ERROR HY000: Plugin 'plugin' is not loaded
grant select on *.* to r1 require subject 'foobar';
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on mysql.user to r1 require issuer 'foobar';
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on *.* to r1 require cipher 'foobar';
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on mysql.user to r1 require ssl;
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on *.* to r1 require x509;
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on mysql.user to r1 require none;
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on *.* to r1 with max_queries_per_hour 10;
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on mysql.user to r1 with max_updates_per_hour 10;
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on *.* to r1 with max_connections_per_hour 10;
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
grant select on mysql.user to r1 with max_user_connections 10;
-ERROR 28000: Can't find any matching row in the user table
+drop user r1;
set password for r1 = '00000000000000000000000000000000000000000';
ERROR 28000: Can't find any matching row in the user table
drop role r1;
diff --git a/mysql-test/suite/roles/password.test b/mysql-test/suite/roles/password.test
index f638c5f39be..e5fff01ddbc 100644
--- a/mysql-test/suite/roles/password.test
+++ b/mysql-test/suite/roles/password.test
@@ -10,6 +10,7 @@
# max_queries_per_hour | max_updates_per_hour | max_connections_per_hour | max_user_connections
#set password for ... = ...
+set sql_mode='';
create role r1;
# IDENTIFIED does not apply to roles, using it forces username context
@@ -24,26 +25,28 @@ grant select on *.* to r1 identified via plugin;
--error ER_PLUGIN_IS_NOT_LOADED
grant select on mysql.user to r1 identified via plugin using 'param';
---error ER_PASSWORD_NO_MATCH
+# same for REQUIRE and mqh
grant select on *.* to r1 require subject 'foobar';
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on mysql.user to r1 require issuer 'foobar';
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on *.* to r1 require cipher 'foobar';
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on mysql.user to r1 require ssl;
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on *.* to r1 require x509;
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on mysql.user to r1 require none;
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on *.* to r1 with max_queries_per_hour 10;
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on mysql.user to r1 with max_updates_per_hour 10;
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on *.* to r1 with max_connections_per_hour 10;
---error ER_PASSWORD_NO_MATCH
+drop user r1;
grant select on mysql.user to r1 with max_user_connections 10;
+drop user r1;
+
--error ER_PASSWORD_NO_MATCH
set password for r1 = '00000000000000000000000000000000000000000';
diff --git a/mysql-test/suite/roles/prepare_stmt_with_role.result b/mysql-test/suite/roles/prepare_stmt_with_role.result
new file mode 100644
index 00000000000..e859b2e304b
--- /dev/null
+++ b/mysql-test/suite/roles/prepare_stmt_with_role.result
@@ -0,0 +1,107 @@
+#
+# Test user to check if we can grant the created role to it.
+#
+create user test_user;
+#
+# First create the role.
+#
+SET @createRole = 'CREATE ROLE developers';
+PREPARE stmtCreateRole FROM @createRole;
+EXECUTE stmtCreateRole;
+#
+# Test to see if the role is created.
+#
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+user host is_role
+developers Y
+SHOW GRANTS;
+Grants for root@localhost
+GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+# Test reexecution.
+EXECUTE stmtCreateRole;
+ERROR HY000: Operation CREATE ROLE failed for 'developers'
+#
+# Now grant the role to the test user.
+#
+SET @grantRole = 'GRANT developers to test_user';
+PREPARE stmtGrantRole FROM @grantRole;
+EXECUTE stmtGrantRole;
+# Test reexecution.
+EXECUTE stmtGrantRole;
+#
+# We should see 2 entries in the roles_mapping table.
+#
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+% test_user developers N
+localhost root developers Y
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT developers TO 'test_user'@'%'
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Test revoking a role.
+#
+SET @revokeRole = 'REVOKE developers FROM test_user';
+PREPARE stmtRevokeRole FROM @revokeRole;
+EXECUTE stmtRevokeRole;
+EXECUTE stmtRevokeRole;
+ERROR HY000: Cannot revoke role 'developers' from: 'test_user'@'%'.
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+EXECUTE stmtGrantRole;
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT developers TO 'test_user'@'%'
+GRANT USAGE ON *.* TO 'test_user'@'%'
+EXECUTE stmtRevokeRole;
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Now drop the role.
+#
+SET @dropRole = 'DROP ROLE developers';
+PREPARE stmtDropRole FROM @dropRole;
+EXECUTE stmtDropRole;
+#
+# Check both user and roles_mapping table for traces of our role.
+#
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+user host is_role
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+SHOW GRANTS;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Test reexecution.
+#
+EXECUTE stmtCreateRole;
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+user host is_role
+developers Y
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+localhost root developers Y
+SHOW GRANTS;
+Grants for root@localhost
+GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+EXECUTE stmtDropRole;
+# Cleanup.
+DROP USER test_user;
diff --git a/mysql-test/suite/roles/prepare_stmt_with_role.test b/mysql-test/suite/roles/prepare_stmt_with_role.test
new file mode 100644
index 00000000000..516e9ddab34
--- /dev/null
+++ b/mysql-test/suite/roles/prepare_stmt_with_role.test
@@ -0,0 +1,85 @@
+--source include/not_embedded.inc
+
+
+--echo #
+--echo # Test user to check if we can grant the created role to it.
+--echo #
+create user test_user;
+--echo #
+--echo # First create the role.
+--echo #
+SET @createRole = 'CREATE ROLE developers';
+PREPARE stmtCreateRole FROM @createRole;
+EXECUTE stmtCreateRole;
+--echo #
+--echo # Test to see if the role is created.
+--echo #
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+SHOW GRANTS;
+
+--echo # Test reexecution.
+--error ER_CANNOT_USER
+EXECUTE stmtCreateRole;
+
+--echo #
+--echo # Now grant the role to the test user.
+--echo #
+SET @grantRole = 'GRANT developers to test_user';
+PREPARE stmtGrantRole FROM @grantRole;
+EXECUTE stmtGrantRole;
+--echo # Test reexecution.
+EXECUTE stmtGrantRole;
+
+--echo #
+--echo # We should see 2 entries in the roles_mapping table.
+--echo #
+--sorted_result
+SELECT * FROM mysql.roles_mapping;
+SHOW GRANTS FOR test_user;
+
+--echo #
+--echo # Test revoking a role.
+--echo #
+SET @revokeRole = 'REVOKE developers FROM test_user';
+PREPARE stmtRevokeRole FROM @revokeRole;
+EXECUTE stmtRevokeRole;
+--error ER_CANNOT_REVOKE_ROLE
+EXECUTE stmtRevokeRole;
+SHOW GRANTS FOR test_user;
+
+EXECUTE stmtGrantRole;
+SHOW GRANTS FOR test_user;
+EXECUTE stmtRevokeRole;
+SHOW GRANTS FOR test_user;
+
+--echo #
+--echo # Now drop the role.
+--echo #
+SET @dropRole = 'DROP ROLE developers';
+PREPARE stmtDropRole FROM @dropRole;
+EXECUTE stmtDropRole;
+
+--echo #
+--echo # Check both user and roles_mapping table for traces of our role.
+--echo #
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+SELECT * FROM mysql.roles_mapping;
+SHOW GRANTS;
+SHOW GRANTS FOR test_user;
+
+--echo #
+--echo # Test reexecution.
+--echo #
+EXECUTE stmtCreateRole;
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+SELECT * FROM mysql.roles_mapping;
+
+SHOW GRANTS;
+SHOW GRANTS FOR test_user;
+EXECUTE stmtDropRole;
+
+--echo # Cleanup.
+DROP USER test_user;
diff --git a/mysql-test/suite/roles/recursive.result b/mysql-test/suite/roles/recursive.result
index ef40c97865f..7abbd01240e 100644
--- a/mysql-test/suite/roles/recursive.result
+++ b/mysql-test/suite/roles/recursive.result
@@ -28,18 +28,18 @@ Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT role10 TO 'foo'@'localhost'
select * from information_schema.applicable_roles;
-GRANTEE ROLE_NAME IS_GRANTABLE
-foo@localhost role10 NO
-role10 role9 NO
-role2 role1 NO
-role4 role2 NO
-role5 role2 NO
-role5 role3 NO
-role6 role4 NO
-role6 role5 NO
-role7 role5 NO
-role9 role6 NO
-role9 role7 NO
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+foo@localhost role10 NO NO
+role10 role9 NO NULL
+role2 role1 NO NULL
+role4 role2 NO NULL
+role5 role2 NO NULL
+role5 role3 NO NULL
+role6 role4 NO NULL
+role6 role5 NO NULL
+role7 role5 NO NULL
+role9 role6 NO NULL
+role9 role7 NO NULL
show status like 'debug%';
Variable_name Value
grant select on *.* to role1;
diff --git a/mysql-test/suite/roles/recursive_dbug.result b/mysql-test/suite/roles/recursive_dbug.result
index 1d857a5c888..ea65a842eb0 100644
--- a/mysql-test/suite/roles/recursive_dbug.result
+++ b/mysql-test/suite/roles/recursive_dbug.result
@@ -32,18 +32,18 @@ Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT role10 TO 'foo'@'localhost'
select * from information_schema.applicable_roles;
-GRANTEE ROLE_NAME IS_GRANTABLE
-foo@localhost role10 NO
-role10 role9 NO
-role2 role1 NO
-role4 role2 NO
-role5 role2 NO
-role5 role3 NO
-role6 role4 NO
-role6 role5 NO
-role7 role5 NO
-role9 role6 NO
-role9 role7 NO
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+foo@localhost role10 NO NO
+role10 role9 NO NULL
+role2 role1 NO NULL
+role4 role2 NO NULL
+role5 role2 NO NULL
+role5 role3 NO NULL
+role6 role4 NO NULL
+role6 role5 NO NULL
+role7 role5 NO NULL
+role9 role6 NO NULL
+role9 role7 NO NULL
show status like 'debug%';
Variable_name Value
Debug_role_merges_global 11
diff --git a/mysql-test/suite/roles/rpl_definer.result b/mysql-test/suite/roles/rpl_definer.result
index eadb6315d9b..c9e4f66a267 100644
--- a/mysql-test/suite/roles/rpl_definer.result
+++ b/mysql-test/suite/roles/rpl_definer.result
@@ -21,19 +21,19 @@ create definer=current_role procedure pcr() select current_role;
create definer=role1 procedure pr() select "role1";
show create procedure pcu;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pcu CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`()
+pcu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`()
select current_user latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure pu;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pu CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`()
+pu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`()
select "root@localhost" latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure pcr;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pcr CREATE DEFINER=`role1` PROCEDURE `pcr`()
+pcr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pcr`()
select current_role latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure pr;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pr CREATE DEFINER=`role1` PROCEDURE `pr`()
+pr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr`()
select "role1" latin1 latin1_swedish_ci latin1_swedish_ci
[connection slave]
set role role1;
@@ -49,19 +49,19 @@ GRANT role2 TO 'role1'
GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION
show create procedure pcu;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pcu CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`()
+pcu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`()
select current_user latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure pu;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pu CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`()
+pu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`()
select "root@localhost" latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure pcr;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pcr CREATE DEFINER=`role1` PROCEDURE `pcr`()
+pcr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pcr`()
select current_role latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure pr;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-pr CREATE DEFINER=`role1` PROCEDURE `pr`()
+pr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr`()
select "role1" latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure pcu;
drop procedure pu;
diff --git a/mysql-test/suite/roles/set_default_role_clear.result b/mysql-test/suite/roles/set_default_role_clear.result
new file mode 100644
index 00000000000..382d3d27c70
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_clear.result
@@ -0,0 +1,35 @@
+create user test_user@localhost;
+create role test_role;
+grant select on *.* to test_role;
+grant test_role to test_user@localhost;
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+set default role test_role;
+select user, host, default_role from mysql.user;
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+select user, host, default_role from mysql.user where user='test_user';
+user host default_role
+test_user localhost test_role
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO 'test_role'
+select user, host, default_role from mysql.user where user='test_user';
+user host default_role
+test_user localhost test_role
+set default role NONE;
+select user, host, default_role from mysql.user where user='test_user';
+user host default_role
+test_user localhost
+set default role invalid_role;
+ERROR OP000: Invalid role specification `invalid_role`.
+select user, host, default_role from mysql.user where user='test_user';
+user host default_role
+test_user localhost
+select user, host, default_role from mysql.user;
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+drop role test_role;
+drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_clear.test b/mysql-test/suite/roles/set_default_role_clear.test
new file mode 100644
index 00000000000..32c9661c573
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_clear.test
@@ -0,0 +1,52 @@
+source include/not_embedded.inc;
+
+# This test checks clearing a default role from a user.
+
+# Create a user with no privileges
+create user test_user@localhost;
+
+create role test_role;
+
+grant select on *.* to test_role;
+grant test_role to test_user@localhost;
+
+change_user 'test_user';
+show grants;
+set default role test_role;
+
+# Even though a user has the default role set, without reconnecting, we should
+# not already have the roles privileges.
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user;
+
+change_user 'root';
+select user, host, default_role from mysql.user where user='test_user';
+
+change_user 'test_user';
+# This should show that the new test_user has the role's grants enabled.
+show grants;
+select user, host, default_role from mysql.user where user='test_user';
+
+set default role NONE;
+
+# We should still have the role set right now.
+select user, host, default_role from mysql.user where user='test_user';
+
+# Make sure we do not somehow get privileges to set an invalid role
+--error ER_INVALID_ROLE
+set default role invalid_role;
+
+change_user 'root';
+select user, host, default_role from mysql.user where user='test_user';
+
+change_user 'test_user';
+# The user does not have a default role set anymore. Make sure we don't still
+# get the privileges.
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user;
+
+change_user 'root';
+
+# Cleanup
+drop role test_role;
+drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_for.result b/mysql-test/suite/roles/set_default_role_for.result
new file mode 100644
index 00000000000..7289319a428
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_for.result
@@ -0,0 +1,65 @@
+create user user_a@localhost;
+create user user_b@localhost;
+create role role_a;
+create role role_b;
+grant role_a to user_a@localhost;
+grant role_b to user_b@localhost;
+grant role_a to user_a@localhost;
+grant select on *.* to role_a;
+grant role_b to user_b@localhost;
+grant insert, update on *.* to role_b;
+set default role role_a for user_b@localhost;
+ERROR 42000: Access denied for user 'user_a'@'localhost' to database 'mysql'
+set default role role_a for user_a@localhost;
+set default role invalid_role for user_a@localhost;
+ERROR OP000: Invalid role specification `invalid_role`.
+set default role role_b for user_a@localhost;
+ERROR OP000: Invalid role specification `role_b`.
+set default role role_b for user_b@localhost;
+show grants;
+Grants for user_a@localhost
+GRANT role_a TO 'user_a'@'localhost'
+GRANT USAGE ON *.* TO 'user_a'@'localhost'
+GRANT SELECT ON *.* TO 'role_a'
+select user, host, default_role from mysql.user where user like 'user_%';
+user host default_role
+user_a localhost role_a
+user_b localhost role_b
+set default role NONE for current_user;
+select user, host, default_role from mysql.user where user like 'user_%';
+user host default_role
+user_a localhost
+user_b localhost role_b
+set default role current_role for current_user;
+select user, host, default_role from mysql.user where user like 'user_%';
+user host default_role
+user_a localhost role_a
+user_b localhost role_b
+set default role role_b for current_user;
+ERROR OP000: Invalid role specification `role_b`.
+show grants;
+Grants for user_b@localhost
+GRANT role_b TO 'user_b'@'localhost'
+GRANT USAGE ON *.* TO 'user_b'@'localhost'
+GRANT INSERT, UPDATE ON *.* TO 'role_b'
+select user, host, default_role from mysql.user where user like 'user_%';
+ERROR 42000: SELECT command denied to user 'user_b'@'localhost' for table 'user'
+insert into mysql.user (user, host) values ('someuser', 'somehost');
+Warnings:
+Warning 1364 Field 'ssl_cipher' doesn't have a default value
+Warning 1364 Field 'x509_issuer' doesn't have a default value
+Warning 1364 Field 'x509_subject' doesn't have a default value
+Warning 1364 Field 'authentication_string' doesn't have a default value
+set default role NONE for user_a@localhost;
+show grants;
+Grants for user_a@localhost
+GRANT role_a TO 'user_a'@'localhost'
+GRANT USAGE ON *.* TO 'user_a'@'localhost'
+GRANT INSERT, UPDATE ON *.* TO 'role_b'
+select user, host, default_role from mysql.user where user like 'user_%';
+ERROR 42000: SELECT command denied to user 'user_a'@'localhost' for table 'user'
+drop role role_a;
+drop role role_b;
+delete from mysql.user where user = 'someuser' && host = 'somehost';
+drop user user_a@localhost;
+drop user user_b@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_for.test b/mysql-test/suite/roles/set_default_role_for.test
new file mode 100644
index 00000000000..de35b529ce6
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_for.test
@@ -0,0 +1,87 @@
+source include/not_embedded.inc;
+
+# This test checks setting a default role to a different user;
+
+
+create user user_a@localhost;
+create user user_b@localhost;
+
+create role role_a;
+create role role_b;
+
+grant role_a to user_a@localhost;
+grant role_b to user_b@localhost;
+
+grant role_a to user_a@localhost;
+grant select on *.* to role_a;
+
+grant role_b to user_b@localhost;
+grant insert, update on *.* to role_b;
+
+change_user 'user_a';
+
+# A user should not be a able to set a default role for someone else,
+# if he hasn't got write access to the database.
+--error ER_DBACCESS_DENIED_ERROR
+set default role role_a for user_b@localhost;
+
+# Should have the same effect as set default role role_a.
+set default role role_a for user_a@localhost;
+
+change_user 'root';
+
+# Not even a 'root' user should be able to set an invalid role for a user.
+--error ER_INVALID_ROLE
+set default role invalid_role for user_a@localhost;
+
+--error ER_INVALID_ROLE
+set default role role_b for user_a@localhost;
+
+# Make sure we can set a default role for a different user than the one that
+# is actually running the command.
+set default role role_b for user_b@localhost;
+
+change_user 'user_a';
+
+show grants;
+--sorted_result
+select user, host, default_role from mysql.user where user like 'user_%';
+
+set default role NONE for current_user;
+--sorted_result
+select user, host, default_role from mysql.user where user like 'user_%';
+
+set default role current_role for current_user;
+--sorted_result
+select user, host, default_role from mysql.user where user like 'user_%';
+
+# Make sure we can't set a default role not granted to us, using current_user
+--error ER_INVALID_ROLE
+set default role role_b for current_user;
+
+change_user 'user_b';
+
+show grants;
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user where user like 'user_%';
+
+# Make sure the default role setting worked from root.
+insert into mysql.user (user, host) values ('someuser', 'somehost');
+# Since we have update privileges on the mysql.user table, we should
+# be able to set a default role for a different user.
+set default role NONE for user_a@localhost;
+
+change_user 'user_a';
+
+# There is no default role set any more.
+show grants;
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user where user like 'user_%';
+
+change_user 'root';
+
+drop role role_a;
+drop role role_b;
+delete from mysql.user where user = 'someuser' && host = 'somehost';
+drop user user_a@localhost;
+drop user user_b@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_invalid.result b/mysql-test/suite/roles/set_default_role_invalid.result
new file mode 100644
index 00000000000..3916bacfd4c
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_invalid.result
@@ -0,0 +1,40 @@
+create user test_user@localhost;
+create role test_role;
+create role not_granted_role;
+grant select on *.* to test_role;
+grant test_role to test_user@localhost;
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+select user, host, default_role from mysql.user;
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+set default role invalid_role;
+ERROR OP000: Invalid role specification `invalid_role`.
+set default role not_granted_role;
+ERROR OP000: Invalid role specification `not_granted_role`.
+set default role test_role;
+select user, host, default_role from mysql.user;
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+select user, host, default_role from mysql.user where user='test_user';
+user host default_role
+test_user localhost test_role
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO 'test_role'
+select user, host, default_role from mysql.user where user='test_user';
+user host default_role
+test_user localhost test_role
+set default role invalid_role;
+ERROR OP000: Invalid role specification `invalid_role`.
+select user, host, default_role from mysql.user where user='test_user';
+user host default_role
+test_user localhost test_role
+revoke test_role from test_user@localhost;
+select user, host, default_role from mysql.user where user='test_user';
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+drop role test_role;
+drop role not_granted_role;
+drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_invalid.test b/mysql-test/suite/roles/set_default_role_invalid.test
new file mode 100644
index 00000000000..8e72e316d4b
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_invalid.test
@@ -0,0 +1,62 @@
+source include/not_embedded.inc;
+
+# This test checks the error paths possible during set default role.
+
+# Create a user with no privileges
+create user test_user@localhost;
+
+create role test_role;
+create role not_granted_role;
+
+grant select on *.* to test_role;
+grant test_role to test_user@localhost;
+
+change_user 'test_user';
+show grants;
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user;
+
+# A user can not set a default role that does not exist in the database.
+--error ER_INVALID_ROLE
+set default role invalid_role;
+
+# A user can not set a default role if he can not call set role <role>.
+--error ER_INVALID_ROLE
+set default role not_granted_role;
+
+set default role test_role;
+
+# Even though a user has the default role set, without reconnecting, we should
+# not already have the roles privileges.
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user;
+
+change_user 'root';
+select user, host, default_role from mysql.user where user='test_user';
+
+change_user 'test_user';
+# This should show that the new test_user has the role's grants enabled.
+show grants;
+select user, host, default_role from mysql.user where user='test_user';
+
+# If we have a failed set default role attempt, don't change the already set
+# default role.
+--error ER_INVALID_ROLE
+set default role invalid_role;
+select user, host, default_role from mysql.user where user='test_user';
+
+change_user 'root';
+# Now, even though a default role is still set for test_user, make sure the
+# user does not get the rights, if he can not set the role.
+revoke test_role from test_user@localhost;
+
+change_user 'test_user';
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user where user='test_user';
+
+change_user 'root';
+
+# Cleanup
+drop role test_role;
+drop role not_granted_role;
+drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_new_connection.result b/mysql-test/suite/roles/set_default_role_new_connection.result
new file mode 100644
index 00000000000..d88ead70038
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_new_connection.result
@@ -0,0 +1,48 @@
+create user test_user@localhost;
+create role test_role;
+grant select on *.* to test_role;
+grant test_role to test_user@localhost;
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+select user, host, default_role from mysql.user where user = 'test_user';
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+set default role test_role;
+select user, host, default_role from mysql.user where user = 'test_user';
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+select user, host, default_role from mysql.user where user = 'test_user';
+user host default_role
+test_user localhost test_role
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO 'test_role'
+select user, host, default_role from mysql.user where user = 'test_user';
+user host default_role
+test_user localhost test_role
+set default role NONE;
+select user, host, default_role from mysql.user where user = 'test_user';
+user host default_role
+test_user localhost
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+select user, host, default_role from mysql.user where user = 'test_user';
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+select user, host, default_role from mysql.user where user = 'test_user';
+user host default_role
+test_user localhost
+set default role test_role for test_user@localhost;
+show grants;
+Grants for test_user@localhost
+GRANT test_role TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO 'test_role'
+select user, host, default_role from mysql.user where user = 'test_user';
+user host default_role
+test_user localhost test_role
+drop role test_role;
+drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_new_connection.test b/mysql-test/suite/roles/set_default_role_new_connection.test
new file mode 100644
index 00000000000..81f7f2ffb58
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_new_connection.test
@@ -0,0 +1,47 @@
+source include/not_embedded.inc;
+
+create user test_user@localhost;
+create role test_role;
+grant select on *.* to test_role;
+grant test_role to test_user@localhost;
+
+--connect (c1, localhost, test_user,,)
+show grants;
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user where user = 'test_user';
+set default role test_role;
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user where user = 'test_user';
+disconnect c1;
+
+connection default;
+select user, host, default_role from mysql.user where user = 'test_user';
+
+
+--connect (c1, localhost, test_user,,)
+show grants;
+select user, host, default_role from mysql.user where user = 'test_user';
+set default role NONE;
+disconnect c1;
+
+connection default;
+select user, host, default_role from mysql.user where user = 'test_user';
+
+--connect (c1, localhost, test_user,,)
+show grants;
+--error ER_TABLEACCESS_DENIED_ERROR
+select user, host, default_role from mysql.user where user = 'test_user';
+disconnect c1;
+
+connection default;
+select user, host, default_role from mysql.user where user = 'test_user';
+set default role test_role for test_user@localhost;
+
+--connect (c1, localhost, test_user,,)
+show grants;
+select user, host, default_role from mysql.user where user = 'test_user';
+disconnect c1;
+
+connection default;
+drop role test_role;
+drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/set_default_role_ps-6960.result b/mysql-test/suite/roles/set_default_role_ps-6960.result
new file mode 100644
index 00000000000..60210d7f92c
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_ps-6960.result
@@ -0,0 +1,8 @@
+create role r1;
+prepare stmt from "set password = '11111111111111111111111111111111111111111'";
+execute stmt;
+prepare stmt from "set default role r1";
+execute stmt;
+set password = '';
+set default role NONE;
+drop role r1;
diff --git a/mysql-test/suite/roles/set_default_role_ps-6960.test b/mysql-test/suite/roles/set_default_role_ps-6960.test
new file mode 100644
index 00000000000..8ac520e1776
--- /dev/null
+++ b/mysql-test/suite/roles/set_default_role_ps-6960.test
@@ -0,0 +1,15 @@
+#
+# MDEV-6960 Server crashes in check_alter_user on setting a default role via PS
+#
+
+--source include/not_embedded.inc
+
+create role r1;
+prepare stmt from "set password = '11111111111111111111111111111111111111111'";
+execute stmt;
+prepare stmt from "set default role r1";
+execute stmt;
+
+set password = '';
+set default role NONE;
+drop role r1;
diff --git a/mysql-test/suite/roles/set_role-recursive.result b/mysql-test/suite/roles/set_role-recursive.result
index 0bec8026ab5..9e62558fc14 100644
--- a/mysql-test/suite/roles/set_role-recursive.result
+++ b/mysql-test/suite/roles/set_role-recursive.result
@@ -16,11 +16,11 @@ Host User Role Admin_option
test_role1 test_role2 N
grant select on *.* to test_role2;
select * from mysql.user where user like 'test_role1';
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role
- test_role1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 N Y
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role default_role max_statement_time
+ test_role1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 N Y 0.000000
select * from mysql.user where user like 'test_role2';
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role
- test_role2 Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 N Y
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role default_role max_statement_time
+ test_role2 Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 N Y 0.000000
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
diff --git a/mysql-test/suite/roles/set_role-simple.result b/mysql-test/suite/roles/set_role-simple.result
index ea416835017..4fb705368b7 100644
--- a/mysql-test/suite/roles/set_role-simple.result
+++ b/mysql-test/suite/roles/set_role-simple.result
@@ -11,8 +11,8 @@ localhost root test_role1 Y
localhost test_user test_role1 N
grant select on *.* to test_role1;
select * from mysql.user where user='test_role1';
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role
- test_role1 Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 N Y
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role default_role max_statement_time
+ test_role1 Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 N Y 0.000000
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
@@ -45,3 +45,12 @@ delete from mysql.user where user='test_role1';
delete from mysql.roles_mapping where Role='test_role1';
flush privileges;
drop user 'test_user'@'localhost';
+create user user1;
+select current_user;
+current_user
+user1@%
+show grants;
+Grants for user1@%
+GRANT USAGE ON *.* TO 'user1'@'%'
+set role none;
+drop user user1;
diff --git a/mysql-test/suite/roles/set_role-simple.test b/mysql-test/suite/roles/set_role-simple.test
index 152a1d0eb25..ed884fa2407 100644
--- a/mysql-test/suite/roles/set_role-simple.test
+++ b/mysql-test/suite/roles/set_role-simple.test
@@ -37,3 +37,18 @@ delete from mysql.user where user='test_role1';
delete from mysql.roles_mapping where Role='test_role1';
flush privileges;
drop user 'test_user'@'localhost';
+
+#
+# MDEV-9898 SET ROLE NONE can crash mysqld.
+#
+
+create user user1;
+
+--connect (con1,localhost,user1,,)
+select current_user;
+show grants;
+set role none;
+
+connection default;
+drop user user1;
+
diff --git a/mysql-test/suite/roles/show_grants.result b/mysql-test/suite/roles/show_grants.result
index e7b7860c74f..5d46b038cf8 100644
--- a/mysql-test/suite/roles/show_grants.result
+++ b/mysql-test/suite/roles/show_grants.result
@@ -23,15 +23,15 @@ user host
grant select on mysql.* to test_role2;
flush privileges;
select * from information_schema.applicable_roles;
-GRANTEE ROLE_NAME IS_GRANTABLE
-root@localhost test_role1 YES
-root@localhost test_role2 YES
-test_role1 test_role2 NO
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+root@localhost test_role1 YES NO
+root@localhost test_role2 YES NO
+test_role1 test_role2 NO NULL
select * from information_schema.applicable_roles;
-GRANTEE ROLE_NAME IS_GRANTABLE
-test_role1 test_role2 NO
-test_user@localhost test_role1 NO
-test_user@localhost test_role2 NO
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+test_role1 test_role2 NO NULL
+test_user@localhost test_role1 NO NO
+test_user@localhost test_role2 NO NO
show grants;
Grants for test_user@localhost
GRANT USAGE ON *.* TO 'test_user'@'localhost'
diff --git a/mysql-test/suite/roles/show_grants_replicated.result b/mysql-test/suite/roles/show_grants_replicated.result
new file mode 100644
index 00000000000..0b2e38d3630
--- /dev/null
+++ b/mysql-test/suite/roles/show_grants_replicated.result
@@ -0,0 +1,57 @@
+include/master-slave.inc
+[connection master]
+create user u1;
+create role r1;
+#
+# On master SHOW GRANTS work both for the user and the role:
+show grants for u1;
+Grants for u1@%
+GRANT USAGE ON *.* TO 'u1'@'%'
+show grants for r1;
+Grants for r1
+GRANT USAGE ON *.* TO 'r1'
+#
+connection slave;
+#
+# The role has been replicated,
+# it's visible in mysql.user and I_S:
+#
+select user, host, is_role from mysql.user where user in ('u1', 'r1');
+user host is_role
+r1 Y
+u1 % N
+select * from information_schema.applicable_roles;
+GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
+root@localhost r1 YES NO
+#
+# Check show grants for the new user.
+show grants for u1;
+Grants for u1@%
+GRANT USAGE ON *.* TO 'u1'@'%'
+#
+# Check show grants for the new role.
+show grants for r1;
+Grants for r1
+GRANT USAGE ON *.* TO 'r1'
+#
+# Check if flushing privileges preserves the state.
+flush privileges;
+show grants for r1;
+Grants for r1
+GRANT USAGE ON *.* TO 'r1'
+#
+# Check SHOW GRANTS after setting the role.
+set role r1;
+show grants;
+Grants for root@localhost
+GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO 'r1'
+show grants for r1;
+Grants for r1
+GRANT USAGE ON *.* TO 'r1'
+connection master;
+drop role r1;
+drop user u1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/roles/show_grants_replicated.test b/mysql-test/suite/roles/show_grants_replicated.test
new file mode 100644
index 00000000000..1d4572bb297
--- /dev/null
+++ b/mysql-test/suite/roles/show_grants_replicated.test
@@ -0,0 +1,41 @@
+--source include/master-slave.inc
+
+--enable_connect_log
+
+create user u1;
+create role r1;
+--echo #
+--echo # On master SHOW GRANTS work both for the user and the role:
+show grants for u1;
+show grants for r1;
+--echo #
+--sync_slave_with_master
+--echo #
+--echo # The role has been replicated,
+--echo # it's visible in mysql.user and I_S:
+--echo #
+--sorted_result
+select user, host, is_role from mysql.user where user in ('u1', 'r1');
+select * from information_schema.applicable_roles;
+--echo #
+--echo # Check show grants for the new user.
+show grants for u1;
+--echo #
+--echo # Check show grants for the new role.
+show grants for r1;
+--echo #
+--echo # Check if flushing privileges preserves the state.
+flush privileges;
+show grants for r1;
+--echo #
+--echo # Check SHOW GRANTS after setting the role.
+set role r1;
+show grants;
+show grants for r1;
+
+connection master;
+drop role r1;
+drop user u1;
+--disable_connect_log
+--sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/hrtime.inc b/mysql-test/suite/rpl/include/hrtime.inc
index b49bf0c7792..84af425c909 100644
--- a/mysql-test/suite/rpl/include/hrtime.inc
+++ b/mysql-test/suite/rpl/include/hrtime.inc
@@ -3,7 +3,7 @@
set time_zone='+03:00';
set timestamp=unix_timestamp('2011-01-01 01:01:01') + 0.123456;
-create table t1 (a timestamp(4), b varchar(100), c datetime(2));
+create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2));
insert t1 (b,c) values (now(6), now(6));
diff --git a/mysql-test/suite/rpl/include/rpl_set_statement.inc b/mysql-test/suite/rpl/include/rpl_set_statement.inc
new file mode 100644
index 00000000000..6ab2d4e66c6
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_set_statement.inc
@@ -0,0 +1,31 @@
+#Check if the variable is replicated correctly with "SET STATEMENT"
+# Usage:
+# $rpl_ssvt_var_name - the name of tested variable;
+# $rpl_ssvt_var_value - the value to set;
+# $rpl_ssvt_table - the table name to insert values.
+
+--connection master
+--echo [connection master]
+eval SELECT @@$rpl_ssvt_var_name;
+
+--connection slave
+--echo [connection slave]
+eval SELECT @@$rpl_ssvt_var_name;
+
+--connection master
+--echo [connection master]
+--disable_result_log
+eval SET STATEMENT $rpl_ssvt_var_name=$rpl_ssvt_var_value FOR
+ INSERT INTO $rpl_ssvt_table VALUES(@@$rpl_ssvt_var_name);
+--enable_result_log
+eval SELECT @@$rpl_ssvt_var_name;
+
+--sync_slave_with_master
+--echo [connection slave]
+eval SELECT * FROM $rpl_ssvt_table;
+eval SELECT @@$rpl_ssvt_var_name;
+
+--connection master
+--echo [connection master]
+eval DELETE FROM $rpl_ssvt_table;
+
diff --git a/mysql-test/suite/rpl/r/create_or_replace_mix.result b/mysql-test/suite/rpl/r/create_or_replace_mix.result
index f2471ac5f9e..c6cce358799 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_mix.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_mix.result
@@ -84,9 +84,6 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */
master-bin.000001 # Query # # ROLLBACK
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t9`/* Generated to handle failed CREATE OR REPLACE */
-master-bin.000001 # Query # # ROLLBACK
show tables;
Tables_in_test
t2
@@ -248,12 +245,8 @@ master-bin.000001 # Query # # use `test`; create temporary table t5 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `t5` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t6` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create temporary table t7 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t7` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t8` /* generated by server */
drop table t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/create_or_replace_row.result b/mysql-test/suite/rpl/r/create_or_replace_row.result
index 4645d032482..8f032107db9 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_row.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_row.result
@@ -22,14 +22,14 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
- `f1` int(1) NOT NULL DEFAULT '0'
+ `f1` int(1) NOT NULL
)
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 # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` (
- `f1` int(1) NOT NULL DEFAULT '0'
+ `f1` int(1) NOT NULL
)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
@@ -55,14 +55,14 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t1 (to_be_deleted int)
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
- `f1` int(1) NOT NULL DEFAULT '0'
+ `f1` int(1) NOT NULL
)
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` (
- `f1` int(1) NOT NULL DEFAULT '0'
+ `f1` int(1) NOT NULL
)
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
@@ -106,9 +106,6 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */
master-bin.000001 # Query # # ROLLBACK
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t9`/* Generated to handle failed CREATE OR REPLACE */
-master-bin.000001 # Query # # ROLLBACK
show tables;
Tables_in_test
t2
@@ -270,12 +267,8 @@ master-bin.000001 # Query # # use `test`; create temporary table t5 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `t5` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t6` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create temporary table t7 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t7` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t8` /* generated by server */
drop table t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/create_or_replace_statement.result b/mysql-test/suite/rpl/r/create_or_replace_statement.result
index 8c8f9bb2ccd..7bdbc64e9f2 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_statement.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_statement.result
@@ -237,12 +237,8 @@ master-bin.000001 # Query # # use `test`; create temporary table t5 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `t5` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t6` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create temporary table t7 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t7` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t8` /* generated by server */
drop table t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result b/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result
new file mode 100644
index 00000000000..b036bde349a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+create table t1(id int auto_increment primary key);
+create table t2(id int auto_increment primary key);
+create table slave_only(id int auto_increment primary key);
+insert into slave_only values(NULL);
+create trigger t1i after insert on t1 for each row insert into slave_only values(NULL);
+stop slave;
+set global replicate_ignore_table="test.t2";
+start slave;
+insert into t2 values(NULL);
+insert into t1 values(NULL);
+drop table t1, t2, slave_only;
+stop slave;
+set global replicate_ignore_table="";
+start slave;
+drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result b/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result
new file mode 100644
index 00000000000..fd07dfce188
--- /dev/null
+++ b/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result
@@ -0,0 +1,24 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging;
+INSERT t3 VALUES (x);
+END;
+SAVEPOINT event_logging;
+INSERT INTO t2 VALUES (x);
+RELEASE SAVEPOINT event_logging;
+END|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result
index f61ca063b77..1f605935005 100644
--- a/mysql-test/suite/rpl/r/rpl_EE_err.result
+++ b/mysql-test/suite/rpl/r/rpl_EE_err.result
@@ -4,5 +4,5 @@ create table t1 (a int) engine=myisam;
flush tables;
drop table if exists t1;
Warnings:
-Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
+Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result
index 7be3bc576f3..608526ea79f 100644
--- a/mysql-test/suite/rpl/r/rpl_alter.result
+++ b/mysql-test/suite/rpl/r/rpl_alter.result
@@ -35,7 +35,7 @@ alter table t1 modify a bigint;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL DEFAULT '0',
+ `a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -47,7 +47,7 @@ alter table t1 modify a int unsigned;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(10) unsigned NOT NULL DEFAULT '0',
+ `a` int(10) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -59,7 +59,7 @@ alter table t1 modify a bigint unsigned;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -75,7 +75,7 @@ a b
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -91,7 +91,7 @@ alter table t2 modify a bigint;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bigint(20) NOT NULL DEFAULT '0',
+ `a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
index db642f21950..72844fb9de6 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
@@ -28,7 +28,7 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
show binary logs;
Log_name File_size
master-bin.000001 #
-SET GLOBAL debug_dbug="";
+SET GLOBAL debug_dbug=@old_debug;
RESET MASTER;
###################### TEST #3
CREATE TABLE t1 (a INT);
@@ -42,7 +42,7 @@ show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #4
@@ -54,7 +54,7 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
SELECT count(*) FROM t2;
count(*)
1
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #5
@@ -64,7 +64,7 @@ LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
SELECT count(*) FROM t2;
count(*)
1
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #6
@@ -81,7 +81,7 @@ SELECT count(*) FROM t2;
count(*)
3
SET AUTOCOMMIT= 1;
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #7
@@ -97,7 +97,7 @@ SELECT count(*) FROM t4;
count(*)
1
### check that the incident event is written to the current log
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Incident # # #1 (LOST_EVENTS)
@@ -144,7 +144,7 @@ count(*)
SELECT count(*) FROM t2;
count(*)
0
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
###################### TEST #9
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET SQL_LOG_BIN=0;
@@ -167,7 +167,7 @@ SELECT count(*) FROM t4;
count(*)
0
SET SQL_LOG_BIN=1;
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
###################### TEST #10
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Could not open .*");
@@ -215,7 +215,6 @@ DELETE FROM t4;
DELETE FROM t2;
DROP TABLE t5;
include/rpl_restart_server.inc [server_number=1]
-SET GLOBAL debug_dbug= @old_debug;
DROP TABLE t1, t2, t4;
RESET MASTER;
include/start_slave.inc
@@ -271,7 +270,6 @@ include/rpl_restart_server.inc [server_number=2]
include/stop_slave_sql.inc
Warnings:
Note 1255 Slave already has been stopped
-SET GLOBAL debug_dbug=@old_debug;
RESET SLAVE;
RESET MASTER;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
index ccc7116a949..0c780122e38 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
@@ -6,6 +6,7 @@ create table t (s1 int) engine=innodb;
set @@autocommit=0;
start transaction;
insert into t values (1);
+create user x@y;
grant select on t to x@y;
rollback;
show grants for x@y;
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
index 9e37fbf40b1..bd5b23c2228 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 367, the last event read from 'master-bin.000010' at 248, the last byte read from 'master-bin.000010' at 248.''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 368, the last event read from 'master-bin.000010' at 4, the last byte read from 'master-bin.000010' at 249.''
select count(*) as zero from t1;
zero
0
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_db.result b/mysql-test/suite/rpl/r/rpl_create_drop_db.result
new file mode 100644
index 00000000000..b6fb6f127c8
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_db.result
@@ -0,0 +1,28 @@
+include/master-slave.inc
+[connection master]
+CREATE DATABASE db1;
+CREATE DATABASE IF NOT EXISTS db1;
+Warnings:
+Note 1007 Can't create database 'db1'; database exists
+CREATE OR REPLACE DATABASE db2;
+CREATE OR REPLACE DATABASE db1;
+SHOW DATABASES LIKE 'db%';
+Database (db%)
+db1
+db2
+CREATE DATABASE db1;
+ERROR HY000: Can't create database 'db1'; database exists
+DROP DATABASE db3;
+ERROR HY000: Can't drop database 'db3'; database doesn't exist
+CREATE DATABASE IF NOT EXISTS db3;
+SHOW DATABASES LIKE 'db%';
+Database (db%)
+db1
+db2
+db3
+DROP DATABASE db1;
+DROP DATABASE db2;
+DROP DATABASE IF EXISTS db3;
+SHOW DATABASES LIKE 'db%';
+Database (db%)
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_event.result b/mysql-test/suite/rpl/r/rpl_create_drop_event.result
new file mode 100644
index 00000000000..2f477b1976e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_event.result
@@ -0,0 +1,24 @@
+include/master-slave.inc
+[connection master]
+SET GLOBAL event_scheduler=off;
+CREATE TABLE t1 (a INT);
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
+ERROR HY000: Event 'ev1' already exists
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
+SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME STATUS EVENT_DEFINITION
+ev1 ENABLED INSERT INTO t1 VALUES (11)
+SET GLOBAL event_scheduler=on;
+SET GLOBAL event_scheduler=off;
+SELECT DISTINCT a FROM t1;
+a
+11
+DELETE FROM t1;
+# Syncing slave with master
+SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+EVENT_NAME STATUS EVENT_DEFINITION
+ev1 SLAVESIDE_DISABLED INSERT INTO t1 VALUES (11)
+DROP TABLE t1;
+DROP EVENT ev1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_function.result b/mysql-test/suite/rpl/r/rpl_create_drop_function.result
new file mode 100644
index 00000000000..fc10d1f7c25
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_function.result
@@ -0,0 +1,50 @@
+include/master-slave.inc
+[connection master]
+CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+ERROR 42000: FUNCTION hello already exists
+SHOW CREATE FUNCTION hello;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+hello NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `hello`(str CHAR(20)) RETURNS char(50) CHARSET latin1
+ DETERMINISTIC
+RETURN
+CONCAT('Hello, ', str, '!') latin1 latin1_swedish_ci latin1_swedish_ci
+CREATE OR REPLACE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+CREATE OR REPLACE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+SELECT hello('master');
+hello('master')
+Hello, master!
+SELECT hello('slave');
+hello('slave')
+Hello, slave!
+CREATE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+Warnings:
+Note 1304 FUNCTION hello already exists
+CREATE OR REPLACE FUNCTION bye (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Bye, ', str, '!');
+SELECT hello('master');
+hello('master')
+Hello, master!
+SELECT bye('master');
+bye('master')
+Bye, master!
+SELECT hello('slave');
+hello('slave')
+Hello, slave!
+SELECT bye('slave');
+bye('slave')
+Bye, slave!
+DROP FUNCTION hello;
+DROP FUNCTION IF EXISTS bye;
+DROP FUNCTION hello;
+ERROR 42000: FUNCTION test.hello does not exist
+DROP FUNCTION IF EXISTS bye;
+Warnings:
+Note 1305 FUNCTION test.bye does not exist
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_index.result b/mysql-test/suite/rpl/r/rpl_create_drop_index.result
new file mode 100644
index 00000000000..1126c7eb701
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_index.result
@@ -0,0 +1,23 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (a INT, b INT);
+CREATE INDEX i1 ON t1 (a);
+CREATE OR REPLACE INDEX i1 ON t1 (a, b);
+# On slave:
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `i1` (`a`,`b`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+# On master:
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `i1` (`a`,`b`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result b/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result
new file mode 100644
index 00000000000..5fc7d582cb0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result
@@ -0,0 +1,64 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (id INT);
+CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+0
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+3
+# Syncing with slave
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+3
+CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+ERROR 42000: PROCEDURE proc1 already exists
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+Warnings:
+Note 1304 PROCEDURE proc1 already exists
+CREATE OR REPLACE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+# Syncing with slave
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+3
+DROP PROCEDURE proc1;
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+6
+# Syncing with slave
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+6
+DROP PROCEDURE proc1;
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+9
+# Syncing with slave
+CALL proc1(@cnt);
+SELECT @cnt;
+@cnt
+9
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE proc1;
+DROP PROCEDURE IF EXISTS proc2;
+Warnings:
+Note 1305 PROCEDURE test.proc2 does not exist
+# Syncing with slave
+DROP PROCEDURE proc1;
+ERROR 42000: PROCEDURE test.proc1 does not exist
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_role.result b/mysql-test/suite/rpl/r/rpl_create_drop_role.result
new file mode 100644
index 00000000000..84c9b9a7110
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_role.result
@@ -0,0 +1,41 @@
+include/master-slave.inc
+[connection master]
+CREATE ROLE role_1;
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+User
+role_1
+CREATE ROLE IF NOT EXISTS role_1;
+Warnings:
+Note 1975 Can't create role 'role_1'; it already exists
+CREATE ROLE IF NOT EXISTS role_2;
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+User
+role_1
+role_2
+CREATE OR REPLACE ROLE IF NOT EXISTS role_3;
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+CREATE OR REPLACE ROLE role_3;
+CREATE OR REPLACE ROLE role_2;
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+User
+role_1
+role_2
+role_3
+CREATE ROLE role_2;
+ERROR HY000: Operation CREATE ROLE failed for 'role_2'
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+User
+role_1
+role_2
+role_3
+DROP ROLE role_1;
+DROP ROLE IF EXISTS role_2;
+DROP ROLE IF EXISTS role_3;
+DROP ROLE IF EXISTS role_4;
+Warnings:
+Note 1976 Can't drop role 'role_4'; it doesn't exist
+DROP ROLE role_4;
+ERROR HY000: Operation DROP ROLE failed for 'role_4'
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+User
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result b/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result
new file mode 100644
index 00000000000..8cb80613af8
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result
@@ -0,0 +1,48 @@
+include/master-slave.inc
+[connection master]
+# Part 1 - initial creation
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE t1 (val INT);
+CREATE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 1;
+SET @sum=0;
+INSERT INTO t1 VALUES (10), (20), (30);
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT_Master
+SET @sum = @sum + NEW.val + 1
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT_Slave
+SET @sum = @sum + NEW.val + 1
+# Part 2 - CREATE IF NOT EXISTS (on a existing trigger)
+CREATE TRIGGER IF NOT EXISTS val_sum AFTER INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 2;
+Warnings:
+Note 1359 Trigger already exists
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT_Master
+SET @sum = @sum + NEW.val + 1
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT_Slave
+SET @sum = @sum + NEW.val + 1
+# Part 3 - CREATE OR REPLACE (on a existing trigger)
+CREATE OR REPLACE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 3;
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT_Master
+SET @sum = @sum + NEW.val + 3
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+ACTION_STATEMENT_Slave
+SET @sum = @sum + NEW.val + 3
+# Clearing up
+DROP TRIGGER val_sum;
+DROP TABLE t1;
+DROP TRIGGER IF EXISTS val_sum;
+Warnings:
+Note 1360 Trigger does not exist
+DROP TRIGGER random_trigger;
+ERROR HY000: Trigger does not exist
+DROP DATABASE db1;
+DROP TRIGGER IF EXISTS val_sum;
+ERROR 3D000: No database selected
+# Syncing slave with master
+DROP TRIGGER val_sum;
+ERROR HY000: Trigger does not exist
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_udf.result b/mysql-test/suite/rpl/r/rpl_create_drop_udf.result
new file mode 100644
index 00000000000..c7089c0ec5b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_udf.result
@@ -0,0 +1,42 @@
+include/master-slave.inc
+[connection master]
+CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+SELECT metaphon('master');
+metaphon('master')
+MSTR
+CREATE FUNCTION metaphon RETURNS INT SONAME "UDF_EXAMPLE_LIB";
+ERROR HY000: Function 'metaphon' already exists
+SELECT metaphon('slave');
+metaphon('slave')
+SLF
+CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+Warnings:
+Note 1125 Function 'metaphon' already exists
+DROP FUNCTION IF EXISTS random_function_name;
+Warnings:
+Note 1305 FUNCTION test.random_function_name does not exist
+CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+Warnings:
+Note 1125 Function 'metaphon' already exists
+CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+SELECT metaphon('slave');
+metaphon('slave')
+SLF
+DROP FUNCTION metaphon;
+CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+ERROR HY000: Function 'metaphon' already exists
+SELECT metaphon('slave');
+metaphon('slave')
+SLF
+DROP FUNCTION metaphon;
+DROP FUNCTION IF EXISTS metaphon;
+Warnings:
+Note 1305 FUNCTION test.metaphon does not exist
+DROP FUNCTION metaphon;
+ERROR 42000: FUNCTION test.metaphon does not exist
+DROP FUNCTION IF EXISTS metaphon;
+Warnings:
+Note 1305 FUNCTION test.metaphon does not exist
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_user.result b/mysql-test/suite/rpl/r/rpl_create_drop_user.result
new file mode 100644
index 00000000000..c55c522852c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_user.result
@@ -0,0 +1,46 @@
+include/master-slave.inc
+[connection master]
+CREATE USER u1@localhost IDENTIFIED BY 'abcdefghijk';
+SELECT CURRENT_USER;
+CURRENT_USER
+u1@localhost
+CREATE USER IF NOT EXISTS u2@localhost;
+SELECT CURRENT_USER;
+CURRENT_USER
+u2@localhost
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+user password
+u1 *D9553C4CE316A9845CE49E30A2D7E3857AF966C4
+u2
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+user password
+u1 *D9553C4CE316A9845CE49E30A2D7E3857AF966C4
+u2
+CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'abcdefghijk2';
+SELECT CURRENT_USER;
+CURRENT_USER
+u1@localhost
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+user password
+u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
+u2
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+user password
+u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
+u2
+CREATE USER u1@localhost;
+ERROR HY000: Operation CREATE USER failed for 'u1'@'localhost'
+DROP USER u3@localhost;
+ERROR HY000: Operation DROP USER failed for 'u3'@'localhost'
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+user password
+u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
+u2
+DROP USER IF EXISTS u1@localhost;
+DROP USER u2@localhost;
+DROP USER IF EXISTS u3@localhost;
+Warnings:
+Note 1974 Can't drop user 'u3'@'localhost'; it doesn't exist
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+user password
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_view.result b/mysql-test/suite/rpl/r/rpl_create_drop_view.result
new file mode 100644
index 00000000000..85731210ae8
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_view.result
@@ -0,0 +1,99 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1(id INT);
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
+INSERT INTO t1 VALUES (5), (8), (10), (20), (30);
+SELECT * FROM t1;
+id
+5
+8
+10
+20
+30
+SELECT * FROM v1;
+id
+20
+30
+# Syncing slave with master
+SELECT * FROM t1;
+id
+5
+8
+10
+20
+30
+SELECT * FROM v1;
+id
+20
+30
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
+ERROR 42S01: Table 'v1' already exists
+CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
+Warnings:
+Note 1050 Table 'v1' already exists
+CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+# Syncing slave with master
+SELECT * FROM t1;
+id
+5
+8
+10
+20
+30
+SELECT * FROM v1;
+id
+20
+30
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
+INSERT INTO t1 VALUES (50), (80), (3), (2), (40);
+SELECT * FROM t1;
+id
+5
+8
+10
+20
+30
+50
+80
+3
+2
+40
+SELECT * FROM v1;
+id
+20
+30
+50
+80
+40
+# Syncing slave with master
+SELECT * FROM t1;
+id
+5
+8
+10
+20
+30
+50
+80
+3
+2
+40
+SELECT * FROM v1;
+id
+20
+30
+50
+80
+40
+DROP VIEW v1;
+DROP TABLE t1;
+DROP VIEW v1;
+ERROR 42S02: Unknown table 'test.v1'
+DROP VIEW IF EXISTS v2;
+Warnings:
+Note 1051 Unknown table 'test.v2'
+# Syncing slave with master
+SELECT * FROM v1;
+ERROR 42S02: Table 'test.v1' doesn't exist
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_current_user.result b/mysql-test/suite/rpl/r/rpl_current_user.result
index a5e340b8850..3391af5de9c 100644
--- a/mysql-test/suite/rpl/r/rpl_current_user.result
+++ b/mysql-test/suite/rpl/r/rpl_current_user.result
@@ -8,6 +8,7 @@ CREATE VIEW test.v_procs_priv AS SELECT * FROM mysql.procs_priv WHERE User LIKE
CREATE VIEW test.v_event AS SELECT definer FROM mysql.event WHERE name = 'e1';
CREATE PROCEDURE p1() SELECT 1;
# bug48321_1-01234 has the max length(16) of user.
+CREATE USER 'bug48321_1-01234'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'bug48321_1-01234'@'localhost' WITH GRANT OPTION;
# Test the max lengths of user and host names
diff --git a/mysql-test/suite/rpl/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result
index 0173bf1e28d..df246cc547f 100644
--- a/mysql-test/suite/rpl/r/rpl_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_ddl.result
@@ -1,5 +1,7 @@
include/master-slave.inc
[connection master]
+set global sql_mode='';
+set local sql_mode='';
-------- switch to master -------
SET AUTOCOMMIT = 1;
@@ -1620,4 +1622,5 @@ use test;
DROP TEMPORARY TABLE mysqltest1.t22;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest3;
+set global sql_mode=default;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index 4cbc2d7d9e9..a9f1d92cb42 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -6,6 +6,7 @@ flush privileges;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+create user rpl_do_grant@localhost;
grant select on *.* to rpl_do_grant@localhost;
grant drop on test.* to rpl_do_grant@localhost;
show grants for rpl_do_grant@localhost;
@@ -113,7 +114,7 @@ GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO 'cr
USE bug42217_db;
SHOW CREATE FUNCTION upgrade_del_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-upgrade_del_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
+upgrade_del_func NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
BEGIN
RETURN "INSIDE upgrade_del_func()";
END latin1 latin1_swedish_ci latin1_swedish_ci
@@ -124,7 +125,7 @@ INSIDE upgrade_del_func()
USE bug42217_db;
SHOW CREATE FUNCTION upgrade_del_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-upgrade_del_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
+upgrade_del_func NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
BEGIN
RETURN "INSIDE upgrade_del_func()";
END latin1 latin1_swedish_ci latin1_swedish_ci
@@ -149,7 +150,7 @@ upgrade_alter_func()
INSIDE upgrade_alter_func()
SHOW CREATE FUNCTION upgrade_alter_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-upgrade_alter_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1
+upgrade_alter_func NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1
BEGIN
RETURN "INSIDE upgrade_alter_func()";
END latin1 latin1_swedish_ci latin1_swedish_ci
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter.result
new file mode 100644
index 00000000000..fb315c4b020
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter.result
@@ -0,0 +1,286 @@
+include/master-slave.inc
+[connection master]
+# On slave
+call mtr.add_suppression("Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS lists can't be non-empty at the same time");
+call mtr.add_suppression("DO_DOMAIN_IDS or IGNORE_DOMAIN_IDS lists can't be non-empty in non-GTID mode.*");
+# On master
+SET @@session.gtid_domain_id= 1;
+SELECT @@session.gtid_domain_id;
+@@session.gtid_domain_id
+1
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+i
+1
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) : 1
+IGNORE_DOMAIN_IDS (AFTER) :
+# On master
+SET @@session.gtid_domain_id= 2;
+INSERT INTO t1 VALUES(2);
+SET @@session.gtid_domain_id= 1;
+INSERT INTO t1 VALUES(3);
+SELECT * FROM t1;
+i
+1
+2
+3
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+i
+1
+3
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) : 1
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+# On master
+SELECT @@session.gtid_domain_id;
+@@session.gtid_domain_id
+1
+INSERT INTO t1 VALUES(4);
+SET @@session.gtid_domain_id= 2;
+INSERT INTO t1 VALUES(5);
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+5
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+i
+1
+3
+5
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+include/stop_slave.inc
+Warnings:
+Note 1255 Slave already has been stopped
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) : 1, 2, 3, 4, 5, 6, 7, 8, 9
+IGNORE_DOMAIN_IDS (AFTER) :
+# On master
+SELECT @@session.gtid_domain_id;
+@@session.gtid_domain_id
+2
+INSERT INTO t1 VALUES(8);
+SET @@session.gtid_domain_id= 7;
+INSERT INTO t1 VALUES(9);
+SET @@session.gtid_domain_id= 10;
+INSERT INTO t1 VALUES(10);
+INSERT INTO t1 VALUES(11);
+START TRANSACTION;
+INSERT INTO t1 VALUES(12);
+INSERT INTO t1 VALUES(13);
+COMMIT;
+INSERT INTO t1 VALUES(14);
+INSERT INTO t1 VALUES(15);
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+i
+1
+3
+5
+8
+9
+# On slave
+# Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
+Seconds_Behind_Master = '0'
+# On slave
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) : 1, 2, 3, 4, 5, 6, 7, 8, 9
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+# On master
+SET @@session.gtid_domain_id=2;
+CREATE TABLE t2(i int) ENGINE=MYISAM;
+CREATE TABLE t3(i int) ENGINE=INNODB;
+SET @@session.gtid_domain_id=1;
+BEGIN;
+INSERT INTO t2 VALUES(1);
+INSERT INTO t3 VALUES(1);
+# On slave
+include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
+# On master
+INSERT INTO t2 VALUES(2);
+INSERT INTO t3 VALUES(2);
+COMMIT;
+include/save_master_gtid.inc
+# On slave
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2;
+i
+SELECT * FROM t3;
+i
+# On master
+SET @@session.gtid_domain_id=1;
+BEGIN;
+INSERT INTO t2 VALUES(3);
+INSERT INTO t3 VALUES(3);
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+# On master
+INSERT INTO t2 VALUES(4);
+INSERT INTO t3 VALUES(4);
+COMMIT;
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+SELECT * FROM t2;
+i
+4
+SELECT * FROM t3;
+i
+3
+4
+# On master
+SET @@session.gtid_domain_id=1;
+BEGIN;
+INSERT INTO t2 VALUES(5);
+INSERT INTO t3 VALUES(5);
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+# On master
+INSERT INTO t2 VALUES(6);
+INSERT INTO t3 VALUES(6);
+COMMIT;
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+SELECT * FROM t2;
+i
+4
+5
+SELECT * FROM t3;
+i
+3
+4
+# On slave
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 2
+# On master
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(7);
+INSERT INTO t3 VALUES(7);
+COMMIT;
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 2
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+# On master
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(8);
+INSERT INTO t3 VALUES(8);
+COMMIT;
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+SELECT * FROM t2;
+i
+4
+5
+8
+SELECT * FROM t3;
+i
+3
+4
+8
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=NO;
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=NO;
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), DO_DOMAIN_IDS=(), MASTER_USE_GTID=SLAVE_POS;
+include/start_slave.inc
+# On master
+SET @@session.gtid_domain_id=2;
+DROP TABLE t1, t2, t3;
+include/save_master_gtid.inc
+# On slave
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
new file mode 100644
index 00000000000..0c4fe90ba9a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
@@ -0,0 +1,415 @@
+include/master-slave.inc
+[connection master]
+# On master
+SET @@session.gtid_domain_id= 1;
+SELECT @@session.gtid_domain_id;
+@@session.gtid_domain_id
+1
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+# On slave
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+# Case 0 : Start slave with IGNORE_DOMAIN_IDS=(), then restart
+# replication with IGNORE_DOMAIN_IDS=() after IO thread is
+# killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+SELECT * FROM t1;
+i
+1
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+# On master
+START TRANSACTION;
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+COMMIT;
+SELECT * FROM t1;
+i
+1
+2
+3
+# On slave
+include/wait_for_slave_io_error.inc [errno=1595]
+SELECT * FROM t1;
+i
+1
+SET @@global.debug_dbug="-d";
+START SLAVE io_thread;
+include/wait_for_slave_io_to_start.inc
+SELECT * FROM t1;
+i
+1
+2
+3
+# Case 1 : Start slave with IGNORE_DOMAIN_IDS=(1), then restart
+# replication with IGNORE_DOMAIN_IDS=(1) after IO thread is
+# killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+# On master
+START TRANSACTION;
+INSERT INTO t1 VALUES(4);
+INSERT INTO t1 VALUES(5);
+COMMIT;
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+5
+# On slave
+include/wait_for_slave_io_error.inc [errno=1595]
+SELECT * FROM t1;
+i
+1
+2
+3
+SET @@global.debug_dbug="-d";
+START SLAVE io_thread;
+include/wait_for_slave_io_to_start.inc
+SELECT * FROM t1;
+i
+1
+2
+3
+# Case 2 : Start slave with IGNORE_DOMAIN_IDS=(), then restart
+# replication with IGNORE_DOMAIN_IDS=(1) after IO thread is
+# killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+# On master
+START TRANSACTION;
+INSERT INTO t1 VALUES(6);
+INSERT INTO t1 VALUES(7);
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES(8);
+INSERT INTO t1 VALUES(9);
+COMMIT;
+SET @@session.gtid_domain_id= 2;
+START TRANSACTION;
+INSERT INTO t1 VALUES(10);
+INSERT INTO t1 VALUES(11);
+COMMIT;
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+# On slave
+include/wait_for_slave_io_error.inc [errno=1595]
+SELECT * FROM t1;
+i
+1
+2
+3
+SET @@global.debug_dbug="-d";
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+SELECT * FROM t1;
+i
+1
+2
+3
+10
+11
+# Case 3 : Start slave with IGNORE_DOMAIN_IDS=(1), then restart
+# replication with IGNORE_DOMAIN_IDS=() after IO thread is
+# killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+# On master
+SET @@session.gtid_domain_id= 1;
+START TRANSACTION;
+INSERT INTO t1 VALUES(12);
+INSERT INTO t1 VALUES(13);
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES(14);
+INSERT INTO t1 VALUES(15);
+COMMIT;
+SET @@session.gtid_domain_id= 2;
+START TRANSACTION;
+INSERT INTO t1 VALUES(16);
+INSERT INTO t1 VALUES(17);
+COMMIT;
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+# On slave
+include/wait_for_slave_io_error.inc [errno=1595]
+SELECT * FROM t1;
+i
+1
+2
+3
+10
+11
+SET @@global.debug_dbug="-d";
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+SELECT * FROM t1;
+i
+1
+2
+3
+10
+11
+14
+15
+16
+17
+# Case 4 : Start slave with IGNORE_DOMAIN_IDS=(1), then restart
+# replication with IGNORE_DOMAIN_IDS=() after IO thread is
+# killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_after_2_events").
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
+# On master
+SET @@session.gtid_domain_id= 1;
+START TRANSACTION;
+INSERT INTO t1 VALUES(18);
+INSERT INTO t1 VALUES(19);
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(21);
+COMMIT;
+SET @@session.gtid_domain_id= 2;
+START TRANSACTION;
+INSERT INTO t1 VALUES(22);
+INSERT INTO t1 VALUES(23);
+COMMIT;
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+# On slave
+include/wait_for_slave_io_error.inc [errno=1595]
+SELECT * FROM t1;
+i
+1
+2
+3
+10
+11
+14
+15
+16
+17
+SET @@global.debug_dbug="-d";
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) : 1
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+SELECT * FROM t1;
+i
+1
+2
+3
+10
+11
+14
+15
+16
+17
+20
+21
+22
+23
+# Case 5 : Start slave with IGNORE_DOMAIN_IDS=(), then restart
+# replication with IGNORE_DOMAIN_IDS=(1) after IO thread is
+# killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_after_2_events").
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
+# On master
+SET @@session.gtid_domain_id= 1;
+START TRANSACTION;
+INSERT INTO t1 VALUES(24);
+INSERT INTO t1 VALUES(25);
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES(26);
+INSERT INTO t1 VALUES(27);
+COMMIT;
+SET @@session.gtid_domain_id= 2;
+START TRANSACTION;
+INSERT INTO t1 VALUES(28);
+INSERT INTO t1 VALUES(29);
+COMMIT;
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+# On slave
+include/wait_for_slave_io_error.inc [errno=1595]
+SELECT * FROM t1;
+i
+1
+2
+3
+10
+11
+14
+15
+16
+17
+20
+21
+22
+23
+SET @@global.debug_dbug="-d";
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+SELECT * FROM t1;
+i
+1
+2
+3
+10
+11
+14
+15
+16
+17
+20
+21
+22
+23
+28
+29
+# On master
+DROP TABLE t1;
+# On slave
+include/stop_slave.inc
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
new file mode 100644
index 00000000000..f26619a0871
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
@@ -0,0 +1,59 @@
+include/master-slave.inc
+[connection master]
+# On master
+call mtr.add_suppression("mysqld: Table './mysql/gtid_slave_pos' is marked as crashed and should be repaired");
+call mtr.add_suppression("Checking table: './mysql/gtid_slave_pos'");
+call mtr.add_suppression("mysql.gtid_slave_pos: 1 client is using or hasn't closed the table properly");
+SET @@session.gtid_domain_id= 0;
+create table ti (a int auto_increment primary key) engine=innodb;
+create table tm (a int auto_increment primary key) engine=myisam;
+insert into ti set a=null;
+insert into tm set a=null;
+# On slave
+include/stop_slave.inc
+select * from ti;
+a
+1
+select * from tm;
+a
+1
+# On master
+SET @@session.gtid_domain_id= 1;
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+SET @@session.gtid_domain_id= 0;
+insert into ti set a=null;
+insert into tm set a=null;
+set @@global.debug_dbug="+d,crash_before_send_xid";
+# On slave
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+# On master
+include/rpl_start_server.inc [server_number=1]
+# Master has restarted successfully
+set @@global.debug_dbug="-d";
+# On slave
+include/stop_slave.inc
+include/start_slave.inc
+select * from ti;
+a
+1
+3
+select * from tm;
+a
+1
+3
+# On master
+drop table ti;
+drop table tm;
+# On slave
+include/stop_slave.inc
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result
new file mode 100644
index 00000000000..d3e17a991b6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result
@@ -0,0 +1,177 @@
+include/rpl_init.inc [topology=1->2]
+# On slave
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+# On slave
+CHANGE MASTER TO master_use_gtid=slave_pos, DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+include/start_slave.inc
+# On master
+SELECT @@session.gtid_domain_id;
+@@session.gtid_domain_id
+0
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+# On slave
+# New connection 'con_temp1'
+LOCK TABLE t1 WRITE;
+# On master
+SET @@session.gtid_domain_id=1;
+INSERT INTO t1 VALUES (2);
+SET @@session.gtid_domain_id=0;
+INSERT INTO t2 VALUES (2);
+INSERT INTO t2 VALUES (3);
+BEGIN;
+INSERT INTO t2 VALUES (4);
+INSERT INTO t2 VALUES (5);
+COMMIT;
+INSERT INTO t2 VALUES (6);
+# On slave
+SELECT * FROM t2 ORDER by a;
+a
+1
+2
+3
+4
+5
+6
+# On con_temp1
+SELECT * FROM t1;
+a
+1
+UNLOCK TABLES;
+# On slave
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+# On slave
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) : 1
+IGNORE_DOMAIN_IDS (AFTER) :
+# On slave
+# On con_temp1
+LOCK TABLE t1 WRITE;
+# On master
+SET @@session.gtid_domain_id=0;
+INSERT INTO t1 VALUES (3);
+SET @@session.gtid_domain_id=1;
+INSERT INTO t2 VALUES (7);
+INSERT INTO t2 VALUES (8);
+BEGIN;
+INSERT INTO t2 VALUES (9);
+INSERT INTO t2 VALUES (10);
+COMMIT;
+INSERT INTO t2 VALUES (11);
+# On slave
+SELECT * FROM t2 ORDER by a;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+# On con_temp1
+SELECT * FROM t1;
+a
+1
+2
+UNLOCK TABLES;
+# On slave
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+# On slave
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) : 1
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+# On slave
+# On con_temp1
+LOCK TABLE t1 WRITE;
+# On master
+SET @@session.gtid_domain_id=1;
+INSERT INTO t1 VALUES (4);
+SET @@session.gtid_domain_id=0;
+INSERT INTO t2 VALUES (12);
+INSERT INTO t2 VALUES (13);
+BEGIN;
+INSERT INTO t2 VALUES (14);
+INSERT INTO t2 VALUES (15);
+COMMIT;
+INSERT INTO t2 VALUES (16);
+# On slave
+SELECT * FROM t2 ORDER by a;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+# On con_temp1
+SELECT * FROM t1;
+a
+1
+2
+UNLOCK TABLES;
+# On slave
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+SELECT * FROM t2;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+# Restore original settings.
+# On master
+SET @@session.gtid_domain_id=0;
+DROP TABLE t1, t2;
+# On slave
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads= @old_parallel_threads;
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result
new file mode 100644
index 00000000000..b4706ea5f11
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result
@@ -0,0 +1,46 @@
+include/master-slave.inc
+[connection master]
+# On slave
+include/stop_slave.inc
+DO_DOMAIN_IDS (BEFORE) :
+IGNORE_DOMAIN_IDS (BEFORE) :
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) : 1
+# On master
+SET @@session.gtid_domain_id= 0;
+CREATE TABLE t1(i INT);
+CREATE TABLE t2(i INT);
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+SET @@session.gtid_domain_id= 1;
+INSERT INTO t2 VALUES(1);
+SELECT * FROM t2;
+i
+1
+# On slave
+SELECT * FROM t1;
+i
+1
+SELECT * FROM t2;
+i
+include/rpl_restart_server.inc [server_number=2]
+# On slave
+DO_DOMAIN_IDS (AFTER RESTART) :
+IGNORE_DOMAIN_IDS (AFTER RESTART) : 1
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=();
+include/start_slave.inc
+DO_DOMAIN_IDS (AFTER) :
+IGNORE_DOMAIN_IDS (AFTER) :
+SELECT * FROM t1;
+i
+1
+SELECT * FROM t2;
+i
+# On master
+SET @@session.gtid_domain_id= 0;
+DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
index e5e690bdf52..1e0ac5ab940 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
@@ -96,13 +96,11 @@ f5 DOUBLE DEFAULT '2.00',
f6 ENUM('a', 'b', 'c') default 'a',
f7 DECIMAL(17,9) default '1000.00',
f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
+f9 NUMERIC(6,2) default '2000.00',
f10 VARCHAR(1024),
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f12 SET('a', 'b', 'c') default 'b')
ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
@@ -119,13 +117,11 @@ CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
f5 DOUBLE DEFAULT '2.00',
f6 DECIMAL(17,9) default '1000.00',
f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
+f8 NUMERIC(6,2) default '2000.00',
f9 VARCHAR(1024),
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f11 CHAR(255))
ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
@@ -184,9 +180,6 @@ INSERT into t2 values (2, 2, 2, 'second',
(3, 3, 3, 'third',
3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
binary data';
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
index 9247ceb1030..38ef9dbff80 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
@@ -96,13 +96,11 @@ f5 DOUBLE DEFAULT '2.00',
f6 ENUM('a', 'b', 'c') default 'a',
f7 DECIMAL(17,9) default '1000.00',
f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
+f9 NUMERIC(6,2) default '2000.00',
f10 VARCHAR(1024),
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f12 SET('a', 'b', 'c') default 'b')
ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
@@ -119,13 +117,11 @@ CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
f5 DOUBLE DEFAULT '2.00',
f6 DECIMAL(17,9) default '1000.00',
f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
+f8 NUMERIC(6,2) default '2000.00',
f9 VARCHAR(1024),
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f11 CHAR(255))
ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
@@ -184,9 +180,6 @@ INSERT into t2 values (2, 2, 2, 'second',
(3, 3, 3, 'third',
3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
binary data';
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
index 80d69eae6db..c24020eef87 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
@@ -210,7 +210,8 @@ DROP TABLE t8;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP,
+d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP,
e INT NOT NULL,
f text not null,
g text,
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
index 73c2a237f05..a8710f0de5b 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
@@ -210,7 +210,8 @@ DROP TABLE t8;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP,
+d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP,
e INT NOT NULL,
f text not null,
g text,
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index 7b93a221953..a5bf73cdbfa 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -2,7 +2,8 @@ include/rpl_init.inc [topology=1->2->1]
show variables like 'relay_log%';
Variable_name Value
relay_log master-relay-bin
-relay_log_index master-relay-bin.index
+relay_log_basename MYSQLD_DATADIR/master-relay-bin
+relay_log_index MYSQLD_DATADIR/master-relay-bin.index
relay_log_info_file relay-log.info
relay_log_purge ON
relay_log_recovery OFF
diff --git a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
index f778e76adc0..c30bac3d8c0 100644
--- a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
@@ -32,7 +32,7 @@ SET TIMESTAMP=1000000000;
CREATE TABLE t3 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t3 VALUES (1),(1);
-Got one of the listed errors
+ERROR 23000: Duplicate entry '1' for key 'a'
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS t1,t2,t3;
SET FOREIGN_KEY_CHECKS=1;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
index f3b52d89eb4..22f284d6716 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
@@ -231,6 +231,15 @@ NULL
SELECT master_gtid_wait('', NULL);
master_gtid_wait('', NULL)
0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 1
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_time';
+Variable_name Value
+Master_gtid_wait_time 0
SELECT master_gtid_wait(@pos, 0.5);
master_gtid_wait(@pos, 0.5)
-1
@@ -271,13 +280,46 @@ SELECT master_gtid_wait('2-1-5');
SELECT master_gtid_wait('2-1-10');
SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
SELECT master_gtid_wait('2-1-2');
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 3
SELECT master_gtid_wait('1-1-1');
master_gtid_wait('1-1-1')
0
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 4
+SET @a= MASTER_GTID_WAIT_TIME;
+SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
+AS Master_gtid_wait_time_as_expected;
+Master_gtid_wait_time_as_expected
+OK
SELECT master_gtid_wait('0-1-109');
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 0
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 4
SELECT master_gtid_wait('2-1-2', 0.5);
master_gtid_wait('2-1-2', 0.5)
-1
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+Variable_name Value
+Master_gtid_wait_timeouts 1
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+Variable_name Value
+Master_gtid_wait_count 5
+SET @a= MASTER_GTID_WAIT_TIME;
+SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
+Master_gtid_wait_time_as_expected
+OK
KILL QUERY KILL_ID;
ERROR 70100: Query execution was interrupted
SET gtid_domain_id=2;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
index 0c2249f2dce..5f67901b7f5 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
@@ -3,7 +3,6 @@ include/rpl_init.inc [topology=1->2]
call mtr.add_suppression("Checking table:");
call mtr.add_suppression("client is using or hasn't closed the table properly");
call mtr.add_suppression("Table .* is marked as crashed and should be repaired");
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
flush tables;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result b/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result
new file mode 100644
index 00000000000..3558a6764d1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result
@@ -0,0 +1,30 @@
+include/master-slave.inc
+[connection master]
+SET @@SESSION.gtid_domain_id=0;
+CREATE TABLE t (a INT);
+call mtr.add_suppression("connecting slave requested to start from.*which is not in the master's binlog");
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @@SESSION.gtid_domain_id=11;
+SET @@SESSION.server_id=111;
+SET @@SESSION.gtid_seq_no=1;
+INSERT INTO t SET a=1;
+SET @save.gtid_slave_pos=@@global.gtid_slave_pos;
+SET @@global.gtid_slave_pos=concat(@@global.gtid_slave_pos, ",", 11, "-", 111, "-", 1 + 1);
+Warnings:
+Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-2. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos.
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_error.inc [errno=1236]
+FLUSH BINARY LOGS;
+PURGE BINARY LOGS TO 'master-bin.000002';;
+FLUSH BINARY LOGS DELETE_DOMAIN_ID=(11);
+include/start_slave.inc
+INSERT INTO t SET a=1;
+include/wait_for_slave_io_error.inc [errno=1236]
+FLUSH BINARY LOGS;
+PURGE BINARY LOGS TO 'master-bin.000004';;
+FLUSH BINARY LOGS DELETE_DOMAIN_ID=(11);
+include/start_slave.inc
+SET @@SESSION.gtid_domain_id=0;
+DROP TABLE t;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result
new file mode 100644
index 00000000000..f6a4f3e4f7e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result
@@ -0,0 +1,55 @@
+include/rpl_init.inc [topology=1->2->3]
+include/stop_slave.inc
+CHANGE MASTER TO
+MASTER_USE_GTID = SLAVE_POS, IGNORE_DOMAIN_IDS = (2,3);
+START SLAVE;
+include/stop_slave.inc
+CHANGE MASTER TO
+MASTER_USE_GTID = SLAVE_POS, IGNORE_DOMAIN_IDS = (2,3);
+START SLAVE;
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "m1");
+INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+SET @@session.gtid_domain_id=2;
+# The following should get filetered on slave.
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, "m1");
+INSERT INTO t2 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 m1
+2 m2
+3 m3
+4 m4
+# Only 't1' should have replicated to slaves.
+SHOW TABLES;
+Tables_in_test
+t1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 m1
+2 m2
+3 m3
+4 m4
+# Only 't1' should have replicated to slaves.
+SHOW TABLES;
+Tables_in_test
+t1
+# Cleanup
+SET @@session.gtid_domain_id=1;
+DROP TABLE t1;
+SET @@session.gtid_domain_id=2;
+DROP TABLE t2;
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+STOP SLAVE;
+CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = ();
+STOP SLAVE;
+CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = ();
+# End of test.
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_sort.result b/mysql-test/suite/rpl/r/rpl_gtid_sort.result
new file mode 100644
index 00000000000..add24522b90
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_sort.result
@@ -0,0 +1,99 @@
+include/rpl_init.inc [topology=1->2]
+*** Test connecting with empty GTID state to start from very beginning of binlog ***
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+Variable_name Value
+gtid_binlog_pos
+SHOW VARIABLES LIKE 'gtid_current_pos';
+Variable_name Value
+gtid_current_pos
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+Variable_name Value
+gtid_slave_pos
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+Variable_name Value
+gtid_binlog_state
+RESET MASTER;
+FLUSH LOGS;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SET @@SESSION.gtid_domain_id=1;
+INSERT INTO t1 VALUES(1);
+SET @@SESSION.gtid_domain_id=99999;
+INSERT INTO t1 VALUES(3);
+SET @@SESSION.gtid_domain_id=10;
+INSERT INTO t1 VALUES(4);
+SET @@SESSION.gtid_domain_id=100;
+INSERT INTO t1 VALUES(5);
+SET @@SESSION.gtid_domain_id=2147483648;
+INSERT INTO t1 VALUES(6);
+SET @@SESSION.gtid_domain_id=4294967295;
+INSERT INTO t1 VALUES(7);
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+Variable_name Value
+gtid_binlog_pos 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_current_pos';
+Variable_name Value
+gtid_current_pos 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+Variable_name Value
+gtid_slave_pos
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+Variable_name Value
+gtid_binlog_state 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+Variable_name Value
+gtid_binlog_pos
+SHOW VARIABLES LIKE 'gtid_current_pos';
+Variable_name Value
+gtid_current_pos
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+Variable_name Value
+gtid_slave_pos
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+Variable_name Value
+gtid_binlog_state
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
+MASTER_USE_GTID=CURRENT_POS;
+include/start_slave.inc
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+Variable_name Value
+gtid_binlog_pos 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_current_pos';
+Variable_name Value
+gtid_current_pos 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+Variable_name Value
+gtid_slave_pos 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+Variable_name Value
+gtid_binlog_state 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SELECT * FROM t1;
+a
+1
+3
+4
+5
+6
+7
+SET @@SESSION.gtid_domain_id=1000;
+INSERT INTO t1 VALUES(8);
+SET @@SESSION.gtid_domain_id=89;
+INSERT INTO t1 VALUES(9);
+SET @@SESSION.gtid_domain_id=10100000;
+INSERT INTO t1 VALUES(10);
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+Variable_name Value
+gtid_binlog_pos 0-1-1,1-1-1,10-1-1,89-2-1,100-1-1,1000-2-1,99999-1-1,10100000-2-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_current_pos';
+Variable_name Value
+gtid_current_pos 0-1-1,1-1-1,10-1-1,89-2-1,100-1-1,1000-2-1,99999-1-1,10100000-2-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+Variable_name Value
+gtid_slave_pos 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+Variable_name Value
+gtid_binlog_state 0-1-1,1-1-1,10-1-1,89-2-1,100-1-1,1000-2-1,99999-1-1,10100000-2-1,2147483648-1-1,4294967295-1-1
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index 5a6787d37ac..697cc7aa7fd 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime.result
@@ -2,7 +2,7 @@ include/master-slave.inc
[connection master]
set time_zone='+03:00';
set timestamp=unix_timestamp('2011-01-01 01:01:01') + 0.123456;
-create table t1 (a timestamp(4), b varchar(100), c datetime(2));
+create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2));
insert t1 (b,c) values (now(6), now(6));
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010');
set timestamp=unix_timestamp('2022-02-02 02:02:02') + 0.654321;
@@ -35,13 +35,13 @@ use `test`/*!*/;
SET TIMESTAMP=1293832861/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-create table t1 (a timestamp(4), b varchar(100), c datetime(2))
+create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2))
/*!*/;
BEGIN
/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime_row.result b/mysql-test/suite/rpl/r/rpl_hrtime_row.result
index aaf8b1c2466..458002b0b79 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime_row.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime_row.result
@@ -2,7 +2,7 @@ include/master-slave.inc
[connection master]
set time_zone='+03:00';
set timestamp=unix_timestamp('2011-01-01 01:01:01') + 0.123456;
-create table t1 (a timestamp(4), b varchar(100), c datetime(2));
+create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2));
insert t1 (b,c) values (now(6), now(6));
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010');
set timestamp=unix_timestamp('2022-02-02 02:02:02') + 0.654321;
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index ae6d6ddfc8d..40baaa60b01 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
@@ -1,8 +1,12 @@
include/master-slave.inc
[connection master]
+set global sql_mode="";
+set local sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+set global sql_mode="";
+set local sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
@@ -31,4 +35,6 @@ flush privileges;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+set global sql_mode=default;
+set global sql_mode=default;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index 6d7c4e3686c..75445bec823 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -17,6 +17,7 @@ DROP TABLE t4;
**** Adding GRANTS on master ****
create table test.t1(a int);
create table test.t4(a int);
+set sql_mode="";
GRANT SELECT ON test.t1 TO mysqltest1@localhost;
GRANT INSERT ON test.t4 TO mysqltest2@localhost;
GRANT select, update, insert, references on t1
@@ -65,6 +66,7 @@ flush privileges;
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
+set sql_mode="";
**** Checking grants on slave ****
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
index b02164ac61b..6f685c35901 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
@@ -2,16 +2,19 @@ include/master-slave.inc
[connection master]
use test;
CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
-dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON
+UPDATE CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
PRIMARY KEY(id)) ENGINE='innodb';
CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
-dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
PRIMARY KEY(id)) ENGINE='innodb'
PARTITION BY KEY(id) partitions 5;
CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
-dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
PRIMARY KEY(id)) ENGINE='innodb'
PARTITION BY RANGE(id)
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index bc245a073cd..2e3faaba7b6 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev382.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -362,7 +362,7 @@ use `ts``et`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index 7815fa88c93..34b3789df5f 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
@@ -3,7 +3,8 @@ include/master-slave.inc
drop table if exists t1;
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
-0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP,PRIMARY KEY(id));
alter table t1 engine=myisam;
show create table t1;
Table Create Table
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
index 39e1541eb0e..7831919c8b6 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
@@ -13398,8 +13398,8 @@ 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 `test`; CREATE TABLE `tt_xx_1` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13419,8 +13419,8 @@ 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 `test`; CREATE TABLE `tt_xx_1` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13443,8 +13443,8 @@ 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 `test`; CREATE TABLE `nt_xx_2` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13465,8 +13465,8 @@ 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 `test`; CREATE TABLE `nt_xx_2` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13490,8 +13490,8 @@ 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 `test`; CREATE TABLE `tt_xx_3` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13512,8 +13512,8 @@ 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 `test`; CREATE TABLE `tt_xx_3` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13537,8 +13537,8 @@ 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 `test`; CREATE TABLE `nt_xx_4` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13558,8 +13558,8 @@ 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 `test`; CREATE TABLE `nt_xx_4` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13582,8 +13582,8 @@ 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 `test`; CREATE TABLE `nt_xx_5` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13603,8 +13603,8 @@ 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 `test`; CREATE TABLE `nt_xx_5` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13627,8 +13627,8 @@ 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 `test`; CREATE TABLE `nt_xx_6` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13648,8 +13648,8 @@ 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 `test`; CREATE TABLE `nt_xx_6` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13670,8 +13670,8 @@ 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 `test`; CREATE TABLE `tt_xx_7` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13684,8 +13684,8 @@ 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 `test`; CREATE TABLE `tt_xx_7` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13914,8 +13914,8 @@ 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 `test`; CREATE TABLE `tt_xx_8` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13928,8 +13928,8 @@ 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 `test`; CREATE TABLE `tt_xx_8` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -14150,8 +14150,8 @@ 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 `test`; CREATE TABLE `nt_xx_9` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14165,8 +14165,8 @@ 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 `test`; CREATE TABLE `nt_xx_9` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14416,8 +14416,8 @@ 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 `test`; CREATE TABLE `nt_xx_10` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14431,8 +14431,8 @@ 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 `test`; CREATE TABLE `nt_xx_10` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14721,15 +14721,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -14789,15 +14783,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B T CT T R]
@@ -14843,15 +14831,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -14904,15 +14886,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B CT T R]
@@ -14950,15 +14926,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B N CT T R]
@@ -15011,15 +14981,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
###################################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result
index ca3a2c50ee0..631b071136b 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result
@@ -1,4 +1,5 @@
-include/rpl_init.inc [topology=1->2]
+include/master-slave.inc
+[connection master]
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=10;
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
@@ -1226,6 +1227,59 @@ include/stop_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
+*** MDEV-6676 - test syntax of @@slave_parallel_mode ***
+Parallel_Mode = 'conservative'
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='aggressive';
+Parallel_Mode = 'aggressive'
+SET GLOBAL slave_parallel_mode='conservative';
+Parallel_Mode = 'conservative'
+*** MDEV-6676 - test that empty parallel_mode does not replicate in parallel ***
+INSERT INTO t2 VALUES (1040);
+include/save_master_gtid.inc
+SET GLOBAL slave_parallel_mode='none';
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply";
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+a
+1040
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+*** MDEV-6676 - test disabling domain-based parallel replication ***
+SET gtid_domain_id = 1;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+DELETE FROM t2 WHERE a >= 1041;
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+SET gtid_domain_id = 0;
+include/save_master_gtid.inc
+SET GLOBAL slave_parallel_mode=minimal;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+a
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='conservative';
+include/start_slave.inc
*** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging ***
*** MDEV-7882: Excessive transaction retry in parallel replication ***
CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
@@ -1693,21 +1747,21 @@ SET GLOBAL debug_dbug=@old_dbug;
include/start_slave.inc
*** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
BEGIN;
-INSERT INTO t2 VALUES (200);
-INSERT INTO t1 VALUES (200);
-INSERT INTO t2 VALUES (201);
+INSERT INTO t2 VALUES (2000);
+INSERT INTO t1 VALUES (2000);
+INSERT INTO t2 VALUES (2001);
ROLLBACK;
-SELECT * FROM t1 WHERE a>=200 ORDER BY a;
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
a
-200
-SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+2000
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
a
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
-SELECT * FROM t1 WHERE a>=200 ORDER BY a;
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
a
-200
-SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+2000
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
a
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result b/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
new file mode 100644
index 00000000000..ae9389c6266
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
@@ -0,0 +1,164 @@
+include/rpl_init.inc [topology=1->2->3->4]
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+*** MDEV-6676: Test that @@skip_parallel_replication is preserved in slave binlog ***
+INSERT INTO t1 VALUES(1,1);
+BEGIN;
+INSERT INTO t1 VALUES(2,1);
+INSERT INTO t1 VALUES(3,1);
+COMMIT;
+SET SESSION skip_parallel_replication=1;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET SESSION skip_parallel_replication=0;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 11
+3 1
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 11
+3 1
+status
+Ok, no retry
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 11
+3 1
+status
+Ok, no retry
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 11
+3 1
+status
+Ok, no retry
+*** MDEV-6676: Test that the FL_WAITED flag in GTID is preserved in slave binlog ***
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET GLOBAL slave_parallel_mode='optimistic';
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET GLOBAL slave_parallel_mode='optimistic';
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET GLOBAL slave_parallel_mode='optimistic';
+BEGIN;
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="thd_report_wait_for SIGNAL waiting1";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting1";
+SET debug_sync="thd_report_wait_for SIGNAL waiting2";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting2";
+SET debug_sync="thd_report_wait_for SIGNAL waiting3";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting3";
+SET debug_sync="thd_report_wait_for SIGNAL waiting4";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting4";
+SET debug_sync="thd_report_wait_for SIGNAL waiting5";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting5";
+SET debug_sync="thd_report_wait_for SIGNAL waiting6";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting6";
+SET debug_sync="thd_report_wait_for SIGNAL waiting7";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting7";
+SET debug_sync="thd_report_wait_for SIGNAL waiting8";
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET debug_sync="now WAIT_FOR waiting8";
+COMMIT;
+SET debug_sync="RESET";
+COMMIT;
+COMMIT;
+COMMIT;
+COMMIT;
+COMMIT;
+COMMIT;
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 20
+3 1
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 20
+3 1
+status
+Ok, no retry
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 20
+3 1
+status
+Ok, no retry
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 20
+3 1
+status
+Ok, no retry
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
new file mode 100644
index 00000000000..0177e65b10f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -0,0 +1,551 @@
+include/rpl_init.inc [topology=1->2]
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+INSERT INTO t1 VALUES(1,1);
+BEGIN;
+INSERT INTO t1 VALUES(2,1);
+INSERT INTO t1 VALUES(3,1);
+COMMIT;
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,2);
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,3);
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,4);
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,5);
+DELETE FROM t1 WHERE a=3;
+INSERT INTO t1 VALUES(3,2);
+DELETE FROM t1 WHERE a=1;
+INSERT INTO t1 VALUES(1,2);
+DELETE FROM t1 WHERE a=3;
+INSERT INTO t1 VALUES(3,3);
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,6);
+include/save_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 6
+3 3
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 6
+3 3
+*** Test a bunch of non-transactional/DDL event groups. ***
+include/stop_slave.inc
+INSERT INTO t1 VALUES (4,4);
+INSERT INTO t1 VALUES (5,5);
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+CREATE TABLE t3 (a INT PRIMARY KEY) ENGINE=MyISAM;
+ALTER TABLE t2 ADD b INT;
+INSERT INTO t2 VALUES (2,2);
+ALTER TABLE t2 DROP b;
+INSERT INTO t2 VALUES (3);
+ALTER TABLE t2 ADD c INT;
+INSERT INTO t2 VALUES (4,5);
+INSERT INTO t2 VALUES (5,5);
+INSERT INTO t3 VALUES (1);
+UPDATE t2 SET c=NULL WHERE a=4;
+ALTER TABLE t2 ADD UNIQUE (c);
+INSERT INTO t2 VALUES (6,6);
+UPDATE t2 SET c=c+100 WHERE a=2;
+INSERT INTO t3(a) VALUES (2);
+DELETE FROM t3 WHERE a=2;
+INSERT INTO t3(a) VALUES (2);
+DELETE FROM t3 WHERE a=2;
+ALTER TABLE t3 CHANGE a c INT NOT NULL;
+INSERT INTO t3(c) VALUES (2);
+DELETE FROM t3 WHERE c=2;
+INSERT INTO t3 SELECT a+200 FROM t2;
+DELETE FROM t3 WHERE c >= 200;
+INSERT INTO t3 SELECT a+200 FROM t2;
+include/save_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 6
+3 3
+4 4
+5 5
+SELECT * FROM t2 ORDER BY a;
+a c
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 5
+6 6
+SELECT * FROM t3 ORDER BY c;
+c
+1
+201
+202
+203
+204
+205
+206
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 6
+3 3
+4 4
+5 5
+SELECT * FROM t2 ORDER BY a;
+a c
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 5
+6 6
+SELECT * FROM t3 ORDER BY c;
+c
+1
+201
+202
+203
+204
+205
+206
+*** Test @@skip_parallel_replication. ***
+include/stop_slave.inc
+UPDATE t1 SET b=10 WHERE a=3;
+SET SESSION skip_parallel_replication=1;
+UPDATE t1 SET b=20 WHERE a=3;
+UPDATE t1 SET b=30 WHERE a=3;
+UPDATE t1 SET b=50 WHERE a=3;
+UPDATE t1 SET b=80 WHERE a=3;
+UPDATE t1 SET b=130 WHERE a=3;
+UPDATE t1 SET b=210 WHERE a=3;
+UPDATE t1 SET b=340 WHERE a=3;
+UPDATE t1 SET b=550 WHERE a=3;
+UPDATE t1 SET b=890 WHERE a=3;
+SET SESSION skip_parallel_replication=0;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 6
+3 890
+4 4
+5 5
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 6
+3 890
+4 4
+5 5
+status
+Ok, no retry
+*** Test that we do not replicate in parallel transactions that had row lock waits on the master ***
+include/stop_slave.inc
+BEGIN;
+UPDATE t1 SET b=b+1 WHERE a=3;
+SET debug_sync='thd_report_wait_for SIGNAL waiting1';
+UPDATE t1 SET b=1001 WHERE a=3;
+SET debug_sync='now WAIT_FOR waiting1';
+BEGIN;
+UPDATE t1 SET b=1002 WHERE a=5;
+SET debug_sync='thd_report_wait_for SIGNAL waiting2';
+UPDATE t1 SET b=102 WHERE a=3;
+SET debug_sync='now WAIT_FOR waiting2';
+UPDATE t1 SET b=1000 WHERE a=1;
+SET debug_sync='thd_report_wait_for SIGNAL waiting3';
+UPDATE t1 SET b=1003 WHERE a=5;
+SET debug_sync='now WAIT_FOR waiting3';
+SET debug_sync='thd_report_wait_for SIGNAL waiting4';
+UPDATE t1 SET b=1004 WHERE a=3;
+SET debug_sync='now WAIT_FOR waiting4';
+SET debug_sync='thd_report_wait_for SIGNAL waiting5';
+UPDATE t1 SET b=1005 WHERE a=5;
+SET debug_sync='now WAIT_FOR waiting5';
+SET debug_sync='thd_report_wait_for SIGNAL waiting6';
+UPDATE t1 SET b=1006 WHERE a=1;
+SET debug_sync='now WAIT_FOR waiting6';
+SET debug_sync='thd_report_wait_for SIGNAL waiting7';
+UPDATE t1 SET b=1007 WHERE a=5;
+SET debug_sync='now WAIT_FOR waiting7';
+SET debug_sync='thd_report_wait_for SIGNAL waiting8';
+UPDATE t1 SET b=1008 WHERE a=3;
+SET debug_sync='now WAIT_FOR waiting8';
+COMMIT;
+COMMIT;
+SET debug_sync='RESET';
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1006
+2 6
+3 1008
+4 4
+5 1007
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1006
+2 6
+3 1008
+4 4
+5 1007
+status
+Ok, no retry
+*** Test that we replicate correctly when using READ COMMITTED and binlog_format=MIXED on the slave ***
+include/stop_slave.inc
+SET @old_format= @@GLOBAL.binlog_format;
+SET GLOBAL binlog_format= MIXED;
+SET @old_isolation= @@GLOBAL.tx_isolation;
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,0), (2,0), (3,0);
+INSERT INTO t2 VALUES (1,0), (2,0);
+INSERT INTO t1 SELECT 4, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 4, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 5, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 5, COUNT(*) FROM t1;
+INSERT INTO t2 SELECT 6, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 6, COUNT(*) FROM t2;
+INSERT INTO t1 SELECT 7, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 7, COUNT(*) FROM t1;
+INSERT INTO t2 SELECT 8, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 8, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 9, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 9, COUNT(*) FROM t2;
+INSERT INTO t1 SELECT 10, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 10, COUNT(*) FROM t1;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0
+2 0
+3 0
+4 2
+5 3
+6 5
+7 5
+8 7
+9 8
+10 8
+SELECT * FROM t2 ORDER BY a;
+a b
+1 0
+2 0
+4 4
+5 5
+6 5
+7 7
+8 7
+9 8
+10 10
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0
+2 0
+3 0
+4 2
+5 3
+6 5
+7 5
+8 7
+9 8
+10 8
+SELECT * FROM t2 ORDER BY a;
+a b
+1 0
+2 0
+4 4
+5 5
+6 5
+7 7
+8 7
+9 8
+10 10
+include/stop_slave.inc
+SET GLOBAL binlog_format= @old_format;
+SET GLOBAL tx_isolation= @old_isolation;
+include/start_slave.inc
+*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1), (2,1), (3,1), (4,1), (5,1);
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+ALTER TABLE t2 COMMENT "123abc";
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+INSERT INTO t1 VALUES (1,2);
+INSERT INTO t1 VALUES (2,2);
+INSERT INTO t1 VALUES (3,2);
+INSERT INTO t1 VALUES (4,2);
+INSERT INTO t3 VALUES (1,3);
+ALTER TABLE t2 COMMENT "hello, world";
+BEGIN;
+INSERT INTO t1 VALUES (5,4);
+INSERT INTO t1 VALUES (6,4);
+INSERT INTO t1 VALUES (7,4);
+INSERT INTO t1 VALUES (8,4);
+INSERT INTO t1 VALUES (9,4);
+INSERT INTO t1 VALUES (10,4);
+INSERT INTO t1 VALUES (11,4);
+INSERT INTO t1 VALUES (12,4);
+INSERT INTO t1 VALUES (13,4);
+INSERT INTO t1 VALUES (14,4);
+INSERT INTO t1 VALUES (15,4);
+INSERT INTO t1 VALUES (16,4);
+INSERT INTO t1 VALUES (17,4);
+INSERT INTO t1 VALUES (18,4);
+INSERT INTO t1 VALUES (19,4);
+INSERT INTO t1 VALUES (20,4);
+COMMIT;
+INSERT INTO t1 VALUES (21,5);
+INSERT INTO t1 VALUES (22,5);
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 2
+3 2
+4 2
+5 4
+6 4
+7 4
+8 4
+9 4
+10 4
+11 4
+12 4
+13 4
+14 4
+15 4
+16 4
+17 4
+18 4
+19 4
+20 4
+21 5
+22 5
+SELECT * FROM t2 ORDER BY a;
+a b
+1 1
+2 1
+3 1
+4 1
+5 1
+SELECT * FROM t3 ORDER BY a;
+a b
+1 3
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 2
+3 2
+4 2
+5 4
+6 4
+7 4
+8 4
+9 4
+10 4
+11 4
+12 4
+13 4
+14 4
+15 4
+16 4
+17 4
+18 4
+19 4
+20 4
+21 5
+22 5
+SELECT * FROM t2 ORDER BY a;
+a b
+1 1
+2 1
+3 1
+4 1
+5 1
+SELECT * FROM t3 ORDER BY a;
+a b
+1 3
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debug;
+include/start_slave.inc
+*** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+ALTER TABLE t3 COMMENT "DDL statement 1";
+INSERT INTO t1 VALUES (30,0);
+INSERT INTO t1 VALUES (31,0);
+INSERT INTO t1 VALUES (32,0);
+INSERT INTO t1 VALUES (33,0);
+INSERT INTO t1 VALUES (34,0);
+INSERT INTO t1 VALUES (35,0);
+INSERT INTO t1 VALUES (36,0);
+SET @old_server_id= @@SESSION.server_id;
+SET SESSION server_id= 100;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SET SESSION server_id= @old_server_id;
+INSERT INTO t1 VALUES (37,0);
+ALTER TABLE t3 COMMENT "DDL statement 2";
+INSERT INTO t1 VALUES (38,0);
+INSERT INTO t1 VALUES (39,0);
+ALTER TABLE t3 COMMENT "DDL statement 3";
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a b
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a b
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debug;
+include/start_slave.inc
+*** MDEV-8113: ALTER TABLE causes slave hang in optimistic parallel replication ***
+include/stop_slave.inc
+ALTER TABLE t2 ADD c INT;
+INSERT INTO t2 (a,b) VALUES (50, 0);
+INSERT INTO t2 (a,b) VALUES (51, 1);
+INSERT INTO t2 (a,b) VALUES (52, 2);
+INSERT INTO t2 (a,b) VALUES (53, 3);
+INSERT INTO t2 (a,b) VALUES (54, 4);
+INSERT INTO t2 (a,b) VALUES (55, 5);
+INSERT INTO t2 (a,b) VALUES (56, 6);
+INSERT INTO t2 (a,b) VALUES (57, 7);
+INSERT INTO t2 (a,b) VALUES (58, 8);
+INSERT INTO t2 (a,b) VALUES (59, 9);
+ALTER TABLE t2 DROP COLUMN c;
+SELECT * FROM t2 WHERE a >= 50 ORDER BY a;
+a b
+50 0
+51 1
+52 2
+53 3
+54 4
+55 5
+56 6
+57 7
+58 8
+59 9
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 50 ORDER BY a;
+a b
+50 0
+51 1
+52 2
+53 3
+54 4
+55 5
+56 6
+57 7
+58 8
+59 9
+*** MDEV-8075: DROP TEMPORARY TABLE not marked as ddl, causing optimistic parallel replication to fail ***
+include/stop_slave.inc
+INSERT INTO t1 VALUES (40, 10);
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (41);
+BEGIN;
+INSERT INTO t2 SELECT a, 20 FROM t1;
+DROP TEMPORARY TABLE t1;
+COMMIT;
+INSERT INTO t1 VALUES (42, 10);
+include/save_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 40 ORDER BY a;
+a b
+40 10
+42 10
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+a b
+41 20
+50 0
+51 1
+52 2
+53 3
+54 4
+55 5
+56 6
+57 7
+58 8
+59 9
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 40 ORDER BY a;
+a b
+40 10
+42 10
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+a b
+41 20
+50 0
+51 1
+52 2
+53 3
+54 4
+55 5
+56 6
+57 7
+58 8
+59 9
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+DROP TABLE t1, t2, t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
new file mode 100644
index 00000000000..91970f3eeb5
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
@@ -0,0 +1,85 @@
+include/rpl_init.inc [topology=1->2]
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,0), (2,0), (3,0);
+INSERT INTO t2 VALUES (1,0), (2,0);
+SET @old_isolation= @@GLOBAL.tx_isolation;
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='aggressive';
+*** Test that we replicate correctly when using READ COMMITTED and --log-slave-updates=0 on the slave ***
+INSERT INTO t1 SELECT 4, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 4, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 5, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 5, COUNT(*) FROM t1;
+INSERT INTO t2 SELECT 6, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 6, COUNT(*) FROM t2;
+INSERT INTO t1 SELECT 7, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 7, COUNT(*) FROM t1;
+INSERT INTO t2 SELECT 8, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 8, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 9, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 9, COUNT(*) FROM t2;
+INSERT INTO t1 SELECT 10, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 10, COUNT(*) FROM t1;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0
+2 0
+3 0
+4 2
+5 3
+6 5
+7 5
+8 7
+9 8
+10 8
+SELECT * FROM t2 ORDER BY a;
+a b
+1 0
+2 0
+4 4
+5 5
+6 5
+7 7
+8 7
+9 8
+10 10
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0
+2 0
+3 0
+4 2
+5 3
+6 5
+7 5
+8 7
+9 8
+10 8
+SELECT * FROM t2 ORDER BY a;
+a b
+1 0
+2 0
+4 4
+5 5
+6 5
+7 7
+8 7
+9 8
+10 10
+include/stop_slave.inc
+SET GLOBAL tx_isolation= @old_isolation;
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
index da2cf42f870..1ccc87ada60 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
@@ -137,6 +137,32 @@ a b
30 conservative
31 conservative
include/stop_slave.inc
+SET @old_mode= @@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode=optimistic;
+CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (32);
+INSERT INTO t4 VALUES (33);
+INSERT INTO t1 SELECT a, "optimistic" FROM t4;
+DROP TEMPORARY TABLE t4;
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a b
+30 conservative
+31 conservative
+32 optimistic
+33 optimistic
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a b
+30 conservative
+31 conservative
+32 optimistic
+33 optimistic
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_mode;
+include/start_slave.inc
+include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index 27fd92db31c..c1e3ee60e10 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -34,15 +34,15 @@ t1
t2
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-trg2 INSERT t2 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1 INSERT t1 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg2 INSERT t2 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
*** slave ***
show tables;
Tables_in_test
t1
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1 INSERT t1 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
*** master ***
drop trigger trg1;
drop trigger trg2;
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index d9b6006fbb0..57754183483 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -63,8 +63,11 @@ drop table t1;
create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 2
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
+Note 1265 Data truncated for column 'a' at row 4
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 5
Warning 1262 Row 5 was truncated; it contained more data than there were input columns
select * from rewrite.t1;
@@ -77,6 +80,9 @@ a b
truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings:
+Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 2
+Note 1265 Data truncated for column 'a' at row 3
Warning 1366 Incorrect integer value: '
' for column 'a' at row 4
Warning 1261 Row 4 doesn't contain data for all columns
diff --git a/mysql-test/suite/rpl/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result
index 5298395da20..47b94074ecf 100644
--- a/mysql-test/suite/rpl/r/rpl_row_USER.result
+++ b/mysql-test/suite/rpl/r/rpl_row_USER.result
@@ -1,5 +1,7 @@
include/master-slave.inc
[connection master]
+set global sql_mode="";
+set local sql_mode="";
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE USER tester IDENTIFIED BY 'test';
@@ -33,3 +35,5 @@ REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP USER tester@'%';
DROP USER ''@'localhost%';
include/rpl_end.inc
+set global sql_mode=default;
+set local sql_mode=default;
diff --git a/mysql-test/suite/rpl/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result
index b7d3f8914e0..e9ddc1c4d12 100644
--- a/mysql-test/suite/rpl/r/rpl_row_UUID.result
+++ b/mysql-test/suite/rpl/r/rpl_row_UUID.result
@@ -25,7 +25,7 @@ insert into t2 values(fn1(2));
SHOW CREATE TABLE test.t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
+ `a` int(11) NOT NULL,
`blob_column` longblob,
`vchar_column` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
index 5e7c3c10c1e..71747e825b9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -103,7 +103,7 @@ a
7
8
9
-SET GLOBAL QUERY_CACHE_SIZE=0;
+SET GLOBAL QUERY_CACHE_SIZE=default;
DROP TABLE t1;
================ Test for BUG#22550 ================
include/rpl_reset.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
index c7241c52353..91b1007aa59 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
@@ -2,9 +2,6 @@ include/master-slave.inc
[connection master]
DROP TABLE IF EXISTS t1;
SET @@BINLOG_FORMAT = ROW;
-SELECT @@BINLOG_FORMAT;
-@@BINLOG_FORMAT
-ROW
**** Partition RANGE testing ****
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
@@ -577,7 +574,7 @@ t1 CREATE TABLE `t1` (
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
@@ -594,7 +591,7 @@ t1 CREATE TABLE `t1` (
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
@@ -650,7 +647,7 @@ t1 CREATE TABLE `t1` (
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
@@ -667,7 +664,7 @@ t1 CREATE TABLE `t1` (
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_select.result b/mysql-test/suite/rpl/r/rpl_row_create_select.result
index ac95d50df9d..81bbd3bc2fd 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_select.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_select.result
@@ -8,7 +8,7 @@ include/master-slave.inc
#value of 21.
CREATE TABLE t1 AS SELECT REPEAT('A', 1000) DIV 1 AS a;
Warnings:
-Warning 1918 Encountered illegal value '' when converting to DECIMAL
+Warning 1292 Truncated incorrect DECIMAL value: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -16,7 +16,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 AS SELECT CONVERT(REPEAT('A', 255) USING UCS2) DIV 1 AS a;
Warnings:
-Warning 1918 Encountered illegal value '' when converting to DECIMAL
+Warning 1292 Truncated incorrect DECIMAL value: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index 3030c8e5238..31c4a823f70 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -417,7 +417,7 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE mysqltest1.without_select (f1 BIGINT)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE `mysqltest1`.`with_select` (
- `f1` int(1) NOT NULL DEFAULT '0'
+ `f1` int(1) NOT NULL
)
master-bin.000001 # Table_map # # table_id: # (mysqltest1.with_select)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 8b484ef4e1b..20dcaecabd3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
@@ -44,10 +44,6 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES;
Tables_in_test
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
index 280955c66ef..05b2c04e7ba 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
@@ -62,18 +62,12 @@ SET @commands= 'Drop-Temp-T-Temp';
DROP TEMPORARY TABLE tt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-N-Temp';
DROP TEMPORARY TABLE nt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-Xe-Temp';
@@ -99,9 +93,6 @@ DROP TEMPORARY TABLE tt_tmp_2, tt_1;
ERROR 42S02: Unknown table 'test.tt_1'
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-If-TXe-Temp';
@@ -112,7 +103,7 @@ Note 1051 Unknown table 'test.tt_1'
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-NXe-Temp';
@@ -120,9 +111,6 @@ DROP TEMPORARY TABLE nt_tmp_2, tt_1;
ERROR 42S02: Unknown table 'test.tt_1'
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-If-NXe-Temp';
@@ -133,8 +121,6 @@ Note 1051 Unknown table 'test.tt_1'
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
@@ -142,29 +128,18 @@ SET @commands= 'Drop-Temp-TN-Temp';
DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-TT-Temp';
DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TT-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TT-Temp << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-NN-Temp';
DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NN-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
@@ -182,7 +157,6 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -203,8 +177,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -217,9 +189,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -236,16 +205,10 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -343,7 +306,6 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -366,8 +328,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -384,7 +344,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -409,8 +369,8 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -424,9 +384,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -445,16 +402,10 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -471,9 +422,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
@@ -495,16 +443,10 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
@@ -521,12 +463,8 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -541,20 +479,12 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -569,7 +499,6 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -589,7 +518,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -602,9 +530,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -620,9 +545,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -644,9 +566,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -672,9 +591,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -698,9 +614,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -729,7 +642,6 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -752,8 +664,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -766,9 +676,6 @@ ROLLBACK;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
@@ -787,16 +694,10 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
@@ -898,7 +799,6 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -923,8 +823,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -941,7 +839,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -968,8 +866,8 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -983,9 +881,6 @@ ROLLBACK;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
@@ -1006,16 +901,10 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
@@ -1032,9 +921,6 @@ ROLLBACK;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
@@ -1058,16 +944,10 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */
@@ -1084,12 +964,8 @@ ROLLBACK;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1106,20 +982,12 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1134,7 +1002,6 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1156,7 +1023,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1169,9 +1035,6 @@ ROLLBACK;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
@@ -1189,9 +1052,6 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -1215,9 +1075,6 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -1245,9 +1102,6 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -1273,9 +1127,6 @@ Warning # Some non-transactional changed tables couldn't be rolled back
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -1407,10 +1258,6 @@ DROP TABLE tt_tmp_2, nt_tmp_2, nt_2;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1418,11 +1265,6 @@ SET @commands= 'Drop-TN-Temp';
DROP TABLE tt_tmp_2, nt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1613,10 +1455,6 @@ master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1631,10 +1469,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
#########################################################################
@@ -1651,13 +1485,6 @@ DROP TEMPORARY TABLE nt_tmp_1;
DROP TEMPORARY TABLE nt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp';
@@ -1667,13 +1494,6 @@ DROP TEMPORARY TABLE tt_tmp_1;
DROP TEMPORARY TABLE tt_tmp_2;
-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1692,15 +1512,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -1715,12 +1526,6 @@ DROP TEMPORARY TABLE tt_tmp_2;
COMMIT;
-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne C';
@@ -1739,11 +1544,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne C << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te C';
@@ -1759,9 +1559,6 @@ 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 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Table_map # # table_id: # (test.tt_error_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
@@ -1783,11 +1580,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1806,15 +1598,6 @@ ROLLBACK;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
@@ -1829,12 +1612,6 @@ DROP TEMPORARY TABLE tt_tmp_2;
ROLLBACK;
-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne R';
@@ -1855,11 +1632,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne R << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te R';
@@ -1875,9 +1647,6 @@ ROLLBACK;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
master-bin.000001 # Table_map # # table_id: # (test.tt_error_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
@@ -1901,11 +1670,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e-
#########################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
new file mode 100644
index 00000000000..e69358a5d29
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
@@ -0,0 +1,4733 @@
+include/rpl_init.inc [topology=1->2->3]
+CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+### engines: MyISAM, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+### engines: MyISAM, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+### engines: MyISAM, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result
new file mode 100644
index 00000000000..ba01221d3b6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result
@@ -0,0 +1,3516 @@
+include/rpl_init.inc [topology=1->2->3]
+CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+### engines: MyISAM, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result
new file mode 100644
index 00000000000..16152f28c27
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result
@@ -0,0 +1,3516 @@
+include/rpl_init.inc [topology=1->2->3]
+CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+### engines: MyISAM, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+DROP TABLE t;
+include/rpl_sync.inc
+CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
index cc537f83ca4..95167311c3f 100644
--- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
@@ -548,7 +548,6 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index 83ec26486e0..4ff3d45e2bb 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -215,7 +215,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Gtid # # GTID #-#-#
master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
master-bin.000002 # Gtid # # GTID #-#-#
@@ -253,7 +252,6 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Gtid # # GTID #-#-#
slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Gtid # # BEGIN GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index 3b9733a18e8..c78e0e4816e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -215,7 +215,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Gtid # # GTID #-#-#
master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB
master-bin.000002 # Gtid # # GTID #-#-#
@@ -253,7 +252,6 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB
slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Gtid # # GTID #-#-#
slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=InnoDB
slave-bin.000002 # Gtid # # BEGIN GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
index 39e1541eb0e..7831919c8b6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
@@ -13398,8 +13398,8 @@ 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 `test`; CREATE TABLE `tt_xx_1` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13419,8 +13419,8 @@ 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 `test`; CREATE TABLE `tt_xx_1` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13443,8 +13443,8 @@ 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 `test`; CREATE TABLE `nt_xx_2` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13465,8 +13465,8 @@ 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 `test`; CREATE TABLE `nt_xx_2` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13490,8 +13490,8 @@ 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 `test`; CREATE TABLE `tt_xx_3` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13512,8 +13512,8 @@ 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 `test`; CREATE TABLE `tt_xx_3` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13537,8 +13537,8 @@ 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 `test`; CREATE TABLE `nt_xx_4` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13558,8 +13558,8 @@ 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 `test`; CREATE TABLE `nt_xx_4` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13582,8 +13582,8 @@ 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 `test`; CREATE TABLE `nt_xx_5` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13603,8 +13603,8 @@ 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 `test`; CREATE TABLE `nt_xx_5` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13627,8 +13627,8 @@ 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 `test`; CREATE TABLE `nt_xx_6` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13648,8 +13648,8 @@ 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 `test`; CREATE TABLE `nt_xx_6` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -13670,8 +13670,8 @@ 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 `test`; CREATE TABLE `tt_xx_7` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13684,8 +13684,8 @@ 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 `test`; CREATE TABLE `tt_xx_7` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13914,8 +13914,8 @@ 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 `test`; CREATE TABLE `tt_xx_8` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -13928,8 +13928,8 @@ 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 `test`; CREATE TABLE `tt_xx_8` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=InnoDB
@@ -14150,8 +14150,8 @@ 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 `test`; CREATE TABLE `nt_xx_9` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14165,8 +14165,8 @@ 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 `test`; CREATE TABLE `nt_xx_9` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14416,8 +14416,8 @@ 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 `test`; CREATE TABLE `nt_xx_10` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14431,8 +14431,8 @@ 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 `test`; CREATE TABLE `nt_xx_10` (
- `trans_id` int(11) NOT NULL DEFAULT '0',
- `stmt_id` int(11) NOT NULL DEFAULT '0',
+ `trans_id` int(11) NOT NULL,
+ `stmt_id` int(11) NOT NULL,
`info` varchar(64) DEFAULT NULL,
PRIMARY KEY (`trans_id`,`stmt_id`)
) ENGINE=MyISAM
@@ -14721,15 +14721,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_11` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -14789,15 +14783,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_12` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B T CT T R]
@@ -14843,15 +14831,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_13` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -14904,15 +14886,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_14` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B CT T R]
@@ -14950,15 +14926,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_15` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
rpl_mixing_engines.inc [commands=B N CT T R]
@@ -15011,15 +14981,9 @@ rpl_mixing_engines.inc [commands=drop-CT]
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_16` /* generated by server */
-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
###################################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 19611ac52b5..7c7c6997b07 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -161,7 +161,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -184,7 +184,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -293,7 +293,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
@@ -322,7 +322,7 @@ use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result b/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result
new file mode 100644
index 00000000000..bf7ced0dd89
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result
@@ -0,0 +1,502 @@
+include/master-slave.inc
+[connection master]
+#Test case 1:
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging_1;
+INSERT t3 VALUES (1);
+END;
+SAVEPOINT event_logging_1;
+INSERT INTO t2 VALUES (1);
+RELEASE SAVEPOINT event_logging_1;
+END|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+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 INTEGER PRIMARY KEY) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t3 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging_1;
+INSERT t3 VALUES (1);
+END;
+SAVEPOINT event_logging_1;
+INSERT INTO t2 VALUES (1);
+RELEASE SAVEPOINT event_logging_1;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # SAVEPOINT `event_logging_1`
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+[connection master]
+DROP TRIGGER tr1;
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
+# Test case 2:
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging_2;
+INSERT t3 VALUES (3);
+END;
+SAVEPOINT event_logging_2;
+INSERT INTO t2 VALUES (1);
+RELEASE SAVEPOINT event_logging_2;
+END|
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1()|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+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 INTEGER PRIMARY KEY) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t3 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging_1;
+INSERT t3 VALUES (1);
+END;
+SAVEPOINT event_logging_1;
+INSERT INTO t2 VALUES (1);
+RELEASE SAVEPOINT event_logging_1;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # SAVEPOINT `event_logging_1`
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TRIGGER tr1
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging_2;
+INSERT t3 VALUES (3);
+END;
+SAVEPOINT event_logging_2;
+INSERT INTO t2 VALUES (1);
+RELEASE SAVEPOINT event_logging_2;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1()
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # SAVEPOINT `event_logging_2`
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE p1;
+# Test case 3:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig AFTER INSERT ON t FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+ROLLBACK TO savepoint_1;
+END |
+INSERT INTO t VALUES (2);
+INSERT INTO t VALUES (3);
+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 t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig AFTER INSERT ON t FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+ROLLBACK TO savepoint_1;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # SAVEPOINT `savepoint_1`
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # SAVEPOINT `savepoint_1`
+master-bin.000001 # Xid # # COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+[connection master]
+DROP TABLE t;
+# Test case 4:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+INSERT INTO t1 VALUES (5);
+END |
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+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 t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig BEFORE INSERT ON t FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+INSERT INTO t1 VALUES (5);
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: #
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # SAVEPOINT `savepoint_1`
+master-bin.000001 # Table_map # # table_id: # (test.t)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: #
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+5
+5
+30
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+5
+5
+30
+[connection master]
+DROP TABLE t;
+DROP TABLE t1;
+# Test case 5:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+END |
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+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 t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # SAVEPOINT `savepoint_1`
+master-bin.000001 # Table_map # # table_id: # (test.t)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+30
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+30
+[connection master]
+DROP TABLE t;
+DROP TABLE t1;
+# Test case 6:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+ROLLBACK TO event_logging_2;
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+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 INTEGER ) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+ROLLBACK TO event_logging_2;
+RETURN 0;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+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 # # SAVEPOINT `event_logging_2`
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+[connection master]
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+# Test case 7:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+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 INTEGER ) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+RETURN 0;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+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 # # SAVEPOINT `event_logging_2`
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: #
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+[connection master]
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+1
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+1
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+# Test case 8:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t1 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t1 VALUES (10);
+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 INTEGER ) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+RETURN 0;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+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 # # SAVEPOINT `event_logging_2`
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+[connection master]
+SELECT * FROM t1;
+f1
+1
+0
+2
+4
+10
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+f1
+1
+0
+2
+4
+10
+[connection master]
+DROP TABLE t1;
+DROP FUNCTION f1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result
index 57d92386638..e084d43f90a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp012.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp012.result
@@ -3,6 +3,7 @@ include/master-slave.inc
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
+create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;
SELECT CURRENT_USER();
@@ -17,6 +18,7 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
+set sql_mode=default;
<******** Master user1 p3 & p2 calls *******>
----------------------------------------------
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig004.result b/mysql-test/suite/rpl/r/rpl_row_trig004.result
index 50317b55e2e..075616b58cf 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig004.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig004.result
@@ -8,7 +8,7 @@ CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=INNOD
CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
INSERT INTO test.t2 VALUES (1, 0.0);
INSERT INTO test.t2 VALUES (1, 0.0);
-Got one of the listed errors
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
select * from test.t1;
n d
1 1.234
diff --git a/mysql-test/suite/rpl/r/rpl_row_triggers.result b/mysql-test/suite/rpl/r/rpl_row_triggers.result
index 82dbc727993..b4ae9861633 100644
--- a/mysql-test/suite/rpl/r/rpl_row_triggers.result
+++ b/mysql-test/suite/rpl/r/rpl_row_triggers.result
@@ -65,7 +65,7 @@ i0 1 a
i1 1 a
u0 1 a d
u1 1 a d
-# INSERT triggers which cause also UPDATE test (insert duplicate row)
+# INSERT triggers causing DELETE + INSERT (on unique key conflict)
insert into t1 values ('0','1');
SELECT * FROM t2 order by id;
id cnt o n
@@ -78,12 +78,12 @@ u1 1 a d
insert into t1 values ('0','1');
SELECT * FROM t2 order by id;
id cnt o n
-d0 1 d
-d1 1 d
+d0 2 0
+d1 2 0
i0 3 0
i1 3 0
-u0 2 0 0
-u1 2 0 0
+u0 1 a d
+u1 1 a d
# INSERT triggers which cause also DELETE test
# (insert duplicate row in table referenced by foreign key)
insert into t1 values ('1','1');
@@ -91,12 +91,12 @@ CREATE TABLE t3 (C1 CHAR(1) primary key, FOREIGN KEY (C1) REFERENCES t1(C1) ) en
insert into t1 values ('1','1');
SELECT * FROM t2 order by id;
id cnt o n
-d0 2 1
-d1 2 1
+d0 3 1
+d1 3 1
i0 5 1
i1 5 1
-u0 2 0 0
-u1 2 0 0
+u0 1 a d
+u1 1 a d
drop table t3,t1;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
@@ -237,4 +237,50 @@ a b
3 30
set global slave_run_triggers_for_rbr = @slave_run_triggers_for_rbr.saved;
drop table t1, tlog;
+#
+# MDEV-8411 Assertion `is_stat_field || !table || (!table->write_set ||
+# bitmap_is_set(table->write_set, field_index) ||
+# bitmap_is_set(table->vcol_set, field_index))'
+# failed in Field_timestamp::store_TIME_with_warning
+#
+#
+# Create table on master, replicate it on slave.
+#
+connection master;
+set @binlog_row_image.saved = @@binlog_row_image;
+set binlog_row_image = MINIMAL;
+create table t1 (pk int primary key, f int);
+connection slave;
+#
+# Create a trigger on the slave.
+#
+create trigger tr before update on t1 for each row set new.f = 1000;
+set @old_slave_run_triggers_for_rbr = @@global.slave_run_triggers_for_rbr;
+set global slave_run_triggers_for_rbr = YES;
+connection master;
+#
+# Update the table to have the trigger fire on the slave.,
+#
+insert into t1 values (1,1),(2,2);
+update t1 set pk=pk+10;
+select * from t1;
+pk f
+11 1
+12 2
+connection slave;
+#
+# Check to see if slave has the table updated.
+#
+select * from t1;
+pk f
+11 1000
+12 1000
+#
+# Cleanup
+#
+set global slave_run_triggers_for_rbr = @old_slave_run_triggers_for_rbr;
+connection master;
+set binlog_row_image = @binlog_row_image.saved;
+drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_triggers_sbr.result b/mysql-test/suite/rpl/r/rpl_row_triggers_sbr.result
deleted file mode 100644
index 96197393de9..00000000000
--- a/mysql-test/suite/rpl/r/rpl_row_triggers_sbr.result
+++ /dev/null
@@ -1,14 +0,0 @@
-include/master-slave.inc
-[connection master]
-set binlog_format = row;
-create table t1 (i int);
-create table t2 (i int);
-SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
-set global slave_run_triggers_for_rbr=YES;
-create trigger tr_before before insert on t1 for each row
-insert into t2 values (1);
-insert into t1 values (1);
-include/wait_for_slave_sql_error_and_skip.inc [errno=1666]
-drop tables t1,t2;
-SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index a09d44227a3..656dc45ea47 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -9,7 +9,8 @@ INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2;
include/stop_slave.inc
RESET SLAVE;
-START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1
+CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT;
+START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1;
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
n
@@ -18,7 +19,7 @@ n
3
4
include/check_slave_param.inc [Exec_Master_Log_Pos]
-START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
+START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
n
@@ -30,7 +31,7 @@ include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE;
include/wait_for_slave_to_start.inc
include/stop_slave.inc
-START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2
+START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2;
include/wait_for_slave_param.inc [Until_Log_Pos]
include/wait_for_slave_sql_to_stop.inc
include/check_slave_param.inc [Exec_Master_Log_Pos]
@@ -55,6 +56,7 @@ include/stop_slave_sql.inc
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
include/sync_slave_io_with_master.inc
+start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=relay_log_pos;
include/wait_for_slave_sql_to_stop.inc
include/assert.inc [table t1 should have two rows.]
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result
index 471de20ea6d..08369f60233 100644
--- a/mysql-test/suite/rpl/r/rpl_row_view01.result
+++ b/mysql-test/suite/rpl/r/rpl_row_view01.result
@@ -9,7 +9,6 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
-DROP TABLE IF EXISTS mysqltest1.t10;
CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a));
CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a));
@@ -32,7 +31,6 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
-CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a));
SELECT * FROM mysqltest1.v2;
qty price value
3 50 150
@@ -96,6 +94,5 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
-DROP TABLE IF EXISTS mysqltest1.t10;
DROP DATABASE mysqltest1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result
new file mode 100644
index 00000000000..708c3ef0313
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result
@@ -0,0 +1,467 @@
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Read semi-sync reply");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+#
+# Uninstall semi-sync plugins on master and slave
+#
+include/stop_slave.inc
+reset slave;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+reset master;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+#
+# Main test of semi-sync replication start here
+#
+[ on master ]
+set global rpl_semi_sync_master_timeout= 60000;
+[ default state of semi-sync on master should be OFF ]
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+[ enable semi-sync on master ]
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ status of semi-sync on master should be ON even without any semi-sync slaves ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+#
+# BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+# BUG#45673 Semisynch reports correct operation even if no slave is connected
+#
+[ status of semi-sync on master should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+reset master;
+[ on slave ]
+[ default state of semi-sync on slave should be OFF ]
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+[ enable semi-sync on slave ]
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+[ initial master state after the semi-sync slave connected ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+create table t1(a int) engine = ENGINE_TYPE;
+[ master state after CREATE TABLE statement ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 1
+select CONNECTIONS_NORMAL_SLAVE - CONNECTIONS_NORMAL_SLAVE as 'Should be 0';
+Should be 0
+0
+[ insert records to table ]
+insert t1 values (10);
+insert t1 values (9);
+insert t1 values (8);
+insert t1 values (7);
+insert t1 values (6);
+insert t1 values (5);
+insert t1 values (4);
+insert t1 values (3);
+insert t1 values (2);
+insert t1 values (1);
+[ master status after inserts ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 11
+[ on slave ]
+[ slave status after replicated inserts ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+10
+select min(a) from t1;
+min(a)
+1
+select max(a) from t1;
+max(a)
+10
+
+# BUG#50157
+# semi-sync replication crashes when replicating a transaction which
+# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
+[ on master ]
+SET SESSION AUTOCOMMIT= 0;
+CREATE TABLE t2(c1 INT) ENGINE=innodb;
+BEGIN;
+
+# Even though it is in a transaction, this statement is binlogged into binlog
+# file immediately.
+CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
+
+# These statements will not be binlogged until the transaction is committed
+INSERT INTO t2 VALUES(11);
+INSERT INTO t2 VALUES(22);
+COMMIT;
+DROP TABLE t2, t3;
+SET SESSION AUTOCOMMIT= 1;
+#
+# Test semi-sync master will switch OFF after one transaction
+# timeout waiting for slave reply.
+#
+include/stop_slave.inc
+[ on master ]
+set global rpl_semi_sync_master_timeout= 5000;
+[ master status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 16
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+[ semi-sync replication of these transactions will fail ]
+insert into t1 values (500);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 1
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 16
+delete from t1 where a=10;
+delete from t1 where a=9;
+delete from t1 where a=8;
+delete from t1 where a=7;
+delete from t1 where a=6;
+delete from t1 where a=5;
+delete from t1 where a=4;
+delete from t1 where a=3;
+delete from t1 where a=2;
+delete from t1 where a=1;
+insert into t1 values (100);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 16
+#
+# Test semi-sync status on master will be ON again when slave catches up
+#
+[ on slave ]
+[ slave status should be OFF ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+[ slave status should be ON ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+2
+select min(a) from t1;
+min(a)
+100
+select max(a) from t1;
+max(a)
+500
+[ on master ]
+[ master status should be ON again after slave catches up ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 16
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+#
+# Test disable/enable master semi-sync on the fly.
+#
+drop table t1;
+[ on slave ]
+include/stop_slave.inc
+#
+# Flush status
+#
+[ Semi-sync master status variables before FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 17
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+[ Semi-sync master status variables after FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on master ]
+show master logs;
+Log_name master-bin.000001
+File_size #
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ disable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ enable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+#
+# Test RESET MASTER/SLAVE
+#
+[ on slave ]
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+drop table t1;
+show status like 'Rpl_relay%';
+Variable_name Value
+[ test reset master ]
+[ on master]
+reset master;
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on slave ]
+include/stop_slave.inc
+reset slave;
+kill query _tid;
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+[ on slave ]
+select * from t1;
+a
+1
+2
+3
+[ on master ]
+[ master semi-sync status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 3
+#
+# Start semi-sync replication without SUPER privilege
+#
+include/stop_slave.inc
+reset slave;
+[ on master ]
+reset master;
+kill query _tid;
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+set sql_log_bin=1;
+[ on slave ]
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+change master to master_user='rpl',master_password='rpl_password';
+include/start_slave.inc
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+[ on master ]
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+insert into t1 values (4);
+insert into t1 values (5);
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 2
+#
+# Test semi-sync slave connect to non-semi-sync master
+#
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ on master ]
+kill query _tid;
+[ Semi-sync status on master should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+set global rpl_semi_sync_master_enabled= 0;
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (8);
+[ master semi-sync clients should be 1, status should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ on slave ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+include/stop_slave.inc
+[ on master ]
+set global rpl_semi_sync_master_enabled= 0;
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (10);
+#
+# Test non-semi-sync slave connect to semi-sync master
+#
+set global rpl_semi_sync_master_timeout= 5000;
+set global rpl_semi_sync_master_enabled= 1;
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ uninstall semi-sync slave plugin ]
+set global rpl_semi_sync_slave_enabled= 0;
+[ reinstall semi-sync slave plugin and disable semi-sync ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+#
+# Clean up
+#
+include/stop_slave.inc
+set global rpl_semi_sync_slave_enabled= 0;
+set global rpl_semi_sync_master_enabled= 0;
+change master to master_user='root',master_password='';
+include/start_slave.inc
+drop table t1;
+drop user rpl@127.0.0.1;
+flush privileges;
+set global rpl_semi_sync_master_timeout= default;
+include/rpl_end.inc
+set global rpl_semi_sync_master_wait_point=default;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result
new file mode 100644
index 00000000000..06573145e86
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result
@@ -0,0 +1,467 @@
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Read semi-sync reply");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+#
+# Uninstall semi-sync plugins on master and slave
+#
+include/stop_slave.inc
+reset slave;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+reset master;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+#
+# Main test of semi-sync replication start here
+#
+[ on master ]
+set global rpl_semi_sync_master_timeout= 60000;
+[ default state of semi-sync on master should be OFF ]
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+[ enable semi-sync on master ]
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ status of semi-sync on master should be ON even without any semi-sync slaves ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+#
+# BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+# BUG#45673 Semisynch reports correct operation even if no slave is connected
+#
+[ status of semi-sync on master should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+reset master;
+[ on slave ]
+[ default state of semi-sync on slave should be OFF ]
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+[ enable semi-sync on slave ]
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+[ initial master state after the semi-sync slave connected ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+create table t1(a int) engine = ENGINE_TYPE;
+[ master state after CREATE TABLE statement ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 1
+select CONNECTIONS_NORMAL_SLAVE - CONNECTIONS_NORMAL_SLAVE as 'Should be 0';
+Should be 0
+0
+[ insert records to table ]
+insert t1 values (10);
+insert t1 values (9);
+insert t1 values (8);
+insert t1 values (7);
+insert t1 values (6);
+insert t1 values (5);
+insert t1 values (4);
+insert t1 values (3);
+insert t1 values (2);
+insert t1 values (1);
+[ master status after inserts ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 11
+[ on slave ]
+[ slave status after replicated inserts ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+10
+select min(a) from t1;
+min(a)
+1
+select max(a) from t1;
+max(a)
+10
+
+# BUG#50157
+# semi-sync replication crashes when replicating a transaction which
+# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
+[ on master ]
+SET SESSION AUTOCOMMIT= 0;
+CREATE TABLE t2(c1 INT) ENGINE=innodb;
+BEGIN;
+
+# Even though it is in a transaction, this statement is binlogged into binlog
+# file immediately.
+CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
+
+# These statements will not be binlogged until the transaction is committed
+INSERT INTO t2 VALUES(11);
+INSERT INTO t2 VALUES(22);
+COMMIT;
+DROP TABLE t2, t3;
+SET SESSION AUTOCOMMIT= 1;
+#
+# Test semi-sync master will switch OFF after one transaction
+# timeout waiting for slave reply.
+#
+include/stop_slave.inc
+[ on master ]
+set global rpl_semi_sync_master_timeout= 5000;
+[ master status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+[ semi-sync replication of these transactions will fail ]
+insert into t1 values (500);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 1
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+delete from t1 where a=10;
+delete from t1 where a=9;
+delete from t1 where a=8;
+delete from t1 where a=7;
+delete from t1 where a=6;
+delete from t1 where a=5;
+delete from t1 where a=4;
+delete from t1 where a=3;
+delete from t1 where a=2;
+delete from t1 where a=1;
+insert into t1 values (100);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+#
+# Test semi-sync status on master will be ON again when slave catches up
+#
+[ on slave ]
+[ slave status should be OFF ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+[ slave status should be ON ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+2
+select min(a) from t1;
+min(a)
+100
+select max(a) from t1;
+max(a)
+500
+[ on master ]
+[ master status should be ON again after slave catches up ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 14
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+#
+# Test disable/enable master semi-sync on the fly.
+#
+drop table t1;
+[ on slave ]
+include/stop_slave.inc
+#
+# Flush status
+#
+[ Semi-sync master status variables before FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 12
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 15
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+[ Semi-sync master status variables after FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on master ]
+show master logs;
+Log_name master-bin.000001
+File_size #
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ disable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ enable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+#
+# Test RESET MASTER/SLAVE
+#
+[ on slave ]
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+drop table t1;
+show status like 'Rpl_relay%';
+Variable_name Value
+[ test reset master ]
+[ on master]
+reset master;
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on slave ]
+include/stop_slave.inc
+reset slave;
+kill query _tid;
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+[ on slave ]
+select * from t1;
+a
+1
+2
+3
+[ on master ]
+[ master semi-sync status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 3
+#
+# Start semi-sync replication without SUPER privilege
+#
+include/stop_slave.inc
+reset slave;
+[ on master ]
+reset master;
+kill query _tid;
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+set sql_log_bin=1;
+[ on slave ]
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+change master to master_user='rpl',master_password='rpl_password';
+include/start_slave.inc
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+[ on master ]
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+insert into t1 values (4);
+insert into t1 values (5);
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 2
+#
+# Test semi-sync slave connect to non-semi-sync master
+#
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ on master ]
+kill query _tid;
+[ Semi-sync status on master should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+set global rpl_semi_sync_master_enabled= 0;
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (8);
+[ master semi-sync clients should be 1, status should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ on slave ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+include/stop_slave.inc
+[ on master ]
+set global rpl_semi_sync_master_enabled= 0;
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (10);
+#
+# Test non-semi-sync slave connect to semi-sync master
+#
+set global rpl_semi_sync_master_timeout= 5000;
+set global rpl_semi_sync_master_enabled= 1;
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ uninstall semi-sync slave plugin ]
+set global rpl_semi_sync_slave_enabled= 0;
+[ reinstall semi-sync slave plugin and disable semi-sync ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+#
+# Clean up
+#
+include/stop_slave.inc
+set global rpl_semi_sync_slave_enabled= 0;
+set global rpl_semi_sync_master_enabled= 0;
+change master to master_user='root',master_password='';
+include/start_slave.inc
+drop table t1;
+drop user rpl@127.0.0.1;
+flush privileges;
+set global rpl_semi_sync_master_timeout= default;
+include/rpl_end.inc
+set global rpl_semi_sync_master_wait_point=default;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result
new file mode 100644
index 00000000000..4533e7fb4ac
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result
@@ -0,0 +1,54 @@
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
+call mtr.add_suppression("Read semi-sync reply");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+set global rpl_semi_sync_master_enabled = 1;
+include/stop_slave.inc
+set global rpl_semi_sync_slave_enabled = 1;
+include/start_slave.inc
+SET GLOBAL event_scheduler = ON;
+CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=ENGINE_TYPE;
+INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
+INSERT INTO t1 SELECT i+5, f FROM t1;
+INSERT INTO t1 SELECT i+10, f FROM t1;
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
+CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
+STOP SLAVE IO_THREAD;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 20;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 19;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 18;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 17;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 16;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 15;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 14;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 13;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 12;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 11;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 10;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 9;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 8;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 7;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 6;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 5;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 4;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 3;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 2;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 1;
+SET GLOBAL event_scheduler = OFF;
+include/stop_slave.inc
+set global rpl_semi_sync_slave_enabled = 0;
+set global rpl_semi_sync_master_enabled = 0;
+include/start_slave.inc
+DROP EVENT ev1;
+DROP EVENT ev2;
+DROP TABLE t1;
+include/rpl_end.inc
+set global rpl_semi_sync_master_wait_point=default;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
new file mode 100644
index 00000000000..36a6ea655a2
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
@@ -0,0 +1,133 @@
+#
+# Preparation
+#
+CREATE TABLE t1 (i INT NOT NULL, PRIMARY KEY (i)) ENGINE=InnoDB;
+RESET MASTER;
+SET @@global.rpl_semi_sync_master_timeout = 60000;
+SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
+# It's okay to see "Killed" but we should not see "Timeout" in the log.
+call mtr.add_suppression("Killed waiting for reply of binlog");
+call mtr.add_suppression("Run function 'after_commit' in plugin 'rpl_semi_sync_master' failed");
+call mtr.add_suppression("Run function 'after_sync' in plugin 'rpl_semi_sync_master' failed");
+#
+# Test wait point = AFTER_COMMIT
+#
+SET @@global.rpl_semi_sync_master_wait_point = AFTER_COMMIT;
+# Make another connection to INSERT from.
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+# Go ahead and send the INSERT; it should block.
+INSERT INTO t1 (i) VALUES (1);
+# The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+should_be_waiting
+Waiting for semi-sync ACK from slave
+# The insert should be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+# Kill the waiting thread; it should die immediately.
+KILL @other_connection_id;
+# Collect the error from the INSERT thread; it should be disconnected.
+Got one of the listed errors
+# Wait for INSERT thread to actually disappear (KILL closes connection
+# before thread actually finishes its processing).
+# The INSERT thread should now be gone.
+SELECT state AS should_be_empty_set
+FROM information_schema.processlist WHERE id = @other_connection_id;
+should_be_empty_set
+# The insert is still there
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+# Make another connection to INSERT from.
+# Go ahead and send the INSERT; it should block.
+INSERT INTO t1 (i) VALUES (2);
+# The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+should_be_waiting
+Waiting for semi-sync ACK from slave
+# The insert should be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+2
+# Now restart server
+# Done restarting server
+# Reset setting that were lost in restart
+SET @@global.rpl_semi_sync_master_timeout = 60000;
+SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
+# Check that row is still there
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+2
+#
+# Test wait point = AFTER_SYNC
+#
+SET @@global.rpl_semi_sync_master_wait_point = AFTER_SYNC;
+# Make another connection to INSERT from.
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+# Go ahead and send the INSERT; it should block.
+INSERT INTO t1 (i) VALUES (3);
+# The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+should_be_waiting
+Waiting for semi-sync ACK from slave
+# The insert should NOT be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+2
+# Kill the waiting thread; it should die immediately.
+KILL @other_connection_id;
+# Collect the error from the INSERT thread; it should be disconnected.
+Got one of the listed errors
+# Wait for INSERT thread to actually disappear (KILL closes connection
+# before thread actually finishes its processing).
+# The INSERT thread should now be gone.
+SELECT state AS should_be_empty_set
+FROM information_schema.processlist WHERE id = @other_connection_id;
+should_be_empty_set
+# The row inserted is there
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+2
+3
+# Make another connection to INSERT from.
+# Go ahead and send the INSERT; it should block.
+INSERT INTO t1 (i) VALUES (4);
+# The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+should_be_waiting
+Waiting for semi-sync ACK from slave
+# The insert should NOT be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+2
+3
+# Now restart server
+# Done restarting server
+# Reset setting that were lost in restart
+SET @@global.rpl_semi_sync_master_timeout = 60000;
+SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
+# But the row inserted is there
+SELECT * FROM t1 ORDER BY 1;
+i
+1
+2
+3
+4
+#
+# Cleanup
+#
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+DROP TABLE t1;
+SET @@global.rpl_semi_sync_master_timeout = 10000;
+SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
+SET @@global.rpl_semi_sync_master_wait_point = AFTER_COMMIT;
diff --git a/mysql-test/suite/rpl/r/rpl_set_statement.result b/mysql-test/suite/rpl/r/rpl_set_statement.result
new file mode 100644
index 00000000000..c9df74b0d3b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_set_statement.result
@@ -0,0 +1,142 @@
+include/master-slave.inc
+[connection master]
+set sql_mode="";
+set sql_mode="";
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+call mtr.add_suppression("Unsafe statement written to the binary log*");
+CREATE TABLE t1 (a bigint unsigned not null);
+CREATE TABLE t2 (a char(255) not null);
+
+There are the following types of variables:
+1) variables that are NOT replicated correctly when using STATEMENT mode;
+
+[connection master]
+SELECT @@max_join_size;
+@@max_join_size
+18446744073709551615
+[connection slave]
+SELECT @@max_join_size;
+@@max_join_size
+18446744073709551615
+[connection master]
+SET STATEMENT max_join_size=2 FOR
+INSERT INTO t1 VALUES(@@max_join_size);
+SELECT @@max_join_size;
+@@max_join_size
+18446744073709551615
+[connection slave]
+SELECT * FROM t1;
+a
+18446744073709551615
+SELECT @@max_join_size;
+@@max_join_size
+18446744073709551615
+[connection master]
+DELETE FROM t1;
+
+2) variables thar ARE replicated correctly
+They must be replicated correctly with "SET STATEMENT" too.
+
+[connection master]
+SELECT @@auto_increment_increment;
+@@auto_increment_increment
+1
+[connection slave]
+SELECT @@auto_increment_increment;
+@@auto_increment_increment
+1
+[connection master]
+SET STATEMENT auto_increment_increment=10 FOR
+INSERT INTO t1 VALUES(@@auto_increment_increment);
+SELECT @@auto_increment_increment;
+@@auto_increment_increment
+1
+[connection slave]
+SELECT * FROM t1;
+a
+10
+SELECT @@auto_increment_increment;
+@@auto_increment_increment
+1
+[connection master]
+DELETE FROM t1;
+
+3) sql_mode which is replicated correctly exept NO_DIR_IN_CREATE value;
+
+[connection master]
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection slave]
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection master]
+SET STATEMENT sql_mode='ERROR_FOR_DIVISION_BY_ZERO' FOR
+INSERT INTO t2 VALUES(@@sql_mode);
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection slave]
+SELECT * FROM t2;
+a
+ERROR_FOR_DIVISION_BY_ZERO
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection master]
+DELETE FROM t2;
+[connection master]
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection slave]
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection master]
+SET STATEMENT sql_mode='NO_DIR_IN_CREATE' FOR
+INSERT INTO t2 VALUES(@@sql_mode);
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection slave]
+SELECT * FROM t2;
+a
+
+SELECT @@sql_mode;
+@@sql_mode
+
+[connection master]
+DELETE FROM t2;
+
+4) variables that are not replicated at all:
+default_storage_engine, storage_engine, max_heap_table_size
+
+[connection master]
+SELECT @@max_heap_table_size;
+@@max_heap_table_size
+1048576
+[connection slave]
+SELECT @@max_heap_table_size;
+@@max_heap_table_size
+1048576
+[connection master]
+SET STATEMENT max_heap_table_size=16384 FOR
+INSERT INTO t1 VALUES(@@max_heap_table_size);
+SELECT @@max_heap_table_size;
+@@max_heap_table_size
+1048576
+[connection slave]
+SELECT * FROM t1;
+a
+1048576
+SELECT @@max_heap_table_size;
+@@max_heap_table_size
+1048576
+[connection master]
+DELETE FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
+include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_statement.test b/mysql-test/suite/rpl/r/rpl_set_statement.test
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_set_statement.test
diff --git a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
new file mode 100644
index 00000000000..fdefdc9d7c3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+include/stop_slave.inc
+RESET SLAVE ALL;
+# Does not work for CHANGE MASTER:
+SET STATEMENT default_master_connection = 'm1' FOR
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root';
+#
+# The first field, Connection_name, should say 'm1'...
+#
+Connection_name = 'm1'
+RESET SLAVE ALL;
+CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root';
+SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
+set default_master_connection = 'm1';
+stop slave;
+include/wait_for_slave_to_stop.inc
+reset slave all;
+set default_master_connection = '';
diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
index aff83e1b99e..105b9d5c65f 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
@@ -95,6 +95,9 @@ t2 CREATE TABLE `t2` (
`data` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show global status like 'slave_skipped_errors';
+Variable_name Value
+Slave_skipped_errors 4
INSERT INTO t2 VALUES(1, 1);
INSERT INTO t2 VALUES(2, 1);
INSERT INTO t2 VALUES(3, 1);
@@ -104,6 +107,9 @@ DELETE FROM t2 WHERE id = 5;
SET SQL_LOG_BIN=1;
UPDATE t2 SET id= id + 3, data = 2;
+show global status like 'slave_skipped_errors';
+Variable_name Value
+Slave_skipped_errors 5
**** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR.
==== Clean Up ====
diff --git a/mysql-test/suite/rpl/r/rpl_skip_replication.result b/mysql-test/suite/rpl/r/rpl_skip_replication.result
index 92b5fa5f629..586a104239a 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_replication.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_replication.result
@@ -8,22 +8,22 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo
DROP USER'nonsuperuser'@'127.0.0.1';
SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
-replicate
+REPLICATE
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
-replicate
+REPLICATE
STOP SLAVE;
SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
-replicate
+REPLICATE
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
-filter_on_master
+FILTER_ON_MASTER
START SLAVE;
SELECT @@skip_replication;
@@skip_replication
diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
index 79b83b4ceb9..2de0f5ccd82 100644
--- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
@@ -76,6 +76,21 @@ ALTER TABLE t1 ADD INDEX id1(a);
INSERT INTO t1 values(1, sleep(3));
### Assertion is good. Both Master and Slave exhibit the
### same number of queries in slow log: 1
+********************************************************************
+**** TRUNCATE the slow log then check whether runtime changes of
+**** log_slow_slave_statements work without slave restart.
+********************************************************************
+SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
+SET @@global.log_slow_slave_statements = off;
+TRUNCATE mysql.slow_log;
+INSERT INTO t1 values(1, sleep(3));;
+SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
+sql_text
+SET @@global.log_slow_slave_statements = on;
+INSERT INTO t1 values(1, sleep(3));;
+SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
+sql_text
+INSERT INTO t1 values(1, sleep(3))
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index b7b90cd1594..177463f45d8 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -1,5 +1,7 @@
include/master-slave.inc
[connection master]
+set local sql_mode='';
+set global sql_mode='';
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -1311,3 +1313,4 @@ drop table t1;
drop procedure p1;
# End of 5.5 tests.
include/rpl_end.inc
+set global sql_mode=default;
diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
index 35aaabc8c56..f02fa4e7b9f 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+create user replssl@localhost;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int auto_increment, KEY(t));
stop slave;
diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result
index a7a56d7c5ee..c9fe21a7929 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+create user replssl@localhost;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
stop slave;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index da925035c9c..4d187095d17 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -215,7 +215,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Gtid # # GTID #-#-#
master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
master-bin.000002 # Gtid # # GTID #-#-#
@@ -252,7 +251,6 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Gtid # # GTID #-#-#
slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Gtid # # BEGIN GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_stm_maria.result b/mysql-test/suite/rpl/r/rpl_stm_maria.result
index 08d202b61c0..7a9dfcd6061 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_maria.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_maria.result
@@ -39,7 +39,7 @@ select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4)
100 log 0 0 0.0000
101 t1 1 1 0.3203
-102 t1 0 2 0.5666
+102 t1 NULL 2 0.5666
103 t2 1 2 0.9164
104 t2 3 0 0.8826
105 t2 4 0 0.6635
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index b1cea5227f6..967acb540bd 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -25,7 +25,7 @@ n
3
4
include/check_slave_param.inc [Exec_Master_Log_Pos]
-start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS;
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_stop.inc
select * from t1;
@@ -52,18 +52,18 @@ include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_stop.inc
include/check_slave_param.inc [Exec_Master_Log_Pos]
==== Test various error conditions ====
-start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS;
+start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS;
+start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS;
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave sql_thread;
-start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
+start slave until master_log_file='master-bin.000001', master_log_pos=776;
Warnings:
Note 1254 Slave is already running
include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_strict_password_validation.result b/mysql-test/suite/rpl/r/rpl_strict_password_validation.result
new file mode 100644
index 00000000000..071d730fa72
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_strict_password_validation.result
@@ -0,0 +1,13 @@
+include/master-slave.inc
+[connection master]
+install soname "simple_password_check";
+select @@strict_password_validation;
+@@strict_password_validation
+1
+create user foo1 identified by password '11111111111111111111111111111111111111111';
+set password for foo1 = PASSWORD('PLAINtext-password!!99');
+drop user foo1;
+create user foo1 identified by password '11111111111111111111111111111111111111111';
+ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
+uninstall plugin simple_password_check;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_table_options.result b/mysql-test/suite/rpl/r/rpl_table_options.result
index a94d6e9bc2f..a417aaf720d 100644
--- a/mysql-test/suite/rpl/r/rpl_table_options.result
+++ b/mysql-test/suite/rpl/r/rpl_table_options.result
@@ -7,7 +7,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 `VAROPT`='5'
+) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
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 1933b0b82f8..5e70bf85ab9 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
@@ -67,8 +67,6 @@ slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Xid # # COMMIT /* XID */
-slave-bin.000001 # Gtid # # GTID #-#-#
-slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2_tmp` /* generated by server */
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
slave-bin.000001 # Xid # # COMMIT /* XID */
@@ -90,7 +88,7 @@ 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 `test`; CREATE TABLE `t1` (
- `rand()` double NOT NULL DEFAULT '0'
+ `rand()` double NOT NULL
) ENGINE=MyISAM
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result b/mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result
new file mode 100644
index 00000000000..2e9116ced2d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result
@@ -0,0 +1,83 @@
+include/master-slave.inc
+[connection master]
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+1
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+1
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result
new file mode 100644
index 00000000000..7cb7d177f1a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+SET @@global.mysql56_temporal_format=false;;
+SET @@global.mysql56_temporal_format=false;;
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+0
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+0
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 33 33
+t2 1 41 41
+t3 1 50 50
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 33 33
+t2 1 41 41
+t3 1 50 50
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result
new file mode 100644
index 00000000000..74c287578d7
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+SET @@global.mysql56_temporal_format=false;;
+SET @@global.mysql56_temporal_format=true;;
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+0
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+1
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 33 33
+t2 1 41 41
+t3 1 50 50
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56_dst.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56_dst.result
new file mode 100644
index 00000000000..352101cb8cd
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56_dst.result
@@ -0,0 +1,28 @@
+include/master-slave.inc
+[connection master]
+set global time_zone='Europe/Moscow';
+set time_zone='UTC';
+stop slave;
+start slave;
+set global mysql56_temporal_format=false;
+set global time_zone='Europe/Moscow';
+set time_zone='UTC';
+create table t1 (pk int primary key, t timestamp not null);
+set timestamp = 1288477526;
+insert into t1 values (1,null);
+set timestamp = 1288481126;
+insert into t1 values (2,null);
+select pk, t, unix_timestamp(t) from t1;
+pk t unix_timestamp(t)
+1 2010-10-30 22:25:26 1288477526
+2 2010-10-30 23:25:26 1288481126
+set time_zone=default;
+select pk, t, unix_timestamp(t) from t1;
+pk t unix_timestamp(t)
+1 2010-10-31 02:25:26 1288477526
+2 2010-10-31 02:25:26 1288481126
+set global time_zone=default;
+drop table t1;
+set global time_zone=default;
+set global mysql56_temporal_format=default;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result
new file mode 100644
index 00000000000..cc22e00aeb1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+SET @@global.mysql56_temporal_format=true;;
+SET @@global.mysql56_temporal_format=false;;
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+1
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+0
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 33 33
+t2 1 41 41
+t3 1 50 50
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result
new file mode 100644
index 00000000000..8675283435a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+SET @@global.mysql56_temporal_format=true;;
+SET @@global.mysql56_temporal_format=true;;
+SELECT @@global.mysql56_temporal_format AS on_master;
+on_master
+1
+SELECT @@global.mysql56_temporal_format AS on_slave;
+on_slave
+1
+CREATE TABLE t1
+(
+c0 TIME(0),
+c1 TIME(1),
+c2 TIME(2),
+c3 TIME(3),
+c4 TIME(4),
+c5 TIME(5),
+c6 TIME(6)
+);
+CREATE TABLE t2
+(
+c0 TIMESTAMP(0),
+c1 TIMESTAMP(1),
+c2 TIMESTAMP(2),
+c3 TIMESTAMP(3),
+c4 TIMESTAMP(4),
+c5 TIMESTAMP(5),
+c6 TIMESTAMP(6)
+);
+CREATE TABLE t3
+(
+c0 DATETIME(0),
+c1 DATETIME(1),
+c2 DATETIME(2),
+c3 DATETIME(3),
+c4 DATETIME(4),
+c5 DATETIME(5),
+c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+SELECT * FROM t1;;
+c0 01:01:01
+c1 01:01:01.1
+c2 01:01:01.11
+c3 01:01:01.111
+c4 01:01:01.1111
+c5 01:01:01.11111
+c6 01:01:01.111111
+SELECT * FROM t2;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT * FROM t3;;
+c0 2001-01-01 01:01:01
+c1 2001-01-01 01:01:01.1
+c2 2001-01-01 01:01:01.11
+c3 2001-01-01 01:01:01.111
+c4 2001-01-01 01:01:01.1111
+c5 2001-01-01 01:01:01.11111
+c6 2001-01-01 01:01:01.111111
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+t1 1 34 34
+t2 1 41 41
+t3 1 48 48
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+SET @@global.mysql56_temporal_format=DEFAULT;
+SET @@global.mysql56_temporal_format=DEFAULT;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result
index ecc95481f2d..de4c9dafc1c 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result
@@ -20,17 +20,31 @@ mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
`b` datetime(1) DEFAULT NULL,
`c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @@mysql56_temporal_format;
+@@mysql56_temporal_format
+1
SET TIME_ZONE='+00:00';
CREATE TABLE mysql050614_temporal0 (a time(0), b datetime(0), c timestamp(0)) engine=myisam;
CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) engine=myisam;
INSERT INTO mysql050614_temporal0 VALUES ('00:00:02','2001-01-01 00:00:02','2001-01-01 00:00:02');
INSERT INTO mysql050614_temporal1 VALUES ('00:00:02.1','2001-01-01 00:00:02.2','2001-01-01 00:00:02.3');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+mysql050614_temporal0 2 13 26
+mysql050614_temporal1 1 16 16
SELECT * FROM mysql050614_temporal0;
a b c
00:00:02 2001-01-01 00:00:02 2001-01-01 00:00:02
SELECT * FROM mysql050614_temporal1;
a b c
00:00:02.1 2001-01-01 00:00:02.2 2001-01-01 00:00:02.3
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+mysql050614_temporal0 1 13 13
+mysql050614_temporal1 1 16 16
+SET @@global.mysql56_temporal_format=DEFAULT;
DROP TABLE mysql050614_temporal0;
DROP TABLE mysql050614_temporal1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result
new file mode 100644
index 00000000000..37373367f8a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result
@@ -0,0 +1,51 @@
+include/master-slave.inc
+[connection master]
+SET @@global.mysql56_temporal_format=false;;
+#
+# Testing replication from MariaDB-10.0 master
+# started over MySQL-5.6 data directory
+# to MariaDB-10.0 slave running with natively created tables
+#
+SET TIME_ZONE='+00:00';
+SHOW CREATE TABLE mysql050614_temporal0;
+Table Create Table
+mysql050614_temporal0 CREATE TABLE `mysql050614_temporal0` (
+ `a` time DEFAULT NULL,
+ `b` datetime DEFAULT NULL,
+ `c` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE mysql050614_temporal1;
+Table Create Table
+mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
+ `a` time(1) DEFAULT NULL,
+ `b` datetime(1) DEFAULT NULL,
+ `c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @@mysql56_temporal_format;
+@@mysql56_temporal_format
+0
+SET TIME_ZONE='+00:00';
+CREATE TABLE mysql050614_temporal0 (a time(0), b datetime(0), c timestamp(0)) engine=myisam;
+CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) engine=myisam;
+INSERT INTO mysql050614_temporal0 VALUES ('00:00:02','2001-01-01 00:00:02','2001-01-01 00:00:02');
+INSERT INTO mysql050614_temporal1 VALUES ('00:00:02.1','2001-01-01 00:00:02.2','2001-01-01 00:00:02.3');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+mysql050614_temporal0 2 13 26
+mysql050614_temporal1 1 16 16
+SELECT * FROM mysql050614_temporal0;
+a b c
+00:00:02 2001-01-01 00:00:02 2001-01-01 00:00:02
+SELECT * FROM mysql050614_temporal1;
+a b c
+00:00:02.1 2001-01-01 00:00:02.2 2001-01-01 00:00:02.3
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
+TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
+mysql050614_temporal0 1 16 16
+mysql050614_temporal1 1 16 16
+SET @@global.mysql56_temporal_format=DEFAULT;
+DROP TABLE mysql050614_temporal0;
+DROP TABLE mysql050614_temporal1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index c0e35274594..6b63d8cda31 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -35,7 +35,7 @@ select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4)
100 log 0 0 0.0000
101 t1 1 1 0.3203
-102 t1 0 2 0.5666
+102 t1 NULL 2 0.5666
103 t2 1 2 0.9164
104 t2 3 0 0.8826
105 t2 4 0 0.6635
@@ -58,7 +58,7 @@ select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4)
100 log 0 0 0.0000
101 t1 1 1 0.3203
-102 t1 0 2 0.5666
+102 t1 NULL 2 0.5666
103 t2 1 2 0.9164
104 t2 3 0 0.8826
105 t2 4 0 0.6635
diff --git a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result
new file mode 100644
index 00000000000..f966f18964b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result
@@ -0,0 +1,88 @@
+include/master-slave.inc
+[connection master]
+*** MDEV-9383: Server fails to read master.info after upgrade 10.0 -> 10.1 ***
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=CURRENT_POS;
+include/rpl_stop_server.inc [server_number=2]
+include/rpl_start_server.inc [server_number=2]
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+include/save_master_gtid.inc
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+a
+1
+include/stop_slave.inc
+include/rpl_stop_server.inc [server_number=2]
+include/rpl_start_server.inc [server_number=2]
+INSERT INTO t1 VALUES (2);
+include/save_master_gtid.inc
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+include/stop_slave.inc
+include/rpl_stop_server.inc [server_number=2]
+include/rpl_start_server.inc [server_number=2]
+INSERT INTO t1 VALUES (3);
+include/save_master_gtid.inc
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+include/stop_slave.inc
+include/rpl_stop_server.inc [server_number=2]
+include/rpl_start_server.inc [server_number=2]
+INSERT INTO t1 VALUES (4);
+include/save_master_gtid.inc
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+include/stop_slave.inc
+include/rpl_stop_server.inc [server_number=2]
+include/rpl_start_server.inc [server_number=2]
+INSERT INTO t1 VALUES (5);
+include/save_master_gtid.inc
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+include/stop_slave.inc
+include/rpl_stop_server.inc [server_number=2]
+include/rpl_start_server.inc [server_number=2]
+INSERT INTO t1 VALUES (6);
+include/save_master_gtid.inc
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index 8711dce4ab6..f91cdad6e47 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -38,6 +38,34 @@ include/stop_slave.inc
include/start_slave.inc
SET @@global.init_slave = 'SELECT 1';
[on master]
+SELECT @@pid_file, @@datadir;
+@@pid_file MYSQLTEST_VARDIR/run/mysqld.1.pid
+@@datadir MYSQLTEST_VARDIR/mysqld.1/data/
+**** Relay log variables
+SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+@@relay_log master-relay-bin
+@@relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
+@@relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin
+**** Binary log variables
+SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+@@log_bin 1
+@@log_bin_index MYSQLTEST_VARDIR/mysqld.1/data/master-bin.index
+@@log_bin_basename MYSQLTEST_VARDIR/mysqld.1/data/master-bin
+[on slave]
+SELECT @@pid_file, @@datadir;
+@@pid_file MYSQLTEST_VARDIR/run/mysqld.2.pid
+@@datadir MYSQLTEST_VARDIR/mysqld.2/data/
+**** Relay log variables
+SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+@@relay_log slave-relay-bin
+@@relay_log_index MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.index
+@@relay_log_basename MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin
+**** Binary log variables
+SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+@@log_bin 1
+@@log_bin_index MYSQLTEST_VARDIR/mysqld.2/data/slave-bin.index
+@@log_bin_basename MYSQLTEST_VARDIR/mysqld.2/data/slave-bin
+[on master]
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
truth BOOLEAN,
num INT,
diff --git a/mysql-test/suite/rpl/r/rpl_view_debug.result b/mysql-test/suite/rpl/r/rpl_view_debug.result
new file mode 100644
index 00000000000..e4d97741d9f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_view_debug.result
@@ -0,0 +1,34 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-6409 CREATE VIEW replication problem if error occurs in mysql_register_view
+#
+# Check the bug where if an error occurs in mysql_register_view the view
+# is still replicated to the slave
+#
+create table t1 (a int);
+insert into t1 values (1);
+create view v1 as select a from t1;
+insert into v1 values (2);
+select * from v1 order by a;
+a
+1
+2
+show tables;
+Tables_in_test
+t1
+v1
+set @@debug_dbug="d,simulate_register_view_failure";
+CREATE VIEW v2 as SELECT * FROM t1;
+ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
+show tables;
+Tables_in_test
+t1
+v1
+show tables;
+Tables_in_test
+t1
+v1
+DROP VIEW IF EXISTS v1;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff b/mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff
new file mode 100644
index 00000000000..550f64173a7
--- /dev/null
+++ b/mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff
@@ -0,0 +1,11 @@
+--- suite/rpl/r/temporal_row-9560.result
++++ suite/rpl/r/temporal_row-9560.reject
+@@ -7,7 +7,7 @@
+ insert into t1 values ('2016-02-15 12:50:06.123');
+ select @@mysql56_temporal_format;
+ @@mysql56_temporal_format
+-0
++1
+ select * from t1;
+ ts
+ 2016-02-15 12:50:06.123
diff --git a/mysql-test/suite/rpl/r/temporal_row-9560.result b/mysql-test/suite/rpl/r/temporal_row-9560.result
new file mode 100644
index 00000000000..c6a57d43fd0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/temporal_row-9560.result
@@ -0,0 +1,15 @@
+include/master-slave.inc
+[connection master]
+select @@mysql56_temporal_format;
+@@mysql56_temporal_format
+0
+create table t1 (ts timestamp(3), t time(3), dt datetime(3));
+insert into t1 values ('2016-02-15 12:50:06.123', '12:50:06.123', '2016-02-15 12:50:06.123');
+select @@mysql56_temporal_format;
+@@mysql56_temporal_format
+0
+select * from t1;
+ts t dt
+2016-02-15 12:50:06.123 12:50:06.123 2016-02-15 12:50:06.123
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test b/mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test
new file mode 100644
index 00000000000..405d1a929f1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test
@@ -0,0 +1,35 @@
+#
+# MDEV-9737 Duplicate error in replication with slave triggers and auto increment
+#
+source include/master-slave.inc;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+
+create table t1(id int auto_increment primary key);
+create table t2(id int auto_increment primary key);
+
+sync_slave_with_master;
+create table slave_only(id int auto_increment primary key);
+insert into slave_only values(NULL);
+create trigger t1i after insert on t1 for each row insert into slave_only values(NULL);
+
+stop slave;
+set global replicate_ignore_table="test.t2";
+start slave;
+
+connection master;
+insert into t2 values(NULL);
+insert into t1 values(NULL);
+
+sync_slave_with_master;
+
+drop table t1, t2, slave_only;
+stop slave;
+set global replicate_ignore_table="";
+start slave;
+
+connection master;
+drop table t1, t2;
+
+source include/rpl_end.inc;
+
diff --git a/mysql-test/suite/rpl/t/mysql-wsrep#110-2.test b/mysql-test/suite/rpl/t/mysql-wsrep#110-2.test
new file mode 100644
index 00000000000..2b6d07913ab
--- /dev/null
+++ b/mysql-test/suite/rpl/t/mysql-wsrep#110-2.test
@@ -0,0 +1,44 @@
+#
+# codership/mysql-wsrep/110 - Assertion `table_found' failed in unpack_row() with SAVEPOINT, trigger, error handler
+#
+
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+
+DELIMITER |;
+
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK TO event_logging;
+ INSERT t3 VALUES (x);
+ END;
+ SAVEPOINT event_logging;
+
+ INSERT INTO t2 VALUES (x);
+
+ RELEASE SAVEPOINT event_logging;
+END|
+DELIMITER ;|
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+
+DROP PROCEDURE p1;
+
+sync_slave_with_master;
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_EE_err.test b/mysql-test/suite/rpl/t/rpl_EE_err.test
index 5272b11f342..28c5af0a192 100644
--- a/mysql-test/suite/rpl/t/rpl_EE_err.test
+++ b/mysql-test/suite/rpl/t/rpl_EE_err.test
@@ -1,3 +1,2 @@
--- source include/not_ndb_default.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_EE_err.test
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment.test b/mysql-test/suite/rpl/t/rpl_auto_increment.test
index 8869e3745db..fe0f1689471 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment.test
@@ -1,7 +1,6 @@
#####################################
# Wrapper for rpl_auto_increment.test#
#####################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=innodb;
let $engine_type2=myisam;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
index fb3b39fac9d..6a2cf20d756 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -1,405 +1 @@
-# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
-# when generating new name.
-#
-# WHY
-# ===
-#
-# We want to check whether error is reported or not when
-# new_file_impl fails (this may happen when rotation is not
-# possible because there is some problem finding an
-# unique filename).
-#
-# HOW
-# ===
-#
-# Test cases are documented inline.
-
--- source include/have_innodb.inc
--- source include/have_debug.inc
--- source include/master-slave.inc
-
--- echo #######################################################################
--- echo ####################### PART 1: MASTER TESTS ##########################
--- echo #######################################################################
-
-
-### ACTION: stopping slave as it is not needed for the first part of
-### the test
-
--- connection slave
--- source include/stop_slave.inc
--- connection master
-
-call mtr.add_suppression("Can't generate a unique log-filename");
-call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
-call mtr.add_suppression("Error writing file .*");
-
-SET @old_debug= @@global.debug;
-
-### ACTION: create a large file (> 4096 bytes) that will be later used
-### in LOAD DATA INFILE to check binlog errors in its vacinity
--- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
--- let $MYSQLD_DATADIR= `select @@datadir`
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
-
-### ACTION: create a small file (< 4096 bytes) that will be later used
-### in LOAD DATA INFILE to check for absence of binlog errors
-### when file loading this file does not force flushing and
-### rotating the binary log
--- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
--- let $MYSQLD_DATADIR= `select @@datadir`
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
-
-RESET MASTER;
-
--- echo ###################### TEST #1
-
-### ASSERTION: no problem flushing logs (should show two binlogs)
-FLUSH LOGS;
--- echo # assert: must show two binlogs
--- source include/show_binary_logs.inc
-
--- echo ###################### TEST #2
-
-### ASSERTION: check that FLUSH LOGS actually fails and reports
-### failure back to the user if find_uniq_filename fails
-### (should show just one binlog)
-
-RESET MASTER;
-SET GLOBAL debug_dbug="+d,error_unique_log_filename";
--- error ER_NO_UNIQUE_LOGFILE
-FLUSH LOGS;
--- echo # assert: must show one binlog
--- source include/show_binary_logs.inc
-
-### ACTION: clean up and move to next test
-SET GLOBAL debug_dbug="";
-RESET MASTER;
-
--- echo ###################### TEST #3
-
-### ACTION: create some tables (t1, t2, t4) and insert some values in
-### table t1
-CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
-CREATE TABLE t4 (a VARCHAR(16384));
-INSERT INTO t1 VALUES (1);
-RESET MASTER;
-
-### ASSERTION: we force rotation of the binary log because it exceeds
-### the max_binlog_size option (should show two binary
-### logs)
-
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
-
-# shows two binary logs
--- echo # assert: must show two binlog
--- source include/show_binary_logs.inc
-
-# clean up the table and the binlog to be used in next part of test
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #4
-
-### ASSERTION: load the big file into a transactional table and check
-### that it reports error. The table will contain the
-### changes performed despite the fact that it reported an
-### error.
-
-SET GLOBAL debug_dbug="+d,error_unique_log_filename";
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
-
-# show table
--- echo # assert: must show one entry
-SELECT count(*) FROM t2;
-
-# clean up the table and the binlog to be used in next part of test
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #5
-
-### ASSERTION: load the small file into a transactional table and
-### check that it succeeds
-
-SET GLOBAL debug_dbug="+d,error_unique_log_filename";
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
-
-# show table
--- echo # assert: must show one entry
-SELECT count(*) FROM t2;
-
-# clean up the table and the binlog to be used in next part of test
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #6
-
-### ASSERTION: check that even if one is using a transactional table
-### and explicit transactions (no autocommit) if rotation
-### fails we get the error. Transaction is not rolledback
-### because rotation happens after the commit.
-
-SET GLOBAL debug_dbug="+d,error_unique_log_filename";
-SET AUTOCOMMIT=0;
-INSERT INTO t2 VALUES ('muse');
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
-INSERT INTO t2 VALUES ('muse');
--- error ER_NO_UNIQUE_LOGFILE
-COMMIT;
-
-### ACTION: Show the contents of the table after the test
--- echo # assert: must show three entries
-SELECT count(*) FROM t2;
-
-### ACTION: clean up and move to the next test
-SET AUTOCOMMIT= 1;
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #7
-
-### ASSERTION: check that on a non-transactional table, if rotation
-### fails then an error is reported and an incident event
-### is written to the current binary log.
-
-SET GLOBAL debug_dbug="+d,error_unique_log_filename";
-SELECT count(*) FROM t4;
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
-
--- echo # assert: must show 1 entry
-SELECT count(*) FROM t4;
-
--- echo ### check that the incident event is written to the current log
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
--- let $binlog_limit= 4,1
--- source include/show_binlog_events.inc
-
-# clean up and move to next test
-DELETE FROM t4;
-RESET MASTER;
-
--- echo ###################### TEST #8
-
-### ASSERTION: check that statements end up in error but they succeed
-### on changing the data.
-
-SET GLOBAL debug_dbug="+d,error_unique_log_filename";
--- echo # must show 0 entries
-SELECT count(*) FROM t4;
-SELECT count(*) FROM t2;
-
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
--- error ER_NO_UNIQUE_LOGFILE
-INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
-
--- echo # INFO: Count(*) Before Offending DELETEs
--- echo # assert: must show 1 entry
-SELECT count(*) FROM t4;
--- echo # assert: must show 4 entries
-SELECT count(*) FROM t2;
-
--- error ER_NO_UNIQUE_LOGFILE
-DELETE FROM t4;
--- error ER_NO_UNIQUE_LOGFILE
-DELETE FROM t2;
-
--- echo # INFO: Count(*) After Offending DELETEs
--- echo # assert: must show zero entries
-SELECT count(*) FROM t4;
-SELECT count(*) FROM t2;
-
-# remove fault injection
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
-
--- echo ###################### TEST #9
-
-### ASSERTION: check that if we disable binlogging, then statements
-### succeed.
-SET GLOBAL debug_dbug="+d,error_unique_log_filename";
-SET SQL_LOG_BIN=0;
-INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
-INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
--- echo # assert: must show four entries
-SELECT count(*) FROM t2;
-SELECT count(*) FROM t4;
-DELETE FROM t2;
-DELETE FROM t4;
--- echo # assert: must show zero entries
-SELECT count(*) FROM t2;
-SELECT count(*) FROM t4;
-SET SQL_LOG_BIN=1;
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
-
--- echo ###################### TEST #10
-
-### ASSERTION: check that error is reported if there is a failure
-### while registering the index file and the binary log
-### file or failure to write the rotate event.
-
-call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
-call mtr.add_suppression("Could not open .*");
-
-RESET MASTER;
-SHOW WARNINGS;
-
-# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
-SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
--- replace_regex /\.[\\\/]master/master/
--- error ER_CANT_OPEN_FILE
-FLUSH LOGS;
-SET GLOBAL debug_dbug="-d,fault_injection_registering_index";
-
--- error ER_NO_BINARY_LOGGING
-SHOW BINARY LOGS;
-
-# issue some statements and check that they don't fail
-CREATE TABLE t5 (a INT);
-INSERT INTO t4 VALUES ('bbbbb');
-INSERT INTO t2 VALUES ('aaaaa');
-DELETE FROM t4;
-DELETE FROM t2;
-DROP TABLE t5;
-
--- echo ###################### TEST #11
-
-### ASSERTION: check that error is reported if there is a failure
-### while opening the index file and the binary log file or
-### failure to write the rotate event.
-
-# restart the server so that we have binlog again
---let $rpl_server_number= 1
---source include/rpl_restart_server.inc
-
-# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
-SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
--- replace_regex /\.[\\\/]master/master/
--- error ER_CANT_OPEN_FILE
-FLUSH LOGS;
-SET GLOBAL debug_dbug="-d,fault_injection_openning_index";
-
--- error ER_FLUSH_MASTER_BINLOG_CLOSED
-RESET MASTER;
-
-# issue some statements and check that they don't fail
-CREATE TABLE t5 (a INT);
-INSERT INTO t4 VALUES ('bbbbb');
-INSERT INTO t2 VALUES ('aaaaa');
-DELETE FROM t4;
-DELETE FROM t2;
-DROP TABLE t5;
-
-# restart the server so that we have binlog again
---let $rpl_server_number= 1
---source include/rpl_restart_server.inc
-
--- echo ###################### TEST #12
-
-### ASSERTION: check that error is reported if there is a failure
-### while writing the rotate event when creating a new log
-### file.
-
-# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
-SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
--- error ER_ERROR_ON_WRITE
-FLUSH LOGS;
-SET GLOBAL debug_dbug="-d,fault_injection_new_file_rotate_event";
-
--- error ER_FLUSH_MASTER_BINLOG_CLOSED
-RESET MASTER;
-
-# issue some statements and check that they don't fail
-CREATE TABLE t5 (a INT);
-INSERT INTO t4 VALUES ('bbbbb');
-INSERT INTO t2 VALUES ('aaaaa');
-DELETE FROM t4;
-DELETE FROM t2;
-DROP TABLE t5;
-
-# restart the server so that we have binlog again
---let $rpl_server_number= 1
---source include/rpl_restart_server.inc
-
-## clean up
-SET GLOBAL debug_dbug= @old_debug;
-DROP TABLE t1, t2, t4;
-RESET MASTER;
-
-# restart slave again
--- connection slave
--- source include/start_slave.inc
--- connection master
-
--- echo #######################################################################
--- echo ####################### PART 2: SLAVE TESTS ###########################
--- echo #######################################################################
-
-### setup
---source include/rpl_reset.inc
--- connection slave
-
-# slave suppressions
-
-call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
-call mtr.add_suppression("Error writing file .*");
-call mtr.add_suppression("Could not open .*");
-call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
-call mtr.add_suppression("Can't generate a unique log-filename .*");
--- echo ###################### TEST #13
-
-#### ASSERTION: check against unique log filename error
--- let $io_thd_injection_fault_flag= error_unique_log_filename
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
--- echo ###################### TEST #14
-
-#### ASSERTION: check against rotate failing
--- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
--- echo ###################### TEST #15
-
-#### ASSERTION: check against relay log open failure
--- let $io_thd_injection_fault_flag= fault_injection_registering_index
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
--- echo ###################### TEST #16
-
-#### ASSERTION: check against relay log index open failure
--- let $io_thd_injection_fault_flag= fault_injection_openning_index
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
-### clean up
--- source include/stop_slave_sql.inc
-SET GLOBAL debug_dbug=@old_debug;
-RESET SLAVE;
-RESET MASTER;
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_binlog_errors.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
index 26ebb29ae8d..f8513021134 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
@@ -16,6 +16,7 @@ create table t (s1 int) engine=innodb;
set @@autocommit=0;
start transaction;
insert into t values (1);
+create user x@y;
grant select on t to x@y;
let $wait_binlog_event= grant select;
source include/wait_for_binlog_event.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_bit.test b/mysql-test/suite/rpl/t/rpl_bit.test
index 67606e5d509..305a2abcf3a 100644
--- a/mysql-test/suite/rpl/t/rpl_bit.test
+++ b/mysql-test/suite/rpl/t/rpl_bit.test
@@ -6,7 +6,6 @@
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
##########
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
index 9f45db85fb7..2d6252c3ad9 100644
--- a/mysql-test/suite/rpl/t/rpl_bug26395.test
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -4,9 +4,6 @@
# just before writing the XID log event is executed correctly. The
# master rolls back, so the slave should not execute statement.
#
-# This test was previously part of rpl_ndb_transaction.test
-#
-#
# ==== Method ====
#
# We want master to be alive so that it can replicate the statement to
diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
index 88b4f8fbba5..6d222cba115 100644
--- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
@@ -1,77 +1 @@
-#
-# Bug#11747416 : 32228 A disk full makes binary log corrupt.
-#
-#
-# The test demonstrates reading from binlog error propagation to slave
-# and reporting there.
-# Conditions for the bug include a crash at time of the last event to
-# the binlog was written partly. With the fixes the event is not sent out
-# any longer, but rather the dump thread sends out a sound error message.
-#
-# Crash is not simulated. A binlog with partly written event in its end is installed
-# and replication is started from it.
-#
-
---source include/have_binlog_format_mixed.inc
---source include/master-slave.inc
-
---connection slave
-# Make sure the slave is stopped while we are messing with master.
-# Otherwise we get occasional failures as the slave manages to re-connect
-# to the newly started master and we get extra events applied, causing
-# conflicts.
---source include/stop_slave.inc
-
---connection master
-call mtr.add_suppression("Error in Log_event::read_log_event()");
---let $datadir= `SELECT @@datadir`
-
---let $rpl_server_number= 1
---source include/rpl_stop_server.inc
-
---remove_file $datadir/master-bin.000001
---copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
-
---let $rpl_server_number= 1
---source include/rpl_start_server.inc
-
---source include/wait_until_connected_again.inc
-
-# evidence of the partial binlog
---error ER_ERROR_WHEN_EXECUTING_COMMAND
-show binlog events;
-
---connection slave
-call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
-reset slave;
-start slave;
-
-# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
---let $slave_param=Last_IO_Errno
---let $slave_param_value=1236
---source include/wait_for_slave_param.inc
-
---let $slave_field_result_replace= / at [0-9]*/ at XXX/
---let $status_items= Last_IO_Errno, Last_IO_Error
---source include/show_slave_status.inc
-
-#
-# Cleanup
-#
-
---connection master
-reset master;
-
---connection slave
-stop slave;
-reset slave;
-# Table was created from binlog, it may not be created if SQL thread is running
-# slowly and IO thread reaches incident before SQL thread applies it.
---disable_warnings
-drop table if exists t;
---enable_warnings
-reset master;
-
---echo End of the tests
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_cant_read_event_incident.inc
diff --git a/mysql-test/suite/rpl/t/rpl_checksum.test b/mysql-test/suite/rpl/t/rpl_checksum.test
index 93b108cbd19..8e006b1b6a0 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum.test
@@ -1,326 +1 @@
-# WL2540 replication events checksum
-# Testing configuration parameters
-
---source include/have_debug.inc
---source include/have_binlog_format_mixed.inc
---source include/master-slave.inc
-
-call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
-call mtr.add_suppression('Replication event checksum verification failed');
-# due to C failure simulation
-call mtr.add_suppression('Relay log write failure: could not queue event from master');
-call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
-
-# A. read/write access to the global vars:
-# binlog_checksum master_verify_checksum slave_sql_verify_checksum
-
-connection master;
-
-set @master_save_binlog_checksum= @@global.binlog_checksum;
-set @save_master_verify_checksum = @@global.master_verify_checksum;
-
-select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.binlog_checksum as 'no session var';
-
-select @@global.master_verify_checksum as 'must be zero because of default';
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.master_verify_checksum as 'no session var';
-
-connection slave;
-
-set @slave_save_binlog_checksum= @@global.binlog_checksum;
-set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
-
-select @@global.slave_sql_verify_checksum as 'must be one because of default';
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.slave_sql_verify_checksum as 'no session var';
-
-connection master;
-
-source include/show_binary_logs.inc;
-set @@global.binlog_checksum = NONE;
-select @@global.binlog_checksum;
---echo *** must be rotations seen ***
-source include/show_binary_logs.inc;
-
-set @@global.binlog_checksum = default;
-select @@global.binlog_checksum;
-
-# testing lack of side-effects in non-effective update of binlog_checksum:
-set @@global.binlog_checksum = CRC32;
-select @@global.binlog_checksum;
-set @@global.binlog_checksum = CRC32;
-
-set @@global.master_verify_checksum = 0;
-set @@global.master_verify_checksum = default;
-
---error ER_WRONG_VALUE_FOR_VAR
-set @@global.binlog_checksum = ADLER32;
---error ER_WRONG_VALUE_FOR_VAR
-set @@global.master_verify_checksum = 2; # the var is of bool type
-
-connection slave;
-
-set @@global.slave_sql_verify_checksum = 0;
-set @@global.slave_sql_verify_checksum = default;
---error ER_WRONG_VALUE_FOR_VAR
-set @@global.slave_sql_verify_checksum = 2; # the var is of bool type
-
-#
-# B. Old Slave to New master conditions
-#
-# while master does not send a checksum-ed binlog the Old Slave can
-# work with the New Master
-
-connection master;
-
-set @@global.binlog_checksum = NONE;
-create table t1 (a int);
-
-# testing that binlog rotation preserves opt_binlog_checksum value
-flush logs;
-flush logs;
-flush logs;
-
-sync_slave_with_master;
-#connection slave;
-# checking that rotation on the slave side leaves slave stable
-flush logs;
-flush logs;
-flush logs;
-select count(*) as zero from t1;
-
-source include/stop_slave.inc;
-
-connection master;
-set @@global.binlog_checksum = CRC32;
-insert into t1 values (1) /* will not be applied on slave due to simulation */;
-
-# instruction to the dump thread
-
-connection slave;
-set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
-start slave;
---let $slave_io_errno= 1236
---let $show_slave_io_error= 1
-source include/wait_for_slave_io_error.inc;
-
-select count(*) as zero from t1;
-
-###connection master;
-set @@global.debug_dbug='';
-
-connection slave;
-source include/start_slave.inc;
-
-#
-# C. checksum failure simulations
-#
-
-# C1. Failure by a client thread
-connection master;
-set @@global.master_verify_checksum = 1;
-set @@session.debug_dbug='d,simulate_checksum_test_failure';
---error ER_ERROR_WHEN_EXECUTING_COMMAND
-show binlog events;
-set @@session.debug_dbug='';
-set @@global.master_verify_checksum = default;
-
-#connection master;
-sync_slave_with_master;
-
-connection slave;
-source include/stop_slave.inc;
-
-connection master;
-create table t2 (a int);
-let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1);
-
-connection slave;
-
-# C2. Failure by IO thread
-# instruction to io thread
-set @@global.debug_dbug='d,simulate_checksum_test_failure';
-start slave io_thread;
-# When the checksum error is detected, the slave sets error code 1913
-# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
-# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
-# So we usually get 1595, but it is occasionally possible to get 1913.
---let $slave_io_errno= 1595,1913
---let $show_slave_io_error= 0
-source include/wait_for_slave_io_error.inc;
-set @@global.debug_dbug='';
-
-# to make IO thread re-read it again w/o the failure
-start slave io_thread;
-let $slave_param= Read_Master_Log_Pos;
-let $slave_param_value= $pos_master;
-source include/wait_for_slave_param.inc;
-
-# C3. Failure by SQL thread
-# instruction to sql thread;
-set @@global.slave_sql_verify_checksum = 1;
-
-set @@global.debug_dbug='d,simulate_checksum_test_failure';
-
-start slave sql_thread;
---let $slave_sql_errno= 1593
---let $show_slave_sql_error= 1
-source include/wait_for_slave_sql_error.inc;
-
-# resuming SQL thread to parse out the event w/o the failure
-
-set @@global.debug_dbug='';
-source include/start_slave.inc;
-
-connection master;
-sync_slave_with_master;
-
-#connection slave;
-select count(*) as 'must be zero' from t2;
-
-#
-# D. Reset slave, Change-Master, Binlog & Relay-log rotations with
-# random value on binlog_checksum on both master and slave
-#
-connection slave;
-stop slave;
-reset slave;
-
-# randomize slave server's own checksum policy
-set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
-flush logs;
-
-connection master;
-set @@global.binlog_checksum= CRC32;
-reset master;
-flush logs;
-create table t3 (a int, b char(5));
-
-connection slave;
-source include/start_slave.inc;
-
-connection master;
-sync_slave_with_master;
-
-#connection slave;
-select count(*) as 'must be zero' from t3;
-source include/stop_slave.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
-
-connection master;
-flush logs;
-reset master;
-insert into t3 value (1, @@global.binlog_checksum);
-
-connection slave;
-source include/start_slave.inc;
-flush logs;
-
-connection master;
-sync_slave_with_master;
-
-#connection slave;
-select count(*) as 'must be one' from t3;
-
-connection master;
-set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
-insert into t3 value (1, @@global.binlog_checksum);
-sync_slave_with_master;
-
-#connection slave;
-
-#clean-up
-
-connection master;
-drop table t1, t2, t3;
-set @@global.binlog_checksum = @master_save_binlog_checksum;
-set @@global.master_verify_checksum = @save_master_verify_checksum;
-
-#
-# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540
-#
-# Sanity check that verifies that no assertions are triggered because
-# of old FD events (generated by versions prior to server released with
-# checksums feature)
-#
-# There is no need for query log, if something wrong this should trigger
-# an assertion
-
---disable_query_log
-
-BINLOG '
-MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
-';
-
---enable_query_log
-
-#connection slave;
-sync_slave_with_master;
-
-
---echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
-
---connection master
-
---source include/wait_for_binlog_checkpoint.inc
-CREATE TABLE t4 (a INT PRIMARY KEY);
-INSERT INTO t4 VALUES (1);
-
-SET sql_log_bin=0;
-CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
-SET sql_log_bin=1;
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET debug_dbug= '+d,binlog_inject_new_name_error';
---error ER_NO_UNIQUE_LOGFILE
-FLUSH LOGS;
-SET debug_dbug= @old_dbug;
-
-INSERT INTO t4 VALUES (2);
-
---connection slave
---let $slave_sql_errno= 1590
---source include/wait_for_slave_sql_error.inc
-
-# Search the error log for the error message.
-# The bug was that 4 garbage bytes were output in the middle of the error
-# message; by searching for a pattern that spans that location, we can
-# catch the error.
-let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!$log_error_)
-{
- # MySQL Server on windows is started with --console and thus
- # does not know the location of its .err log, use default location
- let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
-}
---let SEARCH_FILE= $log_error_
---let SEARCH_RANGE=-50000
---let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
---source include/search_pattern_in_file.inc
-
-SELECT * FROM t4 ORDER BY a;
-STOP SLAVE IO_THREAD;
-SET sql_slave_skip_counter= 1;
---source include/start_slave.inc
-
---connection master
---save_master_pos
-
---connection slave
---sync_with_master
-SELECT * FROM t4 ORDER BY a;
-
-
---connection slave
-set @@global.binlog_checksum = @slave_save_binlog_checksum;
-set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
-
---echo End of tests
-
---connection master
-DROP TABLE t4;
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_checksum.inc
diff --git a/mysql-test/suite/rpl/t/rpl_checksum_cache.test b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
index 5667d599aff..56c3e1e1cb5 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum_cache.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
@@ -1,255 +1 @@
--- source include/have_innodb.inc
--- source include/master-slave.inc
-
---disable_warnings
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
---enable_warnings
-
-connection master;
-set @save_binlog_cache_size = @@global.binlog_cache_size;
-set @save_binlog_checksum = @@global.binlog_checksum;
-set @save_master_verify_checksum = @@global.master_verify_checksum;
-set @@global.binlog_cache_size = 4096;
-set @@global.binlog_checksum = CRC32;
-set @@global.master_verify_checksum = 1;
-
-# restart slave to force the dump thread to verify events (on master side)
-connection slave;
-source include/stop_slave.inc;
-source include/start_slave.inc;
-
-connection master;
-
-#
-# Testing a critical part of checksum handling dealing with transaction cache.
-# The cache's buffer size is set to be less than the transaction's footprint
-# in binlog.
-#
-# To verify combined buffer-by-buffer read out of the file and fixing crc per event
-# there are the following parts:
-#
-# 1. the event size is much less than the cache's buffer
-# 2. the event size is bigger than the cache's buffer
-# 3. the event size if approximately the same as the cache's buffer
-# 4. all in above
-
-#
-# 1. the event size is much less than the cache's buffer
-#
-
-flush status;
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# parameter to ensure the test slightly varies binlog content
-# between different invocations
-#
-let $deviation_size=32;
-eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb;
-
-# Now we are going to create transaction which is long enough so its
-# transaction binlog will be flushed to disk...
-
-delimiter |;
-create procedure test.p_init (n int, size int)
-begin
- while n > 0 do
- select round(RAND() * size) into @act_size;
- set @data = repeat('a', @act_size);
- insert into t1 values(n, @data );
- set n= n-1;
- end while;
-end|
-
-delimiter ;|
-
-let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s
-
-begin;
---disable_warnings
-# todo: check if it is really so.
-#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
-eval call test.p_init($1, $deviation_size);
---enable_warnings
-commit;
-
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t1, slave:test.t1;
-source include/diff_tables.inc;
-
-# undoing changes with verifying the above once again
-connection master;
-
-begin;
-delete from t1;
-commit;
-
-sync_slave_with_master;
-
-
-#
-# 2. the event size is bigger than the cache's buffer
-#
-connection master;
-
-flush status;
-let $t2_data_size= `select 3 * @@global.binlog_cache_size`;
-let $t2_aver_size= `select 2 * @@global.binlog_cache_size`;
-let $t2_max_rand= `select 1 * @@global.binlog_cache_size`;
-
-eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb;
-let $1=100;
---disable_query_log
-begin;
-while ($1)
-{
- eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
- set @data = repeat('a', @act_size);
- insert into t2 set data = @data;
- dec $1;
-}
-commit;
---enable_query_log
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t2, slave:test.t2;
-source include/diff_tables.inc;
-
-# undoing changes with verifying the above once again
-connection master;
-
-begin;
-delete from t2;
-commit;
-
-sync_slave_with_master;
-
-#
-# 3. the event size if approximately the same as the cache's buffer
-#
-
-connection master;
-
-flush status;
-let $t3_data_size= `select 2 * @@global.binlog_cache_size`;
-let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`;
-let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`;
-
-eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb;
-
-let $1= 300;
---disable_query_log
-begin;
-while ($1)
-{
- eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
- insert into t3 set data= repeat('a', @act_size);
- dec $1;
-}
-commit;
---enable_query_log
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t3, slave:test.t3;
-source include/diff_tables.inc;
-
-# undoing changes with verifying the above once again
-connection master;
-
-begin;
-delete from t3;
-commit;
-
-sync_slave_with_master;
-
-
-#
-# 4. all in above
-#
-
-connection master;
-flush status;
-
-delimiter |;
-eval create procedure test.p1 (n int)
-begin
- while n > 0 do
- case (select (round(rand()*100) % 3) + 1)
- when 1 then
- select round(RAND() * $deviation_size) into @act_size;
- set @data = repeat('a', @act_size);
- insert into t1 values(n, @data);
- when 2 then
- begin
- select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
- insert into t2 set data=repeat('a', @act_size);
- end;
- when 3 then
- begin
- select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
- insert into t3 set data= repeat('a', @act_size);
- end;
- end case;
- set n= n-1;
- end while;
-end|
-delimiter ;|
-
-let $1= 1000;
-set autocommit= 0;
-begin;
---disable_warnings
-eval call test.p1($1);
---enable_warnings
-commit;
-
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t1, slave:test.t1;
-source include/diff_tables.inc;
-
-let $diff_tables=master:test.t2, slave:test.t2;
-source include/diff_tables.inc;
-
-let $diff_tables=master:test.t3, slave:test.t3;
-source include/diff_tables.inc;
-
-
-connection master;
-
-begin;
-delete from t1;
-delete from t2;
-delete from t3;
-commit;
-
-drop table t1, t2, t3;
-set @@global.binlog_cache_size = @save_binlog_cache_size;
-set @@global.binlog_checksum = @save_binlog_checksum;
-set @@global.master_verify_checksum = @save_master_verify_checksum;
-drop procedure test.p_init;
-drop procedure test.p1;
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_checksum_cache.inc
diff --git a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
index 5e070b14301..1e2ca875190 100644
--- a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
+++ b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type=innodb;
diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test
index da87b133cb5..310b0cef8e8 100644
--- a/mysql-test/suite/rpl/t/rpl_corruption.test
+++ b/mysql-test/suite/rpl/t/rpl_corruption.test
@@ -1,170 +1 @@
-############################################################
-# Purpose: WL#5064 Testing with corrupted events.
-# The test emulates the corruption at the vary stages
-# of replication:
-# - in binlog file
-# - in network
-# - in relay log
-############################################################
-
-#
-# The tests intensively utilize @@global.debug. Note,
-# Bug#11765758 - 58754,
-# @@global.debug is read by the slave threads through dbug-interface.
-# Hence, before a client thread set @@global.debug we have to ensure that:
-# (a) the slave threads are stopped, or (b) the slave threads are in
-# sync and waiting.
-
---source include/have_debug.inc
---source include/master-slave.inc
-
-# Block legal errors for MTR
-call mtr.add_suppression('Found invalid event in binary log');
-call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
-call mtr.add_suppression('event read from binlog did not pass crc check');
-call mtr.add_suppression('Replication event checksum verification failed');
-call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
-call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
-
-SET @old_master_verify_checksum = @@master_verify_checksum;
-
-# Creating test table/data and set corruption position for testing
---echo # 1. Creating test table/data and set corruption position for testing
---connection master
---echo * insert/update/delete rows in table t1 *
-# Corruption algorithm modifies only the first event and
-# then will be reset. To avoid checking always the first event
-# from binlog (usually it is FD) we randomly execute different
-# statements and set position for corruption inside events.
-
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
---disable_query_log
-let $i=`SELECT 3+CEILING(10*RAND())`;
-let $j=1;
-let $pos=0;
-while ($i) {
- eval INSERT INTO t1 VALUES ($j, 'a', NULL);
- if (`SELECT RAND() > 0.7`)
- {
- eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j;
- }
- if (`SELECT RAND() > 0.8`)
- {
- eval DELETE FROM t1 WHERE a = $j;
- }
- if (!$pos) {
- let $pos= query_get_value(SHOW MASTER STATUS, Position, 1);
- --sync_slave_with_master
- --source include/stop_slave.inc
- --disable_query_log
- --connection master
- }
- dec $i;
- inc $j;
-}
---enable_query_log
-
-
-# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
---echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
-SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
---echo SHOW BINLOG EVENTS;
---disable_query_log
-send_eval SHOW BINLOG EVENTS FROM $pos;
---enable_query_log
---error ER_ERROR_WHEN_EXECUTING_COMMAND
-reap;
-
-SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
-
-# Emulate corruption on master with crc checking on master
---echo # 3. Master read a corrupted event from binlog and send the error to slave
-
-# We have a rare but nasty potential race here: if the dump thread on
-# the master for the _old_ slave connection has not yet discovered
-# that the slave has disconnected, we will inject the corrupt event on
-# the wrong connection, and the test will fail
-# (+d,corrupt_read_log_event2 corrupts only one event).
-# So kill any lingering dump thread (we need to kill; otherwise dump thread
-# could manage to send all events down the socket before seeing it close, and
-# hang forever waiting for new binlog events to be created).
-let $id= `select id from information_schema.processlist where command = "Binlog Dump"`;
-if ($id)
-{
- --disable_query_log
- --error 0,1094
- eval kill $id;
- --enable_query_log
-}
-let $wait_condition=
- SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
---source include/wait_condition.inc
-
-SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
---connection slave
-START SLAVE IO_THREAD;
-let $slave_io_errno= 1236;
---let $slave_timeout= 10
---source include/wait_for_slave_io_error.inc
---connection master
-SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
-
-# Emulate corruption on master without crc checking on master
---echo # 4. Master read a corrupted event from binlog and send it to slave
---connection master
-SET GLOBAL master_verify_checksum=0;
-SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
---connection slave
-START SLAVE IO_THREAD;
-# When the checksum error is detected, the slave sets error code 1913
-# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
-# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
-# So we usually get 1595, but it is occasionally possible to get 1913.
-let $slave_io_errno= 1595,1913;
---source include/wait_for_slave_io_error.inc
---connection master
-SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
-SET GLOBAL debug_dbug= "";
-SET GLOBAL master_verify_checksum=1;
-
-# Emulate corruption in network
---echo # 5. Slave. Corruption in network
---connection slave
-SET GLOBAL debug_dbug="+d,corrupt_queue_event";
-START SLAVE IO_THREAD;
-let $slave_io_errno= 1595,1913;
---source include/wait_for_slave_io_error.inc
-SET GLOBAL debug_dbug="-d,corrupt_queue_event";
-
-# Emulate corruption in relay log
---echo # 6. Slave. Corruption in relay log
-
-SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
-
-START SLAVE SQL_THREAD;
-let $slave_sql_errno= 1593;
---source include/wait_for_slave_sql_error.inc
-
-SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
-SET GLOBAL debug_dbug= "";
-
-# Start normal replication and compare same table on master
-# and slave
---echo # 7. Seek diff for tables on master and slave
---connection slave
---source include/start_slave.inc
---connection master
---sync_slave_with_master
-let $diff_tables= master:test.t1, slave:test.t1;
---source include/diff_tables.inc
-
-# Clean up
---echo # 8. Clean up
---connection master
-SET GLOBAL debug_dbug= "";
-SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
-DROP TABLE t1;
---sync_slave_with_master
-SET GLOBAL debug_dbug= "";
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_corruption.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_db.test b/mysql-test/suite/rpl/t/rpl_create_drop_db.test
new file mode 100644
index 00000000000..04721c9c6e8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_db.test
@@ -0,0 +1,33 @@
+--source include/master-slave.inc
+
+connection master;
+
+CREATE DATABASE db1;
+CREATE DATABASE IF NOT EXISTS db1;
+CREATE OR REPLACE DATABASE db2;
+CREATE OR REPLACE DATABASE db1;
+sync_slave_with_master;
+
+SHOW DATABASES LIKE 'db%';
+
+connection master;
+--error ER_DB_CREATE_EXISTS
+CREATE DATABASE db1;
+
+--error ER_DB_DROP_EXISTS
+DROP DATABASE db3;
+
+CREATE DATABASE IF NOT EXISTS db3;
+sync_slave_with_master;
+
+SHOW DATABASES LIKE 'db%';
+
+connection master;
+DROP DATABASE db1;
+DROP DATABASE db2;
+DROP DATABASE IF EXISTS db3;
+sync_slave_with_master;
+
+SHOW DATABASES LIKE 'db%';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_event.test b/mysql-test/suite/rpl/t/rpl_create_drop_event.test
new file mode 100644
index 00000000000..96a7e82d6f7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_event.test
@@ -0,0 +1,27 @@
+--source include/master-slave.inc
+
+connection master;
+SET GLOBAL event_scheduler=off;
+
+CREATE TABLE t1 (a INT);
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
+--error ER_EVENT_ALREADY_EXISTS
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
+SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+
+SET GLOBAL event_scheduler=on;
+let $wait_condition= SELECT count(*)>0 FROM t1;
+--source include/wait_condition.inc
+SET GLOBAL event_scheduler=off;
+SELECT DISTINCT a FROM t1;
+DELETE FROM t1;
+
+--echo # Syncing slave with master
+sync_slave_with_master;
+SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+connection master;
+DROP TABLE t1;
+DROP EVENT ev1;
+sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_function.test b/mysql-test/suite/rpl/t/rpl_create_drop_function.test
new file mode 100644
index 00000000000..5ae0b76554a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_function.test
@@ -0,0 +1,54 @@
+--source include/master-slave.inc
+
+connection master;
+
+CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+
+--error ER_SP_ALREADY_EXISTS
+CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+
+sync_slave_with_master;
+
+SHOW CREATE FUNCTION hello;
+
+connection master;
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+
+CREATE OR REPLACE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+
+SELECT hello('master');
+sync_slave_with_master;
+
+SELECT hello('slave');
+
+connection master;
+CREATE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Hello, ', str, '!');
+
+CREATE OR REPLACE FUNCTION bye (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
+CONCAT('Bye, ', str, '!');
+
+SELECT hello('master');
+SELECT bye('master');
+sync_slave_with_master;
+
+SELECT hello('slave');
+SELECT bye('slave');
+
+connection master;
+DROP FUNCTION hello;
+DROP FUNCTION IF EXISTS bye;
+sync_slave_with_master;
+
+--error ER_SP_DOES_NOT_EXIST
+DROP FUNCTION hello;
+
+DROP FUNCTION IF EXISTS bye;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_index.test b/mysql-test/suite/rpl/t/rpl_create_drop_index.test
new file mode 100644
index 00000000000..ee183ac331b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_index.test
@@ -0,0 +1,19 @@
+--source include/master-slave.inc
+
+connection master;
+
+CREATE TABLE t1 (a INT, b INT);
+CREATE INDEX i1 ON t1 (a);
+CREATE OR REPLACE INDEX i1 ON t1 (a, b);
+sync_slave_with_master;
+
+--echo # On slave:
+SHOW CREATE TABLE t1;
+
+connection master;
+--echo # On master:
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_procedure.test b/mysql-test/suite/rpl/t/rpl_create_drop_procedure.test
new file mode 100644
index 00000000000..6fb0313c706
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_procedure.test
@@ -0,0 +1,81 @@
+--source include/master-slave.inc
+
+connection master;
+CREATE TABLE t1 (id INT);
+DELIMITER $$;
+CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+DELIMITER ;$$
+CALL proc1(@cnt);
+SELECT @cnt;
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+
+--echo # Syncing with slave
+sync_slave_with_master;
+
+CALL proc1(@cnt);
+SELECT @cnt;
+
+connection master;
+DELIMITER $$;
+--error ER_SP_ALREADY_EXISTS
+CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+DELIMITER ;$$
+
+--echo # Syncing with slave
+sync_slave_with_master;
+
+CALL proc1(@cnt);
+SELECT @cnt;
+
+connection master;
+DROP PROCEDURE proc1;
+DELIMITER $$;
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+DELIMITER ;$$
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+
+--echo # Syncing with slave
+sync_slave_with_master;
+
+CALL proc1(@cnt);
+SELECT @cnt;
+
+connection master;
+DROP PROCEDURE proc1;
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+DELIMITER ;$$
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+
+--echo # Syncing with slave
+sync_slave_with_master;
+
+CALL proc1(@cnt);
+SELECT @cnt;
+
+connection master;
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE proc1;
+
+DROP PROCEDURE IF EXISTS proc2;
+
+--echo # Syncing with slave
+sync_slave_with_master;
+
+--error ER_SP_DOES_NOT_EXIST
+DROP PROCEDURE proc1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_role.test b/mysql-test/suite/rpl/t/rpl_create_drop_role.test
new file mode 100644
index 00000000000..7260b473530
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_role.test
@@ -0,0 +1,48 @@
+--source include/master-slave.inc
+
+connection master;
+CREATE ROLE role_1;
+sync_slave_with_master;
+
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+
+connection master;
+CREATE ROLE IF NOT EXISTS role_1;
+CREATE ROLE IF NOT EXISTS role_2;
+sync_slave_with_master;
+
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+
+connection master;
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE ROLE IF NOT EXISTS role_3;
+
+CREATE OR REPLACE ROLE role_3;
+CREATE OR REPLACE ROLE role_2;
+sync_slave_with_master;
+
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+
+connection master;
+--error ER_CANNOT_USER
+CREATE ROLE role_2;
+
+sync_slave_with_master;
+
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+
+connection master;
+DROP ROLE role_1;
+DROP ROLE IF EXISTS role_2;
+DROP ROLE IF EXISTS role_3;
+DROP ROLE IF EXISTS role_4;
+
+--error ER_CANNOT_USER
+DROP ROLE role_4;
+
+sync_slave_with_master;
+
+SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_trigger.test b/mysql-test/suite/rpl/t/rpl_create_drop_trigger.test
new file mode 100644
index 00000000000..568d4e22aee
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_trigger.test
@@ -0,0 +1,48 @@
+--source include/master-slave.inc
+
+--echo # Part 1 - initial creation
+connection master;
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE t1 (val INT);
+CREATE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 1;
+SET @sum=0;
+INSERT INTO t1 VALUES (10), (20), (30);
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+sync_slave_with_master;
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+
+--echo # Part 2 - CREATE IF NOT EXISTS (on a existing trigger)
+connection master;
+CREATE TRIGGER IF NOT EXISTS val_sum AFTER INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 2;
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+sync_slave_with_master;
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+
+--echo # Part 3 - CREATE OR REPLACE (on a existing trigger)
+connection master;
+CREATE OR REPLACE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 3;
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+sync_slave_with_master;
+SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+
+--echo # Clearing up
+connection master;
+DROP TRIGGER val_sum;
+DROP TABLE t1;
+DROP TRIGGER IF EXISTS val_sum;
+
+--error ER_TRG_DOES_NOT_EXIST
+DROP TRIGGER random_trigger;
+DROP DATABASE db1;
+
+--error ER_NO_DB_ERROR
+DROP TRIGGER IF EXISTS val_sum;
+
+--echo # Syncing slave with master
+sync_slave_with_master;
+
+--error ER_TRG_DOES_NOT_EXIST
+DROP TRIGGER val_sum;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_udf.test b/mysql-test/suite/rpl/t/rpl_create_drop_udf.test
new file mode 100644
index 00000000000..af24cabd338
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_udf.test
@@ -0,0 +1,56 @@
+--source include/have_udf.inc
+--source include/master-slave.inc
+
+connection master;
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+SELECT metaphon('master');
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--error ER_UDF_EXISTS
+eval CREATE FUNCTION metaphon RETURNS INT SONAME "$UDF_EXAMPLE_SO";
+
+sync_slave_with_master;
+
+SELECT metaphon('slave');
+
+connection master;
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+DROP FUNCTION IF EXISTS random_function_name;
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--error ER_WRONG_USAGE
+eval CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+sync_slave_with_master;
+
+SELECT metaphon('slave');
+
+connection master;
+DROP FUNCTION metaphon;
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--error ER_UDF_EXISTS
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+sync_slave_with_master;
+
+SELECT metaphon('slave');
+
+connection master;
+DROP FUNCTION metaphon;
+DROP FUNCTION IF EXISTS metaphon;
+sync_slave_with_master;
+
+--error ER_SP_DOES_NOT_EXIST
+DROP FUNCTION metaphon;
+
+DROP FUNCTION IF EXISTS metaphon;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_user.test b/mysql-test/suite/rpl/t/rpl_create_drop_user.test
new file mode 100644
index 00000000000..5fcf0a14c36
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_user.test
@@ -0,0 +1,51 @@
+--source include/master-slave.inc
+
+connection master;
+CREATE USER u1@localhost IDENTIFIED BY 'abcdefghijk';
+connect (user_a, localhost, u1,'abcdefghijk',);
+connection user_a;
+SELECT CURRENT_USER;
+disconnect user_a;
+
+connection master;
+CREATE USER IF NOT EXISTS u2@localhost;
+connect (user_a, localhost, u2,,);
+connection user_a;
+SELECT CURRENT_USER;
+disconnect user_a;
+
+connection master;
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+sync_slave_with_master;
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+
+connection master;
+CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'abcdefghijk2';
+connect (user_a, localhost, u1,'abcdefghijk2',);
+connection user_a;
+SELECT CURRENT_USER;
+disconnect user_a;
+connection master;
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+sync_slave_with_master;
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+
+connection master;
+--error ER_CANNOT_USER
+CREATE USER u1@localhost;
+
+--error ER_CANNOT_USER
+DROP USER u3@localhost;
+
+sync_slave_with_master;
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+
+connection master;
+DROP USER IF EXISTS u1@localhost;
+DROP USER u2@localhost;
+DROP USER IF EXISTS u3@localhost;
+sync_slave_with_master;
+
+SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_view.test b/mysql-test/suite/rpl/t/rpl_create_drop_view.test
new file mode 100644
index 00000000000..9280f35f638
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_view.test
@@ -0,0 +1,55 @@
+--source include/master-slave.inc
+
+connection master;
+CREATE TABLE t1(id INT);
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
+INSERT INTO t1 VALUES (5), (8), (10), (20), (30);
+SELECT * FROM t1;
+SELECT * FROM v1;
+
+--echo # Syncing slave with master
+sync_slave_with_master;
+SELECT * FROM t1;
+SELECT * FROM v1;
+
+connection master;
+--error ER_TABLE_EXISTS_ERROR
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
+
+CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
+
+--echo # Syncing slave with master
+sync_slave_with_master;
+SELECT * FROM t1;
+SELECT * FROM v1;
+
+connection master;
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
+INSERT INTO t1 VALUES (50), (80), (3), (2), (40);
+SELECT * FROM t1;
+SELECT * FROM v1;
+
+--echo # Syncing slave with master
+sync_slave_with_master;
+SELECT * FROM t1;
+SELECT * FROM v1;
+
+connection master;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--error ER_BAD_TABLE_ERROR
+DROP VIEW v1;
+
+DROP VIEW IF EXISTS v2;
+
+--echo # Syncing slave with master
+sync_slave_with_master;
+
+--error ER_NO_SUCH_TABLE
+SELECT * FROM v1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_current_user.test b/mysql-test/suite/rpl/t/rpl_current_user.test
index c9ee6fcd576..1f5a82486e3 100644
--- a/mysql-test/suite/rpl/t/rpl_current_user.test
+++ b/mysql-test/suite/rpl/t/rpl_current_user.test
@@ -42,6 +42,7 @@ CREATE VIEW test.v_procs_priv AS SELECT * FROM mysql.procs_priv WHERE User LIKE
CREATE VIEW test.v_event AS SELECT definer FROM mysql.event WHERE name = 'e1';
CREATE PROCEDURE p1() SELECT 1;
--echo # bug48321_1-01234 has the max length(16) of user.
+CREATE USER 'bug48321_1-01234'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'bug48321_1-01234'@'localhost' WITH GRANT OPTION;
--echo
@@ -235,4 +236,3 @@ DROP PROCEDURE my_revoke;
DROP FUNCTION my_user;
DROP EVENT e1;
--source include/rpl_end.inc
-
diff --git a/mysql-test/suite/rpl/t/rpl_ddl.test b/mysql-test/suite/rpl/t/rpl_ddl.test
index 89ae2c03242..2045ec97edd 100644
--- a/mysql-test/suite/rpl/t/rpl_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_ddl.test
@@ -22,7 +22,6 @@
# effects like failing 'sync_slave_with_master', crashes of the slave or
# abort of the test case etc..
#
---source include/not_ndb_default.inc
--source include/have_innodb.inc
--source include/master-slave.inc
let $engine_type= InnoDB;
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
index 14776263516..ade915da105 100644
--- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/long_test.inc
let $engine_type=innodb;
diff --git a/mysql-test/suite/rpl/t/rpl_delete_no_where.test b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
index 4bfe6d07b5a..9ab637063e0 100644
--- a/mysql-test/suite/rpl/t/rpl_delete_no_where.test
+++ b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
@@ -1,7 +1,3 @@
-###################################################
-# By JBM 2006-02-14 added to skip test when NDB #
-##################################################
--- source include/not_ndb_default.inc
-- source include/master-slave.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_delete_no_where.test
diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index 4d7d1bacc15..83b9a84744f 100644
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
@@ -17,6 +17,7 @@ flush privileges;
# test replication of GRANT
connection master;
+create user rpl_do_grant@localhost;
grant select on *.* to rpl_do_grant@localhost;
grant drop on test.* to rpl_do_grant@localhost;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter.test
new file mode 100644
index 00000000000..1503ee1adaa
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter.test
@@ -0,0 +1,431 @@
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+#
+# Test for DO_DOMAIN_IDS=(M1, M2, ..) and IGNORE_DOMAIN_IDS=(N1, N2, ..)
+#
+
+--echo # On slave
+connection slave;
+call mtr.add_suppression("Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS lists can't be non-empty at the same time");
+call mtr.add_suppression("DO_DOMAIN_IDS or IGNORE_DOMAIN_IDS lists can't be non-empty in non-GTID mode.*");
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id= 1;
+SELECT @@session.gtid_domain_id;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+##### Case 0 : When both DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS are empty.
+SELECT * FROM t1;
+
+##### Case 1: When DO_DOMAIN_IDS is non-empty.
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# Replicate events belonging to "domain_id 1".
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+# Lets change the session domain_id to 2(not in DO_DOMAIN_IDS).
+SET @@session.gtid_domain_id= 2;
+# Should get filtered out on slave.
+INSERT INTO t1 VALUES(2);
+# Change it back to 1 (in DO_DOMAIN_IDS).
+SET @@session.gtid_domain_id= 1;
+# Should get applied on slave.
+INSERT INTO t1 VALUES(3);
+
+SELECT * FROM t1;
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+
+##### Case 2: When IGNORE_DOMAIN_IDS is non-empty.
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# Ignore events belonging to "domain_id 1".
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+# @@session.gtid_domain_id = 1 (in IGNORE_DOMAIN_IDS)
+SELECT @@session.gtid_domain_id;
+# Should get filtered out on slave.
+INSERT INTO t1 VALUES(4);
+# Change it to 2 (not in IGNORE_DOMAIN_IDS).
+SET @@session.gtid_domain_id= 2;
+# Should get applied on slave.
+INSERT INTO t1 VALUES(5);
+
+SELECT * FROM t1;
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+
+##### Case 3: When both DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS are non-empty
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+--error ER_MASTER_INFO
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+##### Case 4: Multiple domain ids.
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# Replicate events belonging to "domain_id 1".
+CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+# @@session.gtid_domain_id = 1 (in DO_DOMAIN_IDS)
+SELECT @@session.gtid_domain_id;
+# Should get applied on slave.
+INSERT INTO t1 VALUES(8);
+# Change it to 7 (in DO_DOMAIN_IDS).
+SET @@session.gtid_domain_id= 7;
+# Should get applied on slave.
+INSERT INTO t1 VALUES(9);
+# Change it to 10 (no in DO_DOMAIN_IDS).
+SET @@session.gtid_domain_id= 10;
+# Following should get filtered out on slave.
+INSERT INTO t1 VALUES(10);
+INSERT INTO t1 VALUES(11);
+START TRANSACTION;
+INSERT INTO t1 VALUES(12);
+INSERT INTO t1 VALUES(13);
+COMMIT;
+INSERT INTO t1 VALUES(14);
+INSERT INTO t1 VALUES(15);
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+
+##### Case 5: Seconds_Behind_Master
+--echo # On slave
+connection slave;
+--echo # Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
+--let $status_items= Seconds_Behind_Master
+--source include/show_slave_status.inc
+
+##### Case 6: Stop slave before a transaction (involving MyISAM and InnoDB
+# table) being filtered commits.
+
+--echo # On slave
+connection slave;
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# IGNORE_DOMAIN_IDS=(1)
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+# following statements should not get filtered.
+SET @@session.gtid_domain_id=2;
+CREATE TABLE t2(i int) ENGINE=MYISAM;
+CREATE TABLE t3(i int) ENGINE=INNODB;
+
+SET @@session.gtid_domain_id=1;
+BEGIN;
+INSERT INTO t2 VALUES(1);
+INSERT INTO t3 VALUES(1);
+
+# Now switch to slave to stop replication.
+--echo # On slave
+connection slave;
+--source include/stop_slave.inc
+--source include/wait_for_slave_to_stop.inc
+
+# Back to master to finish the transaction.
+--echo # On master
+connection master;
+INSERT INTO t2 VALUES(2);
+INSERT INTO t3 VALUES(2);
+COMMIT;
+--source include/save_master_gtid.inc
+
+# On slave to start replication.
+--echo # On slave
+connection slave;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+##### Case 7: Stop slave before a transaction (involving MyISAM and InnoDB
+# table) being filtered commits and start it back with filtering
+# disabled.
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id=1;
+BEGIN;
+INSERT INTO t2 VALUES(3);
+INSERT INTO t3 VALUES(3);
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# Clear IGNORE_DOMAIN_IDS
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+INSERT INTO t2 VALUES(4);
+INSERT INTO t3 VALUES(4);
+COMMIT;
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+##### Case 8: Stop slave into the middle of a transaction and start it back
+# with filtering enabled.
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id=1;
+BEGIN;
+INSERT INTO t2 VALUES(5);
+INSERT INTO t3 VALUES(5);
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# IGNORE_DOMAIN_IDS(1)
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+INSERT INTO t2 VALUES(6);
+INSERT INTO t3 VALUES(6);
+COMMIT;
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+##### Case 9: Initially filter out events belonging to domain_id=2 and then
+# remove the rule to check if event are not being filtered out.
+
+--echo # On slave
+connection slave;
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# IGNORE_DOMAIN_IDS(2)
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(7);
+INSERT INTO t3 VALUES(7);
+COMMIT;
+--source include/save_master_gtid.inc
+
+# Clear the filter
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# IGNORE_DOMAIN_IDS()
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(8);
+INSERT INTO t3 VALUES(8);
+COMMIT;
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+##### Case 10: Test CHANGE MASTER with various "incompatible" combinations.
+# On slave
+connection slave;
+--source include/stop_slave.inc
+
+# 10a: Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS can't be non-empty at the same
+# time.
+
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+--error ER_MASTER_INFO
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+--error ER_MASTER_INFO
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+--error ER_MASTER_INFO
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+
+# 10b: Neither DO_DOMAIN_IDS nor IGNORE_DOMAIN_IDS can be set when
+# MASTER_USE_GTID=NO
+
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# MASTER_USE_GTID can't be set to NO when either of IGNORE_DOMAIN_IDS or
+# DO_DOMAIN_IDS is non-empty.
+--error ER_MASTER_INFO
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
+--error ER_MASTER_INFO
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=NO;
+--error ER_MASTER_INFO
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=NO;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), DO_DOMAIN_IDS=(), MASTER_USE_GTID=SLAVE_POS;
+--source include/start_slave.inc
+
+# Cleanup
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id=2;
+DROP TABLE t1, t2, t3;
+--source include/save_master_gtid.inc
+
+--echo # On slave
+connection slave;
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
new file mode 100644
index 00000000000..a28edfc0c83
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
@@ -0,0 +1,399 @@
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id= 1;
+SELECT @@session.gtid_domain_id;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+sync_slave_with_master;
+
+--echo # On slave
+connection slave;
+
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+
+--echo # Case 0 : Start slave with IGNORE_DOMAIN_IDS=(), then restart
+--echo # replication with IGNORE_DOMAIN_IDS=() after IO thread is
+--echo # killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+
+SELECT * FROM t1;
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+
+--echo # On master
+connection master;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+COMMIT;
+save_master_pos;
+SELECT * FROM t1;
+
+--echo # On slave
+connection slave;
+--let $slave_io_errno= 1595
+--source include/wait_for_slave_io_error.inc
+SELECT * FROM t1;
+SET @@global.debug_dbug="-d";
+
+START SLAVE io_thread;
+--source include/wait_for_slave_io_to_start.inc
+sync_with_master;
+SELECT * FROM t1;
+
+--echo # Case 1 : Start slave with IGNORE_DOMAIN_IDS=(1), then restart
+--echo # replication with IGNORE_DOMAIN_IDS=(1) after IO thread is
+--echo # killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+
+--echo # On master
+connection master;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(4);
+INSERT INTO t1 VALUES(5);
+COMMIT;
+
+save_master_pos;
+SELECT * FROM t1;
+
+--echo # On slave
+connection slave;
+--let $slave_io_errno= 1595
+--source include/wait_for_slave_io_error.inc
+SELECT * FROM t1;
+SET @@global.debug_dbug="-d";
+
+START SLAVE io_thread;
+--source include/wait_for_slave_io_to_start.inc
+sync_with_master;
+SELECT * FROM t1;
+
+--echo # Case 2 : Start slave with IGNORE_DOMAIN_IDS=(), then restart
+--echo # replication with IGNORE_DOMAIN_IDS=(1) after IO thread is
+--echo # killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+
+--echo # On master
+connection master;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(6);
+INSERT INTO t1 VALUES(7);
+COMMIT; # IO thread gets killed here.
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(8);
+INSERT INTO t1 VALUES(9);
+COMMIT;
+
+SET @@session.gtid_domain_id= 2;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(10);
+INSERT INTO t1 VALUES(11);
+COMMIT;
+
+save_master_pos;
+SELECT * FROM t1;
+
+--echo # On slave
+connection slave;
+--let $slave_io_errno= 1595
+--source include/wait_for_slave_io_error.inc
+SELECT * FROM t1;
+
+SET @@global.debug_dbug="-d";
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SELECT * FROM t1;
+
+--echo # Case 3 : Start slave with IGNORE_DOMAIN_IDS=(1), then restart
+--echo # replication with IGNORE_DOMAIN_IDS=() after IO thread is
+--echo # killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_before_commit").
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
+
+--echo # On master
+connection master;
+
+SET @@session.gtid_domain_id= 1;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(12);
+INSERT INTO t1 VALUES(13);
+COMMIT; # IO thread gets killed here.
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(14);
+INSERT INTO t1 VALUES(15);
+COMMIT;
+
+SET @@session.gtid_domain_id= 2;
+START TRANSACTION;
+INSERT INTO t1 VALUES(16);
+INSERT INTO t1 VALUES(17);
+COMMIT;
+
+save_master_pos;
+SELECT * FROM t1;
+
+--echo # On slave
+connection slave;
+--let $slave_io_errno= 1595
+--source include/wait_for_slave_io_error.inc
+SELECT * FROM t1;
+
+SET @@global.debug_dbug="-d";
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SELECT * FROM t1;
+
+--echo # Case 4 : Start slave with IGNORE_DOMAIN_IDS=(1), then restart
+--echo # replication with IGNORE_DOMAIN_IDS=() after IO thread is
+--echo # killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_after_2_events").
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
+
+--echo # On master
+connection master;
+
+SET @@session.gtid_domain_id= 1;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(18);
+INSERT INTO t1 VALUES(19); # IO thread gets killed here.
+COMMIT;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(21);
+COMMIT;
+
+SET @@session.gtid_domain_id= 2;
+START TRANSACTION;
+INSERT INTO t1 VALUES(22);
+INSERT INTO t1 VALUES(23);
+COMMIT;
+
+save_master_pos;
+SELECT * FROM t1;
+
+--echo # On slave
+connection slave;
+--let $slave_io_errno= 1595
+--source include/wait_for_slave_io_error.inc
+SELECT * FROM t1;
+
+SET @@global.debug_dbug="-d";
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SELECT * FROM t1;
+
+--echo # Case 5 : Start slave with IGNORE_DOMAIN_IDS=(), then restart
+--echo # replication with IGNORE_DOMAIN_IDS=(1) after IO thread is
+--echo # killed due to DBUG_EXECUTE_IF("+d,kill_slave_io_after_2_events").
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
+
+--echo # On master
+connection master;
+
+SET @@session.gtid_domain_id= 1;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(24);
+INSERT INTO t1 VALUES(25); # IO thread gets killed here.
+COMMIT;
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(26);
+INSERT INTO t1 VALUES(27);
+COMMIT;
+
+SET @@session.gtid_domain_id= 2;
+START TRANSACTION;
+INSERT INTO t1 VALUES(28);
+INSERT INTO t1 VALUES(29);
+COMMIT;
+
+save_master_pos;
+SELECT * FROM t1;
+
+--echo # On slave
+connection slave;
+--let $slave_io_errno= 1595
+--source include/wait_for_slave_io_error.inc
+SELECT * FROM t1;
+
+SET @@global.debug_dbug="-d";
+
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SELECT * FROM t1;
+
+# Cleanup
+--echo # On master
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+--echo # On slave
+connection slave;
+--source include/stop_slave.inc
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
new file mode 100644
index 00000000000..032dbfdd184
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
@@ -0,0 +1,98 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+# Valgrind does not work well with test that crashes the server
+--source include/not_valgrind.inc
+--source include/master-slave.inc
+
+--echo # On master
+connection master;
+
+call mtr.add_suppression("mysqld: Table './mysql/gtid_slave_pos' is marked as crashed and should be repaired");
+call mtr.add_suppression("Checking table: './mysql/gtid_slave_pos'");
+call mtr.add_suppression("mysql.gtid_slave_pos: 1 client is using or hasn't closed the table properly");
+
+SET @@session.gtid_domain_id= 0;
+
+create table ti (a int auto_increment primary key) engine=innodb;
+create table tm (a int auto_increment primary key) engine=myisam;
+
+insert into ti set a=null;
+insert into tm set a=null;
+
+save_master_pos;
+
+--echo # On slave
+connection slave;
+sync_with_master;
+--source include/stop_slave.inc
+
+select * from ti;
+select * from tm;
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id= 1;
+
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+
+SET @@session.gtid_domain_id= 0;
+insert into ti set a=null;
+insert into tm set a=null;
+
+set @@global.debug_dbug="+d,crash_before_send_xid";
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # On slave
+connection slave;
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# IGNORE_DOMAIN_IDS=(1)
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+--source include/wait_until_disconnected.inc
+--enable_reconnect
+--let $rpl_server_number=1
+--source include/rpl_start_server.inc
+#--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/wait_until_connected_again.inc
+--echo # Master has restarted successfully
+set @@global.debug_dbug="-d";
+save_master_pos;
+
+--echo # On slave
+--connection slave
+--source include/stop_slave.inc
+--source include/start_slave.inc
+sync_with_master;
+select * from ti;
+select * from tm;
+
+# Cleanup
+--echo # On master
+--connection master
+drop table ti;
+drop table tm;
+sync_slave_with_master;
+
+--echo # On slave
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test
new file mode 100644
index 00000000000..4a997dbdf52
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test
@@ -0,0 +1,221 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--echo # On slave
+--connection server_2
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+
+##### Case 0 : When both DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS are empty.
+
+--echo # On slave
+--connection server_2
+CHANGE MASTER TO master_use_gtid=slave_pos, DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+--source include/start_slave.inc
+
+--echo # On master
+--connection server_1
+SELECT @@session.gtid_domain_id;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+--save_master_pos
+
+--echo # On slave
+--connection server_2
+--sync_with_master
+
+--echo # New connection 'con_temp1'
+# Block the table t1 to simulate a replicated query taking a long time.
+--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+LOCK TABLE t1 WRITE;
+
+--echo # On master
+--connection server_1
+SET @@session.gtid_domain_id=1;
+# This query will be blocked on the slave until UNLOCK TABLES.
+INSERT INTO t1 VALUES (2);
+SET @@session.gtid_domain_id=0;
+# These t2 queries can be replicated in parallel with the prior t1 query, as
+# they are in a separate replication domain.
+INSERT INTO t2 VALUES (2);
+INSERT INTO t2 VALUES (3);
+BEGIN;
+INSERT INTO t2 VALUES (4);
+INSERT INTO t2 VALUES (5);
+COMMIT;
+INSERT INTO t2 VALUES (6);
+
+--echo # On slave
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 6 FROM t2
+--source include/wait_condition.inc
+
+SELECT * FROM t2 ORDER by a;
+
+--echo # On con_temp1
+--connection con_temp1
+SELECT * FROM t1;
+UNLOCK TABLES;
+
+--echo # On slave
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
+--source include/wait_condition.inc
+
+SELECT * FROM t1 ORDER BY a;
+
+##### Case 1 : When DO_DOMAIN_IDS=(1)
+
+--echo # On slave
+--connection server_2
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# Replicate events belonging to "domain_id 1".
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On slave
+--connection server_2
+--sync_with_master
+
+--echo # On con_temp1
+# Block the table t1 to simulate a replicated query taking a long time.
+--connection con_temp1
+LOCK TABLE t1 WRITE;
+
+--echo # On master
+--connection server_1
+SET @@session.gtid_domain_id=0;
+# This query will be blocked on the slave until UNLOCK TABLES.
+# But, since DO_DOMAIN_IDS=(1), it will be filtered out on slave.
+INSERT INTO t1 VALUES (3);
+
+SET @@session.gtid_domain_id=1;
+# These t2 queries can be replicated in parallel with the prior t1 query, as
+# they are in a separate replication domain.
+INSERT INTO t2 VALUES (7);
+INSERT INTO t2 VALUES (8);
+BEGIN;
+INSERT INTO t2 VALUES (9);
+INSERT INTO t2 VALUES (10);
+COMMIT;
+INSERT INTO t2 VALUES (11);
+
+--echo # On slave
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 11 FROM t2
+--source include/wait_condition.inc
+
+SELECT * FROM t2 ORDER by a;
+
+--echo # On con_temp1
+--connection con_temp1
+SELECT * FROM t1;
+UNLOCK TABLES;
+
+--echo # On slave
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
+--source include/wait_condition.inc
+
+SELECT * FROM t1 ORDER BY a;
+
+##### Case 2 : When IGNORE_DOMAIN_IDS=(1)
+
+--echo # On slave
+--connection server_2
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# Replicate events belonging to "domain_id 1".
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On slave
+--connection server_2
+--sync_with_master
+
+--echo # On con_temp1
+# Block the table t1 to simulate a replicated query taking a long time.
+--connection con_temp1
+LOCK TABLE t1 WRITE;
+
+--echo # On master
+--connection server_1
+SET @@session.gtid_domain_id=1;
+# This query will be blocked on the slave until UNLOCK TABLES. However, since
+# IGNORE_DOMAIN_IDS=(1), it will be filtered out on slave.
+INSERT INTO t1 VALUES (4);
+SET @@session.gtid_domain_id=0;
+# These t2 queries can be replicated in parallel with the prior t1 query, as
+# they are in a separate replication domain.
+INSERT INTO t2 VALUES (12);
+INSERT INTO t2 VALUES (13);
+BEGIN;
+INSERT INTO t2 VALUES (14);
+INSERT INTO t2 VALUES (15);
+COMMIT;
+INSERT INTO t2 VALUES (16);
+
+--echo # On slave
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 16 FROM t2
+--source include/wait_condition.inc
+
+SELECT * FROM t2 ORDER by a;
+
+--echo # On con_temp1
+--connection con_temp1
+SELECT * FROM t1;
+UNLOCK TABLES;
+
+--echo # On slave
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
+--source include/wait_condition.inc
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2;
+
+--echo # Restore original settings.
+--echo # On master
+--connection server_1
+SET @@session.gtid_domain_id=0;
+DROP TABLE t1, t2;
+--save_master_pos
+
+--echo # On slave
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads= @old_parallel_threads;
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test
new file mode 100644
index 00000000000..e21700995bb
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test
@@ -0,0 +1,79 @@
+--source include/master-slave.inc
+
+#
+# Test for domain-id based filter on slave restart in GTID-mode.
+#
+
+
+--echo # On slave
+connection slave;
+
+source include/stop_slave.inc;
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# Ignore events belonging to "domain_id 1".
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
+source include/start_slave.inc;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id= 0;
+CREATE TABLE t1(i INT);
+CREATE TABLE t2(i INT);
+
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+
+SET @@session.gtid_domain_id= 1;
+# the following will get filtered out.
+INSERT INTO t2 VALUES(1);
+SELECT * FROM t2;
+
+sync_slave_with_master;
+
+--echo # On slave
+connection slave;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+# restart the slave
+--let $rpl_server_number= 2
+--source include/rpl_restart_server.inc
+
+--echo # On slave
+# Replicate_Do_Domain_Ids/Replicate_Ignore_Domain_Ids should reinitialize
+# properly on restart.
+connection slave;
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER RESTART) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER RESTART) : $ignore_domain_ids_after
+
+# Now, lets clear IGNORE_DOMAIN_IDS.
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=();
+--source include/start_slave.inc
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id= 0;
+DROP TABLE t1, t2;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db_fail.test b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test
index f4482064d7b..c13bae1cab3 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_db_fail.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test
@@ -25,7 +25,7 @@ use db2;
CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB;
ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id);
---error ER_ROW_IS_REFERENCED
+--error ER_ROW_IS_REFERENCED_2
DROP DATABASE db1;
DROP DATABASE db2;
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test
index 08227c18fea..d77632d2ed1 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test
@@ -2,8 +2,6 @@
# Change Author: JBM
# Change Date: 2006-02-07
# Change: Added ENGINE=MyISAM
-# Purpose: According to TU in 16552 This is how
-# to work around NDB's issue with temp tables
##############################################
source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
index 31a36a7e0aa..9aee3582574 100644
--- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
@@ -2,8 +2,6 @@
# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
# still checks that it has the same error as on the master.
##########################################################################
-# 2006-02-07 JBM Added error code 1022 for NDB Engine + ORDER BY
-##########################################################################
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_failed_optimize.test b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
index 798b3ef8b41..99860f16966 100644
--- a/mysql-test/suite/rpl/t/rpl_failed_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_failed_optimize.test
diff --git a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
index ce28c0334ec..ed28c2e9d1c 100644
--- a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_foreign_key.test
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
index 4c4a9063a0b..70be6fbff1f 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
@@ -1,537 +1 @@
---source include/have_innodb.inc
---let $rpl_topology=1->2->3->4
---source include/rpl_init.inc
-
-# Set up a 4-deep replication topology, then test various fail-overs
-# using GTID.
-#
-# A -> B -> C -> D
-
-connection server_1;
---source include/wait_for_binlog_checkpoint.inc
---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
---echo *** GTID position should be empty here ***
---replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS>
-eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
-CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1, "m1");
-INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
-INSERT INTO t2 VALUES (1, "i1");
-BEGIN;
-INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
-INSERT INTO t2 VALUES (4, "i4");
-COMMIT;
-save_master_pos;
-source include/wait_for_binlog_checkpoint.inc;
---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
---let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos`
---echo *** GTID position should be non-empty here ***
---replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
-eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
-
-connection server_2;
-sync_with_master;
-source include/wait_for_binlog_checkpoint.inc;
---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
---echo *** GTID position should be the same as on server_1 ***
---replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
-eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-save_master_pos;
-
-connection server_3;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-save_master_pos;
-
-connection server_4;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-
---echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
-connection server_4;
---source include/stop_slave.inc
-
-connection server_1;
-INSERT INTO t1 VALUES (5, "m1a");
-INSERT INTO t2 VALUES (5, "i1a");
-save_master_pos;
-
-connection server_4;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- MASTER_USE_GTID=CURRENT_POS;
---source include/start_slave.inc
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
---echo *** Now move B to D (C is still replicating from B) ***
-connection server_2;
---source include/stop_slave.inc
---replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
- MASTER_USE_GTID=CURRENT_POS;
---source include/start_slave.inc
-
-connection server_4;
-UPDATE t2 SET b="j1a" WHERE a=5;
-save_master_pos;
-
-connection server_2;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
---echo *** Now move C to D, after letting it fall a little behind ***
-connection server_3;
---source include/stop_slave.inc
-
-connection server_1;
-INSERT INTO t2 VALUES (6, "i6b");
-INSERT INTO t2 VALUES (7, "i7b");
---source include/save_master_gtid.inc
-
-connection server_3;
---replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
- MASTER_USE_GTID=CURRENT_POS;
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-SELECT * FROM t2 ORDER BY a;
-
---echo *** Now change everything back to what it was, to make rpl_end.inc happy
-# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled.
-connection server_2;
-# We need to sync up server_2 before switching. If it happened to have reached
-# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to
-# server_1, which is (deliberately) missing that transaction.
---source include/sync_with_master_gtid.inc
---source include/stop_slave.inc
---replace_result $MASTER_MYPORT MASTER_MYPORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
---source include/start_slave.inc
---source include/wait_for_slave_to_start.inc
-
-connection server_3;
---source include/stop_slave.inc
---replace_result $SLAVE_MYPORT SLAVE_MYPORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT;
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-
-connection server_4;
---source include/stop_slave.inc
---replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
---source include/start_slave.inc
-
-connection server_1;
-DROP TABLE t1,t2;
---source include/save_master_gtid.inc
-
---echo *** A few more checks for BINLOG_GTID_POS function ***
---let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1)
---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-SELECT BINLOG_GTID_POS();
---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-SELECT BINLOG_GTID_POS('a');
---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-SELECT BINLOG_GTID_POS('a',1,NULL);
-SELECT BINLOG_GTID_POS(1,'a');
-SELECT BINLOG_GTID_POS(NULL,NULL);
-SELECT BINLOG_GTID_POS('',1);
-SELECT BINLOG_GTID_POS('a',1);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
-
-
---echo *** Some tests of @@GLOBAL.gtid_binlog_state ***
---connection server_2
---source include/sync_with_master_gtid.inc
---source include/stop_slave.inc
-
---connection server_1
-SET @old_state= @@GLOBAL.gtid_binlog_state;
-
---error ER_BINLOG_MUST_BE_EMPTY
-SET GLOBAL gtid_binlog_state = '';
-RESET MASTER;
-SET GLOBAL gtid_binlog_state = '';
-FLUSH LOGS;
---source include/show_binary_logs.inc
-SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
---source include/show_binary_logs.inc
---let $binlog_file= master-bin.000001
---let $binlog_start= 4
---source include/show_binlog_events.inc
-#SELECT @@GLOBAL.gtid_binlog_pos;
-#SELECT @@GLOBAL.gtid_binlog_state;
---error ER_BINLOG_MUST_BE_EMPTY
-SET GLOBAL gtid_binlog_state = @old_state;
-RESET MASTER;
-SET GLOBAL gtid_binlog_state = @old_state;
-
-# Check that slave can reconnect again, despite the RESET MASTER, as we
-# restored the state.
-
-CREATE TABLE t1 (a INT PRIMARY KEY);
-SET gtid_seq_no=100;
-INSERT INTO t1 VALUES (1);
---source include/save_master_gtid.inc
-
---connection server_2
---source include/start_slave.inc
-# We cannot just use sync_with_master as we've done RESET MASTER, so
-# slave old-style position is wrong.
-# So sync on gtid position instead.
---source include/sync_with_master_gtid.inc
-
-SELECT * FROM t1;
-# Check that the IO gtid position in SHOW SLAVE STATUS is also correct.
---let $status_items= Gtid_IO_Pos
---source include/show_slave_status.inc
-
---echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
-
---connection server_1
-DROP TABLE t1;
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
---save_master_pos
-
---connection server_2
---sync_with_master
---source include/stop_slave.inc
-
---connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
-SELECT @@last_gtid;
-SET gtid_seq_no=110;
-SELECT @@last_gtid;
-BEGIN;
-SELECT @@last_gtid;
-INSERT INTO t1 VALUES (2);
-SELECT @@last_gtid;
-COMMIT;
-SELECT @@last_gtid;
---let $pos= `SELECT @@gtid_binlog_pos`
-
---connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-eval SET @pos= '$pos';
-# Check NULL argument.
-SELECT master_gtid_wait(NULL);
-# Check empty argument returns immediately.
-SELECT master_gtid_wait('', NULL);
-# Let's check that we get a timeout
-SELECT master_gtid_wait(@pos, 0.5);
-SELECT * FROM t1 ORDER BY a;
-# Now actually wait until the slave reaches the position
-send SELECT master_gtid_wait(@pos);
-
---connection server_2
---source include/start_slave.inc
-
---connection s1
-reap;
-SELECT * FROM t1 ORDER BY a;
-
-# Test waiting on a domain that does not exist yet.
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id= 1;
-INSERT INTO t1 VALUES (3);
---let $pos= `SELECT @@gtid_binlog_pos`
-
---connection s1
---replace_result $pos POS
-eval SET @pos= '$pos';
-SELECT master_gtid_wait(@pos, 0);
-SELECT * FROM t1 WHERE a >= 3;
-send SELECT master_gtid_wait(@pos, -1);
-
---connection server_2
---source include/start_slave.inc
-
---connection s1
-reap;
-SELECT * FROM t1 WHERE a >= 3;
-# Waiting for only part of the position.
-SELECT master_gtid_wait('1-1-1', 0);
-
-# Now test a lot of parallel master_gtid_wait() calls, completing in different
-# order, and some of which time out or get killed on the way.
-
---connection s1
-send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
-
---connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-# This will time out.
-send SELECT master_gtid_wait('0-1-1000', 0.5);
-
---connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-# This one we will kill
---let $kill1_id= `SELECT connection_id()`
-send SELECT master_gtid_wait('0-1-2000');
-
---connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-10');
-
---connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-6', 1);
-
-# This one we will kill also.
---connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
---let $kill2_id= `SELECT connection_id()`
-send SELECT master_gtid_wait('2-1-5');
-
---connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-10');
-
---connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
-
---connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-2');
-
---connection server_2
-# This one completes immediately.
-SELECT master_gtid_wait('1-1-1');
-
---connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('0-1-109');
-
---connection server_2
-# This one should time out.
-SELECT master_gtid_wait('2-1-2', 0.5);
-
---replace_result $kill1_id KILL_ID
-eval KILL QUERY $kill1_id;
---connection s3
---error ER_QUERY_INTERRUPTED
-reap;
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=2;
-INSERT INTO t1 VALUES (4);
-
---connection s9
-reap;
-
---connection server_2
---replace_result $kill2_id KILL_ID
-eval KILL CONNECTION $kill2_id;
-
---connection s6
---error 2013,ER_CONNECTION_KILLED
-reap;
-
---connection server_1
-SET gtid_domain_id=1;
-SET gtid_seq_no=4;
-INSERT INTO t1 VALUES (5);
-SET gtid_domain_id=2;
-SET gtid_seq_no=5;
-INSERT INTO t1 VALUES (6);
-
---connection s8
-reap;
---connection s1
-reap;
---connection s2
-reap;
---connection s5
-reap;
---connection s10
-reap;
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=10;
-INSERT INTO t1 VALUES (7);
-
---connection s4
-reap;
---connection s7
-reap;
-
-
---echo *** Test gtid_slave_pos when used with GTID ***
-
---connection server_2
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1000;
-INSERT INTO t1 VALUES (10);
-INSERT INTO t1 VALUES (11);
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 1;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1010;
-INSERT INTO t1 VALUES (12);
-INSERT INTO t1 VALUES (13);
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 2;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1020;
-INSERT INTO t1 VALUES (14);
-INSERT INTO t1 VALUES (15);
-INSERT INTO t1 VALUES (16);
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 3;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1030;
-INSERT INTO t1 VALUES (17);
-INSERT INTO t1 VALUES (18);
-INSERT INTO t1 VALUES (19);
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 5;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=3;
-SET gtid_seq_no=100;
-CREATE TABLE t2 (a INT PRIMARY KEY);
-DROP TABLE t2;
-SET gtid_domain_id=2;
-SET gtid_seq_no=1040;
-INSERT INTO t1 VALUES (20);
---save_master_pos
-
---connection server_2
-SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
-SET GLOBAL slave_ddl_exec_mode=STRICT;
-SET sql_slave_skip_counter=1;
-START SLAVE UNTIL master_gtid_pos="3-1-100";
---let $master_pos=3-1-100
---source include/sync_with_master_gtid.inc
---source include/wait_for_slave_to_stop.inc
---error ER_NO_SUCH_TABLE
-SELECT * FROM t2;
-SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-# Start the slave again, it should fail on the DROP TABLE as the table is not there.
-SET sql_log_bin=0;
-CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
-SET sql_log_bin=1;
-START SLAVE;
---let $slave_sql_errno=1051
---source include/wait_for_slave_sql_error.inc
-SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-STOP SLAVE IO_THREAD;
-SET sql_slave_skip_counter=2;
---source include/start_slave.inc
---sync_with_master
-
-SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
-SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-SET GLOBAL slave_ddl_exec_mode= @saved_mode;
-
-
---echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
-
-# Create an out-of-order binlog on server 2.
-# Let server 3 replicate to an out-of-order point, stop it, restart it,
-# and check that it replicates correctly despite the out-of-order.
-
---connection server_1
-SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
-INSERT INTO t1 VALUES (31);
---save_master_pos
-
---connection server_2
---sync_with_master
-SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
-INSERT INTO t1 VALUES (32);
-
---connection server_1
-INSERT INTO t1 VALUES (33);
---save_master_pos
-
---connection server_2
---sync_with_master
---save_master_pos
-
---connection server_3
---sync_with_master
---source include/stop_slave.inc
-
---connection server_1
-INSERT INTO t1 VALUES (34);
---save_master_pos
-
---connection server_2
---sync_with_master
---save_master_pos
-
---connection server_3
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
---save_master_pos
-
---connection server_4
---sync_with_master
-SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
-
-
-# Clean up.
---connection server_1
-DROP TABLE t1;
-
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_gtid_basic.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
index df3ba9a3420..b81cbd38cd3 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
@@ -12,11 +12,6 @@
call mtr.add_suppression("Checking table:");
call mtr.add_suppression("client is using or hasn't closed the table properly");
call mtr.add_suppression("Table .* is marked as crashed and should be repaired");
-# We have seen this warning a couple of times in Buildbot. Since we crash the
-# server deliberately, it seems possible that we could in rare cases crash in
-# the middle of a page write. The page is recovered from the doublewrite
-# buffer ("[Note] InnoDB: Recovered the page from the doublewrite buffer.").
-call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
flush tables;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test b/mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test
new file mode 100644
index 00000000000..5abedd7eb37
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test
@@ -0,0 +1,95 @@
+# In case master's gtid binlog state is divergent from the slave's gtid_slave_pos
+# slave may not be able to connect.
+# For instance when slave is more updated in some of domains, see
+# MDEV-12012 as example, the master's state may require adjustment.
+# In a specific case of an "old" divergent domain, that is there
+# won't be no more event groups from it generated, the states can be
+# made compatible with wiping the problematic domain away. After that slave
+# becomes connectable.
+#
+# Notice that the slave applied gtid state is not really required to
+# be similarly cleaned in order for replication to flow.
+# However this could lead to an expected error when the master
+# resumes binlogging of such domain which the test demonstrate.
+
+--source include/master-slave.inc
+
+--connection master
+# enforce the default domain_id binlogging explicitly
+SET @@SESSION.gtid_domain_id=0;
+CREATE TABLE t (a INT);
+--sync_slave_with_master
+
+--connection slave
+call mtr.add_suppression("connecting slave requested to start from.*which is not in the master's binlog");
+
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+
+--connection master
+# create extra gtid domains for binlog state
+--let $extra_domain_id=11
+--let $extra_domain_server_id=111
+--let $extra_gtid_seq_no=1
+--eval SET @@SESSION.gtid_domain_id=$extra_domain_id
+--eval SET @@SESSION.server_id=$extra_domain_server_id
+--eval SET @@SESSION.gtid_seq_no=$extra_gtid_seq_no
+INSERT INTO t SET a=1;
+
+#
+# Set up the slave replication state as if slave knows more events from the extra
+# domain.
+#
+--connection slave
+SET @save.gtid_slave_pos=@@global.gtid_slave_pos;
+--eval SET @@global.gtid_slave_pos=concat(@@global.gtid_slave_pos, ",", $extra_domain_id, "-", $extra_domain_server_id, "-", $extra_gtid_seq_no + 1)
+
+# unsuccessful attempt to start slave
+START SLAVE IO_THREAD;
+--let $slave_io_errno=1236
+--source include/wait_for_slave_io_error.inc
+
+--connection master
+# adjust the master binlog state
+FLUSH BINARY LOGS;
+--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--eval PURGE BINARY LOGS TO '$purge_to_binlog';
+# with final removal of the extra domain
+--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID=($extra_domain_id)
+
+--connection slave
+# start the slave sucessfully
+--source include/start_slave.inc
+
+--connection master
+# but the following gtid from the *extra* domain will break replication
+INSERT INTO t SET a=1;
+
+# take note of the slave io thread error due to being dismissed
+# extra domain at connection to master which tried becoming active;
+# slave is to stop.
+--connection slave
+--let $errno=1236
+--source include/wait_for_slave_io_error.inc
+
+# let's apply the very same medicine
+--connection master
+FLUSH BINARY LOGS;
+--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--eval PURGE BINARY LOGS TO '$purge_to_binlog';
+# with final removal of the extra domain
+--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID=($extra_domain_id)
+
+--connection slave
+--source include/start_slave.inc
+
+#
+# cleanup
+#
+--connection master
+SET @@SESSION.gtid_domain_id=0;
+DROP TABLE t;
+
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.cnf b/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.cnf
new file mode 100644
index 00000000000..80b66498022
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.cnf
@@ -0,0 +1,20 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates
+loose-innodb
+gtid_domain_id=1
+
+[mysqld.2]
+log-slave-updates
+loose-innodb
+gtid_domain_id=2
+
+[mysqld.3]
+log-slave-updates
+loose-innodb
+gtid_domain_id=3
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test
new file mode 100644
index 00000000000..f8e8642af28
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test
@@ -0,0 +1,72 @@
+--source include/have_innodb.inc
+--let $rpl_topology=1->2->3
+--source include/rpl_init.inc
+
+--connection server_2
+--source include/stop_slave.inc
+eval CHANGE MASTER TO
+ MASTER_USE_GTID = SLAVE_POS, IGNORE_DOMAIN_IDS = (2,3);
+START SLAVE;
+
+--connection server_3
+--source include/stop_slave.inc
+eval CHANGE MASTER TO
+ MASTER_USE_GTID = SLAVE_POS, IGNORE_DOMAIN_IDS = (2,3);
+START SLAVE;
+
+connection server_1;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "m1");
+INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+
+SET @@session.gtid_domain_id=2;
+--echo # The following should get filetered on slave.
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, "m1");
+INSERT INTO t2 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+
+--source include/save_master_gtid.inc
+
+connection server_2;
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1 ORDER BY a;
+--echo # Only 't1' should have replicated to slaves.
+SHOW TABLES;
+
+--source include/save_master_gtid.inc
+
+connection server_3;
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1 ORDER BY a;
+--echo # Only 't1' should have replicated to slaves.
+SHOW TABLES;
+
+--echo # Cleanup
+--connection server_1
+SET @@session.gtid_domain_id=1;
+DROP TABLE t1;
+SET @@session.gtid_domain_id=2;
+DROP TABLE t2;
+
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+
+--source include/save_master_gtid.inc
+
+--connection server_3
+--source include/sync_with_master_gtid.inc
+
+--connection server_2
+STOP SLAVE;
+CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = ();
+
+--connection server_3
+STOP SLAVE;
+CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = ();
+
+--echo # End of test.
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_sort.test b/mysql-test/suite/rpl/t/rpl_gtid_sort.test
new file mode 100644
index 00000000000..dc3b18aa897
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_sort.test
@@ -0,0 +1,77 @@
+--source include/have_innodb.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--echo *** Test connecting with empty GTID state to start from very beginning of binlog ***
+--connection server_2
+--source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+SHOW VARIABLES LIKE 'gtid_current_pos';
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+
+--connection server_1
+RESET MASTER;
+FLUSH LOGS;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SET @@SESSION.gtid_domain_id=1;
+INSERT INTO t1 VALUES(1);
+
+SET @@SESSION.gtid_domain_id=99999;
+INSERT INTO t1 VALUES(3);
+
+SET @@SESSION.gtid_domain_id=10;
+INSERT INTO t1 VALUES(4);
+
+SET @@SESSION.gtid_domain_id=100;
+INSERT INTO t1 VALUES(5);
+
+SET @@SESSION.gtid_domain_id=2147483648; # 0x80000000
+INSERT INTO t1 VALUES(6);
+
+SET @@SESSION.gtid_domain_id=4294967295; # 0xFFFFFFFF
+INSERT INTO t1 VALUES(7);
+
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+SHOW VARIABLES LIKE 'gtid_current_pos';
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+--save_master_pos
+
+--connection server_2
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+SHOW VARIABLES LIKE 'gtid_current_pos';
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+--sync_with_master
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+SHOW VARIABLES LIKE 'gtid_current_pos';
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+SELECT * FROM t1;
+
+SET @@SESSION.gtid_domain_id=1000;
+INSERT INTO t1 VALUES(8);
+
+SET @@SESSION.gtid_domain_id=89;
+INSERT INTO t1 VALUES(9);
+
+SET @@SESSION.gtid_domain_id=10100000;
+INSERT INTO t1 VALUES(10);
+
+SHOW VARIABLES LIKE 'gtid_binlog_pos';
+SHOW VARIABLES LIKE 'gtid_current_pos';
+SHOW VARIABLES LIKE 'gtid_slave_pos';
+SHOW VARIABLES LIKE 'gtid_binlog_state';
+
+# Clean up.
+--connection server_1
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
index 34074ba8ca9..ee049a515d7 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
@@ -6,11 +6,15 @@ source include/master-slave.inc;
# do not be influenced by other tests.
connection master;
+set global sql_mode="";
+set local sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
save_master_pos;
connection slave;
+set global sql_mode="";
+set local sql_mode="";
sync_with_master;
# as these DELETE were not replicated, we need to do them manually on the
# slave.
@@ -56,5 +60,8 @@ delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+set global sql_mode=default;
+connection master;
+set global sql_mode=default;
# End of 4.1 tests
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index f4c2c32a805..111b6159ec7 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
@@ -49,6 +49,7 @@ connection master;
create table test.t1(a int);
create table test.t4(a int);
+set sql_mode="";
# Simple user that should not replicate
GRANT SELECT ON test.t1 TO mysqltest1@localhost;
@@ -87,7 +88,7 @@ show grants for mysqltest6@localhost;
flush privileges;
show grants for mysqltest5@somehost;
-
+set sql_mode="";
sync_slave_with_master;
--echo **** Checking grants on slave ****
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index 60ffd43bf52..9be855e1a8b 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -1,48 +1 @@
---source include/have_debug.inc
---source include/master-slave.inc
-
---echo **** On Master ****
-CREATE TABLE t1 (a INT);
-
-INSERT INTO t1 VALUES (1),(2),(3);
-SELECT * FROM t1;
-
-let $debug_save= `SELECT @@GLOBAL.debug`;
-SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
-
-# This will generate an incident log event and store it in the binary
-# log before the replace statement.
-REPLACE INTO t1 VALUES (4);
---save_master_pos
-SELECT * FROM t1;
-
---disable_query_log
-eval SET GLOBAL debug_dbug= '$debug_save';
---enable_query_log
-
-connection slave;
-# Wait until SQL thread stops with error LOST_EVENT on master
-call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
-let $slave_sql_errno= 1590;
-let $show_slave_sql_error= 1;
-source include/wait_for_slave_sql_error.inc;
-
-# The 4 should not be inserted into the table, since the incident log
-# event should have stop the slave.
---echo **** On Slave ****
-SELECT * FROM t1;
-
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
---sync_with_master
-
-# Now, we should have inserted the row into the table and the slave
-# should be running. We should also have rotated to a new binary log.
-
-SELECT * FROM t1;
-source include/check_slave_is_running.inc;
-
-connection master;
-DROP TABLE t1;
---sync_slave_with_master
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_incident.inc
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
index f08832e7e72..6f515b9390a 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
@@ -1,89 +1 @@
-######################################################################
-# Some errors that cause the slave SQL thread to stop are not shown in
-# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
-# is only in the server's error log.
-#
-# Two failures and their respective reporting are verified:
-#
-# 1 - Failures during slave thread initialization
-# 2 - Failures while processing queries passed through the init_slave
-# option.
-#
-# In order to check the first type of failure, we inject a fault in the
-# SQL/IO Threads through SET GLOBAL debug.
-#
-# To check the second type, we set @@global.init_slave to an invalid
-# command thus preventing the initialization of the SQL Thread.
-#
-# Obs:
-# 1 - Note that testing failures while initializing the relay log position
-# is hard as the same function is called before the code reaches the point
-# that we want to test.
-#
-# 2 - This test does not target failures that are reported while applying
-# events such as duplicate keys, errors while reading the relay-log.bin*,
-# etc. Such errors are already checked on other tests.
-######################################################################
-
-######################################################################
-# Configuring the Environment
-######################################################################
-source include/have_debug.inc;
-source include/have_log_bin.inc;
-source include/master-slave.inc;
-
-connection slave;
-
---disable_warnings
-stop slave;
---enable_warnings
-reset slave;
-
-######################################################################
-# Injecting faults in the threads' initialization
-######################################################################
-connection slave;
-
-# Set debug flags on slave to force errors to occur
-SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
-
-start slave;
-
-#
-# slave is going to stop because of emulated failures
-# but there won't be any crashes nor asserts hit.
-#
-# 1593 = ER_SLAVE_FATAL_ERROR
---let $slave_sql_errno= 1593
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-
-call mtr.add_suppression("Failed during slave.* thread initialization");
-
-SET GLOBAL debug_dbug= "";
-
-######################################################################
-# Injecting faults in the init_slave option
-######################################################################
-connection slave;
-
-reset slave;
-
-SET GLOBAL init_slave= "garbage";
-
-start slave;
-# 1064 = ER_PARSE_ERROR
---let $slave_sql_errno= 1064
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-
-######################################################################
-# Clean up
-######################################################################
-SET GLOBAL init_slave= "";
-
-# Clean up Last_SQL_Error
---source include/stop_slave_io.inc
-RESET SLAVE;
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_init_slave_errors.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
index afc0c2cbd4b..12698263da4 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
@@ -14,18 +14,21 @@ let $engine_type= 'innodb';
use test;
eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
- dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON
+ UPDATE CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
PRIMARY KEY(id)) ENGINE=$engine_type;
eval CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
- dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+ CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
PRIMARY KEY(id)) ENGINE=$engine_type
PARTITION BY KEY(id) partitions 5;
eval CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
- dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+ CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
PRIMARY KEY(id)) ENGINE=$engine_type
PARTITION BY RANGE(id)
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id.test b/mysql-test/suite/rpl/t/rpl_insert_id.test
index f2f62a207a0..ad32ad24b33 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id.test
@@ -1,7 +1,6 @@
#################################
# Wrapper for rpl_insert_id.test#
#################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_insert_id.test
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id_pk.test b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
index c0d68855f85..148afdac87b 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
@@ -1,7 +1,6 @@
#################################
# Wrapper for rpl_insert_id.test#
#################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=innodb;
-- source extra/rpl_tests/rpl_insert_id_pk.test
diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore.test b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
index 0346975fcee..0891a04db25 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_ignore.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
@@ -1,7 +1,6 @@
#####################################
# Wrapper for rpl_insert_ignore.test#
#####################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test
index 9f4ca1aaf18..76b008caa92 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_statement.inc
let $engine_type=MyISAM;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index 30c9ff1e9e2..8d90afaed27 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
@@ -1,240 +1 @@
-# See if "LOAD DATA LOCAL INFILE" is well replicated
-# (LOAD DATA LOCAL INFILE is not written to the binlog
-# the same way as LOAD DATA INFILE : Append_blocks are smaller).
-# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE :
-# - the loaded file was not written entirely to the master's binlog,
-# only the first 4KB, 8KB or 16KB usually.
-# - the loaded file's first line was not written entirely to the
-# master's binlog (1st char was absent)
-source include/master-slave.inc;
-
-create table t1(a int);
-let $1=10000;
-disable_query_log;
-set SQL_LOG_BIN=0;
-while ($1)
-{
- insert into t1 values(1);
- dec $1;
-}
-set SQL_LOG_BIN=1;
-enable_query_log;
-let $MYSQLD_DATADIR= `select @@datadir`;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
-#This will generate a 20KB file, now test LOAD DATA LOCAL
-truncate table t1;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
-sync_slave_with_master;
-select a,count(*) from t1 group by a;
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
-
-#
-# Now let us test how well we replicate LOAD DATA LOCAL in situation when
-# we met duplicates in tables to which we are adding rows.
-# (It supposed that LOAD DATA LOCAL ignores such errors)
-#
-connection master;
-create table t1(a int);
-insert into t1 values (1), (2), (2), (3);
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
-drop table t1;
-create table t1(a int primary key);
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
-SELECT * FROM t1 ORDER BY a;
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-connection master;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-
-#
-# Bug22504 load data infile sql statement in replication architecture get error
-#
---echo ==== Bug22504 Initialize ====
-
---echo [on master]
---connection master
-
-SET sql_mode='ignore_space';
-CREATE TABLE t1(a int);
-insert into t1 values (1), (2), (3), (4);
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
-truncate table t1;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
-SELECT * FROM t1 ORDER BY a;
-
---echo [on slave]
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
---echo ==== Clean up ====
-
---echo [on master]
-connection master;
-DROP TABLE t1;
-
---echo [on slave]
-sync_slave_with_master;
-
---echo
---echo Bug #43746:
---echo "return wrong query string when parse 'load data infile' sql statement"
---echo
-
---echo [master]
-connection master;
-let $MYSQLD_DATADIR= `select @@datadir`;
-SELECT @@SESSION.sql_mode INTO @old_mode;
-
-SET sql_mode='ignore_space';
-
-CREATE TABLE t1(a int);
-INSERT INTO t1 VALUES (1), (2), (3), (4);
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug43746.sql' FROM t1;
-TRUNCATE TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD/* look mum, with comments in weird places! */DATA/* oh hai */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/* we are */INTO/* from the internets */TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO */ TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO TABLE */ t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA /*!10000 LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE */ t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!10000 INTO*/TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/* empty */INTO TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD/*!999999 special comments that do not expand */DATA/*!999999 code from the future */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!999999 have flux capacitor */INTO/*!999999 will travel */TABLE t1;
-
-SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
-
---echo [slave]
-sync_slave_with_master;
-
---echo
---echo Bug #59267:
---echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
---echo
-
---echo [master]
-connection master;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
-TRUNCATE TABLE t1;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
-
-SELECT 'Master', COUNT(*) FROM t1;
-
---echo [slave]
---sync_slave_with_master
-SELECT 'Slave', COUNT(*) FROM t1;
-
-# cleanup
---echo [master]
-connection master;
-
---remove_file $MYSQLD_DATADIR/bug43746.sql
---remove_file $MYSQLD_DATADIR/bug59267.sql
-
-DROP TABLE t1;
-SET SESSION sql_mode=@old_mode;
-
---echo [slave]
-sync_slave_with_master;
-
-connection master;
-
---echo
---echo Bug #60580/#11902767:
---echo "statement improperly replicated crashes slave sql thread"
---echo
-
---echo [master]
-connection master;
-let $MYSQLD_DATADIR= `select @@datadir`;
-
-CREATE TABLE t1(f1 INT, f2 INT);
-CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
-
-INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
-INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
-INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
-
-CREATE TABLE t3 AS SELECT * FROM t2;
-
-CREATE VIEW v1 AS SELECT * FROM t2
- WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
-
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
-
-SELECT * FROM t1;
-
-sleep 1;
-
---echo [slave]
-sync_slave_with_master;
-
-SELECT * FROM t1;
-
---remove_file $MYSQLD_DATADIR/bug60580.csv
-
---echo [master]
-connection master;
-
-DROP VIEW v1;
-DROP TABLE t1, t2, t3;
-
---echo [slave]
-sync_slave_with_master;
-
-connection master;
---source include/rpl_end.inc
-
---echo # End of 5.1 tests
+--source extra/rpl_tests/rpl_loaddata_local.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index 3f897faac48..babf4208b3d 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -1,115 +1 @@
-#############################################################################
-# Original Author: JBM #
-# Original Date: Aug/18/2005 #
-#############################################################################
-# TEST: To test the LOAD_FILE() in rbr #
-#############################################################################
-# Change Author: JBM
-# Change Date: 2006-01-16
-# Change: Added Order by for NDB
-##########
-
-# Includes
--- source include/have_binlog_format_mixed_or_row.inc
--- source include/master-slave.inc
-
--- source extra/rpl_tests/rpl_loadfile.test
-
-# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
-#
-# DESCRIPTION
-#
-# Problem: when using load_file string function and mixed binlogging format
-# there was no switch to row based binlogging format. This leads
-# to scenarios on which the slave replicates the statement and it
-# will try to load the file from local file system, which in most
-# likely it will not exist.
-#
-# Solution:
-# Marking this function as unsafe for statement format, makes the
-# statement using it to be logged in row based format. As such, data
-# replicated from the master, becomes the content of the loaded file.
-# Consequently, the slave receives the necessary data to complete
-# the load_file instruction correctly.
-#
-# IMPLEMENTATION
-#
-# The test is implemented as follows:
-#
-# On Master,
-# i) write to file the desired content.
-# ii) create table and stored procedure with load_file
-# iii) stop slave
-# iii) execute load_file
-# iv) remove file
-#
-# On Slave,
-# v) start slave
-# vi) sync it with master so that it gets the updates from binlog (which
-# should have bin logged in row format).
-#
-# If the the binlog format does not change to row, then the assertion
-# done in the following step fails. This happens because tables differ
-# since the file does not exist anymore, meaning that when slave
-# attempts to execute LOAD_FILE statement it inserts NULL on table
-# instead of the same contents that the master loaded when it executed
-# the procedure (which was executed when file existed).
-#
-# vii) assert that the contents of master and slave
-# table are the same
-
---source include/rpl_reset.inc
-
-connection master;
-let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
-
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---eval SELECT repeat('x',20) INTO OUTFILE '$file'
-
-disable_warnings;
-DROP TABLE IF EXISTS t1;
-enable_warnings;
-
-CREATE TABLE t1 (t text);
-DELIMITER |;
-CREATE PROCEDURE p(file varchar(4096))
- BEGIN
- INSERT INTO t1 VALUES (LOAD_FILE(file));
- END|
-DELIMITER ;|
-
-# stop slave before issuing the load_file on master
-connection slave;
-source include/stop_slave.inc;
-
-connection master;
-
-# test: check that logging falls back to rbr.
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---eval CALL p('$file')
-
-# test: remove the file from the filesystem and assert that slave still
-# gets the loaded file
-remove_file $file;
-
-# now that the file is removed it is safe (regarding what we want to test)
-# to start slave
-connection slave;
-source include/start_slave.inc;
-
-connection master;
-sync_slave_with_master;
-
-# assertion: assert that the slave got the updates even
-# if the file was removed before the slave started,
-# meaning that contents were indeed transfered
-# through binlog (in row format)
-let $diff_tables= master:t1, slave:t1;
-source include/diff_tables.inc;
-
-# CLEAN UP
---connection master
-DROP TABLE t1;
-DROP PROCEDURE p;
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_loadfile.inc
diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
index 1270933ede1..4f63cd32916 100644
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
@@ -1,7 +1,6 @@
##########
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
##########
#
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test
index b1dbf99f114..704c09355aa 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test
@@ -1,9 +1,5 @@
# See if replication between MyISAM, MEMORY and InnoDB works.
-#This test case is not written for NDB, result files do not
-#match when NDB is the default engine
--- source include/not_ndb_default.inc
-
-- source include/master-slave.inc
connection slave;
@@ -17,7 +13,8 @@ drop table if exists t1;
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
-0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP,PRIMARY KEY(id));
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update.test b/mysql-test/suite/rpl/t/rpl_multi_update.test
index 710337816da..cc147eb3263 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update.test
@@ -1,3 +1,2 @@
--- source include/not_ndb_default.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_multi_update.test
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update2.test b/mysql-test/suite/rpl/t/rpl_multi_update2.test
index 138c1455952..95952cd9e15 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2.test
@@ -1,10 +1,7 @@
#######################################################
# Wrapper for rpl_multi_update2.test to allow multi #
# Engines to reuse test code. By JBM 2006-02-15 #
-# Added comments section and to skip when ndb is #
-# Default engine. #
#######################################################
---source include/not_ndb_default.inc
--source include/master-slave.inc
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
let $engine_type=MyISAM;
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test
index dc12d528c24..d356ca88517 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update3.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update3.test
@@ -1,10 +1,7 @@
#######################################################
# Wrapper for rpl_multi_update3.test to allow multi #
# Engines to reuse test code. By JBM 2006-02-15 #
-# Added comments section and to skip when ndb is #
-# Default engine. #
#######################################################
---source include/not_ndb_default.inc
--source include/master-slave.inc
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
let $engine_type=MyISAM;
diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
index e99a233ac34..1931e2eab2a 100644
--- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
+++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
@@ -43,6 +43,9 @@ connection master;
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
--exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
+let $datadir= `select @@datadir`;
+remove_file $datadir/mysql_upgrade_info;
+
connection master;
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test
index 47063539ffc..bb960d4eb69 100644
--- a/mysql-test/suite/rpl/t/rpl_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_optimize.test
@@ -4,13 +4,10 @@
#####################################
# Change Author: JBM
# Change Date: 2006-02-09
-# Change: NDB does not and will not support
# OPTIMIZE for memory tables. If and when
# it does support for Disk Data, a new
# version of this test will be need.
-# Skipping this test if default engine = ndb
#####################################
--- source include/not_ndb_default.inc
# Slow test, don't run during staging part
-- source include/not_staging.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index e850ae36700..31357cb148e 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -1,177 +1 @@
-# ==== Purpose ====
-#
-# Check replication protocol packet size handling
-#
-# ==== Related bugs ====
-# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
-# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits
-# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors
-# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
-
-# max-out size db name
-source include/have_binlog_format_row.inc;
-source include/master-slave.inc;
-call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
-call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
-let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
-disable_warnings;
-eval drop database if exists $db;
-enable_warnings;
-eval create database $db;
-
-connection master;
-let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
-let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
-let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
-SET @@global.max_allowed_packet=1024;
-SET @@global.net_buffer_length=1024;
-
-sync_slave_with_master;
-# Restart slave for setting to take effect
-source include/stop_slave.inc;
-source include/start_slave.inc;
-
-# Reconnect to master for new setting to take effect
-disconnect master;
-
-# alas, can't use eval here; if db name changed apply the change here
-connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
-
-connection master;
-select @@net_buffer_length, @@max_allowed_packet;
-
-create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
-sync_slave_with_master;
-
-eval select count(*) from `$db`.`t1` /* must be 1 */;
-
-SHOW STATUS LIKE 'Slave_running';
-select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
-connection master;
-eval drop database $db;
-sync_slave_with_master;
-
-#
-# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
-#
-# Check that a situation when the size of event on the master is greater than
-# max_allowed_packet on the slave does not lead to infinite re-transmits.
-
-connection master;
-
-# Change the max packet size on master
-
-SET @@global.max_allowed_packet=4096;
-SET @@global.net_buffer_length=4096;
-
-# Restart slave for new setting to take effect
-connection slave;
-source include/stop_slave.inc;
-source include/start_slave.inc;
-
-# Reconnect to master for new setting to take effect
-disconnect master;
-connect (master, localhost, root);
-connection master;
-
-CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-
-sync_slave_with_master;
-
-connection master;
-
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-
-
-#
-# Bug#42914: The slave I/O thread must stop after trying to read the above
-# event, However there is no Last_IO_Error report.
-#
-
-# The slave I/O thread must stop after trying to read the above event
-connection slave;
-# 1153 = ER_NET_PACKET_TOO_LARGE
---let $slave_io_errno= 1153
---let $show_slave_io_error= 1
---source include/wait_for_slave_io_error.inc
-
-# TODO: this is needed because of BUG#55790. Remove once that is fixed.
---source include/stop_slave_sql.inc
-
-#
-# Bug#42914: On the master, if a binary log event is larger than
-# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
-# is sent to a slave when it requests a dump from the master, thus leading the
-# I/O thread to stop. However, there is no Last_IO_Error reported.
-#
-
---let $rpl_only_running_threads= 1
---source include/rpl_reset.inc
---connection master
-DROP TABLE t1;
---sync_slave_with_master
-
-
-connection master;
-CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
-sync_slave_with_master;
-
-connection master;
-INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
-
-connection slave;
-# The slave I/O thread must stop after receiving
-# 1153 = ER_NET_PACKET_TOO_LARGE
---let $slave_io_errno= 1153
---let $show_slave_io_error= 1
---source include/wait_for_slave_io_error.inc
-
-# Remove the bad binlog and clear error status on slave.
-STOP SLAVE;
-RESET SLAVE;
---connection master
-RESET MASTER;
-
-
-#
-# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
-#
-# In BUG#55322, @@session.max_allowed_packet increased each time SHOW
-# BINLOG EVENTS was issued. To verify that this bug is fixed, we
-# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet
-# never changes. We turn off the result log because we don't care
-# about the contents of the binlog.
-
---disable_result_log
-SET @max_allowed_packet_0= @@session.max_allowed_packet;
-SHOW BINLOG EVENTS;
-SET @max_allowed_packet_1= @@session.max_allowed_packet;
-SHOW BINLOG EVENTS;
-SET @max_allowed_packet_2= @@session.max_allowed_packet;
---enable_result_log
-if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`)
-{
- --echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS
- --source include/show_rpl_debug_info.inc
- SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2;
- --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
-}
-
-
---echo ==== clean up ====
-connection master;
-DROP TABLE t1;
-eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
-eval SET @@global.net_buffer_length= $old_net_buffer_length;
-eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
-# slave is stopped
-connection slave;
-DROP TABLE t1;
-
-# Clear Last_IO_Error
-RESET SLAVE;
-
---source include/rpl_end.inc
-# End of tests
+--source extra/rpl_tests/rpl_packet.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test
index ace9e8e37f4..b7c4bb429a4 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test
@@ -1,2413 +1 @@
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
---let $rpl_topology=1->2
---source include/rpl_init.inc
-
-# Test various aspects of parallel replication.
-
---connection server_2
-SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
---error ER_SLAVE_MUST_STOP
-SET GLOBAL slave_parallel_threads=10;
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=10;
-
-# Check that we do not spawn any worker threads when no slave is running.
-SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
-
-CHANGE MASTER TO master_use_gtid=slave_pos;
---source include/start_slave.inc
-
-# Check that worker threads get spawned when slave starts.
-SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
-# ... and that worker threads get removed when slave stops.
---source include/stop_slave.inc
-SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
---source include/start_slave.inc
-SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
-
---echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
-
---connection server_1
-ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
-CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
-CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
---save_master_pos
-
---connection server_2
---sync_with_master
-
-# Block the table t1 to simulate a replicated query taking a long time.
---connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-LOCK TABLE t1 WRITE;
-
---connection server_1
-SET gtid_domain_id=1;
-# This query will be blocked on the slave until UNLOCK TABLES.
-INSERT INTO t1 VALUES (2);
-SET gtid_domain_id=0;
-# These t2 queries can be replicated in parallel with the prior t1 query, as
-# they are in a separate replication domain.
-INSERT INTO t2 VALUES (2);
-INSERT INTO t2 VALUES (3);
-BEGIN;
-INSERT INTO t2 VALUES (4);
-INSERT INTO t2 VALUES (5);
-COMMIT;
-INSERT INTO t2 VALUES (6);
-
---connection server_2
---let $wait_condition= SELECT COUNT(*) = 6 FROM t2
---source include/wait_condition.inc
-
-SELECT * FROM t2 ORDER by a;
-
---connection con_temp1
-SELECT * FROM t1;
-UNLOCK TABLES;
-
---connection server_2
---let $wait_condition= SELECT COUNT(*) = 2 FROM t1
---source include/wait_condition.inc
-
-SELECT * FROM t1 ORDER BY a;
-
-
---echo *** Test two transactions in different domains committed in opposite order on slave but in a single group commit. ***
---connection server_2
---source include/stop_slave.inc
-
---connection server_1
-# Use a stored function to inject a debug_sync into the appropriate THD.
-# The function does nothing on the master, and on the slave it injects the
-# desired debug_sync action(s).
-SET sql_log_bin=0;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
-SET @old_format= @@SESSION.binlog_format;
-SET binlog_format='statement';
-SET gtid_domain_id=1;
-INSERT INTO t2 VALUES (foo(10,
- 'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1',
- 'commit_after_release_LOCK_prepare_ordered SIGNAL ready2'));
-
---connection server_2
-FLUSH LOGS;
---source include/wait_for_binlog_checkpoint.inc
-SET sql_log_bin=0;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- IF d1 != '' THEN
- SET debug_sync = d1;
- END IF;
- IF d2 != '' THEN
- SET debug_sync = d2;
- END IF;
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-SET @old_format=@@GLOBAL.binlog_format;
-SET GLOBAL binlog_format=statement;
-# We need to restart all parallel threads for the new global setting to
-# be copied to the session-level values.
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-# First make sure the first insert is ready to commit, but not queued yet.
-SET debug_sync='now WAIT_FOR ready1';
-
---connection server_1
-SET gtid_domain_id=2;
-INSERT INTO t2 VALUES (foo(11,
- 'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3',
- 'commit_after_release_LOCK_prepare_ordered SIGNAL ready4 WAIT_FOR cont4'));
-SET gtid_domain_id=0;
-SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
-
---connection server_2
-# Now wait for the second insert to queue itself as the leader, and then
-# wait for more commits to queue up.
-SET debug_sync='now WAIT_FOR ready3';
-SET debug_sync='now SIGNAL cont3';
-SET debug_sync='now WAIT_FOR ready4';
-# Now allow the first insert to queue up to participate in group commit.
-SET debug_sync='now SIGNAL cont1';
-SET debug_sync='now WAIT_FOR ready2';
-# Finally allow the second insert to proceed and do the group commit.
-SET debug_sync='now SIGNAL cont4';
-
---let $wait_condition= SELECT COUNT(*) = 2 FROM t2 WHERE a >= 10
---source include/wait_condition.inc
-SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
-# The two INSERT transactions should have been committed in opposite order,
-# but in the same group commit (seen by precense of cid=# in the SHOW
-# BINLOG output).
---let $binlog_file= slave-bin.000002
---source include/show_binlog_events.inc
-FLUSH LOGS;
---source include/wait_for_binlog_checkpoint.inc
-
-# Restart all the slave parallel worker threads, to clear all debug_sync actions.
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-SET debug_sync='RESET';
---source include/start_slave.inc
-
-
---echo *** Test that group-committed transactions on the master can replicate in parallel on the slave. ***
---connection server_1
-SET debug_sync='RESET';
-FLUSH LOGS;
---source include/wait_for_binlog_checkpoint.inc
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
-# Create some sentinel rows so that the rows inserted in parallel fall into
-# separate gaps and do not cause gap lock conflicts.
-INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7);
---save_master_pos
---connection server_2
---sync_with_master
-
-# We want to test that the transactions can execute out-of-order on
-# the slave, but still end up committing in-order, and in a single
-# group commit.
-#
-# The idea is to group-commit three transactions together on the master:
-# A, B, and C. On the slave, C will execute the insert first, then A,
-# and then B. But B manages to complete before A has time to commit, so
-# all three end up committing together.
-#
-# So we start by setting up some row locks that will block transactions
-# A and B from executing, allowing C to run first.
-
---connection con_temp1
-BEGIN;
-INSERT INTO t3 VALUES (2,102);
---connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-BEGIN;
-INSERT INTO t3 VALUES (4,104);
-
-# On the master, queue three INSERT transactions as a single group commit.
---connect (con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (2, foo(12,
- 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
- ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connect (con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (4, foo(14,
- 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
- ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-
---connect (con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (6, foo(16,
- 'group_commit_waiting_for_prior SIGNAL slave_queued3',
- ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued3';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con_temp3
-REAP;
---connection con_temp4
-REAP;
---connection con_temp5
-REAP;
-SET debug_sync='RESET';
-
---connection server_1
-SELECT * FROM t3 ORDER BY a;
---let $binlog_file= master-bin.000002
---source include/show_binlog_events.inc
-
-# First, wait until insert 3 is ready to queue up for group commit, but is
-# waiting for insert 2 to commit before it can do so itself.
---connection server_2
-SET debug_sync='now WAIT_FOR slave_queued3';
-
-# Next, let insert 1 proceed, and allow it to queue up as the group commit
-# leader, but let it wait for insert 2 to also queue up before proceeding.
---connection con_temp1
-ROLLBACK;
---connection server_2
-SET debug_sync='now WAIT_FOR slave_queued1';
-
-# Now let insert 2 proceed and queue up.
---connection con_temp2
-ROLLBACK;
---connection server_2
-SET debug_sync='now WAIT_FOR slave_queued2';
-# And finally, we can let insert 1 proceed and do the group commit with all
-# three insert transactions together.
-SET debug_sync='now SIGNAL slave_cont1';
-
-# Wait for the commit to complete and check that all three transactions
-# group-committed together (will be seen in the binlog as all three having
-# cid=# on their GTID event).
---let $wait_condition= SELECT COUNT(*) = 3 FROM t3 WHERE a IN (2,4,6)
---source include/wait_condition.inc
-SELECT * FROM t3 ORDER BY a;
---let $binlog_file= slave-bin.000003
---source include/show_binlog_events.inc
-
-
---echo *** Test STOP SLAVE in parallel mode ***
---connection server_2
---source include/stop_slave.inc
-# Respawn all worker threads to clear any left-over debug_sync or other stuff.
-SET debug_sync='RESET';
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-
---connection server_1
-# Set up a couple of transactions. The first will be blocked halfway
-# through on a lock, and while it is blocked we initiate STOP SLAVE.
-# We then test that the halfway-initiated transaction is allowed to
-# complete, but no subsequent ones.
-# We have to use statement-based mode and set
-# binlog_direct_non_transactional_updates=0; otherwise the binlog will
-# be split into two event groups, one for the MyISAM part and one for the
-# InnoDB part.
-SET binlog_direct_non_transactional_updates=0;
-SET sql_log_bin=0;
-CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
-SET sql_log_bin=1;
-BEGIN;
-INSERT INTO t2 VALUES (20);
---disable_warnings
-INSERT INTO t1 VALUES (20);
---enable_warnings
-INSERT INTO t2 VALUES (21);
-INSERT INTO t3 VALUES (20, 20);
-COMMIT;
-INSERT INTO t3 VALUES(21, 21);
-INSERT INTO t3 VALUES(22, 22);
-SET binlog_format=@old_format;
---save_master_pos
-
-# Start a connection that will block the replicated transaction halfway.
---connection con_temp1
-BEGIN;
-INSERT INTO t2 VALUES (21);
-
---connection server_2
-START SLAVE;
-# Wait for the MyISAM change to be visible, after which replication will wait
-# for con_temp1 to roll back.
---let $wait_condition= SELECT COUNT(*) = 1 FROM t1 WHERE a=20
---source include/wait_condition.inc
-
---connection con_temp2
-# Initiate slave stop. It will have to wait for the current event group
-# to complete.
-# The dbug injection causes debug_sync to signal 'wait_for_done_waiting'
-# when the SQL driver thread is ready.
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
-send STOP SLAVE;
-
---connection con_temp1
-SET debug_sync='now WAIT_FOR wait_for_done_waiting';
-ROLLBACK;
-
---connection con_temp2
-reap;
-SET GLOBAL debug_dbug=@old_dbug;
-SET debug_sync='RESET';
-
---connection server_2
---source include/wait_for_slave_to_stop.inc
-# We should see the first transaction applied, but not the two others.
-SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
-SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
-SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
-
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
-SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
-SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
-
-
---connection server_2
-# Respawn all worker threads to clear any left-over debug_sync or other stuff.
---source include/stop_slave.inc
-SET GLOBAL binlog_format=@old_format;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** Test killing slave threads at various wait points ***
---echo *** 1. Test killing transaction waiting in commit for previous transaction to commit ***
-
-# Set up three transactions on the master that will be group-committed
-# together so they can be replicated in parallel on the slave.
---connection con_temp3
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (31, foo(31,
- 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
- 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con_temp4
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-SET binlog_format=statement;
-BEGIN;
-# This insert is just so we can get T2 to wait while a query is running that we
-# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
-INSERT INTO t3 VALUES (32, foo(32,
- 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
- ''));
-# This insert sets up debug_sync points so that T2 will tell when it is at its
-# wait point where we want to kill it - and when it has been killed.
-INSERT INTO t3 VALUES (33, foo(33,
- 'group_commit_waiting_for_prior SIGNAL t2_waiting',
- 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
-send COMMIT;
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-
---connection con_temp5
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (34, foo(34,
- '',
- ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued3';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con_temp3
-REAP;
---connection con_temp4
-REAP;
---connection con_temp5
-REAP;
-
---connection server_1
-SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
-SET debug_sync='RESET';
-
---connection server_2
-SET sql_log_bin=0;
-CALL mtr.add_suppression("Query execution was interrupted");
-CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
-CALL mtr.add_suppression("Slave: Connection was killed");
-SET sql_log_bin=1;
-# Wait until T2 is inside executing its insert of 32, then find it in SHOW
-# PROCESSLIST to know its thread id for KILL later.
-SET debug_sync='now WAIT_FOR t2_query';
---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(32%' AND INFO NOT LIKE '%LIKE%'`
-SET debug_sync='now SIGNAL t2_cont';
-
-# Wait until T2 has entered its wait for T1 to commit, and T1 has
-# progressed into its commit phase.
-SET debug_sync='now WAIT_FOR t1_ready';
-
-# Now kill the transaction T2.
---replace_result $thd_id THD_ID
-eval KILL $thd_id;
-
-# Wait until T2 has reacted on the kill.
-SET debug_sync='now WAIT_FOR t2_killed';
-
-# Now we can allow T1 to proceed.
-SET debug_sync='now SIGNAL t1_cont';
-
---let $slave_sql_errno= 1317,1927,1964
---source include/wait_for_slave_sql_error.inc
-STOP SLAVE IO_THREAD;
-SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
-
-# Now we have to disable the debug_sync statements, so they do not trigger
-# when the events are retried.
-SET debug_sync='RESET';
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
---connection server_1
-INSERT INTO t3 VALUES (39,0);
---save_master_pos
-
---connection server_2
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
-# Restore the foo() function.
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- IF d1 != '' THEN
- SET debug_sync = d1;
- END IF;
- IF d2 != '' THEN
- SET debug_sync = d2;
- END IF;
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
-
---connection server_2
-# Respawn all worker threads to clear any left-over debug_sync or other stuff.
---source include/stop_slave.inc
-SET GLOBAL binlog_format=@old_format;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** 2. Same as (1), but without restarting IO thread after kill of SQL threads ***
-
-# Set up three transactions on the master that will be group-committed
-# together so they can be replicated in parallel on the slave.
---connection con_temp3
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (41, foo(41,
- 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
- 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con_temp4
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-SET binlog_format=statement;
-BEGIN;
-# This insert is just so we can get T2 to wait while a query is running that we
-# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
-INSERT INTO t3 VALUES (42, foo(42,
- 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
- ''));
-# This insert sets up debug_sync points so that T2 will tell when it is at its
-# wait point where we want to kill it - and when it has been killed.
-INSERT INTO t3 VALUES (43, foo(43,
- 'group_commit_waiting_for_prior SIGNAL t2_waiting',
- 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
-send COMMIT;
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-
---connection con_temp5
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (44, foo(44,
- '',
- ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued3';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con_temp3
-REAP;
---connection con_temp4
-REAP;
---connection con_temp5
-REAP;
-
---connection server_1
-SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
-SET debug_sync='RESET';
-
---connection server_2
-# Wait until T2 is inside executing its insert of 42, then find it in SHOW
-# PROCESSLIST to know its thread id for KILL later.
-SET debug_sync='now WAIT_FOR t2_query';
---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(42%' AND INFO NOT LIKE '%LIKE%'`
-SET debug_sync='now SIGNAL t2_cont';
-
-# Wait until T2 has entered its wait for T1 to commit, and T1 has
-# progressed into its commit phase.
-SET debug_sync='now WAIT_FOR t1_ready';
-
-# Now kill the transaction T2.
---replace_result $thd_id THD_ID
-eval KILL $thd_id;
-
-# Wait until T2 has reacted on the kill.
-SET debug_sync='now WAIT_FOR t2_killed';
-
-# Now we can allow T1 to proceed.
-SET debug_sync='now SIGNAL t1_cont';
-
---let $slave_sql_errno= 1317,1927,1964
---source include/wait_for_slave_sql_error.inc
-
-# Now we have to disable the debug_sync statements, so they do not trigger
-# when the events are retried.
-SET debug_sync='RESET';
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
---connection server_1
-INSERT INTO t3 VALUES (49,0);
---save_master_pos
-
---connection server_2
-START SLAVE SQL_THREAD;
---sync_with_master
-SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
-# Restore the foo() function.
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- IF d1 != '' THEN
- SET debug_sync = d1;
- END IF;
- IF d2 != '' THEN
- SET debug_sync = d2;
- END IF;
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
-
---connection server_2
-# Respawn all worker threads to clear any left-over debug_sync or other stuff.
---source include/stop_slave.inc
-SET GLOBAL binlog_format=@old_format;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** 3. Same as (2), but not using gtid mode ***
-
---connection server_2
---source include/stop_slave.inc
-CHANGE MASTER TO master_use_gtid=no;
---source include/start_slave.inc
-
---connection server_1
-# Set up three transactions on the master that will be group-committed
-# together so they can be replicated in parallel on the slave.
---connection con_temp3
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (51, foo(51,
- 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
- 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con_temp4
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-SET binlog_format=statement;
-BEGIN;
-# This insert is just so we can get T2 to wait while a query is running that we
-# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
-INSERT INTO t3 VALUES (52, foo(52,
- 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
- ''));
-# This insert sets up debug_sync points so that T2 will tell when it is at its
-# wait point where we want to kill it - and when it has been killed.
-INSERT INTO t3 VALUES (53, foo(53,
- 'group_commit_waiting_for_prior SIGNAL t2_waiting',
- 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
-send COMMIT;
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-
---connection con_temp5
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
-SET binlog_format=statement;
-send INSERT INTO t3 VALUES (54, foo(54,
- '',
- ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued3';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con_temp3
-REAP;
---connection con_temp4
-REAP;
---connection con_temp5
-REAP;
-
---connection server_1
-SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
-SET debug_sync='RESET';
-
---connection server_2
-# Wait until T2 is inside executing its insert of 52, then find it in SHOW
-# PROCESSLIST to know its thread id for KILL later.
-SET debug_sync='now WAIT_FOR t2_query';
---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(52%' AND INFO NOT LIKE '%LIKE%'`
-SET debug_sync='now SIGNAL t2_cont';
-
-# Wait until T2 has entered its wait for T1 to commit, and T1 has
-# progressed into its commit phase.
-SET debug_sync='now WAIT_FOR t1_ready';
-
-# Now kill the transaction T2.
---replace_result $thd_id THD_ID
-eval KILL $thd_id;
-
-# Wait until T2 has reacted on the kill.
-SET debug_sync='now WAIT_FOR t2_killed';
-
-# Now we can allow T1 to proceed.
-SET debug_sync='now SIGNAL t1_cont';
-
---let $slave_sql_errno= 1317,1927,1964
---source include/wait_for_slave_sql_error.inc
-SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
-
-# Now we have to disable the debug_sync statements, so they do not trigger
-# when the events are retried.
-SET debug_sync='RESET';
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
---connection server_1
-INSERT INTO t3 VALUES (59,0);
---save_master_pos
-
---connection server_2
-START SLAVE SQL_THREAD;
---sync_with_master
-SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
-# Restore the foo() function.
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- IF d1 != '' THEN
- SET debug_sync = d1;
- END IF;
- IF d2 != '' THEN
- SET debug_sync = d2;
- END IF;
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
-
---source include/stop_slave.inc
-CHANGE MASTER TO master_use_gtid=slave_pos;
---source include/start_slave.inc
-
---connection server_2
-# Respawn all worker threads to clear any left-over debug_sync or other stuff.
---source include/stop_slave.inc
-SET GLOBAL binlog_format=@old_format;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=4;
---source include/start_slave.inc
-
-
---echo *** 4. Test killing thread that is waiting to start transaction until previous transaction commits ***
-
-# We set up four transactions T1, T2, T3, and T4 on the master. T2, T3, and T4
-# can run in parallel with each other (same group commit and commit id),
-# but not in parallel with T1.
-#
-# We use four worker threads, each Ti will be queued on each their own
-# worker thread. We will delay T1 commit, T3 will wait for T1 to begin
-# commit before it can start. We will kill T3 during this wait, and
-# check that everything works correctly.
-#
-# It is rather tricky to get the correct thread id of the worker to kill.
-# We start by injecting four dummy transactions in a debug_sync-controlled
-# manner to be able to get known thread ids for the workers in a pool with
-# just 4 worker threads. Then we let in each of the real test transactions
-# T1-T4 one at a time in a way which allows us to know which transaction
-# ends up with which thread id.
-
---connection server_1
-SET binlog_format=statement;
-SET gtid_domain_id=2;
-BEGIN;
-# This debug_sync will linger on and be used to control T4 later.
-INSERT INTO t3 VALUES (70, foo(70,
- 'rpl_parallel_start_waiting_for_prior SIGNAL t4_waiting', ''));
-INSERT INTO t3 VALUES (60, foo(60,
- 'ha_write_row_end SIGNAL d2_query WAIT_FOR d2_cont2',
- 'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont'));
-COMMIT;
-SET gtid_domain_id=0;
-
---connection server_2
-SET debug_sync='now WAIT_FOR d2_query';
---let $d2_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(60%' AND INFO NOT LIKE '%LIKE%'`
-
---connection server_1
-SET gtid_domain_id=1;
-BEGIN;
-# These debug_sync's will linger on and be used to control T3 later.
-INSERT INTO t3 VALUES (61, foo(61,
- 'rpl_parallel_start_waiting_for_prior SIGNAL t3_waiting',
- 'rpl_parallel_start_waiting_for_prior_killed SIGNAL t3_killed'));
-INSERT INTO t3 VALUES (62, foo(62,
- 'ha_write_row_end SIGNAL d1_query WAIT_FOR d1_cont2',
- 'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont'));
-COMMIT;
-SET gtid_domain_id=0;
-
---connection server_2
-SET debug_sync='now WAIT_FOR d1_query';
---let $d1_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(62%' AND INFO NOT LIKE '%LIKE%'`
-
---connection server_1
-SET gtid_domain_id=0;
-INSERT INTO t3 VALUES (63, foo(63,
- 'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2',
- 'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont'));
-
---connection server_2
-SET debug_sync='now WAIT_FOR d0_query';
---let $d0_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(63%' AND INFO NOT LIKE '%LIKE%'`
-
---connection server_1
-SET gtid_domain_id=3;
-BEGIN;
-# These debug_sync's will linger on and be used to control T2 later.
-INSERT INTO t3 VALUES (68, foo(68,
- 'rpl_parallel_start_waiting_for_prior SIGNAL t2_waiting', ''));
-INSERT INTO t3 VALUES (69, foo(69,
- 'ha_write_row_end SIGNAL d3_query WAIT_FOR d3_cont2',
- 'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont'));
-COMMIT;
-SET gtid_domain_id=0;
-
---connection server_2
-SET debug_sync='now WAIT_FOR d3_query';
---let $d3_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(69%' AND INFO NOT LIKE '%LIKE%'`
-
-SET debug_sync='now SIGNAL d2_cont2';
-SET debug_sync='now WAIT_FOR d2_done';
-SET debug_sync='now SIGNAL d1_cont2';
-SET debug_sync='now WAIT_FOR d1_done';
-SET debug_sync='now SIGNAL d0_cont2';
-SET debug_sync='now WAIT_FOR d0_done';
-SET debug_sync='now SIGNAL d3_cont2';
-SET debug_sync='now WAIT_FOR d3_done';
-
-# Now prepare the real transactions T1, T2, T3, T4 on the master.
-
---connection con_temp3
-# Create transaction T1.
-SET binlog_format=statement;
-INSERT INTO t3 VALUES (64, foo(64,
- 'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', ''));
-
-# Create transaction T2, as a group commit leader on the master.
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2';
-send INSERT INTO t3 VALUES (65, foo(65, '', ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-
---connection con_temp4
-# Create transaction T3, participating in T2's group commit.
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
-send INSERT INTO t3 VALUES (66, foo(66, '', ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued3';
-
---connection con_temp5
-# Create transaction T4, participating in group commit with T2 and T3.
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4';
-send INSERT INTO t3 VALUES (67, foo(67, '', ''));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued4';
-SET debug_sync='now SIGNAL master_cont2';
-
---connection con_temp3
-REAP;
---connection con_temp4
-REAP;
---connection con_temp5
-REAP;
-
---connection server_1
-SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
-SET debug_sync='RESET';
-
---connection server_2
-# Now we have the four transactions pending for replication on the slave.
-# Let them be queued for our three worker threads in a controlled fashion.
-# We put them at a stage where T1 is delayed and T3 is waiting for T1 to
-# commit before T3 can start. Then we kill T3.
-
-# Make the worker D0 free, and wait for T1 to be queued in it.
-SET debug_sync='now SIGNAL d0_cont';
-SET debug_sync='now WAIT_FOR t1_waiting';
-
-# Make the worker D3 free, and wait for T2 to be queued in it.
-SET debug_sync='now SIGNAL d3_cont';
-SET debug_sync='now WAIT_FOR t2_waiting';
-
-# Now release worker D1, and wait for T3 to be queued in it.
-# T3 will wait for T1 to commit before it can start.
-SET debug_sync='now SIGNAL d1_cont';
-SET debug_sync='now WAIT_FOR t3_waiting';
-
-# Release worker D2. Wait for T4 to be queued, so we are sure it has
-# received the debug_sync signal (else we might overwrite it with the
-# next debug_sync).
-SET debug_sync='now SIGNAL d2_cont';
-SET debug_sync='now WAIT_FOR t4_waiting';
-
-# Now we kill the waiting transaction T3 in worker D1.
---replace_result $d1_thd_id THD_ID
-eval KILL $d1_thd_id;
-
-# Wait until T3 has reacted on the kill.
-SET debug_sync='now WAIT_FOR t3_killed';
-
-# Now we can allow T1 to proceed.
-SET debug_sync='now SIGNAL t1_cont';
-
---let $slave_sql_errno= 1317,1927,1964
---source include/wait_for_slave_sql_error.inc
-STOP SLAVE IO_THREAD;
-# Since T2, T3, and T4 run in parallel, we can not be sure if T2 will have time
-# to commit or not before the stop. However, T1 should commit, and T3/T4 may
-# not have committed. (After slave restart we check that all become committed
-# eventually).
-SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a;
-
-# Now we have to disable the debug_sync statements, so they do not trigger
-# when the events are retried.
-SET debug_sync='RESET';
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
---connection server_1
-UPDATE t3 SET b=b+1 WHERE a=60;
---save_master_pos
-
---connection server_2
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
-# Restore the foo() function.
-SET sql_log_bin=0;
-DROP FUNCTION foo;
---delimiter ||
-CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
- RETURNS INT DETERMINISTIC
- BEGIN
- IF d1 != '' THEN
- SET debug_sync = d1;
- END IF;
- IF d2 != '' THEN
- SET debug_sync = d2;
- END IF;
- RETURN x;
- END
-||
---delimiter ;
-SET sql_log_bin=1;
-
---connection server_2
-# Respawn all worker threads to clear any left-over debug_sync or other stuff.
---source include/stop_slave.inc
-SET GLOBAL binlog_format=@old_format;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** 5. Test killing thread that is waiting for queue of max length to shorten ***
-
-# Find the thread id of the driver SQL thread that we want to kill.
---let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'
---source include/wait_condition.inc
---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'`
-SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued;
-SET GLOBAL slave_parallel_max_queued=9000;
-
---connection server_1
---let bigstring= `SELECT REPEAT('x', 10000)`
-SET binlog_format=statement;
-# Create an event that will wait to be signalled.
-INSERT INTO t3 VALUES (80, foo(0,
- 'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', ''));
-
---connection server_2
-SET debug_sync='now WAIT_FOR query_waiting';
-# Inject that the SQL driver thread will signal `wait_queue_ready' to debug_sync
-# as it goes to wait for the event queue to become smaller than the value of
-# @@slave_parallel_max_queued.
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max";
-
---connection server_1
---disable_query_log
-# Create an event that will fill up the queue.
-# The Xid event at the end of the event group will have to wait for the Query
-# event with the INSERT to drain so the queue becomes shorter. However that in
-# turn waits for the prior event group to continue.
-eval INSERT INTO t3 VALUES (81, LENGTH('$bigstring'));
---enable_query_log
-SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
-
---connection server_2
-SET debug_sync='now WAIT_FOR wait_queue_ready';
-
---replace_result $thd_id THD_ID
-eval KILL $thd_id;
-
-SET debug_sync='now WAIT_FOR wait_queue_killed';
-SET debug_sync='now SIGNAL query_cont';
-
---let $slave_sql_errno= 1317,1927,1964
---source include/wait_for_slave_sql_error.inc
-STOP SLAVE IO_THREAD;
-
-SET GLOBAL debug_dbug=@old_dbug;
-SET GLOBAL slave_parallel_max_queued= @old_max_queued;
-
---connection server_1
-INSERT INTO t3 VALUES (82,0);
-SET binlog_format=@old_format;
---save_master_pos
-
---connection server_2
-SET debug_sync='RESET';
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
-
-
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL binlog_format=@old_format;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
---echo *** MDEV-5788 Incorrect free of rgi->deferred_events in parallel replication ***
-
---connection server_2
-# Use just two worker threads, so we are sure to get the rpl_group_info added
-# to the free list, which is what triggered the bug.
---source include/stop_slave.inc
-SET GLOBAL replicate_ignore_table="test.t3";
-SET GLOBAL slave_parallel_threads=2;
---source include/start_slave.inc
-
---connection server_1
-INSERT INTO t3 VALUES (100, rand());
-INSERT INTO t3 VALUES (101, rand());
-
---save_master_pos
-
---connection server_2
---sync_with_master
-
---connection server_1
-INSERT INTO t3 VALUES (102, rand());
-INSERT INTO t3 VALUES (103, rand());
-INSERT INTO t3 VALUES (104, rand());
-INSERT INTO t3 VALUES (105, rand());
-
---save_master_pos
-
---connection server_2
---sync_with_master
---source include/stop_slave.inc
-SET GLOBAL replicate_ignore_table="";
---source include/start_slave.inc
-
---connection server_1
-INSERT INTO t3 VALUES (106, rand());
-INSERT INTO t3 VALUES (107, rand());
---save_master_pos
-
---connection server_2
---sync_with_master
---replace_column 2 #
-SELECT * FROM t3 WHERE a >= 100 ORDER BY a;
-
-
---echo *** MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction ***
-
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
---connection server_1
-INSERT INTO t3 VALUES (110, 1);
---save_master_pos
-
---connection server_2
---sync_with_master
-SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
-# Inject a duplicate key error.
-SET sql_log_bin=0;
-INSERT INTO t3 VALUES (111, 666);
-SET sql_log_bin=1;
-
---connection server_1
-
-# Create a group commit with two inserts, the first one conflicts with a row on the slave
---connect (con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-send INSERT INTO t3 VALUES (111, 2);
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connect (con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-send INSERT INTO t3 VALUES (112, 3);
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con1
-REAP;
---connection con2
-REAP;
-SET debug_sync='RESET';
---save_master_pos
-
---connection server_2
---let $slave_sql_errno= 1062
---source include/wait_for_slave_sql_error.inc
---source include/wait_for_slave_sql_to_stop.inc
-# We should not see the row (112,3) here, it should be rolled back due to
-# error signal from the prior transaction.
-SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
-SET sql_log_bin=0;
-DELETE FROM t3 WHERE a=111 AND b=666;
-SET sql_log_bin=1;
-START SLAVE SQL_THREAD;
---sync_with_master
-SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
-
-
---echo ***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts ***
---connection server_2
---source include/stop_slave.inc
-
---connection server_1
-CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB;
-INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
-
-# Create a group commit with UPDATE and DELETE, in that order.
-# The bug was that while the UPDATE's row lock does not block the DELETE, the
-# DELETE's gap lock _does_ block the UPDATE. This could cause a deadlock
-# on the slave.
---connection con1
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-send UPDATE t4 SET b=NULL WHERE a=6;
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con2
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-send DELETE FROM t4 WHERE b <= 3;
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con1
-REAP;
---connection con2
-REAP;
-SET debug_sync='RESET';
---save_master_pos
-
---connection server_2
---source include/start_slave.inc
---sync_with_master
---source include/stop_slave.inc
-
-SELECT * FROM t4 ORDER BY a;
-
-
-# Another example, this one with INSERT vs. DELETE
---connection server_1
-DELETE FROM t4;
-INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
-
-# Create a group commit with INSERT and DELETE, in that order.
-# The bug was that while the INSERT's insert intention lock does not block
-# the DELETE, the DELETE's gap lock _does_ block the INSERT. This could cause
-# a deadlock on the slave.
---connection con1
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-send INSERT INTO t4 VALUES (7, NULL);
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con2
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-send DELETE FROM t4 WHERE b <= 3;
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con1
-REAP;
---connection con2
-REAP;
-SET debug_sync='RESET';
---save_master_pos
-
---connection server_2
---source include/start_slave.inc
---sync_with_master
---source include/stop_slave.inc
-
-SELECT * FROM t4 ORDER BY a;
-
-
-# MDEV-6549, failing to update gtid_slave_pos for a transaction that was retried.
-# The problem was that when a transaction updates the mysql.gtid_slave_pos
-# table, it clears the flag that marks that there is a GTID position that
-# needs to be updated. Then, if the transaction got killed after that due
-# to a deadlock, the subsequent retry would fail to notice that the GTID needs
-# to be recorded in gtid_slave_pos.
-#
-# (In the original bug report, the symptom was an assertion; this was however
-# just a side effect of the missing update of gtid_slave_pos, which also
-# happened to cause a missing clear of OPTION_GTID_BEGIN).
---connection server_1
-DELETE FROM t4;
-INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
-
-# Create two transactions that can run in parallel on the slave but cause
-# a deadlock if the second runs before the first.
---connection con1
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-send UPDATE t4 SET b=NULL WHERE a=6;
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con2
-# Must use statement-based binlogging. Otherwise the transaction will not be
-# binlogged at all, as it modifies no rows.
-SET @old_format= @@SESSION.binlog_format;
-SET binlog_format='statement';
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-send DELETE FROM t4 WHERE b <= 1;
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con1
-REAP;
---connection con2
-REAP;
-SET @old_format=@@GLOBAL.binlog_format;
-SET debug_sync='RESET';
---save_master_pos
---let $last_gtid= `SELECT @@last_gtid`
-
---connection server_2
-# Disable the usual skip of gap locks for transactions that are run in
-# parallel, using DBUG. This allows the deadlock to occur, and this in turn
-# triggers a retry of the second transaction, and the code that was buggy and
-# caused the gtid_slave_pos update to be skipped in the retry.
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug="+d,disable_thd_need_ordering_with";
---source include/start_slave.inc
---sync_with_master
-SET GLOBAL debug_dbug=@old_dbug;
-
-SELECT * FROM t4 ORDER BY a;
-# Check that the GTID of the second transaction was correctly recorded in
-# gtid_slave_pos, in the variable as well as in the table.
---replace_result $last_gtid GTID
-eval SET @last_gtid= '$last_gtid';
-SELECT IF(@@gtid_slave_pos LIKE CONCAT('%',@last_gtid,'%'), "GTID found ok",
- CONCAT("GTID ", @last_gtid, " not found in gtid_slave_pos=", @@gtid_slave_pos))
- AS result;
-SELECT "ROW FOUND" AS `Is the row found?`
- FROM mysql.gtid_slave_pos
- WHERE CONCAT(domain_id, "-", server_id, "-", seq_no) = @last_gtid;
-
-
---echo *** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication ***
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=1;
-SET DEBUG_SYNC= 'RESET';
---source include/start_slave.inc
-
---connection server_1
-CREATE TABLE t5 (a INT PRIMARY KEY, b INT);
-INSERT INTO t5 VALUES (1,1);
-INSERT INTO t5 VALUES (2,2), (3,8);
-INSERT INTO t5 VALUES (4,16);
---save_master_pos
-
---connection server_2
---sync_with_master
-let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
-let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
-let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1);
-let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
---disable_query_log
-eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check;
-eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check;
---enable_query_log
-
---connection server_1
-FLUSH LOGS;
---source include/wait_for_binlog_checkpoint.inc
---save_master_pos
-
---connection server_2
---sync_with_master
-let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
-let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
-let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1);
-let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
---disable_query_log
-eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check;
-eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check;
---enable_query_log
-
-
---echo *** MDEV_6435: Incorrect error handling when query binlogged partially on master with "killed" error ***
-
---connection server_1
-CREATE TABLE t6 (a INT) ENGINE=MyISAM;
-CREATE TRIGGER tr AFTER INSERT ON t6 FOR EACH ROW SET @a = 1;
-
---connection con1
-SET @old_format= @@binlog_format;
-SET binlog_format= statement;
---let $conid = `SELECT CONNECTION_ID()`
-SET debug_sync='sp_head_execute_before_loop SIGNAL ready WAIT_FOR cont';
-send INSERT INTO t6 VALUES (1), (2), (3);
-
---connection server_1
-SET debug_sync='now WAIT_FOR ready';
---replace_result $conid CONID
-eval KILL QUERY $conid;
-SET debug_sync='now SIGNAL cont';
-
---connection con1
---error ER_QUERY_INTERRUPTED
---reap
-SET binlog_format= @old_format;
-SET debug_sync='RESET';
---let $after_error_gtid_pos= `SELECT @@gtid_binlog_pos`
-
---connection server_1
-SET debug_sync='RESET';
-
-
---connection server_2
---let $slave_sql_errno= 1317
---source include/wait_for_slave_sql_error.inc
-STOP SLAVE IO_THREAD;
---replace_result $after_error_gtid_pos AFTER_ERROR_GTID_POS
-eval SET GLOBAL gtid_slave_pos= '$after_error_gtid_pos';
---source include/start_slave.inc
-
---connection server_1
-INSERT INTO t6 VALUES (4);
-SELECT * FROM t6 ORDER BY a;
---save_master_pos
-
---connection server_2
---sync_with_master
-SELECT * FROM t6 ORDER BY a;
-
-
---echo *** MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0 ***
-
---connection server_1
-INSERT INTO t2 VALUES (31);
---let $gtid1= `SELECT @@LAST_GTID`
---source include/save_master_gtid.inc
-
---connection server_2
---source include/sync_with_master_gtid.inc
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads= 0;
---source include/start_slave.inc
-
-# Force a duplicate key error on the slave.
-SET sql_log_bin= 0;
-INSERT INTO t2 VALUES (32);
-SET sql_log_bin= 1;
-
---connection server_1
-INSERT INTO t2 VALUES (32);
---let $gtid2= `SELECT @@LAST_GTID`
-# Rotate the binlog; the bug is triggered when the master binlog file changes
-# after the event group that causes the duplicate key error.
-FLUSH LOGS;
-INSERT INTO t2 VALUES (33);
-INSERT INTO t2 VALUES (34);
-SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
---source include/save_master_gtid.inc
-
---connection server_2
---let $slave_sql_errno= 1062
---source include/wait_for_slave_sql_error.inc
-
---connection server_2
---source include/stop_slave_io.inc
-SET GLOBAL slave_parallel_threads=10;
-START SLAVE;
-
---let $slave_sql_errno= 1062
---source include/wait_for_slave_sql_error.inc
-
-# Note: IO thread is still running at this point.
-# The bug seems to have been that restarting the SQL thread after an error with
-# the IO thread still running, somehow picks up a later relay log position and
-# thus ends up skipping the failing event, rather than re-executing.
-
-START SLAVE SQL_THREAD;
---let $slave_sql_errno= 1062
---source include/wait_for_slave_sql_error.inc
-
-SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
-
-# Skip the duplicate error, so we can proceed.
---error ER_SLAVE_SKIP_NOT_IN_GTID
-SET sql_slave_skip_counter= 1;
---source include/stop_slave_io.inc
---disable_query_log
-eval SET GLOBAL gtid_slave_pos = REPLACE(@@gtid_slave_pos, "$gtid1", "$gtid2");
---enable_query_log
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-
-SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
-
-
---echo *** MDEV-6775: Wrong binlog order in parallel replication ***
---connection server_1
-# A bit tricky bug to reproduce. On the master, we binlog in statement-mode
-# two transactions, an UPDATE followed by a DELETE. On the slave, we replicate
-# with binlog-mode set to ROW, which means the DELETE, which modifies no rows,
-# is not binlogged. Then we inject a wait in the group commit code on the
-# slave, shortly before the actual commit of the UPDATE. The bug was that the
-# DELETE could wake up from wait_for_prior_commit() before the commit of the
-# UPDATE. So the test could see the slave position updated to after DELETE,
-# while the UPDATE was still not visible.
-DELETE FROM t4;
-INSERT INTO t4 VALUES (1,NULL), (3,NULL), (4,4), (5, NULL), (6, 6);
---source include/save_master_gtid.inc
-
---connection server_2
---source include/sync_with_master_gtid.inc
---source include/stop_slave.inc
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug="+d,inject_binlog_commit_before_get_LOCK_log";
-SET @old_format=@@GLOBAL.binlog_format;
-SET GLOBAL binlog_format=ROW;
-# Re-spawn the worker threads to be sure they pick up the new binlog format
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-
---connection con1
-SET @old_format= @@binlog_format;
-SET binlog_format= statement;
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-send UPDATE t4 SET b=NULL WHERE a=6;
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con2
-SET @old_format= @@binlog_format;
-SET binlog_format= statement;
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-send DELETE FROM t4 WHERE b <= 3;
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con1
-REAP;
-SET binlog_format= @old_format;
---connection con2
-REAP;
-SET binlog_format= @old_format;
-SET debug_sync='RESET';
---save_master_pos
-SELECT * FROM t4 ORDER BY a;
-
---connection server_2
---source include/start_slave.inc
-SET debug_sync= 'now WAIT_FOR waiting';
---sync_with_master
-SELECT * FROM t4 ORDER BY a;
-SET debug_sync= 'now SIGNAL cont';
-
-# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
---source include/stop_slave.inc
-SET GLOBAL debug_dbug=@old_dbug;
-SET GLOBAL binlog_format= @old_format;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave ***
---connection server_1
-INSERT INTO t2 VALUES (40);
---save_master_pos
-
---connection server_2
---sync_with_master
---source include/stop_slave.inc
-CHANGE MASTER TO master_use_gtid=no;
-SET @old_dbug= @@GLOBAL.debug_dbug;
-# This DBUG injection causes a DEBUG_SYNC signal "scheduled_gtid_0_x_100" when
-# GTID 0-1-100 has been scheduled for and fetched by a worker thread.
-SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100";
-# This DBUG injection causes a DEBUG_SYNC signal "wait_for_done_waiting" when
-# STOP SLAVE has signalled all worker threads to stop.
-SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
-# Reset worker threads to make DBUG setting catch on.
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-
-
---connection server_1
-# Setup some transaction for the slave to replicate.
-INSERT INTO t2 VALUES (41);
-INSERT INTO t2 VALUES (42);
-# Need to log the DELETE in statement format, so we can see it in processlist.
-SET @old_format= @@binlog_format;
-SET binlog_format= statement;
-DELETE FROM t2 WHERE a=40;
-SET binlog_format= @old_format;
-INSERT INTO t2 VALUES (43);
-INSERT INTO t2 VALUES (44);
-# Force the slave to switch to a new relay log file.
-FLUSH LOGS;
-INSERT INTO t2 VALUES (45);
-# Inject a GTID 0-1-100, which will trigger a DEBUG_SYNC signal when this
-# transaction has been fetched by a worker thread.
-SET gtid_seq_no=100;
-INSERT INTO t2 VALUES (46);
---save_master_pos
-
---connection con_temp2
-# Temporarily block the DELETE on a=40 from completing.
-BEGIN;
-SELECT * FROM t2 WHERE a=40 FOR UPDATE;
-
-
---connection server_2
---source include/start_slave.inc
-
-# Wait for a worker thread to start on the DELETE that will be blocked
-# temporarily by the SELECT FOR UPDATE.
---let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state='updating' and info LIKE '%DELETE FROM t2 WHERE a=40%'
---source include/wait_condition.inc
-
-# The DBUG injection set above will make the worker thread signal the following
-# debug_sync when the GTID 0-1-100 has been reached by a worker thread.
-# Thus, at this point, the SQL driver thread has reached the next
-# relay log file name, while a worker thread is still processing a
-# transaction in the previous relay log file, blocked on the SELECT FOR
-# UPDATE.
-SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100';
-# At this point, the SQL driver thread is in the new relay log file, while
-# the DELETE from the old relay log file is not yet complete. We will stop
-# the slave at this point. The bug was that the DELETE statement would
-# update the slave position to the _new_ relay log file name instead of
-# its own old file name. Thus, by stoping and restarting the slave at this
-# point, we would get an error at restart due to incorrect position. (If
-# we would let the slave catch up before stopping, the incorrect position
-# would be corrected by a later transaction).
-
-send STOP SLAVE;
-
---connection con_temp2
-# Wait for STOP SLAVE to have proceeded sufficiently that it has signalled
-# all worker threads to stop; this ensures that we will stop after the DELETE
-# transaction (and not after a later transaction that might have been able
-# to set a fixed position).
-SET debug_sync= 'now WAIT_FOR wait_for_done_waiting';
-# Now release the row lock that was blocking the replication of DELETE.
-ROLLBACK;
-
---connection server_2
-reap;
---source include/wait_for_slave_sql_to_stop.inc
-SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
-# Now restart the slave. With the bug present, this would start at an
-# incorrect relay log position, causing relay log read error (or if unlucky,
-# silently skip a number of events).
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
---source include/stop_slave.inc
-SET GLOBAL debug_dbug=@old_dbug;
-SET DEBUG_SYNC= 'RESET';
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
-CHANGE MASTER TO master_use_gtid=slave_pos;
---source include/start_slave.inc
-
-
---echo *** MDEV-7326 Server deadlock in connection with parallel replication ***
-# We use three transactions, each in a separate group commit.
-# T1 does mark_start_commit(), then gets a deadlock error.
-# T2 wakes up and starts running
-# T1 does unmark_start_commit()
-# T3 goes to wait for T2 to start its commit
-# T2 does mark_start_commit()
-# The bug was that at this point, T3 got deadlocked. Because T1 has unmarked(),
-# T3 did not yet see the count_committing_event_groups reach its target value
-# yet. But when T1 later re-did mark_start_commit(), it failed to send a wakeup
-# to T3.
-
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=3;
-SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
---source include/start_slave.inc
-
---connection server_1
-SET @old_format= @@SESSION.binlog_format;
-SET binlog_format= STATEMENT;
-# This debug_sync will linger on and be used to control T3 later.
-INSERT INTO t1 VALUES (foo(50,
- "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
- "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
---save_master_pos
---connection server_2
-# Wait for the debug_sync point for T3 to be set. But let the preparation
-# transaction remain hanging, so that T1 and T2 will be scheduled for the
-# remaining two worker threads.
-SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
-
---connection server_1
-INSERT INTO t2 VALUES (foo(50,
- "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
- "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
---save_master_pos
-
---connection server_2
-SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
-# T1 has now done mark_start_commit(). It will later do a rollback and retry.
-
---connection server_1
-# Use a MyISAM table for T2 and T3, so they do not trigger the
-# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event.
-INSERT INTO t1 VALUES (foo(51,
- "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
- "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
-
---connection server_2
-SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
-# T2 has now started running, but has not yet done mark_start_commit()
-SET DEBUG_SYNC= "now SIGNAL t1_cont1";
-SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
-# T1 has now done unmark_start_commit() in preparation for its retry.
-
---connection server_1
-INSERT INTO t1 VALUES (52);
-SET BINLOG_FORMAT= @old_format;
-SELECT * FROM t2 WHERE a>=50 ORDER BY a;
-SELECT * FROM t1 WHERE a>=50 ORDER BY a;
-
---connection server_2
-# Let the preparation transaction complete, so that the same worker thread
-# can continue with the transaction T3.
-SET DEBUG_SYNC= "now SIGNAL prep_cont";
-SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
-# T3 has now gone to wait for T2 to start committing
-SET DEBUG_SYNC= "now SIGNAL t2_cont1";
-SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
-# T2 has now done mark_start_commit().
-# Let things run, and check that T3 does not get deadlocked.
-SET DEBUG_SYNC= "now SIGNAL t1_cont2";
---sync_with_master
-
---connection server_1
---save_master_pos
---connection server_2
---sync_with_master
-SELECT * FROM t2 WHERE a>=50 ORDER BY a;
-SELECT * FROM t1 WHERE a>=50 ORDER BY a;
-SET DEBUG_SYNC="reset";
-
-# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
---source include/stop_slave.inc
-SET GLOBAL debug_dbug=@old_dbug;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** MDEV-7326 Server deadlock in connection with parallel replication ***
-# Similar to the previous test, but with T2 and T3 in the same GCO.
-# We use three transactions, T1 in one group commit and T2/T3 in another.
-# T1 does mark_start_commit(), then gets a deadlock error.
-# T2 wakes up and starts running
-# T1 does unmark_start_commit()
-# T3 goes to wait for T1 to start its commit
-# T2 does mark_start_commit()
-# The bug was that at this point, T3 got deadlocked. T2 increments the
-# count_committing_event_groups but does not signal T3, as they are in
-# the same GCO. Then later when T1 increments, it would also not signal
-# T3, because now the count_committing_event_groups is not equal to the
-# wait_count of T3 (it is one larger).
-
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=3;
-SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
---source include/start_slave.inc
-
---connection server_1
-SET @old_format= @@SESSION.binlog_format;
-SET binlog_format= STATEMENT;
-# This debug_sync will linger on and be used to control T3 later.
-INSERT INTO t1 VALUES (foo(60,
- "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
- "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
---save_master_pos
---connection server_2
-# Wait for the debug_sync point for T3 to be set. But let the preparation
-# transaction remain hanging, so that T1 and T2 will be scheduled for the
-# remaining two worker threads.
-SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
-
---connection server_1
-INSERT INTO t2 VALUES (foo(60,
- "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
- "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
---save_master_pos
-
---connection server_2
-SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
-# T1 has now done mark_start_commit(). It will later do a rollback and retry.
-
-# Do T2 and T3 in a single group commit.
-# Use a MyISAM table for T2 and T3, so they do not trigger the
-# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event.
---connection con_temp3
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
-SET binlog_format=statement;
-send INSERT INTO t1 VALUES (foo(61,
- "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
- "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued1';
-
---connection con_temp4
-SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
-send INSERT INTO t6 VALUES (62);
-
---connection server_1
-SET debug_sync='now WAIT_FOR master_queued2';
-SET debug_sync='now SIGNAL master_cont1';
-
---connection con_temp3
-REAP;
---connection con_temp4
-REAP;
-
---connection server_1
-SET debug_sync='RESET';
-SET BINLOG_FORMAT= @old_format;
-SELECT * FROM t2 WHERE a>=60 ORDER BY a;
-SELECT * FROM t1 WHERE a>=60 ORDER BY a;
-SELECT * FROM t6 WHERE a>=60 ORDER BY a;
-
---connection server_2
-SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
-# T2 has now started running, but has not yet done mark_start_commit()
-SET DEBUG_SYNC= "now SIGNAL t1_cont1";
-SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
-# T1 has now done unmark_start_commit() in preparation for its retry.
-
---connection server_2
-# Let the preparation transaction complete, so that the same worker thread
-# can continue with the transaction T3.
-SET DEBUG_SYNC= "now SIGNAL prep_cont";
-SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
-# T3 has now gone to wait for T2 to start committing
-SET DEBUG_SYNC= "now SIGNAL t2_cont1";
-SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
-# T2 has now done mark_start_commit().
-# Let things run, and check that T3 does not get deadlocked.
-SET DEBUG_SYNC= "now SIGNAL t1_cont2";
---sync_with_master
-
---connection server_1
---save_master_pos
---connection server_2
---sync_with_master
-SELECT * FROM t2 WHERE a>=60 ORDER BY a;
-SELECT * FROM t1 WHERE a>=60 ORDER BY a;
-SELECT * FROM t6 WHERE a>=60 ORDER BY a;
-SET DEBUG_SYNC="reset";
-
-# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
---source include/stop_slave.inc
-SET GLOBAL debug_dbug=@old_dbug;
-SET GLOBAL slave_parallel_threads=0;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
-
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=1;
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
-
---connection server_1
-INSERT INTO t2 VALUES (101);
-INSERT INTO t2 VALUES (102);
-INSERT INTO t2 VALUES (103);
-INSERT INTO t2 VALUES (104);
-INSERT INTO t2 VALUES (105);
-# Inject a partial event group (missing XID at the end). The bug was that such
-# partial group was not handled appropriately, leading to server deadlock.
-SET gtid_seq_no=1000;
-INSERT INTO t2 VALUES (106);
-INSERT INTO t2 VALUES (107);
-INSERT INTO t2 VALUES (108);
-INSERT INTO t2 VALUES (109);
-INSERT INTO t2 VALUES (110);
-INSERT INTO t2 VALUES (111);
-INSERT INTO t2 VALUES (112);
-INSERT INTO t2 VALUES (113);
-INSERT INTO t2 VALUES (114);
-INSERT INTO t2 VALUES (115);
-INSERT INTO t2 VALUES (116);
-INSERT INTO t2 VALUES (117);
-INSERT INTO t2 VALUES (118);
-INSERT INTO t2 VALUES (119);
-INSERT INTO t2 VALUES (120);
-INSERT INTO t2 VALUES (121);
-INSERT INTO t2 VALUES (122);
-INSERT INTO t2 VALUES (123);
-INSERT INTO t2 VALUES (124);
-INSERT INTO t2 VALUES (125);
-INSERT INTO t2 VALUES (126);
-INSERT INTO t2 VALUES (127);
-INSERT INTO t2 VALUES (128);
-INSERT INTO t2 VALUES (129);
-INSERT INTO t2 VALUES (130);
---source include/save_master_gtid.inc
-
---connection server_2
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-# The partial event group (a=106) should be rolled back and thus missing.
-SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
-
---source include/stop_slave.inc
-SET GLOBAL debug_dbug=@old_dbug;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging ***
---echo *** MDEV-7882: Excessive transaction retry in parallel replication ***
-
---connection server_1
-CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
-CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
---save_master_pos
-
---connection server_2
---sync_with_master
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=40;
-SELECT @old_retries:=@@GLOBAL.slave_transaction_retries;
-SET GLOBAL slave_transaction_retries= 5;
-
-
-# Using dbug error injection, we artificially create event groups with a lot of
-# conflicting transactions in each event group. The bugs were originally seen
-# "in the wild" with transactions that did not conflict on the master, and only
-# conflicted very rarely on the slave (maybe some edge case with InnoDB btree
-# page splits or something like that). The event groups here loosely reflect
-# the structure of the original failure's group commits.
-
-
---connection server_1
-INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
-SET @old_dbug= @@SESSION.debug_dbug;
-SET @commit_id= 42;
-SET SESSION debug_dbug="+d,binlog_force_commit_id";
-INSERT INTO t8 VALUES (1,1);
-INSERT INTO t8 VALUES (2,2);
-INSERT INTO t8 VALUES (3,3);
-INSERT INTO t8 VALUES (4,4);
-INSERT INTO t8 VALUES (5,5);
-INSERT INTO t8 VALUES (6,6);
-INSERT INTO t8 VALUES (7,7);
-INSERT INTO t8 VALUES (8,8);
-
-UPDATE t7 SET b=9 WHERE a=3;
-UPDATE t7 SET b=10 WHERE a=3;
-UPDATE t7 SET b=11 WHERE a=3;
-
-INSERT INTO t8 VALUES (12,12);
-INSERT INTO t8 VALUES (13,13);
-
-UPDATE t7 SET b=14 WHERE a=3;
-UPDATE t7 SET b=15 WHERE a=3;
-
-INSERT INTO t8 VALUES (16,16);
-
-UPDATE t7 SET b=17 WHERE a=3;
-
-INSERT INTO t8 VALUES (18,18);
-INSERT INTO t8 VALUES (19,19);
-
-UPDATE t7 SET b=20 WHERE a=3;
-
-INSERT INTO t8 VALUES (21,21);
-
-UPDATE t7 SET b=22 WHERE a=3;
-
-INSERT INTO t8 VALUES (23,24);
-INSERT INTO t8 VALUES (24,24);
-
-UPDATE t7 SET b=25 WHERE a=3;
-
-INSERT INTO t8 VALUES (26,26);
-
-UPDATE t7 SET b=27 WHERE a=3;
-
-BEGIN;
-INSERT INTO t8 VALUES (28,28);
-INSERT INTO t8 VALUES (29,28), (30,28);
-INSERT INTO t8 VALUES (31,28);
-INSERT INTO t8 VALUES (32,28);
-INSERT INTO t8 VALUES (33,28);
-INSERT INTO t8 VALUES (34,28);
-INSERT INTO t8 VALUES (35,28);
-INSERT INTO t8 VALUES (36,28);
-INSERT INTO t8 VALUES (37,28);
-INSERT INTO t8 VALUES (38,28);
-INSERT INTO t8 VALUES (39,28);
-INSERT INTO t8 VALUES (40,28);
-INSERT INTO t8 VALUES (41,28);
-INSERT INTO t8 VALUES (42,28);
-COMMIT;
-
-
-SET @commit_id=43;
-INSERT INTO t8 VALUES (43,43);
-INSERT INTO t8 VALUES (44,44);
-
-UPDATE t7 SET b=45 WHERE a=3;
-
-INSERT INTO t8 VALUES (46,46);
-INSERT INTO t8 VALUES (47,47);
-
-UPDATE t7 SET b=48 WHERE a=3;
-
-INSERT INTO t8 VALUES (49,49);
-INSERT INTO t8 VALUES (50,50);
-
-
-SET @commit_id=44;
-INSERT INTO t8 VALUES (51,51);
-INSERT INTO t8 VALUES (52,52);
-
-UPDATE t7 SET b=53 WHERE a=3;
-
-INSERT INTO t8 VALUES (54,54);
-INSERT INTO t8 VALUES (55,55);
-
-UPDATE t7 SET b=56 WHERE a=3;
-
-INSERT INTO t8 VALUES (57,57);
-
-UPDATE t7 SET b=58 WHERE a=3;
-
-INSERT INTO t8 VALUES (58,58);
-INSERT INTO t8 VALUES (59,59);
-INSERT INTO t8 VALUES (60,60);
-INSERT INTO t8 VALUES (61,61);
-
-UPDATE t7 SET b=62 WHERE a=3;
-
-INSERT INTO t8 VALUES (63,63);
-INSERT INTO t8 VALUES (64,64);
-INSERT INTO t8 VALUES (65,65);
-INSERT INTO t8 VALUES (66,66);
-
-UPDATE t7 SET b=67 WHERE a=3;
-
-INSERT INTO t8 VALUES (68,68);
-
-UPDATE t7 SET b=69 WHERE a=3;
-UPDATE t7 SET b=70 WHERE a=3;
-UPDATE t7 SET b=71 WHERE a=3;
-
-INSERT INTO t8 VALUES (72,72);
-
-UPDATE t7 SET b=73 WHERE a=3;
-UPDATE t7 SET b=74 WHERE a=3;
-UPDATE t7 SET b=75 WHERE a=3;
-UPDATE t7 SET b=76 WHERE a=3;
-
-INSERT INTO t8 VALUES (77,77);
-
-UPDATE t7 SET b=78 WHERE a=3;
-
-INSERT INTO t8 VALUES (79,79);
-
-UPDATE t7 SET b=80 WHERE a=3;
-
-INSERT INTO t8 VALUES (81,81);
-
-UPDATE t7 SET b=82 WHERE a=3;
-
-INSERT INTO t8 VALUES (83,83);
-
-UPDATE t7 SET b=84 WHERE a=3;
-
-
-SET @commit_id=45;
-INSERT INTO t8 VALUES (85,85);
-UPDATE t7 SET b=86 WHERE a=3;
-INSERT INTO t8 VALUES (87,87);
-
-
-SET @commit_id=46;
-INSERT INTO t8 VALUES (88,88);
-INSERT INTO t8 VALUES (89,89);
-INSERT INTO t8 VALUES (90,90);
-
-SET SESSION debug_dbug=@old_dbug;
-
-INSERT INTO t8 VALUES (91,91);
-INSERT INTO t8 VALUES (92,92);
-INSERT INTO t8 VALUES (93,93);
-INSERT INTO t8 VALUES (94,94);
-INSERT INTO t8 VALUES (95,95);
-INSERT INTO t8 VALUES (96,96);
-INSERT INTO t8 VALUES (97,97);
-INSERT INTO t8 VALUES (98,98);
-INSERT INTO t8 VALUES (99,99);
-
-
-SELECT * FROM t7 ORDER BY a;
-SELECT * FROM t8 ORDER BY a;
---source include/save_master_gtid.inc
-
-
---connection server_2
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-SELECT * FROM t7 ORDER BY a;
-SELECT * FROM t8 ORDER BY a;
-
---source include/stop_slave.inc
-SET GLOBAL slave_transaction_retries= @old_retries;
-SET GLOBAL slave_parallel_threads=10;
---source include/start_slave.inc
-
-
---echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
-
---connection server_2
---source include/stop_slave.inc
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
-
---connection server_1
-# Inject two group commits. The bug was that ANALYZE TABLE would call
-# wakeup_subsequent_commits() too early, allowing the following transaction
-# in the same group to run ahead and binlog and free the GCO. Then we get
-# wrong binlog order and later access freed GCO, which causes lost wakeup
-# of following GCO and thus replication hang.
-# We injected a small sleep in ANALYZE to make the race easier to hit (this
-# can only cause false negatives in versions with the bug, not false positives,
-# so sleep is ok here. And it's in general not possible to trigger reliably
-# the race with debug_sync, since the bugfix makes the race impossible).
-
-SET @old_dbug= @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,binlog_force_commit_id";
-
-# Group commit with cid=10000, two event groups.
-SET @commit_id= 10000;
-ANALYZE TABLE t2;
-INSERT INTO t3 VALUES (120, 0);
-
-# Group commit with cid=10001, one event group.
-SET @commit_id= 10001;
-INSERT INTO t3 VALUES (121, 0);
-
-SET SESSION debug_dbug=@old_dbug;
-
-SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
---source include/save_master_gtid.inc
-
---connection server_2
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-
-SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
-
---source include/stop_slave.inc
-SET GLOBAL debug_dbug= @old_dbug;
---source include/start_slave.inc
-
-
---echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
-
---connection server_2
---source include/stop_slave.inc
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
-
---connection server_1
-# Inject two group commits. The bug was that record_gtid for a
-# non-transactional event group would commit its own transaction, which would
-# cause ha_commit_trans() to call wakeup_subsequent_commits() too early. This
-# in turn lead to access to freed group_commit_orderer object, losing a wakeup
-# and causing slave threads to hang.
-# We inject a small sleep in the corresponding record_gtid() to make the race
-# easier to hit.
-
-SET @old_dbug= @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,binlog_force_commit_id";
-
-# Group commit with cid=10010, two event groups.
-SET @old_server_id= @@SESSION.server_id;
-SET SESSION server_id= 100;
-SET @commit_id= 10010;
-ALTER TABLE t1 COMMENT "Hulubulu!";
-SET SESSION server_id= @old_server_id;
-INSERT INTO t3 VALUES (130, 0);
-
-# Group commit with cid=10011, one event group.
-SET @commit_id= 10011;
-INSERT INTO t3 VALUES (131, 0);
-
-SET SESSION debug_dbug=@old_dbug;
-
-SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
---source include/save_master_gtid.inc
-
---connection server_2
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-
-SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
-
---source include/stop_slave.inc
-SET GLOBAL debug_dbug= @old_dbug;
---source include/start_slave.inc
-
-
---echo *** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) ***
-
---connection server_1
-INSERT INTO t3 VALUES (201,0), (202,0);
---source include/save_master_gtid.inc
-
---connection server_2
---source include/sync_with_master_gtid.inc
---source include/stop_slave.inc
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,inject_mdev8031';
-
---connection server_1
-# We artificially create a situation that hopefully resembles the original
-# bug which was only seen "in the wild", and only once.
-# Setup a fake group commit with lots of conflicts that will lead to deadloc
-# kill. The slave DBUG injection causes the slave to be deadlock killed at
-# a particular point during the retry, and then later do a small sleep at
-# another critical point where the prior transaction then has a chance to
-# complete. Finally an extra KILL check catches an unhandled, lingering
-# deadlock kill. So rather artificial, but at least it exercises the
-# relevant code paths.
-SET @old_dbug= @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,binlog_force_commit_id";
-
-SET @commit_id= 10200;
-INSERT INTO t3 VALUES (203, 1);
-INSERT INTO t3 VALUES (204, 1);
-INSERT INTO t3 VALUES (205, 1);
-UPDATE t3 SET b=b+1 WHERE a=201;
-UPDATE t3 SET b=b+1 WHERE a=201;
-UPDATE t3 SET b=b+1 WHERE a=201;
-UPDATE t3 SET b=b+1 WHERE a=202;
-UPDATE t3 SET b=b+1 WHERE a=202;
-UPDATE t3 SET b=b+1 WHERE a=202;
-UPDATE t3 SET b=b+1 WHERE a=202;
-UPDATE t3 SET b=b+1 WHERE a=203;
-UPDATE t3 SET b=b+1 WHERE a=203;
-UPDATE t3 SET b=b+1 WHERE a=204;
-UPDATE t3 SET b=b+1 WHERE a=204;
-UPDATE t3 SET b=b+1 WHERE a=204;
-UPDATE t3 SET b=b+1 WHERE a=203;
-UPDATE t3 SET b=b+1 WHERE a=205;
-UPDATE t3 SET b=b+1 WHERE a=205;
-SET SESSION debug_dbug=@old_dbug;
-
-SELECT * FROM t3 WHERE a>=200 ORDER BY a;
---source include/save_master_gtid.inc
-
---connection server_2
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-
-SELECT * FROM t3 WHERE a>=200 ORDER BY a;
---source include/stop_slave.inc
-SET GLOBAL debug_dbug= @old_dbug;
---source include/start_slave.inc
-
-
---echo *** Check getting deadlock killed inside open_binlog() during retry. ***
-
---connection server_2
---source include/stop_slave.inc
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
-SET @old_max= @@GLOBAL.max_relay_log_size;
-SET GLOBAL max_relay_log_size= 4096;
-
---connection server_1
-SET @old_dbug= @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,binlog_force_commit_id";
-
---let $large= `SELECT REPEAT("*", 8192)`
-SET @commit_id= 10210;
---echo Omit long queries that cause relaylog rotations and transaction retries...
---disable_query_log
-eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
-eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
---enable_query_log
-SET SESSION debug_dbug=@old_dbug;
-
-SELECT * FROM t3 WHERE a>=200 ORDER BY a;
---source include/save_master_gtid.inc
-
---connection server_2
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-
-SELECT * FROM t3 WHERE a>=200 ORDER BY a;
---source include/stop_slave.inc
-SET GLOBAL debug_dbug= @old_debg;
-SET GLOBAL max_relay_log_size= @old_max;
---source include/start_slave.inc
-
-
---echo *** MDEV-8302: Duplicate key with parallel replication ***
-
---connection server_2
---source include/stop_slave.inc
-/* Inject a small sleep which makes the race easier to hit. */
-SET @old_dbug=@@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug="+d,inject_mdev8302";
-
-
---connection server_1
-INSERT INTO t7 VALUES (100,1), (101,2), (102,3), (103,4), (104,5);
-
-# Artificially create a bunch of group commits with conflicting transactions.
-# The bug happened when T1 and T2 was in one group commit, and T3 was in the
-# following group commit. T2 is a DELETE of a row with same primary key as a
-# row that T3 inserts. T1 and T2 can conflict, causing T2 to be deadlock
-# killed after starting to commit. The bug was that T2 could roll back before
-# doing unmark_start_commit(); this could allow T3 to run before the retry
-# of T2, causing duplicate key violation.
-
-SET @old_dbug= @@SESSION.debug_dbug;
-SET @commit_id= 20000;
-SET SESSION debug_dbug="+d,binlog_force_commit_id";
-
---let $n = 100
---disable_query_log
-while ($n)
-{
- eval UPDATE t7 SET b=b+1 WHERE a=100+($n MOD 5);
- eval DELETE FROM t7 WHERE a=100+($n MOD 5);
-
- SET @commit_id = @commit_id + 1;
- eval INSERT INTO t7 VALUES (100+($n MOD 5), $n);
- SET @commit_id = @commit_id + 1;
- dec $n;
-}
---enable_query_log
-SET SESSION debug_dbug=@old_dbug;
-
-
-SELECT * FROM t7 ORDER BY a;
---source include/save_master_gtid.inc
-
-
---connection server_2
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-SELECT * FROM t7 ORDER BY a;
-
---source include/stop_slave.inc
-SET GLOBAL debug_dbug=@old_dbug;
---source include/start_slave.inc
-
-
-
---echo *** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
---connection server_1
-# Inject an event group terminated by ROLLBACK, by mixing MyISAM and InnoDB
-# in a transaction. The bug was an assertion on the ROLLBACK due to
-# mark_start_commit() being already called.
---disable_warnings
-BEGIN;
-INSERT INTO t2 VALUES (200);
-INSERT INTO t1 VALUES (200);
-INSERT INTO t2 VALUES (201);
-ROLLBACK;
---enable_warnings
-SELECT * FROM t1 WHERE a>=200 ORDER BY a;
-SELECT * FROM t2 WHERE a>=200 ORDER BY a;
---source include/save_master_gtid.inc
-
---connection server_2
---source include/sync_with_master_gtid.inc
-SELECT * FROM t1 WHERE a>=200 ORDER BY a;
-SELECT * FROM t2 WHERE a>=200 ORDER BY a;
-
-
-# Clean up.
---connection server_2
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=@old_parallel_threads;
---source include/start_slave.inc
-SET DEBUG_SYNC= 'RESET';
-
---connection server_1
-DROP function foo;
-DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
-SET DEBUG_SYNC= 'RESET';
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_parallel.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_multilevel.cnf b/mysql-test/suite/rpl/t/rpl_parallel_multilevel.cnf
new file mode 100644
index 00000000000..3ff94e458ce
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multilevel.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
+loose-innodb
+
+[mysqld.4]
+log-slave-updates
+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_parallel_multilevel.test b/mysql-test/suite/rpl/t/rpl_parallel_multilevel.test
new file mode 100644
index 00000000000..168b7ea5167
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multilevel.test
@@ -0,0 +1,284 @@
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--let $rpl_topology=1->2->3->4
+--source include/rpl_init.inc
+
+# Test parallel replication with a multi-level replication hierarchy.
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+
+--connection server_3
+--sync_with_master
+--save_master_pos
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+
+--connection server_4
+--sync_with_master
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+
+--echo *** MDEV-6676: Test that @@skip_parallel_replication is preserved in slave binlog ***
+--connection server_1
+
+INSERT INTO t1 VALUES(1,1);
+BEGIN;
+INSERT INTO t1 VALUES(2,1);
+INSERT INTO t1 VALUES(3,1);
+COMMIT;
+# Do a lot of updates on same row in sequence. These would be likely to cause
+# conflicts and rollbacks in optimistic parallel replication, but we disable
+# that by enabling @@skip_parallel_replication. We can test that the flag is
+# preserved down the replication hierarchy by checking that no slave retries
+# are made.
+SET SESSION skip_parallel_replication=1;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+UPDATE t1 SET b=b+1 WHERE a=2;
+SET SESSION skip_parallel_replication=0;
+SELECT * FROM t1 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+--connection server_3
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+--connection server_4
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+
+--echo *** MDEV-6676: Test that the FL_WAITED flag in GTID is preserved in slave binlog ***
+
+--connection server_2
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+
+--connection server_3
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+
+--connection server_4
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+--connection server_1
+# Do a lot of updates on same row in sequence. Ensure that all of these but the
+# first have to do a lock wait on the master, setting FL_WAITED in the GTID
+# event. This should cause all slaves to not attempt to run those updates in
+# parallel with prior events, so that no retries are made.
+
+BEGIN;
+UPDATE t1 SET b=b+1 WHERE a=2;
+
+--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting1";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting1";
+
+--connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting2";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting2";
+
+--connect (con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting3";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting3";
+
+--connect (con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting4";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting4";
+
+--connect (con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting5";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting5";
+
+--connect (con_temp6,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting6";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting6";
+
+--connect (con_temp7,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting7";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting7";
+
+--connect (con_temp8,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync="thd_report_wait_for SIGNAL waiting8";
+send UPDATE t1 SET b=b+1 WHERE a=2;
+--connection server_1
+SET debug_sync="now WAIT_FOR waiting8";
+
+COMMIT;
+SET debug_sync="RESET";
+
+--connection con_temp1
+reap;
+
+COMMIT;
+--connection con_temp2
+reap;
+
+COMMIT;
+--connection con_temp3
+reap;
+
+COMMIT;
+--connection con_temp4
+reap;
+
+COMMIT;
+--connection con_temp5
+reap;
+
+COMMIT;
+--connection con_temp6
+reap;
+
+COMMIT;
+--connection con_temp7
+reap;
+
+COMMIT;
+--connection con_temp8
+reap;
+
+--connection server_1
+SELECT * FROM t1 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+--connection server_3
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+--connection server_4
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+
+# Clean up
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+
+--connection server_3
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+
+--connection server_4
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
new file mode 100644
index 00000000000..41fb6ebb72e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
@@ -0,0 +1,494 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+
+--connection server_1
+
+INSERT INTO t1 VALUES(1,1);
+BEGIN;
+INSERT INTO t1 VALUES(2,1);
+INSERT INTO t1 VALUES(3,1);
+COMMIT;
+
+# Do a bunch of INSERT/DELETE on the same rows, bound to conflict.
+# We will get a lot of rollbacks, probably, but they should be handled without
+# any visible errors.
+
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,2);
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,3);
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,4);
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,5);
+
+DELETE FROM t1 WHERE a=3;
+INSERT INTO t1 VALUES(3,2);
+DELETE FROM t1 WHERE a=1;
+INSERT INTO t1 VALUES(1,2);
+DELETE FROM t1 WHERE a=3;
+INSERT INTO t1 VALUES(3,3);
+
+DELETE FROM t1 WHERE a=2;
+INSERT INTO t1 VALUES (2,6);
+--source include/save_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+#SHOW STATUS LIKE 'Slave_retried_transactions';
+
+
+--echo *** Test a bunch of non-transactional/DDL event groups. ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+
+INSERT INTO t1 VALUES (4,4);
+INSERT INTO t1 VALUES (5,5);
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+CREATE TABLE t3 (a INT PRIMARY KEY) ENGINE=MyISAM;
+ALTER TABLE t2 ADD b INT;
+INSERT INTO t2 VALUES (2,2);
+ALTER TABLE t2 DROP b;
+INSERT INTO t2 VALUES (3);
+ALTER TABLE t2 ADD c INT;
+INSERT INTO t2 VALUES (4,5);
+INSERT INTO t2 VALUES (5,5);
+INSERT INTO t3 VALUES (1);
+UPDATE t2 SET c=NULL WHERE a=4;
+ALTER TABLE t2 ADD UNIQUE (c);
+INSERT INTO t2 VALUES (6,6);
+UPDATE t2 SET c=c+100 WHERE a=2;
+INSERT INTO t3(a) VALUES (2);
+DELETE FROM t3 WHERE a=2;
+INSERT INTO t3(a) VALUES (2);
+DELETE FROM t3 WHERE a=2;
+ALTER TABLE t3 CHANGE a c INT NOT NULL;
+INSERT INTO t3(c) VALUES (2);
+DELETE FROM t3 WHERE c=2;
+INSERT INTO t3 SELECT a+200 FROM t2;
+DELETE FROM t3 WHERE c >= 200;
+INSERT INTO t3 SELECT a+200 FROM t2;
+--source include/save_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY c;
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY c;
+#SHOW STATUS LIKE 'Slave_retried_transactions';
+
+
+--echo *** Test @@skip_parallel_replication. ***
+
+--connection server_2
+--source include/stop_slave.inc
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+
+--connection server_1
+# We do a bunch of conflicting transactions on the master with
+# skip_parallel_replication set to true, and check that we do not
+# get any retries on the slave.
+
+UPDATE t1 SET b=10 WHERE a=3;
+SET SESSION skip_parallel_replication=1;
+UPDATE t1 SET b=20 WHERE a=3;
+UPDATE t1 SET b=30 WHERE a=3;
+UPDATE t1 SET b=50 WHERE a=3;
+UPDATE t1 SET b=80 WHERE a=3;
+UPDATE t1 SET b=130 WHERE a=3;
+UPDATE t1 SET b=210 WHERE a=3;
+UPDATE t1 SET b=340 WHERE a=3;
+UPDATE t1 SET b=550 WHERE a=3;
+UPDATE t1 SET b=890 WHERE a=3;
+SET SESSION skip_parallel_replication=0;
+SELECT * FROM t1 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+
+--echo *** Test that we do not replicate in parallel transactions that had row lock waits on the master ***
+
+--connection server_2
+--source include/stop_slave.inc
+--let $retry1= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+
+--connection server_1
+# Setup a bunch of transactions that all needed to wait.
+--connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+--connect (m2,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+--connect (m3,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+--connect (m4,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+--connect (m5,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+--connect (m6,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+--connect (m7,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+--connect (m8,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+
+--connection default
+BEGIN; UPDATE t1 SET b=b+1 WHERE a=3;
+
+--connection m1
+SET debug_sync='thd_report_wait_for SIGNAL waiting1';
+send UPDATE t1 SET b=1001 WHERE a=3;
+--connection default
+SET debug_sync='now WAIT_FOR waiting1';
+
+--connection m2
+BEGIN;
+UPDATE t1 SET b=1002 WHERE a=5;
+SET debug_sync='thd_report_wait_for SIGNAL waiting2';
+send UPDATE t1 SET b=102 WHERE a=3;
+--connection default
+SET debug_sync='now WAIT_FOR waiting2';
+
+UPDATE t1 SET b=1000 WHERE a=1;
+--connection m3
+SET debug_sync='thd_report_wait_for SIGNAL waiting3';
+send UPDATE t1 SET b=1003 WHERE a=5;
+--connection default
+SET debug_sync='now WAIT_FOR waiting3';
+
+--connection m4
+SET debug_sync='thd_report_wait_for SIGNAL waiting4';
+send UPDATE t1 SET b=1004 WHERE a=3;
+--connection default
+SET debug_sync='now WAIT_FOR waiting4';
+
+--connection m5
+SET debug_sync='thd_report_wait_for SIGNAL waiting5';
+send UPDATE t1 SET b=1005 WHERE a=5;
+--connection default
+SET debug_sync='now WAIT_FOR waiting5';
+
+--connection m6
+SET debug_sync='thd_report_wait_for SIGNAL waiting6';
+send UPDATE t1 SET b=1006 WHERE a=1;
+--connection default
+SET debug_sync='now WAIT_FOR waiting6';
+
+--connection m7
+SET debug_sync='thd_report_wait_for SIGNAL waiting7';
+send UPDATE t1 SET b=1007 WHERE a=5;
+--connection default
+SET debug_sync='now WAIT_FOR waiting7';
+
+--connection m8
+SET debug_sync='thd_report_wait_for SIGNAL waiting8';
+send UPDATE t1 SET b=1008 WHERE a=3;
+--connection default
+SET debug_sync='now WAIT_FOR waiting8';
+
+--connection default
+COMMIT;
+--connection m1
+REAP;
+--connection m2
+REAP;
+COMMIT;
+--connection m3
+REAP;
+--connection m4
+REAP;
+--connection m5
+REAP;
+--connection m6
+REAP;
+--connection m7
+REAP;
+--connection m8
+REAP;
+--connection default
+SET debug_sync='RESET';
+SELECT * FROM t1 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+--let $retry2= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1)
+--disable_query_log
+eval SELECT IF($retry1=$retry2, "Ok, no retry",
+ CONCAT("ERROR: ", $retry2-$retry1, " retries during replication (was ",
+ $retry1, " now ", $retry2, ")")) AS status;
+--enable_query_log
+
+
+--echo *** Test that we replicate correctly when using READ COMMITTED and binlog_format=MIXED on the slave ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_format= @@GLOBAL.binlog_format;
+# Use MIXED format; we cannot binlog ROW events on slave in STATEMENT format.
+SET GLOBAL binlog_format= MIXED;
+SET @old_isolation= @@GLOBAL.tx_isolation;
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+# Reset the worker threads to make the new settings take effect.
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+
+--connection server_1
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,0), (2,0), (3,0);
+INSERT INTO t2 VALUES (1,0), (2,0);
+INSERT INTO t1 SELECT 4, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 4, COUNT(*) FROM t1;
+
+INSERT INTO t1 SELECT 5, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 5, COUNT(*) FROM t1;
+
+INSERT INTO t2 SELECT 6, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 6, COUNT(*) FROM t2;
+
+INSERT INTO t1 SELECT 7, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 7, COUNT(*) FROM t1;
+
+INSERT INTO t2 SELECT 8, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 8, COUNT(*) FROM t2;
+
+INSERT INTO t2 SELECT 9, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 9, COUNT(*) FROM t2;
+
+INSERT INTO t1 SELECT 10, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 10, COUNT(*) FROM t1;
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL binlog_format= @old_format;
+SET GLOBAL tx_isolation= @old_isolation;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+
+--connection server_1
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1), (2,1), (3,1), (4,1), (5,1);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+
+--connection server_1
+# The bug was that ANALYZE TABLE would call
+# wakeup_subsequent_commits() too early, allowing the following
+# transaction in the same group to run ahead and binlog and free the
+# GCO. Then we get wrong binlog order and later access freed GCO,
+# which causes lost wakeup of following GCO and thus replication hang.
+# We injected a small sleep in ANALYZE to make the race easier to hit (this
+# can only cause false negatives in versions with the bug, not false positives,
+# so sleep is ok here. And it's in general not possible to trigger reliably
+# the race with debug_sync, since the bugfix makes the race impossible).
+
+ALTER TABLE t2 COMMENT "123abc";
+ANALYZE TABLE t2;
+INSERT INTO t1 VALUES (1,2);
+INSERT INTO t1 VALUES (2,2);
+INSERT INTO t1 VALUES (3,2);
+INSERT INTO t1 VALUES (4,2);
+INSERT INTO t3 VALUES (1,3);
+ALTER TABLE t2 COMMENT "hello, world";
+BEGIN;
+INSERT INTO t1 VALUES (5,4);
+INSERT INTO t1 VALUES (6,4);
+INSERT INTO t1 VALUES (7,4);
+INSERT INTO t1 VALUES (8,4);
+INSERT INTO t1 VALUES (9,4);
+INSERT INTO t1 VALUES (10,4);
+INSERT INTO t1 VALUES (11,4);
+INSERT INTO t1 VALUES (12,4);
+INSERT INTO t1 VALUES (13,4);
+INSERT INTO t1 VALUES (14,4);
+INSERT INTO t1 VALUES (15,4);
+INSERT INTO t1 VALUES (16,4);
+INSERT INTO t1 VALUES (17,4);
+INSERT INTO t1 VALUES (18,4);
+INSERT INTO t1 VALUES (19,4);
+INSERT INTO t1 VALUES (20,4);
+COMMIT;
+INSERT INTO t1 VALUES (21,5);
+INSERT INTO t1 VALUES (22,5);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debug;
+--source include/start_slave.inc
+
+--echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+# The bug was that record_gtid(), when there is no existing transaction from
+# a DML event being replicated, would commit its own transaction. This wrongly
+# caused wakeup_subsequent_commits(), with similar consequences as MDEV-7888
+# above. We simulate this condition with a small sleep in record_gtid() for
+# a specific ANALYZE that we binlog with server id 100.
+SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+
+--connection server_1
+
+ALTER TABLE t3 COMMENT "DDL statement 1";
+INSERT INTO t1 VALUES (30,0);
+INSERT INTO t1 VALUES (31,0);
+INSERT INTO t1 VALUES (32,0);
+INSERT INTO t1 VALUES (33,0);
+INSERT INTO t1 VALUES (34,0);
+INSERT INTO t1 VALUES (35,0);
+INSERT INTO t1 VALUES (36,0);
+SET @old_server_id= @@SESSION.server_id;
+SET SESSION server_id= 100;
+ANALYZE TABLE t2;
+SET SESSION server_id= @old_server_id;
+INSERT INTO t1 VALUES (37,0);
+ALTER TABLE t3 COMMENT "DDL statement 2";
+INSERT INTO t1 VALUES (38,0);
+INSERT INTO t1 VALUES (39,0);
+ALTER TABLE t3 COMMENT "DDL statement 3";
+
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+--source include/save_master_gtid.inc
+
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debug;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-8113: ALTER TABLE causes slave hang in optimistic parallel replication ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+ALTER TABLE t2 ADD c INT;
+INSERT INTO t2 (a,b) VALUES (50, 0);
+INSERT INTO t2 (a,b) VALUES (51, 1);
+INSERT INTO t2 (a,b) VALUES (52, 2);
+INSERT INTO t2 (a,b) VALUES (53, 3);
+INSERT INTO t2 (a,b) VALUES (54, 4);
+INSERT INTO t2 (a,b) VALUES (55, 5);
+INSERT INTO t2 (a,b) VALUES (56, 6);
+INSERT INTO t2 (a,b) VALUES (57, 7);
+INSERT INTO t2 (a,b) VALUES (58, 8);
+INSERT INTO t2 (a,b) VALUES (59, 9);
+ALTER TABLE t2 DROP COLUMN c;
+SELECT * FROM t2 WHERE a >= 50 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 50 ORDER BY a;
+
+
+--echo *** MDEV-8075: DROP TEMPORARY TABLE not marked as ddl, causing optimistic parallel replication to fail ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (40, 10);
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (41);
+BEGIN;
+INSERT INTO t2 SELECT a, 20 FROM t1;
+DROP TEMPORARY TABLE t1;
+COMMIT;
+INSERT INTO t1 VALUES (42, 10);
+--source include/save_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 40 ORDER BY a;
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 40 ORDER BY a;
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+
+# Clean up.
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE t1, t2, t3;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.cnf b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.cnf
new file mode 100644
index 00000000000..0ea0d951568
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.cnf
@@ -0,0 +1,9 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates=0
+loose-innodb
+
+[mysqld.2]
+log-slave-updates=0
+loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
new file mode 100644
index 00000000000..94924147dce
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
@@ -0,0 +1,74 @@
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,0), (2,0), (3,0);
+INSERT INTO t2 VALUES (1,0), (2,0);
+--save_master_pos
+
+
+--connection server_2
+--sync_with_master
+SET @old_isolation= @@GLOBAL.tx_isolation;
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='aggressive';
+
+
+--echo *** Test that we replicate correctly when using READ COMMITTED and --log-slave-updates=0 on the slave ***
+
+--connection server_1
+
+INSERT INTO t1 SELECT 4, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 4, COUNT(*) FROM t1;
+
+INSERT INTO t1 SELECT 5, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 5, COUNT(*) FROM t1;
+
+INSERT INTO t2 SELECT 6, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 6, COUNT(*) FROM t2;
+
+INSERT INTO t1 SELECT 7, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 7, COUNT(*) FROM t1;
+
+INSERT INTO t2 SELECT 8, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 8, COUNT(*) FROM t2;
+
+INSERT INTO t2 SELECT 9, COUNT(*) FROM t1;
+INSERT INTO t1 SELECT 9, COUNT(*) FROM t2;
+
+INSERT INTO t1 SELECT 10, COUNT(*) FROM t2;
+INSERT INTO t2 SELECT 10, COUNT(*) FROM t1;
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL tx_isolation= @old_isolation;
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE t1, t2;
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
index 83d847318d8..9e93b0b56e9 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
@@ -1,34 +1 @@
-# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
-#
-# The function mysql_show_binlog_events has a local stack variable
-# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
-# this variable goes out of scope and is destroyed before clean
-# thd->current_linfo.
-#
-# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
-# that with the fix local variable linfo is valid along all
-# mysql_show_binlog_events function scope.
-#
---source include/have_debug_sync.inc
---source include/master-slave.inc
-
---echo [connection slave]
---connection slave
-SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
---send SHOW BINLOG EVENTS
-
---connection slave1
---echo [connection slave1]
-SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
-FLUSH LOGS;
-SET DEBUG_SYNC= 'now SIGNAL end';
-
---echo [connection slave]
---connection slave
---disable_result_log
---reap
---enable_result_log
-SET DEBUG_SYNC= 'RESET';
-
---connection master
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_temptable.test b/mysql-test/suite/rpl/t/rpl_parallel_temptable.test
index feae29e7a9e..04165ee4752 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_temptable.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_temptable.test
@@ -233,6 +233,30 @@ SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--source include/stop_slave.inc
+SET @old_mode= @@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode=optimistic;
+
+--connection server_1
+CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (32);
+INSERT INTO t4 VALUES (33);
+INSERT INTO t1 SELECT a, "optimistic" FROM t4;
+DROP TEMPORARY TABLE t4;
+
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_mode;
+--source include/start_slave.inc
+
# Clean up.
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index b3d07dd1400..b4ea3a385b1 100644
--- a/mysql-test/suite/rpl/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -1,9 +1,6 @@
#
# Test of replicating user variables
#
-###########################################################
-# 2006-02-08 By JBM added order by for use w/ NDB engine
-###########################################################
source include/master-slave.inc;
#sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
index 30cc564917a..d7c82266ebf 100644
--- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
@@ -1,5 +1,4 @@
-- source include/have_binlog_format_mixed.inc
--- source include/not_ndb_default.inc
-- source include/master-slave.inc
# Test that the slave temporarily switches to ROW when seeing row
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
index ca16a583fe5..87df66bc148 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_sv_relay_space.test
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
index 13719cbdc33..e022921a5bb 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
@@ -1,3 +1,2 @@
--- source include/not_ndb_default.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_sv_relay_space.test
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test
index f187fbc033f..5e3bcdcd711 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate.test
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
@@ -1,15 +1 @@
-#######################################################
-# Wrapper for rpl_relayrotate.test to allow multi #
-# Engines to reuse test code. By JBM 2006-02-15 #
-# Added comments section and to skip when ndb is #
-# Default engine. #
-#######################################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-# Slow test, don't run during staging part
--- source include/not_staging.inc
--- source include/master-slave.inc
-
-let $engine_type=innodb;
--- source extra/rpl_tests/rpl_relayrotate.test
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_relayrotate.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index 273786cf807..358c0be5b3b 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -109,6 +109,7 @@ source include/show_master_logs.inc;
# we just tests if synonyms are accepted
purge binary logs to 'master-bin.000002';
source include/show_binary_logs.inc;
+--source include/wait_for_binlog_checkpoint.inc
# Set the purge time 1 second after the last modify time of master-bin.000002.
perl;
diff --git a/mysql-test/suite/rpl/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test
index 96521280afd..47b6da75dd6 100644
--- a/mysql-test/suite/rpl/t/rpl_row_001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_001.test
@@ -1,8 +1,6 @@
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
# Slow test, don't run during staging part
-- source include/not_staging.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test
index 010e0e6ea05..31826812efa 100644
--- a/mysql-test/suite/rpl/t/rpl_row_USER.test
+++ b/mysql-test/suite/rpl/t/rpl_row_USER.test
@@ -6,12 +6,13 @@
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
##########
# Includes
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
+set global sql_mode="";
+set local sql_mode="";
# Begin clean up test section
connection master;
@@ -59,3 +60,6 @@ sync_slave_with_master;
# End of 5.0 test case
--source include/rpl_end.inc
+
+set global sql_mode=default;
+set local sql_mode=default;
diff --git a/mysql-test/suite/rpl/t/rpl_row_UUID.test b/mysql-test/suite/rpl/t/rpl_row_UUID.test
index ce3a4ed40a9..1de44af8156 100644
--- a/mysql-test/suite/rpl/t/rpl_row_UUID.test
+++ b/mysql-test/suite/rpl/t/rpl_row_UUID.test
@@ -1,8 +1,6 @@
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=myisam;
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
index 9e99c1eb0b3..82929d57db5 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
@@ -4,10 +4,6 @@
let $SERVER_VERSION=`select version()`;
-#This test case is not written for NDB, the result files
-#will not match when NDB is the default engine
---source include/not_ndb_default.inc
-
--source include/master-slave.inc
# Add suppression for expected warning(s) in slaves error log
@@ -95,7 +91,7 @@ INSERT INTO t1 VALUES (7),(8),(9);
sync_slave_with_master;
SELECT * FROM t1;
-SET GLOBAL QUERY_CACHE_SIZE=0;
+SET GLOBAL QUERY_CACHE_SIZE=default;
--connection master
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
index 3ec79ec8cd5..4262d765148 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
@@ -9,15 +9,12 @@
--source include/have_binlog_format_row.inc
--source include/have_partition.inc
---source include/not_ndb_default.inc
--source include/master-slave.inc
connection master;
--disable_warnings
DROP TABLE IF EXISTS t1;
-let $maybe_ro_var = @@BINLOG_FORMAT;
-let $val4var = ROW;
---source include/safe_set_to_maybe_ro_var.inc
+SET @@BINLOG_FORMAT = ROW;
--echo **** Partition RANGE testing ****
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
index eaf86688a29..5c1c705f48d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
@@ -3,9 +3,7 @@
#################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
index 482ccb7ecc0..e83da6ba142 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
@@ -3,9 +3,7 @@
#################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=myisam;
diff --git a/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
index db41ff09117..b898a9a120a 100644
--- a/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
+++ b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
@@ -1,3 +1,2 @@
--- source include/not_ndb_default.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_delayed_ins.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
index 2429dbc1142..71cd4a5b9ae 100644
--- a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
@@ -8,10 +8,6 @@ let $rename_event_pos= `select @binlog_start_pos + 819`;
# The use of the ps protocol causes extra table maps in the binlog, so
# we disable the ps-protocol for this statement.
-# Merge tables are not supported in NDB
--- source include/not_ndb_default.inc
-
-
--disable_ps_protocol
-- source extra/rpl_tests/rpl_flsh_tbls.test
--enable_ps_protocol
diff --git a/mysql-test/suite/rpl/t/rpl_row_func003.test b/mysql-test/suite/rpl/t/rpl_row_func003.test
index a17d70e4b04..c153bc70253 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func003.test
@@ -3,9 +3,7 @@
###################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_img.cnf b/mysql-test/suite/rpl/t/rpl_row_img.cnf
new file mode 100644
index 00000000000..ed9a4292917
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img.cnf
@@ -0,0 +1,21 @@
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+log-slave-updates
+innodb
+innodb_flush_log_at_trx_commit= 0
+
+[mysqld.2]
+log-slave-updates
+innodb
+innodb_flush_log_at_trx_commit= 0
+
+[mysqld.3]
+log-slave-updates
+innodb
+innodb_flush_log_at_trx_commit= 0
+
+[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_row_img_blobs.cnf b/mysql-test/suite/rpl/t/rpl_row_img_blobs.cnf
new file mode 100644
index 00000000000..d758d29f481
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_blobs.cnf
@@ -0,0 +1 @@
+!include suite/rpl/t/rpl_row_img.cnf
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
new file mode 100644
index 00000000000..467202391b0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
@@ -0,0 +1,59 @@
+#Want to skip this test from daily Valgrind execution
+--source include/no_valgrind_without_big.inc
+
+#
+# This file contains tests for WL#5096.
+#
+
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+-- source include/have_binlog_format_row.inc
+
+-- connection server_1
+-- source include/have_innodb.inc
+-- connection server_2
+-- source include/have_innodb.inc
+-- connection server_3
+-- source include/have_innodb.inc
+-- connection server_1
+
+#
+# WL#5096 Tests.
+#
+
+#
+# Tests combinations of binlog-row-image against mixes of MyISAM and InnoDB
+# storage engines on all three servers.
+#
+# All the combinarions need not to be separated into their own files as
+# the tests for indexes and engines mixes are, because noblobs test script
+# does not take too long time, thence we do not risk triggering PB2 timeout
+# on valgrind runs.
+#
+
+## NOBLOB
+
+-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test
+-- source include/rpl_row_img_general_loop.inc
+
+## MINIMAL
+
+-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test
+-- source include/rpl_row_img_general_loop.inc
+
+## FULL
+
+-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test
+-- source include/rpl_row_img_general_loop.inc
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_min.cnf b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.cnf
new file mode 100644
index 00000000000..d758d29f481
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.cnf
@@ -0,0 +1 @@
+!include suite/rpl/t/rpl_row_img.cnf
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test
new file mode 100644
index 00000000000..24b9655bd81
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test
@@ -0,0 +1,39 @@
+#Want to skip this test from daily Valgrind execution
+--source include/no_valgrind_without_big.inc
+#
+# This file contains tests for WL#5096 and bug fixes.
+#
+
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+-- source include/have_binlog_format_row.inc
+
+-- connection server_1
+-- source include/have_innodb.inc
+-- connection server_2
+-- source include/have_innodb.inc
+-- connection server_3
+-- source include/have_innodb.inc
+-- connection server_1
+
+#
+# WL#5096
+#
+
+#
+# Tests for different storage engines on each server,
+# but same index structure on tables. The tests are conducted
+# using MINIMAL binlog-row-image on all servers.
+#
+
+-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
+-- source include/rpl_row_img_general_loop.inc
+
+-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
+-- source include/rpl_row_img_set.inc
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.cnf b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.cnf
new file mode 100644
index 00000000000..d758d29f481
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.cnf
@@ -0,0 +1 @@
+!include suite/rpl/t/rpl_row_img.cnf
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test
new file mode 100644
index 00000000000..5d5f95a6552
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test
@@ -0,0 +1,39 @@
+#Want to skip this test from daily Valgrind execution
+--source include/no_valgrind_without_big.inc
+#
+# This file contains tests for WL#5096 and bug fixes.
+#
+
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+-- source include/have_binlog_format_row.inc
+
+-- connection server_1
+-- source include/have_innodb.inc
+-- connection server_2
+-- source include/have_innodb.inc
+-- connection server_3
+-- source include/have_innodb.inc
+-- connection server_1
+
+#
+# WL#5096
+#
+
+#
+# Tests for different storage engines on each server,
+# but same index structure on tables. The tests are conducted
+# using NOBLOB binlog-row-image on all servers.
+#
+
+-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
+-- source include/rpl_row_img_general_loop.inc
+
+-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
+-- source include/rpl_row_img_set.inc
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test b/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
index cef259687fb..af4efed872f 100644
--- a/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
+++ b/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_log_bin.inc
-- source include/have_binlog_format_row.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_log.test b/mysql-test/suite/rpl/t/rpl_row_log.test
index b156a4c8dd4..1d37d4327d0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log.test
@@ -1,15 +1,12 @@
###################################
# Wrapper for rpl_row_log.test #
# Added wrapper so that MyISAM & #
-# Innodb and NDB could all use the#
-# Same test. NDB produced a diff #
-# bin-log #
+# Innodb could all use the#
+# Same test
###################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=MyISAM;
diff --git a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
index 631fb29c7bc..0eccde7ecb9 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
@@ -1,11 +1,9 @@
###################################
# Wrapper for rpl_row_log.test #
# Added wrapper so that MyISAM & #
-# Innodb and NDB could all use the#
-# Same test. NDB produced a diff #
-# bin-log #
+# Innodb could all use the#
+# Same test.
###################################
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
index ea4b958ae4c..3e057d48ec9 100644
--- a/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
@@ -4,7 +4,6 @@
# Test of manual relay log rotation with FLUSH LOGS.
# Requires statement logging
-source include/not_ndb_default.inc;
source include/have_binlog_format_row.inc;
source extra/rpl_tests/rpl_max_relay_size.test;
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
index f96603f69ed..0d6b08bd0c1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
@@ -9,7 +9,6 @@
-- echo ## coverage purposes - Field_bits
-- echo ## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
-## Added here because AFAIK it's only MyISAM and NDB that use Field_bits
--source include/rpl_reset.inc
-- connection master
diff --git a/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test b/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test
new file mode 100644
index 00000000000..7ad756ea545
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test
@@ -0,0 +1,312 @@
+###############################################################################
+# Bug#76727: SLAVE ASSERTION IN UNPACK_ROW WITH ROLLBACK TO
+# SAVEPOINT IN ERROR HANDLER
+#
+# Problem:
+# ========
+# "SAVEPOINT", "ROLLBACK TO savepoint" wipe out table map on slave during
+# execution binary log events. For trigger the map is written to binary log once
+# for all trigger body and if trigger contains "SAVEPOINT" or
+# "ROLLBACK TO savepoint" statements any trigger's events after these
+# statements will not have table map. This results in an assert on slave.
+#
+# Test:
+# =====
+# Test case 1:
+# Create a trigger with exception handler which rolls back to a savepoint.
+# Test proves that there will not be any assert during execution of rolling
+# back to savepoint.
+#
+# Test case 2:
+# Create a trigger which calls a procedure which in turn calls an exception
+# handler which rolls back to a savepoint. Prove that it doesn't cause any
+# assertion during execution.
+#
+# Test case 3:
+# Create a simple trigger which does SAVEPOINT and ROLLBACK TO SAVEPOINT
+# and doesn't follow with any other DML statement. Prove that it doesn't cause
+# any assertion during execution.
+#
+# Test case 4:
+# Create a trigger with SAVEPOINT and follows with a DML without ROLLBACK TO
+# savepoint. Ensure that data is replicated properly.
+#
+# Test case 5:
+# Create a trigger with SAVEPOINT and it does nothing. Do few DMLs following
+# the trigger ensure that the data is replicated properly
+#
+# Test case 6:
+# Create a stored function which does SAVEPOINT and ROLLBACK TO
+# SAVEPOINT. Do few inserts following the stored function call and ensure that
+# no assert is generated on slave and all the rows are replicated to slave.
+#
+# Test case 7:
+# Create a stored function which creates a SAVEPOINT alone and follows with
+# DMLs without ROLLBACK TO savepoint. Ensure that data is replicated properly.
+#
+# Test case 8:
+# Create a stored function which has SAVEPOINT inside it and does noting. It
+# should follow with other DMLs. Ensure that data is replicated properly.
+###############################################################################
+--source include/have_binlog_format_row.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--echo #Test case 1:
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+DELIMITER |;
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK TO event_logging_1;
+ INSERT t3 VALUES (1);
+ END;
+ SAVEPOINT event_logging_1;
+ INSERT INTO t2 VALUES (1);
+ RELEASE SAVEPOINT event_logging_1;
+END|
+DELIMITER ;|
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+--source include/show_binlog_events.inc
+
+--sync_slave_with_master
+
+--source include/rpl_connection_master.inc
+
+DROP TRIGGER tr1;
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
+
+--echo # Test case 2:
+
+DELIMITER |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE EXIT HANDLER FOR SQLEXCEPTION
+ BEGIN
+ ROLLBACK TO event_logging_2;
+ INSERT t3 VALUES (3);
+ END;
+ SAVEPOINT event_logging_2;
+ INSERT INTO t2 VALUES (1);
+ RELEASE SAVEPOINT event_logging_2;
+END|
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1()|
+
+DELIMITER ;|
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+--source include/show_binlog_events.inc
+
+--sync_slave_with_master
+
+--source include/rpl_connection_master.inc
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+DROP PROCEDURE p1;
+
+--echo # Test case 3:
+--source include/rpl_reset.inc
+--source include/rpl_connection_master.inc
+
+CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB;
+
+--delimiter |
+CREATE TRIGGER t_insert_trig AFTER INSERT ON t FOR EACH ROW
+BEGIN
+ SAVEPOINT savepoint_1;
+ ROLLBACK TO savepoint_1;
+END |
+--delimiter ;
+
+INSERT INTO t VALUES (2);
+INSERT INTO t VALUES (3);
+
+--source include/show_binlog_events.inc
+
+SELECT * FROM t;
+
+--source include/sync_slave_sql_with_master.inc
+
+SELECT * FROM t;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t;
+
+--echo # Test case 4:
+--source include/rpl_reset.inc
+--source include/rpl_connection_master.inc
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+
+--delimiter |
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t FOR EACH ROW
+BEGIN
+ SAVEPOINT savepoint_1;
+ INSERT INTO t1 VALUES (5);
+END |
+--delimiter ;
+
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+--source include/show_binlog_events.inc
+
+SELECT * FROM t;
+SELECT * FROM t1;
+--source include/sync_slave_sql_with_master.inc
+
+SELECT * FROM t;
+SELECT * FROM t1;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t;
+DROP TABLE t1;
+
+--echo # Test case 5:
+--source include/rpl_reset.inc
+--source include/rpl_connection_master.inc
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+
+--delimiter |
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+
+SAVEPOINT savepoint_1;
+END |
+
+--delimiter ;
+
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+--source include/show_binlog_events.inc
+
+SELECT * FROM t;
+SELECT * FROM t1;
+--source include/sync_slave_sql_with_master.inc
+
+SELECT * FROM t;
+SELECT * FROM t1;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t;
+DROP TABLE t1;
+
+--echo # Test case 6:
+--source include/rpl_reset.inc
+--source include/rpl_connection_master.inc
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+
+--delimiter |
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ SAVEPOINT event_logging_2;
+ INSERT INTO t1 VALUES (1);
+ ROLLBACK TO event_logging_2;
+ RETURN 0;
+END|
+
+--delimiter ;
+
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+--source include/show_binlog_events.inc
+
+--source include/rpl_connection_master.inc
+SELECT * FROM t2;
+SELECT * FROM t1;
+--source include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+SELECT * FROM t1;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+
+--echo # Test case 7:
+--source include/rpl_reset.inc
+--source include/rpl_connection_master.inc
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+
+--delimiter |
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ SAVEPOINT event_logging_2;
+ INSERT INTO t1 VALUES (1);
+ RETURN 0;
+END|
+
+--delimiter ;
+
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+--source include/show_binlog_events.inc
+
+--source include/rpl_connection_master.inc
+SELECT * FROM t2;
+SELECT * FROM t1;
+--source include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+SELECT * FROM t1;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+
+--echo # Test case 8:
+--source include/rpl_reset.inc
+--source include/rpl_connection_master.inc
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+
+--delimiter |
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ SAVEPOINT event_logging_2;
+ RETURN 0;
+END|
+
+--delimiter ;
+
+BEGIN;
+INSERT INTO t1 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t1 VALUES (10);
+--source include/show_binlog_events.inc
+
+--source include/rpl_connection_master.inc
+SELECT * FROM t1;
+--source include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+DROP FUNCTION f1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
index aec421407c9..c863c9c02e1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_sp002.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003.test b/mysql-test/suite/rpl/t/rpl_row_sp003.test
index b5d62f60199..f1cad89b58e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003.test
@@ -3,9 +3,7 @@
#################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/have_binlog_format_row.inc
# Slow test, don't run during staging part
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index bbe4ce47f9e..89bc0ca4df0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
@@ -6,8 +6,6 @@
# Test: Tests SPs with cursors, flow logic, and alter sp. In addition the #
# tests SPs with insert and update operations. #
#############################################################################
-# 2006-02-08 By JBM added ORDER BY for use with NDB engine
-#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
index df3952bead1..f8ff2b2ca8e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
@@ -3,9 +3,7 @@
#################################
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
########################################################
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
index fcac31df780..e2003092d10 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_sp007.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp009.test b/mysql-test/suite/rpl/t/rpl_row_sp009.test
index 6e7226593a1..83d743b8e07 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp009.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp009.test
@@ -5,8 +5,6 @@
#############################################################################
#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12168 #
#############################################################################
-# 2006-02-08 By JBM : Added order by for ndb engine use
-#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test
index 23bc92b51cf..80d312f1878 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp012.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp012.test
@@ -23,6 +23,7 @@ DROP PROCEDURE IF EXISTS test.p3;
# Begin test section 1
# Create user user1 with no particular access rights
+create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;
@@ -34,6 +35,7 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
+set sql_mode=default;
# Need to wait for the rights to be applied at the slave
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig004.test b/mysql-test/suite/rpl/t/rpl_row_trig004.test
index fa5f973c355..e10e0d51039 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig004.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig004.test
@@ -4,12 +4,8 @@
#############################################################################
# TEST: Use before insert triggers and has the second insert fail #
#############################################################################
-# Change by JBM 2006-02-14 added to skip when NDB default engine #
-# This test has been wrapped to allow multipal engines to use same code #
-#############################################################################
# Includes
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_triggers.test b/mysql-test/suite/rpl/t/rpl_row_triggers.test
index 3a884727325..173ddebba12 100644
--- a/mysql-test/suite/rpl/t/rpl_row_triggers.test
+++ b/mysql-test/suite/rpl/t/rpl_row_triggers.test
@@ -64,7 +64,7 @@ sync_slave_with_master;
connection slave;
SELECT * FROM t2 order by id;
---echo # INSERT triggers which cause also UPDATE test (insert duplicate row)
+--echo # INSERT triggers causing DELETE + INSERT (on unique key conflict)
insert into t1 values ('0','1');
SELECT * FROM t2 order by id;
@@ -276,5 +276,54 @@ drop table t1, tlog;
sync_slave_with_master;
+--echo #
+--echo # MDEV-8411 Assertion `is_stat_field || !table || (!table->write_set ||
+--echo # bitmap_is_set(table->write_set, field_index) ||
+--echo # bitmap_is_set(table->vcol_set, field_index))'
+--echo # failed in Field_timestamp::store_TIME_with_warning
+--echo #
+--enable_connect_log
+--echo #
+--echo # Create table on master, replicate it on slave.
+--echo #
+--connection master
+set @binlog_row_image.saved = @@binlog_row_image;
+set binlog_row_image = MINIMAL;
+create table t1 (pk int primary key, f int);
+
+--sync_slave_with_master
+--echo #
+--echo # Create a trigger on the slave.
+--echo #
+create trigger tr before update on t1 for each row set new.f = 1000;
+set @old_slave_run_triggers_for_rbr = @@global.slave_run_triggers_for_rbr;
+set global slave_run_triggers_for_rbr = YES;
+
+--connection master
+--echo #
+--echo # Update the table to have the trigger fire on the slave.,
+--echo #
+insert into t1 values (1,1),(2,2);
+update t1 set pk=pk+10;
+select * from t1;
+
+--sync_slave_with_master
+--echo #
+--echo # Check to see if slave has the table updated.
+--echo #
+select * from t1;
+
+--echo #
+--echo # Cleanup
+--echo #
+
+set global slave_run_triggers_for_rbr = @old_slave_run_triggers_for_rbr;
+
+--connection master
+set binlog_row_image = @binlog_row_image.saved;
+drop table t1;
+
+--sync_slave_with_master
+--disable_connect_log
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test b/mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test
deleted file mode 100644
index a801363b931..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test
+++ /dev/null
@@ -1,43 +0,0 @@
---source include/have_binlog_format_statement.inc
---source include/have_rbr_triggers.inc
---source include/master-slave.inc
-
---disable_query_log
-CALL mtr.add_suppression("Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT");
---enable_query_log
-
-set binlog_format = row;
-
-create table t1 (i int);
-create table t2 (i int);
-
---sync_slave_with_master
---disable_query_log
-CALL mtr.add_suppression("impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT");
---enable_query_log
-
-SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
-set global slave_run_triggers_for_rbr=YES;
-
-create trigger tr_before before insert on t1 for each row
- insert into t2 values (1);
-
---connection master
-
-insert into t1 values (1);
-
---connection slave
-
---let $slave_sql_errno= 1666
---source include/wait_for_slave_sql_error_and_skip.inc
-
---connection master
-
-drop tables t1,t2;
-
---sync_slave_with_master
-SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
-
---connection master
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index 97b60a3055f..8a5d743a238 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
@@ -40,17 +39,14 @@ sync_slave_with_master;
--source include/stop_slave.inc
# Reset slave.
RESET SLAVE;
---disable_query_log
+--replace_result $MASTER_MYPORT MASTER_MYPORT
eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT;
---enable_query_log
# Try to replicate all queries until drop of t1
connection slave;
-echo START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_drop_t1;
---disable_query_log
+--replace_result $master_pos_drop_t1 master_pos_drop_t1
eval START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_drop_t1;
---enable_query_log
--source include/wait_for_slave_sql_to_stop.inc
# Here table should be still not deleted
@@ -60,7 +56,6 @@ SELECT * FROM t1;
--source include/check_slave_param.inc
# This should fail right after start
---replace_result 291 MASTER_LOG_POS
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
--source include/wait_for_slave_sql_to_stop.inc
# again this table should be still not deleted
@@ -78,10 +73,8 @@ sync_slave_with_master;
--source include/stop_slave.inc
# This should stop immediately as we are already there
-echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_create_t2;
---disable_query_log
+--replace_result $master_pos_create_t2 master_pos_create_t2
eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_create_t2;
---enable_query_log
let $slave_param= Until_Log_Pos;
let $slave_param_value= $master_pos_create_t2;
--source include/wait_for_slave_param.inc
@@ -141,9 +134,8 @@ INSERT INTO t1 VALUES (3);
--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1)
--source include/get_relay_log_pos.inc
---disable_query_log
+--replace_result $relay_log_pos relay_log_pos
--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos
---enable_query_log
--source include/wait_for_slave_sql_to_stop.inc
--let $assert_cond= COUNT(*) = 2 FROM t1
diff --git a/mysql-test/suite/rpl/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test
index cc60ab9912c..449196aefd5 100644
--- a/mysql-test/suite/rpl/t/rpl_row_view01.test
+++ b/mysql-test/suite/rpl/t/rpl_row_view01.test
@@ -5,8 +5,6 @@
#############################################################################
#TEST: row based replication of views #
#############################################################################
-# 2006-02-08 By JBM added order by and sleep for use with ndb engine
-#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
@@ -23,7 +21,6 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
-DROP TABLE IF EXISTS mysqltest1.t10;
# Begin test section 1
CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
@@ -45,15 +42,6 @@ CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL
SELECT * FROM mysqltest1.v2;
SELECT * FROM mysqltest1.v1;
-
-# Had to add a waiting for use with NDB
-# engine. Injector thread would have not
-# populated binlog and data would not be on
-# the slave.
-
-CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a));
-let $wait_binlog_event= CREATE TABLE mysqltest1.t10;
--- source include/wait_for_binlog_event.inc
--sync_slave_with_master
SELECT * FROM mysqltest1.v2;
@@ -89,7 +77,6 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
-DROP TABLE IF EXISTS mysqltest1.t10;
DROP DATABASE mysqltest1;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index aa36d70d4b7..d5f80619aeb 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -1,584 +1 @@
-source include/have_semisync.inc;
-source include/not_embedded.inc;
-source include/have_innodb.inc;
-source include/master-slave.inc;
-
-let $engine_type= InnoDB;
-#let $engine_type= MyISAM;
-
-# Suppress warnings that might be generated during the test
-connection master;
-call mtr.add_suppression("Timeout waiting for reply of binlog");
-call mtr.add_suppression("Read semi-sync reply");
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
-connection slave;
-call mtr.add_suppression("Master server does not support semi-sync");
-call mtr.add_suppression("Semi-sync slave .* reply");
-call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
-connection master;
-
-# wait for dying connections (if any) to disappear
-let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
---source include/wait_condition.inc
-
-# After fix of BUG#45848, semi-sync slave should not create any extra
-# connections on master, save the count of connections before start
-# semi-sync slave for comparison below.
-let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
-
---echo #
---echo # Uninstall semi-sync plugins on master and slave
---echo #
-connection slave;
-source include/stop_slave.inc;
-reset slave;
-set global rpl_semi_sync_master_enabled= 0;
-set global rpl_semi_sync_slave_enabled= 0;
-
-connection master;
-reset master;
-set global rpl_semi_sync_master_enabled= 0;
-set global rpl_semi_sync_slave_enabled= 0;
-
---echo #
---echo # Main test of semi-sync replication start here
---echo #
-
-connection master;
-echo [ on master ];
-
-set global rpl_semi_sync_master_timeout= 60000; # 60s
-
-echo [ default state of semi-sync on master should be OFF ];
-show variables like 'rpl_semi_sync_master_enabled';
-
-echo [ enable semi-sync on master ];
-set global rpl_semi_sync_master_enabled = 1;
-show variables like 'rpl_semi_sync_master_enabled';
-
-echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
---echo # BUG#45673 Semisynch reports correct operation even if no slave is connected
---echo #
-
-# BUG#45672 When semi-sync is enabled on master, it would allocate
-# transaction node even without semi-sync slave connected, and would
-# finally result in transaction node allocation error.
-#
-# Semi-sync master will pre-allocate 'max_connections' transaction
-# nodes, so here we do more than that much transactions to check if it
-# will fail or not.
-# select @@global.max_connections + 1;
-let $i= `select @@global.max_connections + 1`;
-disable_query_log;
-eval create table t1 (a int) engine=$engine_type;
-while ($i)
-{
- eval insert into t1 values ($i);
- dec $i;
-}
-drop table t1;
-enable_query_log;
-
-# BUG#45673
-echo [ status of semi-sync on master should be OFF ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-# reset master to make sure the following test will start with a clean environment
-reset master;
-
-connection slave;
-echo [ on slave ];
-
-echo [ default state of semi-sync on slave should be OFF ];
-show variables like 'rpl_semi_sync_slave_enabled';
-
-echo [ enable semi-sync on slave ];
-set global rpl_semi_sync_slave_enabled = 1;
-show variables like 'rpl_semi_sync_slave_enabled';
-source include/start_slave.inc;
-
-connection master;
-echo [ on master ];
-
-# NOTE: Rpl_semi_sync_master_client will only be updated when
-# semi-sync slave has started binlog dump request
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-
-echo [ initial master state after the semi-sync slave connected ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-replace_result $engine_type ENGINE_TYPE;
-eval create table t1(a int) engine = $engine_type;
-
-echo [ master state after CREATE TABLE statement ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-# After fix of BUG#45848, semi-sync slave should not create any extra
-# connections on master.
-let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
-replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
-eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
-
-echo [ insert records to table ];
-insert t1 values (10);
-insert t1 values (9);
-insert t1 values (8);
-insert t1 values (7);
-insert t1 values (6);
-insert t1 values (5);
-insert t1 values (4);
-insert t1 values (3);
-insert t1 values (2);
-insert t1 values (1);
-
-echo [ master status after inserts ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-sync_slave_with_master;
-echo [ on slave ];
-
-echo [ slave status after replicated inserts ];
-show status like 'Rpl_semi_sync_slave_status';
-
-select count(distinct a) from t1;
-select min(a) from t1;
-select max(a) from t1;
-
---echo
---echo # BUG#50157
---echo # semi-sync replication crashes when replicating a transaction which
---echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
-
-connection master;
-echo [ on master ];
-SET SESSION AUTOCOMMIT= 0;
-CREATE TABLE t2(c1 INT) ENGINE=innodb;
-sync_slave_with_master;
-
-connection master;
-BEGIN;
---echo
---echo # Even though it is in a transaction, this statement is binlogged into binlog
---echo # file immediately.
---disable_warnings
-CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
---enable_warnings
---echo
---echo # These statements will not be binlogged until the transaction is committed
-INSERT INTO t2 VALUES(11);
-INSERT INTO t2 VALUES(22);
-COMMIT;
-
-DROP TABLE t2, t3;
-SET SESSION AUTOCOMMIT= 1;
-sync_slave_with_master;
-
-
---echo #
---echo # Test semi-sync master will switch OFF after one transaction
---echo # timeout waiting for slave reply.
---echo #
-connection slave;
-source include/stop_slave.inc;
-
-connection master;
-echo [ on master ];
-set global rpl_semi_sync_master_timeout= 5000;
-
-# The first semi-sync check should be on because after slave stop,
-# there are no transactions on the master.
-echo [ master status should be ON ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-show status like 'Rpl_semi_sync_master_clients';
-
-echo [ semi-sync replication of these transactions will fail ];
-insert into t1 values (500);
-
-# Wait for the semi-sync replication of this transaction to timeout
-let $status_var= Rpl_semi_sync_master_status;
-let $status_var_value= OFF;
-source include/wait_for_status_var.inc;
-
-# The second semi-sync check should be off because one transaction
-# times out during waiting.
-echo [ master status should be OFF ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-# Semi-sync status on master is now OFF, so all these transactions
-# will be replicated asynchronously.
-delete from t1 where a=10;
-delete from t1 where a=9;
-delete from t1 where a=8;
-delete from t1 where a=7;
-delete from t1 where a=6;
-delete from t1 where a=5;
-delete from t1 where a=4;
-delete from t1 where a=3;
-delete from t1 where a=2;
-delete from t1 where a=1;
-
-insert into t1 values (100);
-
-echo [ master status should be OFF ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # Test semi-sync status on master will be ON again when slave catches up
---echo #
-
-# Save the master position for later use.
-save_master_pos;
-
-connection slave;
-echo [ on slave ];
-
-echo [ slave status should be OFF ];
-show status like 'Rpl_semi_sync_slave_status';
-source include/start_slave.inc;
-sync_with_master;
-
-echo [ slave status should be ON ];
-show status like 'Rpl_semi_sync_slave_status';
-
-select count(distinct a) from t1;
-select min(a) from t1;
-select max(a) from t1;
-
-connection master;
-echo [ on master ];
-
-# The master semi-sync status should be on again after slave catches up.
-echo [ master status should be ON again after slave catches up ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 305 304
-show status like 'Rpl_semi_sync_master_yes_tx';
-show status like 'Rpl_semi_sync_master_clients';
-
---echo #
---echo # Test disable/enable master semi-sync on the fly.
---echo #
-
-drop table t1;
-sync_slave_with_master;
-echo [ on slave ];
-
-source include/stop_slave.inc;
-
---echo #
---echo # Flush status
---echo #
-connection master;
-echo [ Semi-sync master status variables before FLUSH STATUS ];
-SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
---replace_result 306 305
-SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
-# Do not write the FLUSH STATUS to binlog, to make sure we'll get a
-# clean status after this.
-FLUSH NO_WRITE_TO_BINLOG STATUS;
-echo [ Semi-sync master status variables after FLUSH STATUS ];
-SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
---replace_result 306 305
-SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
-
-connection master;
-echo [ on master ];
-
-source include/show_master_logs.inc;
-show variables like 'rpl_semi_sync_master_enabled';
-
-echo [ disable semi-sync on the fly ];
-set global rpl_semi_sync_master_enabled=0;
-show variables like 'rpl_semi_sync_master_enabled';
-show status like 'Rpl_semi_sync_master_status';
-
-echo [ enable semi-sync on the fly ];
-set global rpl_semi_sync_master_enabled=1;
-show variables like 'rpl_semi_sync_master_enabled';
-show status like 'Rpl_semi_sync_master_status';
-
---echo #
---echo # Test RESET MASTER/SLAVE
---echo #
-
-connection slave;
-echo [ on slave ];
-
-source include/start_slave.inc;
-
-connection master;
-echo [ on master ];
-
-replace_result $engine_type ENGINE_TYPE;
-eval create table t1 (a int) engine = $engine_type;
-drop table t1;
-
-##show status like 'Rpl_semi_sync_master_status';
-
-sync_slave_with_master;
---replace_column 2 #
-show status like 'Rpl_relay%';
-
-echo [ test reset master ];
-connection master;
-echo [ on master];
-
-reset master;
-
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 306 305
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-connection slave;
-echo [ on slave ];
-
-source include/stop_slave.inc;
-reset slave;
-
-# Kill the dump thread on master for previous slave connection and
-# wait for it to exit
-connection master;
-let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
-if ($_tid)
-{
- --replace_result $_tid _tid
- eval kill query $_tid;
-
- # After dump thread exit, Rpl_semi_sync_master_clients will be 0
- let $status_var= Rpl_semi_sync_master_clients;
- let $status_var_value= 0;
- source include/wait_for_status_var.inc;
-}
-
-connection slave;
-source include/start_slave.inc;
-
-connection master;
-echo [ on master ];
-
-# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
-# 1 after dump thread started.
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-
-replace_result $engine_type ENGINE_TYPE;
-eval create table t1 (a int) engine = $engine_type;
-insert into t1 values (1);
-insert into t1 values (2), (3);
-
-sync_slave_with_master;
-echo [ on slave ];
-
-select * from t1;
-
-connection master;
-echo [ on master ];
-
-echo [ master semi-sync status should be ON ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 306 305
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # Start semi-sync replication without SUPER privilege
---echo #
-connection slave;
-source include/stop_slave.inc;
-reset slave;
-connection master;
-echo [ on master ];
-reset master;
-
-# Kill the dump thread on master for previous slave connection and wait for it to exit
-let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
-if ($_tid)
-{
- --replace_result $_tid _tid
- eval kill query $_tid;
-
- # After dump thread exit, Rpl_semi_sync_master_clients will be 0
- let $status_var= Rpl_semi_sync_master_clients;
- let $status_var_value= 0;
- source include/wait_for_status_var.inc;
-}
-
-# Do not binlog the following statement because it will generate
-# different events for ROW and STATEMENT format
-set sql_log_bin=0;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
-flush privileges;
-set sql_log_bin=1;
-connection slave;
-echo [ on slave ];
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
-flush privileges;
-change master to master_user='rpl',master_password='rpl_password';
-source include/start_slave.inc;
-show status like 'Rpl_semi_sync_slave_status';
-connection master;
-echo [ on master ];
-
-# Wait for the semi-sync binlog dump thread to start
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-echo [ master semi-sync should be ON ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 306 305
-show status like 'Rpl_semi_sync_master_yes_tx';
-insert into t1 values (4);
-insert into t1 values (5);
-echo [ master semi-sync should be ON ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
---replace_result 306 305
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # Test semi-sync slave connect to non-semi-sync master
---echo #
-
-# Disable semi-sync on master
-connection slave;
-echo [ on slave ];
-source include/stop_slave.inc;
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-
-connection master;
-echo [ on master ];
-
-# Kill the dump thread on master for previous slave connection and wait for it to exit
-let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
-if ($_tid)
-{
- --replace_result $_tid _tid
- eval kill query $_tid;
-
- # After dump thread exit, Rpl_semi_sync_master_clients will be 0
- let $status_var= Rpl_semi_sync_master_clients;
- let $status_var_value= 0;
- source include/wait_for_status_var.inc;
-}
-
-echo [ Semi-sync status on master should be ON ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-set global rpl_semi_sync_master_enabled= 0;
-
-connection slave;
-echo [ on slave ];
-SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
-source include/start_slave.inc;
-connection master;
-echo [ on master ];
-insert into t1 values (8);
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-echo [ master semi-sync clients should be 1, status should be OFF ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-sync_slave_with_master;
-echo [ on slave ];
-show status like 'Rpl_semi_sync_slave_status';
-
-# Uninstall semi-sync plugin on master
-connection slave;
-source include/stop_slave.inc;
-connection master;
-echo [ on master ];
-set global rpl_semi_sync_master_enabled= 0;
-
-connection slave;
-echo [ on slave ];
-SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
-source include/start_slave.inc;
-
-connection master;
-echo [ on master ];
-insert into t1 values (10);
-sync_slave_with_master;
-
---echo #
---echo # Test non-semi-sync slave connect to semi-sync master
---echo #
-
-connection master;
-set global rpl_semi_sync_master_timeout= 5000; # 5s
-set global rpl_semi_sync_master_enabled= 1;
-
-connection slave;
-echo [ on slave ];
-source include/stop_slave.inc;
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-
-echo [ uninstall semi-sync slave plugin ];
-set global rpl_semi_sync_slave_enabled= 0;
-
-echo [ reinstall semi-sync slave plugin and disable semi-sync ];
-SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-source include/start_slave.inc;
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-
---echo #
---echo # Clean up
---echo #
-
-connection slave;
-source include/stop_slave.inc;
-set global rpl_semi_sync_slave_enabled= 0;
-
-connection master;
-set global rpl_semi_sync_master_enabled= 0;
-
-connection slave;
-change master to master_user='root',master_password='';
-source include/start_slave.inc;
-
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-connection master;
-drop user rpl@127.0.0.1;
-flush privileges;
-set global rpl_semi_sync_master_timeout= default;
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_semi_sync.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test
new file mode 100644
index 00000000000..2d91d2e4118
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test
@@ -0,0 +1,4 @@
+--source include/have_binlog_format_statement.inc
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+source rpl_semi_sync.test;
+set global rpl_semi_sync_master_wait_point=default;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test
new file mode 100644
index 00000000000..47af6c34fcf
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test
@@ -0,0 +1,4 @@
+--source include/have_binlog_format_row.inc
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+source rpl_semi_sync.test;
+set global rpl_semi_sync_master_wait_point=default;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync-master.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync-master.opt
new file mode 100644
index 00000000000..4cfb5d53923
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync-master.opt
@@ -0,0 +1 @@
+--max-connections=40
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test
new file mode 100644
index 00000000000..527900fd949
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test
@@ -0,0 +1,3 @@
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+source rpl_semi_sync_event.test;
+set global rpl_semi_sync_master_wait_point=default;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.opt
new file mode 100644
index 00000000000..e49ae455124
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.opt
@@ -0,0 +1 @@
+--log_bin
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test
new file mode 100644
index 00000000000..6e4dc456a27
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test
@@ -0,0 +1,254 @@
+source include/have_semisync.inc;
+source include/not_embedded.inc;
+source include/have_innodb.inc;
+
+#
+# This test the rpl_semi_sync_master_wait_point functionality
+# and illustrates the differences between the two values AFTER_COMMIT and
+# AFTER_SYNC
+#
+
+--echo #
+--echo # Preparation
+--echo #
+
+CREATE TABLE t1 (i INT NOT NULL, PRIMARY KEY (i)) ENGINE=InnoDB;
+RESET MASTER;
+
+let $save_timeout = `select @@global.rpl_semi_sync_master_timeout`;
+let $save_wait_no_slave = `select @@global.rpl_semi_sync_master_wait_no_slave`;
+let $save_wait_point = `select @@global.rpl_semi_sync_master_wait_point`;
+
+SET @@global.rpl_semi_sync_master_timeout = 60000;
+SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
+
+--echo # It's okay to see "Killed" but we should not see "Timeout" in the log.
+call mtr.add_suppression("Killed waiting for reply of binlog");
+call mtr.add_suppression("Run function 'after_commit' in plugin 'rpl_semi_sync_master' failed");
+call mtr.add_suppression("Run function 'after_sync' in plugin 'rpl_semi_sync_master' failed");
+
+--echo #
+--echo # Test wait point = AFTER_COMMIT
+--echo #
+SET @@global.rpl_semi_sync_master_wait_point = AFTER_COMMIT;
+
+--echo # Make another connection to INSERT from.
+connect (other,localhost,root,,);
+connection other;
+let $other_connection_id = `SELECT CONNECTION_ID()`;
+
+connection default;
+
+--disable_query_log
+eval SET @other_connection_id = $other_connection_id;
+--enable_query_log
+
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+
+--echo # Go ahead and send the INSERT; it should block.
+connection other;
+send INSERT INTO t1 (i) VALUES (1);
+
+connection default;
+
+let $wait_condition =
+ SELECT COUNT(*) > 0 AS should_be_true
+ FROM information_schema.processlist
+ WHERE id = @other_connection_id
+ AND state = "Waiting for semi-sync ACK from slave";
+--source include/wait_condition.inc
+
+--echo # The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+
+--echo # The insert should be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+
+--echo # Kill the waiting thread; it should die immediately.
+KILL @other_connection_id;
+
+--echo # Collect the error from the INSERT thread; it should be disconnected.
+connection other;
+--error 2013,ER_CONNECTION_KILLED
+reap;
+
+connection default;
+
+--echo # Wait for INSERT thread to actually disappear (KILL closes connection
+--echo # before thread actually finishes its processing).
+let $wait_condition =
+ SELECT COUNT(*) = 0 AS should_be_true
+ FROM information_schema.processlist
+ WHERE id = @other_connection_id;
+--source include/wait_condition.inc
+
+--echo # The INSERT thread should now be gone.
+SELECT state AS should_be_empty_set
+FROM information_schema.processlist WHERE id = @other_connection_id;
+
+--echo # The insert is still there
+SELECT * FROM t1 ORDER BY 1;
+
+connection default;
+disconnect other;
+
+--echo # Make another connection to INSERT from.
+connect (other,localhost,root,,);
+connection other;
+let $other_connection_id = `SELECT CONNECTION_ID()`;
+connection default;
+--disable_query_log
+eval SET @other_connection_id = $other_connection_id;
+--enable_query_log
+
+--echo # Go ahead and send the INSERT; it should block.
+connection other;
+send INSERT INTO t1 (i) VALUES (2);
+
+connection default;
+
+let $wait_condition =
+ SELECT COUNT(*) > 0 AS should_be_true
+ FROM information_schema.processlist
+ WHERE id = @other_connection_id
+ AND state = "Waiting for semi-sync ACK from slave";
+--source include/wait_condition.inc
+
+--echo # The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+
+--echo # The insert should be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+
+--echo # Now restart server
+--source include/restart_mysqld.inc
+--echo # Done restarting server
+
+--echo # Reset setting that were lost in restart
+SET @@global.rpl_semi_sync_master_timeout = 60000;
+SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
+
+--echo # Check that row is still there
+SELECT * FROM t1 ORDER BY 1;
+
+disconnect other;
+
+--echo #
+--echo # Test wait point = AFTER_SYNC
+--echo #
+SET @@global.rpl_semi_sync_master_wait_point = AFTER_SYNC;
+
+--echo # Make another connection to INSERT from.
+connect (other,localhost,root,,);
+connection other;
+let $other_connection_id = `SELECT CONNECTION_ID()`;
+
+connection default;
+
+--disable_query_log
+eval SET @other_connection_id = $other_connection_id;
+--enable_query_log
+
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+
+--echo # Go ahead and send the INSERT; it should block.
+connection other;
+send INSERT INTO t1 (i) VALUES (3);
+
+connection default;
+
+let $wait_condition =
+ SELECT COUNT(*) > 0 AS should_be_true
+ FROM information_schema.processlist
+ WHERE id = @other_connection_id
+ AND state = "Waiting for semi-sync ACK from slave";
+--source include/wait_condition.inc
+
+--echo # The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+
+--echo # The insert should NOT be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+
+--echo # Kill the waiting thread; it should die immediately.
+KILL @other_connection_id;
+
+--echo # Collect the error from the INSERT thread; it should be disconnected.
+connection other;
+--error 2013,ER_CONNECTION_KILLED
+reap;
+
+connection default;
+
+--echo # Wait for INSERT thread to actually disappear (KILL closes connection
+--echo # before thread actually finishes its processing).
+let $wait_condition =
+ SELECT COUNT(*) = 0 AS should_be_true
+ FROM information_schema.processlist
+ WHERE id = @other_connection_id;
+--source include/wait_condition.inc
+
+--echo # The INSERT thread should now be gone.
+SELECT state AS should_be_empty_set
+FROM information_schema.processlist WHERE id = @other_connection_id;
+
+--echo # The row inserted is there
+SELECT * FROM t1 ORDER BY 1;
+
+connection default;
+disconnect other;
+
+--echo # Make another connection to INSERT from.
+connect (other,localhost,root,,);
+connection other;
+let $other_connection_id = `SELECT CONNECTION_ID()`;
+connection default;
+--disable_query_log
+eval SET @other_connection_id = $other_connection_id;
+--enable_query_log
+
+--echo # Go ahead and send the INSERT; it should block.
+connection other;
+send INSERT INTO t1 (i) VALUES (4);
+
+connection default;
+
+let $wait_condition =
+ SELECT COUNT(*) > 0 AS should_be_true
+ FROM information_schema.processlist
+ WHERE id = @other_connection_id
+ AND state = "Waiting for semi-sync ACK from slave";
+--source include/wait_condition.inc
+
+--echo # The INSERT thread should now be waiting.
+SELECT state AS should_be_waiting
+FROM information_schema.processlist WHERE id = @other_connection_id;
+
+--echo # The insert should NOT be visible to other threads
+SELECT * FROM t1 ORDER BY 1;
+
+--echo # Now restart server
+--source include/restart_mysqld.inc
+--echo # Done restarting server
+
+--echo # Reset setting that were lost in restart
+SET @@global.rpl_semi_sync_master_timeout = 60000;
+SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
+
+--echo # But the row inserted is there
+SELECT * FROM t1 ORDER BY 1;
+
+disconnect other;
+
+--echo #
+--echo # Cleanup
+--echo #
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+DROP TABLE t1;
+
+eval SET @@global.rpl_semi_sync_master_timeout = $save_timeout;
+eval SET @@global.rpl_semi_sync_master_wait_no_slave = $save_wait_no_slave;
+eval SET @@global.rpl_semi_sync_master_wait_point = $save_wait_point;
diff --git a/mysql-test/suite/rpl/t/rpl_set_statement.test b/mysql-test/suite/rpl/t/rpl_set_statement.test
new file mode 100644
index 00000000000..5bc54e44e34
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_set_statement.test
@@ -0,0 +1,61 @@
+--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+set sql_mode="";
+connection slave;
+set sql_mode="";
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+call mtr.add_suppression("Unsafe statement written to the binary log*");
+CREATE TABLE t1 (a bigint unsigned not null);
+CREATE TABLE t2 (a char(255) not null);
+
+--echo
+--echo There are the following types of variables:
+--echo 1) variables that are NOT replicated correctly when using STATEMENT mode;
+--echo
+
+--let $rpl_ssvt_var_name=max_join_size
+--let $rpl_ssvt_var_value=2
+--let $rpl_ssvt_table=t1
+--source suite/rpl/include/rpl_set_statement.inc
+
+--echo
+--echo 2) variables thar ARE replicated correctly
+--echo They must be replicated correctly with "SET STATEMENT" too.
+--echo
+--let $rpl_ssvt_var_name=auto_increment_increment
+--let $rpl_ssvt_var_value=10
+--let $rpl_ssvt_table=t1
+--source suite/rpl/include/rpl_set_statement.inc
+
+--echo
+--echo 3) sql_mode which is replicated correctly exept NO_DIR_IN_CREATE value;
+--echo
+--let $rpl_ssvt_var_name=sql_mode
+--let $rpl_ssvt_var_value='ERROR_FOR_DIVISION_BY_ZERO'
+--let $rpl_ssvt_table=t2
+--source suite/rpl/include/rpl_set_statement.inc
+--let $rpl_ssvt_var_name=sql_mode
+--let $rpl_ssvt_var_value='NO_DIR_IN_CREATE'
+--let $rpl_ssvt_table=t2
+--source suite/rpl/include/rpl_set_statement.inc
+
+--echo
+--echo 4) variables that are not replicated at all:
+--echo default_storage_engine, storage_engine, max_heap_table_size
+--echo
+--let $rpl_ssvt_var_name=max_heap_table_size
+--let $rpl_ssvt_var_value=16384
+--let $rpl_ssvt_table=t1
+--source suite/rpl/include/rpl_set_statement.inc
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+sync_slave_with_master;
+source include/stop_slave.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
new file mode 100644
index 00000000000..106cb4547f4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
@@ -0,0 +1,34 @@
+--source include/master-slave.inc
+
+--connection slave
+
+--source include/stop_slave.inc
+RESET SLAVE ALL;
+
+--echo # Does not work for CHANGE MASTER:
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval SET STATEMENT default_master_connection = 'm1' FOR
+ CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+
+
+--echo #
+--echo # The first field, Connection_name, should say 'm1'...
+--echo #
+--let $status_items= Connection_name
+--source include/show_all_slaves_status.inc
+#query_vertical SHOW ALL SLAVES STATUS;
+
+
+RESET SLAVE ALL;
+
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
+
+set default_master_connection = 'm1';
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+reset slave all;
+set default_master_connection = '';
+--disconnect slave
+--connection default
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
index a8f5deaa30b..208da1fa722 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
@@ -1 +1 @@
---slave-skip-error=1062
+--slave-skip-errors=1062
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test
index a3c430ef009..6cf3113daf5 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_error.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test
@@ -140,6 +140,7 @@ connection slave;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2;
+show global status like 'slave_skipped_errors';
connection master;
@@ -157,6 +158,7 @@ sync_slave_with_master;
let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
echo $error;
+show global status like 'slave_skipped_errors';
--echo **** We cannot execute a select as there are differences in the
--echo **** behavior between STMT and RBR.
diff --git a/mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt b/mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt
index bc90d5ea6c1..a223f2e04a4 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt
@@ -1 +1 @@
---slave-skip-error=1590
+--slave-skip-errors=1590
diff --git a/mysql-test/suite/rpl/t/rpl_skip_replication.test b/mysql-test/suite/rpl/t/rpl_skip_replication.test
index 806f19b9e86..c57256780a4 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_replication.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_replication.test
@@ -1,377 +1 @@
---source include/have_innodb.inc
---source include/master-slave.inc
-
-connection slave;
-# Test that SUPER is required to change @@replicate_events_marked_for_skip.
-CREATE USER 'nonsuperuser'@'127.0.0.1';
-GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
- SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
-connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,);
-connection nonpriv;
---error ER_SPECIFIC_ACCESS_DENIED_ERROR
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-disconnect nonpriv;
-connection slave;
-DROP USER'nonsuperuser'@'127.0.0.1';
-
-SELECT @@global.replicate_events_marked_for_skip;
---error ER_SLAVE_MUST_STOP
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-SELECT @@global.replicate_events_marked_for_skip;
-STOP SLAVE;
---error ER_GLOBAL_VARIABLE
-SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
-SELECT @@global.replicate_events_marked_for_skip;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-SELECT @@global.replicate_events_marked_for_skip;
-START SLAVE;
-
-connection master;
-SELECT @@skip_replication;
---error ER_LOCAL_VARIABLE
-SET GLOBAL skip_replication=1;
-SELECT @@skip_replication;
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb;
-INSERT INTO t1(a) VALUES (1);
-INSERT INTO t2(a) VALUES (1);
-
-
-# Test that master-side filtering works.
-SET skip_replication=1;
-
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-INSERT INTO t1(a) VALUES (2);
-INSERT INTO t2(a) VALUES (2);
-
-# Inject a rotate event in the binlog stream sent to slave (otherwise we will
-# fail sync_slave_with_master as the last event on the master is not present
-# on the slave).
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-
-sync_slave_with_master;
-connection slave;
-SHOW TABLES;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-connection master;
-DROP TABLE t3;
-
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-sync_slave_with_master;
-
-
-# Test that slave-side filtering works.
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-START SLAVE;
-
-connection master;
-SET skip_replication=1;
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-INSERT INTO t1(a) VALUES (3);
-INSERT INTO t2(a) VALUES (3);
-
-# Inject a rotate event in the binlog stream sent to slave (otherwise we will
-# fail sync_slave_with_master as the last event on the master is not present
-# on the slave).
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-
-sync_slave_with_master;
-connection slave;
-SHOW TABLES;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-connection master;
-DROP TABLE t3;
-
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-
-
-# Test that events with @@skip_replication=1 are not filtered when filtering is
-# not set on slave.
-connection master;
-SET skip_replication=1;
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-INSERT INTO t3(a) VALUES(2);
-sync_slave_with_master;
-connection slave;
-SELECT * FROM t3;
-connection master;
-DROP TABLE t3;
-
-#
-# Test that the slave will preserve the @@skip_replication flag in its
-# own binlog.
-#
-
-TRUNCATE t1;
-sync_slave_with_master;
-connection slave;
-RESET MASTER;
-
-connection master;
-SET skip_replication=0;
-INSERT INTO t1 VALUES (1,0);
-SET skip_replication=1;
-INSERT INTO t1 VALUES (2,0);
-SET skip_replication=0;
-INSERT INTO t1 VALUES (3,0);
-
-sync_slave_with_master;
-connection slave;
-# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have
-# applied all events.
-SELECT * FROM t1 ORDER by a;
-
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-let $SLAVE_DATADIR= `select @@datadir`;
-
-connection master;
-TRUNCATE t1;
-
-# Now apply the slave binlog to the master, to check that both the slave
-# and mysqlbinlog will preserve the @@skip_replication flag.
---exec $MYSQL_BINLOG $SLAVE_DATADIR/slave-bin.000001 > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
---exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
-
-# The master should have all three events.
-SELECT * FROM t1 ORDER by a;
-
-# The slave should be missing event 2, which is marked with the
-# @@skip_replication flag.
-
-connection slave;
-START SLAVE;
-
-connection master;
-sync_slave_with_master;
-
-connection slave;
-SELECT * FROM t1 ORDER by a;
-
-#
-# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication
-# events.
-#
-
-connection master;
-TRUNCATE t1;
-
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-# We will skip two INSERTs (in addition to any skipped due to
-# @@skip_replication). Since from 5.5 every statement is wrapped in
-# BEGIN ... END, we need to skip 6 events for this.
-SET GLOBAL sql_slave_skip_counter=6;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-START SLAVE;
-
-connection master;
-# Need to fix @@binlog_format to get consistent event count.
-SET @old_binlog_format= @@binlog_format;
-SET binlog_format= statement;
-SET skip_replication=0;
-INSERT INTO t1 VALUES (1,5);
-SET skip_replication=1;
-INSERT INTO t1 VALUES (2,5);
-SET skip_replication=0;
-INSERT INTO t1 VALUES (3,5);
-INSERT INTO t1 VALUES (4,5);
-SET binlog_format= @old_binlog_format;
-
-sync_slave_with_master;
-connection slave;
-
-# The slave should have skipped the first three inserts (number 1 and 3 due
-# to @@sql_slave_skip_counter=2, number 2 due to
-# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4
-# should be left.
-SELECT * FROM t1;
-
-
-#
-# Check that BINLOG statement preserves the @@skip_replication flag.
-#
-connection slave;
-# Need row @@binlog_format for BINLOG statements containing row events.
---source include/stop_slave.inc
-SET @old_slave_binlog_format= @@global.binlog_format;
-SET GLOBAL binlog_format= row;
---source include/start_slave.inc
-
-connection master;
-TRUNCATE t1;
-
-SET @old_binlog_format= @@binlog_format;
-SET binlog_format= row;
-# Format description log event.
-BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAA371saA==';
-# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1
-BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
-wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA=';
-# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0
-BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
-wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
-SET binlog_format= @old_binlog_format;
-
-SELECT * FROM t1 ORDER BY a;
-sync_slave_with_master;
-connection slave;
-# Slave should have only the second insert, the first should be ignored due to
-# the @@skip_replication flag.
-SELECT * FROM t1 ORDER by a;
-
---source include/stop_slave.inc
-SET GLOBAL binlog_format= @old_slave_binlog_format;
---source include/start_slave.inc
-
-
-# Test that it is not possible to change @@skip_replication inside a
-# transaction or statement, thereby replicating only parts of statements
-# or transactions.
-connection master;
-SET skip_replication=0;
-
-BEGIN;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=0;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=1;
-ROLLBACK;
-SET skip_replication=1;
-BEGIN;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=0;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=1;
-COMMIT;
-SET autocommit=0;
-INSERT INTO t2(a) VALUES(100);
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=1;
-ROLLBACK;
-SET autocommit=1;
-
-SET skip_replication=1;
---delimiter |
-CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END|
-CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END|
-CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END|
---delimiter ;
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SELECT foo(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SELECT baz(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET @a= foo(1);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET @a= baz(1);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-UPDATE t2 SET b=foo(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-UPDATE t2 SET b=baz(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-INSERT INTO t1 VALUES (101, foo(1));
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-INSERT INTO t1 VALUES (101, baz(0));
-SELECT @@skip_replication;
-CALL bar(0);
-SELECT @@skip_replication;
-CALL bar(1);
-SELECT @@skip_replication;
-DROP FUNCTION foo;
-DROP PROCEDURE bar;
-DROP FUNCTION baz;
-
-
-# Test that master-side filtering happens on the master side, and that
-# slave-side filtering happens on the slave.
-
-# First test that events do not reach the slave when master-side filtering
-# is configured. Do this by replicating first with only the IO thread running
-# and master-side filtering; then change to no filtering and start the SQL
-# thread. This should still skip the events, as master-side filtering
-# means the events never reached the slave.
-connection master;
-SET skip_replication= 0;
-TRUNCATE t1;
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-START SLAVE IO_THREAD;
-connection master;
-SET skip_replication= 1;
-INSERT INTO t1(a) VALUES (1);
-SET skip_replication= 0;
-INSERT INTO t1(a) VALUES (2);
---source include/save_master_pos.inc
-connection slave;
---source include/sync_io_with_master.inc
-STOP SLAVE IO_THREAD;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-connection master;
-sync_slave_with_master;
-connection slave;
-# Now only the second insert of (2) should be visible, as the first was
-# filtered on the master, so even though the SQL thread ran without skipping
-# events, it will never see the event in the first place.
-SELECT * FROM t1;
-
-# Now tests that when slave-side filtering is configured, events _do_ reach
-# the slave.
-connection master;
-SET skip_replication= 0;
-TRUNCATE t1;
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-START SLAVE IO_THREAD;
-connection master;
-SET skip_replication= 1;
-INSERT INTO t1(a) VALUES (1);
-SET skip_replication= 0;
-INSERT INTO t1(a) VALUES (2);
---source include/save_master_pos.inc
-connection slave;
---source include/sync_io_with_master.inc
-STOP SLAVE IO_THREAD;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-connection master;
-sync_slave_with_master;
-connection slave;
-# Now both inserts should be visible. Since filtering was configured to be
-# slave-side, the event is in the relay log, and when the SQL thread ran we
-# had disabled filtering again.
-SELECT * FROM t1 ORDER BY a;
-
-
-# Clean up.
-connection master;
-SET skip_replication=0;
-DROP TABLE t1,t2;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_skip_replication.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
index 6b2886bbd8d..df88d42ed68 100644
--- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
@@ -299,6 +299,39 @@ if ($master_slow_query == $slave_slow_query)
-- echo ### same number of queries in slow log: $master_slow_query
}
+-- echo ********************************************************************
+-- echo **** TRUNCATE the slow log then check whether runtime changes of
+-- echo **** log_slow_slave_statements work without slave restart.
+-- echo ********************************************************************
+
+SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
+SET @@global.log_slow_slave_statements = off;
+TRUNCATE mysql.slow_log;
+
+-- connection master
+
+--disable_warnings
+-- eval $slow_query;
+--enable_warnings
+sync_slave_with_master;
+
+-- connection slave
+
+eval SELECT sql_text FROM mysql.slow_log WHERE sql_text like '$slow_query';
+
+SET @@global.log_slow_slave_statements = on;
+
+-- connection master
+
+--disable_warnings
+-- eval $slow_query;
+--enable_warnings
+sync_slave_with_master;
+
+-- connection slave
+
+eval SELECT sql_text FROM mysql.slow_log WHERE sql_text like '$slow_query';
+
-- connection master
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index c978a145a92..124d98cd29b 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -6,6 +6,8 @@
source include/have_binlog_format_mixed.inc;
source include/master-slave.inc;
+set local sql_mode='';
+set global sql_mode='';
# we need a db != test, where we don't have automatic grants
--disable_warnings
@@ -739,3 +741,4 @@ drop procedure p1;
# Cleanup
sync_slave_with_master;
--source include/rpl_end.inc
+set global sql_mode=default;
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index 82d61d94bd4..b9d637320bb 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
@@ -1,7 +1,6 @@
##########################################
# Change Author: JBM
# Change Date: 2006-05-02
-# Change: Added Order By for NDB testing
##########################################
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test
index 3a947d413bb..6f196005711 100644
--- a/mysql-test/suite/rpl/t/rpl_special_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_special_charset.test
@@ -1,26 +1 @@
-################################################################################
-# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
-# Problem: IO thread fails to connect to master if servers are configured with
-# special character sets like utf16, utf32, ucs2.
-#
-# Analysis: MySQL server does not support few special character sets like
-# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
-# When IO thread is trying to connect to Master, it sets server's character
-# set as client's character set. When Slave server is started with these
-# special character sets, IO thread (a connection to Master) fails because
-# of the above said reason.
-#
-# Fix: If server's character set is not supported as client's character set,
-# then set default's client character set(latin1) as client's character set.
-###############################################################################
---source include/master-slave.inc
-call mtr.add_suppression("'utf16' can not be used as client character set");
-CREATE TABLE t1(i VARCHAR(20));
-INSERT INTO t1 VALUES (0xFFFF);
---sync_slave_with_master
---let diff_tables=master:t1, slave:t1
---source include/diff_tables.inc
-# Cleanup
---connection master
-DROP TABLE t1;
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_special_charset.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
index 592d13e67b0..0a756982047 100644
--- a/mysql-test/suite/rpl/t/rpl_sporadic_master.test
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
@@ -1,26 +1 @@
-# test to see if replication can continue when master sporadically fails on
-# COM_BINLOG_DUMP and additionally limits the number of events per dump
-
-source include/master-slave.inc;
-
-create table t2(n int);
-create table t1(n int not null auto_increment primary key);
-insert into t1 values (NULL),(NULL);
-truncate table t1;
-# We have to use 4 in the following to make this test work with all table types
-insert into t1 values (4),(NULL);
-sync_slave_with_master;
---source include/stop_slave.inc
---source include/start_slave.inc
-connection master;
-insert into t1 values (NULL),(NULL);
-flush logs;
-truncate table t1;
-insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
-sync_slave_with_master;
-select * from t1 ORDER BY n;
-connection master;
-drop table t1,t2;
-sync_slave_with_master;
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_sporadic_master.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 43289428d45..883b367e9f2 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -1,110 +1 @@
-source include/have_ssl_communication.inc;
-source include/master-slave.inc;
-
-# create a user for replication that requires ssl encryption
-connection master;
-grant replication slave on *.* to replssl@localhost require ssl;
-create table t1 (t int auto_increment, KEY(t));
-
-sync_slave_with_master;
-
-# Set slave to use SSL for connection to master
-stop slave;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval change master to
- master_user='replssl',
- master_password='',
- master_ssl=1,
- master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
- master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
- master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
-start slave;
-
-# Switch to master and insert one record, then sync it to slave
-connection master;
-insert into t1 values(1);
-sync_slave_with_master;
-
-# The record should now be on slave
-select * from t1;
-
-# The slave is synced and waiting/reading from master
-# SHOW SLAVE STATUS will show "Waiting for master to send event"
-let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key;
-source include/show_slave_status.inc;
-source include/check_slave_is_running.inc;
-
-# Stop the slave, as reported in bug#21871 it would hang
-STOP SLAVE;
-
-select * from t1;
-
-# Do the same thing a number of times
-disable_query_log;
-disable_result_log;
-# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows
-# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
-# red trees.
-disable_parsing;
-let $i= 100;
-while ($i)
-{
- start slave;
- connection master;
- insert into t1 values (NULL);
- select * from t1; # Some variance
- connection slave;
- select * from t1; # Some variance
- stop slave;
- dec $i;
-}
-enable_parsing;
-START SLAVE;
-enable_query_log;
-enable_result_log;
-connection master;
-# INSERT one more record to make sure
-# the sync has something to do
-insert into t1 values (NULL);
-let $master_count= `select count(*) from t1`;
-
-sync_slave_with_master;
---source include/wait_for_slave_to_start.inc
-source include/show_slave_status.inc;
-source include/check_slave_is_running.inc;
-
-let $slave_count= `select count(*) from t1`;
-
-if ($slave_count != $master_count)
-{
- echo master and slave differed in number of rows;
- echo master: $master_count;
- echo slave: $slave_count;
-
- connection master;
- echo === master ===;
- select count(*) t1;
- select * from t1;
- connection slave;
- echo === slave ===;
- select count(*) t1;
- select * from t1;
- query_vertical show slave status;
-}
-
-connection master;
-drop user replssl@localhost;
-drop table t1;
-sync_slave_with_master;
-
---source include/stop_slave.inc
-CHANGE MASTER TO
- master_user = 'root',
- master_ssl = 0,
- master_ssl_ca = '',
- master_ssl_cert = '',
- master_ssl_key = '';
-
---echo End of 5.0 tests
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_ssl.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test
index f5f63a00033..d994dd21c1d 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl1.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl1.test
@@ -7,6 +7,7 @@ source include/master-slave.inc;
# creating replication user for whom ssl auth is required
# preparing playground
connection master;
+create user replssl@localhost;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
diff --git a/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test b/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test
index 7add76c0ef5..32de2a94cbb 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test
@@ -1,4 +1,3 @@
--- source include/not_ndb_default.inc
-- source include/have_log_bin.inc
-- source include/have_binlog_format_statement.inc
RESET MASTER;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
index bb8c39ca873..016d3ed6090 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
@@ -6,7 +6,6 @@
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
# Change: Split the original test file. This one forces STATEMENT only because
# when in STATEMENT mode, the load_file will issue a warning, whereas
# in RBR or MIXED mode it does not (by lsoares).
diff --git a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
index 5e982644cd9..f72300ee2de 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
@@ -1,101 +1 @@
-#
-# BUG#12400313 / BUG#64503 test case
-#
-#
-# Description
-# -----------
-#
-# This test case starts the slave server with:
-# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
-#
-# Then it issues some queries that will cause the slave to reach
-# relay-log-space-limit. We lock the table so that the SQL thread is
-# not able to purge the log and then we issue some more statements.
-#
-# The purpose is to show that the IO thread will honor the limits
-# while the SQL thread is not able to purge the relay logs, which did
-# not happen before this patch. In addition we assert that while
-# ignoring the limit (SQL thread needs to rotate before purging), the
-# IO thread does not do it in an uncontrolled manner.
-
---source include/have_binlog_format_statement.inc
---source include/have_innodb.inc
---source include/master-slave.inc
-
---disable_query_log
-CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
-
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-
---sync_slave_with_master
-
-# wait for the SQL thread to sleep
---let $show_statement= SHOW PROCESSLIST
---let $field= State
---let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
---source include/wait_show_condition.inc
-
-# now the io thread has set rli->ignore_space_limit
-# lets lock the table so that once the SQL thread awakes
-# it blocks there and does not set rli->ignore_space_limit
-# back to zero
-LOCK TABLE t1 WRITE;
-
-# now issue more statements that will overflow the
-# rli->log_space_limit (in this case ~10K)
---connection master
-
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-
---connection slave
-
-# ASSERT that the IO thread waits for the SQL thread to release some
-# space before continuing
---let $show_statement= SHOW PROCESSLIST
---let $field= State
---let $condition= LIKE 'Waiting for %'
-# before the patch (IO would have transfered everything)
-#--let $condition= = 'Waiting for master to send event'
-# after the patch (now it waits for space to be freed)
-#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
---source include/wait_show_condition.inc
-
-# without the patch we can uncomment the following two lines and
-# watch the IO thread synchronize with the master, thus writing
-# relay logs way over the space limit
-#--connection master
-#--source include/sync_slave_io_with_master.inc
-
-## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
---let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
---let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
---let $assert_text= Assert that relay log space is close to the limit
---let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
---source include/assert.inc
-
-# unlock the table and let SQL thread continue applying events
-UNLOCK TABLES;
-
---connection master
---sync_slave_with_master
---let $diff_tables=master:test.t1,slave:test.t1
---source include/diff_tables.inc
-
---connection master
-DROP TABLE t1;
---enable_query_log
---sync_slave_with_master
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_stm_relay_ign_space.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 074d38ca0c6..9194a1fda63 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -64,7 +64,6 @@ select * from t1;
--source include/check_slave_param.inc
# this should fail right after start
---replace_result 291 MASTER_LOG_POS
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
@@ -107,22 +106,18 @@ eval start slave until master_log_file='$master_log_file', master_log_pos=$maste
--echo ==== Test various error conditions ====
---replace_result 561 MASTER_LOG_POS
--error 1277
start slave until master_log_file='master-bin', master_log_pos=561;
---replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS
--error 1277
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
--error 1277
start slave until master_log_file='master-bin.000001';
--error 1277
start slave until relay_log_file='slave-relay-bin.000002';
---replace_result 561 MASTER_LOG_POS
--error 1277
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
# Warning should be given for second command
start slave sql_thread;
---replace_result 776 MASTER_LOG_POS
start slave until master_log_file='master-bin.000001', master_log_pos=776;
#
diff --git a/mysql-test/suite/rpl/t/rpl_strict_password_validation.test b/mysql-test/suite/rpl/t/rpl_strict_password_validation.test
new file mode 100644
index 00000000000..c4dda1e1269
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_strict_password_validation.test
@@ -0,0 +1,24 @@
+if (!$SIMPLE_PASSWORD_CHECK_SO) {
+ skip No SIMPLE_PASSWORD_CHECK plugin;
+}
+
+--source include/master-slave.inc
+
+
+--connection slave
+install soname "simple_password_check";
+select @@strict_password_validation;
+
+--connection master
+create user foo1 identified by password '11111111111111111111111111111111111111111';
+set password for foo1 = PASSWORD('PLAINtext-password!!99');
+drop user foo1;
+--sync_slave_with_master
+
+--connection slave
+--error ER_OPTION_PREVENTS_STATEMENT
+create user foo1 identified by password '11111111111111111111111111111111111111111';
+
+uninstall plugin simple_password_check;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index 4ba66b5fbf8..cd826c6be1e 100644
--- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
@@ -1,624 +1 @@
-#
-# rpl_switch_stm_row_mixed tests covers
-#
-# - 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
-# definition of MIXED binlog format
-# - correctness of execution
-
-
--- source include/not_ndb_default.inc
--- source include/have_binlog_format_mixed_or_row.inc
--- source include/master-slave.inc
-
-# Since this test generates row-based events in the binary log, the
-# slave SQL thread cannot be in STATEMENT mode to execute this test,
-# so we only execute it for MIXED and ROW as default value of
-# BINLOG_FORMAT.
-
-connection slave;
-
-connection master;
---disable_warnings
-drop database if exists mysqltest1;
-create database mysqltest1;
---enable_warnings
-use mysqltest1;
-
-# Save binlog format
-set @my_binlog_format= @@global.binlog_format;
-
-# play with switching
-set session binlog_format=mixed;
-show session variables like "binlog_format%";
-set session binlog_format=statement;
-show session variables like "binlog_format%";
-set session binlog_format=row;
-show session variables like "binlog_format%";
-
-set global binlog_format=DEFAULT;
-show global variables like "binlog_format%";
-set global binlog_format=MIXED;
-show global variables like "binlog_format%";
-set global binlog_format=STATEMENT;
-show global variables like "binlog_format%";
-set global binlog_format=ROW;
-show global variables like "binlog_format%";
-show session variables like "binlog_format%";
-select @@global.binlog_format, @@session.binlog_format;
-
-CREATE TABLE t1 (a varchar(100));
-
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
-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_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values(concat("for_4_",UUID()));
-insert into t1 select "yesterday_5_";
-
-# verify that temp tables prevent a switch to SBR
-create temporary table tmp(a char(100));
-insert into tmp values("see_6_");
---error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
-set binlog_format=statement;
-insert into t1 select * from tmp;
-drop temporary table tmp;
-
-# Now we go to SBR
-set binlog_format=statement;
-show global variables like "binlog_format%";
-show session variables like "binlog_format%";
-select @@global.binlog_format, @@session.binlog_format;
-set global binlog_format=statement;
-show global variables like "binlog_format%";
-show session variables like "binlog_format%";
-select @@global.binlog_format, @@session.binlog_format;
-
-prepare stmt1 from 'insert into t1 select ?';
-set @string="emergency_7_";
-insert into t1 values("work_8_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values("work_9_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values("for_10_");
-insert into t1 select "yesterday_11_";
-
-# test statement (is not default after wl#3368)
-set binlog_format=statement;
-select @@global.binlog_format, @@session.binlog_format;
-set global binlog_format=statement;
-select @@global.binlog_format, @@session.binlog_format;
-
-prepare stmt1 from 'insert into t1 select ?';
-set @string="emergency_12_";
-insert into t1 values("work_13_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values("work_14_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values("for_15_");
-insert into t1 select "yesterday_16_";
-
-# and now the mixed mode
-
-set global binlog_format=mixed;
-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(),?)';
-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_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values(concat("for_20_",UUID()));
-insert into t1 select "yesterday_21_";
-
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values(concat("for_23_",UUID()));
-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 t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
-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:
---disable_warnings
-insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
---enable_warnings
-
-# inside a stored procedure
-
-delimiter |;
-create procedure foo()
-begin
-insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
-insert into t1 select "yesterday_27_";
-end|
-create procedure foo2()
-begin
-insert into t1 values(concat("emergency_28_",UUID()));
-insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
-set session binlog_format=row; # accepted for stored procs
-insert into t1 values("more work_31_");
-set session binlog_format=mixed;
-end|
-create function foo3() returns bigint unsigned
-begin
- set session binlog_format=row; # rejected for stored funcs
- insert into t1 values("alarm");
- return 100;
-end|
-create procedure foo4(x varchar(100))
-begin
-insert into t1 values(concat("work_250_",x));
-insert into t1 select "yesterday_270_";
-end|
-delimiter ;|
-call foo();
-call foo2();
-call foo4("hello");
-call foo4(UUID());
-call foo4("world");
-
-# test that can't SET in a stored function
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
-select foo3();
-select * from t1 where a="alarm";
-
-# Tests of stored functions/triggers/views for BUG#20930 "Mixed
-# binlogging mode does not work with stored functions, triggers,
-# views"
-
-# Function which calls procedure
-drop function foo3;
-delimiter |;
-create function foo3() returns bigint unsigned
-begin
- insert into t1 values("foo3_32_");
- call foo();
- return 100;
-end|
-delimiter ;|
-insert into t2 select foo3();
-
-prepare stmt1 from 'insert into t2 select foo3()';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# Test if stored function calls stored function which calls procedure
-# which requires row-based.
-
-delimiter |;
-create function foo4() returns bigint unsigned
-begin
- insert into t2 select foo3();
- return 100;
-end|
-delimiter ;|
-select foo4();
-
-prepare stmt1 from 'select foo4()';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# A simple stored function
-delimiter |;
-create function foo5() returns bigint unsigned
-begin
- insert into t2 select UUID();
- return 100;
-end|
-delimiter ;|
-select foo5();
-
-prepare stmt1 from 'select foo5()';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# A simple stored function where UUID() is in the argument
-delimiter |;
-create function foo6(x varchar(100)) returns bigint unsigned
-begin
- insert into t2 select x;
- return 100;
-end|
-delimiter ;|
-select foo6("foo6_1_");
-select foo6(concat("foo6_2_",UUID()));
-
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-
-# Test of views using UUID()
-
-create view v1 as select uuid();
-create table t11 (data varchar(255));
-insert into t11 select * from v1;
-# Test of querying INFORMATION_SCHEMA which parses the view's body,
-# to verify that it binlogs statement-based (is not polluted by
-# the parsing of the view's body).
-insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
-prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# Test of triggers with UUID()
-delimiter |;
-create trigger t11_bi before insert on t11 for each row
-begin
- set NEW.data = concat(NEW.data,UUID());
-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("delay_6_");
-
-# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
-# replicate fine in statement-based ; we test that in mixed mode it
-# works).
-insert delayed into t2 values(rand());
-set @a=2.345;
-insert delayed into t2 values(@a);
-
-# With INSERT DELAYED, rows are written to the binlog after they are
-# written to the table. Therefore, it is not enough to wait until the
-# rows make it to t2 on the master (the rows may not be in the binlog
-# at that time, and may still not be in the binlog when
-# sync_slave_with_master is later called). Instead, we wait until the
-# rows make it to t2 on the slave. We first call
-# sync_slave_with_master, so that we are sure that t2 has been created
-# on the slave.
-sync_slave_with_master;
-let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2;
---source include/wait_condition.inc
-connection master;
-
-# If you want to do manual testing of the mixed mode regarding UDFs (not
-# testable automatically as quite platform- and compiler-dependent),
-# you just need to set the variable below to 1, and to
-# "make udf_example.so" in sql/, and to copy sql/udf_example.so to
-# MYSQL_TEST_DIR/lib/mysql.
-let $you_want_to_test_UDF=0;
-if ($you_want_to_test_UDF)
-{
- CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
- prepare stmt1 from 'insert into t1 select metaphon(?)';
- set @string="emergency_133_";
- insert into t1 values("work_134_");
- execute stmt1 using @string;
- deallocate prepare stmt1;
- prepare stmt1 from 'insert into t1 select ?';
- insert into t1 values(metaphon("work_135_"));
- execute stmt1 using @string;
- deallocate prepare stmt1;
- insert into t1 values(metaphon("for_136_"));
- insert into t1 select "yesterday_137_";
- create table t6 select metaphon("for_138_");
- create table t7 select 1 union select metaphon("for_139_");
- create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3);
- create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
-}
-
-create table t20 select * from t1; # save for comparing later
-create table t21 select * from t2;
-create table t22 select * from t3;
-drop table t1,t2,t3;
-
-# This tests the fix to
-# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog
-# We verify that under the mixed binlog mode, a stored function
-# modifying at least two tables having an auto_increment column,
-# is binlogged row-based. Indeed in statement-based binlogging,
-# only the auto_increment value generated for the first table
-# is recorded in the binlog, the value generated for the 2nd table
-# lacking.
-
-create table t1 (a int primary key auto_increment, b varchar(100));
-create table t2 (a int primary key auto_increment, b varchar(100));
-create table t3 (b varchar(100));
-delimiter |;
-create function f (x varchar(100)) returns int deterministic
-begin
- insert into t1 values(null,x);
- insert into t2 values(null,x);
- return 1;
-end|
-delimiter ;|
-select f("try_41_");
-# Two operations which compensate each other except that their net
-# effect is that they advance the auto_increment counter of t2 on slave:
-sync_slave_with_master;
-use mysqltest1;
-insert into t2 values(2,null),(3,null),(4,null);
-delete from t2 where a>=2;
-
-connection master;
-# this is the call which didn't replicate well
-select f("try_42_");
-sync_slave_with_master;
-
-# now use prepared statement and test again, just to see that the RBB
-# mode isn't set at PREPARE but at EXECUTE.
-
-insert into t2 values(3,null),(4,null);
-delete from t2 where a>=3;
-
-connection master;
-prepare stmt1 from 'select f(?)';
-set @string="try_43_";
-insert into t1 values(null,"try_44_"); # should be SBB
-execute stmt1 using @string; # should be RBB
-deallocate prepare stmt1;
-sync_slave_with_master;
-
-# verify that if only one table has auto_inc, it does not trigger RBB
-# (we'll check in binlog further below)
-
-connection master;
-create table t12 select * from t1; # save for comparing later
-drop table t1;
-create table t1 (a int, b varchar(100), key(a));
-select f("try_45_");
-
-# restore table's key
-create table t13 select * from t1;
-drop table t1;
-create table t1 (a int primary key auto_increment, b varchar(100));
-
-# now test if it's two functions, each of them inserts in one table
-
-drop function f;
-# we need a unique key to have sorting of rows by mysqldump
-create table t14 (unique (a)) select * from t2;
-truncate table t2;
-delimiter |;
-create function f1 (x varchar(100)) returns int deterministic
-begin
- insert into t1 values(null,x);
- return 1;
-end|
-create function f2 (x varchar(100)) returns int deterministic
-begin
- insert into t2 values(null,x);
- return 1;
-end|
-delimiter ;|
-select f1("try_46_"),f2("try_47_");
-
-sync_slave_with_master;
-insert into t2 values(2,null),(3,null),(4,null);
-delete from t2 where a>=2;
-
-connection master;
-# Test with SELECT and INSERT
-select f1("try_48_"),f2("try_49_");
-insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
-sync_slave_with_master;
-
-# verify that if f2 does only read on an auto_inc table, this does not
-# switch to RBB
-connection master;
-drop function f2;
-delimiter |;
-create function f2 (x varchar(100)) returns int deterministic
-begin
- declare y int;
- insert into t1 values(null,x);
- set y = (select count(*) from t2);
- return y;
-end|
-delimiter ;|
-select f1("try_53_"),f2("try_54_");
-sync_slave_with_master;
-
-# And now, a normal statement with a trigger (no stored functions)
-
-connection master;
-drop function f2;
-delimiter |;
-create trigger t1_bi before insert on t1 for each row
-begin
- insert into t2 values(null,"try_55_");
-end|
-delimiter ;|
-insert into t1 values(null,"try_56_");
-# and now remove one auto_increment and verify SBB
-alter table t1 modify a int, drop primary key;
-insert into t1 values(null,"try_57_");
-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 table t16 like t15;
-INSERT INTO t16 SELECT * FROM t15;
-# we'll verify that this one is done RBB
-insert into t16 values("try_65_");
-drop table t15;
-# we'll verify that this one is done SBB
-insert into t16 values("try_66_");
-sync_slave_with_master;
-
-# and now compare:
-
-connection master;
-
-# first check that data on master is sensible
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-select count(*) from t4;
-select count(*) from t5;
-select count(*) from t11;
-select count(*) from t20;
-select count(*) from t21;
-select count(*) from t22;
-select count(*) from t12;
-select count(*) from t13;
-select count(*) from t14;
-select count(*) from t16;
-if ($you_want_to_test_UDF)
-{
- select count(*) from t6;
- select count(*) from t7;
- select count(*) from t8;
- select count(*) from t9;
-}
-
-sync_slave_with_master;
-
-#
-# Bug#20863 If binlog format is changed between update and unlock of
-# tables, wrong binlog
-#
-
-connection master;
-DROP TABLE IF EXISTS t11;
-SET SESSION BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t11 (song VARCHAR(255));
-LOCK TABLES t11 WRITE;
-SET SESSION BINLOG_FORMAT=ROW;
-INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
-SET SESSION BINLOG_FORMAT=STATEMENT;
-INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
-UNLOCK TABLES;
-
---query_vertical SELECT * FROM t11
-sync_slave_with_master;
-USE mysqltest1;
---query_vertical SELECT * FROM t11
-
-connection master;
-DROP TABLE IF EXISTS t12;
-SET SESSION BINLOG_FORMAT=MIXED;
-CREATE TABLE t12 (data LONG);
-LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
-UNLOCK TABLES;
-sync_slave_with_master;
-
-#
-# BUG#28086: SBR of USER() becomes corrupted on slave
-#
-
-connection master;
-
-# Just to get something that is non-trivial, albeit still simple, we
-# stuff the result of USER() and CURRENT_USER() into a variable.
---delimiter $$
-CREATE FUNCTION my_user()
- RETURNS CHAR(64)
-BEGIN
- DECLARE user CHAR(64);
- SELECT USER() INTO user;
- RETURN user;
-END $$
---delimiter ;
-
---delimiter $$
-CREATE FUNCTION my_current_user()
- RETURNS CHAR(64)
-BEGIN
- DECLARE user CHAR(64);
- SELECT CURRENT_USER() INTO user;
- RETURN user;
-END $$
---delimiter ;
-
-DROP TABLE IF EXISTS t13;
-CREATE TABLE t13 (data CHAR(64));
-INSERT INTO t13 VALUES (USER());
-INSERT INTO t13 VALUES (my_user());
-INSERT INTO t13 VALUES (CURRENT_USER());
-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
---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
-
-# Let's compare. Note: If they match test will pass, if they do not match
-# the test will show that the diff statement failed and not reject file
-# will be created. You will need to go to the mysql-test dir and diff
-# the files your self to see what is not matching
-
-diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
-
-connection master;
-
-# Now test that mysqlbinlog works fine on a binlog generated by the
-# mixed mode
-
-# BUG#11312 "DELIMITER is not written to the binary log that causes
-# syntax error" makes that mysqlbinlog will fail if we pass it the
-# text of queries; this forces us to use --base64-output here.
-
-# BUG#20929 "BINLOG command causes invalid free plus assertion
-# failure" makes mysqld segfault when receiving --base64-output
-
-# So I can't enable this piece of test
-# SIGH
-
-if ($enable_when_11312_or_20929_fixed)
-{
---exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
-drop database mysqltest1;
---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
-# the old mysqldump output on slave is the same as what it was on
-# master before restoring on master.
-diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
-}
-
-drop database mysqltest1;
-sync_slave_with_master;
-
-connection master;
-# Restore binlog format setting
-set global binlog_format =@my_binlog_format;
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_switch_stm_row_mixed.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test
index 20b82930aea..ec98a344282 100644
--- a/mysql-test/suite/rpl/t/rpl_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_sync.test
@@ -1,153 +1,2 @@
-########################################################################################
-# This test verifies the options --sync-relay-log-info and --relay-log-recovery by
-# crashing the slave in two different situations:
-# (case-1) - Corrupt the relay log with changes which were not processed by
-# the SQL Thread and crashes it.
-# (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
-#
-# Case 1:
-# 1 - Stops the SQL Thread
-# 2 - Inserts new records into the master.
-# 3 - Corrupts the relay-log.bin* which most likely has such changes.
-# 4 - Crashes the slave
-# 5 - Verifies if the slave is sync with the master which means that the information
-# loss was circumvented by the recovery process.
-#
-# Case 2:
-# 1 - Stops the SQL/IO Threads
-# 2 - Inserts new records into the master.
-# 3 - Corrupts the master.info with wrong coordinates.
-# 4 - Crashes the slave
-# 5 - Verifies if the slave is sync with the master which means that the information
-# loss was circumvented by the recovery process.
-########################################################################################
-
-########################################################################################
-# Configuring the environment
-########################################################################################
---echo =====Configuring the enviroment=======;
---source include/not_embedded.inc
---source include/not_valgrind.inc
---source include/have_debug.inc
---source include/have_innodb.inc
---source include/not_crashrep.inc
---source include/master-slave.inc
-
-call mtr.add_suppression('Attempting backtrace');
-call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
-# Use innodb so we do not get "table should be repaired" issues.
-ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
-flush tables;
-CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
-
-insert into t1(a) values(1);
-insert into t1(a) values(2);
-insert into t1(a) values(3);
-
-########################################################################################
-# Case 1: Corrupt a relay-log.bin*
-########################################################################################
---echo =====Inserting data on the master but without the SQL Thread being running=======;
-sync_slave_with_master;
-
-connection slave;
-let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
---replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
---copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
---source include/stop_slave_sql.inc
-
-connection master;
-insert into t1(a) values(4);
-insert into t1(a) values(5);
-insert into t1(a) values(6);
-
---echo =====Removing relay log files and crashing/recoverying the slave=======;
-connection slave;
---source include/stop_slave_io.inc
-
-let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
-
---let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
-perl;
-$file= $ENV{'FILE_TO_CORRUPT'};
-open(FILE, ">$file") || die "Unable to open $file.";
-truncate(FILE,0);
-print FILE "failure";
-close ($file);
-EOF
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
---error 2013
-FLUSH LOGS;
-
---let $rpl_server_number= 2
---source include/rpl_reconnect.inc
-
---echo =====Dumping and comparing tables=======;
---source include/start_slave.inc
-
-connection master;
-sync_slave_with_master;
-
-let $diff_tables=master:t1,slave:t1;
-source include/diff_tables.inc;
-
-########################################################################################
-# Case 2: Corrupt a master.info
-########################################################################################
---echo =====Corrupting the master.info=======;
-connection slave;
---source include/stop_slave.inc
-
-connection master;
-FLUSH LOGS;
-
-insert into t1(a) values(7);
-insert into t1(a) values(8);
-insert into t1(a) values(9);
-
-connection slave;
-let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
-
---perl
-use strict;
-use warnings;
-my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
-my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
-open(FILE, "<", $src) or die;
-my @content= <FILE>;
-close FILE;
-open(FILE, ">", $dst) or die;
-binmode FILE;
-print FILE @content;
-close FILE;
-EOF
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
---error 2013
-FLUSH LOGS;
-
---let $rpl_server_number= 2
---source include/rpl_reconnect.inc
-
---echo =====Dumping and comparing tables=======;
---source include/start_slave.inc
-
-connection master;
-sync_slave_with_master;
-
-let $diff_tables=master:t1,slave:t1;
-source include/diff_tables.inc;
-
-########################################################################################
-# Clean up
-########################################################################################
---echo =====Clean up=======;
-connection master;
-drop table t1;
-
---remove_file $MYSQLD_SLAVE_DATADIR/master.backup
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_sync.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 786600c480f..1cc975e6ad4 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
@@ -192,7 +192,9 @@ DROP TEMPORARY TABLE t1;
# INSERT INTO t1 VALUES(1);
--echo # The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
+--disable_warnings
INSERT INTO t1 VALUES(uuid()+0);
+--enable_warnings
COMMIT;
source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test b/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test
new file mode 100644
index 00000000000..99a70e011c4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test
@@ -0,0 +1 @@
+--source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mariadb53.test b/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mariadb53.test
new file mode 100644
index 00000000000..058ad017305
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mariadb53.test
@@ -0,0 +1,4 @@
+--let $force_master_mysql56_temporal_format=false;
+--let $force_slave_mysql56_temporal_format=false;
+
+--source rpl_temporal_format_default_to_default.test
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56.test b/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56.test
new file mode 100644
index 00000000000..547b0831cc7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56.test
@@ -0,0 +1,14 @@
+#
+# MariaDB-5.3 fractional temporal types do not store metadata
+# when running with --binlog-format=row, thus can replicate
+# only into a field with exactly the same data type and format.
+#
+# Skip when running with --binlog-format=row.
+# But mixed and statement formats should work without problems.
+#
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+--let $force_master_mysql56_temporal_format=false;
+--let $force_slave_mysql56_temporal_format=true;
+
+--source rpl_temporal_format_default_to_default.test
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56_dst.test b/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56_dst.test
new file mode 100644
index 00000000000..511bdc15184
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_mariadb53_to_mysql56_dst.test
@@ -0,0 +1,37 @@
+#
+# MDEV-12672 Replicated TIMESTAMP fields given wrong value near DST change
+#
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+connection slave;
+set global time_zone='Europe/Moscow';
+set time_zone='UTC';
+stop slave;
+start slave;
+
+connection master;
+set global mysql56_temporal_format=false;
+set global time_zone='Europe/Moscow';
+set time_zone='UTC';
+
+create table t1 (pk int primary key, t timestamp not null);
+set timestamp = 1288477526;
+insert into t1 values (1,null);
+set timestamp = 1288481126;
+insert into t1 values (2,null);
+
+sync_slave_with_master;
+
+select pk, t, unix_timestamp(t) from t1;
+set time_zone=default;
+select pk, t, unix_timestamp(t) from t1;
+
+set global time_zone=default;
+
+connection master;
+drop table t1;
+set global time_zone=default;
+set global mysql56_temporal_format=default;
+
+source include/rpl_end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mariadb53.test b/mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mariadb53.test
new file mode 100644
index 00000000000..dbee9f05d0a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mariadb53.test
@@ -0,0 +1,4 @@
+--let $force_master_mysql56_temporal_format=true;
+--let $force_slave_mysql56_temporal_format=false;
+
+--source rpl_temporal_format_default_to_default.test
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mysql56.test b/mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mysql56.test
new file mode 100644
index 00000000000..9c7994b67de
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_mysql56_to_mysql56.test
@@ -0,0 +1,4 @@
+--let $force_master_mysql56_temporal_format=true;
+--let $force_slave_mysql56_temporal_format=true;
+
+--source rpl_temporal_format_default_to_default.test
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb.test b/mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb.test
index 46c51a5e465..efbff9345d4 100644
--- a/mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb.test
+++ b/mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb.test
@@ -1,5 +1,12 @@
--source include/master-slave.inc
+if ($force_slave_mysql56_temporal_format)
+{
+ connection slave;
+ eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
+ connection master;
+}
+
--echo #
--echo # Testing replication from MariaDB-10.0 master
@@ -22,6 +29,7 @@ SHOW CREATE TABLE mysql050614_temporal0;
SHOW CREATE TABLE mysql050614_temporal1;
connection slave;
+SELECT @@mysql56_temporal_format;
SET TIME_ZONE='+00:00';
CREATE TABLE mysql050614_temporal0 (a time(0), b datetime(0), c timestamp(0)) engine=myisam;
CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) engine=myisam;
@@ -29,11 +37,16 @@ CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) en
connection master;
INSERT INTO mysql050614_temporal0 VALUES ('00:00:02','2001-01-01 00:00:02','2001-01-01 00:00:02');
INSERT INTO mysql050614_temporal1 VALUES ('00:00:02.1','2001-01-01 00:00:02.2','2001-01-01 00:00:02.3');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
sync_slave_with_master;
connection slave;
SELECT * FROM mysql050614_temporal0;
SELECT * FROM mysql050614_temporal1;
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
+SET @@global.mysql56_temporal_format=DEFAULT;
connection master;
DROP TABLE mysql050614_temporal0;
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb53.test b/mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb53.test
new file mode 100644
index 00000000000..435dad57c27
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_mysql56_to_mariadb53.test
@@ -0,0 +1,2 @@
+--let $force_slave_mysql56_temporal_format=false;
+--source rpl_temporal_mysql56_to_mariadb.test
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
index bea6332963e..4a8994d1878 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
@@ -1,3 +1,2 @@
---source include/not_ndb_default.inc
let $engine=MyISAM;
--source extra/rpl_tests/rpl_truncate.test
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
index 093cf56a316..fbedaed87c1 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
@@ -1,4 +1,3 @@
--source include/have_innodb.inc
---source include/not_ndb_default.inc
let $engine=InnoDB;
--source extra/rpl_tests/rpl_truncate.test
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test
index 59d75dd47f5..4dbfc27d088 100644
--- a/mysql-test/suite/rpl/t/rpl_typeconv.test
+++ b/mysql-test/suite/rpl/t/rpl_typeconv.test
@@ -1,72 +1 @@
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-connection slave;
-set @saved_slave_type_conversions = @@global.slave_type_conversions;
-CREATE TABLE type_conversions (
- TestNo INT AUTO_INCREMENT PRIMARY KEY,
- Source TEXT,
- Target TEXT,
- Flags TEXT,
- On_Master TEXT,
- On_Slave TEXT,
- Expected TEXT,
- Compare INT,
- Error TEXT);
-
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
-SELECT @@global.slave_type_conversions;
---error ER_WRONG_VALUE_FOR_VAR
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT';
-SELECT @@global.slave_type_conversions;
-
-# Checking strict interpretation of type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
-source extra/rpl_tests/type_conversions.test;
-
-# Checking lossy integer type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
-source extra/rpl_tests/type_conversions.test;
-
-# Checking non-lossy integer type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
-source extra/rpl_tests/type_conversions.test;
-
-# Checking all type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
-source extra/rpl_tests/type_conversions.test;
-
-connection slave;
---echo **** Result of conversions ****
-disable_query_log;
-SELECT RPAD(Source, 15, ' ') AS Source_Type,
- RPAD(Target, 15, ' ') AS Target_Type,
- RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
- IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
- IF(Compare, '<Correct value>',
- CONCAT("'", On_Slave, "' != '", Expected, "'")))
- AS Value_On_Slave
- FROM type_conversions;
-enable_query_log;
-DROP TABLE type_conversions;
-
-call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
-
-connection master;
-DROP TABLE t1;
-sync_slave_with_master;
-
-set global slave_type_conversions = @saved_slave_type_conversions;
-
---source include/rpl_end.inc
+--source extra/rpl_tests/rpl_typeconv.inc
diff --git a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test
new file mode 100644
index 00000000000..e81e7c0d714
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test
@@ -0,0 +1,163 @@
+--source include/master-slave.inc
+
+--echo *** MDEV-9383: Server fails to read master.info after upgrade 10.0 -> 10.1 ***
+
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=CURRENT_POS;
+--let $datadir= `SELECT @@datadir`
+
+--let $rpl_server_number= 2
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master.info
+--copy_file $MYSQL_TEST_DIR/std_data/bad_master.info $datadir/master.info
+
+--let $rpl_server_number= 2
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+--connection master
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+--source include/save_master_gtid.inc
+
+--connection slave
+# Fix the port after we replaced master.info.
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1;
+
+--source include/stop_slave.inc
+
+--let $rpl_server_number= 2
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master.info
+--copy_file $MYSQL_TEST_DIR/std_data/bad2_master.info $datadir/master.info
+
+--let $rpl_server_number= 2
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+--connection master
+INSERT INTO t1 VALUES (2);
+--source include/save_master_gtid.inc
+
+--connection slave
+# Fix the port after we replaced master.info.
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+--source include/stop_slave.inc
+
+--let $rpl_server_number= 2
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master.info
+--copy_file $MYSQL_TEST_DIR/std_data/bad3_master.info $datadir/master.info
+
+--let $rpl_server_number= 2
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+--connection master
+INSERT INTO t1 VALUES (3);
+--source include/save_master_gtid.inc
+
+--connection slave
+# Fix the port after we replaced master.info.
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+--source include/stop_slave.inc
+
+--let $rpl_server_number= 2
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master.info
+--copy_file $MYSQL_TEST_DIR/std_data/bad4_master.info $datadir/master.info
+
+--let $rpl_server_number= 2
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+--connection master
+INSERT INTO t1 VALUES (4);
+--source include/save_master_gtid.inc
+
+--connection slave
+# Fix the port after we replaced master.info.
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+--source include/stop_slave.inc
+
+--let $rpl_server_number= 2
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master.info
+--copy_file $MYSQL_TEST_DIR/std_data/bad5_master.info $datadir/master.info
+
+--let $rpl_server_number= 2
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+--connection master
+INSERT INTO t1 VALUES (5);
+--source include/save_master_gtid.inc
+
+--connection slave
+# Fix the port after we replaced master.info.
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+--source include/stop_slave.inc
+
+--let $rpl_server_number= 2
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master.info
+--copy_file $MYSQL_TEST_DIR/std_data/bad6_master.info $datadir/master.info
+
+--let $rpl_server_number= 2
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+--connection master
+INSERT INTO t1 VALUES (6);
+--source include/save_master_gtid.inc
+
+--connection slave
+# Fix the port after we replaced master.info.
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test
index ca90054da2a..246e595d265 100644
--- a/mysql-test/suite/rpl/t/rpl_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_variables.test
@@ -119,6 +119,30 @@ SET @@global.init_slave = 'SELECT 1';
--echo [on master]
connection master;
+# checking values of read-only variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@pid_file, @@datadir;
+--echo **** Relay log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+--echo **** Binary log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+
+--echo [on slave]
+connection slave;
+# checking values of read-only variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@pid_file, @@datadir;
+--echo **** Relay log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+--echo **** Binary log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+
+--echo [on master]
+connection master;
# Tables where everything happens.
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
diff --git a/mysql-test/suite/rpl/t/rpl_view_debug.test b/mysql-test/suite/rpl/t/rpl_view_debug.test
new file mode 100644
index 00000000000..a00b6733dea
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_view_debug.test
@@ -0,0 +1,34 @@
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-6409 CREATE VIEW replication problem if error occurs in mysql_register_view
+--echo #
+--echo # Check the bug where if an error occurs in mysql_register_view the view
+--echo # is still replicated to the slave
+--echo #
+connection master;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1 as select a from t1;
+insert into v1 values (2);
+select * from v1 order by a;
+sync_slave_with_master;
+
+# view already has to be on slave
+show tables;
+connection master;
+set @@debug_dbug="d,simulate_register_view_failure";
+
+--error ER_OUT_OF_RESOURCES
+CREATE VIEW v2 as SELECT * FROM t1;
+
+show tables;
+sync_slave_with_master;
+show tables;
+
+connection master;
+DROP VIEW IF EXISTS v1;
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/temporal_row-9560-master.opt b/mysql-test/suite/rpl/t/temporal_row-9560-master.opt
new file mode 100644
index 00000000000..07c4494e8b6
--- /dev/null
+++ b/mysql-test/suite/rpl/t/temporal_row-9560-master.opt
@@ -0,0 +1 @@
+--disable-mysql56-temporal-format
diff --git a/mysql-test/suite/rpl/t/temporal_row-9560.combinations b/mysql-test/suite/rpl/t/temporal_row-9560.combinations
new file mode 100644
index 00000000000..b1c360f8615
--- /dev/null
+++ b/mysql-test/suite/rpl/t/temporal_row-9560.combinations
@@ -0,0 +1,6 @@
+[old2old]
+--disable-mysql56-temporal-format
+
+[old2new]
+--enable-mysql56-temporal-format
+
diff --git a/mysql-test/suite/rpl/t/temporal_row-9560.test b/mysql-test/suite/rpl/t/temporal_row-9560.test
new file mode 100644
index 00000000000..00fb59bc088
--- /dev/null
+++ b/mysql-test/suite/rpl/t/temporal_row-9560.test
@@ -0,0 +1,20 @@
+#
+# MDEV-9560 Mariadb 10.1 Crashes when replicating from 10.0
+#
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+select @@mysql56_temporal_format;
+create table t1 (ts timestamp(3), t time(3), dt datetime(3));
+insert into t1 values ('2016-02-15 12:50:06.123', '12:50:06.123', '2016-02-15 12:50:06.123');
+
+sync_slave_with_master;
+
+select @@mysql56_temporal_format;
+select * from t1;
+
+connection master;
+drop table t1;
+
+source include/rpl_end.inc;
+
diff --git a/mysql-test/suite/storage_engine/col_opt_not_null.result b/mysql-test/suite/storage_engine/col_opt_not_null.result
index 246b7dfc5c0..7c78521d5d1 100644
--- a/mysql-test/suite/storage_engine/col_opt_not_null.result
+++ b/mysql-test/suite/storage_engine/col_opt_not_null.result
@@ -1482,7 +1482,15 @@ r1_1 0.9
r1_1 0.9
r1_1 0.9
ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0);
-ERROR 42000: Display width out of range for 'd0_0' (max = 255)
+# ERROR: Statement succeeded (expected results: ER_TOO_BIG_DISPLAYWIDTH)
+# ------------ UNEXPECTED RESULT ------------
+# [ ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) ]
+# The statement|command succeeded unexpectedly.
+# ALTER TABLE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1);
ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35);
diff --git a/mysql-test/suite/storage_engine/col_opt_null.result b/mysql-test/suite/storage_engine/col_opt_null.result
index fbcde865d11..f2f80987945 100644
--- a/mysql-test/suite/storage_engine/col_opt_null.result
+++ b/mysql-test/suite/storage_engine/col_opt_null.result
@@ -1436,7 +1436,15 @@ r1_1 0.9
r1_1 0.9
r1_1 0.9
ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0);
-ERROR 42000: Display width out of range for 'd0_0' (max = 255)
+# ERROR: Statement succeeded (expected results: ER_TOO_BIG_DISPLAYWIDTH)
+# ------------ UNEXPECTED RESULT ------------
+# [ ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) ]
+# The statement|command succeeded unexpectedly.
+# ALTER TABLE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1);
ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35);
diff --git a/mysql-test/suite/storage_engine/col_opt_unsigned.result b/mysql-test/suite/storage_engine/col_opt_unsigned.result
index 7b5274525ce..9a44e48127c 100644
--- a/mysql-test/suite/storage_engine/col_opt_unsigned.result
+++ b/mysql-test/suite/storage_engine/col_opt_unsigned.result
@@ -451,7 +451,15 @@ r1_1 0.9
r1_1 0.9
r1_1 0.9
ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0);
-ERROR 42000: Display width out of range for 'd0_0' (max = 255)
+# ERROR: Statement succeeded (expected results: ER_TOO_BIG_DISPLAYWIDTH)
+# ------------ UNEXPECTED RESULT ------------
+# [ ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) ]
+# The statement|command succeeded unexpectedly.
+# ALTER TABLE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1);
ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35);
diff --git a/mysql-test/suite/storage_engine/col_opt_zerofill.result b/mysql-test/suite/storage_engine/col_opt_zerofill.result
index a35ce4bfe66..fd16bd5cf74 100644
--- a/mysql-test/suite/storage_engine/col_opt_zerofill.result
+++ b/mysql-test/suite/storage_engine/col_opt_zerofill.result
@@ -447,7 +447,15 @@ r1_1 0.9
r1_1 0.9
r1_1 0.9
ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0);
-ERROR 42000: Display width out of range for 'd0_0' (max = 255)
+# ERROR: Statement succeeded (expected results: ER_TOO_BIG_DISPLAYWIDTH)
+# ------------ UNEXPECTED RESULT ------------
+# [ ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) ]
+# The statement|command succeeded unexpectedly.
+# ALTER TABLE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1);
ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35);
diff --git a/mysql-test/suite/storage_engine/foreign_keys.test b/mysql-test/suite/storage_engine/foreign_keys.test
index cbadc4c950d..4991862685f 100644
--- a/mysql-test/suite/storage_engine/foreign_keys.test
+++ b/mysql-test/suite/storage_engine/foreign_keys.test
@@ -77,10 +77,10 @@ if (!$mysql_errname)
--sorted_result
SELECT a,b FROM t2;
- --let $error_codes = ER_ROW_IS_REFERENCED
+ --let $error_codes = ER_ROW_IS_REFERENCED_2
DROP TABLE t1;
--source check_errors.inc
- if ($mysql_errname != ER_ROW_IS_REFERENCED)
+ if ($mysql_errname != ER_ROW_IS_REFERENCED_2)
{
--let $functionality = Foreign keys
--source unexpected_result.inc
diff --git a/mysql-test/suite/storage_engine/select.result b/mysql-test/suite/storage_engine/select.result
index 015ed80b771..9bd36cffc27 100644
--- a/mysql-test/suite/storage_engine/select.result
+++ b/mysql-test/suite/storage_engine/select.result
@@ -68,7 +68,8 @@ a
SELECT FOUND_ROWS();
FOUND_ROWS()
3
-SET GLOBAL query_cache_size = 1024*1024;
+SET GLOBAL query_cache_type = ON;
+SET query_cache_type = ON;
SELECT SQL_CACHE * FROM t1, t2;
a b a b
1 z 1 z
@@ -89,7 +90,7 @@ a b a b
200 bar 100 foobar
200 bar 200 bar
200 bar 200 bar
-SET GLOBAL query_cache_size = 0;
+SET GLOBAL query_cache_type = DEFAULT;
SELECT a+10 AS field1, CONCAT(b,':',b) AS field2 FROM t1
WHERE b > 'b' AND a IS NOT NULL
GROUP BY 2 DESC, field1 ASC
diff --git a/mysql-test/suite/storage_engine/select.test b/mysql-test/suite/storage_engine/select.test
index 34cfd99d344..9b4e1784f47 100644
--- a/mysql-test/suite/storage_engine/select.test
+++ b/mysql-test/suite/storage_engine/select.test
@@ -45,11 +45,11 @@ SELECT SQL_BIG_RESULT SQL_CALC_FOUND_ROWS DISTINCT(t2.a)
FROM t1 t1_1, t2, t1 t1_2;
SELECT FOUND_ROWS();
-let $query_cache = `SELECT @@query_cache_size`;
-SET GLOBAL query_cache_size = 1024*1024;
+SET GLOBAL query_cache_type = ON;
+SET query_cache_type = ON;
--sorted_result
SELECT SQL_CACHE * FROM t1, t2;
-eval SET GLOBAL query_cache_size = $query_cache;
+SET GLOBAL query_cache_type = DEFAULT;
# Combination of main clauses
diff --git a/mysql-test/suite/storage_engine/type_char_indexes.result b/mysql-test/suite/storage_engine/type_char_indexes.result
index 33594e2581f..5be07bdf53f 100644
--- a/mysql-test/suite/storage_engine/type_char_indexes.result
+++ b/mysql-test/suite/storage_engine/type_char_indexes.result
@@ -96,6 +96,8 @@ varchar1b 2
varchar2b 1
varchar3b 1
SET SESSION optimizer_switch = 'engine_condition_pushdown=on';
+Warnings:
+Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release.
EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
id select_type table type possible_keys key key_len ref rows Extra
# # # range c_v c_v # # # Using index condition
diff --git a/mysql-test/suite/storage_engine/type_float.result b/mysql-test/suite/storage_engine/type_float.result
index 5cd76673a3c..ff03bd3b3f2 100644
--- a/mysql-test/suite/storage_engine/type_float.result
+++ b/mysql-test/suite/storage_engine/type_float.result
@@ -278,7 +278,15 @@ r1_1 0.9
r1_1 0.9
r1_1 0.9
ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0);
-ERROR 42000: Display width out of range for 'd0_0' (max = 255)
+# ERROR: Statement succeeded (expected results: ER_TOO_BIG_DISPLAYWIDTH)
+# ------------ UNEXPECTED RESULT ------------
+# [ ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) ]
+# The statement|command succeeded unexpectedly.
+# ALTER TABLE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1);
ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35);
diff --git a/mysql-test/suite/storage_engine/type_spatial.result b/mysql-test/suite/storage_engine/type_spatial.result
index 71211bd2057..cab1942153f 100644
--- a/mysql-test/suite/storage_engine/type_spatial.result
+++ b/mysql-test/suite/storage_engine/type_spatial.result
@@ -412,12 +412,12 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
-120 120 1 1 0 1 0 1 1 0
+120 120 1 1 0 1 0 0 1 0
120 121 0 0 1 0 0 0 1 0
120 122 NULL NULL NULL NULL NULL NULL NULL NULL
120 123 NULL NULL NULL NULL NULL NULL NULL NULL
121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 1 1 0
+121 121 1 1 0 1 0 0 1 0
121 122 NULL NULL NULL NULL NULL NULL NULL NULL
121 123 NULL NULL NULL NULL NULL NULL NULL NULL
122 120 NULL NULL NULL NULL NULL NULL NULL NULL
diff --git a/mysql-test/suite/storage_engine/type_spatial_indexes.result b/mysql-test/suite/storage_engine/type_spatial_indexes.result
index b2e00463606..f608366c217 100644
--- a/mysql-test/suite/storage_engine/type_spatial_indexes.result
+++ b/mysql-test/suite/storage_engine/type_spatial_indexes.result
@@ -412,12 +412,12 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
-120 120 1 1 0 1 0 1 1 0
+120 120 1 1 0 1 0 0 1 0
120 121 0 0 1 0 0 0 1 0
120 122 NULL NULL NULL NULL NULL NULL NULL NULL
120 123 NULL NULL NULL NULL NULL NULL NULL NULL
121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 1 1 0
+121 121 1 1 0 1 0 0 1 0
121 122 NULL NULL NULL NULL NULL NULL NULL NULL
121 123 NULL NULL NULL NULL NULL NULL NULL NULL
122 120 NULL NULL NULL NULL NULL NULL NULL NULL
@@ -1112,12 +1112,12 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
-120 120 1 1 0 1 0 1 1 0
+120 120 1 1 0 1 0 0 1 0
120 121 0 0 1 0 0 0 1 0
120 122 NULL NULL NULL NULL NULL NULL NULL NULL
120 123 NULL NULL NULL NULL NULL NULL NULL NULL
121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 1 1 0
+121 121 1 1 0 1 0 0 1 0
121 122 NULL NULL NULL NULL NULL NULL NULL NULL
121 123 NULL NULL NULL NULL NULL NULL NULL NULL
122 120 NULL NULL NULL NULL NULL NULL NULL NULL
diff --git a/mysql-test/suite/stress/include/ddl7.inc b/mysql-test/suite/stress/include/ddl7.inc
index 76ba8066c66..00308a1a5d0 100644
--- a/mysql-test/suite/stress/include/ddl7.inc
+++ b/mysql-test/suite/stress/include/ddl7.inc
@@ -65,13 +65,11 @@ while ($run)
}
eval $drop_index;
eval $insert_record;
- # NDB: ER_DUP_UNIQUE, others: ER_DUP_ENTRY
- --error 0,ER_DUP_ENTRY,ER_DUP_UNIQUE
+ --error 0,ER_DUP_ENTRY
eval $create_index;
if (!$mysql_errno)
{
--echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
- --echo # Error: or ER_DUP_UNIQUE (NDB only)
--echo # abort
exit;
}
diff --git a/mysql-test/suite/sys_vars/disabled.def b/mysql-test/suite/sys_vars/disabled.def
index 758215208de..e4a2699f031 100644
--- a/mysql-test/suite/sys_vars/disabled.def
+++ b/mysql-test/suite/sys_vars/disabled.def
@@ -11,4 +11,4 @@
##############################################################################
innodb_flush_checkpoint_debug_basic: removed from XtraDB-26.0
-table_open_cache_instances_basic: no such variable in MariaDB
+all_vars: obsolete, see sysvars_* tests
diff --git a/mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc b/mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc
new file mode 100644
index 00000000000..58d6ce2deb2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc
@@ -0,0 +1,55 @@
+# ==== Usage ====
+# [--let $rpl_debug=1]
+# --let $rpl_log_var_name= log_bin_basename|relay_log_basename|...
+# --source suite/sys_vars/inc/bin_relay_log_basename_index.inc
+#
+# $rpl_log_var_name
+# The name of the variable to test, i.e., one of:
+# - log_bin_basename
+# - relay_log_basename
+# - log_bin_index
+# - relay_log_index
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+if ($rpl_debug)
+{
+ --echo Testing variable named: $rpl_log_var_name
+}
+
+--let $basename= `SELECT @@global.$rpl_log_var_name`
+
+#
+# Assert that the variable is indeed only global
+#
+--replace_result $basename REPLACED
+--eval select @@global.$rpl_log_var_name
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+--eval select @@session.$rpl_log_var_name
+
+#
+# Assert that it is retrievable
+#
+--replace_result $basename REPLACED
+--eval show global variables like '$rpl_log_var_name'
+
+--replace_result $basename REPLACED
+--eval show session variables like '$rpl_log_var_name'
+
+--replace_result $basename REPLACED
+--eval select * from information_schema.global_variables where variable_name='$rpl_log_var_name'
+
+--replace_result $basename REPLACED
+--eval select * from information_schema.session_variables where variable_name='$rpl_log_var_name'
+
+#
+# Assert it is read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+--eval set global $rpl_log_var_name=1
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+--eval set session $rpl_log_var_name=1
+
diff --git a/mysql-test/suite/sys_vars/inc/collation_basic.inc b/mysql-test/suite/sys_vars/inc/collation_basic.inc
index be8ae36eeb8..14b9ae4af2a 100644
--- a/mysql-test/suite/sys_vars/inc/collation_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/collation_basic.inc
@@ -152,6 +152,8 @@ eval SET $collation_variable = utf8_esperanto_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_hungarian_ci;
eval SELECT $collation_variable;
+eval SET $collation_variable = utf8_thai_520_w2;
+eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_bin;
diff --git a/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
new file mode 100644
index 00000000000..1fea4ca5bb9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
@@ -0,0 +1,112 @@
+CREATE TABLE t1 (a TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+if (`SELECT @@explicit_defaults_for_timestamp=0`)
+{
+ --error ER_INVALID_DEFAULT
+ CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
+}
+
+if (`SELECT @@explicit_defaults_for_timestamp=1`)
+{
+ CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
+ SHOW CREATE TABLE t1;
+ DROP TABLE t1;
+}
+
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT NULL);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a TIMESTAMP) AS SELECT 1 AS i;
+SHOW CREATE TABLE t1;
+CREATE TABLE t2 (b TIMESTAMP) AS SELECT a FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+ALTER TABLE t1 ADD b TIMESTAMP;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-10802 TIMESTAMP NOT NULL field with explicit_defaults_for_timestamp and NO_ZERO_DATE shouldn't throw error
+--echo #
+
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+SET sql_mode='ANSI,NO_ZERO_DATE';
+CREATE TABLE t1 (a TIMESTAMP NOT NULL);
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+SET timestamp=DEFAULT;
diff --git a/mysql-test/suite/sys_vars/inc/sysvars_server.inc b/mysql-test/suite/sys_vars/inc/sysvars_server.inc
new file mode 100644
index 00000000000..cb06b40f8c9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/sysvars_server.inc
@@ -0,0 +1,69 @@
+--source include/word_size.inc
+--vertical_results
+
+# need stable timestamp, because its current value is printed below
+set time_zone='+00:00';
+set timestamp=unix_timestamp('2014-09-01 13:40:23');
+# ditto
+set pseudo_thread_id=10;
+# to show session != global, and doesn't affect global_value_origin
+set sql_mode=ansi_quotes;
+# global_value_origin=SQL
+set global div_precision_increment=5;
+
+--replace_regex /^\/\S+/PATH/
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+select * from information_schema.system_variables
+ where variable_name not like 'aria%' and
+ variable_name not like 'debug%' and
+ variable_name not like 'wsrep%' and
+ variable_name not in (
+ 'have_openssl',
+ 'have_symlink',
+ 'hostname',
+ 'large_files_support', 'log_tc_size',
+ 'lower_case_file_system',
+ 'lower_case_table_names',
+ 'open_files_limit',
+ 'rand_seed1',
+ 'rand_seed2',
+ 'system_time_zone',
+ 'version_comment',
+ 'version_compile_machine', 'version_compile_os',
+ 'version_malloc_library', 'version_ssl_library', 'version'
+ )
+ order by variable_name;
+
+# now various metadata but no values, for variables where
+# values change often
+select VARIABLE_NAME, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT,
+ NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE,
+ ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT
+ from information_schema.system_variables
+ where variable_name in (
+ 'have_openssl',
+ 'have_symlink',
+ 'hostname',
+ 'large_files_support',
+ 'lower_case_file_system',
+ 'lower_case_table_names',
+ 'open_files_limit',
+ 'rand_seed1',
+ 'rand_seed2',
+ 'system_time_zone',
+ 'version_comment',
+ 'version_compile_machine', 'version_compile_os',
+ 'version_malloc_library', 'version_ssl_library', 'version'
+ )
+ order by variable_name;
+
+# yet less data: no values, no blocks size, no min/max value.
+select VARIABLE_NAME, GLOBAL_VALUE_ORIGIN, VARIABLE_SCOPE, VARIABLE_TYPE,
+ VARIABLE_COMMENT, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT
+ from information_schema.system_variables
+ where variable_name in (
+ 'log_tc_size'
+ )
+ order by variable_name;
+
+set global div_precision_increment=default;
diff --git a/mysql-test/suite/sys_vars/inc/sysvars_server.opt b/mysql-test/suite/sys_vars/inc/sysvars_server.opt
new file mode 100644
index 00000000000..850203a1a5e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/sysvars_server.opt
@@ -0,0 +1 @@
+--auto-increment-increment=1 --loose-thread-pool-size=4
diff --git a/mysql-test/suite/sys_vars/r/aria_encrypt_tables_basic.result b/mysql-test/suite/sys_vars/r/aria_encrypt_tables_basic.result
new file mode 100644
index 00000000000..bf40f534bd6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_encrypt_tables_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.aria_encrypt_tables;
+select @@global.aria_encrypt_tables;
+@@global.aria_encrypt_tables
+0
+select @@session.aria_encrypt_tables;
+ERROR HY000: Variable 'aria_encrypt_tables' is a GLOBAL variable
+show global variables like 'aria_encrypt_tables';
+Variable_name Value
+aria_encrypt_tables OFF
+show session variables like 'aria_encrypt_tables';
+Variable_name Value
+aria_encrypt_tables OFF
+select * from information_schema.global_variables
+where variable_name='aria_encrypt_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_ENCRYPT_TABLES OFF
+select * from information_schema.session_variables
+where variable_name='aria_encrypt_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_ENCRYPT_TABLES OFF
+set global aria_encrypt_tables=ON;
+select @@global.aria_encrypt_tables;
+@@global.aria_encrypt_tables
+1
+set global aria_encrypt_tables=OFF;
+select @@global.aria_encrypt_tables;
+@@global.aria_encrypt_tables
+0
+set global aria_encrypt_tables=1;
+select @@global.aria_encrypt_tables;
+@@global.aria_encrypt_tables
+1
+set session aria_encrypt_tables=1;
+ERROR HY000: Variable 'aria_encrypt_tables' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_encrypt_tables=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_encrypt_tables'
+set global aria_encrypt_tables=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_encrypt_tables'
+set global aria_encrypt_tables="foo";
+ERROR 42000: Variable 'aria_encrypt_tables' can't be set to the value of 'foo'
+SET @@global.aria_encrypt_tables = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/back_log_basic.result b/mysql-test/suite/sys_vars/r/back_log_basic.result
index d68e72a8a4a..0940ebeef8c 100644
--- a/mysql-test/suite/sys_vars/r/back_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/back_log_basic.result
@@ -1,20 +1,20 @@
select @@global.back_log;
@@global.back_log
-150
+80
select @@session.back_log;
ERROR HY000: Variable 'back_log' is a GLOBAL variable
show global variables like 'back_log';
Variable_name Value
-back_log 150
+back_log 80
show session variables like 'back_log';
Variable_name Value
-back_log 150
+back_log 80
select * from information_schema.global_variables where variable_name='back_log';
VARIABLE_NAME VARIABLE_VALUE
-BACK_LOG 150
+BACK_LOG 80
select * from information_schema.session_variables where variable_name='back_log';
VARIABLE_NAME VARIABLE_VALUE
-BACK_LOG 150
+BACK_LOG 80
set global back_log=1;
ERROR HY000: Variable 'back_log' is a read only variable
set session back_log=1;
diff --git a/mysql-test/suite/sys_vars/r/binlog_row_image_basic.result b/mysql-test/suite/sys_vars/r/binlog_row_image_basic.result
new file mode 100644
index 00000000000..8a1aae216bb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_row_image_basic.result
@@ -0,0 +1,100 @@
+SELECT @@GLOBAL.binlog_row_image;
+@@GLOBAL.binlog_row_image
+FULL
+SELECT @@SESSION.binlog_row_image;
+@@SESSION.binlog_row_image
+FULL
+FULL Expected
+'#---------------------BS_STVARS_002_01----------------------#'
+SET @start_value= @@global.binlog_row_image;
+SELECT COUNT(@@GLOBAL.binlog_row_image);
+COUNT(@@GLOBAL.binlog_row_image)
+1
+1 Expected
+SELECT COUNT(@@SESSION.binlog_row_image);
+COUNT(@@SESSION.binlog_row_image)
+1
+1 Expected
+'#---------------------BS_STVARS_002_02----------------------#'
+SET @@GLOBAL.binlog_row_image=0;
+SELECT @@GLOBAL.binlog_row_image;
+@@GLOBAL.binlog_row_image
+MINIMAL
+MINIMAL Expected
+SET @@SESSION.binlog_row_image=0;
+SELECT @@SESSION.binlog_row_image;
+@@SESSION.binlog_row_image
+MINIMAL
+MINIMAL Expected
+SET @@GLOBAL.binlog_row_image=1;
+SELECT @@GLOBAL.binlog_row_image;
+@@GLOBAL.binlog_row_image
+NOBLOB
+NOBLOB Expected
+SET @@SESSION.binlog_row_image=1;
+SELECT @@SESSION.binlog_row_image;
+@@SESSION.binlog_row_image
+NOBLOB
+NOBLOB Expected
+SET @@GLOBAL.binlog_row_image=2;
+SELECT @@GLOBAL.binlog_row_image;
+@@GLOBAL.binlog_row_image
+FULL
+FULL Expected
+SET @@SESSION.binlog_row_image=2;
+SELECT @@SESSION.binlog_row_image;
+@@SESSION.binlog_row_image
+FULL
+FULL Expected
+'#---------------------BS_STVARS_002_03----------------------#'
+SELECT @@GLOBAL.binlog_row_image = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+@@GLOBAL.binlog_row_image = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.binlog_row_image);
+COUNT(@@GLOBAL.binlog_row_image)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_002_04----------------------#'
+SELECT @@SESSION.binlog_row_image = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+@@SESSION.binlog_row_image = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@SESSION.binlog_row_image);
+COUNT(@@SESSION.binlog_row_image)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_002_05----------------------#'
+SELECT COUNT(@@binlog_row_image);
+COUNT(@@binlog_row_image)
+1
+1 Expected
+SELECT COUNT(@@local.binlog_row_image);
+COUNT(@@local.binlog_row_image)
+1
+1 Expected
+SELECT COUNT(@@SESSION.binlog_row_image);
+COUNT(@@SESSION.binlog_row_image)
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.binlog_row_image);
+COUNT(@@GLOBAL.binlog_row_image)
+1
+1 Expected
+SET @@global.binlog_row_image= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/collation_connection_basic.result b/mysql-test/suite/sys_vars/r/collation_connection_basic.result
index c8ce41cfe88..5f8d64e8fa3 100644
--- a/mysql-test/suite/sys_vars/r/collation_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_connection_basic.result
@@ -374,6 +374,10 @@ SET @@session.collation_connection = utf8_hungarian_ci;
SELECT @@session.collation_connection;
@@session.collation_connection
utf8_hungarian_ci
+SET @@session.collation_connection = utf8_thai_520_w2;
+SELECT @@session.collation_connection;
+@@session.collation_connection
+utf8_thai_520_w2
SET @@session.collation_connection = ucs2_general_ci;
SELECT @@session.collation_connection;
@@session.collation_connection
@@ -883,6 +887,10 @@ SET @@global.collation_connection = utf8_hungarian_ci;
SELECT @@global.collation_connection;
@@global.collation_connection
utf8_hungarian_ci
+SET @@global.collation_connection = utf8_thai_520_w2;
+SELECT @@global.collation_connection;
+@@global.collation_connection
+utf8_thai_520_w2
SET @@global.collation_connection = ucs2_general_ci;
SELECT @@global.collation_connection;
@@global.collation_connection
diff --git a/mysql-test/suite/sys_vars/r/collation_database_basic.result b/mysql-test/suite/sys_vars/r/collation_database_basic.result
index efe9638c5f6..5a218167bdb 100644
--- a/mysql-test/suite/sys_vars/r/collation_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_database_basic.result
@@ -376,6 +376,10 @@ SET @@session.collation_database = utf8_hungarian_ci;
SELECT @@session.collation_database;
@@session.collation_database
utf8_hungarian_ci
+SET @@session.collation_database = utf8_thai_520_w2;
+SELECT @@session.collation_database;
+@@session.collation_database
+utf8_thai_520_w2
SET @@session.collation_database = ucs2_general_ci;
SELECT @@session.collation_database;
@@session.collation_database
@@ -885,6 +889,10 @@ SET @@global.collation_database = utf8_hungarian_ci;
SELECT @@global.collation_database;
@@global.collation_database
utf8_hungarian_ci
+SET @@global.collation_database = utf8_thai_520_w2;
+SELECT @@global.collation_database;
+@@global.collation_database
+utf8_thai_520_w2
SET @@global.collation_database = ucs2_general_ci;
SELECT @@global.collation_database;
@@global.collation_database
diff --git a/mysql-test/suite/sys_vars/r/collation_server_basic.result b/mysql-test/suite/sys_vars/r/collation_server_basic.result
index e60f3a3041a..352aeb9ce15 100644
--- a/mysql-test/suite/sys_vars/r/collation_server_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_server_basic.result
@@ -373,6 +373,10 @@ SET @@session.collation_server = utf8_hungarian_ci;
SELECT @@session.collation_server;
@@session.collation_server
utf8_hungarian_ci
+SET @@session.collation_server = utf8_thai_520_w2;
+SELECT @@session.collation_server;
+@@session.collation_server
+utf8_thai_520_w2
SET @@session.collation_server = ucs2_general_ci;
SELECT @@session.collation_server;
@@session.collation_server
@@ -882,6 +886,10 @@ SET @@global.collation_server = utf8_hungarian_ci;
SELECT @@global.collation_server;
@@global.collation_server
utf8_hungarian_ci
+SET @@global.collation_server = utf8_thai_520_w2;
+SELECT @@global.collation_server;
+@@global.collation_server
+utf8_thai_520_w2
SET @@global.collation_server = ucs2_general_ci;
SELECT @@global.collation_server;
@@global.collation_server
diff --git a/mysql-test/suite/sys_vars/r/debug_crc_break_basic.result b/mysql-test/suite/sys_vars/r/debug_crc_break_basic.result
deleted file mode 100644
index 70f338ad305..00000000000
--- a/mysql-test/suite/sys_vars/r/debug_crc_break_basic.result
+++ /dev/null
@@ -1,39 +0,0 @@
-SET @start_global_value = @@global.debug_crc_break;
-select @@global.debug_crc_break;
-@@global.debug_crc_break
-0
-select @@session.debug_crc_break;
-ERROR HY000: Variable 'debug_crc_break' is a GLOBAL variable
-show global variables like 'debug_crc_break';
-Variable_name Value
-debug_crc_break 0
-show session variables like 'debug_crc_break';
-Variable_name Value
-debug_crc_break 0
-select * from information_schema.global_variables where variable_name='debug_crc_break';
-VARIABLE_NAME VARIABLE_VALUE
-DEBUG_CRC_BREAK 0
-select * from information_schema.session_variables where variable_name='debug_crc_break';
-VARIABLE_NAME VARIABLE_VALUE
-DEBUG_CRC_BREAK 0
-set global debug_crc_break=1;
-select @@global.debug_crc_break;
-@@global.debug_crc_break
-1
-set session debug_crc_break=1;
-ERROR HY000: Variable 'debug_crc_break' is a GLOBAL variable and should be set with SET GLOBAL
-set global debug_crc_break=1.1;
-ERROR 42000: Incorrect argument type to variable 'debug_crc_break'
-set global debug_crc_break=1e1;
-ERROR 42000: Incorrect argument type to variable 'debug_crc_break'
-set global debug_crc_break="foo";
-ERROR 42000: Incorrect argument type to variable 'debug_crc_break'
-set global debug_crc_break=0;
-select @@global.debug_crc_break;
-@@global.debug_crc_break
-0
-set global debug_crc_break=cast(-1 as unsigned int);
-select @@global.debug_crc_break;
-@@global.debug_crc_break
-18446744073709551615
-SET @@global.debug_crc_break = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/debug_mutex_deadlock_detector_basic.result b/mysql-test/suite/sys_vars/r/debug_mutex_deadlock_detector_basic.result
new file mode 100644
index 00000000000..b438df8e6e2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/debug_mutex_deadlock_detector_basic.result
@@ -0,0 +1,21 @@
+select @@global.debug_mutex_deadlock_detector;
+@@global.debug_mutex_deadlock_detector
+1
+select @@session.debug_mutex_deadlock_detector;
+ERROR HY000: Variable 'debug_mutex_deadlock_detector' is a GLOBAL variable
+show global variables like 'debug_mutex_deadlock_detector';
+Variable_name Value
+debug_mutex_deadlock_detector ON
+show session variables like 'debug_mutex_deadlock_detector';
+Variable_name Value
+debug_mutex_deadlock_detector ON
+select * from information_schema.global_variables where variable_name='debug_mutex_deadlock_detector';
+VARIABLE_NAME VARIABLE_VALUE
+DEBUG_MUTEX_DEADLOCK_DETECTOR ON
+select * from information_schema.session_variables where variable_name='debug_mutex_deadlock_detector';
+VARIABLE_NAME VARIABLE_VALUE
+DEBUG_MUTEX_DEADLOCK_DETECTOR ON
+set global debug_mutex_deadlock_detector=1;
+ERROR HY000: Variable 'debug_mutex_deadlock_detector' is a read only variable
+set session debug_mutex_deadlock_detector=1;
+ERROR HY000: Variable 'debug_mutex_deadlock_detector' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_basic.result b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_basic.result
new file mode 100644
index 00000000000..22056efc934
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_basic.result
@@ -0,0 +1,181 @@
+SET @start_global_value = @@global.default_tmp_storage_engine;
+SELECT @start_global_value;
+@start_global_value
+NULL
+SET @start_session_value = @@session.default_tmp_storage_engine;
+SELECT @start_session_value;
+@start_session_value
+NULL
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.default_tmp_storage_engine = MEMORY;
+SET @@global.default_tmp_storage_engine = DEFAULT;
+SELECT @@global.default_tmp_storage_engine;
+@@global.default_tmp_storage_engine
+NULL
+SET @@session.default_tmp_storage_engine = MEMORY;
+SET @@session.default_tmp_storage_engine = DEFAULT;
+SELECT @@session.default_tmp_storage_engine;
+@@session.default_tmp_storage_engine
+NULL
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.default_tmp_storage_engine = MYISAM;
+SELECT @@global.default_tmp_storage_engine;
+@@global.default_tmp_storage_engine
+MyISAM
+SET @@global.default_tmp_storage_engine = MERGE;
+SELECT @@global.default_tmp_storage_engine;
+@@global.default_tmp_storage_engine
+MRG_MyISAM
+SET @@global.default_tmp_storage_engine = MEMORY;
+SELECT @@global.default_tmp_storage_engine;
+@@global.default_tmp_storage_engine
+MEMORY
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@session.default_tmp_storage_engine = MYISAM;
+SELECT @@session.default_tmp_storage_engine;
+@@session.default_tmp_storage_engine
+MyISAM
+SET @@session.default_tmp_storage_engine = MERGE;
+SELECT @@session.default_tmp_storage_engine;
+@@session.default_tmp_storage_engine
+MRG_MyISAM
+SET @@session.default_tmp_storage_engine = MEMORY;
+SELECT @@session.default_tmp_storage_engine;
+@@session.default_tmp_storage_engine
+MEMORY
+'#------------------FN_DYNVARS_005_04-----------------------#'
+SET @@global.default_tmp_storage_engine = 8199;
+ERROR 42000: Incorrect argument type to variable 'default_tmp_storage_engine'
+SET @@global.default_tmp_storage_engine = -1024;
+ERROR 42000: Incorrect argument type to variable 'default_tmp_storage_engine'
+SET @@global.default_tmp_storage_engine = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'default_tmp_storage_engine'
+SET @@global.default_tmp_storage_engine = FILE;
+ERROR 42000: Unknown storage engine 'FILE'
+SET @@session.default_tmp_storage_engine = 8199;
+ERROR 42000: Incorrect argument type to variable 'default_tmp_storage_engine'
+SET @@session.default_tmp_storage_engine = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'default_tmp_storage_engine'
+SET @@session.default_tmp_storage_engine = RECORD;
+ERROR 42000: Unknown storage engine 'RECORD'
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SELECT @@global.default_tmp_storage_engine =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='default_tmp_storage_engine';
+@@global.default_tmp_storage_engine =
+VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@session.default_tmp_storage_engine =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='default_tmp_storage_engine';
+@@session.default_tmp_storage_engine =
+VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SET @@global.default_tmp_storage_engine = TRUE;
+ERROR 42000: Incorrect argument type to variable 'default_tmp_storage_engine'
+SET @@global.default_tmp_storage_engine = FALSE;
+ERROR 42000: Incorrect argument type to variable 'default_tmp_storage_engine'
+'#---------------------FN_DYNVARS_001_8----------------------#'
+SET @@default_tmp_storage_engine = MYISAM;
+SELECT @@default_tmp_storage_engine = @@local.default_tmp_storage_engine;
+@@default_tmp_storage_engine = @@local.default_tmp_storage_engine
+1
+SELECT @@local.default_tmp_storage_engine = @@session.default_tmp_storage_engine;
+@@local.default_tmp_storage_engine = @@session.default_tmp_storage_engine
+1
+'#---------------------FN_DYNVARS_001_9----------------------#'
+SET default_tmp_storage_engine = MEMORY;
+SELECT @@default_tmp_storage_engine;
+@@default_tmp_storage_engine
+MEMORY
+SELECT local.default_tmp_storage_engine;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.default_tmp_storage_engine;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT default_tmp_storage_engine = @@session.default_tmp_storage_engine;
+ERROR 42S22: Unknown column 'default_tmp_storage_engine' in 'field list'
+SET @@default_tmp_storage_engine = @start_global_value;
+SET default_tmp_storage_engine = MyISAM;
+SET default_storage_engine = MyISAM;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+SET default_storage_engine = MEMORY;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+SET @@global.default_tmp_storage_engine = NULL;
+SET @@session.default_tmp_storage_engine = NULL;
+SET default_storage_engine = MEMORY;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+SET default_storage_engine = MYISAM;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+SET default_tmp_storage_engine = DEFAULT;
+SET default_storage_engine = DEFAULT;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+SET @@global.default_tmp_storage_engine = @start_global_value;
+SELECT @@global.default_tmp_storage_engine;
+@@global.default_tmp_storage_engine
+NULL
+SET @@session.default_tmp_storage_engine = @start_session_value;
+SELECT @@session.default_tmp_storage_engine;
+@@session.default_tmp_storage_engine
+NULL
diff --git a/mysql-test/suite/sys_vars/r/delay_key_write_func.result b/mysql-test/suite/sys_vars/r/delay_key_write_func.result
index d55cca7ab8e..5cc4b2eaaad 100644
--- a/mysql-test/suite/sys_vars/r/delay_key_write_func.result
+++ b/mysql-test/suite/sys_vars/r/delay_key_write_func.result
@@ -1,23 +1,20 @@
'#--------------------FN_DYNVARS_023_01-------------------------#'
SET @start_value= @@global.delay_key_write;
-SET @@global.delay_key_write = ON;
-SELECT @@global.delay_key_write;
-@@global.delay_key_write
-ON
-'connect (user1,localhost,root,,,,)'
-'connection user1'
-SELECT @@global.delay_key_write AS res_is_ON;
-res_is_ON
-ON
-SET @@global.delay_key_write = ALL;
-'connect (user1,localhost,root,,,,)'
-'connection user1'
-SELECT @@global.delay_key_write AS res_is_ALL;
-res_is_ALL
-ALL
'#--------------------FN_DYNVARS_023_02-------------------------#'
+CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT)
+BEGIN
+WHILE (var1 < var2) DO
+INSERT INTO t1 VALUES(var1,REPEAT('MYSQL',10),100000.0/var1);
+SET var1=var1+1;
+END WHILE;
+END//
'---check when delay_key_write is OFF---'
SET @@global.delay_key_write = OFF;
+CREATE TABLE t1(
+a INT PRIMARY KEY,
+b VARCHAR(512),
+c DOUBLE
+) DELAY_KEY_WRITE = 1;
FLUSH STATUS;
CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads';
@@ -32,8 +29,14 @@ Key_write_requests 9
SELECT COUNT(*) FROM t1;
COUNT(*)
9
+DROP TABLE t1;
'----check when delay_key_write is ON---'
SET @@global.delay_key_write = ON;
+CREATE TABLE t1(
+a INT PRIMARY KEY,
+b VARCHAR(512),
+c DOUBLE
+) DELAY_KEY_WRITE = 1;
FLUSH STATUS;
CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads';
@@ -48,8 +51,14 @@ Key_write_requests 9
SELECT COUNT(*) FROM t1;
COUNT(*)
9
+DROP TABLE t1;
'----check when delay_key_write is ALL---'
SET @@global.delay_key_write = ALL;
+CREATE TABLE t1(
+a INT PRIMARY KEY,
+b VARCHAR(512),
+c DOUBLE
+) DELAY_KEY_WRITE = 0;
FLUSH STATUS;
CALL sp_addRecords(1,10);
SHOW STATUS LIKE 'Key_reads';
diff --git a/mysql-test/suite/sys_vars/r/encrypt_tmp_disk_tables_basic.result b/mysql-test/suite/sys_vars/r/encrypt_tmp_disk_tables_basic.result
new file mode 100644
index 00000000000..833ad5287ba
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/encrypt_tmp_disk_tables_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.encrypt_tmp_disk_tables;
+select @@global.encrypt_tmp_disk_tables;
+@@global.encrypt_tmp_disk_tables
+0
+select @@session.encrypt_tmp_disk_tables;
+ERROR HY000: Variable 'encrypt_tmp_disk_tables' is a GLOBAL variable
+show global variables like 'encrypt_tmp_disk_tables';
+Variable_name Value
+encrypt_tmp_disk_tables OFF
+show session variables like 'encrypt_tmp_disk_tables';
+Variable_name Value
+encrypt_tmp_disk_tables OFF
+select * from information_schema.global_variables
+where variable_name='encrypt_tmp_disk_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ENCRYPT_TMP_DISK_TABLES OFF
+select * from information_schema.session_variables
+where variable_name='encrypt_tmp_disk_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ENCRYPT_TMP_DISK_TABLES OFF
+set global encrypt_tmp_disk_tables=ON;
+select @@global.encrypt_tmp_disk_tables;
+@@global.encrypt_tmp_disk_tables
+1
+set global encrypt_tmp_disk_tables=OFF;
+select @@global.encrypt_tmp_disk_tables;
+@@global.encrypt_tmp_disk_tables
+0
+set global encrypt_tmp_disk_tables=1;
+select @@global.encrypt_tmp_disk_tables;
+@@global.encrypt_tmp_disk_tables
+1
+set session encrypt_tmp_disk_tables=1;
+ERROR HY000: Variable 'encrypt_tmp_disk_tables' is a GLOBAL variable and should be set with SET GLOBAL
+set global encrypt_tmp_disk_tables=1.1;
+ERROR 42000: Incorrect argument type to variable 'encrypt_tmp_disk_tables'
+set global encrypt_tmp_disk_tables=1e1;
+ERROR 42000: Incorrect argument type to variable 'encrypt_tmp_disk_tables'
+set global encrypt_tmp_disk_tables="foo";
+ERROR 42000: Variable 'encrypt_tmp_disk_tables' can't be set to the value of 'foo'
+SET @@global.encrypt_tmp_disk_tables = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/enforce_storage_engine_basic.result b/mysql-test/suite/sys_vars/r/enforce_storage_engine_basic.result
new file mode 100644
index 00000000000..cb5b199b271
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/enforce_storage_engine_basic.result
@@ -0,0 +1,39 @@
+SET @start_session_value = @@session.enforce_storage_engine;
+SET @@session.enforce_storage_engine = INNODB;
+SET @@session.enforce_storage_engine = DEFAULT;
+SELECT @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+NULL
+SET @@session.enforce_storage_engine = MYISAM;
+SELECT @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MyISAM
+SET @@session.enforce_storage_engine = MERGE;
+SELECT @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MRG_MyISAM
+SET @@session.enforce_storage_engine = MEMORY;
+SELECT @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MEMORY
+SET @@session.enforce_storage_engine = INNODB;
+SELECT @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+InnoDB
+SET @@session.enforce_storage_engine = 8199;
+ERROR 42000: Incorrect argument type to variable 'enforce_storage_engine'
+SET @@session.enforce_storage_engine = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'enforce_storage_engine'
+SET @@session.enforce_storage_engine = RECORD;
+ERROR 42000: Unknown storage engine 'RECORD'
+SELECT @@session.enforce_storage_engine =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='enforce_storage_engine';
+@@session.enforce_storage_engine =
+VARIABLE_VALUE
+1
+SET @@session.enforce_storage_engine = TRUE;
+ERROR 42000: Incorrect argument type to variable 'enforce_storage_engine'
+SET @@session.enforce_storage_engine = FALSE;
+ERROR 42000: Incorrect argument type to variable 'enforce_storage_engine'
+SET @@session.enforce_storage_engine = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
deleted file mode 100644
index 64028e537bf..00000000000
--- a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
+++ /dev/null
@@ -1,290 +0,0 @@
-SET @session_start_value = @@session.engine_condition_pushdown;
-SELECT @session_start_value;
-@session_start_value
-0
-SET @global_start_value = @@global.engine_condition_pushdown;
-SELECT @global_start_value;
-@global_start_value
-0
-select @old_session_opt_switch:=@@session.optimizer_switch,
-@old_global_opt_switch:=@@global.optimizer_switch;
-@old_session_opt_switch:=@@session.optimizer_switch @old_global_opt_switch:=@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-'#--------------------FN_DYNVARS_028_01------------------------#'
-SET @@session.engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SET @@session.engine_condition_pushdown = DEFAULT;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-0
-SET @@global.engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SET @@global.engine_condition_pushdown = DEFAULT;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-1
-'#---------------------FN_DYNVARS_028_02-------------------------#'
-SET engine_condition_pushdown = 1;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@engine_condition_pushdown;
-@@engine_condition_pushdown
-1
-SELECT session.engine_condition_pushdown;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT local.engine_condition_pushdown;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.engine_condition_pushdown;
-ERROR 42S02: Unknown table 'global' in field list
-SET session engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-0
-SET global engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-0
-'#--------------------FN_DYNVARS_028_03------------------------#'
-SET @@session.engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-0
-SET @@session.engine_condition_pushdown = 1;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-1
-SET @@global.engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-0
-SET @@global.engine_condition_pushdown = 1;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-1
-'#--------------------FN_DYNVARS_028_04-------------------------#'
-SET @@session.engine_condition_pushdown = -1;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '-1'
-SET @@session.engine_condition_pushdown = 1.6;
-ERROR 42000: Incorrect argument type to variable 'engine_condition_pushdown'
-SET @@session.engine_condition_pushdown = "T";
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'T'
-SET @@session.engine_condition_pushdown = "Y";
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'Y'
-SET @@session.engine_condition_pushdown = TRÜE;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'TRÜE'
-SET @@session.engine_condition_pushdown = ÕN;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÕN'
-SET @@session.engine_condition_pushdown = OF;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'OF'
-SET @@session.engine_condition_pushdown = ÓFF;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÓFF'
-SET @@global.engine_condition_pushdown = -1;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '-1'
-SET @@global.engine_condition_pushdown = 2;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '2'
-SET @@global.engine_condition_pushdown = "T";
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'T'
-SET @@global.engine_condition_pushdown = "Y";
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'Y'
-SET @@global.engine_condition_pushdown = TRÜE;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'TRÜE'
-SET @@global.engine_condition_pushdown = ÕN;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÕN'
-SET @@global.engine_condition_pushdown = OF;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'OF'
-SET @@global.engine_condition_pushdown = ÓFF;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÓFF'
-'#-------------------FN_DYNVARS_028_05----------------------------#'
-SET @@global.engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SET @@session.engine_condition_pushdown = 1;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown AS res_is_0;
-res_is_0
-0
-SET @@global.engine_condition_pushdown = 0;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown AS res_is_1;
-res_is_1
-1
-'#----------------------FN_DYNVARS_028_06------------------------#'
-SELECT IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
-1
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-0
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-VARIABLE_VALUE
-OFF
-'#----------------------FN_DYNVARS_028_07------------------------#'
-SELECT IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
-1
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-1
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-VARIABLE_VALUE
-ON
-'#---------------------FN_DYNVARS_028_08-------------------------#'
-SET @@session.engine_condition_pushdown = OFF;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-0
-SET @@session.engine_condition_pushdown = ON;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-1
-SET @@global.engine_condition_pushdown = OFF;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-0
-SET @@global.engine_condition_pushdown = ON;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-1
-'#---------------------FN_DYNVARS_028_09----------------------#'
-SET @@session.engine_condition_pushdown = TRUE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-1
-SET @@session.engine_condition_pushdown = FALSE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-0
-SET @@global.engine_condition_pushdown = TRUE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-1
-SET @@global.engine_condition_pushdown = FALSE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-0
-Check that @@engine_condition_pushdown influences
-@@optimizer_switch and vice-versa
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@session.engine_condition_pushdown = TRUE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@session.engine_condition_pushdown = FALSE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@global.engine_condition_pushdown = TRUE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@global.engine_condition_pushdown = FALSE;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@session.optimizer_switch = "engine_condition_pushdown=on";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@session.optimizer_switch = "engine_condition_pushdown=off";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@global.optimizer_switch = "engine_condition_pushdown=on";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-set @@global.optimizer_switch = "engine_condition_pushdown=off";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
-SET @@session.engine_condition_pushdown = @session_start_value;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-0
-SET @@global.engine_condition_pushdown = @global_start_value;
-Warnings:
-Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-0
-set @session.optimizer_switch=@old_session_opt_switch,
-@@global.optimizer_switch=@old_global_opt_switch;
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result
new file mode 100644
index 00000000000..d9a9a2909ce
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result
@@ -0,0 +1,21 @@
+select @@global.explicit_defaults_for_timestamp;
+@@global.explicit_defaults_for_timestamp
+0
+select @@session.explicit_defaults_for_timestamp;
+ERROR HY000: Variable 'explicit_defaults_for_timestamp' is a GLOBAL variable
+show global variables like 'explicit_defaults_for_timestamp';
+Variable_name Value
+explicit_defaults_for_timestamp OFF
+show session variables like 'explicit_defaults_for_timestamp';
+Variable_name Value
+explicit_defaults_for_timestamp OFF
+select * from information_schema.global_variables where variable_name='explicit_defaults_for_timestamp';
+VARIABLE_NAME VARIABLE_VALUE
+EXPLICIT_DEFAULTS_FOR_TIMESTAMP OFF
+select * from information_schema.session_variables where variable_name='explicit_defaults_for_timestamp';
+VARIABLE_NAME VARIABLE_VALUE
+EXPLICIT_DEFAULTS_FOR_TIMESTAMP OFF
+set global explicit_defaults_for_timestamp=true;
+ERROR HY000: Variable 'explicit_defaults_for_timestamp' is a read only variable
+set session explicit_defaults_for_timestamp=true;
+ERROR HY000: Variable 'explicit_defaults_for_timestamp' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
new file mode 100644
index 00000000000..61a4eb8a934
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
@@ -0,0 +1,188 @@
+CREATE TABLE t1 (a TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
+ERROR 42000: Invalid default value for 'a'
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT '2001-01-01 10:20:30'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT '2001-01-01 10:20:30'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT '2001-01-01 10:20:30'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP) AS SELECT 1 AS i;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `i` int(1) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 (b TIMESTAMP) AS SELECT a FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+ALTER TABLE t1 ADD b TIMESTAMP;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# MDEV-10802 TIMESTAMP NOT NULL field with explicit_defaults_for_timestamp and NO_ZERO_DATE shouldn't throw error
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+SET sql_mode='ANSI,NO_ZERO_DATE';
+CREATE TABLE t1 (a TIMESTAMP NOT NULL);
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+a
+2001-01-01 10:20:30
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+SET timestamp=DEFAULT;
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
new file mode 100644
index 00000000000..fb820dc167d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
@@ -0,0 +1,195 @@
+CREATE TABLE t1 (a TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT '2001-01-01 10:20:30'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT '2001-01-01 10:20:30'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '2001-01-01 10:20:30');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT '2001-01-01 10:20:30'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIMESTAMP) AS SELECT 1 AS i;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL,
+ `i` int(1) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 (b TIMESTAMP) AS SELECT a FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `b` timestamp NULL DEFAULT NULL,
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+ALTER TABLE t1 ADD b TIMESTAMP;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# MDEV-10802 TIMESTAMP NOT NULL field with explicit_defaults_for_timestamp and NO_ZERO_DATE shouldn't throw error
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+SET sql_mode='ANSI,NO_ZERO_DATE';
+CREATE TABLE t1 (a TIMESTAMP NOT NULL);
+INSERT INTO t1 VALUES ();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+SELECT * FROM t1;
+a
+0000-00-00 00:00:00
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+SET timestamp=DEFAULT;
diff --git a/mysql-test/suite/sys_vars/r/have_ndbcluster_basic.result b/mysql-test/suite/sys_vars/r/have_ndbcluster_basic.result
deleted file mode 100644
index 1b662311072..00000000000
--- a/mysql-test/suite/sys_vars/r/have_ndbcluster_basic.result
+++ /dev/null
@@ -1,53 +0,0 @@
-'#---------------------BS_STVARS_012_01----------------------#'
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
-COUNT(@@GLOBAL.have_ndbcluster)
-1
-1 Expected
-'#---------------------BS_STVARS_012_02----------------------#'
-SET @@GLOBAL.have_ndbcluster=1;
-ERROR HY000: Variable 'have_ndbcluster' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
-COUNT(@@GLOBAL.have_ndbcluster)
-1
-1 Expected
-'#---------------------BS_STVARS_012_03----------------------#'
-SELECT @@GLOBAL.have_ndbcluster = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_ndbcluster';
-@@GLOBAL.have_ndbcluster = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
-COUNT(@@GLOBAL.have_ndbcluster)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_ndbcluster';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-'#---------------------BS_STVARS_012_04----------------------#'
-SELECT @@have_ndbcluster = @@GLOBAL.have_ndbcluster;
-@@have_ndbcluster = @@GLOBAL.have_ndbcluster
-1
-1 Expected
-'#---------------------BS_STVARS_012_05----------------------#'
-SELECT COUNT(@@have_ndbcluster);
-COUNT(@@have_ndbcluster)
-1
-1 Expected
-SELECT COUNT(@@local.have_ndbcluster);
-ERROR HY000: Variable 'have_ndbcluster' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@SESSION.have_ndbcluster);
-ERROR HY000: Variable 'have_ndbcluster' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
-COUNT(@@GLOBAL.have_ndbcluster)
-1
-1 Expected
-SELECT have_ndbcluster = @@SESSION.have_ndbcluster;
-ERROR 42S22: Unknown column 'have_ndbcluster' in 'field list'
-Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_check_interval_basic.result b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_check_interval_basic.result
new file mode 100644
index 00000000000..5a8734a9446
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_check_interval_basic.result
@@ -0,0 +1,72 @@
+SET @start_global_value = @@global.innodb_background_scrub_data_check_interval;
+#
+# default value
+#
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+3600
+set global innodb_background_scrub_data_check_interval=10;
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+10
+set global innodb_background_scrub_data_check_interval=DEFAULT;
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+3600
+set global innodb_background_scrub_data_check_interval=20;
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+20
+set global innodb_background_scrub_data_check_interval=DEFAULT;
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+3600
+#
+# exists as global only
+#
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+3600
+select @@session.innodb_background_scrub_data_check_interval;
+ERROR HY000: Variable 'innodb_background_scrub_data_check_interval' is a GLOBAL variable
+show global variables like 'innodb_background_scrub_data_check_interval';
+Variable_name Value
+innodb_background_scrub_data_check_interval 3600
+show session variables like 'innodb_background_scrub_data_check_interval';
+Variable_name Value
+innodb_background_scrub_data_check_interval 3600
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_check_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_CHECK_INTERVAL 3600
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_check_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_CHECK_INTERVAL 3600
+#
+# show that it's writable
+#
+set global innodb_background_scrub_data_check_interval=10;
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+10
+set global innodb_background_scrub_data_check_interval=20;
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+20
+set global innodb_background_scrub_data_check_interval=1;
+select @@global.innodb_background_scrub_data_check_interval;
+@@global.innodb_background_scrub_data_check_interval
+1
+set session innodb_background_scrub_data_check_interval=1;
+ERROR HY000: Variable 'innodb_background_scrub_data_check_interval' is a GLOBAL variable and should be set with SET GLOBAL
+#
+# incorrect types
+#
+set global innodb_background_scrub_data_check_interval=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_check_interval'
+set global innodb_background_scrub_data_check_interval=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_check_interval'
+set global innodb_background_scrub_data_check_interval="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_check_interval'
+SET @@global.innodb_background_scrub_data_check_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_compressed_basic.result b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_compressed_basic.result
new file mode 100644
index 00000000000..7a1fd978bd2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_compressed_basic.result
@@ -0,0 +1,50 @@
+SET @start_global_value = @@global.innodb_background_scrub_data_compressed;
+#
+# exists as global only
+#
+select @@global.innodb_background_scrub_data_compressed;
+@@global.innodb_background_scrub_data_compressed
+0
+select @@session.innodb_background_scrub_data_compressed;
+ERROR HY000: Variable 'innodb_background_scrub_data_compressed' is a GLOBAL variable
+show global variables like 'innodb_background_scrub_data_compressed';
+Variable_name Value
+innodb_background_scrub_data_compressed OFF
+show session variables like 'innodb_background_scrub_data_compressed';
+Variable_name Value
+innodb_background_scrub_data_compressed OFF
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_compressed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED OFF
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_compressed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED OFF
+#
+# show that it's writable
+#
+set global innodb_background_scrub_data_compressed=ON;
+select @@global.innodb_background_scrub_data_compressed;
+@@global.innodb_background_scrub_data_compressed
+1
+set global innodb_background_scrub_data_compressed=OFF;
+select @@global.innodb_background_scrub_data_compressed;
+@@global.innodb_background_scrub_data_compressed
+0
+set global innodb_background_scrub_data_compressed=1;
+select @@global.innodb_background_scrub_data_compressed;
+@@global.innodb_background_scrub_data_compressed
+1
+set session innodb_background_scrub_data_compressed=1;
+ERROR HY000: Variable 'innodb_background_scrub_data_compressed' is a GLOBAL variable and should be set with SET GLOBAL
+#
+# incorrect types
+#
+set global innodb_background_scrub_data_compressed=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_compressed'
+set global innodb_background_scrub_data_compressed=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_compressed'
+set global innodb_background_scrub_data_compressed="foo";
+ERROR 42000: Variable 'innodb_background_scrub_data_compressed' can't be set to the value of 'foo'
+SET @@global.innodb_background_scrub_data_compressed = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_interval_basic.result b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_interval_basic.result
new file mode 100644
index 00000000000..49bbc8cd34a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_interval_basic.result
@@ -0,0 +1,50 @@
+SET @start_global_value = @@global.innodb_background_scrub_data_interval;
+#
+# exists as global only
+#
+select @@global.innodb_background_scrub_data_interval;
+@@global.innodb_background_scrub_data_interval
+604800
+select @@session.innodb_background_scrub_data_interval;
+ERROR HY000: Variable 'innodb_background_scrub_data_interval' is a GLOBAL variable
+show global variables like 'innodb_background_scrub_data_interval';
+Variable_name Value
+innodb_background_scrub_data_interval 604800
+show session variables like 'innodb_background_scrub_data_interval';
+Variable_name Value
+innodb_background_scrub_data_interval 604800
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_INTERVAL 604800
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_INTERVAL 604800
+#
+# show that it's writable
+#
+set global innodb_background_scrub_data_interval=100;
+select @@global.innodb_background_scrub_data_interval;
+@@global.innodb_background_scrub_data_interval
+100
+set global innodb_background_scrub_data_interval=200;
+select @@global.innodb_background_scrub_data_interval;
+@@global.innodb_background_scrub_data_interval
+200
+set global innodb_background_scrub_data_interval=300;
+select @@global.innodb_background_scrub_data_interval;
+@@global.innodb_background_scrub_data_interval
+300
+set session innodb_background_scrub_data_interval=400;
+ERROR HY000: Variable 'innodb_background_scrub_data_interval' is a GLOBAL variable and should be set with SET GLOBAL
+#
+# incorrect types
+#
+set global innodb_background_scrub_data_interval=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_interval'
+set global innodb_background_scrub_data_interval=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_interval'
+set global innodb_background_scrub_data_interval="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_interval'
+SET @@global.innodb_background_scrub_data_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_uncompressed_basic.result b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_uncompressed_basic.result
new file mode 100644
index 00000000000..c85bde6493f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_background_scrub_data_uncompressed_basic.result
@@ -0,0 +1,50 @@
+SET @start_global_value = @@global.innodb_background_scrub_data_uncompressed;
+#
+# exists as global only
+#
+select @@global.innodb_background_scrub_data_uncompressed;
+@@global.innodb_background_scrub_data_uncompressed
+0
+select @@session.innodb_background_scrub_data_uncompressed;
+ERROR HY000: Variable 'innodb_background_scrub_data_uncompressed' is a GLOBAL variable
+show global variables like 'innodb_background_scrub_data_uncompressed';
+Variable_name Value
+innodb_background_scrub_data_uncompressed OFF
+show session variables like 'innodb_background_scrub_data_uncompressed';
+Variable_name Value
+innodb_background_scrub_data_uncompressed OFF
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_uncompressed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_UNCOMPRESSED OFF
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_uncompressed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_BACKGROUND_SCRUB_DATA_UNCOMPRESSED OFF
+#
+# show that it's writable
+#
+set global innodb_background_scrub_data_uncompressed=ON;
+select @@global.innodb_background_scrub_data_uncompressed;
+@@global.innodb_background_scrub_data_uncompressed
+1
+set global innodb_background_scrub_data_uncompressed=OFF;
+select @@global.innodb_background_scrub_data_uncompressed;
+@@global.innodb_background_scrub_data_uncompressed
+0
+set global innodb_background_scrub_data_uncompressed=1;
+select @@global.innodb_background_scrub_data_uncompressed;
+@@global.innodb_background_scrub_data_uncompressed
+1
+set session innodb_background_scrub_data_uncompressed=1;
+ERROR HY000: Variable 'innodb_background_scrub_data_uncompressed' is a GLOBAL variable and should be set with SET GLOBAL
+#
+# incorrect types
+#
+set global innodb_background_scrub_data_uncompressed=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_uncompressed'
+set global innodb_background_scrub_data_uncompressed=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_uncompressed'
+set global innodb_background_scrub_data_uncompressed="foo";
+ERROR 42000: Variable 'innodb_background_scrub_data_uncompressed' can't be set to the value of 'foo'
+SET @@global.innodb_background_scrub_data_uncompressed = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_buf_dump_status_frequency_basic.result b/mysql-test/suite/sys_vars/r/innodb_buf_dump_status_frequency_basic.result
new file mode 100644
index 00000000000..168509f466c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buf_dump_status_frequency_basic.result
@@ -0,0 +1,42 @@
+SET @start_innodb_buf_dump_status_frequency = @@global.innodb_buf_dump_status_frequency;
+SELECT @start_innodb_buf_dump_status_frequency;
+@start_innodb_buf_dump_status_frequency
+0
+SELECT COUNT(@@global.innodb_buf_dump_status_frequency);
+COUNT(@@global.innodb_buf_dump_status_frequency)
+1
+SET @@global.innodb_buf_dump_status_frequency = 20;
+SELECT @@global.innodb_buf_dump_status_frequency;
+@@global.innodb_buf_dump_status_frequency
+20
+SET @@global.innodb_buf_dump_status_frequency = 0;
+SELECT @@global.innodb_buf_dump_status_frequency;
+@@global.innodb_buf_dump_status_frequency
+0
+SET @@global.innodb_buf_dump_status_frequency = 100;
+SELECT @@global.innodb_buf_dump_status_frequency;
+@@global.innodb_buf_dump_status_frequency
+100
+SET @@global.innodb_buf_dump_status_frequency = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_buf_dump_status_frequency value: '-1'
+SELECT @@global.innodb_buf_dump_status_frequency;
+@@global.innodb_buf_dump_status_frequency
+0
+SET @@global.innodb_buf_dump_status_frequency = 101;
+Warnings:
+Warning 1292 Truncated incorrect innodb_buf_dump_status_frequency value: '101'
+SELECT @@global.innodb_buf_dump_status_frequency;
+@@global.innodb_buf_dump_status_frequency
+100
+SET @@global.innodb_buf_dump_status_frequency = 10.5;
+ERROR 42000: Incorrect argument type to variable 'innodb_buf_dump_status_frequency'
+SELECT @@global.innodb_buf_dump_status_frequency;
+@@global.innodb_buf_dump_status_frequency
+100
+SET @@global.innodb_buf_dump_status_frequency = "abc";
+ERROR 42000: Incorrect argument type to variable 'innodb_buf_dump_status_frequency'
+SELECT @@global.innodb_buf_dump_status_frequency;
+@@global.innodb_buf_dump_status_frequency
+100
+SET @@global.innodb_buf_dump_status_frequency = @start_innodb_buf_dump_status_frequency;
diff --git a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
index d2d96596a93..8e05db129dc 100644
--- a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
@@ -1,47 +1,47 @@
SET @orig = @@global.innodb_checksum_algorithm;
SELECT @orig;
@orig
-innodb
+INNODB
SET GLOBAL innodb_checksum_algorithm = 'crc32';
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-crc32
+CRC32
SET GLOBAL innodb_checksum_algorithm = 'strict_crc32';
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-strict_crc32
+STRICT_CRC32
SET GLOBAL innodb_checksum_algorithm = 'innodb';
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-innodb
+INNODB
SET GLOBAL innodb_checksum_algorithm = 'strict_innodb';
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-strict_innodb
+STRICT_INNODB
SET GLOBAL innodb_checksum_algorithm = 'none';
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-none
+NONE
SET GLOBAL innodb_checksum_algorithm = 'strict_none';
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_checksum_algorithm = '';
ERROR 42000: Variable 'innodb_checksum_algorithm' can't be set to the value of ''
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_checksum_algorithm = 'foobar';
ERROR 42000: Variable 'innodb_checksum_algorithm' can't be set to the value of 'foobar'
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_checksum_algorithm = 123;
ERROR 42000: Variable 'innodb_checksum_algorithm' can't be set to the value of '123'
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_checksum_algorithm = @orig;
SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm
-innodb
+INNODB
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result
index 6dd1b6dc489..65046d93344 100644
--- a/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result
@@ -1,17 +1,17 @@
SET @start_value = @@GLOBAL.innodb_cleaner_lsn_age_factor;
SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
@@GLOBAL.innodb_cleaner_lsn_age_factor
-high_checkpoint
+HIGH_CHECKPOINT
SELECT @@SESSION.innodb_cleaner_lsn_age_factor;
ERROR HY000: Variable 'innodb_cleaner_lsn_age_factor' is a GLOBAL variable
SET GLOBAL innodb_cleaner_lsn_age_factor='legacy';
SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
@@GLOBAL.innodb_cleaner_lsn_age_factor
-legacy
+LEGACY
SET GLOBAL innodb_cleaner_lsn_age_factor='high_checkpoint';
SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
@@GLOBAL.innodb_cleaner_lsn_age_factor
-high_checkpoint
+HIGH_CHECKPOINT
SET GLOBAL innodb_cleaner_lsn_age_factor=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lsn_age_factor'
SET GLOBAL innodb_cleaner_lsn_age_factor=1e1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_compression_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_compression_algorithm_basic.result
new file mode 100644
index 00000000000..1213ec8bf10
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_compression_algorithm_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.innodb_compression_algorithm;
+SELECT @start_global_value;
+@start_global_value
+zlib
+select @@global.innodb_compression_algorithm;
+@@global.innodb_compression_algorithm
+zlib
+select @@session.innodb_compression_algorithm;
+ERROR HY000: Variable 'innodb_compression_algorithm' is a GLOBAL variable
+show global variables like 'innodb_compression_algorithm';
+Variable_name Value
+innodb_compression_algorithm zlib
+show session variables like 'innodb_compression_algorithm';
+Variable_name Value
+innodb_compression_algorithm zlib
+select * from information_schema.global_variables where variable_name='innodb_compression_algorithm';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_ALGORITHM zlib
+select * from information_schema.session_variables where variable_name='innodb_compression_algorithm';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_ALGORITHM zlib
+set global innodb_compression_algorithm=1;
+select @@global.innodb_compression_algorithm;
+@@global.innodb_compression_algorithm
+zlib
+select * from information_schema.global_variables where variable_name='innodb_compression_algorithm';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_ALGORITHM zlib
+select * from information_schema.session_variables where variable_name='innodb_compression_algorithm';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_ALGORITHM zlib
+set session innodb_compression_algorithm=0;
+ERROR HY000: Variable 'innodb_compression_algorithm' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_compression_algorithm=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_algorithm'
+set global innodb_compression_algorithm=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_algorithm'
+set global innodb_compression_algorithm="foo";
+ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'foo'
+set global innodb_compression_algorithm=0;
+select @@global.innodb_compression_algorithm;
+@@global.innodb_compression_algorithm
+none
+SET @@global.innodb_compression_algorithm = @start_global_value;
+SELECT @@global.innodb_compression_algorithm;
+@@global.innodb_compression_algorithm
+zlib
diff --git a/mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result b/mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result
new file mode 100644
index 00000000000..eced486ad70
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result
@@ -0,0 +1,50 @@
+SET @start_global_value = @@global.innodb_debug_force_scrubbing;
+#
+# exists as global only
+#
+select @@global.innodb_debug_force_scrubbing;
+@@global.innodb_debug_force_scrubbing
+0
+select @@session.innodb_debug_force_scrubbing;
+ERROR HY000: Variable 'innodb_debug_force_scrubbing' is a GLOBAL variable
+show global variables like 'innodb_debug_force_scrubbing';
+Variable_name Value
+innodb_debug_force_scrubbing OFF
+show session variables like 'innodb_debug_force_scrubbing';
+Variable_name Value
+innodb_debug_force_scrubbing OFF
+select * from information_schema.global_variables
+where variable_name='innodb_debug_force_scrubbing';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DEBUG_FORCE_SCRUBBING OFF
+select * from information_schema.session_variables
+where variable_name='innodb_debug_force_scrubbing';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DEBUG_FORCE_SCRUBBING OFF
+#
+# show that it's writable
+#
+set global innodb_debug_force_scrubbing=ON;
+select @@global.innodb_debug_force_scrubbing;
+@@global.innodb_debug_force_scrubbing
+1
+set global innodb_debug_force_scrubbing=OFF;
+select @@global.innodb_debug_force_scrubbing;
+@@global.innodb_debug_force_scrubbing
+0
+set global innodb_debug_force_scrubbing=1;
+select @@global.innodb_debug_force_scrubbing;
+@@global.innodb_debug_force_scrubbing
+1
+set session innodb_debug_force_scrubbing=1;
+ERROR HY000: Variable 'innodb_debug_force_scrubbing' is a GLOBAL variable and should be set with SET GLOBAL
+#
+# incorrect types
+#
+set global innodb_debug_force_scrubbing=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_debug_force_scrubbing'
+set global innodb_debug_force_scrubbing=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_debug_force_scrubbing'
+set global innodb_debug_force_scrubbing="foo";
+ERROR 42000: Variable 'innodb_debug_force_scrubbing' can't be set to the value of 'foo'
+SET @@global.innodb_debug_force_scrubbing = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_basic.result
new file mode 100644
index 00000000000..916bb5ca1a9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_defragment_basic.result
@@ -0,0 +1,18 @@
+SET @orig = @@global.innodb_defragment;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_defragment = OFF;
+SELECT @@global.innodb_defragment;
+@@global.innodb_defragment
+0
+SET GLOBAL innodb_defragment = ON;
+SELECT @@global.innodb_defragment;
+@@global.innodb_defragment
+1
+SET GLOBAL innodb_defragment = 100;
+ERROR 42000: Variable 'innodb_defragment' can't be set to the value of '100'
+SELECT @@global.innodb_defragment;
+@@global.innodb_defragment
+1
+SET GLOBAL innodb_defragment = @orig;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result
new file mode 100644
index 00000000000..93a5af727c3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result
@@ -0,0 +1,37 @@
+SET @start_innodb_defragment_fill_factor = @@global.innodb_defragment_fill_factor;
+SELECT @start_innodb_defragment_fill_factor;
+@start_innodb_defragment_fill_factor
+0.9
+SELECT COUNT(@@global.innodb_defragment_fill_factor);
+COUNT(@@global.innodb_defragment_fill_factor)
+1
+SET @@global.innodb_defragment_fill_factor = 0.77777777777777;
+SELECT @@global.innodb_defragment_fill_factor;
+@@global.innodb_defragment_fill_factor
+0.777778
+SET @@global.innodb_defragment_fill_factor = 1;
+SELECT @@global.innodb_defragment_fill_factor;
+@@global.innodb_defragment_fill_factor
+1.000000
+SET @@global.innodb_defragment_fill_factor = 0.7;
+SELECT @@global.innodb_defragment_fill_factor;
+@@global.innodb_defragment_fill_factor
+0.700000
+SET @@global.innodb_defragment_fill_factor = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_fill_factor value: '-1'
+SELECT @@global.innodb_defragment_fill_factor;
+@@global.innodb_defragment_fill_factor
+0.700000
+SET @@global.innodb_defragment_fill_factor = 2;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_fill_factor value: '2'
+SELECT @@global.innodb_defragment_fill_factor;
+@@global.innodb_defragment_fill_factor
+1.000000
+SET @@global.innodb_defragment_fill_factor = "abc";
+ERROR 42000: Incorrect argument type to variable 'innodb_defragment_fill_factor'
+SELECT @@global.innodb_defragment_fill_factor;
+@@global.innodb_defragment_fill_factor
+1.000000
+SET @@global.innodb_defragment_fill_factor = @start_innodb_defragment_fill_factor;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result
new file mode 100644
index 00000000000..ffbeb39fe33
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result
@@ -0,0 +1,42 @@
+SET @start_innodb_defragment_fill_factor_n_recs = @@global.innodb_defragment_fill_factor_n_recs;
+SELECT @start_innodb_defragment_fill_factor_n_recs;
+@start_innodb_defragment_fill_factor_n_recs
+20
+SELECT COUNT(@@global.innodb_defragment_fill_factor_n_recs);
+COUNT(@@global.innodb_defragment_fill_factor_n_recs)
+1
+SET @@global.innodb_defragment_fill_factor_n_recs = 50;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+@@global.innodb_defragment_fill_factor_n_recs
+50
+SET @@global.innodb_defragment_fill_factor_n_recs = 100;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+@@global.innodb_defragment_fill_factor_n_recs
+100
+SET @@global.innodb_defragment_fill_factor_n_recs = 1;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+@@global.innodb_defragment_fill_factor_n_recs
+1
+SET @@global.innodb_defragment_fill_factor_n_recs = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_fill_factor_n_ value: '-1'
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+@@global.innodb_defragment_fill_factor_n_recs
+1
+SET @@global.innodb_defragment_fill_factor_n_recs = 10000;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_fill_factor_n_ value: '10000'
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+@@global.innodb_defragment_fill_factor_n_recs
+100
+SET @@global.innodb_defragment_fill_factor_n_recs = 10.5;
+ERROR 42000: Incorrect argument type to variable 'innodb_defragment_fill_factor_n_recs'
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+@@global.innodb_defragment_fill_factor_n_recs
+100
+SET @@global.innodb_defragment_fill_factor_n_recs = "abc";
+ERROR 42000: Incorrect argument type to variable 'innodb_defragment_fill_factor_n_recs'
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+@@global.innodb_defragment_fill_factor_n_recs
+100
+SET @@global.innodb_defragment_fill_factor_n_recs = @start_innodb_defragment_fill_factor_n_recs;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result
new file mode 100644
index 00000000000..d4314d6506e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result
@@ -0,0 +1,42 @@
+SET @start_innodb_defragment_frequency = @@global.innodb_defragment_frequency;
+SELECT @start_innodb_defragment_frequency;
+@start_innodb_defragment_frequency
+40
+SELECT COUNT(@@global.innodb_defragment_frequency);
+COUNT(@@global.innodb_defragment_frequency)
+1
+SET @@global.innodb_defragment_frequency = 200;
+SELECT @@global.innodb_defragment_frequency;
+@@global.innodb_defragment_frequency
+200
+SET @@global.innodb_defragment_frequency = 1;
+SELECT @@global.innodb_defragment_frequency;
+@@global.innodb_defragment_frequency
+1
+SET @@global.innodb_defragment_frequency = 1000;
+SELECT @@global.innodb_defragment_frequency;
+@@global.innodb_defragment_frequency
+1000
+SET @@global.innodb_defragment_frequency = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_frequency value: '-1'
+SELECT @@global.innodb_defragment_frequency;
+@@global.innodb_defragment_frequency
+1
+SET @@global.innodb_defragment_frequency = 10000;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_frequency value: '10000'
+SELECT @@global.innodb_defragment_frequency;
+@@global.innodb_defragment_frequency
+1000
+SET @@global.innodb_defragment_frequency = 10.5;
+ERROR 42000: Incorrect argument type to variable 'innodb_defragment_frequency'
+SELECT @@global.innodb_defragment_frequency;
+@@global.innodb_defragment_frequency
+1000
+SET @@global.innodb_defragment_frequency = "abc";
+ERROR 42000: Incorrect argument type to variable 'innodb_defragment_frequency'
+SELECT @@global.innodb_defragment_frequency;
+@@global.innodb_defragment_frequency
+1000
+SET @@global.innodb_defragment_frequency = @start_innodb_defragment_frequency;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result
new file mode 100644
index 00000000000..99b68b39ec4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result
@@ -0,0 +1,28 @@
+SET @start_innodb_defragment_n_pages = @@global.innodb_defragment_n_pages;
+SELECT @start_innodb_defragment_n_pages;
+@start_innodb_defragment_n_pages
+7
+SELECT COUNT(@@global.innodb_defragment_n_pages);
+COUNT(@@global.innodb_defragment_n_pages)
+1
+SET @@global.innodb_defragment_n_pages = 1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_n_pages value: '1'
+SELECT @@global.innodb_defragment_n_pages;
+@@global.innodb_defragment_n_pages
+2
+SET @@global.innodb_defragment_n_pages = 2;
+SELECT @@global.innodb_defragment_n_pages;
+@@global.innodb_defragment_n_pages
+2
+SET @@global.innodb_defragment_n_pages = 32;
+SELECT @@global.innodb_defragment_n_pages;
+@@global.innodb_defragment_n_pages
+32
+SET @@global.innodb_defragment_n_pages = 64;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_n_pages value: '64'
+SELECT @@global.innodb_defragment_n_pages;
+@@global.innodb_defragment_n_pages
+32
+SET @@global.innodb_defragment_n_pages = @start_innodb_defragment_n_pages;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result
new file mode 100644
index 00000000000..025dacdb1ec
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result
@@ -0,0 +1,33 @@
+SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
+SELECT @start_innodb_defragment_stats_accuracy;
+@start_innodb_defragment_stats_accuracy
+0
+SELECT COUNT(@@global.innodb_defragment_stats_accuracy);
+COUNT(@@global.innodb_defragment_stats_accuracy)
+1
+SET @@global.innodb_defragment_stats_accuracy = 1;
+SELECT @@global.innodb_defragment_stats_accuracy;
+@@global.innodb_defragment_stats_accuracy
+1
+SET @@global.innodb_defragment_stats_accuracy = 1000;
+SELECT @@global.innodb_defragment_stats_accuracy;
+@@global.innodb_defragment_stats_accuracy
+1000
+SET @@global.innodb_defragment_stats_accuracy = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_stats_accuracy value: '-1'
+SELECT @@global.innodb_defragment_stats_accuracy;
+@@global.innodb_defragment_stats_accuracy
+0
+SET @@global.innodb_defragment_stats_accuracy = 1000000000000;
+Warnings:
+Warning 1292 Truncated incorrect innodb_defragment_stats_accuracy value: '1000000000000'
+SELECT @@global.innodb_defragment_stats_accuracy;
+@@global.innodb_defragment_stats_accuracy
+4294967295
+SET @@global.innodb_defragment_stats_accuracy = "abc";
+ERROR 42000: Incorrect argument type to variable 'innodb_defragment_stats_accuracy'
+SELECT @@global.innodb_defragment_stats_accuracy;
+@@global.innodb_defragment_stats_accuracy
+4294967295
+SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
diff --git a/mysql-test/suite/sys_vars/r/innodb_disallow_writes_basic.result b/mysql-test/suite/sys_vars/r/innodb_disallow_writes_basic.result
new file mode 100644
index 00000000000..bfb6b67b5d8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_disallow_writes_basic.result
@@ -0,0 +1,45 @@
+#
+# innodb_disallow_writes
+#
+# save the initial value
+SET @innodb_disallow_writes_global_saved = @@global.innodb_disallow_writes;
+# default
+SELECT @@global.innodb_disallow_writes;
+@@global.innodb_disallow_writes
+0
+
+# scope
+SELECT @@session.innodb_disallow_writes;
+ERROR HY000: Variable 'innodb_disallow_writes' is a GLOBAL variable
+SET @@global.innodb_disallow_writes=OFF;
+SELECT @@global.innodb_disallow_writes;
+@@global.innodb_disallow_writes
+0
+SET @@global.innodb_disallow_writes=ON;
+SELECT @@global.innodb_disallow_writes;
+@@global.innodb_disallow_writes
+1
+
+# valid values
+SET @@global.innodb_disallow_writes='OFF';
+SELECT @@global.innodb_disallow_writes;
+@@global.innodb_disallow_writes
+0
+SET @@global.innodb_disallow_writes=ON;
+SELECT @@global.innodb_disallow_writes;
+@@global.innodb_disallow_writes
+1
+SET @@global.innodb_disallow_writes=default;
+SELECT @@global.innodb_disallow_writes;
+@@global.innodb_disallow_writes
+0
+
+# invalid values
+SET @@global.innodb_disallow_writes=NULL;
+ERROR 42000: Variable 'innodb_disallow_writes' can't be set to the value of 'NULL'
+SET @@global.innodb_disallow_writes='junk';
+ERROR 42000: Variable 'innodb_disallow_writes' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.innodb_disallow_writes = @innodb_disallow_writes_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result
index 771c6e917ac..6a1c6df9c89 100644
--- a/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result
@@ -1,17 +1,17 @@
SET @start_value = @@GLOBAL.innodb_empty_free_list_algorithm;
SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
@@GLOBAL.innodb_empty_free_list_algorithm
-legacy
+LEGACY
SELECT @@SESSION.innodb_empty_free_list_algorithm;
ERROR HY000: Variable 'innodb_empty_free_list_algorithm' is a GLOBAL variable
SET GLOBAL innodb_empty_free_list_algorithm='legacy';
SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
@@GLOBAL.innodb_empty_free_list_algorithm
-legacy
+LEGACY
SET GLOBAL innodb_empty_free_list_algorithm='backoff';
SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
@@GLOBAL.innodb_empty_free_list_algorithm
-backoff
+BACKOFF
SET GLOBAL innodb_empty_free_list_algorithm=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_empty_free_list_algorithm'
SET GLOBAL innodb_empty_free_list_algorithm=1e1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_encrypt_log_basic.result b/mysql-test/suite/sys_vars/r/innodb_encrypt_log_basic.result
new file mode 100644
index 00000000000..4beb1a01edf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_encrypt_log_basic.result
@@ -0,0 +1,48 @@
+SELECT @@GLOBAL.innodb_encrypt_log;
+@@GLOBAL.innodb_encrypt_log
+0
+0 Expected
+SET @@GLOBAL.innodb_encrypt_log=1;
+ERROR HY000: Variable 'innodb_encrypt_log' is a read only variable
+Expected error 'Read only variable'
+SELECT @@GLOBAL.innodb_encrypt_log;
+@@GLOBAL.innodb_encrypt_log
+0
+0 Expected
+SELECT IF(@@GLOBAL.innodb_encrypt_log, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_encrypt_log';
+IF(@@GLOBAL.innodb_encrypt_log, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT @@GLOBAL.innodb_encrypt_log;
+@@GLOBAL.innodb_encrypt_log
+0
+0 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_encrypt_log';
+VARIABLE_VALUE
+OFF
+0 Expected
+SELECT @@innodb_encrypt_log = @@GLOBAL.innodb_encrypt_log;
+@@innodb_encrypt_log = @@GLOBAL.innodb_encrypt_log
+1
+1 Expected
+SELECT @@innodb_encrypt_log;
+@@innodb_encrypt_log
+0
+0 Expected
+SELECT COUNT(@@local.innodb_encrypt_log);
+ERROR HY000: Variable 'innodb_encrypt_log' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_encrypt_log);
+ERROR HY000: Variable 'innodb_encrypt_log' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@GLOBAL.innodb_encrypt_log;
+@@GLOBAL.innodb_encrypt_log
+0
+0 Expected
+SELECT innodb_encrypt_log;
+ERROR 42S22: Unknown column 'innodb_encrypt_log' in 'field list'
+Expected error 'Unknown column in field list'
diff --git a/mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result b/mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result
new file mode 100644
index 00000000000..ff48f6dfab0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.innodb_encrypt_tables;
+select @@global.innodb_encrypt_tables;
+@@global.innodb_encrypt_tables
+OFF
+select @@session.innodb_encrypt_tables;
+ERROR HY000: Variable 'innodb_encrypt_tables' is a GLOBAL variable
+show global variables like 'innodb_encrypt_tables';
+Variable_name Value
+innodb_encrypt_tables OFF
+show session variables like 'innodb_encrypt_tables';
+Variable_name Value
+innodb_encrypt_tables OFF
+select * from information_schema.global_variables
+where variable_name='innodb_encrypt_tables';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPT_TABLES OFF
+select * from information_schema.session_variables
+where variable_name='innodb_encrypt_tables';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPT_TABLES OFF
+set global innodb_encrypt_tables=ON;
+ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'ON'
+show warnings;
+Level Code Message
+Warning 138 InnoDB: cannot enable encryption, encryption plugin is not available
+Error 1231 Variable 'innodb_encrypt_tables' can't be set to the value of 'ON'
+select @@global.innodb_encrypt_tables;
+@@global.innodb_encrypt_tables
+OFF
+set global innodb_encrypt_tables=OFF;
+select @@global.innodb_encrypt_tables;
+@@global.innodb_encrypt_tables
+OFF
+set global innodb_encrypt_tables=1;
+ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of '1'
+select @@global.innodb_encrypt_tables;
+@@global.innodb_encrypt_tables
+OFF
+set session innodb_encrypt_tables=1;
+ERROR HY000: Variable 'innodb_encrypt_tables' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_encrypt_tables=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encrypt_tables'
+set global innodb_encrypt_tables=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encrypt_tables'
+set global innodb_encrypt_tables="foo";
+ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'foo'
+SET @@global.innodb_encrypt_tables = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_encryption_rotate_key_age_basic.result b/mysql-test/suite/sys_vars/r/innodb_encryption_rotate_key_age_basic.result
new file mode 100644
index 00000000000..9f4c672f719
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_encryption_rotate_key_age_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.innodb_encryption_rotate_key_age;
+select @@global.innodb_encryption_rotate_key_age;
+@@global.innodb_encryption_rotate_key_age
+1
+select @@session.innodb_encryption_rotate_key_age;
+ERROR HY000: Variable 'innodb_encryption_rotate_key_age' is a GLOBAL variable
+show global variables like 'innodb_encryption_rotate_key_age';
+Variable_name Value
+innodb_encryption_rotate_key_age 1
+show session variables like 'innodb_encryption_rotate_key_age';
+Variable_name Value
+innodb_encryption_rotate_key_age 1
+select * from information_schema.global_variables
+where variable_name='innodb_encryption_rotate_key_age';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPTION_ROTATE_KEY_AGE 1
+select * from information_schema.session_variables
+where variable_name='innodb_encryption_rotate_key_age';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPTION_ROTATE_KEY_AGE 1
+set global innodb_encryption_rotate_key_age=1;
+select @@global.innodb_encryption_rotate_key_age;
+@@global.innodb_encryption_rotate_key_age
+1
+set global innodb_encryption_rotate_key_age=2;
+select @@global.innodb_encryption_rotate_key_age;
+@@global.innodb_encryption_rotate_key_age
+2
+set global innodb_encryption_rotate_key_age=1;
+select @@global.innodb_encryption_rotate_key_age;
+@@global.innodb_encryption_rotate_key_age
+1
+set session innodb_encryption_rotate_key_age=1;
+ERROR HY000: Variable 'innodb_encryption_rotate_key_age' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_encryption_rotate_key_age=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotate_key_age'
+set global innodb_encryption_rotate_key_age=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotate_key_age'
+set global innodb_encryption_rotate_key_age="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotate_key_age'
+SET @@global.innodb_encryption_rotate_key_age = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_encryption_rotation_iops_basic.result b/mysql-test/suite/sys_vars/r/innodb_encryption_rotation_iops_basic.result
new file mode 100644
index 00000000000..5a7267d2815
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_encryption_rotation_iops_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.innodb_encryption_rotation_iops;
+select @@global.innodb_encryption_rotation_iops;
+@@global.innodb_encryption_rotation_iops
+100
+select @@session.innodb_encryption_rotation_iops;
+ERROR HY000: Variable 'innodb_encryption_rotation_iops' is a GLOBAL variable
+show global variables like 'innodb_encryption_rotation_iops';
+Variable_name Value
+innodb_encryption_rotation_iops 100
+show session variables like 'innodb_encryption_rotation_iops';
+Variable_name Value
+innodb_encryption_rotation_iops 100
+select * from information_schema.global_variables
+where variable_name='innodb_encryption_rotation_iops';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPTION_ROTATION_IOPS 100
+select * from information_schema.session_variables
+where variable_name='innodb_encryption_rotation_iops';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPTION_ROTATION_IOPS 100
+set global innodb_encryption_rotation_iops=100;
+select @@global.innodb_encryption_rotation_iops;
+@@global.innodb_encryption_rotation_iops
+100
+set global innodb_encryption_rotation_iops=50;
+select @@global.innodb_encryption_rotation_iops;
+@@global.innodb_encryption_rotation_iops
+50
+set global innodb_encryption_rotation_iops=100;
+select @@global.innodb_encryption_rotation_iops;
+@@global.innodb_encryption_rotation_iops
+100
+set session innodb_encryption_rotation_iops=50;
+ERROR HY000: Variable 'innodb_encryption_rotation_iops' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_encryption_rotation_iops=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotation_iops'
+set global innodb_encryption_rotation_iops=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotation_iops'
+set global innodb_encryption_rotation_iops="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotation_iops'
+SET @@global.innodb_encryption_rotation_iops = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_encryption_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_encryption_threads_basic.result
new file mode 100644
index 00000000000..727a08c9cc6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_encryption_threads_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.innodb_encryption_threads;
+select @@global.innodb_encryption_threads;
+@@global.innodb_encryption_threads
+0
+select @@session.innodb_encryption_threads;
+ERROR HY000: Variable 'innodb_encryption_threads' is a GLOBAL variable
+show global variables like 'innodb_encryption_threads';
+Variable_name Value
+innodb_encryption_threads 0
+show session variables like 'innodb_encryption_threads';
+Variable_name Value
+innodb_encryption_threads 0
+select * from information_schema.global_variables
+where variable_name='innodb_encryption_threads';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPTION_THREADS 0
+select * from information_schema.session_variables
+where variable_name='innodb_encryption_threads';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ENCRYPTION_THREADS 0
+set global innodb_encryption_threads=0;
+select @@global.innodb_encryption_threads;
+@@global.innodb_encryption_threads
+0
+set global innodb_encryption_threads=5;
+select @@global.innodb_encryption_threads;
+@@global.innodb_encryption_threads
+5
+set global innodb_encryption_threads=1;
+select @@global.innodb_encryption_threads;
+@@global.innodb_encryption_threads
+1
+set session innodb_encryption_threads=1;
+ERROR HY000: Variable 'innodb_encryption_threads' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_encryption_threads=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_threads'
+set global innodb_encryption_threads=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_threads'
+set global innodb_encryption_threads="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_encryption_threads'
+SET @@global.innodb_encryption_threads = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result b/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result
new file mode 100644
index 00000000000..a6da229808e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result
@@ -0,0 +1,25 @@
+# Establish connection con1 (user=root)
+# Establish connection con2 (user=root)
+drop table if exists t1;
+# Switch to connection con1
+create table t1 (id integer, x integer) engine = InnoDB;
+insert into t1 values(0, 0);
+set DEBUG_DBUG='+d,fatal-semaphore-timeout';
+set autocommit=0;
+# Sending query on con1,
+# the session will hold lock table mutex and sleep
+SELECT * from t1 where id = 0 FOR UPDATE;
+# Switch to connection con2
+set autocommit=0;
+# Sending query on con2,
+# the session will be blocked on the lock table mutex and
+# thus be put into sync arry
+SELECT * from t1 where id = 0 FOR UPDATE;
+# Switched to the default connection
+# Waitting for mysqld to crash
+# Mysqld crash was detected
+# Waitting for reconnect after mysqld restarts
+# Reconnected after mysqld was successfully restarted
+# Cleaning up before exit
+drop table if exists t1;
+# Clean exit
diff --git a/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold_basic.result b/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold_basic.result
new file mode 100644
index 00000000000..4e1f4721530
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_fatal_semaphore_wait_threshold;
+@@global.innodb_fatal_semaphore_wait_threshold
+600
+select @@session.innodb_fatal_semaphore_wait_threshold;
+ERROR HY000: Variable 'innodb_fatal_semaphore_wait_threshold' is a GLOBAL variable
+show global variables like 'innodb_fatal_semaphore_wait_threshold';
+Variable_name Value
+innodb_fatal_semaphore_wait_threshold 600
+show session variables like 'innodb_fatal_semaphore_wait_threshold';
+Variable_name Value
+innodb_fatal_semaphore_wait_threshold 600
+select * from information_schema.global_variables where variable_name='innodb_fatal_semaphore_wait_threshold';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FATAL_SEMAPHORE_WAIT_THRESHOLD 600
+select * from information_schema.session_variables where variable_name='innodb_fatal_semaphore_wait_threshold';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FATAL_SEMAPHORE_WAIT_THRESHOLD 600
+set global innodb_fatal_semaphore_wait_threshold=1;
+ERROR HY000: Variable 'innodb_fatal_semaphore_wait_threshold' is a read only variable
+set session innodb_fatal_semaphore_wait_threshold=1;
+ERROR HY000: Variable 'innodb_fatal_semaphore_wait_threshold' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_force_primary_key_basic.result b/mysql-test/suite/sys_vars/r/innodb_force_primary_key_basic.result
new file mode 100644
index 00000000000..eda72bd754d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_force_primary_key_basic.result
@@ -0,0 +1,44 @@
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+COUNT(@@GLOBAL.innodb_force_primary_key)
+1
+1 Expected
+SET @@GLOBAL.innodb_force_primary_key=1;
+Expected ok
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+COUNT(@@GLOBAL.innodb_force_primary_key)
+1
+1 Expected
+SELECT IF(@@GLOBAL.innodb_force_primary_key, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_primary_key';
+IF(@@GLOBAL.innodb_force_primary_key, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+COUNT(@@GLOBAL.innodb_force_primary_key)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_primary_key';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_force_primary_key = @@GLOBAL.innodb_force_primary_key;
+@@innodb_force_primary_key = @@GLOBAL.innodb_force_primary_key
+1
+1 Expected
+SELECT COUNT(@@innodb_force_primary_key);
+COUNT(@@innodb_force_primary_key)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_force_primary_key);
+ERROR HY000: Variable 'innodb_force_primary_key' is a GLOBAL variable
+Expected Variable 'innodb_force_primary_key' is a GLOBAL variable
+SELECT COUNT(@@SESSION.innodb_force_primary_key);
+ERROR HY000: Variable 'innodb_force_primary_key' is a GLOBAL variable
+Expected Variable 'innodb_force_primary_key' is a GLOBAL variable
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+COUNT(@@GLOBAL.innodb_force_primary_key)
+1
+1 Expected
diff --git a/mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result b/mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result
index 4ad0ce8d78e..17e67d2b861 100644
--- a/mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result
@@ -1,17 +1,17 @@
SET @start_value = @@GLOBAL.innodb_foreground_preflush;
SELECT @@GLOBAL.innodb_foreground_preflush;
@@GLOBAL.innodb_foreground_preflush
-exponential_backoff
+EXPONENTIAL_BACKOFF
SELECT @@SESSION.innodb_foreground_preflush;
ERROR HY000: Variable 'innodb_foreground_preflush' is a GLOBAL variable
SET GLOBAL innodb_foreground_preflush='sync_preflush';
SELECT @@GLOBAL.innodb_foreground_preflush;
@@GLOBAL.innodb_foreground_preflush
-sync_preflush
+SYNC_PREFLUSH
SET GLOBAL innodb_foreground_preflush='exponential_backoff';
SELECT @@GLOBAL.innodb_foreground_preflush;
@@GLOBAL.innodb_foreground_preflush
-exponential_backoff
+EXPONENTIAL_BACKOFF
SET GLOBAL innodb_foreground_preflush=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_foreground_preflush'
SET GLOBAL innodb_foreground_preflush=1e1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result
new file mode 100644
index 00000000000..a2c328f38fd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result
@@ -0,0 +1,77 @@
+SET @start_global_value = @@global.innodb_idle_flush_pct;
+SELECT @start_global_value;
+@start_global_value
+100
+Valid values are between 0 and 100
+select @@global.innodb_idle_flush_pct between 0 and 100;
+@@global.innodb_idle_flush_pct between 0 and 100
+1
+select @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+100
+select @@session.innodb_idle_flush_pct;
+ERROR HY000: Variable 'innodb_idle_flush_pct' is a GLOBAL variable
+show global variables like 'innodb_idle_flush_pct';
+Variable_name Value
+innodb_idle_flush_pct 100
+show session variables like 'innodb_idle_flush_pct';
+Variable_name Value
+innodb_idle_flush_pct 100
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IDLE_FLUSH_PCT 100
+select * from information_schema.session_variables where variable_name='innodb_idle_flush_pct';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IDLE_FLUSH_PCT 100
+set global innodb_idle_flush_pct=10;
+select @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+10
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IDLE_FLUSH_PCT 10
+select * from information_schema.session_variables where variable_name='innodb_idle_flush_pct';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IDLE_FLUSH_PCT 10
+set session innodb_idle_flush_pct=1;
+ERROR HY000: Variable 'innodb_idle_flush_pct' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_idle_flush_pct=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_idle_flush_pct'
+set global innodb_idle_flush_pct=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_idle_flush_pct'
+set global innodb_idle_flush_pct="bar";
+ERROR 42000: Incorrect argument type to variable 'innodb_idle_flush_pct'
+set global innodb_idle_flush_pct=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_idle_flush_pct value: '-7'
+select @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+0
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IDLE_FLUSH_PCT 0
+set global innodb_idle_flush_pct=106;
+Warnings:
+Warning 1292 Truncated incorrect innodb_idle_flush_pct value: '106'
+select @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+100
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IDLE_FLUSH_PCT 100
+set global innodb_idle_flush_pct=0;
+select @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+0
+set global innodb_idle_flush_pct=100;
+select @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+100
+set global innodb_idle_flush_pct=DEFAULT;
+select @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+100
+SET @@global.innodb_idle_flush_pct = @start_global_value;
+SELECT @@global.innodb_idle_flush_pct;
+@@global.innodb_idle_flush_pct
+100
diff --git a/mysql-test/suite/sys_vars/r/innodb_immediate_scrub_data_uncompressed_basic.result b/mysql-test/suite/sys_vars/r/innodb_immediate_scrub_data_uncompressed_basic.result
new file mode 100644
index 00000000000..5b31918c5d2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_immediate_scrub_data_uncompressed_basic.result
@@ -0,0 +1,50 @@
+SET @start_global_value = @@global.innodb_immediate_scrub_data_uncompressed;
+#
+# exists as global only
+#
+select @@global.innodb_immediate_scrub_data_uncompressed;
+@@global.innodb_immediate_scrub_data_uncompressed
+0
+select @@session.innodb_immediate_scrub_data_uncompressed;
+ERROR HY000: Variable 'innodb_immediate_scrub_data_uncompressed' is a GLOBAL variable
+show global variables like 'innodb_immediate_scrub_data_uncompressed';
+Variable_name Value
+innodb_immediate_scrub_data_uncompressed OFF
+show session variables like 'innodb_immediate_scrub_data_uncompressed';
+Variable_name Value
+innodb_immediate_scrub_data_uncompressed OFF
+select * from information_schema.global_variables
+where variable_name='innodb_immediate_scrub_data_uncompressed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED OFF
+select * from information_schema.session_variables
+where variable_name='innodb_immediate_scrub_data_uncompressed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED OFF
+#
+# show that it's writable
+#
+set global innodb_immediate_scrub_data_uncompressed=ON;
+select @@global.innodb_immediate_scrub_data_uncompressed;
+@@global.innodb_immediate_scrub_data_uncompressed
+1
+set global innodb_immediate_scrub_data_uncompressed=OFF;
+select @@global.innodb_immediate_scrub_data_uncompressed;
+@@global.innodb_immediate_scrub_data_uncompressed
+0
+set global innodb_immediate_scrub_data_uncompressed=1;
+select @@global.innodb_immediate_scrub_data_uncompressed;
+@@global.innodb_immediate_scrub_data_uncompressed
+1
+set session innodb_immediate_scrub_data_uncompressed=1;
+ERROR HY000: Variable 'innodb_immediate_scrub_data_uncompressed' is a GLOBAL variable and should be set with SET GLOBAL
+#
+# incorrect types
+#
+set global innodb_immediate_scrub_data_uncompressed=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_immediate_scrub_data_uncompressed'
+set global innodb_immediate_scrub_data_uncompressed=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_immediate_scrub_data_uncompressed'
+set global innodb_immediate_scrub_data_uncompressed="foo";
+ERROR 42000: Variable 'innodb_immediate_scrub_data_uncompressed' can't be set to the value of 'foo'
+SET @@global.innodb_immediate_scrub_data_uncompressed = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result
new file mode 100644
index 00000000000..dc8fba41e0b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores.result
@@ -0,0 +1,45 @@
+#
+# innodb_instrument_semaphores
+#
+# save the initial value
+SET @innodb_instrument_semaphores_global_saved = @@global.innodb_instrument_semaphores;
+# default
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+
+# scope
+SELECT @@session.innodb_instrument_semaphores;
+ERROR HY000: Variable 'innodb_instrument_semaphores' is a GLOBAL variable
+SET @@global.innodb_instrument_semaphores=OFF;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+SET @@global.innodb_instrument_semaphores=ON;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+1
+
+# valid values
+SET @@global.innodb_instrument_semaphores='OFF';
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+SET @@global.innodb_instrument_semaphores=ON;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+1
+SET @@global.innodb_instrument_semaphores=default;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+
+# invalid values
+SET @@global.innodb_instrument_semaphores=NULL;
+ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'NULL'
+SET @@global.innodb_instrument_semaphores='junk';
+ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result
new file mode 100644
index 00000000000..dc8fba41e0b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result
@@ -0,0 +1,45 @@
+#
+# innodb_instrument_semaphores
+#
+# save the initial value
+SET @innodb_instrument_semaphores_global_saved = @@global.innodb_instrument_semaphores;
+# default
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+
+# scope
+SELECT @@session.innodb_instrument_semaphores;
+ERROR HY000: Variable 'innodb_instrument_semaphores' is a GLOBAL variable
+SET @@global.innodb_instrument_semaphores=OFF;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+SET @@global.innodb_instrument_semaphores=ON;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+1
+
+# valid values
+SET @@global.innodb_instrument_semaphores='OFF';
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+SET @@global.innodb_instrument_semaphores=ON;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+1
+SET @@global.innodb_instrument_semaphores=default;
+SELECT @@global.innodb_instrument_semaphores;
+@@global.innodb_instrument_semaphores
+0
+
+# invalid values
+SET @@global.innodb_instrument_semaphores=NULL;
+ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'NULL'
+SET @@global.innodb_instrument_semaphores='junk';
+ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result
index cb03046c84d..4497e8f208a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result
@@ -1,47 +1,47 @@
SET @orig = @@global.innodb_log_checksum_algorithm;
SELECT @orig;
@orig
-innodb
+INNODB
SET GLOBAL innodb_log_checksum_algorithm = 'crc32';
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-crc32
+CRC32
SET GLOBAL innodb_log_checksum_algorithm = 'strict_crc32';
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-strict_crc32
+STRICT_CRC32
SET GLOBAL innodb_log_checksum_algorithm = 'innodb';
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-innodb
+INNODB
SET GLOBAL innodb_log_checksum_algorithm = 'strict_innodb';
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-strict_innodb
+STRICT_INNODB
SET GLOBAL innodb_log_checksum_algorithm = 'none';
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-none
+NONE
SET GLOBAL innodb_log_checksum_algorithm = 'strict_none';
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_log_checksum_algorithm = '';
ERROR 42000: Variable 'innodb_log_checksum_algorithm' can't be set to the value of ''
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_log_checksum_algorithm = 'foobar';
ERROR 42000: Variable 'innodb_log_checksum_algorithm' can't be set to the value of 'foobar'
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_log_checksum_algorithm = 123;
ERROR 42000: Variable 'innodb_log_checksum_algorithm' can't be set to the value of '123'
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-strict_none
+STRICT_NONE
SET GLOBAL innodb_log_checksum_algorithm = @orig;
SELECT @@global.innodb_log_checksum_algorithm;
@@global.innodb_log_checksum_algorithm
-innodb
+INNODB
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
index 8c0af874228..f7a02ed3548 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
@@ -37,7 +37,12 @@ buffer_pool_bytes_dirty disabled
buffer_pool_pages_free disabled
buffer_pages_created disabled
buffer_pages_written disabled
+buffer_index_pages_written disabled
+buffer_non_index_pages_written disabled
buffer_pages_read disabled
+buffer_pages0_read disabled
+buffer_index_sec_rec_cluster_reads disabled
+buffer_index_sec_rec_cluster_reads_avoided disabled
buffer_data_reads disabled
buffer_data_written disabled
buffer_flush_batch_scanned disabled
@@ -68,9 +73,12 @@ buffer_flush_background_pages disabled
buffer_LRU_batch_scanned disabled
buffer_LRU_batch_num_scan disabled
buffer_LRU_batch_scanned_per_call disabled
-buffer_LRU_batch_total_pages disabled
-buffer_LRU_batches disabled
-buffer_LRU_batch_pages disabled
+buffer_LRU_batch_flush_total_pages disabled
+buffer_LRU_batches_flush disabled
+buffer_LRU_batch_flush_pages disabled
+buffer_LRU_batch_evict_total_pages disabled
+buffer_LRU_batches_evict disabled
+buffer_LRU_batch_evict_pages disabled
buffer_LRU_single_flush_scanned disabled
buffer_LRU_single_flush_num_scan disabled
buffer_LRU_single_flush_scanned_per_call disabled
@@ -160,6 +168,21 @@ compress_pages_compressed disabled
compress_pages_decompressed disabled
compression_pad_increments disabled
compression_pad_decrements disabled
+compress_saved disabled
+compress_trim_sect512 disabled
+compress_trim_sect1024 disabled
+compress_trim_sect2048 disabled
+compress_trim_sect4096 disabled
+compress_trim_sect8192 disabled
+compress_trim_sect16384 disabled
+compress_trim_sect32768 disabled
+compress_pages_page_compressed disabled
+compress_page_compressed_trim_op disabled
+compress_page_compressed_trim_op_saved disabled
+compress_pages_page_decompressed disabled
+compress_pages_page_compression_error disabled
+compress_pages_encrypted disabled
+compress_pages_decrypted disabled
index_page_splits disabled
index_page_merge_attempts disabled
index_page_merge_successful disabled
@@ -193,6 +216,8 @@ innodb_log_flush_usec disabled
innodb_mem_validate_usec disabled
innodb_master_purge_usec disabled
innodb_dict_lru_usec disabled
+innodb_dict_lru_count_active disabled
+innodb_dict_lru_count_idle disabled
innodb_checkpoint_usec disabled
innodb_dblwr_writes disabled
innodb_dblwr_pages_written disabled
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
index 8c0af874228..f7a02ed3548 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
@@ -37,7 +37,12 @@ buffer_pool_bytes_dirty disabled
buffer_pool_pages_free disabled
buffer_pages_created disabled
buffer_pages_written disabled
+buffer_index_pages_written disabled
+buffer_non_index_pages_written disabled
buffer_pages_read disabled
+buffer_pages0_read disabled
+buffer_index_sec_rec_cluster_reads disabled
+buffer_index_sec_rec_cluster_reads_avoided disabled
buffer_data_reads disabled
buffer_data_written disabled
buffer_flush_batch_scanned disabled
@@ -68,9 +73,12 @@ buffer_flush_background_pages disabled
buffer_LRU_batch_scanned disabled
buffer_LRU_batch_num_scan disabled
buffer_LRU_batch_scanned_per_call disabled
-buffer_LRU_batch_total_pages disabled
-buffer_LRU_batches disabled
-buffer_LRU_batch_pages disabled
+buffer_LRU_batch_flush_total_pages disabled
+buffer_LRU_batches_flush disabled
+buffer_LRU_batch_flush_pages disabled
+buffer_LRU_batch_evict_total_pages disabled
+buffer_LRU_batches_evict disabled
+buffer_LRU_batch_evict_pages disabled
buffer_LRU_single_flush_scanned disabled
buffer_LRU_single_flush_num_scan disabled
buffer_LRU_single_flush_scanned_per_call disabled
@@ -160,6 +168,21 @@ compress_pages_compressed disabled
compress_pages_decompressed disabled
compression_pad_increments disabled
compression_pad_decrements disabled
+compress_saved disabled
+compress_trim_sect512 disabled
+compress_trim_sect1024 disabled
+compress_trim_sect2048 disabled
+compress_trim_sect4096 disabled
+compress_trim_sect8192 disabled
+compress_trim_sect16384 disabled
+compress_trim_sect32768 disabled
+compress_pages_page_compressed disabled
+compress_page_compressed_trim_op disabled
+compress_page_compressed_trim_op_saved disabled
+compress_pages_page_decompressed disabled
+compress_pages_page_compression_error disabled
+compress_pages_encrypted disabled
+compress_pages_decrypted disabled
index_page_splits disabled
index_page_merge_attempts disabled
index_page_merge_successful disabled
@@ -193,6 +216,8 @@ innodb_log_flush_usec disabled
innodb_mem_validate_usec disabled
innodb_master_purge_usec disabled
innodb_dict_lru_usec disabled
+innodb_dict_lru_count_active disabled
+innodb_dict_lru_count_idle disabled
innodb_checkpoint_usec disabled
innodb_dblwr_writes disabled
innodb_dblwr_pages_written disabled
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
index 8c0af874228..f7a02ed3548 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
@@ -37,7 +37,12 @@ buffer_pool_bytes_dirty disabled
buffer_pool_pages_free disabled
buffer_pages_created disabled
buffer_pages_written disabled
+buffer_index_pages_written disabled
+buffer_non_index_pages_written disabled
buffer_pages_read disabled
+buffer_pages0_read disabled
+buffer_index_sec_rec_cluster_reads disabled
+buffer_index_sec_rec_cluster_reads_avoided disabled
buffer_data_reads disabled
buffer_data_written disabled
buffer_flush_batch_scanned disabled
@@ -68,9 +73,12 @@ buffer_flush_background_pages disabled
buffer_LRU_batch_scanned disabled
buffer_LRU_batch_num_scan disabled
buffer_LRU_batch_scanned_per_call disabled
-buffer_LRU_batch_total_pages disabled
-buffer_LRU_batches disabled
-buffer_LRU_batch_pages disabled
+buffer_LRU_batch_flush_total_pages disabled
+buffer_LRU_batches_flush disabled
+buffer_LRU_batch_flush_pages disabled
+buffer_LRU_batch_evict_total_pages disabled
+buffer_LRU_batches_evict disabled
+buffer_LRU_batch_evict_pages disabled
buffer_LRU_single_flush_scanned disabled
buffer_LRU_single_flush_num_scan disabled
buffer_LRU_single_flush_scanned_per_call disabled
@@ -160,6 +168,21 @@ compress_pages_compressed disabled
compress_pages_decompressed disabled
compression_pad_increments disabled
compression_pad_decrements disabled
+compress_saved disabled
+compress_trim_sect512 disabled
+compress_trim_sect1024 disabled
+compress_trim_sect2048 disabled
+compress_trim_sect4096 disabled
+compress_trim_sect8192 disabled
+compress_trim_sect16384 disabled
+compress_trim_sect32768 disabled
+compress_pages_page_compressed disabled
+compress_page_compressed_trim_op disabled
+compress_page_compressed_trim_op_saved disabled
+compress_pages_page_decompressed disabled
+compress_pages_page_compression_error disabled
+compress_pages_encrypted disabled
+compress_pages_decrypted disabled
index_page_splits disabled
index_page_merge_attempts disabled
index_page_merge_successful disabled
@@ -193,6 +216,8 @@ innodb_log_flush_usec disabled
innodb_mem_validate_usec disabled
innodb_master_purge_usec disabled
innodb_dict_lru_usec disabled
+innodb_dict_lru_count_active disabled
+innodb_dict_lru_count_idle disabled
innodb_checkpoint_usec disabled
innodb_dblwr_writes disabled
innodb_dblwr_pages_written disabled
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
index 8c0af874228..f7a02ed3548 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
@@ -37,7 +37,12 @@ buffer_pool_bytes_dirty disabled
buffer_pool_pages_free disabled
buffer_pages_created disabled
buffer_pages_written disabled
+buffer_index_pages_written disabled
+buffer_non_index_pages_written disabled
buffer_pages_read disabled
+buffer_pages0_read disabled
+buffer_index_sec_rec_cluster_reads disabled
+buffer_index_sec_rec_cluster_reads_avoided disabled
buffer_data_reads disabled
buffer_data_written disabled
buffer_flush_batch_scanned disabled
@@ -68,9 +73,12 @@ buffer_flush_background_pages disabled
buffer_LRU_batch_scanned disabled
buffer_LRU_batch_num_scan disabled
buffer_LRU_batch_scanned_per_call disabled
-buffer_LRU_batch_total_pages disabled
-buffer_LRU_batches disabled
-buffer_LRU_batch_pages disabled
+buffer_LRU_batch_flush_total_pages disabled
+buffer_LRU_batches_flush disabled
+buffer_LRU_batch_flush_pages disabled
+buffer_LRU_batch_evict_total_pages disabled
+buffer_LRU_batches_evict disabled
+buffer_LRU_batch_evict_pages disabled
buffer_LRU_single_flush_scanned disabled
buffer_LRU_single_flush_num_scan disabled
buffer_LRU_single_flush_scanned_per_call disabled
@@ -160,6 +168,21 @@ compress_pages_compressed disabled
compress_pages_decompressed disabled
compression_pad_increments disabled
compression_pad_decrements disabled
+compress_saved disabled
+compress_trim_sect512 disabled
+compress_trim_sect1024 disabled
+compress_trim_sect2048 disabled
+compress_trim_sect4096 disabled
+compress_trim_sect8192 disabled
+compress_trim_sect16384 disabled
+compress_trim_sect32768 disabled
+compress_pages_page_compressed disabled
+compress_page_compressed_trim_op disabled
+compress_page_compressed_trim_op_saved disabled
+compress_pages_page_decompressed disabled
+compress_pages_page_compression_error disabled
+compress_pages_encrypted disabled
+compress_pages_decrypted disabled
index_page_splits disabled
index_page_merge_attempts disabled
index_page_merge_successful disabled
@@ -193,6 +216,8 @@ innodb_log_flush_usec disabled
innodb_mem_validate_usec disabled
innodb_master_purge_usec disabled
innodb_dict_lru_usec disabled
+innodb_dict_lru_count_active disabled
+innodb_dict_lru_count_idle disabled
innodb_checkpoint_usec disabled
innodb_dblwr_writes disabled
innodb_dblwr_pages_written disabled
diff --git a/mysql-test/suite/sys_vars/r/innodb_mtflush_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_mtflush_threads_basic.result
new file mode 100644
index 00000000000..75a1cc5262e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_mtflush_threads_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_mtflush_threads;
+@@global.innodb_mtflush_threads
+8
+select @@session.innodb_mtflush_threads;
+ERROR HY000: Variable 'innodb_mtflush_threads' is a GLOBAL variable
+show global variables like 'innodb_mtflush_threads';
+Variable_name Value
+innodb_mtflush_threads 8
+show session variables like 'innodb_mtflush_threads';
+Variable_name Value
+innodb_mtflush_threads 8
+select * from information_schema.global_variables where variable_name='innodb_mtflush_threads';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_MTFLUSH_THREADS 8
+select * from information_schema.session_variables where variable_name='innodb_mtflush_threads';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_MTFLUSH_THREADS 8
+set global innodb_mtflush_threads=1;
+ERROR HY000: Variable 'innodb_mtflush_threads' is a read only variable
+set session innodb_mtflush_threads=1;
+ERROR HY000: Variable 'innodb_mtflush_threads' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_prefix_index_cluster_optimization_basic.result b/mysql-test/suite/sys_vars/r/innodb_prefix_index_cluster_optimization_basic.result
new file mode 100644
index 00000000000..57b653bcf5e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_prefix_index_cluster_optimization_basic.result
@@ -0,0 +1,122 @@
+SET @start_global_value = @@global.innodb_prefix_index_cluster_optimization;
+SELECT @start_global_value;
+@start_global_value
+0
+#
+# exists as global only
+#
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_prefix_index_cluster_optimization in (0, 1);
+@@global.innodb_prefix_index_cluster_optimization in (0, 1)
+1
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+0
+select @@session.innodb_prefix_index_cluster_optimization;
+ERROR HY000: Variable 'innodb_prefix_index_cluster_optimization' is a GLOBAL variable
+show global variables like 'innodb_prefix_index_cluster_optimization';
+Variable_name Value
+innodb_prefix_index_cluster_optimization OFF
+show session variables like 'innodb_prefix_index_cluster_optimization';
+Variable_name Value
+innodb_prefix_index_cluster_optimization OFF
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
+#
+# show that it's writable
+#
+set global innodb_prefix_index_cluster_optimization = 'OFF';
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+0
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
+set @@global.innodb_prefix_index_cluster_optimization = 'ON';
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+1
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+set global innodb_prefix_index_cluster_optimization = 0;
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+0
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
+set @@global.innodb_prefix_index_cluster_optimization = 1;
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+1
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+set session innodb_prefix_index_cluster_optimization = 'OFF';
+ERROR HY000: Variable 'innodb_prefix_index_cluster_optimization' is a GLOBAL variable and should be set with SET GLOBAL
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+1
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+set @@session.innodb_prefix_index_cluster_optimization = 'ON';
+ERROR HY000: Variable 'innodb_prefix_index_cluster_optimization' is a GLOBAL variable and should be set with SET GLOBAL
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+1
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+#
+# incorrect types
+#
+set global innodb_prefix_index_cluster_optimization = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_prefix_index_cluster_optimization'
+set global innodb_prefix_index_cluster_optimization = 1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_prefix_index_cluster_optimization'
+set global innodb_prefix_index_cluster_optimization = 2;
+ERROR 42000: Variable 'innodb_prefix_index_cluster_optimization' can't be set to the value of '2'
+set global innodb_prefix_index_cluster_optimization = -3;
+ERROR 42000: Variable 'innodb_prefix_index_cluster_optimization' can't be set to the value of '-3'
+select @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+1
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
+set global innodb_prefix_index_cluster_optimization = 'AUTO';
+ERROR 42000: Variable 'innodb_prefix_index_cluster_optimization' can't be set to the value of 'AUTO'
+#
+# Cleanup
+#
+SET @@global.innodb_prefix_index_cluster_optimization = @start_global_value;
+SELECT @@global.innodb_prefix_index_cluster_optimization;
+@@global.innodb_prefix_index_cluster_optimization
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_scrub_log_basic.result b/mysql-test/suite/sys_vars/r/innodb_scrub_log_basic.result
new file mode 100644
index 00000000000..fc3a31fc5a2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_scrub_log_basic.result
@@ -0,0 +1,48 @@
+SELECT @@GLOBAL.innodb_scrub_log;
+@@GLOBAL.innodb_scrub_log
+0
+0 Expected
+SET @@GLOBAL.innodb_scrub_log=1;
+ERROR HY000: Variable 'innodb_scrub_log' is a read only variable
+Expected error 'Read only variable'
+SELECT @@GLOBAL.innodb_scrub_log;
+@@GLOBAL.innodb_scrub_log
+0
+0 Expected
+SELECT IF(@@GLOBAL.innodb_scrub_log, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log';
+IF(@@GLOBAL.innodb_scrub_log, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT @@GLOBAL.innodb_scrub_log;
+@@GLOBAL.innodb_scrub_log
+0
+0 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log';
+VARIABLE_VALUE
+OFF
+0 Expected
+SELECT @@innodb_scrub_log = @@GLOBAL.innodb_scrub_log;
+@@innodb_scrub_log = @@GLOBAL.innodb_scrub_log
+1
+1 Expected
+SELECT @@innodb_scrub_log;
+@@innodb_scrub_log
+0
+0 Expected
+SELECT @@local.innodb_scrub_log;
+ERROR HY000: Variable 'innodb_scrub_log' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@SESSION.innodb_scrub_log;
+ERROR HY000: Variable 'innodb_scrub_log' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@GLOBAL.innodb_scrub_log;
+@@GLOBAL.innodb_scrub_log
+0
+0 Expected
+SELECT innodb_scrub_log;
+ERROR 42S22: Unknown column 'innodb_scrub_log' in 'field list'
+Expected error 'Unknow column in field list'
diff --git a/mysql-test/suite/sys_vars/r/innodb_scrub_log_speed_basic.result b/mysql-test/suite/sys_vars/r/innodb_scrub_log_speed_basic.result
new file mode 100644
index 00000000000..e51dab0718a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_scrub_log_speed_basic.result
@@ -0,0 +1,53 @@
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+@@GLOBAL.innodb_scrub_log_speed
+256
+200 Expected
+SET @@GLOBAL.innodb_scrub_log_speed=100;
+1 Expected
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+@@GLOBAL.innodb_scrub_log_speed
+100
+100 Expected
+SET @@GLOBAL.innodb_scrub_log_speed=DEFAULT;
+1 Expected
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+@@GLOBAL.innodb_scrub_log_speed
+256
+200 Expected
+SELECT @@GLOBAL.innodb_scrub_log_speed = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log_speed';
+@@GLOBAL.innodb_scrub_log_speed = VARIABLE_VALUE
+1
+1 Expected
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+@@GLOBAL.innodb_scrub_log_speed
+256
+200 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log_speed';
+VARIABLE_VALUE
+256
+200 Expected
+SELECT @@innodb_scrub_log_speed = @@GLOBAL.innodb_scrub_log_speed;
+@@innodb_scrub_log_speed = @@GLOBAL.innodb_scrub_log_speed
+1
+1 Expected
+SELECT @@innodb_scrub_log_speed;
+@@innodb_scrub_log_speed
+256
+200 Expected
+SELECT @@local.innodb_scrub_log_speed;
+ERROR HY000: Variable 'innodb_scrub_log_speed' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@SESSION.innodb_scrub_log_speed;
+ERROR HY000: Variable 'innodb_scrub_log_speed' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+@@GLOBAL.innodb_scrub_log_speed
+256
+200 Expected
+SELECT innodb_scrub_log_speed;
+ERROR 42S22: Unknown column 'innodb_scrub_log_speed' in 'field list'
+Expected error 'Unknow column in field list'
diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
index 0335db8e859..ebb99559255 100644
--- a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
@@ -42,7 +42,9 @@ ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
set global innodb_thread_sleep_delay="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
set global innodb_thread_sleep_delay=18446744073709551616;
-ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
+Warnings:
+Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
+Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '9223372036854775807'
set global innodb_thread_sleep_delay=-7;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7'
diff --git a/mysql-test/suite/sys_vars/r/innodb_use_mtflush_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_mtflush_basic.result
new file mode 100644
index 00000000000..f77abba7ac9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_use_mtflush_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_use_mtflush;
+@@global.innodb_use_mtflush
+0
+select @@session.innodb_use_mtflush;
+ERROR HY000: Variable 'innodb_use_mtflush' is a GLOBAL variable
+show global variables like 'innodb_use_mtflush';
+Variable_name Value
+innodb_use_mtflush OFF
+show session variables like 'innodb_use_mtflush';
+Variable_name Value
+innodb_use_mtflush OFF
+select * from information_schema.global_variables where variable_name='innodb_use_mtflush';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_USE_MTFLUSH OFF
+select * from information_schema.session_variables where variable_name='innodb_use_mtflush';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_USE_MTFLUSH OFF
+set global innodb_use_mtflush=1;
+ERROR HY000: Variable 'innodb_use_mtflush' is a read only variable
+set session innodb_use_mtflush=1;
+ERROR HY000: Variable 'innodb_use_mtflush' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result
new file mode 100644
index 00000000000..63292f5d3c8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result
@@ -0,0 +1,33 @@
+SET @start_use_trim = @@global.innodb_use_trim;
+SELECT @start_use_trim;
+@start_use_trim
+0
+SELECT COUNT(@@GLOBAL.innodb_use_trim);
+COUNT(@@GLOBAL.innodb_use_trim)
+1
+1 Expected
+SET @@GLOBAL.innodb_use_trim=1;
+SELECT COUNT(@@GLOBAL.innodb_use_trim);
+COUNT(@@GLOBAL.innodb_use_trim)
+1
+1 Expected
+SELECT IF(@@GLOBAL.innodb_use_trim, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_trim';
+IF(@@GLOBAL.innodb_use_trim, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_use_trim);
+COUNT(@@GLOBAL.innodb_use_trim)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_trim';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SET @@global.innodb_use_trim = @start_use_trim;
+SELECT @@global.innodb_use_trim;
+@@global.innodb_use_trim
+0
diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result
index 2aa8b7dd80a..48131c96fce 100644
--- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result
@@ -1,20 +1,20 @@
SET @start_global_value = @@global.join_buffer_size;
SELECT @start_global_value;
@start_global_value
-131072
+262144
SET @start_session_value = @@session.join_buffer_size;
SELECT @start_session_value;
@start_session_value
-131072
+262144
'#--------------------FN_DYNVARS_053_01-------------------------#'
SET @@global.join_buffer_size = DEFAULT;
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-131072
+262144
SET @@session.join_buffer_size = DEFAULT;
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-131072
+262144
'#--------------------FN_DYNVARS_053_03-------------------------#'
SET @@global.join_buffer_size = 8200;
Warnings:
@@ -172,8 +172,8 @@ ERROR 42S22: Unknown column 'join_buffer_size' in 'field list'
SET @@global.join_buffer_size = @start_global_value;
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-131072
+262144
SET @@session.join_buffer_size = @start_session_value;
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-131072
+262144
diff --git a/mysql-test/suite/sys_vars/r/log_bin_basename_basic.result b/mysql-test/suite/sys_vars/r/log_bin_basename_basic.result
new file mode 100644
index 00000000000..696e384ac6e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_bin_basename_basic.result
@@ -0,0 +1,21 @@
+select @@global.log_bin_basename;
+@@global.log_bin_basename
+REPLACED
+select @@session.log_bin_basename;
+ERROR HY000: Variable 'log_bin_basename' is a GLOBAL variable
+show global variables like 'log_bin_basename';
+Variable_name Value
+log_bin_basename REPLACED
+show session variables like 'log_bin_basename';
+Variable_name Value
+log_bin_basename REPLACED
+select * from information_schema.global_variables where variable_name='log_bin_basename';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_BASENAME REPLACED
+select * from information_schema.session_variables where variable_name='log_bin_basename';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_BASENAME REPLACED
+set global log_bin_basename=1;
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
+set session log_bin_basename=1;
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_bin_index_basic.result b/mysql-test/suite/sys_vars/r/log_bin_index_basic.result
new file mode 100644
index 00000000000..6b28f5fd3e3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_bin_index_basic.result
@@ -0,0 +1,21 @@
+select @@global.log_bin_index;
+@@global.log_bin_index
+REPLACED
+select @@session.log_bin_index;
+ERROR HY000: Variable 'log_bin_index' is a GLOBAL variable
+show global variables like 'log_bin_index';
+Variable_name Value
+log_bin_index REPLACED
+show session variables like 'log_bin_index';
+Variable_name Value
+log_bin_index REPLACED
+select * from information_schema.global_variables where variable_name='log_bin_index';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_INDEX REPLACED
+select * from information_schema.session_variables where variable_name='log_bin_index';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_INDEX REPLACED
+set global log_bin_index=1;
+ERROR HY000: Variable 'log_bin_index' is a read only variable
+set session log_bin_index=1;
+ERROR HY000: Variable 'log_bin_index' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
new file mode 100644
index 00000000000..daddc4af627
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
@@ -0,0 +1,46 @@
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_long_query_time= @@session.long_query_time;
+SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements;
+USE test;
+CREATE TABLE log_slow_admin_statements (
+i INT PRIMARY KEY AUTO_INCREMENT,
+j VARCHAR(255)
+) ENGINE=InnoDB;
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+SET SESSION long_query_time = 0;
+SET GLOBAL log_slow_admin_statements = on;
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17;
+CREATE PROCEDURE add_rows()
+BEGIN
+DECLARE count INT;
+SET count = 1;
+INSERT INTO log_slow_admin_statements(j) values (REPEAT('A', 255));
+WHILE count <= 15 DO
+INSERT INTO log_slow_admin_statements(j) SELECT j FROM log_slow_admin_statements;
+SET count = count + 1;
+END WHILE;
+END
+$
+CALL add_rows();
+OPTIMIZE TABLE log_slow_admin_statements;
+Table Op Msg_type Msg_text
+test.log_slow_admin_statements optimize note Table does not support optimize, doing recreate + analyze instead
+test.log_slow_admin_statements optimize status OK
+CHECK TABLE log_slow_admin_statements EXTENDED;
+Table Op Msg_type Msg_text
+test.log_slow_admin_statements check status OK
+DROP TABLE log_slow_admin_statements;
+SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%';
+sql_text
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17
+OPTIMIZE TABLE log_slow_admin_statements
+CHECK TABLE log_slow_admin_statements EXTENDED
+DROP TABLE log_slow_admin_statements
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@session.long_query_time= @old_long_query_time;
+SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
+DROP PROCEDURE add_rows;
+TRUNCATE TABLE mysql.slow_log;
diff --git a/mysql-test/suite/sys_vars/r/log_tc_size_basic.result b/mysql-test/suite/sys_vars/r/log_tc_size_basic.result
new file mode 100644
index 00000000000..8097fcf61bd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_tc_size_basic.result
@@ -0,0 +1,4 @@
+SET GLOBAL log_tc_size=1;
+ERROR HY000: Variable 'log_tc_size' is a read only variable
+SET SESSION log_tc_size=1;
+ERROR HY000: Variable 'log_tc_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
index ffa43415bd3..79708c480a8 100644
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
@@ -1,7 +1,7 @@
SET @start_global_value = @@global.max_allowed_packet;
SELECT @start_global_value;
@start_global_value
-1048576
+4194304
SET @@global.max_allowed_packet = DEFAULT;
'#--------------------FN_DYNVARS_070_01-------------------------#'
SET @@global.max_allowed_packet = 1000;
@@ -11,19 +11,19 @@ Warning 1708 The value of 'max_allowed_packet' should be no less than the value
SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = 20000;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SET @@session.max_allowed_packet = DEFAULT;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
'#--------------------FN_DYNVARS_070_02-------------------------#'
SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet = 1048576;
@@global.max_allowed_packet = 1048576
-1
+0
'#--------------------FN_DYNVARS_070_03-------------------------#'
SET @@global.max_allowed_packet = 1024;
Warnings:
@@ -53,27 +53,27 @@ SET @@session.max_allowed_packet = 1024;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = 1025;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = 65535;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = 1073741824;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = 1073741823;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
'#------------------FN_DYNVARS_070_05-----------------------#'
SET @@global.max_allowed_packet = 0;
Warnings:
@@ -116,29 +116,29 @@ SET @@session.max_allowed_packet = 0;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = 1023;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = -2;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = 65530.34;
ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SET @@session.max_allowed_packet = 10737418241;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.max_allowed_packet = test;
ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
'#------------------FN_DYNVARS_070_06-----------------------#'
SELECT @@global.max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -187,7 +187,7 @@ SET max_allowed_packet = 1024;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@max_allowed_packet;
@@max_allowed_packet
-1048576
+4194304
SELECT local.max_allowed_packet;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.max_allowed_packet;
@@ -197,7 +197,7 @@ ERROR 42S22: Unknown column 'max_allowed_packet' in 'field list'
SET @@global.max_allowed_packet = @start_global_value;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
-1048576
+4194304
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
index 1e20776973c..1a848cbae4b 100644
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
@@ -14,7 +14,7 @@ SET @@session.max_allowed_packet = 1024;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1048576
+4194304
SET @@session.net_buffer_length = 1024;
ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.net_buffer_length;
diff --git a/mysql-test/suite/sys_vars/r/max_statement_time_basic.result b/mysql-test/suite/sys_vars/r/max_statement_time_basic.result
new file mode 100644
index 00000000000..8b384ac6765
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_statement_time_basic.result
@@ -0,0 +1,172 @@
+SET @start_global_value = @@global.max_statement_time;
+SELECT @start_global_value;
+@start_global_value
+0
+SET @start_session_value = @@session.max_statement_time;
+SELECT @start_session_value;
+@start_session_value
+0
+'#--------------------FN_DYNVARS_068_01-------------------------#'
+SET @@global.max_statement_time = 100;
+SET @@global.max_statement_time = DEFAULT;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+0.000000
+SET @@session.max_statement_time = 200;
+SET @@session.max_statement_time = DEFAULT;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+0.000000
+'#--------------------FN_DYNVARS_068_02-------------------------#'
+SET @@global.max_statement_time = DEFAULT;
+SELECT @@global.max_statement_time = 0;
+@@global.max_statement_time = 0
+1
+SET @@session.max_statement_time = DEFAULT;
+SELECT @@session.max_statement_time = 0;
+@@session.max_statement_time = 0
+1
+'#--------------------FN_DYNVARS_068_03-------------------------#'
+SET @@global.max_statement_time = 0;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+0.000000
+SET @@global.max_statement_time = 0.123456;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+0.123456
+SET @@global.max_statement_time = 60020;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+60020.000000
+SET @@global.max_statement_time = 31536000;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+31536000.000000
+SET @@global.max_statement_time = 65536;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+65536.000000
+'#--------------------FN_DYNVARS_068_04-------------------------#'
+SET @@session.max_statement_time = 0;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+0.000000
+SET @@session.max_statement_time = 1;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+1.000000
+SET @@session.max_statement_time = 50050;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+50050.000000
+SET @@session.max_statement_time = 31536000;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+31536000.000000
+SET @@session.max_statement_time = 65550;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+65550.000000
+'#------------------FN_DYNVARS_068_05-----------------------#'
+SET @@global.max_statement_time = 100000000000;
+Warnings:
+Warning 1292 Truncated incorrect max_statement_time value: '100000000000'
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+31536000.000000
+SET @@global.max_statement_time = -1;
+Warnings:
+Warning 1292 Truncated incorrect max_statement_time value: '-1'
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+0.000000
+SET @@global.max_statement_time = 65530.34;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+65530.340000
+SET @@global.max_statement_time = test;
+ERROR 42000: Incorrect argument type to variable 'max_statement_time'
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+65530.340000
+SET @@session.max_statement_time = 100000000000;
+Warnings:
+Warning 1292 Truncated incorrect max_statement_time value: '100000000000'
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+31536000.000000
+SET @@session.max_statement_time = -2;
+Warnings:
+Warning 1292 Truncated incorrect max_statement_time value: '-2'
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+0.000000
+SET @@session.max_statement_time = 65530.34;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+65530.340000
+SET @@session.max_statement_time = test;
+ERROR 42000: Incorrect argument type to variable 'max_statement_time'
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+65530.340000
+'#------------------FN_DYNVARS_068_06-----------------------#'
+SELECT @@global.max_statement_time = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_statement_time';
+@@global.max_statement_time = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_068_07-----------------------#'
+SELECT @@session.max_statement_time = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='max_statement_time';
+@@session.max_statement_time = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_068_08-----------------------#'
+SET @@global.max_statement_time = TRUE;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+1.000000
+SET @@global.max_statement_time = FALSE;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+0.000000
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.max_statement_time = 10;
+SELECT @@max_statement_time = @@global.max_statement_time;
+@@max_statement_time = @@global.max_statement_time
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@max_statement_time = 100;
+SELECT @@max_statement_time = @@local.max_statement_time;
+@@max_statement_time = @@local.max_statement_time
+1
+SELECT @@local.max_statement_time = @@session.max_statement_time;
+@@local.max_statement_time = @@session.max_statement_time
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET max_statement_time = 1;
+SELECT @@max_statement_time;
+@@max_statement_time
+1.000000
+SELECT local.max_statement_time;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.max_statement_time;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT max_statement_time = @@session.max_statement_time;
+ERROR 42S22: Unknown column 'max_statement_time' in 'field list'
+#
+# Check that one can use max_statement_time as a field
+#
+drop table if exists t1;
+create table t1 (a int, max_statement_time int);
+drop table t1;
+SET @@global.max_statement_time = @start_global_value;
+SELECT @@global.max_statement_time;
+@@global.max_statement_time
+0.000000
+SET @@session.max_statement_time = @start_session_value;
+SELECT @@session.max_statement_time;
+@@session.max_statement_time
+0.000000
diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result
index 5daf78fcae1..bc6a0740880 100644
--- a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result
@@ -8,87 +8,123 @@ SELECT @start_session_value;
32
'#--------------------FN_DYNVARS_086_01-------------------------#'
SET @@global.max_tmp_tables = 1000;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SET @@global.max_tmp_tables = DEFAULT;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
32
SET @@session.max_tmp_tables = 1000;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SET @@session.max_tmp_tables = DEFAULT;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
32
'#--------------------FN_DYNVARS_086_02-------------------------#'
SET @@global.max_tmp_tables = DEFAULT;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables = 32;
@@global.max_tmp_tables = 32
1
SET @@session.max_tmp_tables = DEFAULT;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables = 32;
@@session.max_tmp_tables = 32
1
'#--------------------FN_DYNVARS_086_03-------------------------#'
SET @@global.max_tmp_tables = 1;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
1
SET @@global.max_tmp_tables = 2;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
2
SET @@global.max_tmp_tables = 65536;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
65536
SET @@global.max_tmp_tables = 4294967295;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
4294967295
SET @@global.max_tmp_tables = 4294967294;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
4294967294
'#--------------------FN_DYNVARS_086_04-------------------------#'
SET @@session.max_tmp_tables = 1;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
1
SET @@session.max_tmp_tables = 2;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
2
SET @@session.max_tmp_tables = 65536;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
65536
SET @@session.max_tmp_tables = 4294967295;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
4294967295
SET @@session.max_tmp_tables = 4294967294;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
4294967294
'#------------------FN_DYNVARS_086_05-----------------------#'
SET @@global.max_tmp_tables = -1024;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '-1024'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
1
SET @@global.max_tmp_tables = 4294967296;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
4294967295
SET @@global.max_tmp_tables = -1;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
1
SET @@global.max_tmp_tables = 429496729500;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
@@ -105,24 +141,28 @@ SELECT @@global.max_tmp_tables;
4294967295
SET @@session.max_tmp_tables = 4294967296;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
4294967295
SET @@session.max_tmp_tables = -1;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
1
SET @@session.max_tmp_tables = 429496729500;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
4294967295
SET @@session.max_tmp_tables = -001;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
@@ -131,6 +171,7 @@ SET @@session.max_tmp_tables = 65530.34;
ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
SET @@session.max_tmp_tables = 10737418241;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '10737418241'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
@@ -154,22 +195,29 @@ WHERE VARIABLE_NAME='max_tmp_tables';
1
'#------------------FN_DYNVARS_086_08-----------------------#'
SET @@global.max_tmp_tables = TRUE;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
1
SET @@global.max_tmp_tables = FALSE;
Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect max_tmp_tables value: '0'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
1
'#---------------------FN_DYNVARS_086_09----------------------#'
SET @@global.max_tmp_tables = 20;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@max_tmp_tables = @@global.max_tmp_tables;
@@max_tmp_tables = @@global.max_tmp_tables
0
'#---------------------FN_DYNVARS_086_10----------------------#'
SET @@max_tmp_tables = 255;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@max_tmp_tables = @@local.max_tmp_tables;
@@max_tmp_tables = @@local.max_tmp_tables
1
@@ -178,6 +226,8 @@ SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
1
'#---------------------FN_DYNVARS_086_11----------------------#'
SET max_tmp_tables = 102;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@max_tmp_tables;
@@max_tmp_tables
102
@@ -188,10 +238,14 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT max_tmp_tables = @@session.max_tmp_tables;
ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list'
SET @@global.max_tmp_tables = @start_global_value;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
32
SET @@session.max_tmp_tables = @start_session_value;
+Warnings:
+Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release.
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
32
diff --git a/mysql-test/suite/sys_vars/r/max_user_connections_func.result b/mysql-test/suite/sys_vars/r/max_user_connections_func.result
index 04999a0a43f..4a71bf1b3f9 100644
--- a/mysql-test/suite/sys_vars/r/max_user_connections_func.result
+++ b/mysql-test/suite/sys_vars/r/max_user_connections_func.result
@@ -2,6 +2,7 @@
SET @default_max_user_connections = @@global.max_user_connections;
Set Global max_user_connections=2;
+CREATE USER test@localhost;
GRANT USAGE on *.* TO test@localhost;
'#--------------------FN_DYNVARS_114_01-------------------------#'
** Connecting conn1 using username 'test' **
diff --git a/mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result b/mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result
deleted file mode 100644
index a43c194e3f9..00000000000
--- a/mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-select @@global.mutex_deadlock_detector;
-@@global.mutex_deadlock_detector
-1
-select @@session.mutex_deadlock_detector;
-ERROR HY000: Variable 'mutex_deadlock_detector' is a GLOBAL variable
-show global variables like 'mutex_deadlock_detector';
-Variable_name Value
-mutex_deadlock_detector ON
-show session variables like 'mutex_deadlock_detector';
-Variable_name Value
-mutex_deadlock_detector ON
-select * from information_schema.global_variables where variable_name='mutex_deadlock_detector';
-VARIABLE_NAME VARIABLE_VALUE
-MUTEX_DEADLOCK_DETECTOR ON
-select * from information_schema.session_variables where variable_name='mutex_deadlock_detector';
-VARIABLE_NAME VARIABLE_VALUE
-MUTEX_DEADLOCK_DETECTOR ON
-set global mutex_deadlock_detector=1;
-ERROR HY000: Variable 'mutex_deadlock_detector' is a read only variable
-set session mutex_deadlock_detector=1;
-ERROR HY000: Variable 'mutex_deadlock_detector' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result b/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
index 15725e757d5..e9150338317 100644
--- a/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
@@ -1,22 +1,22 @@
SET @global_start_value = @@global.myisam_stats_method;
SELECT @global_start_value;
@global_start_value
-nulls_unequal
+NULLS_UNEQUAL
SET @session_start_value = @@session.myisam_stats_method;
SELECT @session_start_value;
@session_start_value
-nulls_unequal
+NULLS_UNEQUAL
'#--------------------FN_DYNVARS_097_01------------------------#'
SET @@global.myisam_stats_method = nulls_equal;
SET @@global.myisam_stats_method = DEFAULT;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
SET @@session.myisam_stats_method = nulls_equal;
SET @@session.myisam_stats_method = DEFAULT;
SELECT @@session.myisam_stats_method;
@@session.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
'#---------------------FN_DYNVARS_097_02-------------------------#'
SET @@global.myisam_stats_method = NULL;
ERROR 42000: Variable 'myisam_stats_method' can't be set to the value of 'NULL'
@@ -30,28 +30,28 @@ ERROR 42000: Variable 'myisam_stats_method' can't be set to the value of ''
SET @@global.myisam_stats_method = 'nulls_equal';
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_equal
+NULLS_EQUAL
SET @@global.myisam_stats_method = 'nulls_unequal';
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
SET @@global.myisam_stats_method = 'nulls_ignored';
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_ignored
+NULLS_IGNORED
'Bug: Value of nulls_ignored is not documented. Its ordinal value is 2'
SET @@session.myisam_stats_method = 'nulls_equal';
SELECT @@session.myisam_stats_method;
@@session.myisam_stats_method
-nulls_equal
+NULLS_EQUAL
SET @@session.myisam_stats_method = 'nulls_unequal';
SELECT @@session.myisam_stats_method;
@@session.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
SET @@session.myisam_stats_method = 'nulls_ignored';
SELECT @@session.myisam_stats_method;
@@session.myisam_stats_method
-nulls_ignored
+NULLS_IGNORED
'#--------------------FN_DYNVARS_097_04-------------------------#'
SET @@global.myisam_stats_method = -1;
ERROR 42000: Variable 'myisam_stats_method' can't be set to the value of '-1'
@@ -81,15 +81,15 @@ WHERE VARIABLE_NAME='myisam_stats_method';
SET @@global.myisam_stats_method = 0;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
SET @@global.myisam_stats_method = 1;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_equal
+NULLS_EQUAL
SET @@global.myisam_stats_method = 2;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_ignored
+NULLS_IGNORED
SET @@global.myisam_stats_method = 0.4;
ERROR 42000: Incorrect argument type to variable 'myisam_stats_method'
SET @@global.myisam_stats_method = 3;
@@ -98,11 +98,11 @@ ERROR 42000: Variable 'myisam_stats_method' can't be set to the value of '3'
SET @@global.myisam_stats_method = TRUE;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_equal
+NULLS_EQUAL
SET @@global.myisam_stats_method = FALSE;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
'#---------------------FN_DYNVARS_097_09----------------------#'
SET myisam_stats_method = 'nulls_equal';
SET session.myisam_stats_method = 'nulls_equal';
@@ -112,16 +112,16 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SET session myisam_stats_method = 'nulls_equal';
SELECT @@myisam_stats_method;
@@myisam_stats_method
-nulls_equal
+NULLS_EQUAL
SET global myisam_stats_method = 'nulls_equal';
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_equal
+NULLS_EQUAL
SET @@global.myisam_stats_method = @global_start_value;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
SET @@session.myisam_stats_method = @session_start_value;
SELECT @@session.myisam_stats_method;
@@session.myisam_stats_method
-nulls_unequal
+NULLS_UNEQUAL
diff --git a/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result b/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
index 5efdeeedc4b..978c8c2d5b2 100644
--- a/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
+++ b/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
@@ -5,10 +5,10 @@ SET @@global.myisam_stats_method = nulls_equal;
'connection con1'
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
-nulls_equal
+NULLS_EQUAL
SELECT @@session.myisam_stats_method;
@@session.myisam_stats_method
-nulls_equal
+NULLS_EQUAL
'#--------------------FN_DYNVARS_097_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
@@ -53,7 +53,7 @@ t1 1 a 1 a A 5 NULL NULL YES BTREE
SET myisam_stats_method = nulls_ignored;
SHOW VARIABLES LIKE 'myisam_stats_method';
Variable_name Value
-myisam_stats_method nulls_ignored
+myisam_stats_method NULLS_IGNORED
DROP TABLE t1;
CREATE TABLE t1 (
a CHAR(3), b CHAR(4), c CHAR(5), d CHAR(6),
diff --git a/mysql-test/suite/sys_vars/r/mysql56_temporal_format_basic.result b/mysql-test/suite/sys_vars/r/mysql56_temporal_format_basic.result
new file mode 100644
index 00000000000..8f4500b2650
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mysql56_temporal_format_basic.result
@@ -0,0 +1,95 @@
+SET @start_value = @@global.mysql56_temporal_format;
+SELECT @start_value;
+@start_value
+1
+'#--------------------FN_DYNVARS_030_01------------------------#'
+SET @@global.mysql56_temporal_format = ON;
+SET @@global.mysql56_temporal_format = DEFAULT;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+1
+'#---------------------FN_DYNVARS_030_02-------------------------#'
+SET @@global.mysql56_temporal_format = @start_value;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+1
+'#--------------------FN_DYNVARS_030_03------------------------#'
+SET @@global.mysql56_temporal_format = ON;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+1
+SET @@global.mysql56_temporal_format = OFF;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+0
+SET @@global.mysql56_temporal_format = 0;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+0
+SET @@global.mysql56_temporal_format = 1;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+1
+'#--------------------FN_DYNVARS_030_04-------------------------#'
+SET @@global.mysql56_temporal_format = 2;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of '2'
+SET @@global.mysql56_temporal_format = -1;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of '-1'
+SET @@global.mysql56_temporal_format = TRUEF;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of 'TRUEF'
+SET @@global.mysql56_temporal_format = TRUE_F;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of 'TRUE_F'
+SET @@global.mysql56_temporal_format = FALSE0;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of 'FALSE0'
+SET @@global.mysql56_temporal_format = OON;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of 'OON'
+SET @@global.mysql56_temporal_format = ONN;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of 'ONN'
+SET @@global.mysql56_temporal_format = OOFF;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of 'OOFF'
+SET @@global.mysql56_temporal_format = 0FF;
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of '0FF'
+SET @@global.mysql56_temporal_format = ' ';
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of ' '
+SET @@global.mysql56_temporal_format = " ";
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of ' '
+SET @@global.mysql56_temporal_format = '';
+ERROR 42000: Variable 'mysql56_temporal_format' can't be set to the value of ''
+'#-------------------FN_DYNVARS_030_05----------------------------#'
+SET @@session.mysql56_temporal_format = 1;
+ERROR HY000: Variable 'mysql56_temporal_format' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.mysql56_temporal_format;
+ERROR HY000: Variable 'mysql56_temporal_format' is a GLOBAL variable
+'#----------------------FN_DYNVARS_030_06------------------------#'
+SELECT IF(@@global.mysql56_temporal_format, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='mysql56_temporal_format';
+IF(@@global.mysql56_temporal_format, "ON", "OFF") = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_030_07----------------------#'
+SET @@global.mysql56_temporal_format = TRUE;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+1
+SET @@global.mysql56_temporal_format = FALSE;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+0
+'#---------------------FN_DYNVARS_030_08----------------------#'
+SET @@global.mysql56_temporal_format = 1;
+SELECT @@mysql56_temporal_format = @@global.mysql56_temporal_format;
+@@mysql56_temporal_format = @@global.mysql56_temporal_format
+1
+'#---------------------FN_DYNVARS_030_09----------------------#'
+SET mysql56_temporal_format = 1;
+ERROR HY000: Variable 'mysql56_temporal_format' is a GLOBAL variable and should be set with SET GLOBAL
+SET global.mysql56_temporal_format = 1;
+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 'mysql56_temporal_format = 1' at line 1
+SELECT global.mysql56_temporal_format;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT mysql56_temporal_format = @@session.mysql56_temporal_format;
+ERROR 42S22: Unknown column 'mysql56_temporal_format' in 'field list'
+SET @@global.mysql56_temporal_format = @start_value;
+SELECT @@global.mysql56_temporal_format;
+@@global.mysql56_temporal_format
+1
diff --git a/mysql-test/suite/sys_vars/r/mysql56_temporal_format_func.result b/mysql-test/suite/sys_vars/r/mysql56_temporal_format_func.result
new file mode 100644
index 00000000000..0f025604606
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mysql56_temporal_format_func.result
@@ -0,0 +1,63 @@
+#
+# MariaDB-5.3 format
+#
+SET @@global.mysql56_temporal_format=false;
+CREATE TABLE t1 (a DATETIME NOT NULL, b DATETIME NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10','2001-01-01 10:10:10');
+SELECT * FROM t1;
+a b
+2001-01-01 10:10:10 2001-01-01 10:10:10
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+FIELD_LENGTH DATA_LENGTH
+8 17
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(5) NOT NULL, b DATETIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10.12345','2001-01-01 10:10:10.12345');
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+FIELD_LENGTH DATA_LENGTH
+7 15
+SELECT * FROM t1;
+a b
+2001-01-01 10:10:10.12345 2001-01-01 10:10:10.12345
+DROP TABLE t1;
+CREATE TABLE t1 (a TIME(5) NOT NULL,b TIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('10:10:10.12345','10:10:10.12345');
+SELECT * FROM t1;
+a b
+10:10:10.12345 10:10:10.12345
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+FIELD_LENGTH DATA_LENGTH
+5 11
+DROP TABLE t1;
+#
+# MySQL-5.6 format
+#
+SET @@global.mysql56_temporal_format=true;
+CREATE TABLE t1 (a DATETIME NOT NULL, b DATETIME NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10','2001-01-01 10:10:10');
+SELECT * FROM t1;
+a b
+2001-01-01 10:10:10 2001-01-01 10:10:10
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+FIELD_LENGTH DATA_LENGTH
+5 11
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(5) NOT NULL, b DATETIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10.12345','2001-01-01 10:10:10.12345');
+SELECT * FROM t1;
+a b
+2001-01-01 10:10:10.12345 2001-01-01 10:10:10.12345
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+FIELD_LENGTH DATA_LENGTH
+8 17
+DROP TABLE t1;
+CREATE TABLE t1 (a TIME(5) NOT NULL,b TIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('10:10:10.12345','10:10:10.12345');
+SELECT * FROM t1;
+a b
+10:10:10.12345 10:10:10.12345
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+FIELD_LENGTH DATA_LENGTH
+6 13
+DROP TABLE t1;
+SET @@global.mysql56_temporal_format=DEFAULT;
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
index 141ab31ea82..97fe3957264 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -1,61 +1,63 @@
SET @start_global_value = @@global.optimizer_switch;
SELECT @start_global_value;
@start_global_value
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
set global optimizer_switch=10;
set session optimizer_switch=5;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
set global optimizer_switch="index_merge_sort_union=on";
set session optimizer_switch="index_merge=off";
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
set session optimizer_switch="default";
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off
set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
+Warnings:
+Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release.
select @@optimizer_switch;
@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on
set global optimizer_switch=1.1;
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
set global optimizer_switch=1e1;
@@ -67,4 +69,4 @@ ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar'
SET @@global.optimizer_switch = @start_global_value;
SELECT @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result
index eb6851baa93..0d7abae094b 100644
--- a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic.result
@@ -1,11 +1,11 @@
SET @start_global_value = @@global.query_alloc_block_size;
SELECT @start_global_value;
@start_global_value
-8192
+16384
SET @start_session_value = @@session.query_alloc_block_size;
SELECT @start_session_value;
@start_session_value
-8192
+16384
'#--------------------FN_DYNVARS_130_01-------------------------#'
SET @@global.query_alloc_block_size = 10000;
Warnings:
@@ -13,22 +13,22 @@ Warning 1292 Truncated incorrect query_alloc_block_size value: '10000'
SET @@global.query_alloc_block_size = DEFAULT;
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
-8192
+16384
SET @@session.query_alloc_block_size = 20000;
Warnings:
Warning 1292 Truncated incorrect query_alloc_block_size value: '20000'
SET @@session.query_alloc_block_size = DEFAULT;
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
-8192
+16384
'#--------------------FN_DYNVARS_130_02-------------------------#'
SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size = 8192;
-@@global.query_alloc_block_size = 8192
+SELECT @@global.query_alloc_block_size = 16384;
+@@global.query_alloc_block_size = 16384
1
SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size = 8192;
-@@session.query_alloc_block_size = 8192
+SELECT @@session.query_alloc_block_size = 16384;
+@@session.query_alloc_block_size = 16384
1
'#--------------------FN_DYNVARS_130_03-------------------------#'
SET @@global.query_alloc_block_size = 1024;
@@ -177,8 +177,8 @@ ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list'
SET @@global.query_alloc_block_size = @start_global_value;
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
-8192
+16384
SET @@session.query_alloc_block_size = @start_session_value;
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
-8192
+16384
diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_func.result b/mysql-test/suite/sys_vars/r/query_cache_limit_func.result
index bbbb273428a..8dde5c3603b 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_func.result
@@ -3,6 +3,8 @@
SET @global_query_cache_limit = @@global.query_cache_limit;
SET @global_query_cache_size = @@global.query_cache_size;
SET @global_query_cache_type = @@global.query_cache_type;
+SET GLOBAL query_cache_type= ON;
+SET LOCAL query_cache_type= ON;
** warnings **
DROP TABLE IF EXISTS t;
** creating table **
diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic.result
index 319948deefa..ee959a45fa0 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic.result
@@ -6,7 +6,7 @@ Warning 1292 Truncated incorrect query_cache_size value: '99'
SET @@global.query_cache_size = DEFAULT;
SELECT @@global.query_cache_size;
@@global.query_cache_size
-0
+1048576
'#---------------------FN_DYNVARS_133_02-------------------------#'
SET @@global.query_cache_size = @start_value;
SELECT @@global.query_cache_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_type_basic.result b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
index bb49d671840..dd59f503527 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
@@ -1,22 +1,22 @@
SET @global_start_value = @@global.query_cache_type;
SELECT @global_start_value;
@global_start_value
-ON
+OFF
SET @session_start_value = @@session.query_cache_type;
SELECT @session_start_value;
@session_start_value
-ON
+OFF
'#--------------------FN_DYNVARS_134_01------------------------#'
SET @@global.query_cache_type = 0;
SET @@global.query_cache_type = DEFAULT;
SELECT @@global.query_cache_type;
@@global.query_cache_type
-ON
+OFF
SET @@session.query_cache_type = 0;
SET @@session.query_cache_type = DEFAULT;
SELECT @@session.query_cache_type;
@@session.query_cache_type
-ON
+OFF
'#---------------------FN_DYNVARS_134_02-------------------------#'
SET @@global.query_cache_type = NULL;
ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'NULL'
@@ -115,8 +115,8 @@ OFF
SET @@global.query_cache_type = @global_start_value;
SELECT @@global.query_cache_type;
@@global.query_cache_type
-ON
+OFF
SET @@session.query_cache_type = @session_start_value;
SELECT @@session.query_cache_type;
@@session.query_cache_type
-ON
+OFF
diff --git a/mysql-test/suite/sys_vars/r/query_cache_type_func.result b/mysql-test/suite/sys_vars/r/query_cache_type_func.result
index af121244572..c016f05e119 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_type_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_type_func.result
@@ -18,9 +18,12 @@ SET @@GLOBAL.query_cache_size = 65536;
SET @@query_cache_type = DEFAULT;
SELECT @@query_cache_type;
@@query_cache_type
-ON
-ON Expected
+OFF
+OFF Expected
+SET @@query_cache_type = ON;
+ERROR HY000: Query cache is globally disabled and you can't enable it only for this session
'#--------------------FN_DYNVARS_135_02-------------------------#'
+SET GLOBAL query_cache_type= ON;
SET @@query_cache_type = NULL;
ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'NULL'
Expected error: Wrong value for variable
diff --git a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
index c4342f3bca8..5868bd597eb 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
@@ -7,6 +7,9 @@ SET @start_global_value = @@GLOBAL.query_cache_wlock_invalidate;
SET @start_session_value = @@SESSION.query_cache_wlock_invalidate;
SET @old_cache_size = @@GLOBAL.query_cache_size;
SET @old_cache_type = @@GLOBAL.query_cache_type;
+SET GLOBAL query_cache_type= ON;
+SET LOCAL query_cache_type= ON;
+SET LOCAL query_cache_type= ON;
CREATE TABLE t1(id int, value varchar(10));
INSERT INTO t1 VALUES(1, 'val1');
INSERT INTO t1 VALUES(2, 'val2');
diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result
index 1fd363ade16..9095dd56ea9 100644
--- a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result
@@ -1,11 +1,11 @@
SET @start_global_value = @@global.query_prealloc_size ;
SELECT @start_global_value;
@start_global_value
-8192
+24576
SET @start_session_value = @@session.query_prealloc_size ;
SELECT @start_session_value;
@start_session_value
-8192
+24576
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.query_prealloc_size = 100;
Warnings:
@@ -13,22 +13,22 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '100'
SET @@global.query_prealloc_size = DEFAULT;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+24576
SET @@session.query_prealloc_size = 200;
Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '200'
SET @@session.query_prealloc_size = DEFAULT;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
-8192
+24576
'#--------------------FN_DYNVARS_005_02-------------------------#'
SET @@global.query_prealloc_size = DEFAULT;
-SELECT @@global.query_prealloc_size = 8192;
-@@global.query_prealloc_size = 8192
+SELECT @@global.query_prealloc_size = 24576;
+@@global.query_prealloc_size = 24576
1
SET @@session.query_prealloc_size = DEFAULT;
-SELECT @@session.query_prealloc_size = 8192;
-@@session.query_prealloc_size = 8192
+SELECT @@session.query_prealloc_size = 24576;
+@@session.query_prealloc_size = 24576
1
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@global.query_prealloc_size = 8192;
@@ -58,53 +58,53 @@ Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
SET @@global.query_prealloc_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
SET @@global.query_prealloc_size = test;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
SET @@global.query_prealloc_size = "test";
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
SET @@global.query_prealloc_size = 'test';
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
SET @@global.query_prealloc_size = ON;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
SET @@session.query_prealloc_size = 0;
Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
-8192
+1024
SET @@session.query_prealloc_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
-8192
+1024
SET @@session.query_prealloc_size = test;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
-8192
+1024
SET @@session.query_prealloc_size = "test";
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
-8192
+1024
'#------------------FN_DYNVARS_005_06-----------------------#'
SELECT @@global.query_prealloc_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -123,13 +123,13 @@ Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '1'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
SET @@global.query_prealloc_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+1024
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.query_prealloc_size = 10;
Warnings:
@@ -153,7 +153,7 @@ Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '1'
SELECT @@query_prealloc_size ;
@@query_prealloc_size
-8192
+1024
SELECT local.query_prealloc_size ;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.query_prealloc_size ;
@@ -163,8 +163,8 @@ ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list'
SET @@global.query_prealloc_size = @start_global_value;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
-8192
+24576
SET @@session.query_prealloc_size = @start_session_value;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
-8192
+24576
diff --git a/mysql-test/suite/sys_vars/r/rand_seed1_basic.result b/mysql-test/suite/sys_vars/r/rand_seed1_basic.result
index 155d7169168..c4244dabcbe 100644
--- a/mysql-test/suite/sys_vars/r/rand_seed1_basic.result
+++ b/mysql-test/suite/sys_vars/r/rand_seed1_basic.result
@@ -1,27 +1,30 @@
select @@global.rand_seed1;
ERROR HY000: Variable 'rand_seed1' is a SESSION variable
+set session rand_seed1=default;
+ERROR 42000: Variable 'rand_seed1' doesn't have a default value
+set session rand_seed1=10969771;
select @@session.rand_seed1;
@@session.rand_seed1
-0
+10969771
show global variables like 'rand_seed1';
Variable_name Value
show session variables like 'rand_seed1';
Variable_name Value
-rand_seed1 0
+rand_seed1 10969771
select * from information_schema.global_variables where variable_name='rand_seed1';
VARIABLE_NAME VARIABLE_VALUE
select * from information_schema.session_variables where variable_name='rand_seed1';
VARIABLE_NAME VARIABLE_VALUE
-RAND_SEED1 0
+RAND_SEED1 10969771
set session rand_seed1=1;
select @@session.rand_seed1;
@@session.rand_seed1
-0
+1
select * from information_schema.global_variables where variable_name='rand_seed1';
VARIABLE_NAME VARIABLE_VALUE
select * from information_schema.session_variables where variable_name='rand_seed1';
VARIABLE_NAME VARIABLE_VALUE
-RAND_SEED1 0
+RAND_SEED1 1
set global rand_seed1=1;
ERROR HY000: Variable 'rand_seed1' is a SESSION variable and can't be used with SET GLOBAL
set session rand_seed1=1.1;
diff --git a/mysql-test/suite/sys_vars/r/rand_seed2_basic.result b/mysql-test/suite/sys_vars/r/rand_seed2_basic.result
index 4974d8a53a3..23e154d0a0e 100644
--- a/mysql-test/suite/sys_vars/r/rand_seed2_basic.result
+++ b/mysql-test/suite/sys_vars/r/rand_seed2_basic.result
@@ -1,27 +1,30 @@
select @@global.rand_seed2;
ERROR HY000: Variable 'rand_seed2' is a SESSION variable
+set session rand_seed2=default;
+ERROR 42000: Variable 'rand_seed2' doesn't have a default value
+set session rand_seed2=10969771;
select @@session.rand_seed2;
@@session.rand_seed2
-0
+10969771
show global variables like 'rand_seed2';
Variable_name Value
show session variables like 'rand_seed2';
Variable_name Value
-rand_seed2 0
+rand_seed2 10969771
select * from information_schema.global_variables where variable_name='rand_seed2';
VARIABLE_NAME VARIABLE_VALUE
select * from information_schema.session_variables where variable_name='rand_seed2';
VARIABLE_NAME VARIABLE_VALUE
-RAND_SEED2 0
+RAND_SEED2 10969771
set session rand_seed2=1;
select @@session.rand_seed2;
@@session.rand_seed2
-0
+1
select * from information_schema.global_variables where variable_name='rand_seed2';
VARIABLE_NAME VARIABLE_VALUE
select * from information_schema.session_variables where variable_name='rand_seed2';
VARIABLE_NAME VARIABLE_VALUE
-RAND_SEED2 0
+RAND_SEED2 1
set global rand_seed2=1;
ERROR HY000: Variable 'rand_seed2' is a SESSION variable and can't be used with SET GLOBAL
set session rand_seed2=1.1;
diff --git a/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result b/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result
new file mode 100644
index 00000000000..10ad3711949
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result
@@ -0,0 +1,24 @@
+include/master-slave.inc
+[connection master]
+select @@global.relay_log_basename;
+@@global.relay_log_basename
+REPLACED
+select @@session.relay_log_basename;
+ERROR HY000: Variable 'relay_log_basename' is a GLOBAL variable
+show global variables like 'relay_log_basename';
+Variable_name Value
+relay_log_basename REPLACED
+show session variables like 'relay_log_basename';
+Variable_name Value
+relay_log_basename REPLACED
+select * from information_schema.global_variables where variable_name='relay_log_basename';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_BASENAME REPLACED
+select * from information_schema.session_variables where variable_name='relay_log_basename';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_BASENAME REPLACED
+set global relay_log_basename=1;
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+set session relay_log_basename=1;
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/relay_log_index_basic.result b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
index d0ceddc96fe..6d8eec9eb30 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
@@ -1,21 +1,45 @@
+include/master-slave.inc
+[connection master]
select @@global.relay_log_index;
@@global.relay_log_index
-mysqld-relay-bin.index
+MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
select @@session.relay_log_index;
ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
show global variables like 'relay_log_index';
Variable_name Value
-relay_log_index mysqld-relay-bin.index
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
show session variables like 'relay_log_index';
Variable_name Value
-relay_log_index mysqld-relay-bin.index
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
select * from information_schema.global_variables where variable_name='relay_log_index';
VARIABLE_NAME VARIABLE_VALUE
-RELAY_LOG_INDEX mysqld-relay-bin.index
+RELAY_LOG_INDEX MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
select * from information_schema.session_variables where variable_name='relay_log_index';
VARIABLE_NAME VARIABLE_VALUE
-RELAY_LOG_INDEX mysqld-relay-bin.index
+RELAY_LOG_INDEX MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
set global relay_log_index=1;
ERROR HY000: Variable 'relay_log_index' is a read only variable
set session relay_log_index=1;
ERROR HY000: Variable 'relay_log_index' is a read only variable
+select @@global.relay_log_index;
+@@global.relay_log_index
+REPLACED
+select @@session.relay_log_index;
+ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
+show global variables like 'relay_log_index';
+Variable_name Value
+relay_log_index REPLACED
+show session variables like 'relay_log_index';
+Variable_name Value
+relay_log_index REPLACED
+select * from information_schema.global_variables where variable_name='relay_log_index';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INDEX REPLACED
+select * from information_schema.session_variables where variable_name='relay_log_index';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INDEX REPLACED
+set global relay_log_index=1;
+ERROR HY000: Variable 'relay_log_index' is a read only variable
+set session relay_log_index=1;
+ERROR HY000: Variable 'relay_log_index' is a read only variable
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_basic.result b/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_basic.result
index 8bc7c845e0b..3fb7719c729 100644
--- a/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_basic.result
@@ -4,7 +4,7 @@
SET @save_replicate_events_marked_for_skip = @@GLOBAL.replicate_events_marked_for_skip;
SELECT @save_replicate_events_marked_for_skip;
@save_replicate_events_marked_for_skip
-replicate
+REPLICATE
# Scope.
SET @@SESSION.replicate_events_marked_for_skip = "";
ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable and should be set with SET GLOBAL
@@ -14,22 +14,22 @@ ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable
SET @@GLOBAL.replicate_events_marked_for_skip=filter_on_master;
SELECT @@GLOBAL.replicate_events_marked_for_skip;
@@GLOBAL.replicate_events_marked_for_skip
-filter_on_master
+FILTER_ON_MASTER
SET @@GLOBAL.replicate_events_marked_for_skip=filter_on_slave;
SELECT @@GLOBAL.replicate_events_marked_for_skip;
@@GLOBAL.replicate_events_marked_for_skip
-filter_on_slave
+FILTER_ON_SLAVE
SET @@GLOBAL.replicate_events_marked_for_skip=replicate;
SELECT @@GLOBAL.replicate_events_marked_for_skip;
@@GLOBAL.replicate_events_marked_for_skip
-replicate
+REPLICATE
SET @@GLOBAL.replicate_events_marked_for_skip=filter;
ERROR 42000: Variable 'replicate_events_marked_for_skip' can't be set to the value of 'filter'
SELECT @@GLOBAL.replicate_events_marked_for_skip;
@@GLOBAL.replicate_events_marked_for_skip
-replicate
+REPLICATE
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='replicate_events_marked_for_skip';
VARIABLE_NAME VARIABLE_VALUE
-REPLICATE_EVENTS_MARKED_FOR_SKIP replicate
+REPLICATE_EVENTS_MARKED_FOR_SKIP REPLICATE
# Cleanup.
SET @@GLOBAL.replicate_events_marked_for_skip = @save_replicate_events_marked_for_skip;
diff --git a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic.result b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic.result
deleted file mode 100644
index 251f428b449..00000000000
--- a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic.result
+++ /dev/null
@@ -1,132 +0,0 @@
-SET @start_global_value = @@global.rpl_recovery_rank;
-SELECT @start_global_value;
-@start_global_value
-0
-'#--------------------FN_DYNVARS_142_01-------------------------#'
-SET @@global.rpl_recovery_rank = 500000;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SET @@global.rpl_recovery_rank = DEFAULT;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-'#--------------------FN_DYNVARS_142_02-------------------------#'
-SET @@global.rpl_recovery_rank = 0;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = 1024;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-1024
-SET @@global.rpl_recovery_rank = 123456789;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-123456789
-SET @@global.rpl_recovery_rank = 2147483648*2;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SET @@global.rpl_recovery_rank = 2147483648*1024;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SET @@global.rpl_recovery_rank = 2147483648*2147483648;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-'#--------------------FN_DYNVARS_142_03-------------------------#'
-SET @@rpl_recovery_rank = 2;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.rpl_recovery_rank = 3;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.rpl_recovery_rank = 4;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_142_04-----------------------#'
-SET @@global.rpl_recovery_rank = -1;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-Warning 1292 Truncated incorrect rpl_recovery_rank value: '-1'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = -2147483648;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483648'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = -2147483649;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483649'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
-SET @@global.rpl_recovery_rank = 2147483649.56;
-ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
-SET @@global.rpl_recovery_rank = 1G;
-ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
-'#------------------FN_DYNVARS_142_05-----------------------#'
-SET @@global.rpl_recovery_rank = 3000;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-@@global.rpl_recovery_rank = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_142_06-----------------------#'
-SELECT count(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_142_07-----------------------#'
-SET @@global.rpl_recovery_rank = TRUE;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-1
-SET @@global.rpl_recovery_rank = FALSE;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-'#---------------------FN_DYNVARS_001_08----------------------#'
-SET @@global.rpl_recovery_rank = 512;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
-@@rpl_recovery_rank = @@global.rpl_recovery_rank
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET rpl_recovery_rank = 2048;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT rpl_recovery_rank;
-ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list'
-SELECT @@rpl_recovery_rank;
-@@rpl_recovery_rank
-512
-SET global rpl_recovery_rank = 64;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SET @@global.rpl_recovery_rank = @start_global_value;
-Warnings:
-Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_basic.result
new file mode 100644
index 00000000000..4900086e9ab
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_basic.result
@@ -0,0 +1,46 @@
+select @@global.rpl_semi_sync_master_wait_point;
+@@global.rpl_semi_sync_master_wait_point
+AFTER_COMMIT
+SET @start_global_value = @@global.rpl_semi_sync_master_wait_point;
+select @@session.rpl_semi_sync_master_wait_point;
+ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable
+show global variables like 'rpl_semi_sync_master_wait_point';
+Variable_name Value
+rpl_semi_sync_master_wait_point AFTER_COMMIT
+show session variables like 'rpl_semi_sync_master_wait_point';
+Variable_name Value
+rpl_semi_sync_master_wait_point AFTER_COMMIT
+select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_point';
+VARIABLE_NAME VARIABLE_VALUE
+RPL_SEMI_SYNC_MASTER_WAIT_POINT AFTER_COMMIT
+select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_point';
+VARIABLE_NAME VARIABLE_VALUE
+RPL_SEMI_SYNC_MASTER_WAIT_POINT AFTER_COMMIT
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+set session rpl_semi_sync_master_wait_point=AFTER_COMMIT;
+ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
+select @@global.rpl_semi_sync_master_wait_point;
+@@global.rpl_semi_sync_master_wait_point
+AFTER_SYNC
+select @@session.rpl_semi_sync_master_wait_point;
+ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable
+show global variables like 'rpl_semi_sync_master_wait_point';
+Variable_name Value
+rpl_semi_sync_master_wait_point AFTER_SYNC
+show session variables like 'rpl_semi_sync_master_wait_point';
+Variable_name Value
+rpl_semi_sync_master_wait_point AFTER_SYNC
+select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_point';
+VARIABLE_NAME VARIABLE_VALUE
+RPL_SEMI_SYNC_MASTER_WAIT_POINT AFTER_SYNC
+select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_point';
+VARIABLE_NAME VARIABLE_VALUE
+RPL_SEMI_SYNC_MASTER_WAIT_POINT AFTER_SYNC
+set global rpl_semi_sync_master_wait_point=1.1;
+ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_wait_point'
+set global rpl_semi_sync_master_wait_point=1e1;
+ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_wait_point'
+SET @@global.rpl_semi_sync_master_wait_point = @start_global_value;
+select @@global.rpl_semi_sync_master_wait_point;
+@@global.rpl_semi_sync_master_wait_point
+AFTER_COMMIT
diff --git a/mysql-test/suite/sys_vars/r/secure_auth_basic.result b/mysql-test/suite/sys_vars/r/secure_auth_basic.result
index 9f12a1760a4..35f283de278 100644
--- a/mysql-test/suite/sys_vars/r/secure_auth_basic.result
+++ b/mysql-test/suite/sys_vars/r/secure_auth_basic.result
@@ -1,19 +1,19 @@
SET @global_start_value = @@global.secure_auth;
SELECT @global_start_value;
@global_start_value
-0
+1
'#--------------------FN_DYNVARS_143_01------------------------#'
SET @@global.secure_auth = 1;
SET @@global.secure_auth = DEFAULT;
SELECT @@global.secure_auth;
@@global.secure_auth
-0
+1
'#---------------------FN_DYNVARS_143_02-------------------------#'
SET secure_auth = 1;
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@secure_auth;
@@secure_auth
-0
+1
SELECT global.secure_auth;
ERROR 42S02: Unknown table 'global' in field list
SET global secure_auth = 1;
@@ -102,4 +102,4 @@ SELECT @@global.secure_auth;
SET @@global.secure_auth = @global_start_value;
SELECT @@global.secure_auth;
@@global.secure_auth
-0
+1
diff --git a/mysql-test/suite/sys_vars/r/show_vs_valstr.result b/mysql-test/suite/sys_vars/r/show_vs_valstr.result
new file mode 100644
index 00000000000..fd59ac1f946
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/show_vs_valstr.result
@@ -0,0 +1,10 @@
+use information_schema;
+select variable_name, s.variable_value, v.global_value
+from global_variables s join system_variables v using (variable_name)
+where not (s.variable_value <=> v.global_value);
+variable_name variable_value global_value
+select variable_name, s.variable_value, v.session_value
+from session_variables s join system_variables v using (variable_name)
+where v.variable_scope != 'GLOBAL' and
+not (s.variable_value <=> v.session_value);
+variable_name variable_value session_value
diff --git a/mysql-test/suite/sys_vars/r/skip_parallel_replication_basic.result b/mysql-test/suite/sys_vars/r/skip_parallel_replication_basic.result
new file mode 100644
index 00000000000..963331805b0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/skip_parallel_replication_basic.result
@@ -0,0 +1,15 @@
+SELECT @@global.skip_parallel_replication;
+ERROR HY000: Variable 'skip_parallel_replication' is a SESSION variable
+SET GLOBAL skip_parallel_replication= 0;
+ERROR HY000: Variable 'skip_parallel_replication' is a SESSION variable and can't be used with SET GLOBAL
+SELECT @@session.skip_parallel_replication;
+@@session.skip_parallel_replication
+0
+SET SESSION skip_parallel_replication= 1;
+SELECT @@session.skip_parallel_replication;
+@@session.skip_parallel_replication
+1
+SET SESSION skip_parallel_replication= 0;
+SELECT @@session.skip_parallel_replication;
+@@session.skip_parallel_replication
+0
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result b/mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result
new file mode 100644
index 00000000000..e4c9134374a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result
@@ -0,0 +1,50 @@
+SET SESSION slave_parallel_mode= none;
+ERROR HY000: Variable 'slave_parallel_mode' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@slave_parallel_mode;
+@@slave_parallel_mode
+minimal
+SELECT @@m1.slave_parallel_mode;
+@@m1.slave_parallel_mode
+NULL
+Warnings:
+Warning 1617 There is no master connection 'm1'
+Warning 1617 There is no master connection 'm1'
+CHANGE MASTER TO master_host='127.0.0.1', master_port=3310, master_user='root';
+SELECT @@``.slave_parallel_mode;
+@@``.slave_parallel_mode
+minimal
+SELECT @@slave_parallel_mode;
+@@slave_parallel_mode
+minimal
+Parallel_Mode = 'minimal'
+SELECT @@m2.slave_parallel_mode;
+@@m2.slave_parallel_mode
+NULL
+Warnings:
+Warning 1617 There is no master connection 'm2'
+Warning 1617 There is no master connection 'm2'
+SET GLOBAL m2.slave_parallel_mode = none;
+Warnings:
+Warning 1617 There is no master connection 'm2'
+CHANGE MASTER 'm1' TO master_host='127.0.0.1', master_port=3311, master_user='root';
+SELECT @@m1.slave_parallel_mode;
+@@m1.slave_parallel_mode
+optimistic
+Parallel_Mode = 'minimal'
+SET GLOBAL m1.slave_parallel_mode= conservative;
+Parallel_Mode = 'minimal'
+SET default_master_connection= 'm1';
+SELECT @@slave_parallel_mode;
+@@slave_parallel_mode
+conservative
+SET GLOBAL slave_parallel_mode= aggressive;
+SELECT @@slave_parallel_mode;
+@@slave_parallel_mode
+aggressive
+Parallel_Mode = 'aggressive'
+SET default_master_connection= '';
+SELECT @@slave_parallel_mode;
+@@slave_parallel_mode
+minimal
+RESET SLAVE ALL;
+RESET SLAVE 'm1' ALL;
diff --git a/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_basic.result b/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_basic.result
new file mode 100644
index 00000000000..02a3cdf27ce
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_basic.result
@@ -0,0 +1,45 @@
+SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= NO;
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+NO
+SET @@global.slave_run_triggers_for_rbr= YES;
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+YES
+SET @@global.slave_run_triggers_for_rbr= LOGGING;
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+LOGGING
+SET @@global.slave_run_triggers_for_rbr= default;
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+NO
+SET @@global.slave_run_triggers_for_rbr= 0;
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+NO
+SET @@global.slave_run_triggers_for_rbr= 1;
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+YES
+SET @@global.slave_run_triggers_for_rbr= 2;
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+LOGGING
+SET @@global.slave_run_triggers_for_rbr= 3;
+ERROR 42000: Variable 'slave_run_triggers_for_rbr' can't be set to the value of '3'
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+LOGGING
+SET @@global.slave_run_triggers_for_rbr= "N";
+ERROR 42000: Variable 'slave_run_triggers_for_rbr' can't be set to the value of 'N'
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+LOGGING
+SET @@global.slave_run_triggers_for_rbr= -1;
+ERROR 42000: Variable 'slave_run_triggers_for_rbr' can't be set to the value of '-1'
+select @@global.slave_run_triggers_for_rbr;
+@@global.slave_run_triggers_for_rbr
+LOGGING
+SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_basic.result b/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
index bf9a83f0380..049404f5648 100644
--- a/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
@@ -42,10 +42,17 @@ ERROR 42000: Variable 'slow_query_log' can't be set to the value of ' '
SET @@global.slow_query_log = '';
ERROR 42000: Variable 'slow_query_log' can't be set to the value of ''
'#-------------------FN_DYNVARS_004_04----------------------------#'
+SET @@global.slow_query_log = ON;
+SET @@session.slow_query_log = ON;
+SELECT @@session.slow_query_log;
+@@session.slow_query_log
+1
SET @@session.slow_query_log = OFF;
-ERROR HY000: Variable 'slow_query_log' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@session.slow_query_log;
-ERROR HY000: Variable 'slow_query_log' is a GLOBAL variable
+@@session.slow_query_log
+0
+SET @@global.slow_query_log = OFF;
+SET @@session.slow_query_log = ON;
'#----------------------FN_DYNVARS_004_05------------------------#'
SELECT IF(@@global.slow_query_log, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -72,12 +79,11 @@ SELECT @@global.slow_query_log;
0
'#---------------------FN_DYNVARS_004_08----------------------#'
SET @@global.slow_query_log = ON;
+SET @@local.slow_query_log = OFF;
SELECT @@slow_query_log = @@global.slow_query_log;
@@slow_query_log = @@global.slow_query_log
-1
+0
'#---------------------FN_DYNVARS_004_09----------------------#'
-SET slow_query_log = ON;
-ERROR HY000: Variable 'slow_query_log' is a GLOBAL variable and should be set with SET GLOBAL
SET local.slow_query_log = OFF;
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 'slow_query_log = OFF' at line 1
SELECT local.slow_query_log;
diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_func.result b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
index f01b2c4c48b..b431f963239 100644
--- a/mysql-test/suite/sys_vars/r/slow_query_log_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
@@ -2,7 +2,7 @@ SET @global_slow_query_log = @@global.slow_query_log;
SET @global_log_output = @@global.log_output;
SET @@session.long_query_time=1;
SET @@global.log_output = 'TABLE';
-'----When slow_query_log = OFF----'
+'----When global.slow_query_log = OFF----'
SET @@global.slow_query_log = OFF;
TRUNCATE mysql.slow_log;
SELECT sleep(2);
@@ -11,7 +11,7 @@ sleep(2)
SELECT count(*) FROM mysql.slow_log;
count(*)
0
-'----When slow_query_log = ON-----'
+'----When global.slow_query_log = ON-----'
SET @@global.slow_query_log = ON;
TRUNCATE mysql.slow_log;
SELECT sleep(2);
@@ -20,6 +20,16 @@ sleep(2)
SELECT count(*) > 0 FROM mysql.slow_log;
count(*) > 0
1
+'----When local.slow_query_log = OFF-----'
+SET @@local.slow_query_log = OFF;
+TRUNCATE mysql.slow_log;
+SELECT sleep(2);
+sleep(2)
+0
+SELECT count(*) FROM mysql.slow_log;
+count(*)
+0
+SET @@local.slow_query_log = ON;
'Bug#47905 stored procedures not logged correctly to slow query log'
TRUNCATE mysql.slow_log;
CREATE PROCEDURE p_test()
diff --git a/mysql-test/suite/sys_vars/r/sql_mode_basic.result b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
index c806fadc4ed..b3c76b12b64 100644
--- a/mysql-test/suite/sys_vars/r/sql_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
@@ -1,22 +1,22 @@
SET @global_start_value = @@global.sql_mode;
SELECT @global_start_value;
@global_start_value
-
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @session_start_value = @@session.sql_mode;
SELECT @session_start_value;
@session_start_value
-
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
'#--------------------FN_DYNVARS_152_01------------------------#'
SET @@global.sql_mode = ANSI;
SET @@global.sql_mode = DEFAULT;
SELECT @@global.sql_mode;
@@global.sql_mode
-
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @@session.sql_mode = ANSI;
SET @@session.sql_mode = DEFAULT;
SELECT @@session.sql_mode;
@@session.sql_mode
-
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
'#---------------------FN_DYNVARS_152_02-------------------------#'
SET @@global.sql_mode = NULL;
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL'
@@ -420,8 +420,8 @@ ANSI_QUOTES
SET @@global.sql_mode = @global_start_value;
SELECT @@global.sql_mode;
@@global.sql_mode
-
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @@session.sql_mode = @session_start_value;
SELECT @@session.sql_mode;
@@session.sql_mode
-
+NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
diff --git a/mysql-test/suite/sys_vars/r/sync_master_info_basic.result b/mysql-test/suite/sys_vars/r/sync_master_info_basic.result
index 940282f629a..ea8b7d7a483 100644
--- a/mysql-test/suite/sys_vars/r/sync_master_info_basic.result
+++ b/mysql-test/suite/sys_vars/r/sync_master_info_basic.result
@@ -1,24 +1,24 @@
SET @start_global_value = @@global.sync_master_info;
SELECT @start_global_value;
@start_global_value
-0
+10000
select @@global.sync_master_info;
@@global.sync_master_info
-0
+10000
select @@session.sync_master_info;
ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable
show global variables like 'sync_master_info';
Variable_name Value
-sync_master_info 0
+sync_master_info 10000
show session variables like 'sync_master_info';
Variable_name Value
-sync_master_info 0
+sync_master_info 10000
select * from information_schema.global_variables where variable_name='sync_master_info';
VARIABLE_NAME VARIABLE_VALUE
-SYNC_MASTER_INFO 0
+SYNC_MASTER_INFO 10000
select * from information_schema.session_variables where variable_name='sync_master_info';
VARIABLE_NAME VARIABLE_VALUE
-SYNC_MASTER_INFO 0
+SYNC_MASTER_INFO 10000
set global sync_master_info=1;
select @@global.sync_master_info;
@@global.sync_master_info
@@ -45,4 +45,4 @@ select @@global.sync_master_info;
SET @@global.sync_master_info = @start_global_value;
SELECT @@global.sync_master_info;
@@global.sync_master_info
-0
+10000
diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result b/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result
index a98fcbfe44c..5196f8ff2dc 100644
--- a/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result
@@ -1,24 +1,24 @@
SET @start_global_value = @@global.sync_relay_log;
SELECT @start_global_value;
@start_global_value
-0
+10000
select @@global.sync_relay_log;
@@global.sync_relay_log
-0
+10000
select @@session.sync_relay_log;
ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable
show global variables like 'sync_relay_log';
Variable_name Value
-sync_relay_log 0
+sync_relay_log 10000
show session variables like 'sync_relay_log';
Variable_name Value
-sync_relay_log 0
+sync_relay_log 10000
select * from information_schema.global_variables where variable_name='sync_relay_log';
VARIABLE_NAME VARIABLE_VALUE
-SYNC_RELAY_LOG 0
+SYNC_RELAY_LOG 10000
select * from information_schema.session_variables where variable_name='sync_relay_log';
VARIABLE_NAME VARIABLE_VALUE
-SYNC_RELAY_LOG 0
+SYNC_RELAY_LOG 10000
set global sync_relay_log=1;
select @@global.sync_relay_log;
@@global.sync_relay_log
@@ -45,4 +45,4 @@ select @@global.sync_relay_log;
SET @@global.sync_relay_log = @start_global_value;
SELECT @@global.sync_relay_log;
@@global.sync_relay_log
-0
+10000
diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result b/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result
index 4900bf166b0..aa84affb7bb 100644
--- a/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result
+++ b/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result
@@ -1,24 +1,24 @@
SET @start_global_value = @@global.sync_relay_log_info;
SELECT @start_global_value;
@start_global_value
-0
+10000
select @@global.sync_relay_log_info;
@@global.sync_relay_log_info
-0
+10000
select @@session.sync_relay_log_info;
ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable
show global variables like 'sync_relay_log_info';
Variable_name Value
-sync_relay_log_info 0
+sync_relay_log_info 10000
show session variables like 'sync_relay_log_info';
Variable_name Value
-sync_relay_log_info 0
+sync_relay_log_info 10000
select * from information_schema.global_variables where variable_name='sync_relay_log_info';
VARIABLE_NAME VARIABLE_VALUE
-SYNC_RELAY_LOG_INFO 0
+SYNC_RELAY_LOG_INFO 10000
select * from information_schema.session_variables where variable_name='sync_relay_log_info';
VARIABLE_NAME VARIABLE_VALUE
-SYNC_RELAY_LOG_INFO 0
+SYNC_RELAY_LOG_INFO 10000
set global sync_relay_log_info=1;
select @@global.sync_relay_log_info;
@@global.sync_relay_log_info
@@ -45,4 +45,4 @@ select @@global.sync_relay_log_info;
SET @@global.sync_relay_log_info = @start_global_value;
SELECT @@global.sync_relay_log_info;
@@global.sync_relay_log_info
-0
+10000
diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff
new file mode 100644
index 00000000000..979f9d8903a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff
@@ -0,0 +1,105 @@
+--- sysvars_aria.result 2015-01-09 11:49:32.000000000 +0100
++++ sysvars_aria,32bit.result 2015-01-09 17:30:11.000000000 +0100
+@@ -7,7 +7,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8192
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Block size to be used for Aria index pages.
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 32768
+@@ -21,7 +21,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 30
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Interval between tries to do an automatic checkpoints. In seconds; 0 means 'no automatic checkpoints' which makes sense only for testing.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -35,7 +35,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1048576
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of bytes that the transaction log has to grow between checkpoints before a new checkpoint is written to the log.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -63,7 +63,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of consecutive log recovery failures after which logs will be automatically deleted to cure the problem; 0 (the default) disables the feature.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 255
+@@ -91,7 +91,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Interval between commite in microseconds (1/1000000c). 0 stands for no waiting for other threads to come and do a commit in "hard" mode and no sync()/commit at all in "soft" mode. Option has only an effect if aria_group_commit is used
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -105,7 +105,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 1073741824
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit for transaction log size
+ NUMERIC_MIN_VALUE 8388608
+ NUMERIC_MAX_VALUE 4294967295
+@@ -147,10 +147,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 300
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in the page cache.
+ NUMERIC_MIN_VALUE 100
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 100
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -175,7 +175,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 100
+@@ -189,7 +189,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 512
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of Aria files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open Aria files.
+ NUMERIC_MIN_VALUE 128
+ NUMERIC_MAX_VALUE 16384
+@@ -231,7 +231,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of threads to use when repairing Aria tables. The value of 1 disables parallel repair.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 128
+@@ -248,7 +248,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria.result b/mysql-test/suite/sys_vars/r/sysvars_aria.result
new file mode 100644
index 00000000000..1308992e771
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result
@@ -0,0 +1,297 @@
+select * from information_schema.system_variables
+where variable_name like 'aria%'
+ order by variable_name;
+VARIABLE_NAME ARIA_BLOCK_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 8192
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8192
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Block size to be used for Aria index pages.
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 32768
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_CHECKPOINT_INTERVAL
+SESSION_VALUE NULL
+GLOBAL_VALUE 30
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Interval between tries to do an automatic checkpoints. In seconds; 0 means 'no automatic checkpoints' which makes sense only for testing.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_CHECKPOINT_LOG_ACTIVITY
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of bytes that the transaction log has to grow between checkpoints before a new checkpoint is written to the log.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_ENCRYPT_TABLES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Encrypt tables (only for tables with ROW_FORMAT=PAGE (default) and not FIXED/DYNAMIC)
+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 ARIA_FORCE_START_AFTER_RECOVERY_FAILURES
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of consecutive log recovery failures after which logs will be automatically deleted to cure the problem; 0 (the default) disables the feature.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 255
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_GROUP_COMMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE none
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE none
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies Aria group commit mode. Possible values are "none" (no group commit), "hard" (with waiting to actual commit), "soft" (no wait for commit (DANGEROUS!!!))
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST none,hard,soft
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_GROUP_COMMIT_INTERVAL
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Interval between commite in microseconds (1/1000000c). 0 stands for no waiting for other threads to come and do a commit in "hard" mode and no sync()/commit at all in "soft" mode. Option has only an effect if aria_group_commit is used
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_FILE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 104857600
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 1073741824
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Limit for transaction log size
+NUMERIC_MIN_VALUE 8388608
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 8192
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_PURGE_TYPE
+SESSION_VALUE NULL
+GLOBAL_VALUE immediate
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE immediate
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how Aria transactional log will be purged
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST immediate,external,at_flush
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_MAX_SORT_FILE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 9223372036853727232
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 9223372036853727232
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1048576
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_PAGECACHE_AGE_THRESHOLD
+SESSION_VALUE NULL
+GLOBAL_VALUE 300
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 300
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in the page cache.
+NUMERIC_MIN_VALUE 100
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 100
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_PAGECACHE_BUFFER_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 8388608
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 134217728
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffer used for index blocks for Aria tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford.
+NUMERIC_MIN_VALUE 131072
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_PAGECACHE_DIVISION_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_PAGECACHE_FILE_HASH_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 512
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 512
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of Aria files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open Aria files.
+NUMERIC_MIN_VALUE 128
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_PAGE_CHECKSUM
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Maintain page checksums (can be overridden per table with PAGE_CHECKSUM clause in CREATE TABLE)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_RECOVER
+SESSION_VALUE NULL
+GLOBAL_VALUE NORMAL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NORMAL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Specifies how corrupted tables should be automatically repaired
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NORMAL,BACKUP,FORCE,QUICK,OFF
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME ARIA_REPAIR_THREADS
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of threads to use when repairing Aria tables. The value of 1 disables parallel repair.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 128
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_SORT_BUFFER_SIZE
+SESSION_VALUE 268434432
+GLOBAL_VALUE 268434432
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 268434432
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_STATS_METHOD
+SESSION_VALUE nulls_unequal
+GLOBAL_VALUE nulls_unequal
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE nulls_unequal
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how Aria index statistics collection code should treat NULLs
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST nulls_unequal,nulls_equal,nulls_ignored
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_SYNC_LOG_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE NEWFILE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NEWFILE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Controls syncing directory after log file growth and new file creation
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NEVER,NEWFILE,ALWAYS
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_USED_FOR_TEMP_TABLES
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether temporary tables should be MyISAM or Aria
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
new file mode 100644
index 00000000000..3164d094528
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
@@ -0,0 +1,11 @@
+--- suite/sys_vars/r/sysvars_debug.result 2014-10-10 13:33:55.000000000 +0300
++++ suite/sys_vars/r/sysvars_debug,32bit.reject 2014-10-10 19:36:44.000000000 +0300
+@@ -21,7 +21,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Extra sleep (in microseconds) to add to binlog fsync(), for debugging
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
diff --git a/mysql-test/suite/sys_vars/r/sysvars_debug.result b/mysql-test/suite/sys_vars/r/sysvars_debug.result
new file mode 100644
index 00000000000..f50e796bff4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_debug.result
@@ -0,0 +1,87 @@
+select * from information_schema.system_variables
+where variable_name like 'debug%'
+ order by variable_name;
+VARIABLE_NAME DEBUG
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Built-in DBUG debugger
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME DEBUG_BINLOG_FSYNC_SLEEP
+SESSION_VALUE NULL
+GLOBAL_VALUE 314
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Extra sleep (in microseconds) to add to binlog fsync(), for debugging
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEBUG_DBUG
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Built-in DBUG debugger
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME DEBUG_MUTEX_DEADLOCK_DETECTOR
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable checking of wrong mutex usage
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME DEBUG_NO_THREAD_ALARM
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Disable system thread alarm calls. Disabling it may be useful in debugging or testing, never do it in production
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME DEBUG_SYNC
+SESSION_VALUE ON - current signal: ''
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Debug Sync Facility
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
new file mode 100644
index 00000000000..5c7e310ce08
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
@@ -0,0 +1,1243 @@
+--- suite/sys_vars/r/sysvars_innodb.result
++++ suite/sys_vars/r/sysvars_innodb,32bit.reject
+@@ -47,13 +47,27 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
++SESSION_VALUE NULL
++GLOBAL_VALUE 1
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Number of InnoDB adaptive hash index partitions (default 1: disable partitioning)
++NUMERIC_MIN_VALUE 1
++NUMERIC_MAX_VALUE 32
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_ADAPTIVE_MAX_SLEEP_DELAY
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 150000
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 150000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The upper limit of the sleep delay in usec. Value of 0 disables it.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000000
+@@ -67,10 +81,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8388608
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.
+ NUMERIC_MIN_VALUE 524288
+-NUMERIC_MAX_VALUE 9223372036854775807
++NUMERIC_MAX_VALUE 2147483647
+ NUMERIC_BLOCK_SIZE 1024
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+@@ -81,7 +95,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Background commit interval in seconds
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1073741824
+@@ -137,7 +151,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB API transaction isolation level
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 3
+@@ -151,7 +165,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 64
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Data file autoextend increment in megabytes
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1000
+@@ -165,7 +179,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT The AUTOINC lock modes supported by InnoDB: 0 => Old style AUTOINC locking (for backward compatibility) 1 => New style AUTOINC locking 2 => No AUTOINC locking (unsafe for SBR)
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 2
+@@ -263,7 +277,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Dump only the hottest N% of each buffer pool, defaults to 100
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 100
+@@ -305,7 +319,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of buffer pool instances, set to higher value on high-end machines to increase scalability
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 64
+@@ -355,6 +369,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_BUFFER_POOL_POPULATE
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Deprecated. This option has no effect and will be removed in MariaDB 10.2.3.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_BUFFER_POOL_SIZE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 8388608
+@@ -375,7 +403,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT A number between [0, 100] that tells how oftern buffer pool dump status in percentages should be printed. E.g. 10 means that buffer pool dump status is printed when every 10% of number of buffer pool pages are dumped. Default is 0 (only start and end status is printed).
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -446,7 +474,7 @@
+ DEFAULT_VALUE ON
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BOOLEAN
+-VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF. Enable InnoDB checksums validation (enabled by default). Disable with --skip-innodb-checksums.
++VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -467,6 +495,104 @@
+ ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_EVICTION_FACTOR
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make page cleaner LRU flushes use evicted instead of flushed page counts for its heuristics
++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 INNODB_CLEANER_FLUSH_CHUNK_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 100
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 100
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Divide page cleaner flush list flush batches into chunks of this size
++NUMERIC_MIN_VALUE 1
++NUMERIC_MAX_VALUE 4294967295
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_FREE_LIST_LWM
++SESSION_VALUE NULL
++GLOBAL_VALUE 10
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 10
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Page cleaner will keep on flushing the same buffer pool instance if its free list length is below this percentage of innodb_lru_scan_depth
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 100
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_LRU_CHUNK_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 100
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 100
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Divide page cleaner LRU list flush batches into chunks of this size
++NUMERIC_MIN_VALUE 1
++NUMERIC_MAX_VALUE 4294967295
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_LSN_AGE_FACTOR
++SESSION_VALUE NULL
++GLOBAL_VALUE HIGH_CHECKPOINT
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE HIGH_CHECKPOINT
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The formula for LSN age factor for page cleaner adaptive flushing. LEGACY: Original Oracle MySQL 5.6 formula. HIGH_CHECKPOINT: (the default) Percona Server 5.6 formula.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST LEGACY,HIGH_CHECKPOINT
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_CLEANER_MAX_FLUSH_TIME
++SESSION_VALUE NULL
++GLOBAL_VALUE 1000
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1000
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT The maximum time limit for a single flush list flush iteration by the page cleaner thread in miliseconds
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 4294967295
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_MAX_LRU_TIME
++SESSION_VALUE NULL
++GLOBAL_VALUE 1000
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1000
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT The maximum time limit for a single LRU tail flush iteration by the page cleaner thread in miliseconds
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 4294967295
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -487,7 +613,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000
+@@ -515,7 +641,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If the compression failure rate of a table is greater than this number more padding is added to the pages to reduce the failures. A value of zero implies no padding
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -543,7 +669,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -557,14 +683,28 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket
+ NUMERIC_MIN_VALUE 1
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CORRUPT_TABLE_ACTION
++SESSION_VALUE NULL
++GLOBAL_VALUE assert
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE assert
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT Warn corruptions of user tables as 'corrupt table' instead of not crashing itself, when used with file_per_table. All file io for the datafile after detected as corrupt are disabled, except for the deletion.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST assert,warn,salvage
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_DATA_FILE_PATH
+ SESSION_VALUE NULL
+ GLOBAL_VALUE ibdata1:12M:autoextend
+@@ -767,7 +907,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 120
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of pages reserved in doublewrite buffer for batch flushing
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 127
+@@ -775,6 +915,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
++SESSION_VALUE NULL
++GLOBAL_VALUE LEGACY
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE BACKOFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The algorithm to use for empty free list handling. Allowed values: LEGACY: Original Oracle MySQL 5.6 handling with single page flushes; BACKOFF: (default) Wait until cleaner produces a free page.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST LEGACY,BACKOFF
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 1
+@@ -845,13 +999,27 @@
+ ENUM_VALUE_LIST OFF,ON,FORCE
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_FAKE_CHANGES
++SESSION_VALUE OFF
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE SESSION
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. This is to cause replication prefetch IO. ATTENTION: the transaction started after enabled is affected.
++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 INNODB_FAST_SHUTDOWN
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 1
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 2
+@@ -865,7 +1033,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 600
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of seconds that semaphore times out in InnoDB.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -935,7 +1103,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Make the first page of the given tablespace dirty.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -949,7 +1117,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 30
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of iterations over which the background flushing is averaged.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1000
+@@ -972,12 +1140,12 @@
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_FLUSH_LOG_AT_TRX_COMMIT
+-SESSION_VALUE NULL
++SESSION_VALUE 1
+ GLOBAL_VALUE 1
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+-VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_SCOPE SESSION
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -1005,7 +1173,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -1047,7 +1215,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 6
+@@ -1055,6 +1223,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_FOREGROUND_PREFLUSH
++SESSION_VALUE NULL
++GLOBAL_VALUE EXPONENTIAL_BACKOFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE EXPONENTIAL_BACKOFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The algorithm InnoDB uses for the query threads at sync preflush. Possible values are SYNC_PREFLUSH: perform a sync preflush as Oracle MySQL; EXPONENTIAL_BACKOFF: (default) wait for the page cleaner flush.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST SYNC_PREFLUSH,EXPONENTIAL_BACKOFF
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_FT_AUX_TABLE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE
+@@ -1075,7 +1257,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8000000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search cache size in bytes
+ NUMERIC_MIN_VALUE 1600000
+ NUMERIC_MAX_VALUE 80000000
+@@ -1117,7 +1299,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 84
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search maximum token size in characters
+ NUMERIC_MIN_VALUE 10
+ NUMERIC_MAX_VALUE 84
+@@ -1131,7 +1313,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 3
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16
+@@ -1145,7 +1327,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search number of words to optimize for each optimize table call
+ NUMERIC_MIN_VALUE 1000
+ NUMERIC_MAX_VALUE 10000
+@@ -1159,7 +1341,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2000000000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search query result cache limit in bytes
+ NUMERIC_MIN_VALUE 1000000
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1187,7 +1369,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -1201,7 +1383,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 640000000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Total memory allocated for InnoDB Fulltext Search cache
+ NUMERIC_MIN_VALUE 32000000
+ NUMERIC_MAX_VALUE 1600000000
+@@ -1229,7 +1411,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Up to what percentage of dirty pages should be flushed when innodb finds it has spare resources to do so.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -1271,10 +1453,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 200
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of IOPs the server can do. Tunes the background IO rate
+ NUMERIC_MIN_VALUE 100
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1283,12 +1465,26 @@
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 2000
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709551615
++DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit to which innodb_io_capacity can be inflated.
+ NUMERIC_MIN_VALUE 100
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_KILL_IDLE_TRANSACTION
++SESSION_VALUE NULL
++GLOBAL_VALUE 0
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 0
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT
++VARIABLE_COMMENT No effect for this build.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 2147483647
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1321,6 +1517,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_LOCKING_FAKE_CHANGES
++SESSION_VALUE NULL
++GLOBAL_VALUE ON
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE ON
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT ###EXPERIMENTAL### if enabled, transactions will get S row locks instead of X locks for fake changes. If disabled, fake change transactions will not take any locks at all.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -1355,7 +1565,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1073741824
+@@ -1363,37 +1573,107 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
+-VARIABLE_NAME INNODB_LOG_BUFFER_SIZE
+-SESSION_VALUE NULL
+-GLOBAL_VALUE 1048576
+-GLOBAL_VALUE_ORIGIN CONFIG
+-DEFAULT_VALUE 16777216
+-VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
+-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
+-ENUM_VALUE_LIST NULL
+-READ_ONLY YES
+-COMMAND_LINE_ARGUMENT REQUIRED
+-VARIABLE_NAME INNODB_LOG_CHECKPOINT_NOW
++VARIABLE_NAME INNODB_LOG_ARCHIVE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE OFF
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BOOLEAN
+-VARIABLE_COMMENT Force checkpoint now
++VARIABLE_COMMENT Set to 1 if you want to have logs archived.
+ 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 INNODB_LOG_COMPRESSED_PAGES
++VARIABLE_NAME INNODB_LOG_ARCH_DIR
+ SESSION_VALUE NULL
+-GLOBAL_VALUE ON
++GLOBAL_VALUE PATH
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE VARCHAR
++VARIABLE_COMMENT Where full logs should be archived.
++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_ARCH_EXPIRE_SEC
++SESSION_VALUE NULL
++GLOBAL_VALUE 0
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 0
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Expiration time for archived innodb transaction logs.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 4294967295
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_LOG_BLOCK_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 512
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 512
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT ###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!
++NUMERIC_MIN_VALUE 512
++NUMERIC_MAX_VALUE 65536
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_LOG_BUFFER_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 1048576
++GLOBAL_VALUE_ORIGIN CONFIG
++DEFAULT_VALUE 16777216
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT
++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 2147483647
++NUMERIC_BLOCK_SIZE 1024
++ENUM_VALUE_LIST NULL
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_LOG_CHECKPOINT_NOW
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Force checkpoint now
++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 INNODB_LOG_CHECKSUM_ALGORITHM
++SESSION_VALUE NULL
++GLOBAL_VALUE INNODB
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE INNODB
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The algorithm InnoDB uses for log block checksums. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Logs created when this option is set to crc32/strict_crc32/none/strict_none will not be readable by any MySQL version or Percona Server versions that donot support this feature
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
++SESSION_VALUE NULL
++GLOBAL_VALUE ON
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE ON
+ VARIABLE_SCOPE GLOBAL
+@@ -1411,7 +1691,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of log files in the log group. InnoDB writes to the files in a circular fashion.
+ NUMERIC_MIN_VALUE 2
+ NUMERIC_MAX_VALUE 100
+@@ -1453,9 +1733,37 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How deep to scan LRU to keep it clean
+ NUMERIC_MIN_VALUE 100
++NUMERIC_MAX_VALUE 4294967295
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_MAX_BITMAP_FILE_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 104857600
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 104857600
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT The maximum size of changed page bitmap files
++NUMERIC_MIN_VALUE 4096
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_MAX_CHANGED_PAGES
++SESSION_VALUE NULL
++GLOBAL_VALUE 1000000
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1000000
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT The maximum number of rows for INFORMATION_SCHEMA.INNODB_CHANGED_PAGES table, 0 - unlimited
++NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 18446744073709551615
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+@@ -1495,10 +1803,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Desired maximum length of the purge queue (0 = no limit)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1509,7 +1817,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum delay of user threads in micro-seconds
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 10000000
+@@ -1523,7 +1831,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of identical copies of log groups we keep for the database. Currently this should be set to 1.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 10
+@@ -1593,7 +1901,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of multi-threaded flush threads
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 64
+@@ -1649,10 +1957,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT How many files at the maximum InnoDB keeps open at the same time.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 9223372036854775807
++NUMERIC_MAX_VALUE 2147483647
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+@@ -1677,7 +1985,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of rw_locks protecting buffer pool page_hash. Rounded up to the next power of 2
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1024
+@@ -1691,7 +1999,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16384
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Page size to use for all InnoDB tablespaces.
+ NUMERIC_MIN_VALUE 4096
+ NUMERIC_MAX_VALUE 65536
+@@ -1727,13 +2035,69 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_PRIORITY_CLEANER
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make buffer pool cleaner and LRU manager threads acquire shared resources with priority
++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 INNODB_PRIORITY_IO
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make I/O threads acquire shared resources with priority
++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 INNODB_PRIORITY_MASTER
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make buffer pool cleaner thread acquire shared resources with priority
++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 INNODB_PRIORITY_PURGE
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make purge coordinator and worker threads acquire shared resources with priority
++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 INNODB_PURGE_BATCH_SIZE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 300
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 300
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of UNDO log pages to purge in one batch from the history list.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 5000
+@@ -1775,7 +2139,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Purge threads can be from 1 to 32. Default is 1.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 32
+@@ -1803,7 +2167,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 56
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 64
+@@ -1817,7 +2181,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of background read I/O threads in InnoDB.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 64
+@@ -1845,10 +2209,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Replication thread delay (ms) on the slave server if innodb_thread_concurrency is reached (0 by default)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1873,7 +2237,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 128
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of undo logs to use (deprecated).
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 128
+@@ -1887,7 +2251,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT An InnoDB page number.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1895,6 +2259,48 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_SCHED_PRIORITY_IO
++SESSION_VALUE NULL
++GLOBAL_VALUE 19
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 19
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Nice value for the I/O handler thread scheduling
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 39
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_SCHED_PRIORITY_MASTER
++SESSION_VALUE NULL
++GLOBAL_VALUE 19
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 19
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Nice value for the master thread scheduling
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 39
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_SCHED_PRIORITY_PURGE
++SESSION_VALUE NULL
++GLOBAL_VALUE 19
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 19
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Nice value for the purge thread scheduling
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 39
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_SCRUB_LOG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -1923,6 +2329,34 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_SHOW_LOCKS_HELD
++SESSION_VALUE NULL
++GLOBAL_VALUE 10
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 10
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Number of locks held to print for each InnoDB transaction in SHOW INNODB STATUS.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 1000
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_SHOW_VERBOSE_LOCKS
++SESSION_VALUE NULL
++GLOBAL_VALUE 0
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 0
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE INT UNSIGNED
++VARIABLE_COMMENT Whether to show records locked in SHOW INNODB STATUS.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 1
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 0
+@@ -1943,7 +2377,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1048576
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Memory buffer size for index creation
+ NUMERIC_MIN_VALUE 65536
+ NUMERIC_MAX_VALUE 67108864
+@@ -1957,10 +2391,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 6
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum delay between polling for a spin lock (6 by default)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2000,7 +2434,7 @@
+ DEFAULT_VALUE nulls_equal
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE ENUM
+-VARIABLE_COMMENT Specifies how InnoDB index statistics collection code should treat NULLs. Possible values are NULLS_EQUAL (default), NULLS_UNEQUAL and NULLS_IGNORED
++VARIABLE_COMMENT Specifies how InnoDB index statistics collection code should treat NULLs
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -2167,7 +2601,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Size of the mutex/lock wait array.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1024
+@@ -2181,10 +2615,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 30
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Count of spin-loop rounds in InnoDB mutexes (30 by default)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2209,7 +2643,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000
+@@ -2223,7 +2657,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000000
+@@ -2245,6 +2679,34 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Track the redo log for changed pages and output a changed page bitmap
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
++VARIABLE_NAME INNODB_TRACK_REDO_LOG_NOW
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Force log tracker to catch up with checkpoint now
++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 INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2293,7 +2755,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 128
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of undo logs to use.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 128
+@@ -2307,7 +2769,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ 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 126
+@@ -2322,7 +2784,7 @@
+ DEFAULT_VALUE OFF
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BOOLEAN
+-VARIABLE_COMMENT Prevent partial page writes, via atomic writes.The option is used to prevent partial writes in case of a crash/poweroff, as faster alternative to doublewrite buffer.Currently this option works only on Linux only with FusionIO device, and directFS filesystem.
++VARIABLE_COMMENT Prevent partial page writes, via atomic writes (beta). The option is used to prevent partial writes in case of a crash/poweroff, as faster alternative to doublewrite buffer. Currently this option works only on Linux only with FusionIO device, and directFS filesystem.
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -2343,6 +2805,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT NONE
++VARIABLE_NAME INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
++SESSION_VALUE NULL
++GLOBAL_VALUE ON
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE ON
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Use global innodb_flush_log_at_trx_commit value. (default: ON).
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_MTFLUSH
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2357,6 +2833,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT NONE
++VARIABLE_NAME INNODB_USE_STACKTRACE
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Print stacktrace on long semaphore wait (off by default supported only on linux)
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_SYS_MALLOC
+ SESSION_VALUE NULL
+ GLOBAL_VALUE ON
+@@ -2387,12 +2877,12 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_VERSION
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 5.6.37
++GLOBAL_VALUE 5.6.36-82.2
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE NULL
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE VARCHAR
+-VARIABLE_COMMENT InnoDB version
++VARIABLE_COMMENT Percona-InnoDB-plugin version
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -2405,7 +2895,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of background write I/O threads in InnoDB.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 64
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
new file mode 100644
index 00000000000..46148b1d6ba
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
@@ -0,0 +1,571 @@
+--- suite/sys_vars/r/sysvars_innodb.result
++++ suite/sys_vars/r/sysvars_innodb,32bit.reject
+@@ -53,7 +53,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 150000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The upper limit of the sleep delay in usec. Value of 0 disables it.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000000
+@@ -67,10 +67,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8388608
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.
+ NUMERIC_MIN_VALUE 524288
+-NUMERIC_MAX_VALUE 9223372036854775807
++NUMERIC_MAX_VALUE 2147483647
+ NUMERIC_BLOCK_SIZE 1024
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+@@ -81,7 +81,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Background commit interval in seconds
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1073741824
+@@ -137,7 +137,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB API transaction isolation level
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 3
+@@ -151,7 +151,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 64
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Data file autoextend increment in megabytes
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1000
+@@ -165,7 +165,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT The AUTOINC lock modes supported by InnoDB: 0 => Old style AUTOINC locking (for backward compatibility) 1 => New style AUTOINC locking 2 => No AUTOINC locking (unsafe for SBR)
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 2
+@@ -263,7 +263,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Dump only the hottest N% of each buffer pool, defaults to 100
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 100
+@@ -305,7 +305,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of buffer pool instances, set to higher value on high-end machines to increase scalability
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 64
+@@ -375,7 +375,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT A number between [0, 100] that tells how oftern buffer pool dump status in percentages should be printed. E.g. 10 means that buffer pool dump status is printed when every 10% of number of buffer pool pages are dumped. Default is 0 (only start and end status is printed).
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -487,7 +487,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000
+@@ -515,7 +515,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If the compression failure rate of a table is greater than this number more padding is added to the pages to reduce the failures. A value of zero implies no padding
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -543,7 +543,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -557,10 +557,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket
+ NUMERIC_MIN_VALUE 1
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -767,7 +767,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 120
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of pages reserved in doublewrite buffer for batch flushing
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 127
+@@ -851,7 +851,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 2
+@@ -865,7 +865,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 600
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of seconds that semaphore times out in InnoDB.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -935,7 +935,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Make the first page of the given tablespace dirty.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -949,7 +949,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 30
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of iterations over which the background flushing is averaged.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1000
+@@ -977,7 +977,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -1005,7 +1005,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -1047,7 +1047,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 6
+@@ -1075,7 +1075,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8000000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search cache size in bytes
+ NUMERIC_MIN_VALUE 1600000
+ NUMERIC_MAX_VALUE 80000000
+@@ -1117,7 +1117,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 84
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search maximum token size in characters
+ NUMERIC_MIN_VALUE 10
+ NUMERIC_MAX_VALUE 84
+@@ -1131,7 +1131,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 3
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16
+@@ -1145,7 +1145,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search number of words to optimize for each optimize table call
+ NUMERIC_MIN_VALUE 1000
+ NUMERIC_MAX_VALUE 10000
+@@ -1159,7 +1159,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2000000000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT InnoDB Fulltext search query result cache limit in bytes
+ NUMERIC_MIN_VALUE 1000000
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1187,7 +1187,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ 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
+@@ -1201,7 +1201,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 640000000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Total memory allocated for InnoDB Fulltext Search cache
+ NUMERIC_MIN_VALUE 32000000
+ NUMERIC_MAX_VALUE 1600000000
+@@ -1229,7 +1229,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Up to what percentage of dirty pages should be flushed when innodb finds it has spare resources to do so.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -1271,10 +1271,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 200
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of IOPs the server can do. Tunes the background IO rate
+ NUMERIC_MIN_VALUE 100
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1283,12 +1283,12 @@
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 2000
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709551615
++DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit to which innodb_io_capacity can be inflated.
+ NUMERIC_MIN_VALUE 100
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1355,7 +1355,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1073741824
+@@ -1369,10 +1369,10 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 16777216
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ 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
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+@@ -1411,7 +1411,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of log files in the log group. InnoDB writes to the files in a circular fashion.
+ NUMERIC_MIN_VALUE 2
+ NUMERIC_MAX_VALUE 100
+@@ -1453,10 +1453,10 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How deep to scan LRU to keep it clean
+ NUMERIC_MIN_VALUE 100
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1495,10 +1495,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Desired maximum length of the purge queue (0 = no limit)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1509,7 +1509,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum delay of user threads in micro-seconds
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 10000000
+@@ -1523,7 +1523,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of identical copies of log groups we keep for the database. Currently this should be set to 1.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 10
+@@ -1593,7 +1593,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of multi-threaded flush threads
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 64
+@@ -1649,10 +1649,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT How many files at the maximum InnoDB keeps open at the same time.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 9223372036854775807
++NUMERIC_MAX_VALUE 2147483647
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+@@ -1677,7 +1677,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of rw_locks protecting buffer pool page_hash. Rounded up to the next power of 2
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1024
+@@ -1691,7 +1691,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16384
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Page size to use for all InnoDB tablespaces.
+ NUMERIC_MIN_VALUE 4096
+ NUMERIC_MAX_VALUE 65536
+@@ -1733,7 +1733,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 300
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of UNDO log pages to purge in one batch from the history list.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 5000
+@@ -1775,7 +1775,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Purge threads can be from 1 to 32. Default is 1.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 32
+@@ -1803,7 +1803,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 56
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 64
+@@ -1817,7 +1817,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of background read I/O threads in InnoDB.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 64
+@@ -1845,10 +1845,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Replication thread delay (ms) on the slave server if innodb_thread_concurrency is reached (0 by default)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1873,7 +1873,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 128
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of undo logs to use (deprecated).
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 128
+@@ -1887,7 +1887,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT An InnoDB page number.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1943,7 +1943,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1048576
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Memory buffer size for index creation
+ NUMERIC_MIN_VALUE 65536
+ NUMERIC_MAX_VALUE 67108864
+@@ -1957,10 +1957,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 6
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum delay between polling for a spin lock (6 by default)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2167,7 +2167,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Size of the mutex/lock wait array.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1024
+@@ -2181,10 +2181,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 30
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Count of spin-loop rounds in InnoDB mutexes (30 by default)
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2209,7 +2209,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000
+@@ -2223,7 +2223,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000000
+@@ -2293,7 +2293,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 128
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of undo logs to use.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 128
+@@ -2307,7 +2307,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ 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 126
+@@ -2405,7 +2405,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of background write I/O threads in InnoDB.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 64
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
new file mode 100644
index 00000000000..0a2757c5138
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
@@ -0,0 +1,688 @@
+--- suite/sys_vars/r/sysvars_innodb.result
++++ suite/sys_vars/r/sysvars_innodb,xtradb.reject
+@@ -47,6 +47,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
++SESSION_VALUE NULL
++GLOBAL_VALUE 1
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Number of InnoDB adaptive hash index partitions (default 1: disable partitioning)
++NUMERIC_MIN_VALUE 1
++NUMERIC_MAX_VALUE 64
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_ADAPTIVE_MAX_SLEEP_DELAY
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 150000
+@@ -355,6 +369,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_BUFFER_POOL_POPULATE
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Deprecated. This option has no effect and will be removed in MariaDB 10.2.3.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_BUFFER_POOL_SIZE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 8388608
+@@ -446,7 +474,7 @@
+ DEFAULT_VALUE ON
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BOOLEAN
+-VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF. Enable InnoDB checksums validation (enabled by default). Disable with --skip-innodb-checksums.
++VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -467,6 +495,104 @@
+ ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_EVICTION_FACTOR
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make page cleaner LRU flushes use evicted instead of flushed page counts for its heuristics
++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 INNODB_CLEANER_FLUSH_CHUNK_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 100
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 100
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Divide page cleaner flush list flush batches into chunks of this size
++NUMERIC_MIN_VALUE 1
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_FREE_LIST_LWM
++SESSION_VALUE NULL
++GLOBAL_VALUE 10
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 10
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Page cleaner will keep on flushing the same buffer pool instance if its free list length is below this percentage of innodb_lru_scan_depth
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 100
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_LRU_CHUNK_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 100
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 100
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Divide page cleaner LRU list flush batches into chunks of this size
++NUMERIC_MIN_VALUE 1
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_LSN_AGE_FACTOR
++SESSION_VALUE NULL
++GLOBAL_VALUE HIGH_CHECKPOINT
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE HIGH_CHECKPOINT
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The formula for LSN age factor for page cleaner adaptive flushing. LEGACY: Original Oracle MySQL 5.6 formula. HIGH_CHECKPOINT: (the default) Percona Server 5.6 formula.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST LEGACY,HIGH_CHECKPOINT
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_CLEANER_MAX_FLUSH_TIME
++SESSION_VALUE NULL
++GLOBAL_VALUE 1000
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1000
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT The maximum time limit for a single flush list flush iteration by the page cleaner thread in miliseconds
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CLEANER_MAX_LRU_TIME
++SESSION_VALUE NULL
++GLOBAL_VALUE 1000
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1000
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT The maximum time limit for a single LRU tail flush iteration by the page cleaner thread in miliseconds
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -565,6 +691,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_CORRUPT_TABLE_ACTION
++SESSION_VALUE NULL
++GLOBAL_VALUE assert
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE assert
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT Warn corruptions of user tables as 'corrupt table' instead of not crashing itself, when used with file_per_table. All file io for the datafile after detected as corrupt are disabled, except for the deletion.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST assert,warn,salvage
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_DATA_FILE_PATH
+ SESSION_VALUE NULL
+ GLOBAL_VALUE ibdata1:12M:autoextend
+@@ -775,6 +915,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
++SESSION_VALUE NULL
++GLOBAL_VALUE LEGACY
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE BACKOFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The algorithm to use for empty free list handling. Allowed values: LEGACY: Original Oracle MySQL 5.6 handling with single page flushes; BACKOFF: (default) Wait until cleaner produces a free page.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST LEGACY,BACKOFF
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 1
+@@ -845,6 +999,20 @@
+ ENUM_VALUE_LIST OFF,ON,FORCE
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_FAKE_CHANGES
++SESSION_VALUE OFF
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE SESSION
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. This is to cause replication prefetch IO. ATTENTION: the transaction started after enabled is affected.
++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 INNODB_FAST_SHUTDOWN
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 1
+@@ -972,11 +1140,11 @@
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_FLUSH_LOG_AT_TRX_COMMIT
+-SESSION_VALUE NULL
++SESSION_VALUE 1
+ GLOBAL_VALUE 1
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+-VARIABLE_SCOPE GLOBAL
++VARIABLE_SCOPE SESSION
+ VARIABLE_TYPE BIGINT UNSIGNED
+ 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
+@@ -1055,6 +1223,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_FOREGROUND_PREFLUSH
++SESSION_VALUE NULL
++GLOBAL_VALUE EXPONENTIAL_BACKOFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE EXPONENTIAL_BACKOFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The algorithm InnoDB uses for the query threads at sync preflush. Possible values are SYNC_PREFLUSH: perform a sync preflush as Oracle MySQL; EXPONENTIAL_BACKOFF: (default) wait for the page cleaner flush.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST SYNC_PREFLUSH,EXPONENTIAL_BACKOFF
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_FT_AUX_TABLE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE
+@@ -1293,6 +1475,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_KILL_IDLE_TRANSACTION
++SESSION_VALUE NULL
++GLOBAL_VALUE 0
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 0
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT
++VARIABLE_COMMENT No effect for this build.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 9223372036854775807
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_LARGE_PREFIX
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -1321,6 +1517,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_LOCKING_FAKE_CHANGES
++SESSION_VALUE NULL
++GLOBAL_VALUE ON
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE ON
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT ###EXPERIMENTAL### if enabled, transactions will get S row locks instead of X locks for fake changes. If disabled, fake change transactions will not take any locks at all.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -1363,6 +1573,62 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_LOG_ARCHIVE
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Set to 1 if you want to have logs archived.
++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 INNODB_LOG_ARCH_DIR
++SESSION_VALUE NULL
++GLOBAL_VALUE PATH
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE VARCHAR
++VARIABLE_COMMENT Where full logs should be archived.
++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_ARCH_EXPIRE_SEC
++SESSION_VALUE NULL
++GLOBAL_VALUE 0
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 0
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Expiration time for archived innodb transaction logs.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_LOG_BLOCK_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 512
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 512
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT ###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!
++NUMERIC_MIN_VALUE 512
++NUMERIC_MAX_VALUE 65536
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_LOG_BUFFER_SIZE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 1048576
+@@ -1391,6 +1657,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_LOG_CHECKSUM_ALGORITHM
++SESSION_VALUE NULL
++GLOBAL_VALUE INNODB
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE INNODB
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE ENUM
++VARIABLE_COMMENT The algorithm InnoDB uses for log block checksums. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Logs created when this option is set to crc32/strict_crc32/none/strict_none will not be readable by any MySQL version or Percona Server versions that donot support this feature
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
+ SESSION_VALUE NULL
+ GLOBAL_VALUE ON
+@@ -1461,6 +1741,34 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_MAX_BITMAP_FILE_SIZE
++SESSION_VALUE NULL
++GLOBAL_VALUE 104857600
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 104857600
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT The maximum size of changed page bitmap files
++NUMERIC_MIN_VALUE 4096
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_MAX_CHANGED_PAGES
++SESSION_VALUE NULL
++GLOBAL_VALUE 1000000
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 1000000
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT The maximum number of rows for INFORMATION_SCHEMA.INNODB_CHANGED_PAGES table, 0 - unlimited
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_MAX_DIRTY_PAGES_PCT
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 75.000000
+@@ -1727,6 +2035,76 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Print lock wait timeout info to MySQL error log (off by default)
++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 INNODB_PRIORITY_CLEANER
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make buffer pool cleaner and LRU manager threads acquire shared resources with priority
++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 INNODB_PRIORITY_IO
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make I/O threads acquire shared resources with priority
++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 INNODB_PRIORITY_MASTER
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make buffer pool cleaner thread acquire shared resources with priority
++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 INNODB_PRIORITY_PURGE
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Make purge coordinator and worker threads acquire shared resources with priority
++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 INNODB_PURGE_BATCH_SIZE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 300
+@@ -1895,6 +2273,48 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_SCHED_PRIORITY_IO
++SESSION_VALUE NULL
++GLOBAL_VALUE 19
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 19
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Nice value for the I/O handler thread scheduling
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 39
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_SCHED_PRIORITY_MASTER
++SESSION_VALUE NULL
++GLOBAL_VALUE 19
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 19
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Nice value for the master thread scheduling
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 39
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_SCHED_PRIORITY_PURGE
++SESSION_VALUE NULL
++GLOBAL_VALUE 19
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 19
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Nice value for the purge thread scheduling
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 39
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME INNODB_SCRUB_LOG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -1923,6 +2343,34 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_SHOW_LOCKS_HELD
++SESSION_VALUE NULL
++GLOBAL_VALUE 10
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 10
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Number of locks held to print for each InnoDB transaction in SHOW INNODB STATUS.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 1000
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT REQUIRED
++VARIABLE_NAME INNODB_SHOW_VERBOSE_LOCKS
++SESSION_VALUE NULL
++GLOBAL_VALUE 0
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE 0
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_COMMENT Whether to show records locked in SHOW INNODB STATUS.
++NUMERIC_MIN_VALUE 0
++NUMERIC_MAX_VALUE 1
++NUMERIC_BLOCK_SIZE 0
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 0
+@@ -2000,7 +2448,7 @@
+ DEFAULT_VALUE nulls_equal
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE ENUM
+-VARIABLE_COMMENT Specifies how InnoDB index statistics collection code should treat NULLs. Possible values are NULLS_EQUAL (default), NULLS_UNEQUAL and NULLS_IGNORED
++VARIABLE_COMMENT Specifies how InnoDB index statistics collection code should treat NULLs
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -2245,6 +2693,34 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Track the redo log for changed pages and output a changed page bitmap
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
++VARIABLE_NAME INNODB_TRACK_REDO_LOG_NOW
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Force log tracker to catch up with checkpoint now
++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 INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2322,7 +2798,7 @@
+ DEFAULT_VALUE OFF
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BOOLEAN
+-VARIABLE_COMMENT Prevent partial page writes, via atomic writes.The option is used to prevent partial writes in case of a crash/poweroff, as faster alternative to doublewrite buffer.Currently this option works only on Linux only with FusionIO device, and directFS filesystem.
++VARIABLE_COMMENT Prevent partial page writes, via atomic writes (beta). The option is used to prevent partial writes in case of a crash/poweroff, as faster alternative to doublewrite buffer. Currently this option works only on Linux only with FusionIO device, and directFS filesystem.
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -2343,6 +2819,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT NONE
++VARIABLE_NAME INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
++SESSION_VALUE NULL
++GLOBAL_VALUE ON
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE ON
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Use global innodb_flush_log_at_trx_commit value. (default: ON).
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_MTFLUSH
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2357,6 +2847,20 @@
+ ENUM_VALUE_LIST OFF,ON
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT NONE
++VARIABLE_NAME INNODB_USE_STACKTRACE
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
++DEFAULT_VALUE OFF
++VARIABLE_SCOPE GLOBAL
++VARIABLE_TYPE BOOLEAN
++VARIABLE_COMMENT Print stacktrace on long semaphore wait (off by default supported only on linux)
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST OFF,ON
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_SYS_MALLOC
+ SESSION_VALUE NULL
+ GLOBAL_VALUE ON
+@@ -2387,12 +2891,12 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_VERSION
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 5.6.37
++GLOBAL_VALUE 5.6.36-83.0
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE NULL
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE VARCHAR
+-VARIABLE_COMMENT InnoDB version
++VARIABLE_COMMENT Percona-InnoDB-plugin version
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
new file mode 100644
index 00000000000..161f740dbfb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -0,0 +1,2415 @@
+select * from information_schema.system_variables
+where variable_name like 'innodb%' and
+variable_name not in (
+'innodb_disallow_writes', # only available WITH_WSREP
+'innodb_sched_priority_cleaner', # linux only
+'innodb_use_native_aio') # default value depends on OS
+order by variable_name;
+VARIABLE_NAME INNODB_ADAPTIVE_FLUSHING
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Attempt flushing dirty pages to avoid IO bursts at checkpoints.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_ADAPTIVE_FLUSHING_LWM
+SESSION_VALUE NULL
+GLOBAL_VALUE 10.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Percentage of log capacity below which no adaptive flushing happens.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 70
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable InnoDB adaptive hash index (enabled by default). Disable with --skip-innodb-adaptive-hash-index.
+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 INNODB_ADAPTIVE_MAX_SLEEP_DELAY
+SESSION_VALUE NULL
+GLOBAL_VALUE 150000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 150000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The upper limit of the sleep delay in usec. Value of 0 disables it.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_ADDITIONAL_MEM_POOL_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 8388608
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8388608
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.
+NUMERIC_MIN_VALUE 524288
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_API_BK_COMMIT_INTERVAL
+SESSION_VALUE NULL
+GLOBAL_VALUE 5
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 5
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Background commit interval in seconds
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_API_DISABLE_ROWLOCK
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Disable row lock when direct access InnoDB through InnoDB APIs
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_API_ENABLE_BINLOG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable binlog for applications direct access InnoDB through InnoDB APIs
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_API_ENABLE_MDL
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable MDL for applications direct access InnoDB through InnoDB APIs
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_API_TRX_LEVEL
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT InnoDB API transaction isolation level
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 3
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_AUTOEXTEND_INCREMENT
+SESSION_VALUE NULL
+GLOBAL_VALUE 64
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 64
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Data file autoextend increment in megabytes
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_AUTOINC_LOCK_MODE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT The AUTOINC lock modes supported by InnoDB: 0 => Old style AUTOINC locking (for backward compatibility) 1 => New style AUTOINC locking 2 => No AUTOINC locking (unsafe for SBR)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_CHECK_INTERVAL
+SESSION_VALUE NULL
+GLOBAL_VALUE 3600
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 3600
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT check if spaces needs scrubbing every innodb_background_scrub_data_check_interval seconds
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable scrubbing of compressed data by background threads (same as encryption_threads)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_INTERVAL
+SESSION_VALUE NULL
+GLOBAL_VALUE 604800
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 604800
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT scrub spaces that were last scrubbed longer than innodb_background_scrub_data_interval seconds ago
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_UNCOMPRESSED
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable scrubbing of uncompressed data by background threads (same as encryption_threads)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_DUMP_AT_SHUTDOWN
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Dump the buffer pool into a file named @@innodb_buffer_pool_filename
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_DUMP_NOW
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Trigger an immediate dump of the buffer pool into a file named @@innodb_buffer_pool_filename
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_DUMP_PCT
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Dump only the hottest N% of each buffer pool, defaults to 100
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_EVICT
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Evict pages from the buffer pool
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_FILENAME
+SESSION_VALUE NULL
+GLOBAL_VALUE ib_buffer_pool
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ib_buffer_pool
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Filename to/from which to dump/load the InnoDB buffer pool
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of buffer pool instances, set to higher value on high-end machines to increase scalability
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 64
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_LOAD_ABORT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Abort a currently running load of the buffer pool
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_LOAD_AT_STARTUP
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Load the buffer pool from a file named @@innodb_buffer_pool_filename
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_LOAD_NOW
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Trigger an immediate load of the buffer pool from a file named @@innodb_buffer_pool_filename
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUFFER_POOL_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 8388608
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 134217728
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT The size of the memory buffer InnoDB uses to cache data and indexes of its tables.
+NUMERIC_MIN_VALUE 5242880
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1048576
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUF_DUMP_STATUS_FREQUENCY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT A number between [0, 100] that tells how oftern buffer pool dump status in percentages should be printed. E.g. 10 means that buffer pool dump status is printed when every 10% of number of buffer pool pages are dumped. Default is 0 (only start and end status is printed).
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_BUF_FLUSH_LIST_NOW
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Force dirty page flush now
+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 INNODB_CHANGE_BUFFERING
+SESSION_VALUE NULL
+GLOBAL_VALUE all
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE all
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Buffer changes to reduce random access: OFF, ON, inserting, deleting, changing, or purging.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_CHANGE_BUFFERING_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Debug flags for InnoDB change buffering (0=none, 2=crash at merge)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_CHANGE_BUFFER_MAX_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 25
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 25
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Maximum on-disk size of change buffer in terms of percentage of the buffer pool.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 50
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_CHECKSUMS
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF. Enable InnoDB checksums validation (enabled by default). Disable with --skip-innodb-checksums.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_CHECKSUM_ALGORITHM
+SESSION_VALUE NULL
+GLOBAL_VALUE INNODB
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE INNODB
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The algorithm InnoDB uses for page checksumming. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Files updated when this option is set to crc32 or strict_crc32 will not be readable by MySQL versions older than 5.6.3
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable INFORMATION_SCHEMA.innodb_cmp_per_index, may have negative impact on performance (off by default)
+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 INNODB_COMMIT_CONCURRENCY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_COMPRESSION_ALGORITHM
+SESSION_VALUE NULL
+GLOBAL_VALUE zlib
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE zlib
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Compression algorithm used on page compression. One of: none, zlib, lz4, lzo, lzma, or bzip2
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST none,zlib,lz4,lzo,lzma,bzip2,snappy
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_COMPRESSION_FAILURE_THRESHOLD_PCT
+SESSION_VALUE NULL
+GLOBAL_VALUE 5
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 5
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If the compression failure rate of a table is greater than this number more padding is added to the pages to reduce the failures. A value of zero implies no padding
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_COMPRESSION_LEVEL
+SESSION_VALUE NULL
+GLOBAL_VALUE 6
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 6
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Compression level used for zlib compression. 0 is no compression, 1 is fastest, 9 is best compression and default is 6.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_COMPRESSION_PAD_PCT_MAX
+SESSION_VALUE NULL
+GLOBAL_VALUE 50
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+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
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_CONCURRENCY_TICKETS
+SESSION_VALUE NULL
+GLOBAL_VALUE 5000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 5000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DATA_FILE_PATH
+SESSION_VALUE NULL
+GLOBAL_VALUE ibdata1:12M:autoextend
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to individual files and their sizes.
+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_DATA_FILE_SIZE_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT InnoDB system tablespace size to be set in recovery.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DATA_HOME_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The common part for InnoDB table spaces.
+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_DEBUG_FORCE_SCRUBBING
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Perform extra scrubbing to increase test exposure
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFAULT_ENCRYPTION_KEY_ID
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Default encryption key id used for table encryption.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFRAGMENT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable/disable InnoDB defragmentation (default FALSE). When set to FALSE, all existing defragmentation will be paused. And new defragmentation command will fail.Paused defragmentation commands will resume when this variable is set to true again.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFRAGMENT_FILL_FACTOR
+SESSION_VALUE NULL
+GLOBAL_VALUE 0.900000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.900000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT A number between [0.7, 1] that tells defragmentation how full it should fill a page. Default is 0.9. Number below 0.7 won't make much sense.This variable, together with innodb_defragment_fill_factor_n_recs, is introduced so defragmentation won't pack the page too full and cause page split on the next insert on every page. The variable indicating more defragmentation gain is the one effective.
+NUMERIC_MIN_VALUE 0.7
+NUMERIC_MAX_VALUE 1
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFRAGMENT_FILL_FACTOR_N_RECS
+SESSION_VALUE NULL
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT How many records of space defragmentation should leave on the page. This variable, together with innodb_defragment_fill_factor, is introduced so defragmentation won't pack the page too full and cause page split on the next insert on every page. The variable indicating more defragmentation gain is the one effective.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFRAGMENT_FREQUENCY
+SESSION_VALUE NULL
+GLOBAL_VALUE 40
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 40
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Do not defragment a single index more than this number of time per second.This controls the number of time defragmentation thread can request X_LOCK on an index. Defragmentation thread will check whether 1/defragment_frequency (s) has passed since it worked on this index last time, and put the index back to the queue if not enough time has passed. The actual frequency can only be lower than this given number.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFRAGMENT_N_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE 7
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 7
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Number of pages considered at once when merging multiple pages to defragment
+NUMERIC_MIN_VALUE 2
+NUMERIC_MAX_VALUE 32
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFRAGMENT_STATS_ACCURACY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT How many defragment stats changes there are before the stats are written to persistent storage. Set to 0 meaning disable defragment stats tracking.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DISABLE_BACKGROUND_MERGE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Disable change buffering merges by the master thread
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_DISABLE_SORT_FILE_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether to disable OS system file cache for sort I/O
+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 INNODB_DOUBLEWRITE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable InnoDB doublewrite buffer (enabled by default). Disable with --skip-innodb-doublewrite.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_DOUBLEWRITE_BATCH_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 120
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 120
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of pages reserved in doublewrite buffer for batch flushing
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 127
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Key rotation - re-encrypt in background all pages that were encrypted with a key that many (or more) versions behind. Value 0 indicates that key rotation is disabled.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_ENCRYPTION_ROTATION_IOPS
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Use this many iops for background key rotation
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_ENCRYPTION_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Number of threads performing background key rotation and scrubbing
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_ENCRYPT_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable redo log encryption
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_ENCRYPT_TABLES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Enable encryption for tables. Don't forget to enable --innodb-encrypt-log too
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON,FORCE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FAST_SHUTDOWN
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FATAL_SEMAPHORE_WAIT_THRESHOLD
+SESSION_VALUE NULL
+GLOBAL_VALUE 600
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 600
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of seconds that semaphore times out in InnoDB.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FILE_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE Antelope
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE Antelope
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT File format to use for new tables in .ibd files.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FILE_FORMAT_CHECK
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether to perform system file format check.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_FILE_FORMAT_MAX
+SESSION_VALUE NULL
+GLOBAL_VALUE Antelope
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE Antelope
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The highest file format in the tablespace.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FILE_PER_TABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Stores each InnoDB table to an .ibd file in the database dir.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_FIL_MAKE_PAGE_DIRTY_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Make the first page of the given tablespace dirty.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FLUSHING_AVG_LOOPS
+SESSION_VALUE NULL
+GLOBAL_VALUE 30
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of iterations over which the background flushing is averaged.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FLUSH_LOG_AT_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 3
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Write and flush logs every (n) second.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2700
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FLUSH_LOG_AT_TRX_COMMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+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
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FLUSH_METHOD
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT With which method to flush data.
+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_FLUSH_NEIGHBORS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+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
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FORCE_LOAD_CORRUPTED
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Force InnoDB to load metadata of corrupted table.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_FORCE_PRIMARY_KEY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Do not allow to create table without primary key (off by default)
+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 INNODB_FORCE_RECOVERY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 6
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FT_AUX_TABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT FTS internal auxiliary table to be checked
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_FT_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 8000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT InnoDB Fulltext search cache size in bytes
+NUMERIC_MIN_VALUE 1600000
+NUMERIC_MAX_VALUE 80000000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FT_ENABLE_DIAG_PRINT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether to enable additional FTS diagnostic printout
+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 INNODB_FT_ENABLE_STOPWORD
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Create FTS index with stopword.
+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 INNODB_FT_MAX_TOKEN_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 84
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 84
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT InnoDB Fulltext search maximum token size in characters
+NUMERIC_MIN_VALUE 10
+NUMERIC_MAX_VALUE 84
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FT_MIN_TOKEN_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 3
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 3
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FT_NUM_WORD_OPTIMIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT InnoDB Fulltext search number of words to optimize for each optimize table call
+NUMERIC_MIN_VALUE 1000
+NUMERIC_MAX_VALUE 10000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FT_RESULT_CACHE_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 2000000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2000000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT InnoDB Fulltext search query result cache limit in bytes
+NUMERIC_MIN_VALUE 1000000
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FT_SERVER_STOPWORD_TABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The user supplied stopword table name.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_FT_SORT_PLL_DEGREE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+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
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FT_TOTAL_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 640000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 640000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Total memory allocated for InnoDB Fulltext Search cache
+NUMERIC_MIN_VALUE 32000000
+NUMERIC_MAX_VALUE 1600000000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_FT_USER_STOPWORD_TABLE
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT User supplied stopword table name, effective in the session level.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_IDLE_FLUSH_PCT
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Up to what percentage of dirty pages should be flushed when innodb finds it has spare resources to do so.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable scrubbing of data
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_INSTRUMENT_SEMAPHORES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable semaphore request instrumentation. This could have some effect on performance but allows better information on long semaphore wait problems. (Default: not enabled)
+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 INNODB_IO_CAPACITY
+SESSION_VALUE NULL
+GLOBAL_VALUE 200
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 200
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of IOPs the server can do. Tunes the background IO rate
+NUMERIC_MIN_VALUE 100
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_IO_CAPACITY_MAX
+SESSION_VALUE NULL
+GLOBAL_VALUE 2000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709551615
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Limit to which innodb_io_capacity can be inflated.
+NUMERIC_MIN_VALUE 100
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LARGE_PREFIX
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Support large index prefix length of REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Artificially limit the number of records per B-tree page (0=unlimited).
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT DEPRECATED. This option may be removed in future releases. Please use READ COMMITTED transaction isolation level instead. Force InnoDB to not use next-key locking, to use only row-level locking.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_LOCK_SCHEDULE_ALGORITHM
+SESSION_VALUE NULL
+GLOBAL_VALUE fcfs
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE fcfs
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The algorithm Innodb uses for deciding which locks to grant next when a lock is released. Possible values are FCFS grant the locks in First-Come-First-Served order; VATS use the Variance-Aware-Transaction-Scheduling algorithm, which uses an Eldest-Transaction-First heuristic.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST fcfs,vats
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LOCK_WAIT_TIMEOUT
+SESSION_VALUE 50
+GLOBAL_VALUE 50
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LOG_BUFFER_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 16777216
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+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
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LOG_CHECKPOINT_NOW
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Force checkpoint now
+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 INNODB_LOG_COMPRESSED_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enables/disables the logging of entire compressed page images. InnoDB logs the compressed pages to prevent corruption if the zlib compression algorithm changes. When turned OFF, InnoDB will assume that the zlib compression algorithm doesn't change.
+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 INNODB_LOG_FILES_IN_GROUP
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 2
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of log files in the log group. InnoDB writes to the files in a circular fashion.
+NUMERIC_MIN_VALUE 2
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LOG_FILE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 5242880
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 50331648
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Size of each log file in a log group.
+NUMERIC_MIN_VALUE 1048576
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1048576
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LOG_GROUP_HOME_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to InnoDB log files.
+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_LRU_SCAN_DEPTH
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT How deep to scan LRU to keep it clean
+NUMERIC_MIN_VALUE 100
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MAX_DIRTY_PAGES_PCT
+SESSION_VALUE NULL
+GLOBAL_VALUE 75.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 75.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Percentage of dirty pages allowed in bufferpool.
+NUMERIC_MIN_VALUE 0.001
+NUMERIC_MAX_VALUE 99.999
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MAX_DIRTY_PAGES_PCT_LWM
+SESSION_VALUE NULL
+GLOBAL_VALUE 0.001000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.001000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Percentage of dirty pages at which flushing kicks in.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 99.999
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MAX_PURGE_LAG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Desired maximum length of the purge queue (0 = no limit)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MAX_PURGE_LAG_DELAY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum delay of user threads in micro-seconds
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 10000000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MIRRORED_LOG_GROUPS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of identical copies of log groups we keep for the database. Currently this should be set to 1.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 10
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MONITOR_DISABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Turn off a monitor counter
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MONITOR_ENABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Turn on a monitor counter
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MONITOR_RESET
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Reset a monitor counter
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MONITOR_RESET_ALL
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Reset all values for a monitor counter
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_MTFLUSH_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of multi-threaded flush threads
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 64
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_OLD_BLOCKS_PCT
+SESSION_VALUE NULL
+GLOBAL_VALUE 37
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 37
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Percentage of the buffer pool to reserve for 'old' blocks.
+NUMERIC_MIN_VALUE 5
+NUMERIC_MAX_VALUE 95
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_OLD_BLOCKS_TIME
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Move blocks to the 'new' end of the buffer pool if the first access was at least this many milliseconds ago. The timeout is disabled if 0.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_ONLINE_ALTER_LOG_MAX_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 134217728
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 134217728
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum modification log file size for online index creation
+NUMERIC_MIN_VALUE 65536
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_OPEN_FILES
+SESSION_VALUE NULL
+GLOBAL_VALUE 2000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT How many files at the maximum InnoDB keeps open at the same time.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_OPTIMIZE_FULLTEXT_ONLY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Only optimize the Fulltext index of the table
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_PAGE_HASH_LOCKS
+SESSION_VALUE NULL
+GLOBAL_VALUE 16
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of rw_locks protecting buffer pool page_hash. Rounded up to the next power of 2
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_PAGE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 16384
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16384
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Page size to use for all InnoDB tablespaces.
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 65536
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable prefix optimization to sometimes avoid cluster index lookups.
+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 INNODB_PRINT_ALL_DEADLOCKS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Print all deadlocks to MySQL error log (off by default)
+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 INNODB_PURGE_BATCH_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 300
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 300
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of UNDO log pages to purge in one batch from the history list.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 5000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_PURGE_RUN_NOW
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Set purge state to RUN
+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 INNODB_PURGE_STOP_NOW
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Set purge state to STOP
+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 INNODB_PURGE_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Purge threads can be from 1 to 32. Default is 1.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 32
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_RANDOM_READ_AHEAD
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether to use read ahead for random access within an extent.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_READ_AHEAD_THRESHOLD
+SESSION_VALUE NULL
+GLOBAL_VALUE 56
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 56
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 64
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_READ_IO_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 4
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of background read I/O threads in InnoDB.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 64
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_READ_ONLY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Start InnoDB in read only mode (off by default)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_REPLICATION_DELAY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Replication thread delay (ms) on the slave server if innodb_thread_concurrency is reached (0 by default)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_ROLLBACK_ON_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_ROLLBACK_SEGMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE 128
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 128
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of undo logs to use (deprecated).
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 128
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_SAVED_PAGE_NUMBER_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT An InnoDB page number.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_SCRUB_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable background redo log (ib_logfile0, ib_logfile1...) scrubbing
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_SCRUB_LOG_SPEED
+SESSION_VALUE NULL
+GLOBAL_VALUE 256
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 256
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Background redo log scrubbing speed in bytes/sec
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 50000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Simulate compression failures.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 99
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_SORT_BUFFER_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Memory buffer size for index creation
+NUMERIC_MIN_VALUE 65536
+NUMERIC_MAX_VALUE 67108864
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_SPIN_WAIT_DELAY
+SESSION_VALUE NULL
+GLOBAL_VALUE 6
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 6
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum delay between polling for a spin lock (6 by default)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_STATS_AUTO_RECALC
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT InnoDB automatic recalculation of persistent statistics enabled for all tables unless overridden at table level (automatic recalculation is only done when InnoDB decides that the table has changed too much and needs a new statistics)
+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 INNODB_STATS_INCLUDE_DELETE_MARKED
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Scan delete marked records for persistent stat
+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 INNODB_STATS_METHOD
+SESSION_VALUE NULL
+GLOBAL_VALUE nulls_equal
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE nulls_equal
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how InnoDB index statistics collection code should treat NULLs. Possible values are NULLS_EQUAL (default), NULLS_UNEQUAL and NULLS_IGNORED
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST nulls_equal,nulls_unequal,nulls_ignored
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_STATS_MODIFIED_COUNTER
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of rows modified before we calculate new statistics (default 0 = current limits)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_STATS_ON_METADATA
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable statistics gathering for metadata commands such as SHOW TABLE STATUS for tables that use transient statistics (off by default)
+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 INNODB_STATS_PERSISTENT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT InnoDB persistent statistics enabled for all tables unless overridden at table level
+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 INNODB_STATS_PERSISTENT_SAMPLE_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of leaf index pages to sample when calculating persistent statistics (by ANALYZE, default 20)
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_STATS_SAMPLE_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE 8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Deprecated, use innodb_stats_transient_sample_pages instead
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_STATS_TRADITIONAL
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable traditional statistic calculation based on number of configured pages (default true)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_STATS_TRANSIENT_SAMPLE_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE 8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of leaf index pages to sample when calculating transient statistics (if persistent statistics are not used, default 8)
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_STATUS_OUTPUT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable InnoDB monitor output to the error log.
+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 INNODB_STATUS_OUTPUT_LOCKS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable InnoDB lock monitor output to the error log. Requires innodb_status_output=ON.
+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 INNODB_STRICT_MODE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use strict mode when evaluating create options.
+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 INNODB_SUPPORT_XA
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable InnoDB support for the XA two-phase commit
+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 INNODB_SYNC_ARRAY_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Size of the mutex/lock wait array.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_SYNC_SPIN_LOOPS
+SESSION_VALUE NULL
+GLOBAL_VALUE 30
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Count of spin-loop rounds in InnoDB mutexes (30 by default)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_TABLE_LOCKS
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable InnoDB locking in LOCK TABLES
+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 INNODB_THREAD_CONCURRENCY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_THREAD_SLEEP_DELAY
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000000
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_TMPDIR
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory for temporary non-tablespace files.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Pause actual purging any delete-marked records, but merely update the purge view. It is to create artificially the situation the purge view have been updated but the each purges were not done yet.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME INNODB_TRX_RSEG_N_SLOTS_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Debug flags for InnoDB to limit TRX_RSEG_N_SLOTS for trx_rsegf_undo_find_free()
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME INNODB_UNDO_DIRECTORY
+SESSION_VALUE NULL
+GLOBAL_VALUE .
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE .
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory where undo tablespace files live, this path can be absolute.
+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_UNDO_LOGS
+SESSION_VALUE NULL
+GLOBAL_VALUE 128
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 128
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of undo logs to use.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 128
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_UNDO_TABLESPACES
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of undo tablespaces to use.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 126
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_USE_ATOMIC_WRITES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Prevent partial page writes, via atomic writes.The option is used to prevent partial writes in case of a crash/poweroff, as faster alternative to doublewrite buffer.Currently this option works only on Linux only with FusionIO device, and directFS filesystem.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_USE_FALLOCATE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Preallocate files fast, using operating system functionality. On POSIX systems, posix_fallocate system call is used.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_USE_MTFLUSH
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use multi-threaded flush. Default FALSE.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_USE_SYS_MALLOC
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT DEPRECATED. This option may be removed in future releases, together with the InnoDB's internal memory allocator. Use OS memory allocator instead of InnoDB's internal memory allocator
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME INNODB_USE_TRIM
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use trim. Default FALSE.
+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 INNODB_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 5.6.37
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT InnoDB version
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME INNODB_WRITE_IO_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 4
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of background write I/O threads in InnoDB.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 64
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
new file mode 100644
index 00000000000..0569b2755d5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
@@ -0,0 +1,1244 @@
+--- sysvars_server_embedded.result
++++ sysvars_server_embedded,32bit.result~
+@@ -57,7 +57,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Auto-increment columns are incremented by this
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 65535
+@@ -71,7 +71,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 65535
+@@ -85,7 +85,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 150
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 65535
+@@ -144,7 +144,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the transactional cache for updates to transactional engines for the binary log. If you often use transactions containing many statements, you can increase this to get more performance
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -169,10 +169,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If non-zero, binlog write will wait at most binlog_commit_wait_usec microseconds for at least this many commits to queue up for group commit to the binlog. This can reduce I/O on the binlog and provide increased opportunity for parallel apply on the slave, but too high a value will decrease commit throughput.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -183,10 +183,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum time, in microseconds, to wait for more commits to queue up for binlog group commit. Only takes effect if the value of binlog_commit_wait_count is non-zero.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -256,7 +256,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance.
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -270,7 +270,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -463,7 +463,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
+ NUMERIC_MIN_VALUE 2
+ NUMERIC_MAX_VALUE 31536000
+@@ -519,7 +519,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 15
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Long search depth for the two-step deadlock detection
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 33
+@@ -533,7 +533,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Short search depth for the two-step deadlock detection
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 32
+@@ -547,7 +547,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50000000
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -561,7 +561,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10000
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -617,7 +617,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The default week format used by WEEK() functions
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 7
+@@ -631,7 +631,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -645,7 +645,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 300
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -659,7 +659,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -687,7 +687,7 @@
+ GLOBAL_VALUE_ORIGIN SQL
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 30
+@@ -785,7 +785,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 99
+@@ -827,7 +827,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of connections on extra-port
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 100000
+@@ -869,7 +869,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 31536000
+@@ -911,7 +911,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 84
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+ NUMERIC_MIN_VALUE 10
+ NUMERIC_MAX_VALUE 84
+@@ -925,7 +925,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 84
+@@ -939,7 +939,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 20
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of best matches to use for query expansion
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000
+@@ -998,7 +998,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT()
+ NUMERIC_MIN_VALUE 4
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1149,7 +1149,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 255
+@@ -1177,7 +1177,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 128
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How many host names should be cached to avoid resolving.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 65536
+@@ -1289,7 +1289,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 28800
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -1320,7 +1320,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the buffer that is used for joins
+ NUMERIC_MIN_VALUE 128
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 128
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1345,7 +1345,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 8
+@@ -1376,7 +1376,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1583,7 +1583,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 31536000
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -1695,7 +1695,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1737,7 +1737,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1779,7 +1779,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4194304
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max packet length to send to or receive from the server
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1073741824
+@@ -1789,14 +1789,14 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MAX_BINLOG_CACHE_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 18446744073709547520
++GLOBAL_VALUE 4294963200
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709547520
++DEFAULT_VALUE 4294963200
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the total size of the transactional cache
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1807,7 +1807,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1073741824
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
+ NUMERIC_MIN_VALUE 4096
+ NUMERIC_MAX_VALUE 1073741824
+@@ -1817,14 +1817,14 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 18446744073709547520
++GLOBAL_VALUE 4294963200
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709547520
++DEFAULT_VALUE 4294963200
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the total size of the statement cache
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1835,7 +1835,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 151
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of simultaneous clients allowed
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 100000
+@@ -1849,7 +1849,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1863,7 +1863,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 20
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16384
+@@ -1891,7 +1891,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 64
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max number of errors/warnings to store for a statement
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 65535
+@@ -1908,7 +1908,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
+ NUMERIC_MIN_VALUE 16384
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1024
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1919,7 +1919,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 20
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16384
+@@ -1947,7 +1947,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max number of bytes in sorted records
+ NUMERIC_MIN_VALUE 4
+ NUMERIC_MAX_VALUE 8388608
+@@ -1961,7 +1961,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 1048576
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1975,7 +1975,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16382
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of prepared statements in the server
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -1989,7 +1989,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2017,7 +2017,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
+ NUMERIC_MIN_VALUE 4
+ NUMERIC_MAX_VALUE 8388608
+@@ -2031,7 +2031,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum stored procedure recursion depth
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 255
+@@ -2059,7 +2059,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 32
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Unused, will be removed.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2087,7 +2087,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2101,7 +2101,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Unused
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2115,7 +2115,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Unused
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1024
+@@ -2129,7 +2129,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2143,7 +2143,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 262144
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Size of buffer to use when using MRR with range access
+ NUMERIC_MIN_VALUE 8192
+ NUMERIC_MAX_VALUE 2147483647
+@@ -2157,10 +2157,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 256
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Ignored. Use mrr_buffer_size instead
+ NUMERIC_MIN_VALUE 1
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2171,7 +2171,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Block size to be used for MyISAM index pages
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 16384
+@@ -2185,7 +2185,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 6
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
+ NUMERIC_MIN_VALUE 2
+ NUMERIC_MAX_VALUE 7
+@@ -2195,9 +2195,9 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 9223372036853727232
++GLOBAL_VALUE 2146435072
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 9223372036853727232
++DEFAULT_VALUE 2146435072
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this
+@@ -2209,14 +2209,14 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MYISAM_MMAP_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 18446744073709551615
++GLOBAL_VALUE 4294967295
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709551615
++DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
+ NUMERIC_MIN_VALUE 7
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+@@ -2241,10 +2241,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If larger than 1, when repairing a MyISAM table all indexes will be created in parallel, with one thread per index. The value of 1 disables parallel repair
+ NUMERIC_MIN_VALUE 1
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2258,7 +2258,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2311,7 +2311,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16384
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1048576
+@@ -2325,7 +2325,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 30
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -2339,7 +2339,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2353,7 +2353,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 60
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -2423,7 +2423,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1
+@@ -2437,7 +2437,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 62
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 63
+@@ -2451,7 +2451,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls number of record samples to check condition selectivity
+ NUMERIC_MIN_VALUE 10
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2479,7 +2479,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 5
+@@ -2507,7 +2507,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2521,7 +2521,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 200
+@@ -2535,7 +2535,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2549,7 +2549,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1024
+@@ -2563,7 +2563,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2577,7 +2577,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1024
+@@ -2591,7 +2591,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2605,7 +2605,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1024
+@@ -2619,7 +2619,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2633,7 +2633,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 80
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of condition instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2647,7 +2647,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2661,7 +2661,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -2675,7 +2675,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of file instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2689,7 +2689,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 32768
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of opened instrumented files.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -2703,7 +2703,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2717,7 +2717,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 200
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of mutex instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2731,7 +2731,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 104857600
+@@ -2745,7 +2745,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 40
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of rwlock instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2759,7 +2759,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 104857600
+@@ -2773,7 +2773,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of socket instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2787,7 +2787,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2801,7 +2801,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 150
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of stage instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2815,7 +2815,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 178
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of statement instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2829,7 +2829,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2843,7 +2843,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2857,7 +2857,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of thread instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2871,7 +2871,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2885,7 +2885,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2899,7 +2899,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1024
+@@ -2913,7 +2913,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -2927,7 +2927,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2997,7 +2997,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 32768
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1073741824
+@@ -3025,7 +3025,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 15
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -3039,7 +3039,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3095,10 +3095,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION ONLY
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT This variable is for internal server use
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3109,7 +3109,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16384
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Allocation block size for query parsing and execution
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3123,7 +3123,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1048576
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't cache results that are bigger than this
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3137,7 +3137,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4096
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3154,7 +3154,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The memory allocated to store results from old queries
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1024
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3207,7 +3207,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 24576
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Persistent buffer for query parsing and execution
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3221,7 +3221,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4096
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Allocation block size for storing ranges during optimization
+ NUMERIC_MIN_VALUE 4096
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3235,7 +3235,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 131072
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
+ NUMERIC_MIN_VALUE 8192
+ NUMERIC_MAX_VALUE 2147483647
+@@ -3263,7 +3263,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 262144
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 2147483647
+@@ -3277,10 +3277,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8388608
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The size of the buffers used [NOT] IN evaluation via partial matching
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 9223372036854775807
++NUMERIC_MAX_VALUE 2147483647
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3319,7 +3319,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3417,7 +3417,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1073741824
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1073741824
+@@ -3431,7 +3431,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 31536000
+@@ -3490,7 +3490,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
+ NUMERIC_MIN_VALUE 1024
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3767,7 +3767,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 256
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 524288
+@@ -3837,7 +3837,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 400
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of cached table definitions
+ NUMERIC_MIN_VALUE 400
+ NUMERIC_MAX_VALUE 524288
+@@ -3851,7 +3851,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of cached open tables
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1048576
+@@ -3865,7 +3865,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How many threads we should keep in a cache for reuse
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16384
+@@ -3879,7 +3879,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 512
+@@ -3994,7 +3994,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
+ NUMERIC_MIN_VALUE 1024
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -4005,7 +4005,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8192
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 134217728
+@@ -4019,7 +4019,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4096
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 134217728
+@@ -4117,7 +4117,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 28800
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -4221,7 +4221,7 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME OPEN_FILES_LIMIT
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -4234,7 +4234,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -4244,7 +4244,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -4329,7 +4329,7 @@
+ VARIABLE_NAME LOG_TC_SIZE
+ GLOBAL_VALUE_ORIGIN AUTO
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Size of transaction coordinator log.
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
new file mode 100644
index 00000000000..f851dfcc5a4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -0,0 +1,4337 @@
+set time_zone='+00:00';
+set timestamp=unix_timestamp('2014-09-01 13:40:23');
+set pseudo_thread_id=10;
+set sql_mode=ansi_quotes;
+set global div_precision_increment=5;
+select * from information_schema.system_variables
+where variable_name not like 'aria%' and
+variable_name not like 'debug%' and
+variable_name not like 'wsrep%' and
+variable_name not in (
+'have_openssl',
+'have_symlink',
+'hostname',
+'large_files_support', 'log_tc_size',
+'lower_case_file_system',
+'lower_case_table_names',
+'open_files_limit',
+'rand_seed1',
+'rand_seed2',
+'system_time_zone',
+'version_comment',
+'version_compile_machine', 'version_compile_os',
+'version_malloc_library', 'version_ssl_library', 'version'
+ )
+order by variable_name;
+VARIABLE_NAME AUTOCOMMIT
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, all queries are committed immediately. If set to 0, they are only committed upon a COMMIT statement, or rolled back with a ROLLBACK statement. If autocommit is set to 0, and then changed to 1, all open transactions are immediately committed.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME AUTOMATIC_SP_PRIVILEGES
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Creating and dropping stored procedures alters ACLs
+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 AUTO_INCREMENT_INCREMENT
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Auto-increment columns are incremented by this
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME AUTO_INCREMENT_OFFSET
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BACK_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE 80
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 150
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BASEDIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to installation directory. All paths are usually resolved relative to this
+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 BIG_TABLES
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Old variable, which if set to 1, allows large result sets by saving all temporary sets to disk, avoiding 'table full' errors. No longer needed, as the server now handles this automatically. sql_big_tables is a synonym.
+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
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Tells the master to annotate RBR events with the statement that caused these events
+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_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the transactional cache for updates to transactional engines for the binary log. If you often use transactions containing many statements, you can increase this to get more performance
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_CHECKSUM
+SESSION_VALUE NULL
+GLOBAL_VALUE NONE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NONE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Type of BINLOG_CHECKSUM_ALG. Include checksum for log events in the binary log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NONE,CRC32
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_COMMIT_WAIT_COUNT
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If non-zero, binlog write will wait at most binlog_commit_wait_usec microseconds for at least this many commits to queue up for group commit to the binlog. This can reduce I/O on the binlog and provide increased opportunity for parallel apply on the slave, but too high a value will decrease commit throughput.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_COMMIT_WAIT_USEC
+SESSION_VALUE NULL
+GLOBAL_VALUE 100000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum time, in microseconds, to wait for more commits to queue up for binlog group commit. Only takes effect if the value of binlog_commit_wait_count is non-zero.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Causes updates to non-transactional engines using statement format to be written directly to binary log. Before using this option make sure that there are no dependencies between transactional and non-transactional tables such as in the statement INSERT INTO t_myisam SELECT * FROM t_innodb; otherwise, slaves may diverge from the master.
+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_FORMAT
+SESSION_VALUE STATEMENT
+GLOBAL_VALUE STATEMENT
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE STATEMENT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT What form of binary logging the master will use: either ROW for row-based binary logging, STATEMENT for statement-based binary logging, or MIXED. MIXED is statement-based binary logging except for those statements where only row-based is correct: those which involve user-defined functions (i.e. UDFs) or the UUID() function; for those, row-based binary logging is automatically used.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST MIXED,STATEMENT,ROW
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_OPTIMIZE_THREAD_SCHEDULING
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Run fast part of group commit in a single thread, to optimize kernel thread scheduling. On by default. Disable to run each transaction in group commit in its own thread, which can be slower at very high concurrency. This option is mostly for testing one algorithm versus the other, and it should not normally be necessary to change it.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_ROW_IMAGE
+SESSION_VALUE FULL
+GLOBAL_VALUE FULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE FULL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL).
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_STMT_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance.
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BULK_INSERT_BUFFER_SIZE
+SESSION_VALUE 8388608
+GLOBAL_VALUE 8388608
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8388608
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME CHARACTER_SETS_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory where character sets are
+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 CHARACTER_SET_CLIENT
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set for statements that arrive from the client
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_CONNECTION
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used for literals that do not have a character set introducer and for number-to-string conversion
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_DATABASE
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used by the default database
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_FILESYSTEM
+SESSION_VALUE binary
+GLOBAL_VALUE binary
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE binary
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The filesystem character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_RESULTS
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used for returning query results to the client
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_SERVER
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The default character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_SYSTEM
+SESSION_VALUE NULL
+GLOBAL_VALUE utf8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used by the server for storing identifiers
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLLATION_CONNECTION
+SESSION_VALUE latin1_swedish_ci
+GLOBAL_VALUE latin1_swedish_ci
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1_swedish_ci
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The collation of the connection character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLLATION_DATABASE
+SESSION_VALUE latin1_swedish_ci
+GLOBAL_VALUE latin1_swedish_ci
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1_swedish_ci
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The collation of the database character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLLATION_SERVER
+SESSION_VALUE latin1_swedish_ci
+GLOBAL_VALUE latin1_swedish_ci
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1_swedish_ci
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The server default collation
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COMPLETION_TYPE
+SESSION_VALUE NO_CHAIN
+GLOBAL_VALUE NO_CHAIN
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NO_CHAIN
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The transaction completion type
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO_CHAIN,CHAIN,RELEASE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME CONCURRENT_INSERT
+SESSION_VALUE NULL
+GLOBAL_VALUE AUTO
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE AUTO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Use concurrent insert with MyISAM
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NEVER,AUTO,ALWAYS
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME CONNECT_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 60
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 10
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
+NUMERIC_MIN_VALUE 2
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DATADIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE PATH
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the database root directory
+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 DATETIME_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE %Y-%m-%d %H:%i:%s
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE %Y-%m-%d %H:%i:%s
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The DATETIME format (ignored)
+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 DATE_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE %Y-%m-%d
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE %Y-%m-%d
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The DATE format (ignored)
+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 DEADLOCK_SEARCH_DEPTH_LONG
+SESSION_VALUE 15
+GLOBAL_VALUE 15
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 15
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Long search depth for the two-step deadlock detection
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 33
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT
+SESSION_VALUE 4
+GLOBAL_VALUE 4
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Short search depth for the two-step deadlock detection
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 32
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEADLOCK_TIMEOUT_LONG
+SESSION_VALUE 50000000
+GLOBAL_VALUE 50000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50000000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT
+SESSION_VALUE 10000
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEFAULT_REGEX_FLAGS
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Default flags for the regex library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEFAULT_STORAGE_ENGINE
+SESSION_VALUE MyISAM
+GLOBAL_VALUE MyISAM
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE MyISAM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The default storage engine for new tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME DEFAULT_TMP_STORAGE_ENGINE
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The default storage engine for user-created temporary tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME DEFAULT_WEEK_FORMAT
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The default week format used by WEEK() functions
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 7
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAYED_INSERT_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAYED_INSERT_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 300
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 300
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAYED_QUEUE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAY_KEY_WRITE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how MyISAM tables handles CREATE TABLE DELAY_KEY_WRITE. If set to ON, the default, any DELAY KEY WRITEs are honored. The key buffer is then flushed only when the table closes, speeding up writes. MyISAM tables should be automatically checked upon startup in this case, and --external locking should not be used, as it can lead to index corruption. If set to OFF, DELAY KEY WRITEs are ignored, while if set to ALL, all new opened tables are treated as if created with DELAY KEY WRITEs enabled.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON,ALL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME DIV_PRECISION_INCREMENT
+SESSION_VALUE 4
+GLOBAL_VALUE 5
+GLOBAL_VALUE_ORIGIN SQL
+DEFAULT_VALUE 4
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 30
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ENCRYPT_BINLOG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Encrypt binary logs (including relay logs)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME ENCRYPT_TMP_DISK_TABLES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Encrypt temporary on-disk tables (created as part of query execution)
+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 ENCRYPT_TMP_FILES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Encrypt temporary files (created for filesort, binary log cache, etc)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME ENFORCE_STORAGE_ENGINE
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Force the use of a storage engine for new tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME ERROR_COUNT
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of errors that resulted from the last statement that generated messages
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME EXPENSIVE_SUBQUERY_LIMIT
+SESSION_VALUE 100
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum number of rows a subquery may examine in order to be executed during optimization and used for constant optimization
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME EXPIRE_LOGS_DAYS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 99
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME EXPLICIT_DEFAULTS_FOR_TIMESTAMP
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT This option causes CREATE TABLE to create all TIMESTAMP columns as NULL with DEFAULT NULL attribute, Without this option, TIMESTAMP columns are NOT NULL and have implicit DEFAULT clauses. The old behavior is deprecated.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME EXTERNAL_USER
+SESSION_VALUE
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The external user account used when logging in
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME EXTRA_MAX_CONNECTIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of connections on extra-port
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME EXTRA_PORT
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Extra port number to use for tcp connections in a one-thread-per-connection manner. 0 means don't use another port
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FLUSH
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Flush MyISAM tables to disk between SQL commands
+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 FLUSH_TIME
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FOREIGN_KEY_CHECKS
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (the default) foreign key constraints (including ON UPDATE and ON DELETE behavior) InnoDB tables are checked, while if set to 0, they are not checked. 0 is not recommended for normal use, though it can be useful in situations where you know the data is consistent, but want to reload data in a different order from that that specified by parent/child relationships. Setting this variable to 1 does not retrospectively check for inconsistencies introduced while set to 0.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME FT_BOOLEAN_SYNTAX
+SESSION_VALUE NULL
+GLOBAL_VALUE + -><()~*:""&|
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE + -><()~*:""&|
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_MAX_WORD_LEN
+SESSION_VALUE NULL
+GLOBAL_VALUE 84
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 84
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+NUMERIC_MIN_VALUE 10
+NUMERIC_MAX_VALUE 84
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_MIN_WORD_LEN
+SESSION_VALUE NULL
+GLOBAL_VALUE 4
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 84
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of best matches to use for query expansion
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_STOPWORD_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE (built-in)
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Use stopwords from this file instead of built-in list
+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 GENERAL_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log connections and queries to a table or log file. Defaults logging to a file 'hostname'.log or a table mysql.general_logif --log-output=TABLE is used.
+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 GENERAL_LOG_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Log connections and queries to given file
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME GROUP_CONCAT_MAX_LEN
+SESSION_VALUE 1024
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT()
+NUMERIC_MIN_VALUE 4
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME GTID_DOMAIN_ID
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Used with global transaction ID to identify logically independent replication streams. When events can propagate through multiple parallel paths (for example multiple masters), each independent source server must use a distinct domain_id. For simple tree-shaped replication topologies, it can be left at its default, 0.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME GTID_SEQ_NO
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Internal server usage, for replication with global transaction id. When set, next event group logged to the binary log will use this sequence number, not generate a new one, thus allowing to preserve master's GTID in slave's binlog.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_COMPRESS
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the zlib compression library is accessible to the server, this will be set to YES, otherwise it will be NO. The COMPRESS() and UNCOMPRESS() functions will only be available if set to YES.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_CRYPT
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the crypt() system call is available this variable will be set to YES, otherwise it will be set to NO. If set to NO, the ENCRYPT() function cannot be used.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_DYNAMIC_LOADING
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports dynamic loading of plugins, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_GEOMETRY
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports spatial data types, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_PROFILING
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If statement profiling is available, will be set to YES, otherwise will be set to NO. See SHOW PROFILES and SHOW PROFILE.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_QUERY_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports the query cache, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_RTREE_KEYS
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If RTREE indexes (used for spatial indexes) are available, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_SSL
+SESSION_VALUE NULL
+GLOBAL_VALUE NO
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports secure connections, will be set to YES, otherwise will be set to NO. If set to DISABLED, the server was compiled with TLS support, but was not started with TLS support (see the mysqld options). See also have_openssl.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HISTOGRAM_SIZE
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 255
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME HISTOGRAM_TYPE
+SESSION_VALUE SINGLE_PREC_HB
+GLOBAL_VALUE SINGLE_PREC_HB
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE SINGLE_PREC_HB
+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.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST SINGLE_PREC_HB,DOUBLE_PREC_HB
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME HOST_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 279
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 128
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT How many host names should be cached to avoid resolving.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 65536
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME IDENTITY
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Synonym for the last_insert_id variable
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME IGNORE_BUILTIN_INNODB
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Disable initialization of builtin InnoDB plugin
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME IGNORE_DB_DIRS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Specifies a directory to add to the ignore list when collecting database names from the datadir. Put a blank argument to reset the list accumulated so far.
+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 INIT_CONNECT
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Command(s) that are executed for each new connection (unless the user has SUPER privilege)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INIT_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Read SQL commands from this file at startup
+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 INIT_SLAVE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Command(s) that are executed by a slave server each time the SQL thread starts
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INSERT_ID
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The value to be used by the following INSERT or ALTER TABLE statement when inserting an AUTO_INCREMENT value
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME INTERACTIVE_TIMEOUT
+SESSION_VALUE 28800
+GLOBAL_VALUE 28800
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 28800
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME IN_TRANSACTION
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Whether there is an active transaction
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME JOIN_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 262144
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffer that is used for joins
+NUMERIC_MIN_VALUE 128
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 128
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME JOIN_BUFFER_SPACE_LIMIT
+SESSION_VALUE 2097152
+GLOBAL_VALUE 2097152
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2097152
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The limit of the space for all join buffers used by a query
+NUMERIC_MIN_VALUE 2048
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 2048
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME JOIN_CACHE_LEVEL
+SESSION_VALUE 2
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 8
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEEP_FILES_ON_CREATE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't overwrite stale .MYD and .MYI even if no directory is specified
+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 KEY_BUFFER_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 134217728
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_AGE_THRESHOLD
+SESSION_VALUE NULL
+GLOBAL_VALUE 300
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 300
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache
+NUMERIC_MIN_VALUE 100
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 100
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_BLOCK_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The default size of key cache blocks
+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 KEY_CACHE_DIVISION_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_FILE_HASH_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 512
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 512
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of MyISAM files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open MyISAM files.
+NUMERIC_MIN_VALUE 128
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_SEGMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of segments in a key cache
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 64
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LARGE_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable support for large pages
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LARGE_PAGE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT If large page support is enabled, this shows the size of memory pages
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LAST_INSERT_ID
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The value to be returned from LAST_INSERT_ID()
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LC_MESSAGES
+SESSION_VALUE en_US
+GLOBAL_VALUE en_US
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE en_US
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Set the language used for the error messages
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LC_MESSAGES_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory where error messages are
+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 LC_TIME_NAMES
+SESSION_VALUE en_US
+GLOBAL_VALUE en_US
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE en_US
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Set the language used for the month names and the days of the week
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LICENSE
+SESSION_VALUE NULL
+GLOBAL_VALUE GPL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The type of license the server has
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOCAL_INFILE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable LOAD DATA LOCAL INFILE
+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 LOCKED_IN_MEMORY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether mysqld was locked in memory with --memlock
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOCK_WAIT_TIMEOUT
+SESSION_VALUE 31536000
+GLOBAL_VALUE 31536000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 31536000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_BIN
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether the binary log is enabled
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOG_BIN_TRUST_FUNCTION_CREATORS
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to FALSE (the default), then when --log-bin is used, creation of a stored function (or trigger) is allowed only to users having the SUPER privilege and only if this stored function (trigger) may not break binary logging. Note that if ALL connections to this server ALWAYS use row-based binary logging, the security issues do not exist and the binary logging cannot break, so you can safely set this to TRUE
+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 LOG_ERROR
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Log errors to file (instead of stdout). If file name is not specified then 'datadir'/'log-basename'.err or the 'pid-file' path with extension .err is used
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LOG_OUTPUT
+SESSION_VALUE NULL
+GLOBAL_VALUE FILE
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE FILE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE SET
+VARIABLE_COMMENT How logs should be written
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NONE,FILE,TABLE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_QUERIES_NOT_USING_INDEXES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log queries that are executed without benefit of any index to the slow log if it is open
+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 LOG_SLOW_ADMIN_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.
+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 LOG_SLOW_FILTER
+SESSION_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+GLOBAL_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Log only certain types of queries
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_SLOW_RATE_LIMIT
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_SLOW_SLAVE_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open.
+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 LOG_SLOW_VERBOSITY
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Verbosity level for the slow log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST innodb,query_plan,explain
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_WARNINGS
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LONG_QUERY_TIME
+SESSION_VALUE 10.000000
+GLOBAL_VALUE 10.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10.000000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Log all queries that have taken more than long_query_time seconds to execute to file. The argument will be treated as a decimal value with microsecond precision
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOW_PRIORITY_UPDATES
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT INSERT/DELETE/UPDATE has lower priority than selects
+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 MAX_ALLOWED_PACKET
+SESSION_VALUE 4194304
+GLOBAL_VALUE 4194304
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4194304
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max packet length to send to or receive from the server
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 18446744073709547520
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709547520
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the total size of the transactional cache
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1073741824
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1073741824
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 18446744073709547520
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709547520
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the total size of the statement cache
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_CONNECTIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE 151
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 151
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of simultaneous clients allowed
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_CONNECT_ERRORS
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_DELAYED_THREADS
+SESSION_VALUE 20
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_DIGEST_LENGTH
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Maximum length considered for digest text.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_ERROR_COUNT
+SESSION_VALUE 64
+GLOBAL_VALUE 64
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 64
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max number of errors/warnings to store for a statement
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_HEAP_TABLE_SIZE
+SESSION_VALUE 1048576
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 16777216
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
+NUMERIC_MIN_VALUE 16384
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_INSERT_DELAYED_THREADS
+SESSION_VALUE 20
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME MAX_JOIN_SIZE
+SESSION_VALUE 18446744073709551615
+GLOBAL_VALUE 18446744073709551615
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709551615
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Joins that are probably going to read more than max_join_size records return an error
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA
+SESSION_VALUE 1024
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max number of bytes in sorted records
+NUMERIC_MIN_VALUE 4
+NUMERIC_MAX_VALUE 8388608
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_LONG_DATA_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 4194304
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_PREPARED_STMT_COUNT
+SESSION_VALUE NULL
+GLOBAL_VALUE 16382
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16382
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of prepared statements in the server
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SEEKS_FOR_KEY
+SESSION_VALUE 4294967295
+GLOBAL_VALUE 4294967295
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4294967295
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SESSION_MEM_USED
+SESSION_VALUE 9223372036854775807
+GLOBAL_VALUE 9223372036854775807
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 9223372036854775807
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Amount of memory a single user session is allowed to allocate. This limits the value of the session variable MEM_USED
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SORT_LENGTH
+SESSION_VALUE 1024
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
+NUMERIC_MIN_VALUE 4
+NUMERIC_MAX_VALUE 8388608
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SP_RECURSION_DEPTH
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum stored procedure recursion depth
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 255
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME MAX_STATEMENT_TIME
+SESSION_VALUE 0.000000
+GLOBAL_VALUE 0.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.000000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT A query that has taken more than max_statement_time seconds will be aborted. The argument will be treated as a decimal value with microsecond precision. A value of 0 (default) means no timeout
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_TMP_TABLES
+SESSION_VALUE 32
+GLOBAL_VALUE 32
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused, will be removed.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_USER_CONNECTIONS
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT
+VARIABLE_COMMENT The maximum number of active connections for a single user (0 = no limit)
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_WRITE_LOCK_COUNT
+SESSION_VALUE NULL
+GLOBAL_VALUE 4294967295
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4294967295
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MRR_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 262144
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Size of buffer to use when using MRR with range access
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MULTI_RANGE_COUNT
+SESSION_VALUE 256
+GLOBAL_VALUE 256
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 256
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Ignored. Use mrr_buffer_size instead
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_BLOCK_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Block size to be used for MyISAM index pages
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_DATA_POINTER_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 6
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 6
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
+NUMERIC_MIN_VALUE 2
+NUMERIC_MAX_VALUE 7
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 9223372036853727232
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 9223372036853727232
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1048576
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_MMAP_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 18446744073709551615
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709551615
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
+NUMERIC_MIN_VALUE 7
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_RECOVER_OPTIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE DEFAULT
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE DEFAULT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Specifies how corrupted tables should be automatically repaired
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT,BACKUP,FORCE,QUICK,BACKUP_ALL,OFF
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME MYISAM_REPAIR_THREADS
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If larger than 1, when repairing a MyISAM table all indexes will be created in parallel, with one thread per index. The value of 1 disables parallel repair
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_SORT_BUFFER_SIZE
+SESSION_VALUE 134216704
+GLOBAL_VALUE 134216704
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 134216704
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_STATS_METHOD
+SESSION_VALUE NULLS_UNEQUAL
+GLOBAL_VALUE NULLS_UNEQUAL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULLS_UNEQUAL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how MyISAM index statistics collection code should treat NULLs. Possible values of name are NULLS_UNEQUAL (default behavior for 4.1 and later), NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULLS_UNEQUAL,NULLS_EQUAL,NULLS_IGNORED
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_USE_MMAP
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use memory mapping for reading and writing MyISAM tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME MYSQL56_TEMPORAL_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME, DATETIME, TIMESTAMP columns.
+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 NET_BUFFER_LENGTH
+SESSION_VALUE 16384
+GLOBAL_VALUE 16384
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16384
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME NET_READ_TIMEOUT
+SESSION_VALUE 30
+GLOBAL_VALUE 30
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME NET_RETRY_COUNT
+SESSION_VALUE 10
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME NET_WRITE_TIMEOUT
+SESSION_VALUE 60
+GLOBAL_VALUE 60
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 60
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OLD
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use compatible behavior from previous MariaDB version. See also --old-mode
+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 OLD_ALTER_TABLE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use old, non-optimized alter table
+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 OLD_MODE
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Used to emulate old behavior from earlier MariaDB or MySQL versions
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO,ZERO_DATE_TIME_CAST
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OLD_PASSWORDS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use old password encryption method (needed for 4.0 and older clients)
+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 OPTIMIZER_PRUNE_LEVEL
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
+SESSION_VALUE 62
+GLOBAL_VALUE 62
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 62
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 63
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT
+SESSION_VALUE 100
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls number of record samples to check condition selectivity
+NUMERIC_MIN_VALUE 10
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SWITCH
+SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
+GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE FLAGSET
+VARIABLE_COMMENT Fine-tune the optimizer behavior
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,default
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 5
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable the performance schema.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 200
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 200
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 80
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 80
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of condition instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 50
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of file instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
+SESSION_VALUE NULL
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of opened instrumented files.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 200
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 200
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of mutex instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 5000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 104857600
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 40
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 40
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of rwlock instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 5000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 104857600
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of socket instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 150
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 150
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of stage instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 178
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 178
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of statement instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 500
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 50
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of thread instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 200
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2048
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PID_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Pid file used by safe_mysqld
+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 PLUGIN_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory for plugins
+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 PLUGIN_MATURITY
+SESSION_VALUE NULL
+GLOBAL_VALUE unknown
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE unknown
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The lowest desirable plugin maturity. Plugins less mature than that will not be installed or loaded
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST unknown,experimental,alpha,beta,gamma,stable
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PORT
+SESSION_VALUE NULL
+GLOBAL_VALUE MASTER_MYPORT
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Port number to use for connection or 0 to default to, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306), whatever comes first
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PRELOAD_BUFFER_SIZE
+SESSION_VALUE 32768
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PROFILING
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (0 is default), statement profiling will be enabled. See SHOW PROFILES and SHOW PROFILE.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PROFILING_HISTORY_SIZE
+SESSION_VALUE 15
+GLOBAL_VALUE 15
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 15
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PROGRESS_REPORT_TIME
+SESSION_VALUE 5
+GLOBAL_VALUE 5
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 5
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PROTOCOL_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The version of the client/server protocol used by the MariaDB server
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PROXY_USER
+SESSION_VALUE
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The proxy user account name used when logging in
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PSEUDO_SLAVE_MODE
+SESSION_VALUE OFF
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT SET pseudo_slave_mode= 0,1 are commands that mysqlbinlog adds to beginning and end of binary log dumps. While zero value indeed disables, the actual enabling of the slave applier execution mode is done implicitly when a Format_description_event is sent through the session.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PSEUDO_THREAD_ID
+SESSION_VALUE 10
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT This variable is for internal server use
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE
+SESSION_VALUE 16384
+GLOBAL_VALUE 16384
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16384
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Allocation block size for query parsing and execution
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't cache results that are bigger than this
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 4096
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4096
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 8
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The memory allocated to store results from old queries
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_STRIP_COMMENTS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Strip all comments from a query before storing it in the query cache
+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 QUERY_CACHE_TYPE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT OFF = Don't cache or retrieve results. ON = Cache all results except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only SELECT SQL_CACHE ... queries
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON,DEMAND
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_WLOCK_INVALIDATE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Invalidate queries in query cache on LOCK for write
+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 QUERY_PREALLOC_SIZE
+SESSION_VALUE 24576
+GLOBAL_VALUE 24576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 24576
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Persistent buffer for query parsing and execution
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RANGE_ALLOC_BLOCK_SIZE
+SESSION_VALUE 4096
+GLOBAL_VALUE 4096
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4096
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Allocation block size for storing ranges during optimization
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME READ_BUFFER_SIZE
+SESSION_VALUE 131072
+GLOBAL_VALUE 131072
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 131072
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME READ_ONLY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege
+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 READ_RND_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 262144
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ROWID_MERGE_BUFF_SIZE
+SESSION_VALUE 8388608
+GLOBAL_VALUE 8388608
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8388608
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffers used [NOT] IN evaluation via partial matching
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SECURE_AUTH
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Disallow authentication for accounts that have old (pre-4.1) passwords
+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 SECURE_FILE_PRIV
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory
+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 SERVER_ID
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SKIP_EXTERNAL_LOCKING
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't use system (external) locking
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SKIP_NAME_RESOLVE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't resolve hostnames. All hostnames are IP's or 'localhost'.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SKIP_NETWORKING
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't allow connection with TCP/IP
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SKIP_REPLICATION
+SESSION_VALUE OFF
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Changes are logged into the binary log with the @@skip_replication flag set. Such events will not be replicated by slaves that run with --replicate-events-marked-for-skip set different from its default of REPLICATE. See Selectively skipping replication of binlog events for more information.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SKIP_SHOW_DATABASE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't allow 'SHOW DATABASE' commands
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SLAVE_COMPRESSED_PROTOCOL
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use compression on master/slave protocol
+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 SLAVE_MAX_ALLOWED_PACKET
+SESSION_VALUE NULL
+GLOBAL_VALUE 1073741824
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1073741824
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLOW_LAUNCH_TIME
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLOW_QUERY_LOG
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow queries to a table or log file. Defaults logging to a file 'hostname'-slow.log or a table mysql.slow_log if --log-output=TABLE is used. Must be enabled to activate other slow log options.
+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 SLOW_QUERY_LOG_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Log slow queries to given log file. Defaults logging to 'hostname'-slow.log. Must be enabled to activate other slow log options
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SOCKET
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Socket file to use for connection
+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 SORT_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 2097152
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SQL_AUTO_IS_NULL
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the query SELECT * FROM table_name WHERE auto_increment_column IS NULL will return an auto-increment that has just been successfully inserted, the same as the LAST_INSERT_ID() function. Some ODBC programs make use of this IS NULL comparison.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_BIG_SELECTS
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 0, MariaDB will not perform large SELECTs. See max_join_size for details. If max_join_size is set to anything but DEFAULT, sql_big_selects is automatically set to 0. If sql_big_selects is again set, max_join_size will be ignored.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_BUFFER_RESULT
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (0 is default), results from SELECT statements are always placed into temporary tables. This can help the server when it takes a long time to send the results to the client by allowing the table locks to be freed early.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_LOG_BIN
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 0 (1 is the default), no logging to the binary log is done for the client. Only clients with the SUPER privilege can update this variable. Can have unintended consequences if set globally, see SET SQL_LOG_BIN. Starting MariaDB 10.1.7, this variable does not affect the replication of events in a Galera cluster.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_LOG_OFF
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (0 is the default), no logging to the general query log is done for the client. Only clients with the SUPER privilege can update this variable.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_MODE
+SESSION_VALUE ANSI_QUOTES
+GLOBAL_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Sets the sql mode
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,IGNORE_BAD_TABLE_OPTIONS,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SQL_NOTES
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, warning_count is incremented each time a Note warning is encountered. If set to 0, Note warnings are not recorded. mysqldump has outputs to set this variable to 0 so that no unnecessary increments occur when data is reloaded.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_QUOTE_SHOW_CREATE
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, the server will quote identifiers for SHOW CREATE DATABASE, SHOW CREATE TABLE and SHOW CREATE VIEW statements. Quoting is disabled if set to 0. Enable to ensure replications works when identifiers require quoting.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_SAFE_UPDATES
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, UPDATEs and DELETEs need either a key in the WHERE clause, or a LIMIT clause, or else they will aborted. Prevents the common mistake of accidentally deleting or updating every row in a table.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_SELECT_LIMIT
+SESSION_VALUE 18446744073709551615
+GLOBAL_VALUE 18446744073709551615
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709551615
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum number of rows to return from SELECT statements
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_WARNINGS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, single-row INSERTs will produce a string containing warning information if a warning occurs.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_CA
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CA file in PEM format (check OpenSSL docs, implies --ssl)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_CAPATH
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CA directory (check OpenSSL docs, implies --ssl)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_CERT
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT X509 cert in PEM format (implies --ssl)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_CIPHER
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT SSL cipher to use (implies --ssl)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_CRL
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CRL file in PEM format (check OpenSSL docs, implies --ssl)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_CRLPATH
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CRL directory (check OpenSSL docs, implies --ssl)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_KEY
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT X509 key in PEM format (implies --ssl)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME STORAGE_ENGINE
+SESSION_VALUE MyISAM
+GLOBAL_VALUE MyISAM
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE MyISAM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Alias for @@default_storage_engine. Deprecated
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME STORED_PROGRAM_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE 256
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 256
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 524288
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME STRICT_PASSWORD_VALIDATION
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT When password validation plugins are enabled, reject passwords that cannot be validated (passwords specified as a hash)
+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 SYNC_BINLOG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Synchronously flush binary log to disk after every #th event. Use 0 (default) to disable synchronous flushing
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SYNC_FRM
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Sync .frm files to disk on creation
+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 SYNC_MASTER_INFO
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Synchronously flush master info to disk after every #th event. Use 0 to disable synchronous flushing
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TABLE_DEFINITION_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE 400
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 400
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of cached table definitions
+NUMERIC_MIN_VALUE 400
+NUMERIC_MAX_VALUE 524288
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TABLE_OPEN_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of cached open tables
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT How many threads we should keep in a cache for reuse
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_CONCURRENCY
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 512
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_HANDLING
+SESSION_VALUE NULL
+GLOBAL_VALUE no-threads
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE one-thread-per-connection
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Define threads usage for handling queries
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST one-thread-per-connection,no-threads
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_STACK
+SESSION_VALUE NULL
+GLOBAL_VALUE 295936
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 295936
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The stack size for each thread
+NUMERIC_MIN_VALUE 131072
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TIMED_MUTEXES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Specify whether to time mutexes. Deprecated, has no effect.
+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 TIMESTAMP
+SESSION_VALUE 1409578823.000000
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.000000
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Set the time for this client
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME TIME_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE %H:%i:%s
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE %H:%i:%s
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The TIME format (ignored)
+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 TIME_ZONE
+SESSION_VALUE +00:00
+GLOBAL_VALUE SYSTEM
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE SYSTEM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The current time zone, used to initialize the time zone for a client when it connects. Set to SYSTEM by default, in which the client uses the system time zone value.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME TMPDIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path for temporary files. Several paths may be specified, separated by a colon (:), in this case they are used in a round-robin fashion
+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 TMP_TABLE_SIZE
+SESSION_VALUE 16777216
+GLOBAL_VALUE 16777216
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16777216
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_ALLOC_BLOCK_SIZE
+SESSION_VALUE 8192
+GLOBAL_VALUE 8192
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8192
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 134217728
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
+SESSION_VALUE 4096
+GLOBAL_VALUE 4096
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4096
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 134217728
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TX_ISOLATION
+SESSION_VALUE REPEATABLE-READ
+GLOBAL_VALUE REPEATABLE-READ
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE REPEATABLE-READ
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Default transaction isolation level
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ,SERIALIZABLE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME TX_READ_ONLY
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME UNIQUE_CHECKS
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, secondary indexes in InnoDB tables are performed. If set to 0, storage engines can (but are not required to) assume that duplicate keys are not present in input data. Set to 0 to speed up imports of large tables to InnoDB. The storage engine will still issue a duplicate key error if it detects one, even if set to 0.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME UPDATABLE_VIEWS_WITH_LIMIT
+SESSION_VALUE YES
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE YES
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO,YES
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME USERSTAT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enables statistics gathering for USER_STATISTICS, CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS tables in the INFORMATION_SCHEMA
+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 USE_STAT_TABLES
+SESSION_VALUE NEVER
+GLOBAL_VALUE NEVER
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NEVER
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how to use system statistics tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NEVER,COMPLEMENTARY,PREFERABLY
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WAIT_TIMEOUT
+SESSION_VALUE 28800
+GLOBAL_VALUE 28800
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 28800
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WARNING_COUNT
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of errors, warnings, and notes that resulted from the last statement that generated messages
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+select VARIABLE_NAME, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT,
+NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE,
+ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT
+from information_schema.system_variables
+where variable_name in (
+'have_openssl',
+'have_symlink',
+'hostname',
+'large_files_support',
+'lower_case_file_system',
+'lower_case_table_names',
+'open_files_limit',
+'rand_seed1',
+'rand_seed2',
+'system_time_zone',
+'version_comment',
+'version_compile_machine', 'version_compile_os',
+'version_malloc_library', 'version_ssl_library', 'version'
+ )
+order by variable_name;
+VARIABLE_NAME HAVE_OPENSSL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Comparing have_openssl with have_ssl will indicate whether YaSSL or openssl was used. If YaSSL, have_ssl will be YES, but have_openssl will be NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_SYMLINK
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If symbolic link support is enabled, will be set to YES, otherwise will be set to NO. Required for the INDEX DIRECTORY and DATA DIRECTORY table options (see CREATE TABLE) and Windows symlink support. Will be set to DISABLED if the server is started with the --skip-symbolic-links option.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HOSTNAME
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Server host name
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LARGE_FILES_SUPPORT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether mysqld was compiled with options for large file support
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOWER_CASE_FILE_SYSTEM
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Case sensitivity of file names on the file system where the data directory is located
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOWER_CASE_TABLE_NAMES
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive. Should be set to 2 if you are using a case insensitive file system
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME OPEN_FILES_LIMIT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RAND_SEED1
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME RAND_SEED2
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SYSTEM_TIME_ZONE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The server system time zone
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Server version number. It may also include a suffix with configuration or build information. -debug indicates debugging support was enabled on the server, and -log indicates at least one of the binary log, general log or slow query log are enabled, for example 10.1.1-MariaDB-mariadb1precise-log.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_COMMENT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Value of the COMPILATION_COMMENT option specified by CMake when building MariaDB, for example mariadb.org binary distribution.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_COMPILE_MACHINE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The machine type or architecture MariaDB was built on, for example i686.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_COMPILE_OS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Operating system that MariaDB was built on, for example debian-linux-gnu.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_MALLOC_LIBRARY
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Version of the used malloc library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_SSL_LIBRARY
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Version of the used SSL library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+select VARIABLE_NAME, GLOBAL_VALUE_ORIGIN, VARIABLE_SCOPE, VARIABLE_TYPE,
+VARIABLE_COMMENT, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT
+from information_schema.system_variables
+where variable_name in (
+'log_tc_size'
+ )
+order by variable_name;
+VARIABLE_NAME LOG_TC_SIZE
+GLOBAL_VALUE_ORIGIN AUTO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Size of transaction coordinator log.
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+set global div_precision_increment=default;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
new file mode 100644
index 00000000000..980b06a1055
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
@@ -0,0 +1,1280 @@
+--- sysvars_server_notembedded.result
++++ sysvars_server_notembedded,32bit.result~
+@@ -57,7 +57,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Auto-increment columns are incremented by this
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 65535
+@@ -71,7 +71,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 65535
+@@ -85,7 +85,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 150
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 65535
+@@ -144,7 +144,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the transactional cache for updates to transactional engines for the binary log. If you often use transactions containing many statements, you can increase this to get more performance
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -169,10 +169,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If non-zero, binlog write will wait at most binlog_commit_wait_usec microseconds for at least this many commits to queue up for group commit to the binlog. This can reduce I/O on the binlog and provide increased opportunity for parallel apply on the slave, but too high a value will decrease commit throughput.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -183,10 +183,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum time, in microseconds, to wait for more commits to queue up for binlog group commit. Only takes effect if the value of binlog_commit_wait_count is non-zero.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -256,7 +256,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance.
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -270,7 +270,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -463,7 +463,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
+ NUMERIC_MIN_VALUE 2
+ NUMERIC_MAX_VALUE 31536000
+@@ -519,7 +519,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 15
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Long search depth for the two-step deadlock detection
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 33
+@@ -533,7 +533,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Short search depth for the two-step deadlock detection
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 32
+@@ -547,7 +547,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50000000
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -561,7 +561,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10000
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -631,7 +631,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The default week format used by WEEK() functions
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 7
+@@ -645,7 +645,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -659,7 +659,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 300
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -673,7 +673,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -701,7 +701,7 @@
+ GLOBAL_VALUE_ORIGIN SQL
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 30
+@@ -813,7 +813,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 99
+@@ -855,7 +855,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of connections on extra-port
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 100000
+@@ -897,7 +897,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 31536000
+@@ -939,7 +939,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 84
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+ NUMERIC_MIN_VALUE 10
+ NUMERIC_MAX_VALUE 84
+@@ -953,7 +953,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 84
+@@ -967,7 +967,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 20
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of best matches to use for query expansion
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000
+@@ -1026,7 +1026,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT()
+ NUMERIC_MIN_VALUE 4
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1261,7 +1261,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 255
+@@ -1289,7 +1289,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 128
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How many host names should be cached to avoid resolving.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 65536
+@@ -1401,7 +1401,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 28800
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -1432,7 +1432,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the buffer that is used for joins
+ NUMERIC_MIN_VALUE 128
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 128
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1457,7 +1457,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 8
+@@ -1488,7 +1488,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1709,7 +1709,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 31536000
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -1863,7 +1863,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1905,7 +1905,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -1961,7 +1961,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4194304
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max packet length to send to or receive from the server
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1073741824
+@@ -1971,14 +1971,14 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MAX_BINLOG_CACHE_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 18446744073709547520
++GLOBAL_VALUE 4294963200
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709547520
++DEFAULT_VALUE 4294963200
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the total size of the transactional cache
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1989,7 +1989,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1073741824
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
+ NUMERIC_MIN_VALUE 4096
+ NUMERIC_MAX_VALUE 1073741824
+@@ -1999,14 +1999,14 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 18446744073709547520
++GLOBAL_VALUE 4294963200
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709547520
++DEFAULT_VALUE 4294963200
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the total size of the statement cache
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2017,7 +2017,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 151
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of simultaneous clients allowed
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 100000
+@@ -2031,7 +2031,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2045,7 +2045,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 20
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16384
+@@ -2073,7 +2073,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 64
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max number of errors/warnings to store for a statement
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 65535
+@@ -2090,7 +2090,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
+ NUMERIC_MIN_VALUE 16384
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1024
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2101,7 +2101,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 20
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16384
+@@ -2129,7 +2129,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max number of bytes in sorted records
+ NUMERIC_MIN_VALUE 4
+ NUMERIC_MAX_VALUE 8388608
+@@ -2143,7 +2143,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 1048576
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2157,7 +2157,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16382
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of prepared statements in the server
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -2185,7 +2185,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2213,7 +2213,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
+ NUMERIC_MIN_VALUE 4
+ NUMERIC_MAX_VALUE 8388608
+@@ -2227,7 +2227,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum stored procedure recursion depth
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 255
+@@ -2255,7 +2255,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 32
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Unused, will be removed.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2283,7 +2283,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2297,7 +2297,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Unused
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2311,7 +2311,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Unused
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1024
+@@ -2325,7 +2325,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2339,7 +2339,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 262144
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Size of buffer to use when using MRR with range access
+ NUMERIC_MIN_VALUE 8192
+ NUMERIC_MAX_VALUE 2147483647
+@@ -2353,10 +2353,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 256
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Ignored. Use mrr_buffer_size instead
+ NUMERIC_MIN_VALUE 1
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2367,7 +2367,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Block size to be used for MyISAM index pages
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 16384
+@@ -2381,7 +2381,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 6
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
+ NUMERIC_MIN_VALUE 2
+ NUMERIC_MAX_VALUE 7
+@@ -2391,9 +2391,9 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 9223372036853727232
++GLOBAL_VALUE 2146435072
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 9223372036853727232
++DEFAULT_VALUE 2146435072
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this
+@@ -2405,14 +2405,14 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME MYISAM_MMAP_SIZE
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 18446744073709551615
++GLOBAL_VALUE 4294967295
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE 18446744073709551615
++DEFAULT_VALUE 4294967295
+ VARIABLE_SCOPE GLOBAL
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
+ NUMERIC_MIN_VALUE 7
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+@@ -2437,10 +2437,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If larger than 1, when repairing a MyISAM table all indexes will be created in parallel, with one thread per index. The value of 1 disables parallel repair
+ NUMERIC_MIN_VALUE 1
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2454,7 +2454,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
+ NUMERIC_MIN_VALUE 4096
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -2507,7 +2507,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16384
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1048576
+@@ -2521,7 +2521,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 30
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -2535,7 +2535,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2549,7 +2549,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 60
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -2619,7 +2619,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1
+@@ -2633,7 +2633,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 62
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 63
+@@ -2647,7 +2647,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls number of record samples to check condition selectivity
+ NUMERIC_MIN_VALUE 10
+ NUMERIC_MAX_VALUE 4294967295
+@@ -2675,7 +2675,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 5
+@@ -2703,7 +2703,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2717,7 +2717,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 200
+@@ -2731,7 +2731,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2745,7 +2745,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1024
+@@ -2759,7 +2759,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2773,7 +2773,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1024
+@@ -2787,7 +2787,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2801,7 +2801,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1024
+@@ -2815,7 +2815,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2829,7 +2829,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 80
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of condition instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2843,7 +2843,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2857,7 +2857,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1024
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -2871,7 +2871,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of file instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2885,7 +2885,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 32768
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of opened instrumented files.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -2899,7 +2899,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2913,7 +2913,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 200
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of mutex instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2927,7 +2927,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 104857600
+@@ -2941,7 +2941,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 40
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of rwlock instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2955,7 +2955,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 104857600
+@@ -2969,7 +2969,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of socket instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -2983,7 +2983,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2997,7 +2997,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 150
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of stage instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -3011,7 +3011,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 178
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of statement instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -3025,7 +3025,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -3039,7 +3039,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -3053,7 +3053,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 50
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of thread instruments.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 256
+@@ -3067,7 +3067,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -3081,7 +3081,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -3095,7 +3095,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1024
+@@ -3109,7 +3109,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 100
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1048576
+@@ -3123,7 +3123,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE -1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT
++VARIABLE_TYPE INT
+ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -3193,7 +3193,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 32768
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1073741824
+@@ -3221,7 +3221,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 15
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -3235,7 +3235,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 5
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3291,10 +3291,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION ONLY
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT This variable is for internal server use
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3305,7 +3305,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 16384
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Allocation block size for query parsing and execution
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3319,7 +3319,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1048576
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Don't cache results that are bigger than this
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3333,7 +3333,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4096
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3350,7 +3350,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The memory allocated to store results from old queries
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1024
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3403,7 +3403,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 24576
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Persistent buffer for query parsing and execution
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3417,7 +3417,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4096
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Allocation block size for storing ranges during optimization
+ NUMERIC_MIN_VALUE 4096
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3431,7 +3431,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 131072
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
+ NUMERIC_MIN_VALUE 8192
+ NUMERIC_MAX_VALUE 2147483647
+@@ -3459,7 +3459,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 262144
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 2147483647
+@@ -3739,10 +3739,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8388608
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The size of the buffers used [NOT] IN evaluation via partial matching
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 9223372036854775807
++NUMERIC_MAX_VALUE 2147483647
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3781,7 +3781,7 @@
+ GLOBAL_VALUE_ORIGIN CONFIG
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -3907,7 +3907,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16383
+@@ -3949,7 +3949,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1073741824
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 1073741824
+@@ -3977,7 +3977,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 131072
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 2147483647
+@@ -4005,7 +4005,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16383
+@@ -4061,7 +4061,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -4089,7 +4089,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 31536000
+@@ -4148,7 +4148,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
+ NUMERIC_MIN_VALUE 1024
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -4439,7 +4439,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 256
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 524288
+@@ -4537,7 +4537,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 400
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of cached table definitions
+ NUMERIC_MIN_VALUE 400
+ NUMERIC_MAX_VALUE 524288
+@@ -4551,7 +4551,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 2000
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of cached open tables
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1048576
+@@ -4565,7 +4565,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT How many threads we should keep in a cache for reuse
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 16384
+@@ -4579,7 +4579,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 10
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release.
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 512
+@@ -4764,7 +4764,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
+ NUMERIC_MIN_VALUE 1024
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -4775,7 +4775,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 8192
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 134217728
+@@ -4789,7 +4789,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 4096
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 134217728
+@@ -4887,7 +4887,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 28800
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 31536000
+@@ -4991,7 +4991,7 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME OPEN_FILES_LIMIT
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 4294967295
+@@ -5004,7 +5004,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -5014,7 +5014,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -5099,7 +5099,7 @@
+ VARIABLE_NAME LOG_TC_SIZE
+ GLOBAL_VALUE_ORIGIN AUTO
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Size of transaction coordinator log.
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
new file mode 100644
index 00000000000..5bc6a6e1743
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -0,0 +1,5107 @@
+set time_zone='+00:00';
+set timestamp=unix_timestamp('2014-09-01 13:40:23');
+set pseudo_thread_id=10;
+set sql_mode=ansi_quotes;
+set global div_precision_increment=5;
+select * from information_schema.system_variables
+where variable_name not like 'aria%' and
+variable_name not like 'debug%' and
+variable_name not like 'wsrep%' and
+variable_name not in (
+'have_openssl',
+'have_symlink',
+'hostname',
+'large_files_support', 'log_tc_size',
+'lower_case_file_system',
+'lower_case_table_names',
+'open_files_limit',
+'rand_seed1',
+'rand_seed2',
+'system_time_zone',
+'version_comment',
+'version_compile_machine', 'version_compile_os',
+'version_malloc_library', 'version_ssl_library', 'version'
+ )
+order by variable_name;
+VARIABLE_NAME AUTOCOMMIT
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, all queries are committed immediately. If set to 0, they are only committed upon a COMMIT statement, or rolled back with a ROLLBACK statement. If autocommit is set to 0, and then changed to 1, all open transactions are immediately committed.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME AUTOMATIC_SP_PRIVILEGES
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Creating and dropping stored procedures alters ACLs
+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 AUTO_INCREMENT_INCREMENT
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Auto-increment columns are incremented by this
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME AUTO_INCREMENT_OFFSET
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BACK_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE 80
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 150
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BASEDIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to installation directory. All paths are usually resolved relative to this
+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 BIG_TABLES
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Old variable, which if set to 1, allows large result sets by saving all temporary sets to disk, avoiding 'table full' errors. No longer needed, as the server now handles this automatically. sql_big_tables is a synonym.
+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
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Tells the master to annotate RBR events with the statement that caused these events
+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_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the transactional cache for updates to transactional engines for the binary log. If you often use transactions containing many statements, you can increase this to get more performance
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_CHECKSUM
+SESSION_VALUE NULL
+GLOBAL_VALUE NONE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NONE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Type of BINLOG_CHECKSUM_ALG. Include checksum for log events in the binary log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NONE,CRC32
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_COMMIT_WAIT_COUNT
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If non-zero, binlog write will wait at most binlog_commit_wait_usec microseconds for at least this many commits to queue up for group commit to the binlog. This can reduce I/O on the binlog and provide increased opportunity for parallel apply on the slave, but too high a value will decrease commit throughput.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_COMMIT_WAIT_USEC
+SESSION_VALUE NULL
+GLOBAL_VALUE 100000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum time, in microseconds, to wait for more commits to queue up for binlog group commit. Only takes effect if the value of binlog_commit_wait_count is non-zero.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Causes updates to non-transactional engines using statement format to be written directly to binary log. Before using this option make sure that there are no dependencies between transactional and non-transactional tables such as in the statement INSERT INTO t_myisam SELECT * FROM t_innodb; otherwise, slaves may diverge from the master.
+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_FORMAT
+SESSION_VALUE STATEMENT
+GLOBAL_VALUE STATEMENT
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE STATEMENT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT What form of binary logging the master will use: either ROW for row-based binary logging, STATEMENT for statement-based binary logging, or MIXED. MIXED is statement-based binary logging except for those statements where only row-based is correct: those which involve user-defined functions (i.e. UDFs) or the UUID() function; for those, row-based binary logging is automatically used.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST MIXED,STATEMENT,ROW
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_OPTIMIZE_THREAD_SCHEDULING
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Run fast part of group commit in a single thread, to optimize kernel thread scheduling. On by default. Disable to run each transaction in group commit in its own thread, which can be slower at very high concurrency. This option is mostly for testing one algorithm versus the other, and it should not normally be necessary to change it.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_ROW_IMAGE
+SESSION_VALUE FULL
+GLOBAL_VALUE FULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE FULL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL).
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_STMT_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance.
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BULK_INSERT_BUFFER_SIZE
+SESSION_VALUE 8388608
+GLOBAL_VALUE 8388608
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8388608
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME CHARACTER_SETS_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory where character sets are
+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 CHARACTER_SET_CLIENT
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set for statements that arrive from the client
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_CONNECTION
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used for literals that do not have a character set introducer and for number-to-string conversion
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_DATABASE
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used by the default database
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_FILESYSTEM
+SESSION_VALUE binary
+GLOBAL_VALUE binary
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE binary
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The filesystem character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_RESULTS
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used for returning query results to the client
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_SERVER
+SESSION_VALUE latin1
+GLOBAL_VALUE latin1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The default character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_SYSTEM
+SESSION_VALUE NULL
+GLOBAL_VALUE utf8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The character set used by the server for storing identifiers
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLLATION_CONNECTION
+SESSION_VALUE latin1_swedish_ci
+GLOBAL_VALUE latin1_swedish_ci
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1_swedish_ci
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The collation of the connection character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLLATION_DATABASE
+SESSION_VALUE latin1_swedish_ci
+GLOBAL_VALUE latin1_swedish_ci
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1_swedish_ci
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The collation of the database character set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLLATION_SERVER
+SESSION_VALUE latin1_swedish_ci
+GLOBAL_VALUE latin1_swedish_ci
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE latin1_swedish_ci
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The server default collation
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COMPLETION_TYPE
+SESSION_VALUE NO_CHAIN
+GLOBAL_VALUE NO_CHAIN
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NO_CHAIN
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The transaction completion type
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO_CHAIN,CHAIN,RELEASE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME CONCURRENT_INSERT
+SESSION_VALUE NULL
+GLOBAL_VALUE AUTO
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE AUTO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Use concurrent insert with MyISAM
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NEVER,AUTO,ALWAYS
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME CONNECT_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 60
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 10
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
+NUMERIC_MIN_VALUE 2
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DATADIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE PATH
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the database root directory
+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 DATETIME_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE %Y-%m-%d %H:%i:%s
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE %Y-%m-%d %H:%i:%s
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The DATETIME format (ignored)
+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 DATE_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE %Y-%m-%d
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE %Y-%m-%d
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The DATE format (ignored)
+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 DEADLOCK_SEARCH_DEPTH_LONG
+SESSION_VALUE 15
+GLOBAL_VALUE 15
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 15
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Long search depth for the two-step deadlock detection
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 33
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT
+SESSION_VALUE 4
+GLOBAL_VALUE 4
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Short search depth for the two-step deadlock detection
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 32
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEADLOCK_TIMEOUT_LONG
+SESSION_VALUE 50000000
+GLOBAL_VALUE 50000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50000000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT
+SESSION_VALUE 10000
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEFAULT_MASTER_CONNECTION
+SESSION_VALUE
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Master connection to use for all slave variables and slave commands
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME DEFAULT_REGEX_FLAGS
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Default flags for the regex library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DEFAULT_STORAGE_ENGINE
+SESSION_VALUE MyISAM
+GLOBAL_VALUE MyISAM
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE MyISAM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The default storage engine for new tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME DEFAULT_TMP_STORAGE_ENGINE
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The default storage engine for user-created temporary tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME DEFAULT_WEEK_FORMAT
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The default week format used by WEEK() functions
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 7
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAYED_INSERT_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAYED_INSERT_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 300
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 300
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAYED_QUEUE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME DELAY_KEY_WRITE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how MyISAM tables handles CREATE TABLE DELAY_KEY_WRITE. If set to ON, the default, any DELAY KEY WRITEs are honored. The key buffer is then flushed only when the table closes, speeding up writes. MyISAM tables should be automatically checked upon startup in this case, and --external locking should not be used, as it can lead to index corruption. If set to OFF, DELAY KEY WRITEs are ignored, while if set to ALL, all new opened tables are treated as if created with DELAY KEY WRITEs enabled.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON,ALL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME DIV_PRECISION_INCREMENT
+SESSION_VALUE 4
+GLOBAL_VALUE 5
+GLOBAL_VALUE_ORIGIN SQL
+DEFAULT_VALUE 4
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 30
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ENCRYPT_BINLOG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Encrypt binary logs (including relay logs)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME ENCRYPT_TMP_DISK_TABLES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Encrypt temporary on-disk tables (created as part of query execution)
+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 ENCRYPT_TMP_FILES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Encrypt temporary files (created for filesort, binary log cache, etc)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME ENFORCE_STORAGE_ENGINE
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Force the use of a storage engine for new tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME ERROR_COUNT
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of errors that resulted from the last statement that generated messages
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME EVENT_SCHEDULER
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Enable the event scheduler. Possible values are ON, OFF, and DISABLED (keep the event scheduler completely deactivated, it cannot be activated run-time)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON,DISABLED,ORIGINAL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME EXPENSIVE_SUBQUERY_LIMIT
+SESSION_VALUE 100
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum number of rows a subquery may examine in order to be executed during optimization and used for constant optimization
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME EXPIRE_LOGS_DAYS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 99
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME EXPLICIT_DEFAULTS_FOR_TIMESTAMP
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT This option causes CREATE TABLE to create all TIMESTAMP columns as NULL with DEFAULT NULL attribute, Without this option, TIMESTAMP columns are NOT NULL and have implicit DEFAULT clauses. The old behavior is deprecated.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME EXTERNAL_USER
+SESSION_VALUE
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The external user account used when logging in
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME EXTRA_MAX_CONNECTIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of connections on extra-port
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME EXTRA_PORT
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Extra port number to use for tcp connections in a one-thread-per-connection manner. 0 means don't use another port
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FLUSH
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Flush MyISAM tables to disk between SQL commands
+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 FLUSH_TIME
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FOREIGN_KEY_CHECKS
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (the default) foreign key constraints (including ON UPDATE and ON DELETE behavior) InnoDB tables are checked, while if set to 0, they are not checked. 0 is not recommended for normal use, though it can be useful in situations where you know the data is consistent, but want to reload data in a different order from that that specified by parent/child relationships. Setting this variable to 1 does not retrospectively check for inconsistencies introduced while set to 0.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME FT_BOOLEAN_SYNTAX
+SESSION_VALUE NULL
+GLOBAL_VALUE + -><()~*:""&|
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE + -><()~*:""&|
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_MAX_WORD_LEN
+SESSION_VALUE NULL
+GLOBAL_VALUE 84
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 84
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+NUMERIC_MIN_VALUE 10
+NUMERIC_MAX_VALUE 84
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_MIN_WORD_LEN
+SESSION_VALUE NULL
+GLOBAL_VALUE 4
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 84
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of best matches to use for query expansion
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME FT_STOPWORD_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE (built-in)
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Use stopwords from this file instead of built-in list
+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 GENERAL_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log connections and queries to a table or log file. Defaults logging to a file 'hostname'.log or a table mysql.general_logif --log-output=TABLE is used.
+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 GENERAL_LOG_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Log connections and queries to given file
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME GROUP_CONCAT_MAX_LEN
+SESSION_VALUE 1024
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT()
+NUMERIC_MIN_VALUE 4
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME GTID_BINLOG_POS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Last GTID logged to the binary log, per replicationdomain
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME GTID_BINLOG_STATE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The internal GTID state of the binlog, used to keep track of all GTIDs ever logged to the binlog.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME GTID_CURRENT_POS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Current GTID position of the server. Per replication domain, this is either the last GTID replicated by a slave thread, or the GTID logged to the binary log, whichever is most recent.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME GTID_DOMAIN_ID
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Used with global transaction ID to identify logically independent replication streams. When events can propagate through multiple parallel paths (for example multiple masters), each independent source server must use a distinct domain_id. For simple tree-shaped replication topologies, it can be left at its default, 0.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME GTID_IGNORE_DUPLICATES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT When set, different master connections in multi-source replication are allowed to receive and process event groups with the same GTID (when using GTID mode). Only one will be applied, any others will be ignored. Within a given replication domain, just the sequence number will be used to decide whether a given GTID has been already applied; this means it is the responsibility of the user to ensure that GTID sequence numbers are strictly increasing.
+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 GTID_SEQ_NO
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Internal server usage, for replication with global transaction id. When set, next event group logged to the binary log will use this sequence number, not generate a new one, thus allowing to preserve master's GTID in slave's binlog.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME GTID_SLAVE_POS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The list of global transaction IDs that were last replicated on the server, one for each replication domain.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME GTID_STRICT_MODE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enforce strict seq_no ordering of events in the binary log. Slave stops with an error if it encounters an event that would cause it to generate an out-of-order binlog if executed.
+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 HAVE_COMPRESS
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the zlib compression library is accessible to the server, this will be set to YES, otherwise it will be NO. The COMPRESS() and UNCOMPRESS() functions will only be available if set to YES.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_CRYPT
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the crypt() system call is available this variable will be set to YES, otherwise it will be set to NO. If set to NO, the ENCRYPT() function cannot be used.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_DYNAMIC_LOADING
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports dynamic loading of plugins, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_GEOMETRY
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports spatial data types, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_PROFILING
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If statement profiling is available, will be set to YES, otherwise will be set to NO. See SHOW PROFILES and SHOW PROFILE.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_QUERY_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports the query cache, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_RTREE_KEYS
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If RTREE indexes (used for spatial indexes) are available, will be set to YES, otherwise will be set to NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_SSL
+SESSION_VALUE NULL
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If the server supports secure connections, will be set to YES, otherwise will be set to NO. If set to DISABLED, the server was compiled with TLS support, but was not started with TLS support (see the mysqld options). See also have_openssl.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HISTOGRAM_SIZE
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 255
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME HISTOGRAM_TYPE
+SESSION_VALUE SINGLE_PREC_HB
+GLOBAL_VALUE SINGLE_PREC_HB
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE SINGLE_PREC_HB
+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.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST SINGLE_PREC_HB,DOUBLE_PREC_HB
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME HOST_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 279
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 128
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT How many host names should be cached to avoid resolving.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 65536
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME IDENTITY
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Synonym for the last_insert_id variable
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME IGNORE_BUILTIN_INNODB
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Disable initialization of builtin InnoDB plugin
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME IGNORE_DB_DIRS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Specifies a directory to add to the ignore list when collecting database names from the datadir. Put a blank argument to reset the list accumulated so far.
+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 INIT_CONNECT
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Command(s) that are executed for each new connection (unless the user has SUPER privilege)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INIT_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Read SQL commands from this file at startup
+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 INIT_SLAVE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Command(s) that are executed by a slave server each time the SQL thread starts
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INSERT_ID
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The value to be used by the following INSERT or ALTER TABLE statement when inserting an AUTO_INCREMENT value
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME INTERACTIVE_TIMEOUT
+SESSION_VALUE 28800
+GLOBAL_VALUE 28800
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 28800
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME IN_TRANSACTION
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Whether there is an active transaction
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME JOIN_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 262144
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffer that is used for joins
+NUMERIC_MIN_VALUE 128
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 128
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME JOIN_BUFFER_SPACE_LIMIT
+SESSION_VALUE 2097152
+GLOBAL_VALUE 2097152
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2097152
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The limit of the space for all join buffers used by a query
+NUMERIC_MIN_VALUE 2048
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 2048
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME JOIN_CACHE_LEVEL
+SESSION_VALUE 2
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 8
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEEP_FILES_ON_CREATE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't overwrite stale .MYD and .MYI even if no directory is specified
+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 KEY_BUFFER_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 134217728
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_AGE_THRESHOLD
+SESSION_VALUE NULL
+GLOBAL_VALUE 300
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 300
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache
+NUMERIC_MIN_VALUE 100
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 100
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_BLOCK_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The default size of key cache blocks
+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 KEY_CACHE_DIVISION_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_FILE_HASH_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 512
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 512
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of MyISAM files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open MyISAM files.
+NUMERIC_MIN_VALUE 128
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME KEY_CACHE_SEGMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of segments in a key cache
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 64
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LARGE_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable support for large pages
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LARGE_PAGE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT If large page support is enabled, this shows the size of memory pages
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LAST_GTID
+SESSION_VALUE
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The GTID of the last commit (if binlogging was enabled), or the empty string if none.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LAST_INSERT_ID
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The value to be returned from LAST_INSERT_ID()
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LC_MESSAGES
+SESSION_VALUE en_US
+GLOBAL_VALUE en_US
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE en_US
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Set the language used for the error messages
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LC_MESSAGES_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory where error messages are
+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 LC_TIME_NAMES
+SESSION_VALUE en_US
+GLOBAL_VALUE en_US
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE en_US
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Set the language used for the month names and the days of the week
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LICENSE
+SESSION_VALUE NULL
+GLOBAL_VALUE GPL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The type of license the server has
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOCAL_INFILE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable LOAD DATA LOCAL INFILE
+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 LOCKED_IN_MEMORY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether mysqld was locked in memory with --memlock
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOCK_WAIT_TIMEOUT
+SESSION_VALUE 31536000
+GLOBAL_VALUE 31536000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 31536000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_BIN
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether the binary log is enabled
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOG_BIN_BASENAME
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The full path of the binary log file names, excluding the extension.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOG_BIN_INDEX
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT File that holds the names for last binary log files.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOG_BIN_TRUST_FUNCTION_CREATORS
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to FALSE (the default), then when --log-bin is used, creation of a stored function (or trigger) is allowed only to users having the SUPER privilege and only if this stored function (trigger) may not break binary logging. Note that if ALL connections to this server ALWAYS use row-based binary logging, the security issues do not exist and the binary logging cannot break, so you can safely set this to TRUE
+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 LOG_ERROR
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Log errors to file (instead of stdout). If file name is not specified then 'datadir'/'log-basename'.err or the 'pid-file' path with extension .err is used
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LOG_OUTPUT
+SESSION_VALUE NULL
+GLOBAL_VALUE FILE
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE FILE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE SET
+VARIABLE_COMMENT How logs should be written
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NONE,FILE,TABLE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_QUERIES_NOT_USING_INDEXES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log queries that are executed without benefit of any index to the slow log if it is open
+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 LOG_SLAVE_UPDATES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.
+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 LOG_SLOW_FILTER
+SESSION_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+GLOBAL_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Log only certain types of queries
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_SLOW_RATE_LIMIT
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_SLOW_SLAVE_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open.
+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 LOG_SLOW_VERBOSITY
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Verbosity level for the slow log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST innodb,query_plan,explain
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_WARNINGS
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LONG_QUERY_TIME
+SESSION_VALUE 10.000000
+GLOBAL_VALUE 10.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10.000000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Log all queries that have taken more than long_query_time seconds to execute to file. The argument will be treated as a decimal value with microsecond precision
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOW_PRIORITY_UPDATES
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT INSERT/DELETE/UPDATE has lower priority than selects
+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 MASTER_VERIFY_CHECKSUM
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Force checksum verification of logged events in the binary log before sending them to slaves or printing them in the output of SHOW BINLOG EVENTS
+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 MAX_ALLOWED_PACKET
+SESSION_VALUE 4194304
+GLOBAL_VALUE 4194304
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4194304
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max packet length to send to or receive from the server
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 18446744073709547520
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709547520
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the total size of the transactional cache
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1073741824
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1073741824
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 18446744073709547520
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709547520
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the total size of the statement cache
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_CONNECTIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE 151
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 151
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of simultaneous clients allowed
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_CONNECT_ERRORS
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_DELAYED_THREADS
+SESSION_VALUE 20
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_DIGEST_LENGTH
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Maximum length considered for digest text.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_ERROR_COUNT
+SESSION_VALUE 64
+GLOBAL_VALUE 64
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 64
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max number of errors/warnings to store for a statement
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 65535
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_HEAP_TABLE_SIZE
+SESSION_VALUE 1048576
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 16777216
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
+NUMERIC_MIN_VALUE 16384
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_INSERT_DELAYED_THREADS
+SESSION_VALUE 20
+GLOBAL_VALUE 20
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME MAX_JOIN_SIZE
+SESSION_VALUE 18446744073709551615
+GLOBAL_VALUE 18446744073709551615
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709551615
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Joins that are probably going to read more than max_join_size records return an error
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA
+SESSION_VALUE 1024
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max number of bytes in sorted records
+NUMERIC_MIN_VALUE 4
+NUMERIC_MAX_VALUE 8388608
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_LONG_DATA_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 4194304
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_PREPARED_STMT_COUNT
+SESSION_VALUE NULL
+GLOBAL_VALUE 16382
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16382
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of prepared statements in the server
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_RELAY_LOG_SIZE
+SESSION_VALUE 1073741824
+GLOBAL_VALUE 1073741824
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 1073741824
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT relay log will be rotated automatically when the size exceeds this value. If 0 at startup, it's set to max_binlog_size
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SEEKS_FOR_KEY
+SESSION_VALUE 4294967295
+GLOBAL_VALUE 4294967295
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4294967295
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SESSION_MEM_USED
+SESSION_VALUE 9223372036854775807
+GLOBAL_VALUE 9223372036854775807
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 9223372036854775807
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Amount of memory a single user session is allowed to allocate. This limits the value of the session variable MEM_USED
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SORT_LENGTH
+SESSION_VALUE 1024
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
+NUMERIC_MIN_VALUE 4
+NUMERIC_MAX_VALUE 8388608
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_SP_RECURSION_DEPTH
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum stored procedure recursion depth
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 255
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME MAX_STATEMENT_TIME
+SESSION_VALUE 0.000000
+GLOBAL_VALUE 0.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.000000
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT A query that has taken more than max_statement_time seconds will be aborted. The argument will be treated as a decimal value with microsecond precision. A value of 0 (default) means no timeout
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_TMP_TABLES
+SESSION_VALUE 32
+GLOBAL_VALUE 32
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused, will be removed.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_USER_CONNECTIONS
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT
+VARIABLE_COMMENT The maximum number of active connections for a single user (0 = no limit)
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_WRITE_LOCK_COUNT
+SESSION_VALUE NULL
+GLOBAL_VALUE 4294967295
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4294967295
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MRR_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 262144
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Size of buffer to use when using MRR with range access
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MULTI_RANGE_COUNT
+SESSION_VALUE 256
+GLOBAL_VALUE 256
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 256
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Ignored. Use mrr_buffer_size instead
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_BLOCK_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Block size to be used for MyISAM index pages
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_DATA_POINTER_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 6
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 6
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
+NUMERIC_MIN_VALUE 2
+NUMERIC_MAX_VALUE 7
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 9223372036853727232
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 9223372036853727232
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1048576
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_MMAP_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 18446744073709551615
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709551615
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
+NUMERIC_MIN_VALUE 7
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_RECOVER_OPTIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE DEFAULT
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE DEFAULT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Specifies how corrupted tables should be automatically repaired
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT,BACKUP,FORCE,QUICK,BACKUP_ALL,OFF
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME MYISAM_REPAIR_THREADS
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If larger than 1, when repairing a MyISAM table all indexes will be created in parallel, with one thread per index. The value of 1 disables parallel repair
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_SORT_BUFFER_SIZE
+SESSION_VALUE 134216704
+GLOBAL_VALUE 134216704
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 134216704
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_STATS_METHOD
+SESSION_VALUE NULLS_UNEQUAL
+GLOBAL_VALUE NULLS_UNEQUAL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULLS_UNEQUAL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how MyISAM index statistics collection code should treat NULLs. Possible values of name are NULLS_UNEQUAL (default behavior for 4.1 and later), NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULLS_UNEQUAL,NULLS_EQUAL,NULLS_IGNORED
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MYISAM_USE_MMAP
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use memory mapping for reading and writing MyISAM tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
+VARIABLE_NAME MYSQL56_TEMPORAL_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME, DATETIME, TIMESTAMP columns.
+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 NET_BUFFER_LENGTH
+SESSION_VALUE 16384
+GLOBAL_VALUE 16384
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16384
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME NET_READ_TIMEOUT
+SESSION_VALUE 30
+GLOBAL_VALUE 30
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME NET_RETRY_COUNT
+SESSION_VALUE 10
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME NET_WRITE_TIMEOUT
+SESSION_VALUE 60
+GLOBAL_VALUE 60
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 60
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OLD
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use compatible behavior from previous MariaDB version. See also --old-mode
+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 OLD_ALTER_TABLE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use old, non-optimized alter table
+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 OLD_MODE
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Used to emulate old behavior from earlier MariaDB or MySQL versions
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO,ZERO_DATE_TIME_CAST
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OLD_PASSWORDS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use old password encryption method (needed for 4.0 and older clients)
+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 OPTIMIZER_PRUNE_LEVEL
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
+SESSION_VALUE 62
+GLOBAL_VALUE 62
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 62
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 63
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT
+SESSION_VALUE 100
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls number of record samples to check condition selectivity
+NUMERIC_MIN_VALUE 10
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SWITCH
+SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
+GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE FLAGSET
+VARIABLE_COMMENT Fine-tune the optimizer behavior
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,default
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 5
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable the performance schema.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 200
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 200
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 80
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 80
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of condition instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH
+SESSION_VALUE NULL
+GLOBAL_VALUE 1024
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1024
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 50
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of file instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
+SESSION_VALUE NULL
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of opened instrumented files.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 200
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 200
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of mutex instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 5000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 104857600
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 40
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 40
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of rwlock instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 5000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 104857600
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of socket instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 150
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 150
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of stage instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 178
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 178
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of statement instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 500
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
+SESSION_VALUE NULL
+GLOBAL_VALUE 50
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 50
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of thread instruments.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 256
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
+SESSION_VALUE NULL
+GLOBAL_VALUE 200
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2048
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1024
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 100
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE -1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
+NUMERIC_MIN_VALUE -1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PID_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Pid file used by safe_mysqld
+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 PLUGIN_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory for plugins
+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 PLUGIN_MATURITY
+SESSION_VALUE NULL
+GLOBAL_VALUE unknown
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE unknown
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The lowest desirable plugin maturity. Plugins less mature than that will not be installed or loaded
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST unknown,experimental,alpha,beta,gamma,stable
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PORT
+SESSION_VALUE NULL
+GLOBAL_VALUE MASTER_MYPORT
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Port number to use for connection or 0 to default to, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306), whatever comes first
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PRELOAD_BUFFER_SIZE
+SESSION_VALUE 32768
+GLOBAL_VALUE 32768
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 32768
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PROFILING
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (0 is default), statement profiling will be enabled. See SHOW PROFILES and SHOW PROFILE.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PROFILING_HISTORY_SIZE
+SESSION_VALUE 15
+GLOBAL_VALUE 15
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 15
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PROGRESS_REPORT_TIME
+SESSION_VALUE 5
+GLOBAL_VALUE 5
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 5
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME PROTOCOL_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The version of the client/server protocol used by the MariaDB server
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PROXY_USER
+SESSION_VALUE
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The proxy user account name used when logging in
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PSEUDO_SLAVE_MODE
+SESSION_VALUE OFF
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT SET pseudo_slave_mode= 0,1 are commands that mysqlbinlog adds to beginning and end of binary log dumps. While zero value indeed disables, the actual enabling of the slave applier execution mode is done implicitly when a Format_description_event is sent through the session.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PSEUDO_THREAD_ID
+SESSION_VALUE 10
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT This variable is for internal server use
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE
+SESSION_VALUE 16384
+GLOBAL_VALUE 16384
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16384
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Allocation block size for query parsing and execution
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Don't cache results that are bigger than this
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 4096
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4096
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 8
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1048576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1048576
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The memory allocated to store results from old queries
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_STRIP_COMMENTS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Strip all comments from a query before storing it in the query cache
+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 QUERY_CACHE_TYPE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT OFF = Don't cache or retrieve results. ON = Cache all results except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only SELECT SQL_CACHE ... queries
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON,DEMAND
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME QUERY_CACHE_WLOCK_INVALIDATE
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Invalidate queries in query cache on LOCK for write
+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 QUERY_PREALLOC_SIZE
+SESSION_VALUE 24576
+GLOBAL_VALUE 24576
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 24576
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Persistent buffer for query parsing and execution
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RANGE_ALLOC_BLOCK_SIZE
+SESSION_VALUE 4096
+GLOBAL_VALUE 4096
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4096
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Allocation block size for storing ranges during optimization
+NUMERIC_MIN_VALUE 4096
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME READ_BUFFER_SIZE
+SESSION_VALUE 131072
+GLOBAL_VALUE 131072
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 131072
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME READ_ONLY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege
+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 READ_RND_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 262144
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RELAY_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE mysqld-relay-bin
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The location and name to use for relay logs.
+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 RELAY_LOG_BASENAME
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The full path of the relay log file names, excluding the extension.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME RELAY_LOG_INDEX
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The location and name to use for the file that keeps a list of the last relay logs.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME RELAY_LOG_INFO_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE relay-log.info
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The location and name of the file that remembers where the SQL replication thread is in the relay logs.
+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 RELAY_LOG_PURGE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT if disabled - do not purge relay logs. if enabled - purge them as soon as they are no more needed.
+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 RELAY_LOG_RECOVERY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enables automatic relay log recovery right after the database startup, which means that the IO Thread starts re-fetching from the master right after the last transaction processed.
+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 RELAY_LOG_SPACE_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum space to use for all relay logs
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME REPLICATE_ANNOTATE_ROW_EVENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Tells the slave to write annotate rows events received from the master to its own binary log. Ignored if log_slave_updates is not set
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME REPLICATE_DO_DB
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tell the slave to restrict replication to updates of tables whose names appear in the comma-separated list. For statement-based replication, only the default database (that is, the one selected by USE) is considered, not any explicitly mentioned tables in the query. For row-based replication, the actual names of table(s) being updated are checked.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME REPLICATE_DO_TABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the slave to restrict replication to tables in the comma-separated list.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME REPLICATE_EVENTS_MARKED_FOR_SKIP
+SESSION_VALUE NULL
+GLOBAL_VALUE REPLICATE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE REPLICATE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Whether the slave should replicate events that were created with @@skip_replication=1 on the master. Default REPLICATE (no events are skipped). Other values are FILTER_ON_SLAVE (events will be sent by the master but ignored by the slave) and FILTER_ON_MASTER (events marked with @@skip_replication=1 will be filtered on the master and never be sent to the slave).
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST REPLICATE,FILTER_ON_SLAVE,FILTER_ON_MASTER
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME REPLICATE_IGNORE_DB
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tell the slave to restrict replication to updates of tables whose names do not appear in the comma-separated list. For statement-based replication, only the default database (that is, the one selected by USE) is considered, not any explicitly mentioned tables in the query. For row-based replication, the actual names of table(s) being updated are checked.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME REPLICATE_IGNORE_TABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the slave thread not to replicate any statement that updates the specified table, even if any other tables might be updated by the same statement.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME REPLICATE_WILD_DO_TABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the slave thread to restrict replication to statements where any of the updated tables match the specified database and table name patterns.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME REPLICATE_WILD_IGNORE_TABLE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the slave thread to not replicate to the tables that match the given wildcard pattern.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME REPORT_HOST
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Hostname or IP of the slave to be reported to the master during slave registration. Will appear in the output of SHOW SLAVE HOSTS. Leave unset if you do not want the slave to register itself with the master. Note that it is not sufficient for the master to simply read the IP of the slave off the socket once the slave connects. Due to NAT and other routing issues, that IP may not be valid for connecting to the slave from the master or other hosts
+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 REPORT_PASSWORD
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The account password of the slave to be reported to the master during slave registration
+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 REPORT_PORT
+SESSION_VALUE NULL
+GLOBAL_VALUE MASTER_MYPORT
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Port for connecting to slave reported to the master during slave registration. Set it only if the slave is listening on a non-default port or if you have a special tunnel from the master or other clients to the slave. If not sure, leave this option unset
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME REPORT_USER
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The account user name of the slave to be reported to the master during slave registration
+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 ROWID_MERGE_BUFF_SIZE
+SESSION_VALUE 8388608
+GLOBAL_VALUE 8388608
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8388608
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of the buffers used [NOT] IN evaluation via partial matching
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SECURE_AUTH
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Disallow authentication for accounts that have old (pre-4.1) passwords
+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 SECURE_FILE_PRIV
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory
+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 SERVER_ID
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SKIP_EXTERNAL_LOCKING
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't use system (external) locking
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SKIP_NAME_RESOLVE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't resolve hostnames. All hostnames are IP's or 'localhost'.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SKIP_NETWORKING
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't allow connection with TCP/IP
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SKIP_PARALLEL_REPLICATION
+SESSION_VALUE OFF
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set when a transaction is written to the binlog, parallel apply of that transaction will be avoided on a slave where slave_parallel_mode is not "aggressive". Can be used to avoid unnecessary rollback and retry for transactions that are likely to cause a conflict if replicated in parallel.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SKIP_REPLICATION
+SESSION_VALUE OFF
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Changes are logged into the binary log with the @@skip_replication flag set. Such events will not be replicated by slaves that run with --replicate-events-marked-for-skip set different from its default of REPLICATE. See Selectively skipping replication of binlog events for more information.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SKIP_SHOW_DATABASE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Don't allow 'SHOW DATABASE' commands
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SLAVE_COMPRESSED_PROTOCOL
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Use compression on master/slave protocol
+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 SLAVE_DDL_EXEC_MODE
+SESSION_VALUE NULL
+GLOBAL_VALUE IDEMPOTENT
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE IDEMPOTENT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT How replication events should be executed. Legal values are STRICT and IDEMPOTENT (default). In IDEMPOTENT mode, replication will not stop for DDL operations that are idempotent. This means that CREATE TABLE is treated as CREATE TABLE OR REPLACE and DROP TABLE is treated as DROP TABLE IF EXISTS.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST STRICT,IDEMPOTENT
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_DOMAIN_PARALLEL_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16383
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_EXEC_MODE
+SESSION_VALUE NULL
+GLOBAL_VALUE STRICT
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE STRICT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT How replication events should be executed. Legal values are STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will not stop for operations that are idempotent. For example, in row based replication attempts to delete rows that doesn't exist will be ignored. In STRICT mode, replication will stop on any unexpected difference between the master and the slave.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST STRICT,IDEMPOTENT
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_LOAD_TMPDIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The location where the slave should put its temporary files when replicating a LOAD DATA INFILE command
+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 SLAVE_MAX_ALLOWED_PACKET
+SESSION_VALUE NULL
+GLOBAL_VALUE 1073741824
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1073741824
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_NET_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 120
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 3600
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Number of seconds to wait for more data from any master/slave connection before aborting the read
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_PARALLEL_MAX_QUEUED
+SESSION_VALUE NULL
+GLOBAL_VALUE 131072
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 131072
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_PARALLEL_MODE
+SESSION_VALUE NULL
+GLOBAL_VALUE conservative
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE conservative
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Controls what transactions are applied in parallel when using --slave-parallel-threads. Possible values: "optimistic" tries to apply most transactional DML in parallel, and handles any conflicts with rollback and retry. "conservative" limits parallelism in an effort to avoid any conflicts. "aggressive" tries to maximise the parallelism, possibly at the cost of increased conflict rate. "minimal" only parallelizes the commit steps of transactions. "none" disables parallel apply completely.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST none,minimal,conservative,optimistic,aggressive
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SLAVE_PARALLEL_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16383
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_RUN_TRIGGERS_FOR_RBR
+SESSION_VALUE NULL
+GLOBAL_VALUE NO
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Modes for how triggers in row-base replication on slave side will be executed. Legal values are NO (default), YES and LOGGING. NO means that trigger for RBR will not be running on slave. YES and LOGGING means that triggers will be running on slave, if there was not triggers running on the master for the statement. LOGGING also means results of that the executed triggers work will be written to the binlog.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO,YES,LOGGING
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_SKIP_ERRORS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the slave thread to continue replication when a query event returns an error from the provided list
+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 SLAVE_SQL_VERIFY_CHECKSUM
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Force checksum verification of replication events after reading them from relay log. Note: Events are always checksum-verified by slave on receiving them from the network before writing them to the relay log
+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 SLAVE_TRANSACTION_RETRIES
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLAVE_TYPE_CONVERSIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Set of slave type conversions that are enabled. If the variable is empty, no conversions are allowed and it is expected that the types match exactly
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST ALL_LOSSY,ALL_NON_LOSSY
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLOW_LAUNCH_TIME
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SLOW_QUERY_LOG
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow queries to a table or log file. Defaults logging to a file 'hostname'-slow.log or a table mysql.slow_log if --log-output=TABLE is used. Must be enabled to activate other slow log options.
+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 SLOW_QUERY_LOG_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Log slow queries to given log file. Defaults logging to 'hostname'-slow.log. Must be enabled to activate other slow log options
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SOCKET
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Socket file to use for connection
+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 SORT_BUFFER_SIZE
+SESSION_VALUE 262144
+GLOBAL_VALUE 262144
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 2097152
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SQL_AUTO_IS_NULL
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the query SELECT * FROM table_name WHERE auto_increment_column IS NULL will return an auto-increment that has just been successfully inserted, the same as the LAST_INSERT_ID() function. Some ODBC programs make use of this IS NULL comparison.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_BIG_SELECTS
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 0, MariaDB will not perform large SELECTs. See max_join_size for details. If max_join_size is set to anything but DEFAULT, sql_big_selects is automatically set to 0. If sql_big_selects is again set, max_join_size will be ignored.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_BUFFER_RESULT
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (0 is default), results from SELECT statements are always placed into temporary tables. This can help the server when it takes a long time to send the results to the client by allowing the table locks to be freed early.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_LOG_BIN
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 0 (1 is the default), no logging to the binary log is done for the client. Only clients with the SUPER privilege can update this variable. Can have unintended consequences if set globally, see SET SQL_LOG_BIN. Starting MariaDB 10.1.7, this variable does not affect the replication of events in a Galera cluster.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_LOG_OFF
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1 (0 is the default), no logging to the general query log is done for the client. Only clients with the SUPER privilege can update this variable.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_MODE
+SESSION_VALUE ANSI_QUOTES
+GLOBAL_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Sets the sql mode
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,IGNORE_BAD_TABLE_OPTIONS,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SQL_NOTES
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, warning_count is incremented each time a Note warning is encountered. If set to 0, Note warnings are not recorded. mysqldump has outputs to set this variable to 0 so that no unnecessary increments occur when data is reloaded.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_QUOTE_SHOW_CREATE
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, the server will quote identifiers for SHOW CREATE DATABASE, SHOW CREATE TABLE and SHOW CREATE VIEW statements. Quoting is disabled if set to 0. Enable to ensure replications works when identifiers require quoting.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_SAFE_UPDATES
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, UPDATEs and DELETEs need either a key in the WHERE clause, or a LIMIT clause, or else they will aborted. Prevents the common mistake of accidentally deleting or updating every row in a table.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_SELECT_LIMIT
+SESSION_VALUE 18446744073709551615
+GLOBAL_VALUE 18446744073709551615
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 18446744073709551615
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum number of rows to return from SELECT statements
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_SLAVE_SKIP_COUNTER
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Skip the next N events from the master log
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SQL_WARNINGS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, single-row INSERTs will produce a string containing warning information if a warning occurs.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SSL_CA
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CA file in PEM format (check OpenSSL docs, implies --ssl)
+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 SSL_CAPATH
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CA directory (check OpenSSL docs, implies --ssl)
+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 SSL_CERT
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT X509 cert in PEM format (implies --ssl)
+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 SSL_CIPHER
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT SSL cipher to use (implies --ssl)
+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 SSL_CRL
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CRL file in PEM format (check OpenSSL docs, implies --ssl)
+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 SSL_CRLPATH
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT CRL directory (check OpenSSL docs, implies --ssl)
+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 SSL_KEY
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT X509 key in PEM format (implies --ssl)
+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 STORAGE_ENGINE
+SESSION_VALUE MyISAM
+GLOBAL_VALUE MyISAM
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE MyISAM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Alias for @@default_storage_engine. Deprecated
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME STORED_PROGRAM_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE 256
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 256
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 524288
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME STRICT_PASSWORD_VALIDATION
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT When password validation plugins are enabled, reject passwords that cannot be validated (passwords specified as a hash)
+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 SYNC_BINLOG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Synchronously flush binary log to disk after every #th event. Use 0 (default) to disable synchronous flushing
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SYNC_FRM
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Sync .frm files to disk on creation
+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 SYNC_MASTER_INFO
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Synchronously flush master info to disk after every #th event. Use 0 to disable synchronous flushing
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SYNC_RELAY_LOG
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Synchronously flush relay log to disk after every #th event. Use 0 to disable synchronous flushing
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SYNC_RELAY_LOG_INFO
+SESSION_VALUE NULL
+GLOBAL_VALUE 10000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Synchronously flush relay log info to disk after every #th transaction. Use 0 to disable synchronous flushing
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TABLE_DEFINITION_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE 400
+GLOBAL_VALUE_ORIGIN AUTO
+DEFAULT_VALUE 400
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of cached table definitions
+NUMERIC_MIN_VALUE 400
+NUMERIC_MAX_VALUE 524288
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TABLE_OPEN_CACHE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of cached open tables
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_CACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT How many threads we should keep in a cache for reuse
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 16384
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_CONCURRENCY
+SESSION_VALUE NULL
+GLOBAL_VALUE 10
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 512
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_HANDLING
+SESSION_VALUE NULL
+GLOBAL_VALUE one-thread-per-connection
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE one-thread-per-connection
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Define threads usage for handling queries
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST one-thread-per-connection,no-threads,pool-of-threads
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_POOL_IDLE_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 60
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 60
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Timeout in seconds for an idle thread in the thread pool.Worker thread will be shut down after timeout
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_POOL_MAX_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Maximum allowed number of worker threads in the thread pool
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 65536
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_POOL_OVERSUBSCRIBE
+SESSION_VALUE NULL
+GLOBAL_VALUE 3
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 3
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT How many additional active worker threads in a group are allowed.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_POOL_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 4
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE 8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Number of thread groups in the pool. This parameter is roughly equivalent to maximum number of concurrently executing threads (threads in a waiting state do not count as executing).
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 100000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_POOL_STALL_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 500
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 500
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Maximum query execution time in milliseconds,before an executing non-yielding thread is considered stalled.If a worker thread is stalled, additional worker thread may be created to handle remaining clients.
+NUMERIC_MIN_VALUE 10
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME THREAD_STACK
+SESSION_VALUE NULL
+GLOBAL_VALUE 295936
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 295936
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The stack size for each thread
+NUMERIC_MIN_VALUE 131072
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TIMED_MUTEXES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Specify whether to time mutexes. Deprecated, has no effect.
+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 TIMESTAMP
+SESSION_VALUE 1409578823.000000
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.000000
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Set the time for this client
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME TIME_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE %H:%i:%s
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE %H:%i:%s
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The TIME format (ignored)
+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 TIME_ZONE
+SESSION_VALUE +00:00
+GLOBAL_VALUE SYSTEM
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE SYSTEM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The current time zone, used to initialize the time zone for a client when it connects. Set to SYSTEM by default, in which the client uses the system time zone value.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME TMPDIR
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path for temporary files. Several paths may be specified, separated by a colon (:), in this case they are used in a round-robin fashion
+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 TMP_TABLE_SIZE
+SESSION_VALUE 16777216
+GLOBAL_VALUE 16777216
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16777216
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_ALLOC_BLOCK_SIZE
+SESSION_VALUE 8192
+GLOBAL_VALUE 8192
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 8192
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 134217728
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
+SESSION_VALUE 4096
+GLOBAL_VALUE 4096
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4096
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 134217728
+NUMERIC_BLOCK_SIZE 1024
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TX_ISOLATION
+SESSION_VALUE REPEATABLE-READ
+GLOBAL_VALUE REPEATABLE-READ
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE REPEATABLE-READ
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Default transaction isolation level
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ,SERIALIZABLE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME TX_READ_ONLY
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME UNIQUE_CHECKS
+SESSION_VALUE ON
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT If set to 1, the default, secondary indexes in InnoDB tables are performed. If set to 0, storage engines can (but are not required to) assume that duplicate keys are not present in input data. Set to 0 to speed up imports of large tables to InnoDB. The storage engine will still issue a duplicate key error if it detects one, even if set to 0.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME UPDATABLE_VIEWS_WITH_LIMIT
+SESSION_VALUE YES
+GLOBAL_VALUE YES
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE YES
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO,YES
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME USERSTAT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enables statistics gathering for USER_STATISTICS, CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS tables in the INFORMATION_SCHEMA
+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 USE_STAT_TABLES
+SESSION_VALUE NEVER
+GLOBAL_VALUE NEVER
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NEVER
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specifies how to use system statistics tables
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NEVER,COMPLEMENTARY,PREFERABLY
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WAIT_TIMEOUT
+SESSION_VALUE 28800
+GLOBAL_VALUE 28800
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 28800
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 31536000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WARNING_COUNT
+SESSION_VALUE 0
+GLOBAL_VALUE NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The number of errors, warnings, and notes that resulted from the last statement that generated messages
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+select VARIABLE_NAME, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT,
+NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE,
+ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT
+from information_schema.system_variables
+where variable_name in (
+'have_openssl',
+'have_symlink',
+'hostname',
+'large_files_support',
+'lower_case_file_system',
+'lower_case_table_names',
+'open_files_limit',
+'rand_seed1',
+'rand_seed2',
+'system_time_zone',
+'version_comment',
+'version_compile_machine', 'version_compile_os',
+'version_malloc_library', 'version_ssl_library', 'version'
+ )
+order by variable_name;
+VARIABLE_NAME HAVE_OPENSSL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Comparing have_openssl with have_ssl will indicate whether YaSSL or openssl was used. If YaSSL, have_ssl will be YES, but have_openssl will be NO.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HAVE_SYMLINK
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT If symbolic link support is enabled, will be set to YES, otherwise will be set to NO. Required for the INDEX DIRECTORY and DATA DIRECTORY table options (see CREATE TABLE) and Windows symlink support. Will be set to DISABLED if the server is started with the --skip-symbolic-links option.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME HOSTNAME
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Server host name
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LARGE_FILES_SUPPORT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether mysqld was compiled with options for large file support
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOWER_CASE_FILE_SYSTEM
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Case sensitivity of file names on the file system where the data directory is located
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOWER_CASE_TABLE_NAMES
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive. Should be set to 2 if you are using a case insensitive file system
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME OPEN_FILES_LIMIT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RAND_SEED1
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME RAND_SEED2
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SYSTEM_TIME_ZONE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The server system time zone
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Server version number. It may also include a suffix with configuration or build information. -debug indicates debugging support was enabled on the server, and -log indicates at least one of the binary log, general log or slow query log are enabled, for example 10.1.1-MariaDB-mariadb1precise-log.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_COMMENT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Value of the COMPILATION_COMMENT option specified by CMake when building MariaDB, for example mariadb.org binary distribution.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_COMPILE_MACHINE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The machine type or architecture MariaDB was built on, for example i686.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_COMPILE_OS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Operating system that MariaDB was built on, for example debian-linux-gnu.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_MALLOC_LIBRARY
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Version of the used malloc library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_SSL_LIBRARY
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Version of the used SSL library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+select VARIABLE_NAME, GLOBAL_VALUE_ORIGIN, VARIABLE_SCOPE, VARIABLE_TYPE,
+VARIABLE_COMMENT, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT
+from information_schema.system_variables
+where variable_name in (
+'log_tc_size'
+ )
+order by variable_name;
+VARIABLE_NAME LOG_TC_SIZE
+GLOBAL_VALUE_ORIGIN AUTO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Size of transaction coordinator log.
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+set global div_precision_increment=default;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff
new file mode 100644
index 00000000000..b93afb03c6f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff
@@ -0,0 +1,47 @@
+--- suite/sys_vars/r/sysvars_wsrep.result 2014-10-10 13:33:55.000000000 +0300
++++ suite/sys_vars/r/sysvars_wsrep,32bit.reject 2014-10-10 19:38:09.000000000 +0300
+@@ -203,7 +203,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 131072
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max number of rows in write set
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 1048576
+@@ -217,7 +217,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1073741824
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max write set size (bytes)
+ NUMERIC_MIN_VALUE 1024
+ NUMERIC_MAX_VALUE 4294901759
+@@ -231,7 +231,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT mysql replication group commit
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 1000
+@@ -399,7 +399,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Max number of times to retry a failed autocommit statement
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 10000
+@@ -427,7 +427,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 1
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Number of slave appliers to launch
+ NUMERIC_MIN_VALUE 1
+ NUMERIC_MAX_VALUE 512
diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
new file mode 100644
index 00000000000..0c206975c29
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
@@ -0,0 +1,605 @@
+select * from information_schema.system_variables
+where variable_name like 'wsrep%'
+ order by variable_name;
+VARIABLE_NAME WSREP_AUTO_INCREMENT_CONTROL
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT To automatically control the assignment of autoincrement variables
+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 WSREP_CAUSAL_READS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Setting this variable is equivalent to setting wsrep_sync_wait READ flag
+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 WSREP_CERTIFY_NONPK
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Certify tables with no primary key
+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 WSREP_CLUSTER_ADDRESS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Address to initially connect to cluster
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_CLUSTER_NAME
+SESSION_VALUE NULL
+GLOBAL_VALUE my_wsrep_cluster
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE my_wsrep_cluster
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Name for the cluster
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_CONVERT_LOCK_TO_TRX
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT To convert locking sessions into transactions
+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 WSREP_DATA_HOME_DIR
+SESSION_VALUE NULL
+GLOBAL_VALUE DATADIR
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE DATADIR
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT home directory for wsrep provider
+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 WSREP_DBUG_OPTION
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT DBUG options to provider library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT To enable debug level logging
+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 WSREP_DESYNC
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT To desynchronize the node from the cluster
+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 WSREP_DIRTY_READS
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Allow reads even when the node is not in the primary component.
+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 WSREP_DRUPAL_282555_WORKAROUND
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable a workaround to handle the cases where inserting a DEFAULT value into an auto-increment column could fail with duplicate key error
+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 WSREP_FORCED_BINLOG_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE NONE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NONE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT binlog format to take effect over user's choice
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST MIXED,STATEMENT,ROW,NONE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_GTID_DOMAIN_ID
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT When wsrep_gtid_mode is set, this value is used as gtid_domain_id for galera transactions and also copied to the joiner nodes during state transfer. It is ignored, otherwise.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_GTID_MODE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Automatically update the (joiner) node's wsrep_gtid_domain_id value with that of donor's (received during state transfer) and use it in place of gtid_domain_id for all galera transactions. When OFF (default), wsrep_gtid_domain_id is simply ignored (backward compatibility).
+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 WSREP_LOAD_DATA_SPLITTING
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT To commit LOAD DATA transaction after every 10K rows inserted
+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 WSREP_LOG_CONFLICTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT To log multi-master conflicts
+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 WSREP_MAX_WS_ROWS
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max number of rows in write set
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1048576
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_MAX_WS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2147483647
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2147483647
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max write set size (bytes)
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 2147483647
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_MYSQL_REPLICATION_BUNDLE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT mysql replication group commit
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_NODE_ADDRESS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Specifies the node's network address, in the format ip address[:port]. Used in situations where autoguessing is not reliable. As of MariaDB 10.1.8, supports IPv6.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_NODE_INCOMING_ADDRESS
+SESSION_VALUE NULL
+GLOBAL_VALUE AUTO
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE AUTO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Client connection address
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_NODE_NAME
+SESSION_VALUE NULL
+GLOBAL_VALUE HOSTNAME
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE HOSTNAME
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Name of this node. This name can be used in wsrep_sst_donor as a preferred donor. Note that multiple nodes in a cluster can have the same name.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_NOTIFY_CMD
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_ON
+SESSION_VALUE OFF
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT To enable wsrep 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
+VARIABLE_NAME WSREP_OSU_METHOD
+SESSION_VALUE TOI
+GLOBAL_VALUE TOI
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE TOI
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Method for Online Schema Upgrade
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST TOI,RSU
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME WSREP_PATCH_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE wsrep_MAJVER.MINVER
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep patch version, for example wsrep_MAJVER.MINVER.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME WSREP_PROVIDER
+SESSION_VALUE NULL
+GLOBAL_VALUE none
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE none
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to replication provider library
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_PROVIDER_OPTIONS
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Semicolon (;) separated list of wsrep options (see wsrep_provider_options documentation).
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_RECOVER
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Recover database state after crash and exit
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT OPTIONAL
+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
+VARIABLE_NAME WSREP_RESTART_SLAVE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Should MariaDB slave be restarted automatically, when node joins back to cluster
+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 WSREP_RETRY_AUTOCOMMIT
+SESSION_VALUE 1
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max number of times to retry a failed autocommit statement
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 10000
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_SLAVE_FK_CHECKS
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Should slave thread do foreign key constraint checks
+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 WSREP_SLAVE_THREADS
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Number of slave appliers to launch
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 512
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_SLAVE_UK_CHECKS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Should slave thread do secondary index uniqueness checks
+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 WSREP_SST_AUTH
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Authentication for SST connection
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_SST_DONOR
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT preferred donor node for the SST
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_SST_DONOR_REJECTS_QUERIES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Reject client queries when donating state snapshot transfer
+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 WSREP_SST_METHOD
+SESSION_VALUE NULL
+GLOBAL_VALUE rsync
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE rsync
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT State snapshot transfer method
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_SST_RECEIVE_ADDRESS
+SESSION_VALUE NULL
+GLOBAL_VALUE AUTO
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE AUTO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Address where node is waiting for SST contact
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_START_POSITION
+SESSION_VALUE NULL
+GLOBAL_VALUE 00000000-0000-0000-0000-000000000000:-1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 00000000-0000-0000-0000-000000000000:-1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT global transaction position to start from
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME WSREP_SYNC_WAIT
+SESSION_VALUE 0
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Ensure "synchronous" read view before executing an operation of the type specified by bitmask: 1 - READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); 2 - UPDATE and DELETE; 4 - INSERT and REPLACE
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 15
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
index 2381dfe4900..4c635783753 100644
--- a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
@@ -1,18 +1,18 @@
SET @start_value = @@global.table_open_cache ;
SELECT @start_value;
@start_value
-400
+2000
'#--------------------FN_DYNVARS_001_01------------------------#'
SET @@global.table_open_cache = 99;
SET @@global.table_open_cache = DeFAULT;
SELECT @@global.table_open_cache;
@@global.table_open_cache
-400
+2000
'#---------------------FN_DYNVARS_001_02-------------------------#'
SET @@global.table_open_cache = Default;
SELECT @@global.table_open_cache = 400;
@@global.table_open_cache = 400
-1
+0
'#--------------------FN_DYNVARS_001_03------------------------#'
SET @@global.table_open_cache = 8;
SELECT @@global.table_open_cache ;
@@ -27,7 +27,7 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '1073741824'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-524288
+1048576
SET @@global.table_open_cache = 18000;
SELECT @@global.table_open_cache ;
@@global.table_open_cache
@@ -48,7 +48,7 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '100000000000'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-524288
+1048576
SET @@global.table_open_cache = -1024;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1024'
@@ -104,4 +104,4 @@ ERROR 42S22: Unknown column 'table_open_cache' in 'field list'
SET @@global.table_open_cache = @start_value;
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-400
+2000
diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result
deleted file mode 100644
index e735c5ccbc6..00000000000
--- a/mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result
+++ /dev/null
@@ -1,3 +0,0 @@
-select @@table_open_cache_instances;
-@@table_open_cache_instances
-1
diff --git a/mysql-test/suite/sys_vars/r/thread_pool_max_threads_basic.result b/mysql-test/suite/sys_vars/r/thread_pool_max_threads_basic.result
index 4a748ca7629..289c0d56092 100644
--- a/mysql-test/suite/sys_vars/r/thread_pool_max_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/thread_pool_max_threads_basic.result
@@ -1,21 +1,21 @@
SET @start_global_value = @@global.thread_pool_max_threads;
select @@global.thread_pool_max_threads;
@@global.thread_pool_max_threads
-500
+1000
select @@session.thread_pool_max_threads;
ERROR HY000: Variable 'thread_pool_max_threads' is a GLOBAL variable
show global variables like 'thread_pool_max_threads';
Variable_name Value
-thread_pool_max_threads 500
+thread_pool_max_threads 1000
show session variables like 'thread_pool_max_threads';
Variable_name Value
-thread_pool_max_threads 500
+thread_pool_max_threads 1000
select * from information_schema.global_variables where variable_name='thread_pool_max_threads';
VARIABLE_NAME VARIABLE_VALUE
-THREAD_POOL_MAX_THREADS 500
+THREAD_POOL_MAX_THREADS 1000
select * from information_schema.session_variables where variable_name='thread_pool_max_threads';
VARIABLE_NAME VARIABLE_VALUE
-THREAD_POOL_MAX_THREADS 500
+THREAD_POOL_MAX_THREADS 1000
set global thread_pool_max_threads=1;
select @@global.thread_pool_max_threads;
@@global.thread_pool_max_threads
diff --git a/mysql-test/suite/sys_vars/r/thread_stack_basic.result b/mysql-test/suite/sys_vars/r/thread_stack_basic.result
index 4d974f66a00..d5a30bbaf6e 100644
--- a/mysql-test/suite/sys_vars/r/thread_stack_basic.result
+++ b/mysql-test/suite/sys_vars/r/thread_stack_basic.result
@@ -1,20 +1,20 @@
select @@global.thread_stack;
@@global.thread_stack
-294912
+295936
select @@session.thread_stack;
ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
show global variables like 'thread_stack';
Variable_name Value
-thread_stack 294912
+thread_stack 295936
show session variables like 'thread_stack';
Variable_name Value
-thread_stack 294912
+thread_stack 295936
select * from information_schema.global_variables where variable_name='thread_stack';
VARIABLE_NAME VARIABLE_VALUE
-THREAD_STACK 294912
+THREAD_STACK 295936
select * from information_schema.session_variables where variable_name='thread_stack';
VARIABLE_NAME VARIABLE_VALUE
-THREAD_STACK 294912
+THREAD_STACK 295936
set global thread_stack=1;
ERROR HY000: Variable 'thread_stack' is a read only variable
set session thread_stack=1;
diff --git a/mysql-test/suite/sys_vars/r/version_ssl_library_basic.result b/mysql-test/suite/sys_vars/r/version_ssl_library_basic.result
new file mode 100644
index 00000000000..c37bb6f21af
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/version_ssl_library_basic.result
@@ -0,0 +1,2 @@
+set @@global.version_malloc_library=1;
+ERROR HY000: Variable 'version_malloc_library' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
index 6dc99dcd5e3..d0e5188b508 100644
--- a/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
@@ -124,5 +124,17 @@ SELECT session.wait_timeout;
ERROR 42S02: Unknown table 'session' in field list
SELECT wait_timeout = @@session.wait_timeout;
ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
+#
+# MDEV-9516 type error when setting session variable
+#
+SET SESSION wait_timeout= 28000;
+SET SESSION wait_timeout= GREATEST(28000, @@wait_timeout);
+SET SESSION wait_timeout= COALESCE(28000, @@wait_timeout);
+SET SESSION wait_timeout= IFNULL(28000, @@wait_timeout);
+SET SESSION wait_timeout= CASE WHEN TRUE THEN 28000 ELSE @@wait_timeout END;
+SET SESSION wait_timeout= 28000.0;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET SESSION wait_timeout= 28000.1;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
SET @@global.wait_timeout = @start_global_value;
SET @@session.wait_timeout = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/r/wsrep_auto_increment_control_basic.result b/mysql-test/suite/sys_vars/r/wsrep_auto_increment_control_basic.result
new file mode 100644
index 00000000000..2608e58b986
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_auto_increment_control_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_auto_increment_control
+#
+# save the initial value
+SET @wsrep_auto_increment_control_global_saved = @@global.wsrep_auto_increment_control;
+# default
+SELECT @@global.wsrep_auto_increment_control;
+@@global.wsrep_auto_increment_control
+1
+
+# scope
+SELECT @@session.wsrep_auto_increment_control;
+ERROR HY000: Variable 'wsrep_auto_increment_control' is a GLOBAL variable
+SET @@global.wsrep_auto_increment_control=OFF;
+SELECT @@global.wsrep_auto_increment_control;
+@@global.wsrep_auto_increment_control
+0
+SET @@global.wsrep_auto_increment_control=ON;
+SELECT @@global.wsrep_auto_increment_control;
+@@global.wsrep_auto_increment_control
+1
+
+# valid values
+SET @@global.wsrep_auto_increment_control='OFF';
+SELECT @@global.wsrep_auto_increment_control;
+@@global.wsrep_auto_increment_control
+0
+SET @@global.wsrep_auto_increment_control=ON;
+SELECT @@global.wsrep_auto_increment_control;
+@@global.wsrep_auto_increment_control
+1
+SET @@global.wsrep_auto_increment_control=default;
+SELECT @@global.wsrep_auto_increment_control;
+@@global.wsrep_auto_increment_control
+1
+
+# invalid values
+SET @@global.wsrep_auto_increment_control=NULL;
+ERROR 42000: Variable 'wsrep_auto_increment_control' can't be set to the value of 'NULL'
+SET @@global.wsrep_auto_increment_control='junk';
+ERROR 42000: Variable 'wsrep_auto_increment_control' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_auto_increment_control = @wsrep_auto_increment_control_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result b/mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result
new file mode 100644
index 00000000000..b5f0c0730b9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result
@@ -0,0 +1,64 @@
+#
+# wsrep_causal_reads
+#
+# save the initial values
+SET @wsrep_causal_reads_global_saved = @@global.wsrep_causal_reads;
+SET @wsrep_causal_reads_session_saved = @@session.wsrep_causal_reads;
+# default
+SELECT @@global.wsrep_causal_reads;
+@@global.wsrep_causal_reads
+0
+SELECT @@session.wsrep_causal_reads;
+@@session.wsrep_causal_reads
+0
+
+# scope and valid values
+SET @@global.wsrep_causal_reads=OFF;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+SELECT @@global.wsrep_causal_reads;
+@@global.wsrep_causal_reads
+0
+SET @@global.wsrep_causal_reads=ON;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+SELECT @@global.wsrep_causal_reads;
+@@global.wsrep_causal_reads
+1
+SET @@session.wsrep_causal_reads=OFF;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+SELECT @@session.wsrep_causal_reads;
+@@session.wsrep_causal_reads
+0
+SET @@session.wsrep_causal_reads=ON;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+SELECT @@session.wsrep_causal_reads;
+@@session.wsrep_causal_reads
+1
+SET @@session.wsrep_causal_reads=default;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+SELECT @@session.wsrep_causal_reads;
+@@session.wsrep_causal_reads
+1
+
+# invalid values
+SET @@global.wsrep_causal_reads=NULL;
+ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'NULL'
+SET @@global.wsrep_causal_reads='junk';
+ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'junk'
+SET @@session.wsrep_causal_reads=NULL;
+ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'NULL'
+SET @@session.wsrep_causal_reads='junk';
+ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'junk'
+
+# restore the initial values
+SET @@global.wsrep_causal_reads = @wsrep_causal_reads_global_saved;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+SET @@session.wsrep_causal_reads = @wsrep_causal_reads_session_saved;
+Warnings:
+Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_certify_nonpk_basic.result b/mysql-test/suite/sys_vars/r/wsrep_certify_nonpk_basic.result
new file mode 100644
index 00000000000..7200d14f75f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_certify_nonpk_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_certify_nonpk
+#
+# save the initial value
+SET @wsrep_certify_nonpk_global_saved = @@global.wsrep_certify_nonpk;
+# default
+SELECT @@global.wsrep_certify_nonpk;
+@@global.wsrep_certify_nonpk
+1
+
+# scope
+SELECT @@session.wsrep_certify_nonpk;
+ERROR HY000: Variable 'wsrep_certify_nonPK' is a GLOBAL variable
+SET @@global.wsrep_certify_nonpk=OFF;
+SELECT @@global.wsrep_certify_nonpk;
+@@global.wsrep_certify_nonpk
+0
+SET @@global.wsrep_certify_nonpk=ON;
+SELECT @@global.wsrep_certify_nonpk;
+@@global.wsrep_certify_nonpk
+1
+
+# valid values
+SET @@global.wsrep_certify_nonpk='OFF';
+SELECT @@global.wsrep_certify_nonpk;
+@@global.wsrep_certify_nonpk
+0
+SET @@global.wsrep_certify_nonpk=ON;
+SELECT @@global.wsrep_certify_nonpk;
+@@global.wsrep_certify_nonpk
+1
+SET @@global.wsrep_certify_nonpk=default;
+SELECT @@global.wsrep_certify_nonpk;
+@@global.wsrep_certify_nonpk
+1
+
+# invalid values
+SET @@global.wsrep_certify_nonpk=NULL;
+ERROR 42000: Variable 'wsrep_certify_nonPK' can't be set to the value of 'NULL'
+SET @@global.wsrep_certify_nonpk='junk';
+ERROR 42000: Variable 'wsrep_certify_nonPK' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_certify_nonpk = @wsrep_certify_nonpk_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_cluster_address_basic.result b/mysql-test/suite/sys_vars/r/wsrep_cluster_address_basic.result
new file mode 100644
index 00000000000..8497e220523
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_cluster_address_basic.result
@@ -0,0 +1,54 @@
+#
+# wsrep_cluster_address
+#
+call mtr.add_suppression("safe_mutex: Found wrong usage of mutex.*");
+# save the initial value
+SET @wsrep_cluster_address_global_saved = @@global.wsrep_cluster_address;
+# default
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+
+
+# scope
+SELECT @@session.wsrep_cluster_address;
+ERROR HY000: Variable 'wsrep_cluster_address' is a GLOBAL variable
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+
+
+# valid values
+SET @@global.wsrep_cluster_address='127.0.0.1';
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+127.0.0.1
+SET @@global.wsrep_cluster_address=AUTO;
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+AUTO
+SET @@global.wsrep_cluster_address=default;
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+
+
+# invalid values
+SET @@global.wsrep_node_address=NULL;
+ERROR 42000: Variable 'wsrep_node_address' can't be set to the value of 'NULL'
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+
+SET @@global.wsrep_cluster_address=ON;
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+ON
+SET @@global.wsrep_cluster_address='OFF';
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+OFF
+SET @@global.wsrep_cluster_address='junk';
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+junk
+
+# restore the initial value
+SET @@global.wsrep_cluster_address = @wsrep_cluster_address_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_cluster_name_basic.result b/mysql-test/suite/sys_vars/r/wsrep_cluster_name_basic.result
new file mode 100644
index 00000000000..29a2d966489
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_cluster_name_basic.result
@@ -0,0 +1,43 @@
+#
+# wsrep_cluster_name
+#
+# save the initial value
+SET @wsrep_cluster_name_global_saved = @@global.wsrep_cluster_name;
+# default
+SELECT @@global.wsrep_cluster_name;
+@@global.wsrep_cluster_name
+my_wsrep_cluster
+
+# scope
+SELECT @@session.wsrep_cluster_name;
+ERROR HY000: Variable 'wsrep_cluster_name' is a GLOBAL variable
+SET @@global.wsrep_cluster_name='my_galera_cluster';
+SELECT @@global.wsrep_cluster_name;
+@@global.wsrep_cluster_name
+my_galera_cluster
+
+# valid values
+SET @@global.wsrep_cluster_name='my_quoted_galera_cluster';
+SELECT @@global.wsrep_cluster_name;
+@@global.wsrep_cluster_name
+my_quoted_galera_cluster
+SET @@global.wsrep_cluster_name=my_unquoted_cluster;
+SELECT @@global.wsrep_cluster_name;
+@@global.wsrep_cluster_name
+my_unquoted_cluster
+SET @@global.wsrep_cluster_name=OFF;
+SELECT @@global.wsrep_cluster_name;
+@@global.wsrep_cluster_name
+OFF
+SET @@global.wsrep_cluster_name=default;
+SELECT @@global.wsrep_cluster_name;
+@@global.wsrep_cluster_name
+my_wsrep_cluster
+
+# invalid values
+SET @@global.wsrep_cluster_name=NULL;
+ERROR 42000: Variable 'wsrep_cluster_name' can't be set to the value of 'NULL'
+
+# restore the initial value
+SET @@global.wsrep_cluster_name = @wsrep_cluster_name_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_convert_lock_to_trx_basic.result b/mysql-test/suite/sys_vars/r/wsrep_convert_lock_to_trx_basic.result
new file mode 100644
index 00000000000..80210c4c4b6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_convert_lock_to_trx_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_convert_lock_to_trx
+#
+# save the initial value
+SET @wsrep_convert_lock_to_trx_global_saved = @@global.wsrep_convert_lock_to_trx;
+# default
+SELECT @@global.wsrep_convert_lock_to_trx;
+@@global.wsrep_convert_lock_to_trx
+0
+
+# scope
+SELECT @@session.wsrep_convert_lock_to_trx;
+ERROR HY000: Variable 'wsrep_convert_LOCK_to_trx' is a GLOBAL variable
+SET @@global.wsrep_convert_lock_to_trx=OFF;
+SELECT @@global.wsrep_convert_lock_to_trx;
+@@global.wsrep_convert_lock_to_trx
+0
+SET @@global.wsrep_convert_lock_to_trx=ON;
+SELECT @@global.wsrep_convert_lock_to_trx;
+@@global.wsrep_convert_lock_to_trx
+1
+
+# valid values
+SET @@global.wsrep_convert_lock_to_trx='OFF';
+SELECT @@global.wsrep_convert_lock_to_trx;
+@@global.wsrep_convert_lock_to_trx
+0
+SET @@global.wsrep_convert_lock_to_trx=ON;
+SELECT @@global.wsrep_convert_lock_to_trx;
+@@global.wsrep_convert_lock_to_trx
+1
+SET @@global.wsrep_convert_lock_to_trx=default;
+SELECT @@global.wsrep_convert_lock_to_trx;
+@@global.wsrep_convert_lock_to_trx
+0
+
+# invalid values
+SET @@global.wsrep_convert_lock_to_trx=NULL;
+ERROR 42000: Variable 'wsrep_convert_LOCK_to_trx' can't be set to the value of 'NULL'
+SET @@global.wsrep_convert_lock_to_trx='junk';
+ERROR 42000: Variable 'wsrep_convert_LOCK_to_trx' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_convert_lock_to_trx = @wsrep_convert_lock_to_trx_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result b/mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result
new file mode 100644
index 00000000000..c794302adb0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result
@@ -0,0 +1,24 @@
+#
+# wsrep_data_home_dir (readonly)
+#
+# default
+SELECT @@global.wsrep_data_home_dir;
+@@global.wsrep_data_home_dir
+DATADIR
+
+# scope
+SELECT @@session.wsrep_data_home_dir;
+ERROR HY000: Variable 'wsrep_data_home_dir' is a GLOBAL variable
+
+# valid values
+SET @@global.wsrep_data_home_dir='/tmp/data';
+ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
+SELECT @@global.wsrep_data_home_dir;
+@@global.wsrep_data_home_dir
+DATADIR
+SET @@global.wsrep_data_home_dir=default;
+ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
+SELECT @@global.wsrep_data_home_dir;
+@@global.wsrep_data_home_dir
+DATADIR
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_dbug_option_basic.result b/mysql-test/suite/sys_vars/r/wsrep_dbug_option_basic.result
new file mode 100644
index 00000000000..2092d54681e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_dbug_option_basic.result
@@ -0,0 +1,47 @@
+#
+# wsrep_dbug_option
+#
+# save the initial value
+SET @wsrep_dbug_option_global_saved = @@global.wsrep_dbug_option;
+# default
+SELECT @@global.wsrep_dbug_option;
+@@global.wsrep_dbug_option
+
+
+# scope
+SELECT @@session.wsrep_dbug_option;
+ERROR HY000: Variable 'wsrep_dbug_option' is a GLOBAL variable
+SET @@global.wsrep_dbug_option='test-dbug-string';
+SELECT @@global.wsrep_dbug_option;
+@@global.wsrep_dbug_option
+test-dbug-string
+
+# valid values
+SET @@global.wsrep_dbug_option='quoted-dbug-string';
+SELECT @@global.wsrep_dbug_option;
+@@global.wsrep_dbug_option
+quoted-dbug-string
+SET @@global.wsrep_dbug_option=unquoted_dbug_string;
+SELECT @@global.wsrep_dbug_option;
+@@global.wsrep_dbug_option
+unquoted_dbug_string
+SET @@global.wsrep_dbug_option=OFF;
+SELECT @@global.wsrep_dbug_option;
+@@global.wsrep_dbug_option
+OFF
+SET @@global.wsrep_dbug_option=NULL;
+SELECT @@global.wsrep_dbug_option;
+@@global.wsrep_dbug_option
+NULL
+SET @@global.wsrep_dbug_option=default;
+SELECT @@global.wsrep_dbug_option;
+@@global.wsrep_dbug_option
+
+
+# invalid values
+SET @@global.wsrep_dbug_option=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_dbug_option'
+
+# restore the initial value
+SET @@global.wsrep_dbug_option = @wsrep_dbug_option_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_debug_basic.result b/mysql-test/suite/sys_vars/r/wsrep_debug_basic.result
new file mode 100644
index 00000000000..96c262c110c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_debug_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_debug
+#
+# save the initial value
+SET @wsrep_debug_global_saved = @@global.wsrep_debug;
+# default
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+0
+
+# scope
+SELECT @@session.wsrep_debug;
+ERROR HY000: Variable 'wsrep_debug' is a GLOBAL variable
+SET @@global.wsrep_debug=OFF;
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+0
+SET @@global.wsrep_debug=ON;
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+1
+
+# valid values
+SET @@global.wsrep_debug='OFF';
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+0
+SET @@global.wsrep_debug=ON;
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+1
+SET @@global.wsrep_debug=default;
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+0
+
+# invalid values
+SET @@global.wsrep_debug=NULL;
+ERROR 42000: Variable 'wsrep_debug' can't be set to the value of 'NULL'
+SET @@global.wsrep_debug='junk';
+ERROR 42000: Variable 'wsrep_debug' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_debug = @wsrep_debug_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_desync_basic.result b/mysql-test/suite/sys_vars/r/wsrep_desync_basic.result
new file mode 100644
index 00000000000..90925e71c32
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_desync_basic.result
@@ -0,0 +1,48 @@
+#
+# wsrep_desync
+#
+call mtr.add_suppression("WSREP: SET desync failed 9 for schema: test, query: SET @@global.wsrep_desync=ON");
+# save the initial value
+SET @wsrep_desync_global_saved = @@global.wsrep_desync;
+# default
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+
+# scope
+SELECT @@session.wsrep_desync;
+ERROR HY000: Variable 'wsrep_desync' is a GLOBAL variable
+SET @@global.wsrep_desync=OFF;
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+SET @@global.wsrep_desync=ON;
+Got one of the listed errors
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+
+# valid values
+SET @@global.wsrep_desync='OFF';
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+SET @@global.wsrep_desync=ON;
+Got one of the listed errors
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+SET @@global.wsrep_desync=default;
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+
+# invalid values
+SET @@global.wsrep_desync=NULL;
+ERROR 42000: Variable 'wsrep_desync' can't be set to the value of 'NULL'
+SET @@global.wsrep_desync='junk';
+ERROR 42000: Variable 'wsrep_desync' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_desync = @wsrep_desync_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result b/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result
new file mode 100644
index 00000000000..1968103873a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result
@@ -0,0 +1,54 @@
+#
+# wsrep_dirty_reads
+#
+# save the initial value
+SET @wsrep_dirty_reads_session_saved = @@session.wsrep_dirty_reads;
+# default
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+0
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+
+# valid values for session
+SET @@session.wsrep_dirty_reads=OFF;
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+SET @@session.wsrep_dirty_reads=ON;
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+1
+SET @@session.wsrep_dirty_reads=default;
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+
+# valid values for global
+SET @@global.wsrep_dirty_reads=OFF;
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+0
+SET @@global.wsrep_dirty_reads=ON;
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+1
+SET @@global.wsrep_dirty_reads=default;
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+0
+
+# invalid values
+SET @@session.wsrep_dirty_reads=NULL;
+ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'NULL'
+SET @@session.wsrep_dirty_reads='junk';
+ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'junk'
+SET @@global.wsrep_dirty_reads=NULL;
+ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'NULL'
+SET @@global.wsrep_dirty_reads='junk';
+ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'junk'
+
+# restore the initial values
+SET @@session.wsrep_dirty_reads = @wsrep_dirty_reads_session_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_drupal_282555_workaround_basic.result b/mysql-test/suite/sys_vars/r/wsrep_drupal_282555_workaround_basic.result
new file mode 100644
index 00000000000..52bfc01e810
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_drupal_282555_workaround_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_drupal_282555_workaround
+#
+# save the initial value
+SET @wsrep_drupal_282555_workaround_global_saved = @@global.wsrep_drupal_282555_workaround;
+# default
+SELECT @@global.wsrep_drupal_282555_workaround;
+@@global.wsrep_drupal_282555_workaround
+0
+
+# scope
+SELECT @@session.wsrep_drupal_282555_workaround;
+ERROR HY000: Variable 'wsrep_drupal_282555_workaround' is a GLOBAL variable
+SET @@global.wsrep_drupal_282555_workaround=OFF;
+SELECT @@global.wsrep_drupal_282555_workaround;
+@@global.wsrep_drupal_282555_workaround
+0
+SET @@global.wsrep_drupal_282555_workaround=ON;
+SELECT @@global.wsrep_drupal_282555_workaround;
+@@global.wsrep_drupal_282555_workaround
+1
+
+# valid values
+SET @@global.wsrep_drupal_282555_workaround='OFF';
+SELECT @@global.wsrep_drupal_282555_workaround;
+@@global.wsrep_drupal_282555_workaround
+0
+SET @@global.wsrep_drupal_282555_workaround=ON;
+SELECT @@global.wsrep_drupal_282555_workaround;
+@@global.wsrep_drupal_282555_workaround
+1
+SET @@global.wsrep_drupal_282555_workaround=default;
+SELECT @@global.wsrep_drupal_282555_workaround;
+@@global.wsrep_drupal_282555_workaround
+0
+
+# invalid values
+SET @@global.wsrep_drupal_282555_workaround=NULL;
+ERROR 42000: Variable 'wsrep_drupal_282555_workaround' can't be set to the value of 'NULL'
+SET @@global.wsrep_drupal_282555_workaround='junk';
+ERROR 42000: Variable 'wsrep_drupal_282555_workaround' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_drupal_282555_workaround = @wsrep_drupal_282555_workaround_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_forced_binlog_format_basic.result b/mysql-test/suite/sys_vars/r/wsrep_forced_binlog_format_basic.result
new file mode 100644
index 00000000000..3cf5ffcaf4e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_forced_binlog_format_basic.result
@@ -0,0 +1,51 @@
+#
+# wsrep_forced_binlog_format
+#
+# save the initial value
+SET @wsrep_forced_binlog_format_global_saved = @@global.wsrep_forced_binlog_format;
+# default
+SELECT @@global.wsrep_forced_binlog_format;
+@@global.wsrep_forced_binlog_format
+NONE
+
+# scope
+SELECT @@session.wsrep_forced_binlog_format;
+ERROR HY000: Variable 'wsrep_forced_binlog_format' is a GLOBAL variable
+SET @@global.wsrep_forced_binlog_format=STATEMENT;
+SELECT @@global.wsrep_forced_binlog_format;
+@@global.wsrep_forced_binlog_format
+STATEMENT
+
+# valid values
+SET @@global.wsrep_forced_binlog_format=STATEMENT;
+SELECT @@global.wsrep_forced_binlog_format;
+@@global.wsrep_forced_binlog_format
+STATEMENT
+SET @@global.wsrep_forced_binlog_format=ROW;
+SELECT @@global.wsrep_forced_binlog_format;
+@@global.wsrep_forced_binlog_format
+ROW
+SET @@global.wsrep_forced_binlog_format=MIXED;
+SELECT @@global.wsrep_forced_binlog_format;
+@@global.wsrep_forced_binlog_format
+MIXED
+SET @@global.wsrep_forced_binlog_format=NONE;
+SELECT @@global.wsrep_forced_binlog_format;
+@@global.wsrep_forced_binlog_format
+NONE
+SET @@global.wsrep_forced_binlog_format=default;
+SELECT @@global.wsrep_forced_binlog_format;
+@@global.wsrep_forced_binlog_format
+NONE
+
+# invalid values
+SET @@global.wsrep_forced_binlog_format=NULL;
+ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'NULL'
+SET @@global.wsrep_forced_binlog_format='junk';
+ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'junk'
+SET @@global.wsrep_forced_binlog_format=ON;
+ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'ON'
+
+# restore the initial value
+SET @@global.wsrep_forced_binlog_format = @wsrep_forced_binlog_format_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_gtid_domain_id_basic.result b/mysql-test/suite/sys_vars/r/wsrep_gtid_domain_id_basic.result
new file mode 100644
index 00000000000..7c9537d095e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_gtid_domain_id_basic.result
@@ -0,0 +1,47 @@
+#
+# wsrep_gtid_domain_id
+#
+# save the initial value
+SET @wsrep_gtid_domain_id_global_saved = @@global.wsrep_gtid_domain_id;
+# default
+SELECT @@global.wsrep_gtid_domain_id;
+@@global.wsrep_gtid_domain_id
+0
+
+# scope
+SELECT @@session.wsrep_gtid_domain_id;
+ERROR HY000: Variable 'wsrep_gtid_domain_id' is a GLOBAL variable
+SET @@global.wsrep_gtid_domain_id=1;
+SELECT @@global.wsrep_gtid_domain_id;
+@@global.wsrep_gtid_domain_id
+1
+
+# valid values
+SET @@global.wsrep_gtid_domain_id=10;
+SELECT @@global.wsrep_gtid_domain_id;
+@@global.wsrep_gtid_domain_id
+10
+SET @@global.wsrep_gtid_domain_id=0;
+SELECT @@global.wsrep_gtid_domain_id;
+@@global.wsrep_gtid_domain_id
+0
+SET @@global.wsrep_gtid_domain_id=default;
+SELECT @global.wsrep_gtid_domain_id;
+@global.wsrep_gtid_domain_id
+NULL
+
+# invalid values
+SET @@global.wsrep_gtid_domain_id=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_gtid_domain_id'
+SET @@global.wsrep_gtid_domain_id='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_gtid_domain_id'
+SET @@global.wsrep_gtid_domain_id=-1;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_gtid_domain_id value: '-1'
+SELECT @global.wsrep_gtid_domain_id;
+@global.wsrep_gtid_domain_id
+NULL
+
+# restore the initial value
+SET @@global.wsrep_gtid_domain_id = @wsrep_gtid_domain_id_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_gtid_mode_basic.result b/mysql-test/suite/sys_vars/r/wsrep_gtid_mode_basic.result
new file mode 100644
index 00000000000..e59d6468c21
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_gtid_mode_basic.result
@@ -0,0 +1,31 @@
+#
+# wsrep_gtid_mode
+#
+# save the initial value
+SET @wsrep_gtid_mode_global_saved = @@global.wsrep_gtid_mode;
+# default
+SELECT @@global.wsrep_gtid_mode;
+@@global.wsrep_gtid_mode
+0
+SELECT @@session.wsrep_gtid_mode;
+ERROR HY000: Variable 'wsrep_gtid_mode' is a GLOBAL variable
+
+# scope and valid values
+SET @@global.wsrep_gtid_mode=OFF;
+SELECT @@global.wsrep_gtid_mode;
+@@global.wsrep_gtid_mode
+0
+SET @@global.wsrep_gtid_mode=ON;
+SELECT @@global.wsrep_gtid_mode;
+@@global.wsrep_gtid_mode
+1
+
+# invalid values
+SET @@global.wsrep_gtid_mode=NULL;
+ERROR 42000: Variable 'wsrep_gtid_mode' can't be set to the value of 'NULL'
+SET @@global.wsrep_gtid_mode='junk';
+ERROR 42000: Variable 'wsrep_gtid_mode' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_gtid_mode = @wsrep_gtid_mode_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_load_data_splitting_basic.result b/mysql-test/suite/sys_vars/r/wsrep_load_data_splitting_basic.result
new file mode 100644
index 00000000000..687934a7705
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_load_data_splitting_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_load_data_splitting
+#
+# save the initial value
+SET @wsrep_load_data_splitting_global_saved = @@global.wsrep_load_data_splitting;
+# default
+SELECT @@global.wsrep_load_data_splitting;
+@@global.wsrep_load_data_splitting
+1
+
+# scope
+SELECT @@session.wsrep_load_data_splitting;
+ERROR HY000: Variable 'wsrep_load_data_splitting' is a GLOBAL variable
+SET @@global.wsrep_load_data_splitting=OFF;
+SELECT @@global.wsrep_load_data_splitting;
+@@global.wsrep_load_data_splitting
+0
+SET @@global.wsrep_load_data_splitting=ON;
+SELECT @@global.wsrep_load_data_splitting;
+@@global.wsrep_load_data_splitting
+1
+
+# valid values
+SET @@global.wsrep_load_data_splitting='OFF';
+SELECT @@global.wsrep_load_data_splitting;
+@@global.wsrep_load_data_splitting
+0
+SET @@global.wsrep_load_data_splitting=ON;
+SELECT @@global.wsrep_load_data_splitting;
+@@global.wsrep_load_data_splitting
+1
+SET @@global.wsrep_load_data_splitting=default;
+SELECT @@global.wsrep_load_data_splitting;
+@@global.wsrep_load_data_splitting
+1
+
+# invalid values
+SET @@global.wsrep_load_data_splitting=NULL;
+ERROR 42000: Variable 'wsrep_load_data_splitting' can't be set to the value of 'NULL'
+SET @@global.wsrep_load_data_splitting='junk';
+ERROR 42000: Variable 'wsrep_load_data_splitting' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_load_data_splitting = @wsrep_load_data_splitting_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_log_conflicts_basic.result b/mysql-test/suite/sys_vars/r/wsrep_log_conflicts_basic.result
new file mode 100644
index 00000000000..4d577daa904
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_log_conflicts_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_log_conflicts
+#
+# save the initial value
+SET @wsrep_log_conflicts_global_saved = @@global.wsrep_log_conflicts;
+# default
+SELECT @@global.wsrep_log_conflicts;
+@@global.wsrep_log_conflicts
+0
+
+# scope
+SELECT @@session.wsrep_log_conflicts;
+ERROR HY000: Variable 'wsrep_log_conflicts' is a GLOBAL variable
+SET @@global.wsrep_log_conflicts=OFF;
+SELECT @@global.wsrep_log_conflicts;
+@@global.wsrep_log_conflicts
+0
+SET @@global.wsrep_log_conflicts=ON;
+SELECT @@global.wsrep_log_conflicts;
+@@global.wsrep_log_conflicts
+1
+
+# valid values
+SET @@global.wsrep_log_conflicts='OFF';
+SELECT @@global.wsrep_log_conflicts;
+@@global.wsrep_log_conflicts
+0
+SET @@global.wsrep_log_conflicts=ON;
+SELECT @@global.wsrep_log_conflicts;
+@@global.wsrep_log_conflicts
+1
+SET @@global.wsrep_log_conflicts=default;
+SELECT @@global.wsrep_log_conflicts;
+@@global.wsrep_log_conflicts
+0
+
+# invalid values
+SET @@global.wsrep_log_conflicts=NULL;
+ERROR 42000: Variable 'wsrep_log_conflicts' can't be set to the value of 'NULL'
+SET @@global.wsrep_log_conflicts='junk';
+ERROR 42000: Variable 'wsrep_log_conflicts' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_log_conflicts = @wsrep_log_conflicts_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_max_ws_rows_basic.result b/mysql-test/suite/sys_vars/r/wsrep_max_ws_rows_basic.result
new file mode 100644
index 00000000000..d96bc8708c5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_max_ws_rows_basic.result
@@ -0,0 +1,51 @@
+#
+# wsrep_max_ws_rows
+#
+# save the initial value
+SET @wsrep_max_ws_rows_global_saved = @@global.wsrep_max_ws_rows;
+# default
+SELECT @@global.wsrep_max_ws_rows;
+@@global.wsrep_max_ws_rows
+0
+
+# scope
+SELECT @@session.wsrep_max_ws_rows;
+ERROR HY000: Variable 'wsrep_max_ws_rows' is a GLOBAL variable
+SET @@global.wsrep_max_ws_rows=1;
+SELECT @@global.wsrep_max_ws_rows;
+@@global.wsrep_max_ws_rows
+1
+
+# valid values
+SET @@global.wsrep_max_ws_rows=131072;
+SELECT @@global.wsrep_max_ws_rows;
+@@global.wsrep_max_ws_rows
+131072
+SET @@global.wsrep_max_ws_rows=131073;
+SELECT @@global.wsrep_max_ws_rows;
+@@global.wsrep_max_ws_rows
+131073
+SET @@global.wsrep_max_ws_rows=0;
+SELECT @@global.wsrep_max_ws_rows;
+@@global.wsrep_max_ws_rows
+0
+SET @@global.wsrep_max_ws_rows=default;
+SELECT @global.wsrep_max_ws_rows;
+@global.wsrep_max_ws_rows
+NULL
+
+# invalid values
+SET @@global.wsrep_max_ws_rows=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
+SET @@global.wsrep_max_ws_rows='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
+SET @@global.wsrep_max_ws_rows=-1;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '-1'
+SELECT @global.wsrep_max_ws_rows;
+@global.wsrep_max_ws_rows
+NULL
+
+# restore the initial value
+SET @@global.wsrep_max_ws_rows = @wsrep_max_ws_rows_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result b/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result
new file mode 100644
index 00000000000..689da3e9cb0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result
@@ -0,0 +1,53 @@
+#
+# wsrep_max_ws_size
+#
+# default
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+2147483647
+
+# scope
+SELECT @@session.wsrep_max_ws_size;
+ERROR HY000: Variable 'wsrep_max_ws_size' is a GLOBAL variable
+SET @@global.wsrep_max_ws_size=1;
+ERROR HY000: WSREP (galera) not started
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+2147483647
+
+# valid values
+SET @@global.wsrep_max_ws_size=1073741824;
+ERROR HY000: WSREP (galera) not started
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+2147483647
+SET @@global.wsrep_max_ws_size=1073741825;
+ERROR HY000: WSREP (galera) not started
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+2147483647
+SET @@global.wsrep_max_ws_size=0;
+ERROR HY000: WSREP (galera) not started
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+2147483647
+SET @@global.wsrep_max_ws_size=default;
+ERROR HY000: WSREP (galera) not started
+SELECT @global.wsrep_max_ws_size;
+@global.wsrep_max_ws_size
+NULL
+
+# invalid values
+SET @@global.wsrep_max_ws_size=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_size'
+SET @@global.wsrep_max_ws_size='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_size'
+SELECT @global.wsrep_max_ws_size;
+@global.wsrep_max_ws_size
+NULL
+SET @@global.wsrep_max_ws_size=-1;
+ERROR HY000: WSREP (galera) not started
+SELECT @global.wsrep_max_ws_size;
+@global.wsrep_max_ws_size
+NULL
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_mysql_replication_bundle_basic.result b/mysql-test/suite/sys_vars/r/wsrep_mysql_replication_bundle_basic.result
new file mode 100644
index 00000000000..1d69d800703
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_mysql_replication_bundle_basic.result
@@ -0,0 +1,52 @@
+#
+# wsrep_mysql_replication_bundle
+#
+# save the initial value
+SET @wsrep_mysql_replication_bundle_global_saved = @@global.wsrep_mysql_replication_bundle;
+# default
+SELECT @@global.wsrep_mysql_replication_bundle;
+@@global.wsrep_mysql_replication_bundle
+0
+
+# scope
+SELECT @@session.wsrep_mysql_replication_bundle;
+ERROR HY000: Variable 'wsrep_mysql_replication_bundle' is a GLOBAL variable
+SELECT @@global.wsrep_mysql_replication_bundle;
+@@global.wsrep_mysql_replication_bundle
+0
+
+# valid values
+SET @@global.wsrep_mysql_replication_bundle=0;
+SELECT @@global.wsrep_mysql_replication_bundle;
+@@global.wsrep_mysql_replication_bundle
+0
+SET @@global.wsrep_mysql_replication_bundle=1000;
+SELECT @@global.wsrep_mysql_replication_bundle;
+@@global.wsrep_mysql_replication_bundle
+1000
+SET @@global.wsrep_mysql_replication_bundle=default;
+SELECT @@global.wsrep_mysql_replication_bundle;
+@@global.wsrep_mysql_replication_bundle
+0
+
+# invalid values
+SET @@global.wsrep_mysql_replication_bundle=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_mysql_replication_bundle'
+SET @@global.wsrep_mysql_replication_bundle='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_mysql_replication_bundle'
+SET @@global.wsrep_mysql_replication_bundle=-1;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '-1'
+SELECT @@global.wsrep_mysql_replication_bundle;
+@@global.wsrep_mysql_replication_bundle
+0
+SET @@global.wsrep_mysql_replication_bundle=1001;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '1001'
+SELECT @@global.wsrep_mysql_replication_bundle;
+@@global.wsrep_mysql_replication_bundle
+1000
+
+# restore the initial value
+SET @@global.wsrep_mysql_replication_bundle = @wsrep_mysql_replication_bundle_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_node_address_basic.result b/mysql-test/suite/sys_vars/r/wsrep_node_address_basic.result
new file mode 100644
index 00000000000..e9a93d2fcd6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_node_address_basic.result
@@ -0,0 +1,49 @@
+#
+# wsrep_node_address
+#
+# save the initial value
+SET @wsrep_node_address_global_saved = @@global.wsrep_node_address;
+# default
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+
+
+# scope
+SELECT @@session.wsrep_node_address;
+ERROR HY000: Variable 'wsrep_node_address' is a GLOBAL variable
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+
+
+# valid values
+SET @@global.wsrep_node_address='127.0.0.1';
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+127.0.0.1
+SET @@global.wsrep_node_address=default;
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+
+
+# invalid values
+SET @@global.wsrep_node_address=NULL;
+ERROR 42000: Variable 'wsrep_node_address' can't be set to the value of 'NULL'
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+
+SET @@global.wsrep_node_address=ON;
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+ON
+SET @@global.wsrep_node_address='OFF';
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+OFF
+SET @@global.wsrep_node_address='junk';
+SELECT @@global.wsrep_node_address;
+@@global.wsrep_node_address
+junk
+
+# restore the initial value
+SET @@global.wsrep_node_address = @wsrep_node_address_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_node_incoming_address_basic.result b/mysql-test/suite/sys_vars/r/wsrep_node_incoming_address_basic.result
new file mode 100644
index 00000000000..2340c61db28
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_node_incoming_address_basic.result
@@ -0,0 +1,56 @@
+#
+# wsrep_node_incoming_address
+#
+# save the initial value
+SET @wsrep_node_incoming_address_global_saved = @@global.wsrep_node_incoming_address;
+# default
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+AUTO
+
+# scope
+SELECT @@session.wsrep_node_incoming_address;
+ERROR HY000: Variable 'wsrep_node_incoming_address' is a GLOBAL variable
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+AUTO
+
+# valid values
+SET @@global.wsrep_node_incoming_address='127.0.0.1:4444';
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+127.0.0.1:4444
+SET @@global.wsrep_node_incoming_address='127.0.0.1';
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+127.0.0.1
+SET @@global.wsrep_node_incoming_address=AUTO;
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+AUTO
+SET @@global.wsrep_node_incoming_address=default;
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+AUTO
+
+# invalid values
+SET @@global.wsrep_node_incoming_address=ON;
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+ON
+SET @@global.wsrep_node_incoming_address='OFF';
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+OFF
+SET @@global.wsrep_node_incoming_address=NULL;
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+NULL
+SET @@global.wsrep_node_incoming_address='junk';
+SELECT @@global.wsrep_node_incoming_address;
+@@global.wsrep_node_incoming_address
+junk
+
+# restore the initial value
+SET @@global.wsrep_node_incoming_address = @wsrep_node_incoming_address_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result
new file mode 100644
index 00000000000..763d0612a1b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result
@@ -0,0 +1,61 @@
+#
+# wsrep_node_name
+#
+call mtr.add_suppression("WSREP: Failed to get provider options");
+# save the initial value
+SET @wsrep_node_name_global_saved = @@global.wsrep_node_name;
+# default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
+
+# scope
+SELECT @@session.wsrep_node_name;
+ERROR HY000: Variable 'wsrep_node_name' is a GLOBAL variable
+SET @@global.wsrep_node_name='node_name';
+SELECT @@global.wsrep_node_name;
+@@global.wsrep_node_name
+node_name
+
+# valid values
+SET @@global.wsrep_node_name='my_node';
+SELECT @@global.wsrep_node_name;
+@@global.wsrep_node_name
+my_node
+SET @@global.wsrep_node_name='hyphenated-node-name';
+SELECT @@global.wsrep_node_name;
+@@global.wsrep_node_name
+hyphenated-node-name
+SET @@global.wsrep_node_name=default;
+# default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
+
+# invalid values
+SET @@global.wsrep_node_name=NULL;
+ERROR 42000: Variable 'wsrep_node_name' can't be set to the value of 'NULL'
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
+SET @@global.wsrep_node_name=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_node_name'
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
+#
+# MDEV-6699 : wsrep_node_name not automaticly set to hostname
+#
+SET @@global.wsrep_node_name=default;
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname';
+@@GLOBAL.wsrep_node_name = VARIABLE_VALUE
+1
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name';
+@@GLOBAL.wsrep_node_name = VARIABLE_VALUE
+1
+
+# restore the initial value
+SET @@global.wsrep_node_name = @wsrep_node_name_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result b/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
new file mode 100644
index 00000000000..056ff8c817b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
@@ -0,0 +1,47 @@
+#
+# wsrep_notify_cmd
+#
+call mtr.add_suppression("WSREP: Failed to get provider options");
+# save the initial value
+SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
+# default
+SELECT @@global.wsrep_notify_cmd;
+@@global.wsrep_notify_cmd
+
+
+# scope
+SELECT @@session.wsrep_notify_cmd;
+ERROR HY000: Variable 'wsrep_notify_cmd' is a GLOBAL variable
+SET @@global.wsrep_notify_cmd='notify_cmd';
+SELECT @@global.wsrep_notify_cmd;
+@@global.wsrep_notify_cmd
+notify_cmd
+
+# valid values
+SET @@global.wsrep_notify_cmd='command';
+SELECT @@global.wsrep_notify_cmd;
+@@global.wsrep_notify_cmd
+command
+SET @@global.wsrep_notify_cmd='hyphenated-command';
+SELECT @@global.wsrep_notify_cmd;
+@@global.wsrep_notify_cmd
+hyphenated-command
+SET @@global.wsrep_notify_cmd=default;
+SELECT @@global.wsrep_notify_cmd;
+@@global.wsrep_notify_cmd
+
+SET @@global.wsrep_notify_cmd=NULL;
+SELECT @@global.wsrep_notify_cmd;
+@@global.wsrep_notify_cmd
+NULL
+
+# invalid values
+SET @@global.wsrep_notify_cmd=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd'
+SELECT @@global.wsrep_notify_cmd;
+@@global.wsrep_notify_cmd
+NULL
+
+# restore the initial value
+SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_on_basic.result b/mysql-test/suite/sys_vars/r/wsrep_on_basic.result
new file mode 100644
index 00000000000..735e2d77180
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_on_basic.result
@@ -0,0 +1,50 @@
+#
+# wsrep_on
+#
+# save the initial values
+SET @wsrep_on_global_saved = @@global.wsrep_on;
+SET @wsrep_on_session_saved = @@session.wsrep_on;
+# default
+SELECT @@global.wsrep_on;
+@@global.wsrep_on
+0
+SELECT @@session.wsrep_on;
+@@session.wsrep_on
+0
+
+# scope and valid values
+SET @@global.wsrep_on=OFF;
+SELECT @@global.wsrep_on;
+@@global.wsrep_on
+0
+SET @@global.wsrep_on=ON;
+SELECT @@global.wsrep_on;
+@@global.wsrep_on
+1
+SET @@session.wsrep_on=OFF;
+SELECT @@session.wsrep_on;
+@@session.wsrep_on
+0
+SET @@session.wsrep_on=ON;
+SELECT @@session.wsrep_on;
+@@session.wsrep_on
+1
+SET @@session.wsrep_on=default;
+SELECT @@session.wsrep_on;
+@@session.wsrep_on
+1
+
+# invalid values
+SET @@global.wsrep_on=NULL;
+ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'NULL'
+SET @@global.wsrep_on='junk';
+ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'junk'
+SET @@session.wsrep_on=NULL;
+ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'NULL'
+SET @@session.wsrep_on='junk';
+ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'junk'
+
+# restore the initial values
+SET @@global.wsrep_on = @wsrep_on_global_saved;
+SET @@session.wsrep_on = @wsrep_on_session_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_osu_method_basic.result b/mysql-test/suite/sys_vars/r/wsrep_osu_method_basic.result
new file mode 100644
index 00000000000..10f1d654c12
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_osu_method_basic.result
@@ -0,0 +1,61 @@
+#
+# wsrep_osu_method
+#
+# save the initial value
+SET @wsrep_osu_method_global_saved = @@global.wsrep_osu_method;
+# default
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+TOI
+
+# scope
+SELECT @@session.wsrep_osu_method;
+@@session.wsrep_osu_method
+TOI
+SET @@global.wsrep_osu_method=TOI;
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+TOI
+
+# valid values
+SET @@global.wsrep_osu_method=TOI;
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+TOI
+SET @@global.wsrep_osu_method=RSU;
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+RSU
+SET @@global.wsrep_osu_method="RSU";
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+RSU
+SET @@global.wsrep_osu_method=default;
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+TOI
+SET @@global.wsrep_osu_method=1;
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+RSU
+
+# invalid values
+SET @@global.wsrep_osu_method=4;
+ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of '4'
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+RSU
+SET @@global.wsrep_osu_method=NULL;
+ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'NULL'
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+RSU
+SET @@global.wsrep_osu_method='junk';
+ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'junk'
+SELECT @@global.wsrep_osu_method;
+@@global.wsrep_osu_method
+RSU
+
+# restore the initial value
+SET @@global.wsrep_osu_method = @wsrep_osu_method_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
new file mode 100644
index 00000000000..3e4ac8ca883
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
@@ -0,0 +1,40 @@
+#
+# wsrep_provider
+#
+# save the initial value
+SET @wsrep_provider_global_saved = @@global.wsrep_provider;
+# default
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+none
+
+# scope
+SELECT @@session.wsrep_provider;
+ERROR HY000: Variable 'wsrep_provider' is a GLOBAL variable
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+none
+
+# valid values
+SET @@global.wsrep_provider=default;
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+none
+
+# invalid values
+SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
+ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/invalid/libgalera_smm.so'
+SET @@global.wsrep_provider=NULL;
+ERROR 42000: Variable 'wsrep_provider' can't be set to the value of 'NULL'
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+none
+SET @@global.wsrep_provider=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_provider'
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+none
+
+# restore the initial value
+SET @@global.wsrep_provider = @wsrep_provider_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
new file mode 100644
index 00000000000..b2e07c55b38
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
@@ -0,0 +1,49 @@
+#
+# wsrep_provider_options
+#
+call mtr.add_suppression("WSREP: Failed to get provider options");
+SET @@global.wsrep_provider = @@global.wsrep_provider;
+# save the initial value
+SET @wsrep_provider_options_global_saved = @@global.wsrep_provider_options;
+# default
+SELECT @@global.wsrep_provider_options;
+@@global.wsrep_provider_options
+
+
+# scope
+SELECT @@session.wsrep_provider_options;
+ERROR HY000: Variable 'wsrep_provider_options' is a GLOBAL variable
+SET @@global.wsrep_provider_options='option1';
+SELECT @@global.wsrep_provider_options;
+@@global.wsrep_provider_options
+option1
+
+# valid values
+SET @@global.wsrep_provider_options='name1=value1;name2=value2';
+SELECT @@global.wsrep_provider_options;
+@@global.wsrep_provider_options
+name1=value1;name2=value2
+SET @@global.wsrep_provider_options='hyphenated-name:value';
+SELECT @@global.wsrep_provider_options;
+@@global.wsrep_provider_options
+hyphenated-name:value
+SET @@global.wsrep_provider_options=default;
+SELECT @@global.wsrep_provider_options;
+@@global.wsrep_provider_options
+
+
+# invalid values
+SET @@global.wsrep_provider_options=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_provider_options'
+SELECT @@global.wsrep_provider_options;
+@@global.wsrep_provider_options
+
+SET @@global.wsrep_provider_options=NULL;
+Got one of the listed errors
+SELECT @@global.wsrep_provider_options;
+@@global.wsrep_provider_options
+NULL
+
+# restore the initial value
+SET @@global.wsrep_provider_options = @wsrep_provider_options_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_recover_basic.result b/mysql-test/suite/sys_vars/r/wsrep_recover_basic.result
new file mode 100644
index 00000000000..b26c1121a4c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_recover_basic.result
@@ -0,0 +1,22 @@
+#
+# wsrep_recover
+#
+# default
+SELECT @@global.wsrep_recover;
+@@global.wsrep_recover
+0
+SELECT @@session.wsrep_recover;
+ERROR HY000: Variable 'wsrep_recover' is a GLOBAL variable
+
+# scope and valid values
+SET @@global.wsrep_recover=OFF;
+ERROR HY000: Variable 'wsrep_recover' is a read only variable
+SET @@global.wsrep_recover=ON;
+ERROR HY000: Variable 'wsrep_recover' is a read only variable
+
+# invalid values
+SET @@global.wsrep_recover=NULL;
+ERROR HY000: Variable 'wsrep_recover' is a read only variable
+SET @@global.wsrep_recover='junk';
+ERROR HY000: Variable 'wsrep_recover' is a read only variable
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_replicate_myisam_basic.result b/mysql-test/suite/sys_vars/r/wsrep_replicate_myisam_basic.result
new file mode 100644
index 00000000000..3625f29aa0f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_replicate_myisam_basic.result
@@ -0,0 +1,31 @@
+#
+# wsrep_replicate_myisam
+#
+# save the initial value
+SET @wsrep_replicate_myisam_global_saved = @@global.wsrep_replicate_myisam;
+# default
+SELECT @@global.wsrep_replicate_myisam;
+@@global.wsrep_replicate_myisam
+0
+SELECT @@session.wsrep_replicate_myisam;
+ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable
+
+# scope and valid values
+SET @@global.wsrep_replicate_myisam=OFF;
+SELECT @@global.wsrep_replicate_myisam;
+@@global.wsrep_replicate_myisam
+0
+SET @@global.wsrep_replicate_myisam=ON;
+SELECT @@global.wsrep_replicate_myisam;
+@@global.wsrep_replicate_myisam
+1
+
+# invalid values
+SET @@global.wsrep_replicate_myisam=NULL;
+ERROR 42000: Variable 'wsrep_replicate_myisam' can't be set to the value of 'NULL'
+SET @@global.wsrep_replicate_myisam='junk';
+ERROR 42000: Variable 'wsrep_replicate_myisam' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_replicate_myisam = @wsrep_replicate_myisam_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_restart_slave_basic.result b/mysql-test/suite/sys_vars/r/wsrep_restart_slave_basic.result
new file mode 100644
index 00000000000..0ecdf915992
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_restart_slave_basic.result
@@ -0,0 +1,31 @@
+#
+# wsrep_restart_slave
+#
+# save the initial value
+SET @wsrep_restart_slave_global_saved = @@global.wsrep_restart_slave;
+# default
+SELECT @@global.wsrep_restart_slave;
+@@global.wsrep_restart_slave
+0
+SELECT @@session.wsrep_restart_slave;
+ERROR HY000: Variable 'wsrep_restart_slave' is a GLOBAL variable
+
+# scope and valid values
+SET @@global.wsrep_restart_slave=OFF;
+SELECT @@global.wsrep_restart_slave;
+@@global.wsrep_restart_slave
+0
+SET @@global.wsrep_restart_slave=ON;
+SELECT @@global.wsrep_restart_slave;
+@@global.wsrep_restart_slave
+1
+
+# invalid values
+SET @@global.wsrep_restart_slave=NULL;
+ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of 'NULL'
+SET @@global.wsrep_restart_slave='junk';
+ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_restart_slave = @wsrep_restart_slave_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_retry_autocommit_basic.result b/mysql-test/suite/sys_vars/r/wsrep_retry_autocommit_basic.result
new file mode 100644
index 00000000000..d848dadd24d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_retry_autocommit_basic.result
@@ -0,0 +1,63 @@
+#
+# wsrep_retry_autocommit
+#
+# save the initial values
+SET @wsrep_retry_autocommit_global_saved = @@global.wsrep_retry_autocommit;
+SET @wsrep_retry_autocommit_session_saved = @@session.wsrep_retry_autocommit;
+# default
+SELECT @@global.wsrep_retry_autocommit;
+@@global.wsrep_retry_autocommit
+1
+
+# scope
+SET @@session.wsrep_retry_autocommit=1;
+SELECT @@session.wsrep_retry_autocommit;
+@@session.wsrep_retry_autocommit
+1
+SET @@global.wsrep_retry_autocommit=1;
+SELECT @@global.wsrep_retry_autocommit;
+@@global.wsrep_retry_autocommit
+1
+
+# valid values
+SET @@global.wsrep_retry_autocommit=10;
+SELECT @@global.wsrep_retry_autocommit;
+@@global.wsrep_retry_autocommit
+10
+SET @@global.wsrep_retry_autocommit=0;
+SELECT @@global.wsrep_retry_autocommit;
+@@global.wsrep_retry_autocommit
+0
+SET @@global.wsrep_retry_autocommit=default;
+SELECT @global.wsrep_retry_autocommit;
+@global.wsrep_retry_autocommit
+NULL
+SET @@session.wsrep_retry_autocommit=10;
+SELECT @@session.wsrep_retry_autocommit;
+@@session.wsrep_retry_autocommit
+10
+SET @@session.wsrep_retry_autocommit=0;
+SELECT @@session.wsrep_retry_autocommit;
+@@session.wsrep_retry_autocommit
+0
+SET @@session.wsrep_retry_autocommit=default;
+SELECT @session.wsrep_retry_autocommit;
+@session.wsrep_retry_autocommit
+NULL
+
+# invalid values
+SET @@global.wsrep_retry_autocommit=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_retry_autocommit'
+SET @@global.wsrep_retry_autocommit='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_retry_autocommit'
+SET @@global.wsrep_retry_autocommit=-1;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_retry_autocommit value: '-1'
+SELECT @global.wsrep_retry_autocommit;
+@global.wsrep_retry_autocommit
+NULL
+
+# restore the initial value
+SET @@global.wsrep_retry_autocommit = @wsrep_retry_autocommit_global_saved;
+SET @@session.wsrep_retry_autocommit = @wsrep_retry_autocommit_session_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_slave_fk_checks_basic.result b/mysql-test/suite/sys_vars/r/wsrep_slave_fk_checks_basic.result
new file mode 100644
index 00000000000..40b3270e221
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_slave_fk_checks_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_slave_fk_checks
+#
+# save the initial value
+SET @wsrep_slave_fk_checks_global_saved = @@global.wsrep_slave_fk_checks;
+# default
+SELECT @@global.wsrep_slave_fk_checks;
+@@global.wsrep_slave_fk_checks
+1
+
+# scope
+SELECT @@session.wsrep_slave_fk_checks;
+ERROR HY000: Variable 'wsrep_slave_FK_checks' is a GLOBAL variable
+SET @@global.wsrep_slave_fk_checks=OFF;
+SELECT @@global.wsrep_slave_fk_checks;
+@@global.wsrep_slave_fk_checks
+0
+SET @@global.wsrep_slave_fk_checks=ON;
+SELECT @@global.wsrep_slave_fk_checks;
+@@global.wsrep_slave_fk_checks
+1
+
+# valid values
+SET @@global.wsrep_slave_fk_checks='OFF';
+SELECT @@global.wsrep_slave_fk_checks;
+@@global.wsrep_slave_fk_checks
+0
+SET @@global.wsrep_slave_fk_checks=ON;
+SELECT @@global.wsrep_slave_fk_checks;
+@@global.wsrep_slave_fk_checks
+1
+SET @@global.wsrep_slave_fk_checks=default;
+SELECT @@global.wsrep_slave_fk_checks;
+@@global.wsrep_slave_fk_checks
+1
+
+# invalid values
+SET @@global.wsrep_slave_fk_checks=NULL;
+ERROR 42000: Variable 'wsrep_slave_FK_checks' can't be set to the value of 'NULL'
+SET @@global.wsrep_slave_fk_checks='junk';
+ERROR 42000: Variable 'wsrep_slave_FK_checks' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_slave_fk_checks = @wsrep_slave_fk_checks_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_slave_threads_basic.result b/mysql-test/suite/sys_vars/r/wsrep_slave_threads_basic.result
new file mode 100644
index 00000000000..62be5a42416
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_slave_threads_basic.result
@@ -0,0 +1,49 @@
+#
+# wsrep_slave_threads
+#
+# save the initial value
+SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads;
+# default
+SELECT @@global.wsrep_slave_threads;
+@@global.wsrep_slave_threads
+1
+
+# scope
+SELECT @@session.wsrep_slave_threads;
+ERROR HY000: Variable 'wsrep_slave_threads' is a GLOBAL variable
+SET @@global.wsrep_slave_threads=1;
+SELECT @@global.wsrep_slave_threads;
+@@global.wsrep_slave_threads
+1
+
+# valid values
+SET @@global.wsrep_slave_threads=10;
+SELECT @@global.wsrep_slave_threads;
+@@global.wsrep_slave_threads
+10
+SET @@global.wsrep_slave_threads=0;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
+SELECT @@global.wsrep_slave_threads;
+@@global.wsrep_slave_threads
+1
+SET @@global.wsrep_slave_threads=default;
+SELECT @global.wsrep_slave_threads;
+@global.wsrep_slave_threads
+NULL
+
+# invalid values
+SET @@global.wsrep_slave_threads=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_slave_threads'
+SET @@global.wsrep_slave_threads='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_slave_threads'
+SET @@global.wsrep_slave_threads=-1;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_slave_threads value: '-1'
+SELECT @global.wsrep_slave_threads;
+@global.wsrep_slave_threads
+NULL
+
+# restore the initial value
+SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_slave_uk_checks_basic.result b/mysql-test/suite/sys_vars/r/wsrep_slave_uk_checks_basic.result
new file mode 100644
index 00000000000..b78a83b547d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_slave_uk_checks_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_slave_uk_checks
+#
+# save the initial value
+SET @wsrep_slave_uk_checks_global_saved = @@global.wsrep_slave_uk_checks;
+# default
+SELECT @@global.wsrep_slave_uk_checks;
+@@global.wsrep_slave_uk_checks
+0
+
+# scope
+SELECT @@session.wsrep_slave_uk_checks;
+ERROR HY000: Variable 'wsrep_slave_UK_checks' is a GLOBAL variable
+SET @@global.wsrep_slave_uk_checks=OFF;
+SELECT @@global.wsrep_slave_uk_checks;
+@@global.wsrep_slave_uk_checks
+0
+SET @@global.wsrep_slave_uk_checks=ON;
+SELECT @@global.wsrep_slave_uk_checks;
+@@global.wsrep_slave_uk_checks
+1
+
+# valid values
+SET @@global.wsrep_slave_uk_checks='OFF';
+SELECT @@global.wsrep_slave_uk_checks;
+@@global.wsrep_slave_uk_checks
+0
+SET @@global.wsrep_slave_uk_checks=ON;
+SELECT @@global.wsrep_slave_uk_checks;
+@@global.wsrep_slave_uk_checks
+1
+SET @@global.wsrep_slave_uk_checks=default;
+SELECT @@global.wsrep_slave_uk_checks;
+@@global.wsrep_slave_uk_checks
+0
+
+# invalid values
+SET @@global.wsrep_slave_uk_checks=NULL;
+ERROR 42000: Variable 'wsrep_slave_UK_checks' can't be set to the value of 'NULL'
+SET @@global.wsrep_slave_uk_checks='junk';
+ERROR 42000: Variable 'wsrep_slave_UK_checks' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_slave_uk_checks = @wsrep_slave_uk_checks_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_sst_auth_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sst_auth_basic.result
new file mode 100644
index 00000000000..e6b532c6bba
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_sst_auth_basic.result
@@ -0,0 +1,52 @@
+#
+# wsrep_sst_auth
+#
+# save the initial value
+SET @wsrep_sst_auth_global_saved = @@global.wsrep_sst_auth;
+# default
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+NULL
+
+# scope
+SELECT @@session.wsrep_sst_auth;
+ERROR HY000: Variable 'wsrep_sst_auth' is a GLOBAL variable
+SET @@global.wsrep_sst_auth='user:pass';
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+********
+
+# valid values
+SET @@global.wsrep_sst_auth=user;
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+********
+SET @@global.wsrep_sst_auth='user:1234';
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+********
+SET @@global.wsrep_sst_auth='hyphenated-user-name:';
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+********
+SET @@global.wsrep_sst_auth=default;
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+NULL
+SET @@global.wsrep_sst_auth=NULL;
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+NULL
+
+# invalid values
+SET @@global.wsrep_sst_auth=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_sst_auth'
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+NULL
+SET @@global.wsrep_sst_auth=user:pass;
+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 ':pass' at line 1
+
+# restore the initial value
+SET @@global.wsrep_sst_auth = @wsrep_sst_auth_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result
new file mode 100644
index 00000000000..3d4fc24df7f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result
@@ -0,0 +1,50 @@
+#
+# wsrep_sst_donor
+#
+# save the initial value
+SET @wsrep_sst_donor_global_saved = @@global.wsrep_sst_donor;
+# default
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+
+
+# scope
+SELECT @@session.wsrep_sst_donor;
+ERROR HY000: Variable 'wsrep_sst_donor' is a GLOBAL variable
+SET @@global.wsrep_sst_donor=rsync;
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+rsync
+
+# valid values
+SET @@global.wsrep_sst_donor=node1;
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+node1
+SET @@global.wsrep_sst_donor='node1,node2';
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+node1,node2
+SET @@global.wsrep_sst_donor='hyphenated-donor-name';
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+hyphenated-donor-name
+SET @@global.wsrep_sst_donor=default;
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+
+SET @@global.wsrep_sst_donor=NULL;
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+NULL
+
+# invalid values
+SET @@global.wsrep_sst_donor=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_sst_donor'
+SELECT @@global.wsrep_sst_donor;
+@@global.wsrep_sst_donor
+NULL
+
+# restore the initial value
+SET @@global.wsrep_sst_donor = @wsrep_sst_donor_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_sst_donor_rejects_queries_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sst_donor_rejects_queries_basic.result
new file mode 100644
index 00000000000..c9f95beec0a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_sst_donor_rejects_queries_basic.result
@@ -0,0 +1,45 @@
+#
+# wsrep_sst_donor_rejects_queries
+#
+# save the initial value
+SET @wsrep_sst_donor_rejects_queries_global_saved = @@global.wsrep_sst_donor_rejects_queries;
+# default
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+@@global.wsrep_sst_donor_rejects_queries
+0
+
+# scope
+SELECT @@session.wsrep_sst_donor_rejects_queries;
+ERROR HY000: Variable 'wsrep_sst_donor_rejects_queries' is a GLOBAL variable
+SET @@global.wsrep_sst_donor_rejects_queries=OFF;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+@@global.wsrep_sst_donor_rejects_queries
+0
+SET @@global.wsrep_sst_donor_rejects_queries=ON;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+@@global.wsrep_sst_donor_rejects_queries
+1
+
+# valid values
+SET @@global.wsrep_sst_donor_rejects_queries='OFF';
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+@@global.wsrep_sst_donor_rejects_queries
+0
+SET @@global.wsrep_sst_donor_rejects_queries=ON;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+@@global.wsrep_sst_donor_rejects_queries
+1
+SET @@global.wsrep_sst_donor_rejects_queries=default;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+@@global.wsrep_sst_donor_rejects_queries
+0
+
+# invalid values
+SET @@global.wsrep_sst_donor_rejects_queries=NULL;
+ERROR 42000: Variable 'wsrep_sst_donor_rejects_queries' can't be set to the value of 'NULL'
+SET @@global.wsrep_sst_donor_rejects_queries='junk';
+ERROR 42000: Variable 'wsrep_sst_donor_rejects_queries' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_sst_donor_rejects_queries = @wsrep_sst_donor_rejects_queries_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_sst_method_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sst_method_basic.result
new file mode 100644
index 00000000000..cbdac640c36
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_sst_method_basic.result
@@ -0,0 +1,54 @@
+#
+# wsrep_sst_method
+#
+# save the initial value
+SET @wsrep_sst_method_global_saved = @@global.wsrep_sst_method;
+# default
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+rsync
+
+# scope
+SELECT @@session.wsrep_sst_method;
+ERROR HY000: Variable 'wsrep_sst_method' is a GLOBAL variable
+SET @@global.wsrep_sst_method=rsync;
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+rsync
+
+# valid values
+SET @@global.wsrep_sst_method=rsync;
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+rsync
+SET @@global.wsrep_sst_method=mysqldump;
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+mysqldump
+SET @@global.wsrep_sst_method=xtrabackup;
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+xtrabackup
+SET @@global.wsrep_sst_method="xtrabackup-v2";
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+xtrabackup-v2
+SET @@global.wsrep_sst_method=default;
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+rsync
+SET @@global.wsrep_sst_method='junk';
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+junk
+
+# invalid values
+SET @@global.wsrep_sst_method=NULL;
+ERROR 42000: Variable 'wsrep_sst_method' can't be set to the value of 'NULL'
+SELECT @@global.wsrep_sst_method;
+@@global.wsrep_sst_method
+junk
+
+# restore the initial value
+SET @@global.wsrep_sst_method = @wsrep_sst_method_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_sst_receive_address_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sst_receive_address_basic.result
new file mode 100644
index 00000000000..6db52eb8150
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_sst_receive_address_basic.result
@@ -0,0 +1,64 @@
+#
+# wsrep_sst_receive_address
+#
+# save the initial value
+SET @wsrep_sst_receive_address_global_saved = @@global.wsrep_sst_receive_address;
+# default
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+AUTO
+
+# scope
+SELECT @@session.wsrep_sst_receive_address;
+ERROR HY000: Variable 'wsrep_sst_receive_address' is a GLOBAL variable
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+AUTO
+
+# valid values
+SET @@global.wsrep_sst_receive_address=AUTO;
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+AUTO
+SET @@global.wsrep_sst_receive_address=default;
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+AUTO
+SET @@global.wsrep_sst_receive_address='192.168.2.254';
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+192.168.2.254
+
+# invalid values
+SET @@global.wsrep_sst_receive_address='127.0.0.1:4444';
+ERROR 42000: Variable 'wsrep_sst_receive_address' can't be set to the value of '127.0.0.1:4444'
+SET @@global.wsrep_sst_receive_address='127.0.0.1';
+ERROR 42000: Variable 'wsrep_sst_receive_address' can't be set to the value of '127.0.0.1'
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+192.168.2.254
+SET @@global.wsrep_sst_receive_address=NULL;
+ERROR 42000: Variable 'wsrep_sst_receive_address' can't be set to the value of 'NULL'
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+192.168.2.254
+SET @@global.wsrep_sst_receive_address='OFF';
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+OFF
+SET @@global.wsrep_sst_receive_address=ON;
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+ON
+SET @@global.wsrep_sst_receive_address='';
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+
+SET @@global.wsrep_sst_receive_address='junk';
+SELECT @@global.wsrep_sst_receive_address;
+@@global.wsrep_sst_receive_address
+junk
+
+# restore the initial value
+SET @@global.wsrep_sst_receive_address = @wsrep_sst_receive_address_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result b/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result
new file mode 100644
index 00000000000..a49e6135d47
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result
@@ -0,0 +1,57 @@
+#
+# wsrep_start_position
+#
+# save the initial value
+SET @wsrep_start_position_global_saved = @@global.wsrep_start_position;
+# default
+SELECT @@global.wsrep_start_position;
+@@global.wsrep_start_position
+00000000-0000-0000-0000-000000000000:-1
+
+# scope
+SELECT @@session.wsrep_start_position;
+ERROR HY000: Variable 'wsrep_start_position' is a GLOBAL variable
+SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-1';
+SELECT @@global.wsrep_start_position;
+@@global.wsrep_start_position
+00000000-0000-0000-0000-000000000000:-1
+
+# valid values
+SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2';
+SELECT @@global.wsrep_start_position;
+@@global.wsrep_start_position
+00000000-0000-0000-0000-000000000000:-2
+SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100';
+SELECT @@global.wsrep_start_position;
+@@global.wsrep_start_position
+12345678-1234-1234-1234-123456789012:100
+SET @@global.wsrep_start_position=default;
+SELECT @@global.wsrep_start_position;
+@@global.wsrep_start_position
+00000000-0000-0000-0000-000000000000:-1
+
+# invalid values
+SET @@global.wsrep_start_position='000000000000000-0000-0000-0000-000000000000:-1';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '000000000000000-0000-0000-0000-000000000000:-1'
+SET @@global.wsrep_start_position='12345678-1234-1234-12345-123456789012:100';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-12345-123456789012:100'
+SET @@global.wsrep_start_position='12345678-1234-123-12345-123456789012:0';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-123-12345-123456789012:0'
+SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:_99999';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:_99999'
+SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:a';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:a'
+SET @@global.wsrep_start_position='OFF';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'OFF'
+SET @@global.wsrep_start_position=ON;
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'ON'
+SET @@global.wsrep_start_position='';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of ''
+SET @@global.wsrep_start_position=NULL;
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'NULL'
+SET @@global.wsrep_start_position='junk';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'junk'
+
+# restore the initial value
+SET @@global.wsrep_start_position = @wsrep_start_position_global_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result
new file mode 100644
index 00000000000..0df3dff8990
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result
@@ -0,0 +1,54 @@
+#
+# wsrep_sync_wait
+#
+# save the initial values
+SET @wsrep_sync_wait_global_saved = @@global.wsrep_sync_wait;
+SET @wsrep_sync_wait_session_saved = @@session.wsrep_sync_wait;
+# default
+SELECT @@global.wsrep_sync_wait;
+@@global.wsrep_sync_wait
+0
+SELECT @@session.wsrep_sync_wait;
+@@session.wsrep_sync_wait
+0
+
+# scope and valid values
+SET @@global.wsrep_sync_wait=0;
+SELECT @@global.wsrep_sync_wait;
+@@global.wsrep_sync_wait
+0
+SET @@global.wsrep_sync_wait=7;
+SELECT @@global.wsrep_sync_wait;
+@@global.wsrep_sync_wait
+7
+SET @@session.wsrep_sync_wait=0;
+SELECT @@session.wsrep_sync_wait;
+@@session.wsrep_sync_wait
+0
+SET @@session.wsrep_sync_wait=7;
+SELECT @@session.wsrep_sync_wait;
+@@session.wsrep_sync_wait
+7
+SET @@session.wsrep_sync_wait=default;
+SELECT @@session.wsrep_sync_wait;
+@@session.wsrep_sync_wait
+7
+SET @@session.wsrep_sync_wait=8;
+SELECT @@session.wsrep_sync_wait;
+@@session.wsrep_sync_wait
+8
+
+# invalid values
+SET @@global.wsrep_sync_wait=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
+SET @@global.wsrep_sync_wait='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
+SET @@session.wsrep_sync_wait=NULL;
+ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
+SET @@session.wsrep_sync_wait='junk';
+ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
+
+# restore the initial values
+SET @@global.wsrep_sync_wait = @wsrep_sync_wait_global_saved;
+SET @@session.wsrep_sync_wait = @wsrep_sync_wait_session_saved;
+# End of test
diff --git a/mysql-test/suite/sys_vars/t/aria_encrypt_tables_basic.test b/mysql-test/suite/sys_vars/t/aria_encrypt_tables_basic.test
new file mode 100644
index 00000000000..2db0708e925
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_encrypt_tables_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_encrypt_tables;
+
+#
+# exists as global only
+#
+select @@global.aria_encrypt_tables;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_encrypt_tables;
+show global variables like 'aria_encrypt_tables';
+show session variables like 'aria_encrypt_tables';
+select * from information_schema.global_variables
+where variable_name='aria_encrypt_tables';
+select * from information_schema.session_variables
+where variable_name='aria_encrypt_tables';
+
+#
+# show that it's writable
+#
+set global aria_encrypt_tables=ON;
+select @@global.aria_encrypt_tables;
+set global aria_encrypt_tables=OFF;
+select @@global.aria_encrypt_tables;
+set global aria_encrypt_tables=1;
+select @@global.aria_encrypt_tables;
+--error ER_GLOBAL_VARIABLE
+set session aria_encrypt_tables=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_encrypt_tables=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_encrypt_tables=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_encrypt_tables="foo";
+
+SET @@global.aria_encrypt_tables = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/binlog_row_image_basic.test b/mysql-test/suite/sys_vars/t/binlog_row_image_basic.test
new file mode 100644
index 00000000000..6f5095b6a5d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_row_image_basic.test
@@ -0,0 +1,129 @@
+################## mysql-test\t\binlog_row_image_basic.test ###################
+# #
+# Variable Name: binlog_row_image #
+# Scope: Global & Session #
+# Access Type: Static #
+# Data Type: enumeration #
+# #
+# #
+# Creation Date: 2010-05-20 #
+# Author : Luis Soares #
+# #
+# #
+# Description:Test Cases of Dynamic System Variable binlog_row_image #
+# that checks the behavior of this variable in the following ways #
+# * Value Check #
+# * Scope Check #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.X/en/server-system-variables.html #
+# #
+###############################################################################
+
+
+SELECT @@GLOBAL.binlog_row_image;
+SELECT @@SESSION.binlog_row_image;
+--echo FULL Expected
+
+--echo '#---------------------BS_STVARS_002_01----------------------#'
+####################################################################
+# Displaying default value #
+####################################################################
+SET @start_value= @@global.binlog_row_image;
+
+SELECT COUNT(@@GLOBAL.binlog_row_image);
+--echo 1 Expected
+
+SELECT COUNT(@@SESSION.binlog_row_image);
+--echo 1 Expected
+
+--echo '#---------------------BS_STVARS_002_02----------------------#'
+####################################################################
+# Check if Value can set #
+####################################################################
+SET @@GLOBAL.binlog_row_image=0;
+SELECT @@GLOBAL.binlog_row_image;
+--echo MINIMAL Expected
+
+SET @@SESSION.binlog_row_image=0;
+SELECT @@SESSION.binlog_row_image;
+--echo MINIMAL Expected
+
+SET @@GLOBAL.binlog_row_image=1;
+SELECT @@GLOBAL.binlog_row_image;
+--echo NOBLOB Expected
+
+SET @@SESSION.binlog_row_image=1;
+SELECT @@SESSION.binlog_row_image;
+--echo NOBLOB Expected
+
+SET @@GLOBAL.binlog_row_image=2;
+SELECT @@GLOBAL.binlog_row_image;
+--echo FULL Expected
+
+SET @@SESSION.binlog_row_image=2;
+SELECT @@SESSION.binlog_row_image;
+--echo FULL Expected
+
+--echo '#---------------------BS_STVARS_002_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+--disable_warnings
+SELECT @@GLOBAL.binlog_row_image = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+--enable_warnings
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.binlog_row_image);
+--echo 1 Expected
+
+--disable_warnings
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+--enable_warnings
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_002_04----------------------#'
+#################################################################
+# Check if the value in SESSION Table matches value in variable #
+#################################################################
+
+--disable_warnings
+SELECT @@SESSION.binlog_row_image = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+--enable_warnings
+--echo 1 Expected
+
+SELECT COUNT(@@SESSION.binlog_row_image);
+--echo 1 Expected
+
+--disable_warnings
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='binlog_row_image';
+--enable_warnings
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_002_05----------------------#'
+################################################################################
+# Check if binlog_row_image can be accessed with and without @@ sign #
+################################################################################
+
+SELECT COUNT(@@binlog_row_image);
+--echo 1 Expected
+SELECT COUNT(@@local.binlog_row_image);
+--echo 1 Expected
+SELECT COUNT(@@SESSION.binlog_row_image);
+--echo 1 Expected
+SELECT COUNT(@@GLOBAL.binlog_row_image);
+--echo 1 Expected
+
+SET @@global.binlog_row_image= @start_value;
+
diff --git a/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test b/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
deleted file mode 100644
index 435a6c33341..00000000000
--- a/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
+++ /dev/null
@@ -1,46 +0,0 @@
---source include/have_debug.inc
-# ulong global
-
-SET @start_global_value = @@global.debug_crc_break;
-
-#
-# exists as global only
-#
-select @@global.debug_crc_break;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.debug_crc_break;
-show global variables like 'debug_crc_break';
-show session variables like 'debug_crc_break';
-select * from information_schema.global_variables where variable_name='debug_crc_break';
-select * from information_schema.session_variables where variable_name='debug_crc_break';
-
-#
-# show that it's writable
-#
-set global debug_crc_break=1;
-select @@global.debug_crc_break;
---error ER_GLOBAL_VARIABLE
-set session debug_crc_break=1;
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-set global debug_crc_break=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global debug_crc_break=1e1;
---error ER_WRONG_TYPE_FOR_VAR
-set global debug_crc_break="foo";
-
-#
-# min/max values
-#
-set global debug_crc_break=0;
-select @@global.debug_crc_break;
---disable_warnings
-set global debug_crc_break=cast(-1 as unsigned int);
---enable_warnings
---replace_result 4294967295 18446744073709551615
-select @@global.debug_crc_break;
-
-SET @@global.debug_crc_break = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/debug_mutex_deadlock_detector_basic.test b/mysql-test/suite/sys_vars/t/debug_mutex_deadlock_detector_basic.test
new file mode 100644
index 00000000000..12b29a309bb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/debug_mutex_deadlock_detector_basic.test
@@ -0,0 +1,23 @@
+--source include/have_mutex_deadlock_detector.inc
+
+# bool readonly
+
+#
+# show the global and session values;
+#
+select @@global.debug_mutex_deadlock_detector;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.debug_mutex_deadlock_detector;
+show global variables like 'debug_mutex_deadlock_detector';
+show session variables like 'debug_mutex_deadlock_detector';
+select * from information_schema.global_variables where variable_name='debug_mutex_deadlock_detector';
+select * from information_schema.session_variables where variable_name='debug_mutex_deadlock_detector';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global debug_mutex_deadlock_detector=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session debug_mutex_deadlock_detector=1;
+
diff --git a/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_basic.test b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_basic.test
new file mode 100644
index 00000000000..26512cc3938
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_basic.test
@@ -0,0 +1,193 @@
+######################################################################
+# START OF default_tmp_storage_engine TESTS #
+######################################################################
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.default_tmp_storage_engine;
+SELECT @start_global_value;
+SET @start_session_value = @@session.default_tmp_storage_engine;
+SELECT @start_session_value;
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+######################################################################
+# Display the DEFAULT value of default_tmp_storage_engine #
+######################################################################
+
+SET @@global.default_tmp_storage_engine = MEMORY;
+SET @@global.default_tmp_storage_engine = DEFAULT;
+SELECT @@global.default_tmp_storage_engine;
+
+SET @@session.default_tmp_storage_engine = MEMORY;
+SET @@session.default_tmp_storage_engine = DEFAULT;
+SELECT @@session.default_tmp_storage_engine;
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+# Change the value of default_tmp_storage_engine to a valid value for GLOBAL Scope #
+########################################################################
+
+SET @@global.default_tmp_storage_engine = MYISAM;
+SELECT @@global.default_tmp_storage_engine;
+SET @@global.default_tmp_storage_engine = MERGE;
+SELECT @@global.default_tmp_storage_engine;
+SET @@global.default_tmp_storage_engine = MEMORY;
+SELECT @@global.default_tmp_storage_engine;
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+#########################################################################
+# Change the value of default_tmp_storage_engine to a valid value for SESSION Scope #
+#########################################################################
+
+SET @@session.default_tmp_storage_engine = MYISAM;
+SELECT @@session.default_tmp_storage_engine;
+SET @@session.default_tmp_storage_engine = MERGE;
+SELECT @@session.default_tmp_storage_engine;
+SET @@session.default_tmp_storage_engine = MEMORY;
+SELECT @@session.default_tmp_storage_engine;
+
+--echo '#------------------FN_DYNVARS_005_04-----------------------#'
+##################################################################
+# Change the value of default_tmp_storage_engine to an invalid value #
+##################################################################
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_tmp_storage_engine = 8199;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_tmp_storage_engine = -1024;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_tmp_storage_engine = 65530.34;
+
+--Error ER_UNKNOWN_STORAGE_ENGINE
+SET @@global.default_tmp_storage_engine = FILE;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.default_tmp_storage_engine = 8199;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.default_tmp_storage_engine = 65530.34;
+
+--Error ER_UNKNOWN_STORAGE_ENGINE
+SET @@session.default_tmp_storage_engine = RECORD;
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+
+
+SELECT @@global.default_tmp_storage_engine =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='default_tmp_storage_engine';
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+
+SELECT @@session.default_tmp_storage_engine =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+ WHERE VARIABLE_NAME='default_tmp_storage_engine';
+
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+# Check if TRUE and FALSE values can be used on variable #
+####################################################################
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_tmp_storage_engine = TRUE;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_tmp_storage_engine = FALSE;
+
+
+--echo '#---------------------FN_DYNVARS_001_8----------------------#'
+###############################################################
+# Check if accessing variable with SESSION,LOCAL and without #
+# SCOPE points to same session variable #
+###############################################################
+
+SET @@default_tmp_storage_engine = MYISAM;
+SELECT @@default_tmp_storage_engine = @@local.default_tmp_storage_engine;
+SELECT @@local.default_tmp_storage_engine = @@session.default_tmp_storage_engine;
+
+
+--echo '#---------------------FN_DYNVARS_001_9----------------------#'
+#########################################################################
+# Check if default_tmp_storage_engine can be accessed with and without @@ sign #
+#########################################################################
+
+SET default_tmp_storage_engine = MEMORY;
+SELECT @@default_tmp_storage_engine;
+--Error ER_UNKNOWN_TABLE
+SELECT local.default_tmp_storage_engine;
+--Error ER_UNKNOWN_TABLE
+SELECT session.default_tmp_storage_engine;
+--Error ER_BAD_FIELD_ERROR
+SELECT default_tmp_storage_engine = @@session.default_tmp_storage_engine;
+
+# check the old obsolete name
+SET @@default_tmp_storage_engine = @start_global_value;
+
+SET default_tmp_storage_engine = MyISAM;
+SET default_storage_engine = MyISAM;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1, t2;
+
+SET default_storage_engine = MEMORY;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1, t2;
+
+# test default_tmp_storage_engine = NULL
+SET @@global.default_tmp_storage_engine = NULL;
+SET @@session.default_tmp_storage_engine = NULL;
+
+SET default_storage_engine = MEMORY;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1, t2;
+
+SET default_storage_engine = MYISAM;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1, t2;
+
+SET default_tmp_storage_engine = DEFAULT;
+SET default_storage_engine = DEFAULT;
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 (b INT);
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1, t2;
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.default_tmp_storage_engine = @start_global_value;
+SELECT @@global.default_tmp_storage_engine;
+SET @@session.default_tmp_storage_engine = @start_session_value;
+SELECT @@session.default_tmp_storage_engine;
+
+
+#############################################################
+# END OF default_tmp_storage_engine TESTS #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt b/mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
index a449c0fb964..06d4d5aa154 100644
--- a/mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
@@ -1,2 +1,2 @@
---myisam-recover=BACKUP,FORCE
+--myisam-recover-options=BACKUP,FORCE
diff --git a/mysql-test/suite/sys_vars/t/delay_key_write_func.test b/mysql-test/suite/sys_vars/t/delay_key_write_func.test
index a44b37653d2..e823e51954c 100644
--- a/mysql-test/suite/sys_vars/t/delay_key_write_func.test
+++ b/mysql-test/suite/sys_vars/t/delay_key_write_func.test
@@ -20,36 +20,14 @@
###############################################################################
--echo '#--------------------FN_DYNVARS_023_01-------------------------#'
-#######################################################################
-# Check if setting delay_key_write is changed in every new connection #
-#######################################################################
-
SET @start_value= @@global.delay_key_write;
-SET @@global.delay_key_write = ON;
-SELECT @@global.delay_key_write;
-
---echo 'connect (user1,localhost,root,,,,)'
-connect (user1,localhost,root,,,,);
---echo 'connection user1'
-connection user1;
-SELECT @@global.delay_key_write AS res_is_ON;
-SET @@global.delay_key_write = ALL;
-disconnect user1;
-
---echo 'connect (user1,localhost,root,,,,)'
-connect (user1,localhost,root,,,,);
---echo 'connection user1'
-connection user1;
-SELECT @@global.delay_key_write AS res_is_ALL;
-
--echo '#--------------------FN_DYNVARS_023_02-------------------------#'
######################################################
# Begin the functionality Testing of delay_key_write #
######################################################
# create procedure to add rows
---disable_query_log
DELIMITER //;
CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT)
BEGIN
@@ -59,28 +37,19 @@ BEGIN
END WHILE;
END//
DELIMITER ;//
---enable_query_log
#==============================================================================
--echo '---check when delay_key_write is OFF---'
#==============================================================================
-
SET @@global.delay_key_write = OFF;
-
---disable_query_log
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
# create a table with delay_key_write enabled
CREATE TABLE t1(
a INT PRIMARY KEY,
b VARCHAR(512),
c DOUBLE
) DELAY_KEY_WRITE = 1;
---enable_query_log
-
FLUSH STATUS;
@@ -90,6 +59,7 @@ SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests';
SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
#==============================================================================
--echo '----check when delay_key_write is ON---'
@@ -97,17 +67,12 @@ SELECT COUNT(*) FROM t1;
SET @@global.delay_key_write = ON;
---disable_query_log
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
# create a table with delay_key_write enabled
CREATE TABLE t1(
a INT PRIMARY KEY,
b VARCHAR(512),
c DOUBLE
) DELAY_KEY_WRITE = 1;
---enable_query_log
FLUSH STATUS;
CALL sp_addRecords(1,10);
@@ -116,23 +81,19 @@ SHOW STATUS LIKE 'Key_reads';
SHOW STATUS LIKE 'Key_writes';
SHOW STATUS LIKE 'Key_write_requests';
SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
#==============================================================================
--echo '----check when delay_key_write is ALL---'
#==============================================================================
SET @@global.delay_key_write = ALL;
---disable_query_log
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
# create a table with delay_key_write disabled
CREATE TABLE t1(
a INT PRIMARY KEY,
b VARCHAR(512),
c DOUBLE
) DELAY_KEY_WRITE = 0;
---enable_query_log
FLUSH STATUS;
CALL sp_addRecords(1,10);
@@ -144,12 +105,9 @@ SELECT COUNT(*) FROM t1;
DROP PROCEDURE sp_addRecords;
DROP TABLE t1;
-disconnect user1;
-connection default;
SET @@global.delay_key_write= @start_value;
####################################################
# End of functionality testing for delay_key_write #
####################################################
-
diff --git a/mysql-test/suite/sys_vars/t/encrypt_tmp_disk_tables_basic.test b/mysql-test/suite/sys_vars/t/encrypt_tmp_disk_tables_basic.test
new file mode 100644
index 00000000000..ee01e6d8ba4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/encrypt_tmp_disk_tables_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.encrypt_tmp_disk_tables;
+
+#
+# exists as global only
+#
+select @@global.encrypt_tmp_disk_tables;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.encrypt_tmp_disk_tables;
+show global variables like 'encrypt_tmp_disk_tables';
+show session variables like 'encrypt_tmp_disk_tables';
+select * from information_schema.global_variables
+where variable_name='encrypt_tmp_disk_tables';
+select * from information_schema.session_variables
+where variable_name='encrypt_tmp_disk_tables';
+
+#
+# show that it's writable
+#
+set global encrypt_tmp_disk_tables=ON;
+select @@global.encrypt_tmp_disk_tables;
+set global encrypt_tmp_disk_tables=OFF;
+select @@global.encrypt_tmp_disk_tables;
+set global encrypt_tmp_disk_tables=1;
+select @@global.encrypt_tmp_disk_tables;
+--error ER_GLOBAL_VARIABLE
+set session encrypt_tmp_disk_tables=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global encrypt_tmp_disk_tables=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global encrypt_tmp_disk_tables=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global encrypt_tmp_disk_tables="foo";
+
+SET @@global.encrypt_tmp_disk_tables = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/enforce_storage_engine_basic.test b/mysql-test/suite/sys_vars/t/enforce_storage_engine_basic.test
new file mode 100644
index 00000000000..62627a1e5ca
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/enforce_storage_engine_basic.test
@@ -0,0 +1,40 @@
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+SET @start_session_value = @@session.enforce_storage_engine;
+
+SET @@session.enforce_storage_engine = INNODB;
+SET @@session.enforce_storage_engine = DEFAULT;
+
+SELECT @@session.enforce_storage_engine;
+
+SET @@session.enforce_storage_engine = MYISAM;
+SELECT @@session.enforce_storage_engine;
+SET @@session.enforce_storage_engine = MERGE;
+SELECT @@session.enforce_storage_engine;
+SET @@session.enforce_storage_engine = MEMORY;
+SELECT @@session.enforce_storage_engine;
+SET @@session.enforce_storage_engine = INNODB;
+SELECT @@session.enforce_storage_engine;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.enforce_storage_engine = 8199;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.enforce_storage_engine = 65530.34;
+
+--Error ER_UNKNOWN_STORAGE_ENGINE
+SET @@session.enforce_storage_engine = RECORD;
+
+SELECT @@session.enforce_storage_engine =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+ WHERE VARIABLE_NAME='enforce_storage_engine';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.enforce_storage_engine = TRUE;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.enforce_storage_engine = FALSE;
+
+SET @@session.enforce_storage_engine = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test
new file mode 100644
index 00000000000..da451aec610
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test
@@ -0,0 +1,26 @@
+#
+# show the global and session values;
+#
+select @@global.explicit_defaults_for_timestamp;
+
+#
+# Test that it's a global-only variable
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.explicit_defaults_for_timestamp;
+
+show global variables like 'explicit_defaults_for_timestamp';
+show session variables like 'explicit_defaults_for_timestamp';
+
+--disable_warnings
+select * from information_schema.global_variables where variable_name='explicit_defaults_for_timestamp';
+select * from information_schema.session_variables where variable_name='explicit_defaults_for_timestamp';
+--enable_warnings
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global explicit_defaults_for_timestamp=true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session explicit_defaults_for_timestamp=true;
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test
new file mode 100644
index 00000000000..2159b7cb6a8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test
@@ -0,0 +1,8 @@
+--disable_query_log
+if (`SELECT @@explicit_defaults_for_timestamp`)
+{
+ Skip Need explicit-defaults-for-timestamp=off;
+}
+--enable_query_log
+
+--source inc/explicit_defaults_for_timestamp.inc
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt
new file mode 100644
index 00000000000..b84d51e2ad1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt
@@ -0,0 +1 @@
+--explicit-defaults-for-timestamp=on
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test
new file mode 100644
index 00000000000..5c03eaa28de
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test
@@ -0,0 +1,8 @@
+--disable_query_log
+if (!`SELECT @@explicit_defaults_for_timestamp`)
+{
+ Skip Need explicit-defaults-for-timestamp=on;
+}
+--enable_query_log
+
+--source inc/explicit_defaults_for_timestamp.inc
diff --git a/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt b/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt
index 30ee4f67284..03b94823278 100644
--- a/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt
+++ b/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt
@@ -1,11 +1,11 @@
---ignore-db-dir=a
---ignore-db-dir=b
---ignore-db-dir=c
---ignore-db-dir=
---ignore-db-dir=d
---ignore-db-dir x
---ignore-db-dir=
---ignore-db-dir=e
---ignore-db-dir=lost+found
---ignore-db-dir=.mysqlgui
---ignore-db-dir=ignored_db
+--ignore-db-dirs=a
+--ignore-db-dirs=b
+--ignore-db-dirs=c
+--ignore-db-dirs=
+--ignore-db-dirs=d
+--ignore-db-dirs x
+--ignore-db-dirs=
+--ignore-db-dirs=e
+--ignore-db-dirs=lost+found
+--ignore-db-dirs=.mysqlgui
+--ignore-db-dirs=ignored_db
diff --git a/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_check_interval_basic.test b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_check_interval_basic.test
new file mode 100644
index 00000000000..77c8671a1bc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_check_interval_basic.test
@@ -0,0 +1,54 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_background_scrub_data_check_interval;
+
+--echo #
+--echo # default value
+--echo #
+select @@global.innodb_background_scrub_data_check_interval;
+set global innodb_background_scrub_data_check_interval=10;
+select @@global.innodb_background_scrub_data_check_interval;
+set global innodb_background_scrub_data_check_interval=DEFAULT;
+select @@global.innodb_background_scrub_data_check_interval;
+set global innodb_background_scrub_data_check_interval=20;
+select @@global.innodb_background_scrub_data_check_interval;
+set global innodb_background_scrub_data_check_interval=DEFAULT;
+select @@global.innodb_background_scrub_data_check_interval;
+
+--echo #
+--echo # exists as global only
+--echo #
+select @@global.innodb_background_scrub_data_check_interval;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_background_scrub_data_check_interval;
+show global variables like 'innodb_background_scrub_data_check_interval';
+show session variables like 'innodb_background_scrub_data_check_interval';
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_check_interval';
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_check_interval';
+
+--echo #
+--echo # show that it's writable
+--echo #
+set global innodb_background_scrub_data_check_interval=10;
+select @@global.innodb_background_scrub_data_check_interval;
+set global innodb_background_scrub_data_check_interval=20;
+select @@global.innodb_background_scrub_data_check_interval;
+set global innodb_background_scrub_data_check_interval=1;
+select @@global.innodb_background_scrub_data_check_interval;
+--error ER_GLOBAL_VARIABLE
+set session innodb_background_scrub_data_check_interval=1;
+
+--echo #
+--echo # incorrect types
+--echo #
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_check_interval=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_check_interval=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_check_interval="foo";
+
+SET @@global.innodb_background_scrub_data_check_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_compressed_basic.test b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_compressed_basic.test
new file mode 100644
index 00000000000..fdf77bbb780
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_compressed_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_background_scrub_data_compressed;
+
+--echo #
+--echo # exists as global only
+--echo #
+select @@global.innodb_background_scrub_data_compressed;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_background_scrub_data_compressed;
+show global variables like 'innodb_background_scrub_data_compressed';
+show session variables like 'innodb_background_scrub_data_compressed';
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_compressed';
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_compressed';
+
+--echo #
+--echo # show that it's writable
+--echo #
+set global innodb_background_scrub_data_compressed=ON;
+select @@global.innodb_background_scrub_data_compressed;
+set global innodb_background_scrub_data_compressed=OFF;
+select @@global.innodb_background_scrub_data_compressed;
+set global innodb_background_scrub_data_compressed=1;
+select @@global.innodb_background_scrub_data_compressed;
+--error ER_GLOBAL_VARIABLE
+set session innodb_background_scrub_data_compressed=1;
+
+--echo #
+--echo # incorrect types
+--echo #
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_compressed=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_compressed=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_background_scrub_data_compressed="foo";
+
+SET @@global.innodb_background_scrub_data_compressed = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_interval_basic.test b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_interval_basic.test
new file mode 100644
index 00000000000..9f1187a97ff
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_interval_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_background_scrub_data_interval;
+
+--echo #
+--echo # exists as global only
+--echo #
+select @@global.innodb_background_scrub_data_interval;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_background_scrub_data_interval;
+show global variables like 'innodb_background_scrub_data_interval';
+show session variables like 'innodb_background_scrub_data_interval';
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_interval';
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_interval';
+
+--echo #
+--echo # show that it's writable
+--echo #
+set global innodb_background_scrub_data_interval=100;
+select @@global.innodb_background_scrub_data_interval;
+set global innodb_background_scrub_data_interval=200;
+select @@global.innodb_background_scrub_data_interval;
+set global innodb_background_scrub_data_interval=300;
+select @@global.innodb_background_scrub_data_interval;
+--error ER_GLOBAL_VARIABLE
+set session innodb_background_scrub_data_interval=400;
+
+--echo #
+--echo # incorrect types
+--echo #
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_interval=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_interval=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_interval="foo";
+
+SET @@global.innodb_background_scrub_data_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_uncompressed_basic.test b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_uncompressed_basic.test
new file mode 100644
index 00000000000..76d6535ad81
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_background_scrub_data_uncompressed_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_background_scrub_data_uncompressed;
+
+--echo #
+--echo # exists as global only
+--echo #
+select @@global.innodb_background_scrub_data_uncompressed;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_background_scrub_data_uncompressed;
+show global variables like 'innodb_background_scrub_data_uncompressed';
+show session variables like 'innodb_background_scrub_data_uncompressed';
+select * from information_schema.global_variables
+where variable_name='innodb_background_scrub_data_uncompressed';
+select * from information_schema.session_variables
+where variable_name='innodb_background_scrub_data_uncompressed';
+
+--echo #
+--echo # show that it's writable
+--echo #
+set global innodb_background_scrub_data_uncompressed=ON;
+select @@global.innodb_background_scrub_data_uncompressed;
+set global innodb_background_scrub_data_uncompressed=OFF;
+select @@global.innodb_background_scrub_data_uncompressed;
+set global innodb_background_scrub_data_uncompressed=1;
+select @@global.innodb_background_scrub_data_uncompressed;
+--error ER_GLOBAL_VARIABLE
+set session innodb_background_scrub_data_uncompressed=1;
+
+--echo #
+--echo # incorrect types
+--echo #
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_uncompressed=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_background_scrub_data_uncompressed=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_background_scrub_data_uncompressed="foo";
+
+SET @@global.innodb_background_scrub_data_uncompressed = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buf_dump_status_frequency_basic.test b/mysql-test/suite/sys_vars/t/innodb_buf_dump_status_frequency_basic.test
new file mode 100644
index 00000000000..c505fbbd3b1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buf_dump_status_frequency_basic.test
@@ -0,0 +1,39 @@
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+SET @start_innodb_buf_dump_status_frequency = @@global.innodb_buf_dump_status_frequency;
+SELECT @start_innodb_buf_dump_status_frequency;
+
+SELECT COUNT(@@global.innodb_buf_dump_status_frequency);
+
+# test valid value
+SET @@global.innodb_buf_dump_status_frequency = 20;
+SELECT @@global.innodb_buf_dump_status_frequency;
+
+# test valid min
+SET @@global.innodb_buf_dump_status_frequency = 0;
+SELECT @@global.innodb_buf_dump_status_frequency;
+
+# test valid max
+SET @@global.innodb_buf_dump_status_frequency = 100;
+SELECT @@global.innodb_buf_dump_status_frequency;
+
+# test invalid value < min
+SET @@global.innodb_buf_dump_status_frequency = -1;
+SELECT @@global.innodb_buf_dump_status_frequency;
+
+# test invalid value > max
+SET @@global.innodb_buf_dump_status_frequency = 101;
+SELECT @@global.innodb_buf_dump_status_frequency;
+
+# test wrong type
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_buf_dump_status_frequency = 10.5;
+SELECT @@global.innodb_buf_dump_status_frequency;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_buf_dump_status_frequency = "abc";
+SELECT @@global.innodb_buf_dump_status_frequency;
+
+SET @@global.innodb_buf_dump_status_frequency = @start_innodb_buf_dump_status_frequency;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test b/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
index bb0f3417f87..e7098b7e3b3 100644
--- a/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/not_encrypted.inc
# Check the default value
SET @orig = @@global.innodb_checksum_algorithm;
diff --git a/mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic-master.opt b/mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic-master.opt
new file mode 100644
index 00000000000..77db41721ca
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic-master.opt
@@ -0,0 +1 @@
+--innodb-compression-algorithm=1 \ No newline at end of file
diff --git a/mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic.test b/mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic.test
new file mode 100644
index 00000000000..6f09ced7dd5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_compression_algorithm_basic.test
@@ -0,0 +1,46 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_compression_algorithm;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.innodb_compression_algorithm;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_compression_algorithm;
+show global variables like 'innodb_compression_algorithm';
+show session variables like 'innodb_compression_algorithm';
+select * from information_schema.global_variables where variable_name='innodb_compression_algorithm';
+select * from information_schema.session_variables where variable_name='innodb_compression_algorithm';
+
+#
+# show that it's writable
+#
+set global innodb_compression_algorithm=1;
+select @@global.innodb_compression_algorithm;
+select * from information_schema.global_variables where variable_name='innodb_compression_algorithm';
+select * from information_schema.session_variables where variable_name='innodb_compression_algorithm';
+--error ER_GLOBAL_VARIABLE
+set session innodb_compression_algorithm=0;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_compression_algorithm=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_compression_algorithm=1e1;
+--error 1231
+set global innodb_compression_algorithm="foo";
+#
+# min/max values
+#
+set global innodb_compression_algorithm=0;
+select @@global.innodb_compression_algorithm;
+#
+# cleanup
+#
+
+SET @@global.innodb_compression_algorithm = @start_global_value;
+SELECT @@global.innodb_compression_algorithm;
diff --git a/mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test b/mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test
new file mode 100644
index 00000000000..cc00f0f6f3d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test
@@ -0,0 +1,42 @@
+# bool global
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+SET @start_global_value = @@global.innodb_debug_force_scrubbing;
+
+--echo #
+--echo # exists as global only
+--echo #
+select @@global.innodb_debug_force_scrubbing;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_debug_force_scrubbing;
+show global variables like 'innodb_debug_force_scrubbing';
+show session variables like 'innodb_debug_force_scrubbing';
+select * from information_schema.global_variables
+where variable_name='innodb_debug_force_scrubbing';
+select * from information_schema.session_variables
+where variable_name='innodb_debug_force_scrubbing';
+
+--echo #
+--echo # show that it's writable
+--echo #
+set global innodb_debug_force_scrubbing=ON;
+select @@global.innodb_debug_force_scrubbing;
+set global innodb_debug_force_scrubbing=OFF;
+select @@global.innodb_debug_force_scrubbing;
+set global innodb_debug_force_scrubbing=1;
+select @@global.innodb_debug_force_scrubbing;
+--error ER_GLOBAL_VARIABLE
+set session innodb_debug_force_scrubbing=1;
+
+--echo #
+--echo # incorrect types
+--echo #
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_debug_force_scrubbing=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_debug_force_scrubbing=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_debug_force_scrubbing="foo";
+
+SET @@global.innodb_debug_force_scrubbing = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_basic.test
new file mode 100644
index 00000000000..9667f63f687
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_defragment_basic.test
@@ -0,0 +1,20 @@
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_defragment;
+SELECT @orig;
+
+# Turn off
+SET GLOBAL innodb_defragment = OFF;
+SELECT @@global.innodb_defragment;
+
+# Turn on
+SET GLOBAL innodb_defragment = ON;
+SELECT @@global.innodb_defragment;
+
+# Wrong value
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_defragment = 100;
+SELECT @@global.innodb_defragment;
+
+SET GLOBAL innodb_defragment = @orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test
new file mode 100644
index 00000000000..ae9863e806a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test
@@ -0,0 +1,27 @@
+--source include/have_innodb.inc
+
+SET @start_innodb_defragment_fill_factor = @@global.innodb_defragment_fill_factor;
+SELECT @start_innodb_defragment_fill_factor;
+
+SELECT COUNT(@@global.innodb_defragment_fill_factor);
+
+SET @@global.innodb_defragment_fill_factor = 0.77777777777777;
+SELECT @@global.innodb_defragment_fill_factor;
+
+SET @@global.innodb_defragment_fill_factor = 1;
+SELECT @@global.innodb_defragment_fill_factor;
+
+SET @@global.innodb_defragment_fill_factor = 0.7;
+SELECT @@global.innodb_defragment_fill_factor;
+
+SET @@global.innodb_defragment_fill_factor = -1;
+SELECT @@global.innodb_defragment_fill_factor;
+
+SET @@global.innodb_defragment_fill_factor = 2;
+SELECT @@global.innodb_defragment_fill_factor;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_defragment_fill_factor = "abc";
+SELECT @@global.innodb_defragment_fill_factor;
+
+SET @@global.innodb_defragment_fill_factor = @start_innodb_defragment_fill_factor;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test
new file mode 100644
index 00000000000..366817c4bbc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test
@@ -0,0 +1,31 @@
+--source include/have_innodb.inc
+
+SET @start_innodb_defragment_fill_factor_n_recs = @@global.innodb_defragment_fill_factor_n_recs;
+SELECT @start_innodb_defragment_fill_factor_n_recs;
+
+SELECT COUNT(@@global.innodb_defragment_fill_factor_n_recs);
+
+SET @@global.innodb_defragment_fill_factor_n_recs = 50;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+
+SET @@global.innodb_defragment_fill_factor_n_recs = 100;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+
+SET @@global.innodb_defragment_fill_factor_n_recs = 1;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+
+SET @@global.innodb_defragment_fill_factor_n_recs = -1;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+
+SET @@global.innodb_defragment_fill_factor_n_recs = 10000;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_defragment_fill_factor_n_recs = 10.5;
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_defragment_fill_factor_n_recs = "abc";
+SELECT @@global.innodb_defragment_fill_factor_n_recs;
+
+SET @@global.innodb_defragment_fill_factor_n_recs = @start_innodb_defragment_fill_factor_n_recs;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test
new file mode 100644
index 00000000000..3ab45744a9c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test
@@ -0,0 +1,37 @@
+--source include/have_innodb.inc
+
+SET @start_innodb_defragment_frequency = @@global.innodb_defragment_frequency;
+SELECT @start_innodb_defragment_frequency;
+
+SELECT COUNT(@@global.innodb_defragment_frequency);
+
+# test valid value
+SET @@global.innodb_defragment_frequency = 200;
+SELECT @@global.innodb_defragment_frequency;
+
+# test valid min
+SET @@global.innodb_defragment_frequency = 1;
+SELECT @@global.innodb_defragment_frequency;
+
+# test valid max
+SET @@global.innodb_defragment_frequency = 1000;
+SELECT @@global.innodb_defragment_frequency;
+
+# test invalid value < min
+SET @@global.innodb_defragment_frequency = -1;
+SELECT @@global.innodb_defragment_frequency;
+
+# test invalid value > max
+SET @@global.innodb_defragment_frequency = 10000;
+SELECT @@global.innodb_defragment_frequency;
+
+# test wrong type
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_defragment_frequency = 10.5;
+SELECT @@global.innodb_defragment_frequency;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_defragment_frequency = "abc";
+SELECT @@global.innodb_defragment_frequency;
+
+SET @@global.innodb_defragment_frequency = @start_innodb_defragment_frequency;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test
new file mode 100644
index 00000000000..64aa20a615f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test
@@ -0,0 +1,22 @@
+--source include/have_innodb.inc
+
+SET @start_innodb_defragment_n_pages = @@global.innodb_defragment_n_pages;
+SELECT @start_innodb_defragment_n_pages;
+
+SELECT COUNT(@@global.innodb_defragment_n_pages);
+
+SET @@global.innodb_defragment_n_pages = 1;
+SELECT @@global.innodb_defragment_n_pages;
+
+SET @@global.innodb_defragment_n_pages = 2;
+SELECT @@global.innodb_defragment_n_pages;
+
+SET @@global.innodb_defragment_n_pages = 32;
+SELECT @@global.innodb_defragment_n_pages;
+
+SET @@global.innodb_defragment_n_pages = 64;
+SELECT @@global.innodb_defragment_n_pages;
+
+SET @@global.innodb_defragment_n_pages = @start_innodb_defragment_n_pages;
+
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test
new file mode 100644
index 00000000000..062753f27ea
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test
@@ -0,0 +1,24 @@
+--source include/have_innodb.inc
+
+SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
+SELECT @start_innodb_defragment_stats_accuracy;
+
+SELECT COUNT(@@global.innodb_defragment_stats_accuracy);
+
+SET @@global.innodb_defragment_stats_accuracy = 1;
+SELECT @@global.innodb_defragment_stats_accuracy;
+
+SET @@global.innodb_defragment_stats_accuracy = 1000;
+SELECT @@global.innodb_defragment_stats_accuracy;
+
+SET @@global.innodb_defragment_stats_accuracy = -1;
+SELECT @@global.innodb_defragment_stats_accuracy;
+
+SET @@global.innodb_defragment_stats_accuracy = 1000000000000;
+SELECT @@global.innodb_defragment_stats_accuracy;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_defragment_stats_accuracy = "abc";
+SELECT @@global.innodb_defragment_stats_accuracy;
+
+SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
diff --git a/mysql-test/suite/sys_vars/t/innodb_disallow_writes_basic.test b/mysql-test/suite/sys_vars/t/innodb_disallow_writes_basic.test
new file mode 100644
index 00000000000..b8e5c127377
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_disallow_writes_basic.test
@@ -0,0 +1,42 @@
+--source include/have_innodb_disallow_writes.inc
+
+--echo #
+--echo # innodb_disallow_writes
+--echo #
+
+--echo # save the initial value
+SET @innodb_disallow_writes_global_saved = @@global.innodb_disallow_writes;
+
+--echo # default
+SELECT @@global.innodb_disallow_writes;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_disallow_writes;
+SET @@global.innodb_disallow_writes=OFF;
+SELECT @@global.innodb_disallow_writes;
+SET @@global.innodb_disallow_writes=ON;
+SELECT @@global.innodb_disallow_writes;
+
+--echo
+--echo # valid values
+SET @@global.innodb_disallow_writes='OFF';
+SELECT @@global.innodb_disallow_writes;
+SET @@global.innodb_disallow_writes=ON;
+SELECT @@global.innodb_disallow_writes;
+SET @@global.innodb_disallow_writes=default;
+SELECT @@global.innodb_disallow_writes;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.innodb_disallow_writes=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.innodb_disallow_writes='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.innodb_disallow_writes = @innodb_disallow_writes_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/innodb_encrypt_log_basic.test b/mysql-test/suite/sys_vars/t/innodb_encrypt_log_basic.test
new file mode 100644
index 00000000000..775e8a3b944
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_encrypt_log_basic.test
@@ -0,0 +1,50 @@
+--source include/have_innodb.inc
+
+# Display default value
+SELECT @@GLOBAL.innodb_encrypt_log;
+--echo 0 Expected
+
+# Check if value can be set
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_encrypt_log=1;
+--echo Expected error 'Read only variable'
+
+SELECT @@GLOBAL.innodb_encrypt_log;
+--echo 0 Expected
+
+# Check if the value in GLOBAL TABLE matches value in variable
+SELECT IF(@@GLOBAL.innodb_encrypt_log, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_encrypt_log';
+--echo 1 Expected
+
+SELECT @@GLOBAL.innodb_encrypt_log;
+--echo 0 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_encrypt_log';
+--echo 0 Expected
+
+# Check if accessing variable with and without GLOBAL point to same variable
+SELECT @@innodb_encrypt_log = @@GLOBAL.innodb_encrypt_log;
+--echo 1 Expected
+
+# Check if innodb_encrypt_log can be accessed with and without @@ sign
+SELECT @@innodb_encrypt_log;
+--echo 0 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_encrypt_log);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_encrypt_log);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT @@GLOBAL.innodb_encrypt_log;
+--echo 0 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_encrypt_log;
+--echo Expected error 'Unknown column in field list'
diff --git a/mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test b/mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test
new file mode 100644
index 00000000000..555b67f2a28
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test
@@ -0,0 +1,44 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_encrypt_tables;
+
+#
+# exists as global only
+#
+select @@global.innodb_encrypt_tables;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_encrypt_tables;
+show global variables like 'innodb_encrypt_tables';
+show session variables like 'innodb_encrypt_tables';
+select * from information_schema.global_variables
+where variable_name='innodb_encrypt_tables';
+select * from information_schema.session_variables
+where variable_name='innodb_encrypt_tables';
+
+#
+# show that it's writable
+#
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_encrypt_tables=ON;
+show warnings;
+select @@global.innodb_encrypt_tables;
+set global innodb_encrypt_tables=OFF;
+select @@global.innodb_encrypt_tables;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_encrypt_tables=1;
+select @@global.innodb_encrypt_tables;
+--error ER_GLOBAL_VARIABLE
+set session innodb_encrypt_tables=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encrypt_tables=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encrypt_tables=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_encrypt_tables="foo";
+
+SET @@global.innodb_encrypt_tables = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_encryption_rotate_key_age_basic.test b/mysql-test/suite/sys_vars/t/innodb_encryption_rotate_key_age_basic.test
new file mode 100644
index 00000000000..51112886130
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_encryption_rotate_key_age_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_encryption_rotate_key_age;
+
+#
+# exists as global only
+#
+select @@global.innodb_encryption_rotate_key_age;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_encryption_rotate_key_age;
+show global variables like 'innodb_encryption_rotate_key_age';
+show session variables like 'innodb_encryption_rotate_key_age';
+select * from information_schema.global_variables
+where variable_name='innodb_encryption_rotate_key_age';
+select * from information_schema.session_variables
+where variable_name='innodb_encryption_rotate_key_age';
+
+#
+# show that it's writable
+#
+set global innodb_encryption_rotate_key_age=1;
+select @@global.innodb_encryption_rotate_key_age;
+set global innodb_encryption_rotate_key_age=2;
+select @@global.innodb_encryption_rotate_key_age;
+set global innodb_encryption_rotate_key_age=1;
+select @@global.innodb_encryption_rotate_key_age;
+--error ER_GLOBAL_VARIABLE
+set session innodb_encryption_rotate_key_age=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_rotate_key_age=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_rotate_key_age=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_rotate_key_age="foo";
+
+SET @@global.innodb_encryption_rotate_key_age = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_encryption_rotation_iops_basic.test b/mysql-test/suite/sys_vars/t/innodb_encryption_rotation_iops_basic.test
new file mode 100644
index 00000000000..cdbada6c5c8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_encryption_rotation_iops_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_encryption_rotation_iops;
+
+#
+# exists as global only
+#
+select @@global.innodb_encryption_rotation_iops;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_encryption_rotation_iops;
+show global variables like 'innodb_encryption_rotation_iops';
+show session variables like 'innodb_encryption_rotation_iops';
+select * from information_schema.global_variables
+where variable_name='innodb_encryption_rotation_iops';
+select * from information_schema.session_variables
+where variable_name='innodb_encryption_rotation_iops';
+
+#
+# show that it's writable
+#
+set global innodb_encryption_rotation_iops=100;
+select @@global.innodb_encryption_rotation_iops;
+set global innodb_encryption_rotation_iops=50;
+select @@global.innodb_encryption_rotation_iops;
+set global innodb_encryption_rotation_iops=100;
+select @@global.innodb_encryption_rotation_iops;
+--error ER_GLOBAL_VARIABLE
+set session innodb_encryption_rotation_iops=50;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_rotation_iops=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_rotation_iops=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_rotation_iops="foo";
+
+SET @@global.innodb_encryption_rotation_iops = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_encryption_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_encryption_threads_basic.test
new file mode 100644
index 00000000000..c3e163faef4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_encryption_threads_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_encryption_threads;
+
+#
+# exists as global only
+#
+select @@global.innodb_encryption_threads;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_encryption_threads;
+show global variables like 'innodb_encryption_threads';
+show session variables like 'innodb_encryption_threads';
+select * from information_schema.global_variables
+where variable_name='innodb_encryption_threads';
+select * from information_schema.session_variables
+where variable_name='innodb_encryption_threads';
+
+#
+# show that it's writable
+#
+set global innodb_encryption_threads=0;
+select @@global.innodb_encryption_threads;
+set global innodb_encryption_threads=5;
+select @@global.innodb_encryption_threads;
+set global innodb_encryption_threads=1;
+select @@global.innodb_encryption_threads;
+--error ER_GLOBAL_VARIABLE
+set session innodb_encryption_threads=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_threads=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_threads=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_encryption_threads="foo";
+
+SET @@global.innodb_encryption_threads = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold-master.opt b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold-master.opt
new file mode 100644
index 00000000000..51d18e632be
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold-master.opt
@@ -0,0 +1 @@
+--innodb-fatal-semaphore-wait-threshold=1
diff --git a/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test
new file mode 100644
index 00000000000..9493536bc59
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test
@@ -0,0 +1,120 @@
+# Only test in debug mode since DBUG_EXECUTE_IF is used
+--source include/have_debug.inc
+
+# Can't test this with embedded server
+--source include/not_embedded.inc
+
+# Don't test this with valgrind
+--source include/not_valgrind.inc
+
+# Only test for innodb
+--source include/have_innodb.inc
+
+--echo # Establish connection con1 (user=root)
+connect (con1,localhost,root,,);
+--echo # Establish connection con2 (user=root)
+connect (con2,localhost,root,,);
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+--echo # Switch to connection con1
+connection con1;
+eval create table t1 (id integer, x integer) engine = InnoDB;
+insert into t1 values(0, 0);
+
+# Enable the debug injection.
+set DEBUG_DBUG='+d,fatal-semaphore-timeout';
+set autocommit=0;
+
+# The following query will hang for an hour since the debug injection
+# code will sleep an hour after holding the lock table mutex
+--echo # Sending query on con1,
+--echo # the session will hold lock table mutex and sleep
+--send
+SELECT * from t1 where id = 0 FOR UPDATE;
+
+# To make sure con1 holding the lock table mutex and sleeping
+--sleep 2
+
+--echo # Switch to connection con2
+connection con2;
+set autocommit=0;
+
+# The following query will be blocked on the lock table mutex held by
+# con1 so it will be put into sync array.
+--echo # Sending query on con2,
+--echo # the session will be blocked on the lock table mutex and
+--echo # thus be put into sync arry
+--send
+SELECT * from t1 where id = 0 FOR UPDATE;
+
+# Waitting for mysqld to abort due to fatal semaphore timeout.
+# Please note that, in the master.opt file, the fatal timeout
+# was set to 1 second, but in mysqld debug mode, this timeout
+# value will be timed 10 because UNIV_DEBUG_VALGRIND is set
+# (see sync_array_print_long_waits_low() in storage/innobase/sync/sync0arr.cc)
+# so the actual timeout will be 1 * 10 = 10 seconds. Besides,
+# mysqld will abort after detecting this fatal timeout 10 times in
+# a loop with interval of 1 second (see srv_error_monitor_thread
+# thread in torage/innobase/srv/srv0srv.cc), so mysqld will abort
+# in 1 * 10 + 1 * 10 = 20 seconds after con2 being blocked on
+# the lock table mutex.
+#
+# P.S. the default fatal sempahore timeout is 600 seconds,
+# so mysqld will abort after 600 * 10 + 1 * 10 = 6010 seconds
+# in debug mode and 600 + 1 * 10 = 610 seconds in release mode.
+
+--echo # Switched to the default connection
+connection default;
+
+--disable_result_log
+--disable_query_log
+
+# Since this test generates lot of errors in log, suppress checking errors
+call mtr.add_suppression(".*");
+
+# The crash is expected
+exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+
+--echo # Waitting for mysqld to crash
+
+# It will take 20 seconds to detect the long semaphore and mysqld to abort.
+# This test will be treated as pass as long as mysqld crash/restart is dectected
+# in 80 seconds.
+let $counter= 80;
+let $mysql_errno= 0;
+while (!$mysql_errno)
+{
+ --error 0,1040,1053,2002,2003,2006,2013
+ show status;
+
+ dec $counter;
+ if (!$counter)
+ {
+ # This will fail this test.
+ --die Server failed to dissapear
+ }
+ --sleep 1
+}
+
+--echo # Mysqld crash was detected
+--echo # Waitting for reconnect after mysqld restarts
+
+enable_reconnect;
+connection default;
+
+--exec echo "restart:--log-error=$error_log" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Call script that will poll the server waiting for it to be back online again
+source include/wait_until_connected_again.inc;
+
+--echo # Reconnected after mysqld was successfully restarted
+
+--echo # Cleaning up before exit
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+--echo # Clean exit
diff --git a/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold_basic.test b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold_basic.test
new file mode 100644
index 00000000000..dcb6fff8751
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold_basic.test
@@ -0,0 +1,21 @@
+--source include/have_innodb.inc
+# bool readonly
+
+#
+# show values;
+#
+select @@global.innodb_fatal_semaphore_wait_threshold;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_fatal_semaphore_wait_threshold;
+show global variables like 'innodb_fatal_semaphore_wait_threshold';
+show session variables like 'innodb_fatal_semaphore_wait_threshold';
+select * from information_schema.global_variables where variable_name='innodb_fatal_semaphore_wait_threshold';
+select * from information_schema.session_variables where variable_name='innodb_fatal_semaphore_wait_threshold';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_fatal_semaphore_wait_threshold=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_fatal_semaphore_wait_threshold=1;
diff --git a/mysql-test/suite/sys_vars/t/innodb_force_primary_key_basic.test b/mysql-test/suite/sys_vars/t/innodb_force_primary_key_basic.test
new file mode 100644
index 00000000000..f760b3545fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_force_primary_key_basic.test
@@ -0,0 +1,57 @@
+--source include/have_innodb.inc
+
+let $force_pk=`select @@innodb_force_primary_key`;
+
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+--echo 1 Expected
+
+####################################################################
+# Check if Value can set #
+####################################################################
+
+SET @@GLOBAL.innodb_force_primary_key=1;
+--echo Expected ok
+
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+--echo 1 Expected
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+SELECT IF(@@GLOBAL.innodb_force_primary_key, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_primary_key';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_primary_key';
+--echo 1 Expected
+
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_force_primary_key = @@GLOBAL.innodb_force_primary_key;
+--echo 1 Expected
+
+SELECT COUNT(@@innodb_force_primary_key);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_force_primary_key);
+--echo Expected Variable 'innodb_force_primary_key' is a GLOBAL variable
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_force_primary_key);
+--echo Expected Variable 'innodb_force_primary_key' is a GLOBAL variable
+
+SELECT COUNT(@@GLOBAL.innodb_force_primary_key);
+--echo 1 Expected
+
+--disable_query_log
+eval set global innodb_force_primary_key=$force_pk;
+--enable_query_log
diff --git a/mysql-test/suite/sys_vars/t/innodb_idle_flush_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_idle_flush_pct_basic.test
new file mode 100644
index 00000000000..7175a59e238
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_idle_flush_pct_basic.test
@@ -0,0 +1,63 @@
+
+#
+# 2013-04-01 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_idle_flush_pct;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are between 0 and 100
+select @@global.innodb_idle_flush_pct between 0 and 100;
+select @@global.innodb_idle_flush_pct;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_idle_flush_pct;
+show global variables like 'innodb_idle_flush_pct';
+show session variables like 'innodb_idle_flush_pct';
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+select * from information_schema.session_variables where variable_name='innodb_idle_flush_pct';
+
+#
+# show that it's writable
+#
+set global innodb_idle_flush_pct=10;
+select @@global.innodb_idle_flush_pct;
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+select * from information_schema.session_variables where variable_name='innodb_idle_flush_pct';
+--error ER_GLOBAL_VARIABLE
+set session innodb_idle_flush_pct=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_idle_flush_pct=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_idle_flush_pct=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_idle_flush_pct="bar";
+
+set global innodb_idle_flush_pct=-7;
+select @@global.innodb_idle_flush_pct;
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+set global innodb_idle_flush_pct=106;
+select @@global.innodb_idle_flush_pct;
+select * from information_schema.global_variables where variable_name='innodb_idle_flush_pct';
+
+#
+# min/max/DEFAULT values
+#
+set global innodb_idle_flush_pct=0;
+select @@global.innodb_idle_flush_pct;
+set global innodb_idle_flush_pct=100;
+select @@global.innodb_idle_flush_pct;
+set global innodb_idle_flush_pct=DEFAULT;
+select @@global.innodb_idle_flush_pct;
+
+
+SET @@global.innodb_idle_flush_pct = @start_global_value;
+SELECT @@global.innodb_idle_flush_pct;
diff --git a/mysql-test/suite/sys_vars/t/innodb_immediate_scrub_data_uncompressed_basic.test b/mysql-test/suite/sys_vars/t/innodb_immediate_scrub_data_uncompressed_basic.test
new file mode 100644
index 00000000000..f3a3fba153a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_immediate_scrub_data_uncompressed_basic.test
@@ -0,0 +1,41 @@
+# bool global
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_immediate_scrub_data_uncompressed;
+
+--echo #
+--echo # exists as global only
+--echo #
+select @@global.innodb_immediate_scrub_data_uncompressed;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_immediate_scrub_data_uncompressed;
+show global variables like 'innodb_immediate_scrub_data_uncompressed';
+show session variables like 'innodb_immediate_scrub_data_uncompressed';
+select * from information_schema.global_variables
+where variable_name='innodb_immediate_scrub_data_uncompressed';
+select * from information_schema.session_variables
+where variable_name='innodb_immediate_scrub_data_uncompressed';
+
+--echo #
+--echo # show that it's writable
+--echo #
+set global innodb_immediate_scrub_data_uncompressed=ON;
+select @@global.innodb_immediate_scrub_data_uncompressed;
+set global innodb_immediate_scrub_data_uncompressed=OFF;
+select @@global.innodb_immediate_scrub_data_uncompressed;
+set global innodb_immediate_scrub_data_uncompressed=1;
+select @@global.innodb_immediate_scrub_data_uncompressed;
+--error ER_GLOBAL_VARIABLE
+set session innodb_immediate_scrub_data_uncompressed=1;
+
+--echo #
+--echo # incorrect types
+--echo #
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_immediate_scrub_data_uncompressed=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_immediate_scrub_data_uncompressed=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_immediate_scrub_data_uncompressed="foo";
+
+SET @@global.innodb_immediate_scrub_data_uncompressed = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test b/mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test
new file mode 100644
index 00000000000..9b302be79b5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test
@@ -0,0 +1,42 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # innodb_instrument_semaphores
+--echo #
+
+--echo # save the initial value
+SET @innodb_instrument_semaphores_global_saved = @@global.innodb_instrument_semaphores;
+
+--echo # default
+SELECT @@global.innodb_instrument_semaphores;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_instrument_semaphores;
+SET @@global.innodb_instrument_semaphores=OFF;
+SELECT @@global.innodb_instrument_semaphores;
+SET @@global.innodb_instrument_semaphores=ON;
+SELECT @@global.innodb_instrument_semaphores;
+
+--echo
+--echo # valid values
+SET @@global.innodb_instrument_semaphores='OFF';
+SELECT @@global.innodb_instrument_semaphores;
+SET @@global.innodb_instrument_semaphores=ON;
+SELECT @@global.innodb_instrument_semaphores;
+SET @@global.innodb_instrument_semaphores=default;
+SELECT @@global.innodb_instrument_semaphores;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.innodb_instrument_semaphores=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.innodb_instrument_semaphores='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/innodb_mtflush_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_mtflush_threads_basic.test
new file mode 100644
index 00000000000..c8412f969eb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_mtflush_threads_basic.test
@@ -0,0 +1,21 @@
+--source include/have_innodb.inc
+# bool readonly
+
+#
+# show values;
+#
+select @@global.innodb_mtflush_threads;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_mtflush_threads;
+show global variables like 'innodb_mtflush_threads';
+show session variables like 'innodb_mtflush_threads';
+select * from information_schema.global_variables where variable_name='innodb_mtflush_threads';
+select * from information_schema.session_variables where variable_name='innodb_mtflush_threads';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_mtflush_threads=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_mtflush_threads=1;
diff --git a/mysql-test/suite/sys_vars/t/innodb_prefix_index_cluster_optimization_basic.test b/mysql-test/suite/sys_vars/t/innodb_prefix_index_cluster_optimization_basic.test
new file mode 100644
index 00000000000..4e272fbd9c5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_prefix_index_cluster_optimization_basic.test
@@ -0,0 +1,76 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_prefix_index_cluster_optimization;
+SELECT @start_global_value;
+
+--echo #
+--echo # exists as global only
+--echo #
+
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_prefix_index_cluster_optimization in (0, 1);
+select @@global.innodb_prefix_index_cluster_optimization;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_prefix_index_cluster_optimization;
+show global variables like 'innodb_prefix_index_cluster_optimization';
+show session variables like 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+
+--echo #
+--echo # show that it's writable
+--echo #
+
+set global innodb_prefix_index_cluster_optimization = 'OFF';
+select @@global.innodb_prefix_index_cluster_optimization;
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+set @@global.innodb_prefix_index_cluster_optimization = 'ON';
+select @@global.innodb_prefix_index_cluster_optimization;
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+set global innodb_prefix_index_cluster_optimization = 0;
+select @@global.innodb_prefix_index_cluster_optimization;
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+set @@global.innodb_prefix_index_cluster_optimization = 1;
+select @@global.innodb_prefix_index_cluster_optimization;
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+
+--error ER_GLOBAL_VARIABLE
+set session innodb_prefix_index_cluster_optimization = 'OFF';
+select @@global.innodb_prefix_index_cluster_optimization;
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_prefix_index_cluster_optimization = 'ON';
+select @@global.innodb_prefix_index_cluster_optimization;
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+
+--echo #
+--echo # incorrect types
+--echo #
+
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_prefix_index_cluster_optimization = 1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_prefix_index_cluster_optimization = 1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_prefix_index_cluster_optimization = 2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_prefix_index_cluster_optimization = -3;
+select @@global.innodb_prefix_index_cluster_optimization;
+select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_prefix_index_cluster_optimization = 'AUTO';
+
+--echo #
+--echo # Cleanup
+--echo #
+
+SET @@global.innodb_prefix_index_cluster_optimization = @start_global_value;
+SELECT @@global.innodb_prefix_index_cluster_optimization;
diff --git a/mysql-test/suite/sys_vars/t/innodb_scrub_log_basic.test b/mysql-test/suite/sys_vars/t/innodb_scrub_log_basic.test
new file mode 100644
index 00000000000..302f2a963c4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_scrub_log_basic.test
@@ -0,0 +1,50 @@
+--source include/have_innodb.inc
+
+# Display default value
+SELECT @@GLOBAL.innodb_scrub_log;
+--echo 0 Expected
+
+# Check if value can be set
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_scrub_log=1;
+--echo Expected error 'Read only variable'
+
+SELECT @@GLOBAL.innodb_scrub_log;
+--echo 0 Expected
+
+# Check if the value in GLOBAL TABLE matches value in variable
+SELECT IF(@@GLOBAL.innodb_scrub_log, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log';
+--echo 1 Expected
+
+SELECT @@GLOBAL.innodb_scrub_log;
+--echo 0 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log';
+--echo 0 Expected
+
+# Check if accessing variable with and without GLOBAL point to same variable
+SELECT @@innodb_scrub_log = @@GLOBAL.innodb_scrub_log;
+--echo 1 Expected
+
+# Check if innodb_scrub_log can be accessed with and without @@ sign
+SELECT @@innodb_scrub_log;
+--echo 0 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@local.innodb_scrub_log;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_scrub_log;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT @@GLOBAL.innodb_scrub_log;
+--echo 0 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_scrub_log;
+--echo Expected error 'Unknow column in field list'
diff --git a/mysql-test/suite/sys_vars/t/innodb_scrub_log_speed_basic.test b/mysql-test/suite/sys_vars/t/innodb_scrub_log_speed_basic.test
new file mode 100644
index 00000000000..5e750eebd65
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_scrub_log_speed_basic.test
@@ -0,0 +1,55 @@
+--source include/have_innodb.inc
+
+# Display default value
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+--echo 200 Expected
+
+# Check if value can be set
+SET @@GLOBAL.innodb_scrub_log_speed=100;
+--echo 1 Expected
+
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+--echo 100 Expected
+
+SET @@GLOBAL.innodb_scrub_log_speed=DEFAULT;
+--echo 1 Expected
+
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+--echo 200 Expected
+
+# Check if the value in GLOBAL TABLE matches value in variable
+SELECT @@GLOBAL.innodb_scrub_log_speed = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log_speed';
+--echo 1 Expected
+
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+--echo 200 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_scrub_log_speed';
+--echo 200 Expected
+
+# Check if accessing variable with and without GLOBAL point to same variable
+SELECT @@innodb_scrub_log_speed = @@GLOBAL.innodb_scrub_log_speed;
+--echo 1 Expected
+
+# Check if innodb_scrub_log_speed can be accessed with and without @@ sign
+SELECT @@innodb_scrub_log_speed;
+--echo 200 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@local.innodb_scrub_log_speed;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_scrub_log_speed;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT @@GLOBAL.innodb_scrub_log_speed;
+--echo 200 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_scrub_log_speed;
+--echo Expected error 'Unknow column in field list'
diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
index 85ae2358db5..bc4efdd1d6f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
@@ -39,7 +39,7 @@ set global innodb_thread_sleep_delay=1.1;
set global innodb_thread_sleep_delay=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_thread_sleep_delay="foo";
---error ER_WRONG_TYPE_FOR_VAR
+
set global innodb_thread_sleep_delay=18446744073709551616;
set global innodb_thread_sleep_delay=-7;
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_mtflush_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_mtflush_basic.test
new file mode 100644
index 00000000000..a9c40b9e522
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_use_mtflush_basic.test
@@ -0,0 +1,22 @@
+--source include/have_innodb.inc
+# bool readonly
+
+#
+# show values;
+#
+select @@global.innodb_use_mtflush;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_use_mtflush;
+show global variables like 'innodb_use_mtflush';
+show session variables like 'innodb_use_mtflush';
+select * from information_schema.global_variables where variable_name='innodb_use_mtflush';
+select * from information_schema.session_variables where variable_name='innodb_use_mtflush';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_use_mtflush=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_use_mtflush=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test
new file mode 100644
index 00000000000..c1b0f142179
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test
@@ -0,0 +1,36 @@
+--source include/have_innodb.inc
+
+SET @start_use_trim = @@global.innodb_use_trim;
+SELECT @start_use_trim;
+
+SELECT COUNT(@@GLOBAL.innodb_use_trim);
+--echo 1 Expected
+
+####################################################################
+# Check if Value can set #
+####################################################################
+
+SET @@GLOBAL.innodb_use_trim=1;
+
+SELECT COUNT(@@GLOBAL.innodb_use_trim);
+--echo 1 Expected
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+SELECT IF(@@GLOBAL.innodb_use_trim, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_trim';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_use_trim);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_trim';
+--echo 1 Expected
+
+SET @@global.innodb_use_trim = @start_use_trim;
+SELECT @@global.innodb_use_trim; \ No newline at end of file
diff --git a/mysql-test/suite/sys_vars/t/log_bin_basename_basic.test b/mysql-test/suite/sys_vars/t/log_bin_basename_basic.test
new file mode 100644
index 00000000000..8ad5bd22bb6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_bin_basename_basic.test
@@ -0,0 +1,13 @@
+#
+# WL#5465: System variables: paths to relay log and binary log files
+#
+# Test for variable:
+# Variable Name: log_bin_basename
+# Variable Scope: Global
+# Dynamic Variable: No
+
+--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+--let $rpl_log_var_name=log_bin_basename
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
diff --git a/mysql-test/suite/sys_vars/t/log_bin_index_basic.test b/mysql-test/suite/sys_vars/t/log_bin_index_basic.test
new file mode 100644
index 00000000000..c99df79f36f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_bin_index_basic.test
@@ -0,0 +1,13 @@
+#
+# WL#5465: System variables: paths to relay log and binary log files
+#
+# Test for variable:
+# Variable Name: log_bin_index
+# Variable Scope: Global
+# Dynamic Variable: No
+
+--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+--let $rpl_log_var_name=log_bin_index
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
diff --git a/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
new file mode 100644
index 00000000000..78e4d35f69a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
@@ -0,0 +1,61 @@
+--source include/no_valgrind_without_big.inc
+-- source include/have_innodb.inc
+
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_long_query_time= @@session.long_query_time;
+SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements;
+
+USE test;
+CREATE TABLE log_slow_admin_statements (
+ i INT PRIMARY KEY AUTO_INCREMENT,
+ j VARCHAR(255)
+) ENGINE=InnoDB;
+
+# enable slow logging to table
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+SET SESSION long_query_time = 0;
+SET GLOBAL log_slow_admin_statements = on;
+
+# test ALTER, OPTIMIZE and CHECK against the table shown up
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17;
+
+# add rows so OPTIMIZE and CHECK runs
+DELIMITER $;
+
+CREATE PROCEDURE add_rows()
+BEGIN
+ DECLARE count INT;
+ SET count = 1;
+ INSERT INTO log_slow_admin_statements(j) values (REPEAT('A', 255));
+ WHILE count <= 15 DO
+ INSERT INTO log_slow_admin_statements(j) SELECT j FROM log_slow_admin_statements;
+ SET count = count + 1;
+ END WHILE;
+END
+$
+
+DELIMITER ;$
+
+CALL add_rows();
+
+# OPTIMIZE TABLE
+OPTIMIZE TABLE log_slow_admin_statements;
+
+# CHECK TABLE
+CHECK TABLE log_slow_admin_statements EXTENDED;
+
+# DROP TABLE
+DROP TABLE log_slow_admin_statements;
+
+# ALTER, OPTIMIZE, CHECK and DROP operations should be logged in slow query log.
+SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%';
+
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@session.long_query_time= @old_long_query_time;
+SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
+
+DROP PROCEDURE add_rows;
+TRUNCATE TABLE mysql.slow_log;
diff --git a/mysql-test/suite/sys_vars/t/log_tc_size_basic.test b/mysql-test/suite/sys_vars/t/log_tc_size_basic.test
new file mode 100644
index 00000000000..221338d0304
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_tc_size_basic.test
@@ -0,0 +1,5 @@
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL log_tc_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET SESSION log_tc_size=1;
diff --git a/mysql-test/suite/sys_vars/t/max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test
index b5e1d834d7e..38b493b3bab 100644
--- a/mysql-test/suite/sys_vars/t/max_digest_length_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--source include/not_embedded.inc
diff --git a/mysql-test/suite/sys_vars/t/max_statement_time_basic.test b/mysql-test/suite/sys_vars/t/max_statement_time_basic.test
new file mode 100644
index 00000000000..186589dcee2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_statement_time_basic.test
@@ -0,0 +1,217 @@
+####################### mysql-test\t\max_statement_time_basic.test ###############
+# #
+# Variable Name: max_statement_time #
+# Scope: GLOBAL | SESSION #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value:10 #
+# Min Value: 1 #
+# #
+# #
+# Creation Date: 2012-12-30 #
+# Author: Monty #
+# #
+# Description: Test Cases of Dynamic System Variable max_statement_time #
+# that checks the behavior of this variable in the following ways#
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# #
+# Reference: https://kb.askmonty.org/en/how-to-limittimeout-queries/ #
+# server-system-variables.html #
+# #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+############################################################
+# START OF max_statement_time TESTS #
+############################################################
+
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.max_statement_time;
+SELECT @start_global_value;
+SET @start_session_value = @@session.max_statement_time;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_068_01-------------------------#'
+###############################################################
+# Display the DEFAULT value of max_statement_time #
+###############################################################
+
+SET @@global.max_statement_time = 100;
+SET @@global.max_statement_time = DEFAULT;
+SELECT @@global.max_statement_time;
+
+SET @@session.max_statement_time = 200;
+SET @@session.max_statement_time = DEFAULT;
+SELECT @@session.max_statement_time;
+
+
+--echo '#--------------------FN_DYNVARS_068_02-------------------------#'
+###############################################################
+# Check the DEFAULT value of max_statement_time #
+###############################################################
+
+SET @@global.max_statement_time = DEFAULT;
+SELECT @@global.max_statement_time = 0;
+
+SET @@session.max_statement_time = DEFAULT;
+SELECT @@session.max_statement_time = 0;
+
+
+--echo '#--------------------FN_DYNVARS_068_03-------------------------#'
+#########################################################################
+# Change the value of max_statement_time to a valid value for GLOBAL Scope #
+#########################################################################
+
+SET @@global.max_statement_time = 0;
+SELECT @@global.max_statement_time;
+SET @@global.max_statement_time = 0.123456;
+SELECT @@global.max_statement_time;
+SET @@global.max_statement_time = 60020;
+SELECT @@global.max_statement_time;
+SET @@global.max_statement_time = 31536000;
+SELECT @@global.max_statement_time;
+SET @@global.max_statement_time = 65536;
+SELECT @@global.max_statement_time;
+
+
+--echo '#--------------------FN_DYNVARS_068_04-------------------------#'
+##########################################################################
+# Change the value of max_statement_time to a valid value for SESSION Scope #
+##########################################################################
+
+SET @@session.max_statement_time = 0;
+SELECT @@session.max_statement_time;
+SET @@session.max_statement_time = 1;
+SELECT @@session.max_statement_time;
+SET @@session.max_statement_time = 50050;
+SELECT @@session.max_statement_time;
+SET @@session.max_statement_time = 31536000;
+SELECT @@session.max_statement_time;
+SET @@session.max_statement_time = 65550;
+SELECT @@session.max_statement_time;
+
+
+--echo '#------------------FN_DYNVARS_068_05-----------------------#'
+########################################################
+# Change the value of max_statement_time to an invalid value #
+########################################################
+
+SET @@global.max_statement_time = 100000000000;
+SELECT @@global.max_statement_time;
+SET @@global.max_statement_time = -1;
+SELECT @@global.max_statement_time;
+SET @@global.max_statement_time = 65530.34;
+SELECT @@global.max_statement_time;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_statement_time = test;
+SELECT @@global.max_statement_time;
+
+SET @@session.max_statement_time = 100000000000;
+SELECT @@session.max_statement_time;
+SET @@session.max_statement_time = -2;
+SELECT @@session.max_statement_time;
+SET @@session.max_statement_time = 65530.34;
+SELECT @@session.max_statement_time;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_statement_time = test;
+SELECT @@session.max_statement_time;
+
+
+--echo '#------------------FN_DYNVARS_068_06-----------------------#'
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+
+
+SELECT @@global.max_statement_time = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_statement_time';
+
+--echo '#------------------FN_DYNVARS_068_07-----------------------#'
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+
+SELECT @@session.max_statement_time = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='max_statement_time';
+
+
+--echo '#------------------FN_DYNVARS_068_08-----------------------#'
+####################################################################
+# Check if TRUE and FALSE values can be used on variable #
+####################################################################
+
+SET @@global.max_statement_time = TRUE;
+SELECT @@global.max_statement_time;
+SET @@global.max_statement_time = FALSE;
+SELECT @@global.max_statement_time;
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+#################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+#################################################################################
+
+SET @@global.max_statement_time = 10;
+SELECT @@max_statement_time = @@global.max_statement_time;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+########################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
+########################################################################################################
+
+SET @@max_statement_time = 100;
+SELECT @@max_statement_time = @@local.max_statement_time;
+SELECT @@local.max_statement_time = @@session.max_statement_time;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+##########################################################################
+# Check if max_statement_time can be accessed with and without @@ sign #
+##########################################################################
+
+SET max_statement_time = 1;
+SELECT @@max_statement_time;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_statement_time;
+--Error ER_UNKNOWN_TABLE
+SELECT session.max_statement_time;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_statement_time = @@session.max_statement_time;
+
+--echo #
+--echo # Check that one can use max_statement_time as a field
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, max_statement_time int);
+drop table t1;
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.max_statement_time = @start_global_value;
+SELECT @@global.max_statement_time;
+SET @@session.max_statement_time = @start_session_value;
+SELECT @@session.max_statement_time;
+
+
+####################################################
+# END OF max_statement_time TESTS #
+####################################################
+
diff --git a/mysql-test/suite/sys_vars/t/max_user_connections_func.test b/mysql-test/suite/sys_vars/t/max_user_connections_func.test
index 74707c9b296..2af396b614f 100644
--- a/mysql-test/suite/sys_vars/t/max_user_connections_func.test
+++ b/mysql-test/suite/sys_vars/t/max_user_connections_func.test
@@ -39,6 +39,7 @@ SET @default_max_user_connections = @@global.max_user_connections;
Set Global max_user_connections=2;
+CREATE USER test@localhost;
GRANT USAGE on *.* TO test@localhost;
--echo '#--------------------FN_DYNVARS_114_01-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
deleted file mode 100644
index 398636fcb13..00000000000
--- a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
+++ /dev/null
@@ -1,23 +0,0 @@
---source include/have_mutex_deadlock_detector.inc
-
-# bool readonly
-
-#
-# show the global and session values;
-#
-select @@global.mutex_deadlock_detector;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.mutex_deadlock_detector;
-show global variables like 'mutex_deadlock_detector';
-show session variables like 'mutex_deadlock_detector';
-select * from information_schema.global_variables where variable_name='mutex_deadlock_detector';
-select * from information_schema.session_variables where variable_name='mutex_deadlock_detector';
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global mutex_deadlock_detector=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session mutex_deadlock_detector=1;
-
diff --git a/mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test b/mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test
new file mode 100644
index 00000000000..d0de9202d3f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test
@@ -0,0 +1,165 @@
+############## mysql-test\t\mysql56_temporal_format_basic.test ################
+# #
+# Variable Name: mysql56_temporal_format #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: boolean #
+# Default Value: OFF #
+# Range: #
+# #
+# Creation Date: 2014-08-27 #
+# #
+# Description: Test Cases of Dynamic System Variable mysql56_temporal_format #
+# that checks the behavior of this variable in the following ways#
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# #
+###############################################################################
+
+--source include/load_sysvars.inc
+########################################################################
+# START OF mysql56_temporal_format TESTS #
+########################################################################
+
+
+###########################################################################
+# Saving initial value of mysql56_temporal_format in a temporary variable #
+###########################################################################
+
+SET @start_value = @@global.mysql56_temporal_format;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_030_01------------------------#'
+#############################################################
+# Display the DEFAULT value of mysql56_temporal_format #
+#############################################################
+
+SET @@global.mysql56_temporal_format = ON;
+SET @@global.mysql56_temporal_format = DEFAULT;
+SELECT @@global.mysql56_temporal_format;
+
+
+--echo '#---------------------FN_DYNVARS_030_02-------------------------#'
+###############################################
+# Verify default value of variable #
+###############################################
+
+SET @@global.mysql56_temporal_format = @start_value;
+SELECT @@global.mysql56_temporal_format;
+
+
+--echo '#--------------------FN_DYNVARS_030_03------------------------#'
+################################################################
+# Change the value of mysql56_temporal_format to a valid value #
+################################################################
+
+SET @@global.mysql56_temporal_format = ON;
+SELECT @@global.mysql56_temporal_format;
+SET @@global.mysql56_temporal_format = OFF;
+SELECT @@global.mysql56_temporal_format;
+SET @@global.mysql56_temporal_format = 0;
+SELECT @@global.mysql56_temporal_format;
+SET @@global.mysql56_temporal_format = 1;
+SELECT @@global.mysql56_temporal_format;
+
+
+--echo '#--------------------FN_DYNVARS_030_04-------------------------#'
+###########################################################################
+# Change the value of mysql56_temporal_format to invalid value #
+###########################################################################
+
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = 2;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = -1;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = TRUEF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = TRUE_F;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = FALSE0;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = OON;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = ONN;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = OOFF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = 0FF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = ' ';
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = " ";
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.mysql56_temporal_format = '';
+
+
+--echo '#-------------------FN_DYNVARS_030_05----------------------------#'
+###########################################################################
+# Test if accessing session mysql56_temporal_format gives error #
+###########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.mysql56_temporal_format = 1;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.mysql56_temporal_format;
+
+
+--echo '#----------------------FN_DYNVARS_030_06------------------------#'
+####################################################################
+# Check if the value in GLOBAL Tables matches values in variable #
+####################################################################
+
+SELECT IF(@@global.mysql56_temporal_format, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='mysql56_temporal_format';
+
+
+--echo '#---------------------FN_DYNVARS_030_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.mysql56_temporal_format = TRUE;
+SELECT @@global.mysql56_temporal_format;
+SET @@global.mysql56_temporal_format = FALSE;
+SELECT @@global.mysql56_temporal_format;
+
+
+--echo '#---------------------FN_DYNVARS_030_08----------------------#'
+###############################################################################
+# Check if accessing variable without SCOPE points to same global variable #
+###############################################################################
+
+SET @@global.mysql56_temporal_format = 1;
+SELECT @@mysql56_temporal_format = @@global.mysql56_temporal_format;
+
+--echo '#---------------------FN_DYNVARS_030_09----------------------#'
+#############################################################################
+# Check if mysql56_temporal_format can be accessed with and without @@ sign #
+#############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET mysql56_temporal_format = 1;
+--Error ER_PARSE_ERROR
+SET global.mysql56_temporal_format = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.mysql56_temporal_format;
+--Error ER_BAD_FIELD_ERROR
+SELECT mysql56_temporal_format = @@session.mysql56_temporal_format;
+
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.mysql56_temporal_format = @start_value;
+SELECT @@global.mysql56_temporal_format;
+
+
+#############################################################
+# END OF mysql56_temporal_format TESTS #
+#############################################################
diff --git a/mysql-test/suite/sys_vars/t/mysql56_temporal_format_func.test b/mysql-test/suite/sys_vars/t/mysql56_temporal_format_func.test
new file mode 100644
index 00000000000..b36a4e03691
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mysql56_temporal_format_func.test
@@ -0,0 +1,66 @@
+#
+# This test checks that DATETIME, DATETIME(5), TIME(5) columns
+# occupy different data length depending on @@mysql56_temporal_format:
+#
+# Type MariaDB MySQL
+# ---- ------- -----
+# DATETIME 8 5
+# DATETIME(5) 7 8
+# TIME(5) 5 6
+#
+# The DATETIME(1-3,4,6) and TIME(0-4,6) data types use the same size
+# in both MariaDB and MySQL formats.
+# TIMESTAMP(0-6) also uses the same size in both formats.
+#
+# We use two columns in the tests below, to make sure the record length
+# is longer than 7. Records whose fields occupy less then 7 bytes use
+# 7 bytes anyway (assuming the default MAX_ROWS values), to store deleted
+# record list pointers.
+#
+
+--echo #
+--echo # MariaDB-5.3 format
+--echo #
+SET @@global.mysql56_temporal_format=false;
+CREATE TABLE t1 (a DATETIME NOT NULL, b DATETIME NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10','2001-01-01 10:10:10');
+SELECT * FROM t1;
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATETIME(5) NOT NULL, b DATETIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10.12345','2001-01-01 10:10:10.12345');
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TIME(5) NOT NULL,b TIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('10:10:10.12345','10:10:10.12345');
+SELECT * FROM t1;
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
+--echo #
+--echo # MySQL-5.6 format
+--echo #
+
+SET @@global.mysql56_temporal_format=true;
+CREATE TABLE t1 (a DATETIME NOT NULL, b DATETIME NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10','2001-01-01 10:10:10');
+SELECT * FROM t1;
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATETIME(5) NOT NULL, b DATETIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:10:10.12345','2001-01-01 10:10:10.12345');
+SELECT * FROM t1;
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TIME(5) NOT NULL,b TIME(5) NOT NULL);
+INSERT INTO t1 VALUES ('10:10:10.12345','10:10:10.12345');
+SELECT * FROM t1;
+SELECT (AVG_ROW_LENGTH-1) DIV 2 AS FIELD_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
+SET @@global.mysql56_temporal_format=DEFAULT;
diff --git a/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test
index 29b4232b7fa..31692081053 100644
--- a/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--source include/not_embedded.inc
--source include/have_perfschema.inc
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test
index 5c89dbda07f..cf87c1a7c68 100644
--- a/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test
+++ b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--source include/not_embedded.inc
--source include/have_perfschema.inc
diff --git a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test
index 9def567b994..1793652397f 100644
--- a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic.test
@@ -60,10 +60,10 @@ SELECT @@session.query_alloc_block_size;
###################################################################
SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size = 8192;
+SELECT @@global.query_alloc_block_size = 16384;
SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size = 8192;
+SELECT @@session.query_alloc_block_size = 16384;
--echo '#--------------------FN_DYNVARS_130_03-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/query_cache_limit_func.test b/mysql-test/suite/sys_vars/t/query_cache_limit_func.test
index e90a0e6adda..c115524d49d 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_limit_func.test
@@ -31,6 +31,9 @@ SET @global_query_cache_limit = @@global.query_cache_limit;
SET @global_query_cache_size = @@global.query_cache_size;
SET @global_query_cache_type = @@global.query_cache_type;
+SET GLOBAL query_cache_type= ON;
+SET LOCAL query_cache_type= ON;
+
--echo ** warnings **
--disable_warnings
DROP TABLE IF EXISTS t;
diff --git a/mysql-test/suite/sys_vars/t/query_cache_type_func.test b/mysql-test/suite/sys_vars/t/query_cache_type_func.test
index 4679d1ec339..e015e374aeb 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_type_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_type_func.test
@@ -71,12 +71,15 @@ SET @@GLOBAL.query_cache_size = 65536;
SET @@query_cache_type = DEFAULT;
SELECT @@query_cache_type;
---echo ON Expected
+--echo OFF Expected
+--error ER_QUERY_CACHE_IS_GLOBALY_DISABLED
+SET @@query_cache_type = ON;
--echo '#--------------------FN_DYNVARS_135_02-------------------------#'
#
# Testing valid possible values
#
+SET GLOBAL query_cache_type= ON;
--error ER_WRONG_VALUE_FOR_VAR
SET @@query_cache_type = NULL;
diff --git a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
index e126a67ff30..5c7533eb50a 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
@@ -49,6 +49,11 @@ SET @start_session_value = @@SESSION.query_cache_wlock_invalidate;
SET @old_cache_size = @@GLOBAL.query_cache_size;
SET @old_cache_type = @@GLOBAL.query_cache_type;
+SET GLOBAL query_cache_type= ON;
+SET LOCAL query_cache_type= ON;
+connection con1;
+SET LOCAL query_cache_type= ON;
+connection con0;
#
# Creating test table
diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test
index 3914bff4ca9..1a6ed56c5f9 100644
--- a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test
@@ -60,10 +60,10 @@ SELECT @@session.query_prealloc_size ;
########################################################################
SET @@global.query_prealloc_size = DEFAULT;
-SELECT @@global.query_prealloc_size = 8192;
+SELECT @@global.query_prealloc_size = 24576;
SET @@session.query_prealloc_size = DEFAULT;
-SELECT @@session.query_prealloc_size = 8192;
+SELECT @@session.query_prealloc_size = 24576;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/rand_seed1_basic.test b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test
index 3745d2fcb1e..a64f8a64aa9 100644
--- a/mysql-test/suite/sys_vars/t/rand_seed1_basic.test
+++ b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test
@@ -6,6 +6,9 @@
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.rand_seed1;
+--error ER_NO_DEFAULT
+set session rand_seed1=default;
+set session rand_seed1=10969771;
select @@session.rand_seed1;
show global variables like 'rand_seed1';
show session variables like 'rand_seed1';
diff --git a/mysql-test/suite/sys_vars/t/rand_seed2_basic.test b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test
index 7a5abcd340b..091fd8f0e3d 100644
--- a/mysql-test/suite/sys_vars/t/rand_seed2_basic.test
+++ b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test
@@ -7,6 +7,9 @@
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.rand_seed2;
+--error ER_NO_DEFAULT
+set session rand_seed2=default;
+set session rand_seed2=10969771;
select @@session.rand_seed2;
show global variables like 'rand_seed2';
show session variables like 'rand_seed2';
diff --git a/mysql-test/suite/sys_vars/t/relay_log_basename_basic.test b/mysql-test/suite/sys_vars/t/relay_log_basename_basic.test
new file mode 100644
index 00000000000..29b70e6cd47
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/relay_log_basename_basic.test
@@ -0,0 +1,16 @@
+#
+# WL#5465: System variables: paths to relay log and binary log files
+#
+# Test for variable:
+# Variable Name: relay_log_basename
+# Variable Scope: Global
+# Dynamic Variable: No
+
+--source include/not_embedded.inc
+--source include/master-slave.inc
+
+--connection slave
+--let $rpl_log_var_name=relay_log_basename
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/t/relay_log_index_basic.test b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
index fa69d978016..5a585ac289f 100644
--- a/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
+++ b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
@@ -1,13 +1,20 @@
--source include/not_embedded.inc
+--source include/master-slave.inc
+
#
# only global
#
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
select @@global.relay_log_index;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.relay_log_index;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show global variables like 'relay_log_index';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show session variables like 'relay_log_index';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
select * from information_schema.global_variables where variable_name='relay_log_index';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
select * from information_schema.session_variables where variable_name='relay_log_index';
#
@@ -17,3 +24,10 @@ select * from information_schema.session_variables where variable_name='relay_lo
set global relay_log_index=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session relay_log_index=1;
+
+--connection slave
+--let $rpl_log_var_name=relay_log_index
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic.test b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic.test
deleted file mode 100644
index b89cee9bdd4..00000000000
--- a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic.test
+++ /dev/null
@@ -1,180 +0,0 @@
-############## mysql-test\t\rpl_recovery_rank_basic.test #######################
-# #
-# Variable Name: rpl_recovery_rank #
-# Scope: GLOBAL & SESSION #
-# Access Type: Dynamic #
-# Data Type: Numeric #
-# Default Value: 1 #
-# Range: 1 - 65536 #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan Maredia #
-# #
-# Description: Test Cases of Dynamic System Variable rpl_recovery_rank #
-# that checks the behavior of this variable in the following ways #
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-################################################################################
-
---source include/load_sysvars.inc
-
-###################################################################
-# START OF rpl_recovery_rank TESTS #
-###################################################################
-
-
-#############################################################
-# Save initial value #
-#############################################################
-
-SET @start_global_value = @@global.rpl_recovery_rank;
-SELECT @start_global_value;
-
---echo '#--------------------FN_DYNVARS_142_01-------------------------#'
-###################################################################
-# Check the DEFAULT value of rpl_recovery_rank #
-###################################################################
-
-SET @@global.rpl_recovery_rank = 500000;
-SET @@global.rpl_recovery_rank = DEFAULT;
-SELECT @@global.rpl_recovery_rank;
-
---echo '#--------------------FN_DYNVARS_142_02-------------------------#'
-##################################################################################
-# Change the value of rpl_recovery_rank to a valid value for GLOBAL Scope #
-##################################################################################
-
-SET @@global.rpl_recovery_rank = 0;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 1024;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 123456789;
-SELECT @@global.rpl_recovery_rank;
-
---disable_warnings
-SET @@global.rpl_recovery_rank = 2147483648*2;
---enable_warnings
---replace_result 4294967296 4294967295
-SELECT @@global.rpl_recovery_rank;
---disable_warnings
-SET @@global.rpl_recovery_rank = 2147483648*1024;
---enable_warnings
---replace_result 2199023255552 4294967295
-SELECT @@global.rpl_recovery_rank;
---disable_warnings
-SET @@global.rpl_recovery_rank = 2147483648*2147483648;
---enable_warnings
---replace_result 4611686018427387904 4294967295
-SELECT @@global.rpl_recovery_rank;
-
-
---echo '#--------------------FN_DYNVARS_142_03-------------------------#'
-#################################################################################
-# Check if variable can be access with session scope #
-#################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@rpl_recovery_rank = 2;
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.rpl_recovery_rank = 3;
-
---Error ER_GLOBAL_VARIABLE
-SET @@local.rpl_recovery_rank = 4;
-
-
-
---echo '#------------------FN_DYNVARS_142_04-----------------------#'
-####################################################################
-# Change the value of rpl_recovery_rank to an invalid value #
-####################################################################
-
-SET @@global.rpl_recovery_rank = -1;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = -2147483648;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = -2147483649;
-SELECT @@global.rpl_recovery_rank;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 65530.34;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 2147483649.56;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 1G;
-
-
---echo '#------------------FN_DYNVARS_142_05-----------------------#'
-####################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-####################################################################
-
-SET @@global.rpl_recovery_rank = 3000;
-SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-
-
---echo '#------------------FN_DYNVARS_142_06-----------------------#'
-###########################################################################
-# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
-###########################################################################
-
-SELECT count(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-
-
---echo '#------------------FN_DYNVARS_142_07-----------------------#'
-####################################################################
-# Check if TRUE and FALSE values can be used on variable #
-####################################################################
-
-SET @@global.rpl_recovery_rank = TRUE;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = FALSE;
-SELECT @@global.rpl_recovery_rank;
-
-
---echo '#---------------------FN_DYNVARS_001_08----------------------#'
-#################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-#################################################################################
-
-
-SET @@global.rpl_recovery_rank = 512;
-SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-##################################################################################
-# Check if rpl_recovery_rank can be accessed without @@ sign and scope #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET rpl_recovery_rank = 2048;
---Error ER_BAD_FIELD_ERROR
-SELECT rpl_recovery_rank;
-
-SELECT @@rpl_recovery_rank;
-
-#verifying another another syntax for setting value
-SET global rpl_recovery_rank = 64;
-
-####################################
-# Restore initial value #
-####################################
-
-SET @@global.rpl_recovery_rank = @start_global_value;
-SELECT @@global.rpl_recovery_rank;
-
-########################################################
-# END OF rpl_recovery_rank TESTS #
-########################################################
-
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_point_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_point_basic.test
new file mode 100644
index 00000000000..8125cf8d653
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_point_basic.test
@@ -0,0 +1,40 @@
+source include/not_embedded.inc;
+source include/have_semisync.inc;
+select @@global.rpl_semi_sync_master_wait_point;
+SET @start_global_value = @@global.rpl_semi_sync_master_wait_point;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.rpl_semi_sync_master_wait_point;
+show global variables like 'rpl_semi_sync_master_wait_point';
+show session variables like 'rpl_semi_sync_master_wait_point';
+select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_point';
+select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_point';
+
+#
+# show that it's writable
+#
+set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
+--error ER_GLOBAL_VARIABLE
+set session rpl_semi_sync_master_wait_point=AFTER_COMMIT;
+select @@global.rpl_semi_sync_master_wait_point;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.rpl_semi_sync_master_wait_point;
+show global variables like 'rpl_semi_sync_master_wait_point';
+show session variables like 'rpl_semi_sync_master_wait_point';
+select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_point';
+select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_point';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global rpl_semi_sync_master_wait_point=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global rpl_semi_sync_master_wait_point=1e1;
+
+
+#
+# Cleanup
+#
+SET @@global.rpl_semi_sync_master_wait_point = @start_global_value;
+select @@global.rpl_semi_sync_master_wait_point;
diff --git a/mysql-test/suite/sys_vars/t/show_vs_valstr.test b/mysql-test/suite/sys_vars/t/show_vs_valstr.test
new file mode 100644
index 00000000000..fec5b9c6bd5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/show_vs_valstr.test
@@ -0,0 +1,12 @@
+# verify that show_status_array and sys_var::val_str print values identically
+
+use information_schema;
+
+select variable_name, s.variable_value, v.global_value
+ from global_variables s join system_variables v using (variable_name)
+ where not (s.variable_value <=> v.global_value);
+
+select variable_name, s.variable_value, v.session_value
+ from session_variables s join system_variables v using (variable_name)
+ where v.variable_scope != 'GLOBAL' and
+ not (s.variable_value <=> v.session_value);
diff --git a/mysql-test/suite/sys_vars/t/skip_parallel_replication_basic.test b/mysql-test/suite/sys_vars/t/skip_parallel_replication_basic.test
new file mode 100644
index 00000000000..3ccac558ea4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/skip_parallel_replication_basic.test
@@ -0,0 +1,14 @@
+--source include/not_embedded.inc
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@global.skip_parallel_replication;
+
+--error ER_LOCAL_VARIABLE
+SET GLOBAL skip_parallel_replication= 0;
+SELECT @@session.skip_parallel_replication;
+SET SESSION skip_parallel_replication= 1;
+SELECT @@session.skip_parallel_replication;
+SET SESSION skip_parallel_replication= 0;
+SELECT @@session.skip_parallel_replication;
+
+# More testing of the actual functionality in rpl.rpl_parallel_* tests.
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt
new file mode 100644
index 00000000000..cd2ccb7eb8b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt
@@ -0,0 +1 @@
+--slave-parallel-mode=minimal --m1.slave-parallel-mode=optimistic --m2.slave-parallel-mode=aggressive
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test
new file mode 100644
index 00000000000..4d233b11cc2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test
@@ -0,0 +1,34 @@
+--source include/not_embedded.inc
+
+# Also tests some command line options, in slave_parallel_mode_basic-master.opt
+
+--error ER_GLOBAL_VARIABLE
+SET SESSION slave_parallel_mode= none;
+
+SELECT @@slave_parallel_mode;
+SELECT @@m1.slave_parallel_mode;
+
+CHANGE MASTER TO master_host='127.0.0.1', master_port=3310, master_user='root';
+SELECT @@``.slave_parallel_mode;
+SELECT @@slave_parallel_mode;
+--let $status_items= Parallel_Mode
+--source include/show_slave_status.inc
+
+SELECT @@m2.slave_parallel_mode;
+SET GLOBAL m2.slave_parallel_mode = none;
+
+CHANGE MASTER 'm1' TO master_host='127.0.0.1', master_port=3311, master_user='root';
+SELECT @@m1.slave_parallel_mode;
+--source include/show_slave_status.inc
+SET GLOBAL m1.slave_parallel_mode= conservative;
+--source include/show_slave_status.inc
+SET default_master_connection= 'm1';
+SELECT @@slave_parallel_mode;
+SET GLOBAL slave_parallel_mode= aggressive;
+SELECT @@slave_parallel_mode;
+--source include/show_slave_status.inc
+SET default_master_connection= '';
+SELECT @@slave_parallel_mode;
+
+RESET SLAVE ALL;
+RESET SLAVE 'm1' ALL;
diff --git a/mysql-test/suite/sys_vars/t/slave_run_triggers_for_rbr_basic.test b/mysql-test/suite/sys_vars/t/slave_run_triggers_for_rbr_basic.test
new file mode 100644
index 00000000000..ac5296677b9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_run_triggers_for_rbr_basic.test
@@ -0,0 +1,30 @@
+
+-- source include/have_rbr_triggers.inc
+
+SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= NO;
+select @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= YES;
+select @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= LOGGING;
+select @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= default;
+select @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= 0;
+select @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= 1;
+select @@global.slave_run_triggers_for_rbr;
+SET @@global.slave_run_triggers_for_rbr= 2;
+select @@global.slave_run_triggers_for_rbr;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.slave_run_triggers_for_rbr= 3;
+select @@global.slave_run_triggers_for_rbr;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.slave_run_triggers_for_rbr= "N";
+select @@global.slave_run_triggers_for_rbr;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.slave_run_triggers_for_rbr= -1;
+select @@global.slave_run_triggers_for_rbr;
+
+
+SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
index fef37b5ff4a..b429f9f5cea 100644
--- a/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
@@ -90,14 +90,16 @@ SET @@global.slow_query_log = '';
--echo '#-------------------FN_DYNVARS_004_04----------------------------#'
##################################################################
-# Test if accessing session slow_query_log gives error #
+# Test that accessing session slow_query_log dows not give #
##################################################################
---Error ER_GLOBAL_VARIABLE
+SET @@global.slow_query_log = ON;
+SET @@session.slow_query_log = ON;
+SELECT @@session.slow_query_log;
SET @@session.slow_query_log = OFF;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.slow_query_log;
-
+SET @@global.slow_query_log = OFF;
+SET @@session.slow_query_log = ON;
--echo '#----------------------FN_DYNVARS_004_05------------------------#'
##############################################################################
@@ -132,18 +134,17 @@ SELECT @@global.slow_query_log;
--echo '#---------------------FN_DYNVARS_004_08----------------------#'
##############################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
-# to same session variable #
+# to same session variable (doesn't) #
##############################################################################
SET @@global.slow_query_log = ON;
+SET @@local.slow_query_log = OFF;
SELECT @@slow_query_log = @@global.slow_query_log;
--echo '#---------------------FN_DYNVARS_004_09----------------------#'
######################################################################
# Check if slow_query_log can be accessed with and without @@ sign #
######################################################################
---Error ER_GLOBAL_VARIABLE
-SET slow_query_log = ON;
--Error ER_PARSE_ERROR
SET local.slow_query_log = OFF;
--Error ER_UNKNOWN_TABLE
diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_func.test b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
index dd202ec20ff..2f1d7449976 100644
--- a/mysql-test/suite/sys_vars/t/slow_query_log_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
@@ -10,7 +10,7 @@ SET @@session.long_query_time=1;
SET @@global.log_output = 'TABLE';
#=========================================
---echo '----When slow_query_log = OFF----'
+--echo '----When global.slow_query_log = OFF----'
#=========================================
SET @@global.slow_query_log = OFF;
@@ -21,7 +21,7 @@ SELECT sleep(2);
SELECT count(*) FROM mysql.slow_log;
#=========================================
---echo '----When slow_query_log = ON-----'
+--echo '----When global.slow_query_log = ON-----'
#=========================================
SET @@global.slow_query_log = ON;
@@ -31,6 +31,17 @@ SELECT sleep(2);
SELECT count(*) > 0 FROM mysql.slow_log;
+#=========================================
+--echo '----When local.slow_query_log = OFF-----'
+#=========================================
+
+SET @@local.slow_query_log = OFF;
+TRUNCATE mysql.slow_log;
+# The sleep is the slow query
+SELECT sleep(2);
+
+SELECT count(*) FROM mysql.slow_log;
+SET @@local.slow_query_log = ON;
#==========================================================================
--echo 'Bug#47905 stored procedures not logged correctly to slow query log'
diff --git a/mysql-test/suite/sys_vars/t/sysvars_aria.opt b/mysql-test/suite/sys_vars/t/sysvars_aria.opt
new file mode 100644
index 00000000000..cff8aa5bbd5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_aria.opt
@@ -0,0 +1 @@
+--loose-aria-log-file-size=100M
diff --git a/mysql-test/suite/sys_vars/t/sysvars_aria.test b/mysql-test/suite/sys_vars/t/sysvars_aria.test
new file mode 100644
index 00000000000..5ff5c0d4b2b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_aria.test
@@ -0,0 +1,7 @@
+--source include/have_aria.inc
+--source include/word_size.inc
+
+--vertical_results
+select * from information_schema.system_variables
+ where variable_name like 'aria%'
+ order by variable_name;
diff --git a/mysql-test/suite/sys_vars/t/sysvars_debug.opt b/mysql-test/suite/sys_vars/t/sysvars_debug.opt
new file mode 100644
index 00000000000..016d0f9b9e9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_debug.opt
@@ -0,0 +1 @@
+--loose-debug-binlog-fsync-sleep=314
diff --git a/mysql-test/suite/sys_vars/t/sysvars_debug.test b/mysql-test/suite/sys_vars/t/sysvars_debug.test
new file mode 100644
index 00000000000..fbdcbd683df
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_debug.test
@@ -0,0 +1,7 @@
+--source include/have_debug.inc
+--source include/word_size.inc
+
+--vertical_results
+select * from information_schema.system_variables
+ where variable_name like 'debug%'
+ order by variable_name;
diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.opt b/mysql-test/suite/sys_vars/t/sysvars_innodb.opt
new file mode 100644
index 00000000000..462e83d98b6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.opt
@@ -0,0 +1 @@
+--loose-innodb-flush-log-at-timeout=3
diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.test b/mysql-test/suite/sys_vars/t/sysvars_innodb.test
new file mode 100644
index 00000000000..8faa9bce31a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.test
@@ -0,0 +1,19 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/not_valgrind.inc
+--source include/word_size.inc
+
+if (`select plugin_auth_version <= "5.6.34-79.1" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB as of 10.1.21-MariaDB or earlier
+}
+
+--vertical_results
+--replace_regex /^\/\S+/PATH/ /\.\//PATH/
+select * from information_schema.system_variables
+ where variable_name like 'innodb%' and
+ variable_name not in (
+ 'innodb_disallow_writes', # only available WITH_WSREP
+ 'innodb_sched_priority_cleaner', # linux only
+ 'innodb_use_native_aio') # default value depends on OS
+ order by variable_name;
diff --git a/mysql-test/suite/sys_vars/t/sysvars_server_embedded.test b/mysql-test/suite/sys_vars/t/sysvars_server_embedded.test
new file mode 100644
index 00000000000..adc71925403
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_server_embedded.test
@@ -0,0 +1,2 @@
+source include/is_embedded.inc;
+source inc/sysvars_server.inc;
diff --git a/mysql-test/suite/sys_vars/t/sysvars_server_notembedded.test b/mysql-test/suite/sys_vars/t/sysvars_server_notembedded.test
new file mode 100644
index 00000000000..55f97f9b39d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_server_notembedded.test
@@ -0,0 +1,2 @@
+source include/not_embedded.inc;
+source inc/sysvars_server.inc;
diff --git a/mysql-test/suite/sys_vars/t/sysvars_wsrep.test b/mysql-test/suite/sys_vars/t/sysvars_wsrep.test
new file mode 100644
index 00000000000..c127115efe1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_wsrep.test
@@ -0,0 +1,13 @@
+--source include/have_wsrep.inc
+--source include/word_size.inc
+--let $datadir = `SELECT @@datadir`
+--let $hostname = `SELECT @@hostname`
+
+--replace_result $datadir DATADIR
+--let $hostname_regex=/^$hostname\$/HOSTNAME/
+--replace_regex $hostname_regex /wsrep_[0-9]{2}\.[0-9]{1,2}/wsrep_MAJVER.MINVER/
+--vertical_results
+select * from information_schema.system_variables
+ where variable_name like 'wsrep%'
+ order by variable_name;
+
diff --git a/mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test b/mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test
deleted file mode 100644
index f7616c2c4e9..00000000000
--- a/mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test
+++ /dev/null
@@ -1 +0,0 @@
-select @@table_open_cache_instances;
diff --git a/mysql-test/suite/sys_vars/t/version_ssl_library_basic.test b/mysql-test/suite/sys_vars/t/version_ssl_library_basic.test
new file mode 100644
index 00000000000..3a244084e7f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/version_ssl_library_basic.test
@@ -0,0 +1,2 @@
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set @@global.version_malloc_library=1;
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
index e92a3294b86..598f6cb44fd 100644
--- a/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
@@ -203,6 +203,20 @@ SELECT session.wait_timeout;
--Error ER_BAD_FIELD_ERROR
SELECT wait_timeout = @@session.wait_timeout;
+--echo #
+--echo # MDEV-9516 type error when setting session variable
+--echo #
+
+SET SESSION wait_timeout= 28000;
+SET SESSION wait_timeout= GREATEST(28000, @@wait_timeout);
+SET SESSION wait_timeout= COALESCE(28000, @@wait_timeout);
+SET SESSION wait_timeout= IFNULL(28000, @@wait_timeout);
+SET SESSION wait_timeout= CASE WHEN TRUE THEN 28000 ELSE @@wait_timeout END;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET SESSION wait_timeout= 28000.0;
+--error ER_WRONG_TYPE_FOR_VAR
+SET SESSION wait_timeout= 28000.1;
####################################
# Restore initial value #
diff --git a/mysql-test/suite/sys_vars/t/wsrep_auto_increment_control_basic.test b/mysql-test/suite/sys_vars/t/wsrep_auto_increment_control_basic.test
new file mode 100644
index 00000000000..5dc23cf2ad6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_auto_increment_control_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_auto_increment_control
+--echo #
+
+--echo # save the initial value
+SET @wsrep_auto_increment_control_global_saved = @@global.wsrep_auto_increment_control;
+
+--echo # default
+SELECT @@global.wsrep_auto_increment_control;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_auto_increment_control;
+SET @@global.wsrep_auto_increment_control=OFF;
+SELECT @@global.wsrep_auto_increment_control;
+SET @@global.wsrep_auto_increment_control=ON;
+SELECT @@global.wsrep_auto_increment_control;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_auto_increment_control='OFF';
+SELECT @@global.wsrep_auto_increment_control;
+SET @@global.wsrep_auto_increment_control=ON;
+SELECT @@global.wsrep_auto_increment_control;
+SET @@global.wsrep_auto_increment_control=default;
+SELECT @@global.wsrep_auto_increment_control;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_auto_increment_control=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_auto_increment_control='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_auto_increment_control = @wsrep_auto_increment_control_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test b/mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test
new file mode 100644
index 00000000000..6539e5cba85
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test
@@ -0,0 +1,45 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_causal_reads
+--echo #
+
+--echo # save the initial values
+SET @wsrep_causal_reads_global_saved = @@global.wsrep_causal_reads;
+SET @wsrep_causal_reads_session_saved = @@session.wsrep_causal_reads;
+
+--echo # default
+SELECT @@global.wsrep_causal_reads;
+SELECT @@session.wsrep_causal_reads;
+
+--echo
+--echo # scope and valid values
+SET @@global.wsrep_causal_reads=OFF;
+SELECT @@global.wsrep_causal_reads;
+SET @@global.wsrep_causal_reads=ON;
+SELECT @@global.wsrep_causal_reads;
+
+SET @@session.wsrep_causal_reads=OFF;
+SELECT @@session.wsrep_causal_reads;
+SET @@session.wsrep_causal_reads=ON;
+SELECT @@session.wsrep_causal_reads;
+SET @@session.wsrep_causal_reads=default;
+SELECT @@session.wsrep_causal_reads;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_causal_reads=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_causal_reads='junk';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_causal_reads=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_causal_reads='junk';
+
+--echo
+--echo # restore the initial values
+SET @@global.wsrep_causal_reads = @wsrep_causal_reads_global_saved;
+SET @@session.wsrep_causal_reads = @wsrep_causal_reads_session_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_certify_nonpk_basic.test b/mysql-test/suite/sys_vars/t/wsrep_certify_nonpk_basic.test
new file mode 100644
index 00000000000..a2c690e5954
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_certify_nonpk_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_certify_nonpk
+--echo #
+
+--echo # save the initial value
+SET @wsrep_certify_nonpk_global_saved = @@global.wsrep_certify_nonpk;
+
+--echo # default
+SELECT @@global.wsrep_certify_nonpk;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_certify_nonpk;
+SET @@global.wsrep_certify_nonpk=OFF;
+SELECT @@global.wsrep_certify_nonpk;
+SET @@global.wsrep_certify_nonpk=ON;
+SELECT @@global.wsrep_certify_nonpk;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_certify_nonpk='OFF';
+SELECT @@global.wsrep_certify_nonpk;
+SET @@global.wsrep_certify_nonpk=ON;
+SELECT @@global.wsrep_certify_nonpk;
+SET @@global.wsrep_certify_nonpk=default;
+SELECT @@global.wsrep_certify_nonpk;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_certify_nonpk=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_certify_nonpk='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_certify_nonpk = @wsrep_certify_nonpk_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_cluster_address_basic.test b/mysql-test/suite/sys_vars/t/wsrep_cluster_address_basic.test
new file mode 100644
index 00000000000..136c0745e42
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_cluster_address_basic.test
@@ -0,0 +1,49 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_cluster_address
+--echo #
+
+call mtr.add_suppression("safe_mutex: Found wrong usage of mutex.*");
+
+--echo # save the initial value
+SET @wsrep_cluster_address_global_saved = @@global.wsrep_cluster_address;
+
+--echo # default
+SELECT @@global.wsrep_cluster_address;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_cluster_address;
+SELECT @@global.wsrep_cluster_address;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_cluster_address='127.0.0.1';
+SELECT @@global.wsrep_cluster_address;
+SET @@global.wsrep_cluster_address=AUTO;
+SELECT @@global.wsrep_cluster_address;
+SET @@global.wsrep_cluster_address=default;
+SELECT @@global.wsrep_cluster_address;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_node_address=NULL;
+SELECT @@global.wsrep_node_address;
+# The values being assigned to wsrep_node_address are not verified so the
+# following alues are currently valid too.
+SET @@global.wsrep_cluster_address=ON;
+SELECT @@global.wsrep_cluster_address;
+SET @@global.wsrep_cluster_address='OFF';
+SELECT @@global.wsrep_cluster_address;
+SET @@global.wsrep_cluster_address='junk';
+SELECT @@global.wsrep_cluster_address;
+
+--echo
+--echo # restore the initial value
+--error 0,ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_cluster_address = @wsrep_cluster_address_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_cluster_name_basic.test b/mysql-test/suite/sys_vars/t/wsrep_cluster_name_basic.test
new file mode 100644
index 00000000000..a6fc3ef7b1e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_cluster_name_basic.test
@@ -0,0 +1,40 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_cluster_name
+--echo #
+
+--echo # save the initial value
+SET @wsrep_cluster_name_global_saved = @@global.wsrep_cluster_name;
+
+--echo # default
+SELECT @@global.wsrep_cluster_name;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_cluster_name;
+SET @@global.wsrep_cluster_name='my_galera_cluster';
+SELECT @@global.wsrep_cluster_name;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_cluster_name='my_quoted_galera_cluster';
+SELECT @@global.wsrep_cluster_name;
+SET @@global.wsrep_cluster_name=my_unquoted_cluster;
+SELECT @@global.wsrep_cluster_name;
+SET @@global.wsrep_cluster_name=OFF;
+SELECT @@global.wsrep_cluster_name;
+SET @@global.wsrep_cluster_name=default;
+SELECT @@global.wsrep_cluster_name;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_cluster_name=NULL;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_cluster_name = @wsrep_cluster_name_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_convert_lock_to_trx_basic.test b/mysql-test/suite/sys_vars/t/wsrep_convert_lock_to_trx_basic.test
new file mode 100644
index 00000000000..486832fb394
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_convert_lock_to_trx_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_convert_lock_to_trx
+--echo #
+
+--echo # save the initial value
+SET @wsrep_convert_lock_to_trx_global_saved = @@global.wsrep_convert_lock_to_trx;
+
+--echo # default
+SELECT @@global.wsrep_convert_lock_to_trx;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_convert_lock_to_trx;
+SET @@global.wsrep_convert_lock_to_trx=OFF;
+SELECT @@global.wsrep_convert_lock_to_trx;
+SET @@global.wsrep_convert_lock_to_trx=ON;
+SELECT @@global.wsrep_convert_lock_to_trx;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_convert_lock_to_trx='OFF';
+SELECT @@global.wsrep_convert_lock_to_trx;
+SET @@global.wsrep_convert_lock_to_trx=ON;
+SELECT @@global.wsrep_convert_lock_to_trx;
+SET @@global.wsrep_convert_lock_to_trx=default;
+SELECT @@global.wsrep_convert_lock_to_trx;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_convert_lock_to_trx=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_convert_lock_to_trx='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_convert_lock_to_trx = @wsrep_convert_lock_to_trx_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test b/mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test
new file mode 100644
index 00000000000..646600c7769
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test
@@ -0,0 +1,28 @@
+--source include/have_wsrep.inc
+--let $datadir = `SELECT @@datadir`
+
+--echo #
+--echo # wsrep_data_home_dir (readonly)
+--echo #
+
+--echo # default
+--replace_result $datadir DATADIR
+SELECT @@global.wsrep_data_home_dir;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_data_home_dir;
+
+--echo
+--echo # valid values
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_data_home_dir='/tmp/data';
+--replace_result $datadir DATADIR
+SELECT @@global.wsrep_data_home_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_data_home_dir=default;
+--replace_result $datadir DATADIR
+SELECT @@global.wsrep_data_home_dir;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_dbug_option_basic.test b/mysql-test/suite/sys_vars/t/wsrep_dbug_option_basic.test
new file mode 100644
index 00000000000..80ce190a154
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_dbug_option_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_dbug_option
+--echo #
+
+--echo # save the initial value
+SET @wsrep_dbug_option_global_saved = @@global.wsrep_dbug_option;
+
+--echo # default
+SELECT @@global.wsrep_dbug_option;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_dbug_option;
+SET @@global.wsrep_dbug_option='test-dbug-string';
+SELECT @@global.wsrep_dbug_option;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_dbug_option='quoted-dbug-string';
+SELECT @@global.wsrep_dbug_option;
+SET @@global.wsrep_dbug_option=unquoted_dbug_string;
+SELECT @@global.wsrep_dbug_option;
+SET @@global.wsrep_dbug_option=OFF;
+SELECT @@global.wsrep_dbug_option;
+SET @@global.wsrep_dbug_option=NULL;
+SELECT @@global.wsrep_dbug_option;
+SET @@global.wsrep_dbug_option=default;
+SELECT @@global.wsrep_dbug_option;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_dbug_option=1;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_dbug_option = @wsrep_dbug_option_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_debug_basic.test b/mysql-test/suite/sys_vars/t/wsrep_debug_basic.test
new file mode 100644
index 00000000000..50576ff064e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_debug_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_debug
+--echo #
+
+--echo # save the initial value
+SET @wsrep_debug_global_saved = @@global.wsrep_debug;
+
+--echo # default
+SELECT @@global.wsrep_debug;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_debug;
+SET @@global.wsrep_debug=OFF;
+SELECT @@global.wsrep_debug;
+SET @@global.wsrep_debug=ON;
+SELECT @@global.wsrep_debug;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_debug='OFF';
+SELECT @@global.wsrep_debug;
+SET @@global.wsrep_debug=ON;
+SELECT @@global.wsrep_debug;
+SET @@global.wsrep_debug=default;
+SELECT @@global.wsrep_debug;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_debug=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_debug='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_debug = @wsrep_debug_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_desync_basic.test b/mysql-test/suite/sys_vars/t/wsrep_desync_basic.test
new file mode 100644
index 00000000000..e386004b92f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_desync_basic.test
@@ -0,0 +1,57 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_desync
+--echo #
+
+# expected as no wsrep provider is currently loaded
+call mtr.add_suppression("WSREP: SET desync failed 9 for schema: test, query: SET @@global.wsrep_desync=ON");
+
+--echo # save the initial value
+SET @wsrep_desync_global_saved = @@global.wsrep_desync;
+
+--echo # default
+SELECT @@global.wsrep_desync;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_desync;
+--disable_warnings
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_desync=OFF;
+--enable_warnings
+SELECT @@global.wsrep_desync;
+# expected as no wsrep provider is currently loaded
+--error ER_CANNOT_USER,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_desync=ON;
+SELECT @@global.wsrep_desync;
+
+--echo
+--echo # valid values
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_desync='OFF';
+SELECT @@global.wsrep_desync;
+# expected as no wsrep provider is currently loaded
+--error ER_CANNOT_USER,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_desync=ON;
+SELECT @@global.wsrep_desync;
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_desync=default;
+SELECT @@global.wsrep_desync;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_desync=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_desync='junk';
+
+--echo
+--echo # restore the initial value
+--disable_warnings
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_desync = @wsrep_desync_global_saved;
+--enable_warnings
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test b/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test
new file mode 100644
index 00000000000..ffe767a051b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test
@@ -0,0 +1,48 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_dirty_reads
+--echo #
+
+--echo # save the initial value
+SET @wsrep_dirty_reads_session_saved = @@session.wsrep_dirty_reads;
+
+--echo # default
+
+SELECT @@global.wsrep_dirty_reads;
+SELECT @@session.wsrep_dirty_reads;
+
+--echo
+--echo # valid values for session
+SET @@session.wsrep_dirty_reads=OFF;
+SELECT @@session.wsrep_dirty_reads;
+SET @@session.wsrep_dirty_reads=ON;
+SELECT @@session.wsrep_dirty_reads;
+SET @@session.wsrep_dirty_reads=default;
+SELECT @@session.wsrep_dirty_reads;
+
+--echo
+--echo # valid values for global
+SET @@global.wsrep_dirty_reads=OFF;
+SELECT @@global.wsrep_dirty_reads;
+SET @@global.wsrep_dirty_reads=ON;
+SELECT @@global.wsrep_dirty_reads;
+SET @@global.wsrep_dirty_reads=default;
+SELECT @@global.wsrep_dirty_reads;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_dirty_reads=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_dirty_reads='junk';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_dirty_reads=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_dirty_reads='junk';
+
+--echo
+--echo # restore the initial values
+SET @@session.wsrep_dirty_reads = @wsrep_dirty_reads_session_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_drupal_282555_workaround_basic.test b/mysql-test/suite/sys_vars/t/wsrep_drupal_282555_workaround_basic.test
new file mode 100644
index 00000000000..e24f6a15265
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_drupal_282555_workaround_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_drupal_282555_workaround
+--echo #
+
+--echo # save the initial value
+SET @wsrep_drupal_282555_workaround_global_saved = @@global.wsrep_drupal_282555_workaround;
+
+--echo # default
+SELECT @@global.wsrep_drupal_282555_workaround;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_drupal_282555_workaround;
+SET @@global.wsrep_drupal_282555_workaround=OFF;
+SELECT @@global.wsrep_drupal_282555_workaround;
+SET @@global.wsrep_drupal_282555_workaround=ON;
+SELECT @@global.wsrep_drupal_282555_workaround;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_drupal_282555_workaround='OFF';
+SELECT @@global.wsrep_drupal_282555_workaround;
+SET @@global.wsrep_drupal_282555_workaround=ON;
+SELECT @@global.wsrep_drupal_282555_workaround;
+SET @@global.wsrep_drupal_282555_workaround=default;
+SELECT @@global.wsrep_drupal_282555_workaround;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_drupal_282555_workaround=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_drupal_282555_workaround='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_drupal_282555_workaround = @wsrep_drupal_282555_workaround_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_forced_binlog_format_basic.test b/mysql-test/suite/sys_vars/t/wsrep_forced_binlog_format_basic.test
new file mode 100644
index 00000000000..455034bb623
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_forced_binlog_format_basic.test
@@ -0,0 +1,46 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_forced_binlog_format
+--echo #
+
+--echo # save the initial value
+SET @wsrep_forced_binlog_format_global_saved = @@global.wsrep_forced_binlog_format;
+
+--echo # default
+SELECT @@global.wsrep_forced_binlog_format;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_forced_binlog_format;
+SET @@global.wsrep_forced_binlog_format=STATEMENT;
+SELECT @@global.wsrep_forced_binlog_format;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_forced_binlog_format=STATEMENT;
+SELECT @@global.wsrep_forced_binlog_format;
+SET @@global.wsrep_forced_binlog_format=ROW;
+SELECT @@global.wsrep_forced_binlog_format;
+SET @@global.wsrep_forced_binlog_format=MIXED;
+SELECT @@global.wsrep_forced_binlog_format;
+SET @@global.wsrep_forced_binlog_format=NONE;
+SELECT @@global.wsrep_forced_binlog_format;
+SET @@global.wsrep_forced_binlog_format=default;
+SELECT @@global.wsrep_forced_binlog_format;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_forced_binlog_format=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_forced_binlog_format='junk';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_forced_binlog_format=ON;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_forced_binlog_format = @wsrep_forced_binlog_format_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_gtid_domain_id_basic.test b/mysql-test/suite/sys_vars/t/wsrep_gtid_domain_id_basic.test
new file mode 100644
index 00000000000..5608e46e0b7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_gtid_domain_id_basic.test
@@ -0,0 +1,43 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_gtid_domain_id
+--echo #
+
+--echo # save the initial value
+SET @wsrep_gtid_domain_id_global_saved = @@global.wsrep_gtid_domain_id;
+
+--echo # default
+SELECT @@global.wsrep_gtid_domain_id;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_gtid_domain_id;
+SET @@global.wsrep_gtid_domain_id=1;
+SELECT @@global.wsrep_gtid_domain_id;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_gtid_domain_id=10;
+SELECT @@global.wsrep_gtid_domain_id;
+SET @@global.wsrep_gtid_domain_id=0;
+SELECT @@global.wsrep_gtid_domain_id;
+SET @@global.wsrep_gtid_domain_id=default;
+SELECT @global.wsrep_gtid_domain_id;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_gtid_domain_id=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_gtid_domain_id='junk';
+# expect warning : Truncated incorrect wsrep_gtid_domain_id value: '-1'
+SET @@global.wsrep_gtid_domain_id=-1;
+SELECT @global.wsrep_gtid_domain_id;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_gtid_domain_id = @wsrep_gtid_domain_id_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_gtid_mode_basic.test b/mysql-test/suite/sys_vars/t/wsrep_gtid_mode_basic.test
new file mode 100644
index 00000000000..1a749e18eaa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_gtid_mode_basic.test
@@ -0,0 +1,33 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_gtid_mode
+--echo #
+
+--echo # save the initial value
+SET @wsrep_gtid_mode_global_saved = @@global.wsrep_gtid_mode;
+
+--echo # default
+SELECT @@global.wsrep_gtid_mode;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_gtid_mode;
+
+--echo
+--echo # scope and valid values
+SET @@global.wsrep_gtid_mode=OFF;
+SELECT @@global.wsrep_gtid_mode;
+SET @@global.wsrep_gtid_mode=ON;
+SELECT @@global.wsrep_gtid_mode;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_gtid_mode=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_gtid_mode='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_gtid_mode = @wsrep_gtid_mode_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_load_data_splitting_basic.test b/mysql-test/suite/sys_vars/t/wsrep_load_data_splitting_basic.test
new file mode 100644
index 00000000000..d52e388fc60
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_load_data_splitting_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_load_data_splitting
+--echo #
+
+--echo # save the initial value
+SET @wsrep_load_data_splitting_global_saved = @@global.wsrep_load_data_splitting;
+
+--echo # default
+SELECT @@global.wsrep_load_data_splitting;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_load_data_splitting;
+SET @@global.wsrep_load_data_splitting=OFF;
+SELECT @@global.wsrep_load_data_splitting;
+SET @@global.wsrep_load_data_splitting=ON;
+SELECT @@global.wsrep_load_data_splitting;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_load_data_splitting='OFF';
+SELECT @@global.wsrep_load_data_splitting;
+SET @@global.wsrep_load_data_splitting=ON;
+SELECT @@global.wsrep_load_data_splitting;
+SET @@global.wsrep_load_data_splitting=default;
+SELECT @@global.wsrep_load_data_splitting;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_load_data_splitting=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_load_data_splitting='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_load_data_splitting = @wsrep_load_data_splitting_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_log_conflicts_basic.test b/mysql-test/suite/sys_vars/t/wsrep_log_conflicts_basic.test
new file mode 100644
index 00000000000..eee4d966855
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_log_conflicts_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_log_conflicts
+--echo #
+
+--echo # save the initial value
+SET @wsrep_log_conflicts_global_saved = @@global.wsrep_log_conflicts;
+
+--echo # default
+SELECT @@global.wsrep_log_conflicts;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_log_conflicts;
+SET @@global.wsrep_log_conflicts=OFF;
+SELECT @@global.wsrep_log_conflicts;
+SET @@global.wsrep_log_conflicts=ON;
+SELECT @@global.wsrep_log_conflicts;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_log_conflicts='OFF';
+SELECT @@global.wsrep_log_conflicts;
+SET @@global.wsrep_log_conflicts=ON;
+SELECT @@global.wsrep_log_conflicts;
+SET @@global.wsrep_log_conflicts=default;
+SELECT @@global.wsrep_log_conflicts;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_log_conflicts=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_log_conflicts='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_log_conflicts = @wsrep_log_conflicts_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_max_ws_rows_basic.test b/mysql-test/suite/sys_vars/t/wsrep_max_ws_rows_basic.test
new file mode 100644
index 00000000000..ed78662c02d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_max_ws_rows_basic.test
@@ -0,0 +1,45 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_max_ws_rows
+--echo #
+
+--echo # save the initial value
+SET @wsrep_max_ws_rows_global_saved = @@global.wsrep_max_ws_rows;
+
+--echo # default
+SELECT @@global.wsrep_max_ws_rows;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_max_ws_rows;
+SET @@global.wsrep_max_ws_rows=1;
+SELECT @@global.wsrep_max_ws_rows;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_max_ws_rows=131072;
+SELECT @@global.wsrep_max_ws_rows;
+SET @@global.wsrep_max_ws_rows=131073;
+SELECT @@global.wsrep_max_ws_rows;
+SET @@global.wsrep_max_ws_rows=0;
+SELECT @@global.wsrep_max_ws_rows;
+SET @@global.wsrep_max_ws_rows=default;
+SELECT @global.wsrep_max_ws_rows;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_max_ws_rows=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_max_ws_rows='junk';
+# expect warnings (Truncated incorrect wsrep_max_ws_rows value: '-1')
+SET @@global.wsrep_max_ws_rows=-1;
+SELECT @global.wsrep_max_ws_rows;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_max_ws_rows = @wsrep_max_ws_rows_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test b/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test
new file mode 100644
index 00000000000..50506ed12df
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test
@@ -0,0 +1,44 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_max_ws_size
+--echo #
+
+--echo # default
+SELECT @@global.wsrep_max_ws_size;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_max_ws_size;
+--error ER_WRONG_ARGUMENTS
+SET @@global.wsrep_max_ws_size=1;
+SELECT @@global.wsrep_max_ws_size;
+
+--echo
+--echo # valid values
+--error ER_WRONG_ARGUMENTS
+SET @@global.wsrep_max_ws_size=1073741824;
+SELECT @@global.wsrep_max_ws_size;
+--error ER_WRONG_ARGUMENTS
+SET @@global.wsrep_max_ws_size=1073741825;
+SELECT @@global.wsrep_max_ws_size;
+--error ER_WRONG_ARGUMENTS
+SET @@global.wsrep_max_ws_size=0;
+SELECT @@global.wsrep_max_ws_size;
+--error ER_WRONG_ARGUMENTS
+SET @@global.wsrep_max_ws_size=default;
+SELECT @global.wsrep_max_ws_size;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_max_ws_size=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_max_ws_size='junk';
+SELECT @global.wsrep_max_ws_size;
+--error ER_WRONG_ARGUMENTS
+SET @@global.wsrep_max_ws_size=-1;
+SELECT @global.wsrep_max_ws_size;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_mysql_replication_bundle_basic.test b/mysql-test/suite/sys_vars/t/wsrep_mysql_replication_bundle_basic.test
new file mode 100644
index 00000000000..c293048c43f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_mysql_replication_bundle_basic.test
@@ -0,0 +1,45 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_mysql_replication_bundle
+--echo #
+
+--echo # save the initial value
+SET @wsrep_mysql_replication_bundle_global_saved = @@global.wsrep_mysql_replication_bundle;
+
+--echo # default
+SELECT @@global.wsrep_mysql_replication_bundle;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_mysql_replication_bundle;
+SELECT @@global.wsrep_mysql_replication_bundle;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_mysql_replication_bundle=0;
+SELECT @@global.wsrep_mysql_replication_bundle;
+SET @@global.wsrep_mysql_replication_bundle=1000;
+SELECT @@global.wsrep_mysql_replication_bundle;
+SET @@global.wsrep_mysql_replication_bundle=default;
+SELECT @@global.wsrep_mysql_replication_bundle;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_mysql_replication_bundle=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_mysql_replication_bundle='junk';
+# expect warning (truncated incorrect value)
+SET @@global.wsrep_mysql_replication_bundle=-1;
+SELECT @@global.wsrep_mysql_replication_bundle;
+# expect warning (truncated incorrect value)
+SET @@global.wsrep_mysql_replication_bundle=1001;
+SELECT @@global.wsrep_mysql_replication_bundle;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_mysql_replication_bundle = @wsrep_mysql_replication_bundle_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_node_address_basic.test b/mysql-test/suite/sys_vars/t/wsrep_node_address_basic.test
new file mode 100644
index 00000000000..fccb40de6bf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_node_address_basic.test
@@ -0,0 +1,45 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_node_address
+--echo #
+
+--echo # save the initial value
+SET @wsrep_node_address_global_saved = @@global.wsrep_node_address;
+
+--echo # default
+SELECT @@global.wsrep_node_address;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_node_address;
+SELECT @@global.wsrep_node_address;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_node_address='127.0.0.1';
+SELECT @@global.wsrep_node_address;
+# default == ''
+SET @@global.wsrep_node_address=default;
+SELECT @@global.wsrep_node_address;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_node_address=NULL;
+SELECT @@global.wsrep_node_address;
+# The values being assigned to wsrep_node_address are not verified so the
+# following alues are currently valid too.
+SET @@global.wsrep_node_address=ON;
+SELECT @@global.wsrep_node_address;
+SET @@global.wsrep_node_address='OFF';
+SELECT @@global.wsrep_node_address;
+SET @@global.wsrep_node_address='junk';
+SELECT @@global.wsrep_node_address;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_node_address = @wsrep_node_address_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_node_incoming_address_basic.test b/mysql-test/suite/sys_vars/t/wsrep_node_incoming_address_basic.test
new file mode 100644
index 00000000000..9ab9525d2a9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_node_incoming_address_basic.test
@@ -0,0 +1,47 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_node_incoming_address
+--echo #
+
+--echo # save the initial value
+SET @wsrep_node_incoming_address_global_saved = @@global.wsrep_node_incoming_address;
+
+--echo # default
+SELECT @@global.wsrep_node_incoming_address;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_node_incoming_address;
+SELECT @@global.wsrep_node_incoming_address;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_node_incoming_address='127.0.0.1:4444';
+SELECT @@global.wsrep_node_incoming_address;
+SET @@global.wsrep_node_incoming_address='127.0.0.1';
+SELECT @@global.wsrep_node_incoming_address;
+SET @@global.wsrep_node_incoming_address=AUTO;
+SELECT @@global.wsrep_node_incoming_address;
+SET @@global.wsrep_node_incoming_address=default;
+SELECT @@global.wsrep_node_incoming_address;
+
+--echo
+--echo # invalid values
+# The values being assigned to wsrep_node_incoming_address are not verified so
+# the following values are currently valid too.
+SET @@global.wsrep_node_incoming_address=ON;
+SELECT @@global.wsrep_node_incoming_address;
+SET @@global.wsrep_node_incoming_address='OFF';
+SELECT @@global.wsrep_node_incoming_address;
+SET @@global.wsrep_node_incoming_address=NULL;
+SELECT @@global.wsrep_node_incoming_address;
+SET @@global.wsrep_node_incoming_address='junk';
+SELECT @@global.wsrep_node_incoming_address;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_node_incoming_address = @wsrep_node_incoming_address_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test
new file mode 100644
index 00000000000..7bc9bec8b95
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test
@@ -0,0 +1,54 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_node_name
+--echo #
+
+call mtr.add_suppression("WSREP: Failed to get provider options");
+
+--echo # save the initial value
+SET @wsrep_node_name_global_saved = @@global.wsrep_node_name;
+
+--echo # default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_node_name;
+SET @@global.wsrep_node_name='node_name';
+SELECT @@global.wsrep_node_name;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_node_name='my_node';
+SELECT @@global.wsrep_node_name;
+SET @@global.wsrep_node_name='hyphenated-node-name';
+SELECT @@global.wsrep_node_name;
+SET @@global.wsrep_node_name=default;
+--echo # default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_node_name=NULL;
+SELECT COUNT(@@global.wsrep_node_name);
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_node_name=1;
+SELECT COUNT(@@global.wsrep_node_name);
+
+--echo #
+--echo # MDEV-6699 : wsrep_node_name not automaticly set to hostname
+--echo #
+SET @@global.wsrep_node_name=default;
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname';
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_node_name = @wsrep_node_name_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test b/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
new file mode 100644
index 00000000000..6d1535ba148
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
@@ -0,0 +1,43 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_notify_cmd
+--echo #
+
+call mtr.add_suppression("WSREP: Failed to get provider options");
+
+--echo # save the initial value
+SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
+
+--echo # default
+SELECT @@global.wsrep_notify_cmd;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_notify_cmd;
+SET @@global.wsrep_notify_cmd='notify_cmd';
+SELECT @@global.wsrep_notify_cmd;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_notify_cmd='command';
+SELECT @@global.wsrep_notify_cmd;
+SET @@global.wsrep_notify_cmd='hyphenated-command';
+SELECT @@global.wsrep_notify_cmd;
+SET @@global.wsrep_notify_cmd=default;
+SELECT @@global.wsrep_notify_cmd;
+SET @@global.wsrep_notify_cmd=NULL;
+SELECT @@global.wsrep_notify_cmd;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_notify_cmd=1;
+SELECT @@global.wsrep_notify_cmd;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_on_basic.opt b/mysql-test/suite/sys_vars/t/wsrep_on_basic.opt
new file mode 100644
index 00000000000..aa1fb6cb155
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_on_basic.opt
@@ -0,0 +1 @@
+--innodb-lock-schedule-algorithm=FCFS
diff --git a/mysql-test/suite/sys_vars/t/wsrep_on_basic.test b/mysql-test/suite/sys_vars/t/wsrep_on_basic.test
new file mode 100644
index 00000000000..229d771b5e7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_on_basic.test
@@ -0,0 +1,45 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_on
+--echo #
+
+--echo # save the initial values
+SET @wsrep_on_global_saved = @@global.wsrep_on;
+SET @wsrep_on_session_saved = @@session.wsrep_on;
+
+--echo # default
+SELECT @@global.wsrep_on;
+SELECT @@session.wsrep_on;
+
+--echo
+--echo # scope and valid values
+SET @@global.wsrep_on=OFF;
+SELECT @@global.wsrep_on;
+SET @@global.wsrep_on=ON;
+SELECT @@global.wsrep_on;
+
+SET @@session.wsrep_on=OFF;
+SELECT @@session.wsrep_on;
+SET @@session.wsrep_on=ON;
+SELECT @@session.wsrep_on;
+SET @@session.wsrep_on=default;
+SELECT @@session.wsrep_on;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_on=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_on='junk';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_on=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_on='junk';
+
+--echo
+--echo # restore the initial values
+SET @@global.wsrep_on = @wsrep_on_global_saved;
+SET @@session.wsrep_on = @wsrep_on_session_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_osu_method_basic.test b/mysql-test/suite/sys_vars/t/wsrep_osu_method_basic.test
new file mode 100644
index 00000000000..ce3a3def88b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_osu_method_basic.test
@@ -0,0 +1,49 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_osu_method
+--echo #
+
+--echo # save the initial value
+SET @wsrep_osu_method_global_saved = @@global.wsrep_osu_method;
+
+--echo # default
+SELECT @@global.wsrep_osu_method;
+
+--echo
+--echo # scope
+SELECT @@session.wsrep_osu_method;
+SET @@global.wsrep_osu_method=TOI;
+SELECT @@global.wsrep_osu_method;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_osu_method=TOI;
+SELECT @@global.wsrep_osu_method;
+SET @@global.wsrep_osu_method=RSU;
+SELECT @@global.wsrep_osu_method;
+SET @@global.wsrep_osu_method="RSU";
+SELECT @@global.wsrep_osu_method;
+SET @@global.wsrep_osu_method=default;
+SELECT @@global.wsrep_osu_method;
+# numeric value
+SET @@global.wsrep_osu_method=1;
+SELECT @@global.wsrep_osu_method;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_osu_method=4;
+SELECT @@global.wsrep_osu_method;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_osu_method=NULL;
+SELECT @@global.wsrep_osu_method;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_osu_method='junk';
+SELECT @@global.wsrep_osu_method;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_osu_method = @wsrep_osu_method_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
new file mode 100644
index 00000000000..1190ab41bb0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
@@ -0,0 +1,39 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_provider
+--echo #
+
+--echo # save the initial value
+SET @wsrep_provider_global_saved = @@global.wsrep_provider;
+
+--echo # default
+SELECT @@global.wsrep_provider;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_provider;
+SELECT @@global.wsrep_provider;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_provider=default;
+SELECT @@global.wsrep_provider;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_provider=NULL;
+SELECT @@global.wsrep_provider;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_provider=1;
+SELECT @@global.wsrep_provider;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_provider = @wsrep_provider_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
new file mode 100644
index 00000000000..d2ea32a0637
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
@@ -0,0 +1,51 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_provider_options
+--echo #
+
+call mtr.add_suppression("WSREP: Failed to get provider options");
+
+SET @@global.wsrep_provider = @@global.wsrep_provider;
+
+--echo # save the initial value
+SET @wsrep_provider_options_global_saved = @@global.wsrep_provider_options;
+
+--echo # default
+SELECT @@global.wsrep_provider_options;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_provider_options;
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_provider_options='option1';
+SELECT @@global.wsrep_provider_options;
+
+--echo
+--echo # valid values
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_provider_options='name1=value1;name2=value2';
+SELECT @@global.wsrep_provider_options;
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_provider_options='hyphenated-name:value';
+SELECT @@global.wsrep_provider_options;
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_provider_options=default;
+SELECT @@global.wsrep_provider_options;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_provider_options=1;
+SELECT @@global.wsrep_provider_options;
+--error ER_WRONG_ARGUMENTS,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_provider_options=NULL;
+SELECT @@global.wsrep_provider_options;
+
+--echo
+--echo # restore the initial value
+--error 0,ER_WRONG_ARGUMENTS
+SET @@global.wsrep_provider_options = @wsrep_provider_options_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_recover_basic.test b/mysql-test/suite/sys_vars/t/wsrep_recover_basic.test
new file mode 100644
index 00000000000..f935e12e258
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_recover_basic.test
@@ -0,0 +1,26 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_recover
+--echo #
+
+--echo # default
+SELECT @@global.wsrep_recover;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_recover;
+
+--echo
+--echo # scope and valid values
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_recover=OFF;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_recover=ON;
+
+--echo
+--echo # invalid values
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_recover=NULL;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_recover='junk';
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_replicate_myisam_basic.test b/mysql-test/suite/sys_vars/t/wsrep_replicate_myisam_basic.test
new file mode 100644
index 00000000000..812fb0cfd73
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_replicate_myisam_basic.test
@@ -0,0 +1,36 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_replicate_myisam
+--echo #
+
+--echo # save the initial value
+SET @wsrep_replicate_myisam_global_saved = @@global.wsrep_replicate_myisam;
+
+--echo # default
+SELECT @@global.wsrep_replicate_myisam;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_replicate_myisam;
+
+--echo
+--echo # scope and valid values
+#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+#TODO: check if it is expected for variable to be dynamic?
+SET @@global.wsrep_replicate_myisam=OFF;
+SELECT @@global.wsrep_replicate_myisam;
+#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_replicate_myisam=ON;
+SELECT @@global.wsrep_replicate_myisam;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_replicate_myisam=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_replicate_myisam='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_replicate_myisam = @wsrep_replicate_myisam_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_restart_slave_basic.test b/mysql-test/suite/sys_vars/t/wsrep_restart_slave_basic.test
new file mode 100644
index 00000000000..c656111aed6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_restart_slave_basic.test
@@ -0,0 +1,36 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_restart_slave
+--echo #
+
+--echo # save the initial value
+SET @wsrep_restart_slave_global_saved = @@global.wsrep_restart_slave;
+
+--echo # default
+SELECT @@global.wsrep_restart_slave;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_restart_slave;
+
+--echo
+--echo # scope and valid values
+#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+#TODO: check if it is expected for variable to be dynamic?
+SET @@global.wsrep_restart_slave=OFF;
+SELECT @@global.wsrep_restart_slave;
+#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.wsrep_restart_slave=ON;
+SELECT @@global.wsrep_restart_slave;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_restart_slave=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_restart_slave='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_restart_slave = @wsrep_restart_slave_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_retry_autocommit_basic.test b/mysql-test/suite/sys_vars/t/wsrep_retry_autocommit_basic.test
new file mode 100644
index 00000000000..aa6f27f816d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_retry_autocommit_basic.test
@@ -0,0 +1,52 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_retry_autocommit
+--echo #
+
+--echo # save the initial values
+SET @wsrep_retry_autocommit_global_saved = @@global.wsrep_retry_autocommit;
+SET @wsrep_retry_autocommit_session_saved = @@session.wsrep_retry_autocommit;
+
+--echo # default
+SELECT @@global.wsrep_retry_autocommit;
+
+--echo
+--echo # scope
+SET @@session.wsrep_retry_autocommit=1;
+SELECT @@session.wsrep_retry_autocommit;
+SET @@global.wsrep_retry_autocommit=1;
+SELECT @@global.wsrep_retry_autocommit;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_retry_autocommit=10;
+SELECT @@global.wsrep_retry_autocommit;
+SET @@global.wsrep_retry_autocommit=0;
+SELECT @@global.wsrep_retry_autocommit;
+SET @@global.wsrep_retry_autocommit=default;
+SELECT @global.wsrep_retry_autocommit;
+
+SET @@session.wsrep_retry_autocommit=10;
+SELECT @@session.wsrep_retry_autocommit;
+SET @@session.wsrep_retry_autocommit=0;
+SELECT @@session.wsrep_retry_autocommit;
+SET @@session.wsrep_retry_autocommit=default;
+SELECT @session.wsrep_retry_autocommit;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_retry_autocommit=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_retry_autocommit='junk';
+# expect warning : Truncated incorrect wsrep_retry_autocommit value: '-1'
+SET @@global.wsrep_retry_autocommit=-1;
+SELECT @global.wsrep_retry_autocommit;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_retry_autocommit = @wsrep_retry_autocommit_global_saved;
+SET @@session.wsrep_retry_autocommit = @wsrep_retry_autocommit_session_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_slave_fk_checks_basic.test b/mysql-test/suite/sys_vars/t/wsrep_slave_fk_checks_basic.test
new file mode 100644
index 00000000000..dd60eb8694b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_slave_fk_checks_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_slave_fk_checks
+--echo #
+
+--echo # save the initial value
+SET @wsrep_slave_fk_checks_global_saved = @@global.wsrep_slave_fk_checks;
+
+--echo # default
+SELECT @@global.wsrep_slave_fk_checks;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_slave_fk_checks;
+SET @@global.wsrep_slave_fk_checks=OFF;
+SELECT @@global.wsrep_slave_fk_checks;
+SET @@global.wsrep_slave_fk_checks=ON;
+SELECT @@global.wsrep_slave_fk_checks;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_slave_fk_checks='OFF';
+SELECT @@global.wsrep_slave_fk_checks;
+SET @@global.wsrep_slave_fk_checks=ON;
+SELECT @@global.wsrep_slave_fk_checks;
+SET @@global.wsrep_slave_fk_checks=default;
+SELECT @@global.wsrep_slave_fk_checks;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_slave_fk_checks=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_slave_fk_checks='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_slave_fk_checks = @wsrep_slave_fk_checks_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_slave_threads_basic.test b/mysql-test/suite/sys_vars/t/wsrep_slave_threads_basic.test
new file mode 100644
index 00000000000..80b4648982d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_slave_threads_basic.test
@@ -0,0 +1,43 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_slave_threads
+--echo #
+
+--echo # save the initial value
+SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads;
+
+--echo # default
+SELECT @@global.wsrep_slave_threads;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_slave_threads;
+SET @@global.wsrep_slave_threads=1;
+SELECT @@global.wsrep_slave_threads;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_slave_threads=10;
+SELECT @@global.wsrep_slave_threads;
+SET @@global.wsrep_slave_threads=0;
+SELECT @@global.wsrep_slave_threads;
+SET @@global.wsrep_slave_threads=default;
+SELECT @global.wsrep_slave_threads;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_slave_threads=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_slave_threads='junk';
+# expect warning : Truncated incorrect wsrep_slave_threads value: '-1'
+SET @@global.wsrep_slave_threads=-1;
+SELECT @global.wsrep_slave_threads;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_slave_uk_checks_basic.test b/mysql-test/suite/sys_vars/t/wsrep_slave_uk_checks_basic.test
new file mode 100644
index 00000000000..c9012954371
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_slave_uk_checks_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_slave_uk_checks
+--echo #
+
+--echo # save the initial value
+SET @wsrep_slave_uk_checks_global_saved = @@global.wsrep_slave_uk_checks;
+
+--echo # default
+SELECT @@global.wsrep_slave_uk_checks;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_slave_uk_checks;
+SET @@global.wsrep_slave_uk_checks=OFF;
+SELECT @@global.wsrep_slave_uk_checks;
+SET @@global.wsrep_slave_uk_checks=ON;
+SELECT @@global.wsrep_slave_uk_checks;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_slave_uk_checks='OFF';
+SELECT @@global.wsrep_slave_uk_checks;
+SET @@global.wsrep_slave_uk_checks=ON;
+SELECT @@global.wsrep_slave_uk_checks;
+SET @@global.wsrep_slave_uk_checks=default;
+SELECT @@global.wsrep_slave_uk_checks;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_slave_uk_checks=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_slave_uk_checks='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_slave_uk_checks = @wsrep_slave_uk_checks_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_sst_auth_basic.test b/mysql-test/suite/sys_vars/t/wsrep_sst_auth_basic.test
new file mode 100644
index 00000000000..aa901ef9ff7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_sst_auth_basic.test
@@ -0,0 +1,45 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_sst_auth
+--echo #
+
+--echo # save the initial value
+SET @wsrep_sst_auth_global_saved = @@global.wsrep_sst_auth;
+
+--echo # default
+SELECT @@global.wsrep_sst_auth;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth='user:pass';
+SELECT @@global.wsrep_sst_auth;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_sst_auth=user;
+SELECT @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth='user:1234';
+SELECT @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth='hyphenated-user-name:';
+SELECT @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth=default;
+SELECT @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth=NULL;
+SELECT @@global.wsrep_sst_auth;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_sst_auth=1;
+SELECT @@global.wsrep_sst_auth;
+--error ER_PARSE_ERROR
+SET @@global.wsrep_sst_auth=user:pass;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_sst_auth = @wsrep_sst_auth_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test b/mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test
new file mode 100644
index 00000000000..7d3d6598557
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test
@@ -0,0 +1,43 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_sst_donor
+--echo #
+
+--echo # save the initial value
+SET @wsrep_sst_donor_global_saved = @@global.wsrep_sst_donor;
+
+--echo # default
+SELECT @@global.wsrep_sst_donor;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_sst_donor;
+SET @@global.wsrep_sst_donor=rsync;
+SELECT @@global.wsrep_sst_donor;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_sst_donor=node1;
+SELECT @@global.wsrep_sst_donor;
+SET @@global.wsrep_sst_donor='node1,node2';
+SELECT @@global.wsrep_sst_donor;
+SET @@global.wsrep_sst_donor='hyphenated-donor-name';
+SELECT @@global.wsrep_sst_donor;
+SET @@global.wsrep_sst_donor=default;
+SELECT @@global.wsrep_sst_donor;
+SET @@global.wsrep_sst_donor=NULL;
+SELECT @@global.wsrep_sst_donor;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_sst_donor=1;
+SELECT @@global.wsrep_sst_donor;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_sst_donor = @wsrep_sst_donor_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_sst_donor_rejects_queries_basic.test b/mysql-test/suite/sys_vars/t/wsrep_sst_donor_rejects_queries_basic.test
new file mode 100644
index 00000000000..bd34e23cd2a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_sst_donor_rejects_queries_basic.test
@@ -0,0 +1,42 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_sst_donor_rejects_queries
+--echo #
+
+--echo # save the initial value
+SET @wsrep_sst_donor_rejects_queries_global_saved = @@global.wsrep_sst_donor_rejects_queries;
+
+--echo # default
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_sst_donor_rejects_queries;
+SET @@global.wsrep_sst_donor_rejects_queries=OFF;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+SET @@global.wsrep_sst_donor_rejects_queries=ON;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_sst_donor_rejects_queries='OFF';
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+SET @@global.wsrep_sst_donor_rejects_queries=ON;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+SET @@global.wsrep_sst_donor_rejects_queries=default;
+SELECT @@global.wsrep_sst_donor_rejects_queries;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_sst_donor_rejects_queries=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_sst_donor_rejects_queries='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_sst_donor_rejects_queries = @wsrep_sst_donor_rejects_queries_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_sst_method_basic.test b/mysql-test/suite/sys_vars/t/wsrep_sst_method_basic.test
new file mode 100644
index 00000000000..3f40a3922dd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_sst_method_basic.test
@@ -0,0 +1,47 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_sst_method
+--echo #
+
+--echo # save the initial value
+SET @wsrep_sst_method_global_saved = @@global.wsrep_sst_method;
+
+--echo # default
+SELECT @@global.wsrep_sst_method;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_sst_method;
+SET @@global.wsrep_sst_method=rsync;
+SELECT @@global.wsrep_sst_method;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_sst_method=rsync;
+SELECT @@global.wsrep_sst_method;
+SET @@global.wsrep_sst_method=mysqldump;
+SELECT @@global.wsrep_sst_method;
+SET @@global.wsrep_sst_method=xtrabackup;
+SELECT @@global.wsrep_sst_method;
+SET @@global.wsrep_sst_method="xtrabackup-v2";
+SELECT @@global.wsrep_sst_method;
+SET @@global.wsrep_sst_method=default;
+SELECT @@global.wsrep_sst_method;
+
+# Its a valid name for an SST method
+SET @@global.wsrep_sst_method='junk';
+SELECT @@global.wsrep_sst_method;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_sst_method=NULL;
+SELECT @@global.wsrep_sst_method;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_sst_method = @wsrep_sst_method_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_sst_receive_address_basic.test b/mysql-test/suite/sys_vars/t/wsrep_sst_receive_address_basic.test
new file mode 100644
index 00000000000..9e50cbf8947
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_sst_receive_address_basic.test
@@ -0,0 +1,53 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_sst_receive_address
+--echo #
+
+--echo # save the initial value
+SET @wsrep_sst_receive_address_global_saved = @@global.wsrep_sst_receive_address;
+
+--echo # default
+SELECT @@global.wsrep_sst_receive_address;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_sst_receive_address;
+SELECT @@global.wsrep_sst_receive_address;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_sst_receive_address=AUTO;
+SELECT @@global.wsrep_sst_receive_address;
+SET @@global.wsrep_sst_receive_address=default;
+SELECT @@global.wsrep_sst_receive_address;
+SET @@global.wsrep_sst_receive_address='192.168.2.254';
+SELECT @@global.wsrep_sst_receive_address;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_sst_receive_address='127.0.0.1:4444';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_sst_receive_address='127.0.0.1';
+SELECT @@global.wsrep_sst_receive_address;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_sst_receive_address=NULL;
+SELECT @@global.wsrep_sst_receive_address;
+# Currently there is no strict checking performed for wsrep_sst_receive_address
+# so following values jusr pass through.
+SET @@global.wsrep_sst_receive_address='OFF';
+SELECT @@global.wsrep_sst_receive_address;
+SET @@global.wsrep_sst_receive_address=ON;
+SELECT @@global.wsrep_sst_receive_address;
+SET @@global.wsrep_sst_receive_address='';
+SELECT @@global.wsrep_sst_receive_address;
+SET @@global.wsrep_sst_receive_address='junk';
+SELECT @@global.wsrep_sst_receive_address;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_sst_receive_address = @wsrep_sst_receive_address_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test b/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test
new file mode 100644
index 00000000000..3e57cfa6da2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test
@@ -0,0 +1,56 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_start_position
+--echo #
+
+--echo # save the initial value
+SET @wsrep_start_position_global_saved = @@global.wsrep_start_position;
+
+--echo # default
+SELECT @@global.wsrep_start_position;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_start_position;
+SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-1';
+SELECT @@global.wsrep_start_position;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2';
+SELECT @@global.wsrep_start_position;
+SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100';
+SELECT @@global.wsrep_start_position;
+SET @@global.wsrep_start_position=default;
+SELECT @@global.wsrep_start_position;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='000000000000000-0000-0000-0000-000000000000:-1';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='12345678-1234-1234-12345-123456789012:100';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='12345678-1234-123-12345-123456789012:0';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:_99999';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:a';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='OFF';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position=ON;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_start_position='junk';
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_start_position = @wsrep_start_position_global_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/wsrep_sync_wait_basic.test b/mysql-test/suite/sys_vars/t/wsrep_sync_wait_basic.test
new file mode 100644
index 00000000000..cd0d545f80e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_sync_wait_basic.test
@@ -0,0 +1,47 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_sync_wait
+--echo #
+
+--echo # save the initial values
+SET @wsrep_sync_wait_global_saved = @@global.wsrep_sync_wait;
+SET @wsrep_sync_wait_session_saved = @@session.wsrep_sync_wait;
+
+--echo # default
+SELECT @@global.wsrep_sync_wait;
+SELECT @@session.wsrep_sync_wait;
+
+--echo
+--echo # scope and valid values
+SET @@global.wsrep_sync_wait=0;
+SELECT @@global.wsrep_sync_wait;
+SET @@global.wsrep_sync_wait=7;
+SELECT @@global.wsrep_sync_wait;
+
+SET @@session.wsrep_sync_wait=0;
+SELECT @@session.wsrep_sync_wait;
+SET @@session.wsrep_sync_wait=7;
+SELECT @@session.wsrep_sync_wait;
+SET @@session.wsrep_sync_wait=default;
+SELECT @@session.wsrep_sync_wait;
+SET @@session.wsrep_sync_wait=8;
+SELECT @@session.wsrep_sync_wait;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_sync_wait=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_sync_wait='junk';
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@session.wsrep_sync_wait=NULL;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@session.wsrep_sync_wait='junk';
+
+--echo
+--echo # restore the initial values
+SET @@global.wsrep_sync_wait = @wsrep_sync_wait_global_saved;
+SET @@session.wsrep_sync_wait = @wsrep_sync_wait_session_saved;
+
+--echo # End of test
diff --git a/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc b/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc
index 01f939337ed..571fe75560b 100644
--- a/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc
@@ -87,6 +87,10 @@ create table t1 (a datetime, b datetime as (utc_time()));
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t1 (a datetime, b datetime as (utc_timestamp()));
+--echo # WEEK() - one argument version
+-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a datetime, b datetime as (week(a)));
+
--echo # MATCH()
if (!$skip_full_text_checks)
{
@@ -98,6 +102,18 @@ if (!$skip_full_text_checks)
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
+--echo # CHARSET()
+-- error ER_CONST_EXPR_IN_VCOL
+create table t1 (a varchar(64), b varchar(64) as (charset(a)));
+
+--echo # COERCIBILITY()
+-- error ER_CONST_EXPR_IN_VCOL
+create table t1 (a varchar(64), b int as (coercibility(a)));
+
+--echo # COLLATION()
+-- error ER_CONST_EXPR_IN_VCOL
+create table t1 (a varchar(64), b varchar(64) as (collation(a)));
+
--echo # CONNECTION_ID()
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t1 (a int as (connection_id()));
diff --git a/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc b/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc
index 8c83586109c..5074d672ec4 100644
--- a/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc
+++ b/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc
@@ -141,7 +141,7 @@ show create table t1;
drop table t1;
--echo # Case 14. ALTER. Changing the expression of a virtual stored column.
-create table t1 (a int, b datetime, c int as (week(b)) persistent);
+create table t1 (a int, b datetime, c int as (week(b,0)) persistent);
insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default);
select * from t1;
@@ -151,7 +151,7 @@ show create table t1;
drop table t1;
--echo # Case 15. ALTER. Changing the expression of a virtual non-stored column.
-create table t1 (a int, b datetime, c int as (week(b)));
+create table t1 (a int, b datetime, c int as (week(b,0)));
insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default);
select * from t1;
diff --git a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc b/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
index 559f9ae6eaa..38f2b00a1a0 100644
--- a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
@@ -1068,7 +1068,7 @@ let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
--echo # WEEK()
-let $cols = a datetime, b int as (week(a));
+let $cols = a datetime, b int as (week(a,0));
let $values1 = '2008-09-01',default;
let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
@@ -1142,24 +1142,6 @@ let $values1 = 5,default;
let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
---echo # CHARSET()
-let $cols = a varchar(1024), b varchar(1024) as (charset(a));
-let $values1 = 'abc',default;
-let $rows = 1;
---source suite/vcol/inc/vcol_supported_sql_funcs.inc
-
---echo # COERCIBILITY()
-let $cols = a varchar(1024), b int as (coercibility(a));
-let $values1 = 'abc',default;
-let $rows = 1;
---source suite/vcol/inc/vcol_supported_sql_funcs.inc
-
---echo # COLLATION()
-let $cols = a varchar(1024), b varchar(1024) as (collation(a));
-let $values1 = 'abc',default;
-let $rows = 1;
---source suite/vcol/inc/vcol_supported_sql_funcs.inc
-
--echo # COMPRESS(), UNCOMPRESS()
let $cols = a varchar(1024), b varchar(1024) as (uncompress(compress(a)));
let $values1 = 'MySQL',default;
diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result
index cbb56977a93..7f805459264 100644
--- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result
@@ -54,10 +54,22 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# UTC_TIMESTAMP()
create table t1 (a datetime, b datetime as (utc_timestamp()));
ERROR HY000: Function or expression is not allowed for column 'b'
+# WEEK() - one argument version
+create table t1 (a datetime, b datetime as (week(a)));
+ERROR HY000: Function or expression is not allowed for column 'b'
# MATCH()
# BENCHMARK()
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
ERROR HY000: Function or expression is not allowed for column 'b'
+# CHARSET()
+create table t1 (a varchar(64), b varchar(64) as (charset(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COERCIBILITY()
+create table t1 (a varchar(64), b int as (coercibility(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COLLATION()
+create table t1 (a varchar(64), b varchar(64) as (collation(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
# CONNECTION_ID()
create table t1 (a int as (connection_id()));
ERROR HY000: Function or expression is not allowed for column 'a'
diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result
index 757964ff9f1..1e1e6d6466e 100644
--- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result
@@ -54,12 +54,24 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# UTC_TIMESTAMP()
create table t1 (a datetime, b datetime as (utc_timestamp()));
ERROR HY000: Function or expression is not allowed for column 'b'
+# WEEK() - one argument version
+create table t1 (a datetime, b datetime as (week(a)));
+ERROR HY000: Function or expression is not allowed for column 'b'
# MATCH()
create table t1 (a varchar(32), b bool as (match a against ('sample text')));
ERROR HY000: Function or expression is not allowed for column 'b'
# BENCHMARK()
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
ERROR HY000: Function or expression is not allowed for column 'b'
+# CHARSET()
+create table t1 (a varchar(64), b varchar(64) as (charset(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COERCIBILITY()
+create table t1 (a varchar(64), b int as (coercibility(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COLLATION()
+create table t1 (a varchar(64), b varchar(64) as (collation(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
# CONNECTION_ID()
create table t1 (a int as (connection_id()));
ERROR HY000: Function or expression is not allowed for column 'a'
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 0a8d87dc2f7..179d1b54c21 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -183,15 +183,15 @@ a b c
0 1 y,n
drop table t1,t2;
CREATE TABLE t1 (
-ts TIMESTAMP,
+ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL
) ENGINE=MyISAM;
INSERT INTO t1 (tsv) VALUES (DEFAULT);
Warnings:
-Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
INSERT DELAYED INTO t1 (tsv) VALUES (DEFAULT);
Warnings:
-Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
FLUSH TABLES;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -356,3 +356,48 @@ SET sql_mode=DEFAULT;
#
# End of 5.5 tests
#
+#
+# End of 10.0 tests
+#
+#
+# MDEV-8441 Bad SHOW CREATE TABLE output for a table with a virtual column
+#
+CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` datetime DEFAULT NULL,
+ `b` timestamp AS (TIMESTAMP(a)) VIRTUAL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)),c TIMESTAMP);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` datetime DEFAULT NULL,
+ `b` timestamp AS (TIMESTAMP(a)) VIRTUAL,
+ `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# MDEV-8839 COLUMN_GET() produces warnings with no data
+#
+SET @aaa= COLUMN_CREATE('price', _binary 0xF0F1F2F3F4F5F6F7);
+SELECT COLUMN_GET(@aaa, 'price' AS DECIMAL) aaa;
+aaa
+0
+Warnings:
+Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when converting to DECIMAL
+SELECT COLUMN_GET(@aaa, 'price' AS INT) aaa;
+aaa
+0
+Warnings:
+Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when converting to INT
+SELECT COLUMN_GET(@aaa, 'price' AS DOUBLE) aaa;
+aaa
+0
+Warnings:
+Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when converting to DOUBLE
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result
index 85e89f57090..76482b39d79 100644
--- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result
@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 14. ALTER. Changing the expression of a virtual stored column.
-create table t1 (a int, b datetime, c int as (week(b)) persistent);
+create table t1 (a int, b datetime, c int as (week(b,0)) persistent);
insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default);
select * from t1;
@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 15. ALTER. Changing the expression of a virtual non-stored column.
-create table t1 (a int, b datetime, c int as (week(b)));
+create table t1 (a int, b datetime, c int as (week(b,0)));
insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default);
select * from t1;
diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result
index d73ea923a11..233f6778ca9 100644
--- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result
@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 14. ALTER. Changing the expression of a virtual stored column.
-create table t1 (a int, b datetime, c int as (week(b)) persistent);
+create table t1 (a int, b datetime, c int as (week(b,0)) persistent);
insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default);
select * from t1;
@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 15. ALTER. Changing the expression of a virtual non-stored column.
-create table t1 (a int, b datetime, c int as (week(b)));
+create table t1 (a int, b datetime, c int as (week(b,0)));
insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default);
select * from t1;
diff --git a/mysql-test/suite/vcol/r/vcol_select_innodb.result b/mysql-test/suite/vcol/r/vcol_select_innodb.result
index 97bfbbe4eaf..5c29f5f8283 100644
--- a/mysql-test/suite/vcol/r/vcol_select_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_select_innodb.result
@@ -133,7 +133,7 @@ count(distinct c)
3
explain select count(distinct c) from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by (scanning)
+1 SIMPLE t1 index NULL c 5 NULL 5 Using index
###
### filesort & range-based utils
###
diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result
index 6dee132b3e5..7c371a1008a 100644
--- a/mysql-test/suite/vcol/r/vcol_select_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result
@@ -133,7 +133,7 @@ count(distinct c)
3
explain select count(distinct c) from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by (scanning)
+1 SIMPLE t1 index NULL c 5 NULL 5 Using index
###
### filesort & range-based utils
###
diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result
index 6efdc33d9d8..f9a7e2cc65c 100644
--- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result
@@ -2539,7 +2539,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` timestamp AS (timestamp(a)) VIRTUAL NULL ON UPDATE CURRENT_TIMESTAMP
+ `b` timestamp AS (timestamp(a)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('2008-12-31',default);
select * from t1;
@@ -2554,7 +2554,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL NULL ON UPDATE CURRENT_TIMESTAMP
+ `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('2003-01-02',default);
select * from t1;
@@ -2595,12 +2595,12 @@ drop table t1;
set sql_warnings = 0;
# WEEK()
set sql_warnings = 1;
-create table t1 (a datetime, b int as (week(a)));
+create table t1 (a datetime, b int as (week(a,0)));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` int(11) AS (week(a)) VIRTUAL
+ `b` int(11) AS (week(a,0)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('2008-09-01',default);
select * from t1;
@@ -2756,51 +2756,6 @@ a b
5 2
drop table t1;
set sql_warnings = 0;
-# CHARSET()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (charset(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (charset(a)) VIRTUAL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1
-drop table t1;
-set sql_warnings = 0;
-# COERCIBILITY()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b int as (coercibility(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` int(11) AS (coercibility(a)) VIRTUAL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc 2
-drop table t1;
-set sql_warnings = 0;
-# COLLATION()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (collation(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (collation(a)) VIRTUAL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1_swedish_ci
-drop table t1;
-set sql_warnings = 0;
# COMPRESS(), UNCOMPRESS()
set sql_warnings = 1;
create table t1 (a varchar(1024), b varchar(1024) as (uncompress(compress(a))));
diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
index 65ace7acb65..184b4a441b2 100644
--- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
@@ -2539,7 +2539,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` timestamp AS (timestamp(a)) VIRTUAL NULL ON UPDATE CURRENT_TIMESTAMP
+ `b` timestamp AS (timestamp(a)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('2008-12-31',default);
select * from t1;
@@ -2554,7 +2554,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL NULL ON UPDATE CURRENT_TIMESTAMP
+ `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('2003-01-02',default);
select * from t1;
@@ -2595,12 +2595,12 @@ drop table t1;
set sql_warnings = 0;
# WEEK()
set sql_warnings = 1;
-create table t1 (a datetime, b int as (week(a)));
+create table t1 (a datetime, b int as (week(a,0)));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` int(11) AS (week(a)) VIRTUAL
+ `b` int(11) AS (week(a,0)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('2008-09-01',default);
select * from t1;
@@ -2756,51 +2756,6 @@ a b
5 2
drop table t1;
set sql_warnings = 0;
-# CHARSET()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (charset(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (charset(a)) VIRTUAL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1
-drop table t1;
-set sql_warnings = 0;
-# COERCIBILITY()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b int as (coercibility(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` int(11) AS (coercibility(a)) VIRTUAL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc 2
-drop table t1;
-set sql_warnings = 0;
-# COLLATION()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (collation(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (collation(a)) VIRTUAL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1_swedish_ci
-drop table t1;
-set sql_warnings = 0;
# COMPRESS(), UNCOMPRESS()
set sql_warnings = 1;
create table t1 (a varchar(1024), b varchar(1024) as (uncompress(compress(a))));
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 1ac0b4f80b7..1eed47269c2 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -183,7 +183,7 @@ drop table t1,t2;
#
CREATE TABLE t1 (
- ts TIMESTAMP,
+ ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL
) ENGINE=MyISAM;
@@ -321,3 +321,32 @@ SET sql_mode=DEFAULT;
--echo #
--echo # End of 5.5 tests
--echo #
+
+--echo #
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-8441 Bad SHOW CREATE TABLE output for a table with a virtual column
+--echo #
+CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+# Make sure that if the first TIMESTAMP column appears to be virtual,
+# then no further promotion is done, so the next TIMESTAMP column "c" does not
+# get the "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" attributes.
+CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)),c TIMESTAMP);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8839 COLUMN_GET() produces warnings with no data
+--echo #
+SET @aaa= COLUMN_CREATE('price', _binary 0xF0F1F2F3F4F5F6F7);
+SELECT COLUMN_GET(@aaa, 'price' AS DECIMAL) aaa;
+SELECT COLUMN_GET(@aaa, 'price' AS INT) aaa;
+SELECT COLUMN_GET(@aaa, 'price' AS DOUBLE) aaa;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/suite/wsrep/README b/mysql-test/suite/wsrep/README
new file mode 100644
index 00000000000..988096071a4
--- /dev/null
+++ b/mysql-test/suite/wsrep/README
@@ -0,0 +1,7 @@
+* 'wsrep' suite is designated for tests which do not require a multi-node
+ galera cluster.
+
+* As these tests are specific to wsrep-related functionalities, they must skip
+ on server built without wsrep patch (vanilla). (-DWITH_WSREP=OFF)
+ See : include/have_wsrep.inc, include/have_wsrep_enabled.inc, not_wsrep.inc
+
diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/mysql-test/suite/wsrep/disabled.def
@@ -0,0 +1 @@
+
diff --git a/mysql-test/suite/wsrep/include/check_galera_version.inc b/mysql-test/suite/wsrep/include/check_galera_version.inc
new file mode 100644
index 00000000000..e495da8f1ee
--- /dev/null
+++ b/mysql-test/suite/wsrep/include/check_galera_version.inc
@@ -0,0 +1,39 @@
+# ==== Purpose ====
+# Enable tests to check the galera library version.
+#
+# ==== Usage ====
+# --let $galera_version=3.6
+# source include/check_galera_lib_version.inc;
+#
+# Parameters:
+# $galera_version
+# Version of the galera library required by the test.
+#
+
+--disable_query_log
+
+# Required Version
+
+eval SET @GALERA_VERSION='$galera_version';
+SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @GALERA_MAJOR_VERSION;
+SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @GALERA_MINOR_VERSION;
+
+# Actual
+SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version';
+
+SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MAJOR_VERSION;
+SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION;
+
+# For testing
+#SELECT @GALERA_MAJOR_VERSION, @GALERA_MINOR_VERSION;
+#SELECT @ACTUAL_GALERA_VERSION;
+#SELECT @ACTUAL_GALERA_MAJOR_VERSION, @ACTUAL_GALERA_MINOR_VERSION;
+
+if (!`SELECT (@ACTUAL_GALERA_MAJOR_VERSION > @GALERA_MAJOR_VERSION) OR
+ (@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MINOR_VERSION >= @GALERA_MINOR_VERSION)
+ `)
+{
+ skip Test requires Galera library version $galera_version;
+}
+
+--enable_query_log
diff --git a/mysql-test/suite/wsrep/my.cnf b/mysql-test/suite/wsrep/my.cnf
new file mode 100644
index 00000000000..7e51b0750a1
--- /dev/null
+++ b/mysql-test/suite/wsrep/my.cnf
@@ -0,0 +1,12 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+wsrep-on=1
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
+wsrep_cluster_address='not empty but invalid'
diff --git a/mysql-test/suite/wsrep/r/alter_table_innodb.result b/mysql-test/suite/wsrep/r/alter_table_innodb.result
new file mode 100644
index 00000000000..85017cec6e0
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/alter_table_innodb.result
@@ -0,0 +1,8 @@
+#
+# MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
+#
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
+ALTER TABLE t1 MODIFY i FLOAT;
+DROP TABLE t1;
diff --git a/mysql-test/suite/wsrep/r/binlog_format.result b/mysql-test/suite/wsrep/r/binlog_format.result
new file mode 100644
index 00000000000..1ca90bd626d
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/binlog_format.result
@@ -0,0 +1,61 @@
+call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
+call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine.");
+#
+# MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
+#
+SHOW VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format ROW
+SET binlog_format=STATEMENT;
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
+SHOW WARNINGS;
+Level Code Message
+Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
+SHOW VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format STATEMENT
+CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
+SET binlog_format=MIXED;
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: MIXED
+SHOW WARNINGS;
+Level Code Message
+Warning 1105 MariaDB Galera does not support binlog format: MIXED
+SHOW VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format MIXED
+CREATE TABLE IF NOT EXISTS test.t2 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
+SET binlog_format=ROW;
+SHOW WARNINGS;
+Level Code Message
+SHOW VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format ROW
+CREATE TABLE IF NOT EXISTS test.t3 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+#
+# MDEV-7322: Option to allow setting the binlog_format with Galera
+#
+SET @@GLOBAL.binlog_format=STATEMENT;
+ERROR 42000: Variable 'binlog_format' can't be set to the value of 'STATEMENT'
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format ROW
+SET @@GLOBAL.binlog_format=MIXED;
+ERROR 42000: Variable 'binlog_format' can't be set to the value of 'MIXED'
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format ROW
+SET @@GLOBAL.binlog_format=DEFAULT;
+ERROR 42000: Variable 'binlog_format' can't be set to the value of 'DEFAULT'
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format ROW
+SET @@GLOBAL.binlog_format=ROW;
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format ROW
+# End of test.
diff --git a/mysql-test/suite/wsrep/r/foreign_key.result b/mysql-test/suite/wsrep/r/foreign_key.result
new file mode 100644
index 00000000000..c8407480f17
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/foreign_key.result
@@ -0,0 +1,19 @@
+USE test;
+create table p(v varchar(20), i int, primary key(v,i)) engine=innodb character set = utf8;
+create table c(k int primary key, v varchar(20), i int, foreign key(v,i) references p(v,i)) engine=innodb character set = utf8;
+insert into p values (_utf32 0x000004100000041100000412, 1);
+insert into c values (1, _utf32 0x000004100000041100000412, 1);
+SELECT * FROM test.p;
+v i
+??? 1
+SELECT * FROM test.c;
+k v i
+1 ??? 1
+SELECT * FROM test.p;
+v i
+??? 1
+SELECT * FROM test.c;
+k v i
+1 ??? 1
+DROP TABLE c;
+DROP TABLE p;
diff --git a/mysql-test/suite/wsrep/r/mdev_10186.result b/mysql-test/suite/wsrep/r/mdev_10186.result
new file mode 100644
index 00000000000..778c064d208
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/mdev_10186.result
@@ -0,0 +1,11 @@
+#
+# MDEV-10186: mysqld crash when runtime setting
+# wsrep_cluster_address without wsrep_on=ON
+#
+SELECT @@wsrep_on;
+@@wsrep_on
+0
+SELECT @@GLOBAL.wsrep_provider;
+@@GLOBAL.wsrep_provider
+libgalera_smm.so
+SET @@GLOBAL.wsrep_cluster_address='gcomm://';
diff --git a/mysql-test/suite/wsrep/r/mdev_6832.result b/mysql-test/suite/wsrep/r/mdev_6832.result
new file mode 100644
index 00000000000..43894a6ec49
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/mdev_6832.result
@@ -0,0 +1,11 @@
+#
+# MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
+#
+SHOW STATUS LIKE 'wsrep_ready';
+Variable_name Value
+wsrep_ready ON
+SHOW STATUS LIKE 'wsrep_ready';
+Variable_name Value
+wsrep_ready OFF
+SET @@global.wsrep_cluster_address='gcomm://';
+# End of test.
diff --git a/mysql-test/suite/wsrep/r/mdev_7798.result b/mysql-test/suite/wsrep/r/mdev_7798.result
new file mode 100644
index 00000000000..83a02f3a606
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/mdev_7798.result
@@ -0,0 +1,13 @@
+#
+# MDEV-7798: mysql.server init script can't stop mysqld when WSREP is
+# turned off
+#
+SELECT @@GLOBAL.WSREP_ON;
+@@GLOBAL.WSREP_ON
+1
+SET GLOBAL WSREP_ON= 0;
+Restart the node.
+SELECT @@GLOBAL.WSREP_ON;
+@@GLOBAL.WSREP_ON
+1
+# End of test.
diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
new file mode 100644
index 00000000000..c00a0c73ce3
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
@@ -0,0 +1,78 @@
+#
+# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
+#
+# Verbose run
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
+TRUNCATE TABLE time_zone;
+TRUNCATE TABLE time_zone_name;
+TRUNCATE TABLE time_zone_transition;
+TRUNCATE TABLE time_zone_transition_type;
+INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
+SET @time_zone_id= LAST_INSERT_ID();
+INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
+INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
+ (@time_zone_id, 0, 0, 0, 'GMT')
+;
+Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
+Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/ignored.tab' as time zone. Skipping it.
+INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
+SET @time_zone_id= LAST_INSERT_ID();
+INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
+INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
+ (@time_zone_id, 0, 0, 0, 'GMT')
+;
+Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
+Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zone. Skipping it.
+Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
+ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
+ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
+# Silent run
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
+TRUNCATE TABLE time_zone;
+TRUNCATE TABLE time_zone_name;
+TRUNCATE TABLE time_zone_transition;
+TRUNCATE TABLE time_zone_transition_type;
+INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
+SET @time_zone_id= LAST_INSERT_ID();
+INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
+INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
+ (@time_zone_id, 0, 0, 0, 'GMT')
+;
+Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
+INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
+SET @time_zone_id= LAST_INSERT_ID();
+INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
+INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
+ (@time_zone_id, 0, 0, 0, 'GMT')
+;
+Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
+ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
+ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
+#
+# Testing with explicit timezonefile
+#
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
+INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
+SET @time_zone_id= LAST_INSERT_ID();
+INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
+INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
+ (@time_zone_id, 0, 0, 0, 'GMT')
+;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
+#
+# Testing --leap
+#
+set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
+prepare set_wsrep_myisam from @prep;
+set @toggle=1; execute set_wsrep_myisam using @toggle;
+TRUNCATE TABLE time_zone_leap_second;
+ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
+set @toggle=0; execute set_wsrep_myisam using @toggle;
diff --git a/mysql-test/suite/wsrep/r/plugin.result b/mysql-test/suite/wsrep/r/plugin.result
new file mode 100644
index 00000000000..4f52173cb25
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/plugin.result
@@ -0,0 +1,3 @@
+SELECT plugin_name,plugin_version,plugin_maturity FROM information_schema.plugins where plugin_name like 'wsrep' ORDER BY plugin_maturity,plugin_name;
+plugin_name plugin_version plugin_maturity
+wsrep 1.0 Stable
diff --git a/mysql-test/suite/wsrep/r/pool_of_threads.result b/mysql-test/suite/wsrep/r/pool_of_threads.result
new file mode 100644
index 00000000000..ffe309f2580
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/pool_of_threads.result
@@ -0,0 +1,8 @@
+
+#
+# MDEV#5687: Maria doesn't shutdown following upgrade to 5.5.35-galera
+#
+SELECT @@GLOBAL.thread_handling;
+@@GLOBAL.thread_handling
+pool-of-threads
+# End of test.
diff --git a/mysql-test/suite/wsrep/r/trans.result b/mysql-test/suite/wsrep/r/trans.result
new file mode 100644
index 00000000000..bc225897103
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/trans.result
@@ -0,0 +1,9 @@
+#
+# MDEV-4222 : Assertion `( ((global_system_variables.wsrep_on) &&
+# (thd && thd->variables.wsrep_on)) && srep_emulate_bin_log)
+# || mysql_bin_log .is_open()' fails on SAVEPOINT with
+# disabled wsrep_provider
+#
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+SAVEPOINT A;
+End of test.
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
new file mode 100644
index 00000000000..62d7f62440f
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -0,0 +1,231 @@
+SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
+SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address;
+
+# MDEV#5534: mysql_tzinfo_to_sql generates wrong query
+#
+# Testing wsrep_replicate_myisam variable.
+SELECT @@session.wsrep_replicate_myisam;
+ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable
+SELECT @@global.wsrep_replicate_myisam;
+@@global.wsrep_replicate_myisam
+0
+SET SESSION wsrep_replicate_myisam= ON;
+ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL
+SET GLOBAL wsrep_replicate_myisam= ON;
+SET GLOBAL wsrep_replicate_myisam= OFF;
+SET GLOBAL wsrep_provider=none;
+#
+# MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
+# variables when using "_"
+#
+CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
+SHOW GLOBAL STATUS LIKE 'wsrep%';
+Variable_name Value
+wsrep_apply_oooe #
+wsrep_apply_oool #
+wsrep_apply_window #
+wsrep_causal_reads #
+wsrep_cert_deps_distance #
+wsrep_cert_index_size #
+wsrep_cert_interval #
+wsrep_cluster_conf_id #
+wsrep_cluster_size #
+wsrep_cluster_state_uuid #
+wsrep_cluster_status #
+wsrep_commit_oooe #
+wsrep_commit_oool #
+wsrep_commit_window #
+wsrep_connected #
+wsrep_flow_control_paused #
+wsrep_flow_control_paused_ns #
+wsrep_flow_control_recv #
+wsrep_flow_control_sent #
+wsrep_incoming_addresses #
+wsrep_last_committed #
+wsrep_local_bf_aborts #
+wsrep_local_cached_downto #
+wsrep_local_cert_failures #
+wsrep_local_commits #
+wsrep_local_index #
+wsrep_local_recv_queue #
+wsrep_local_recv_queue_avg #
+wsrep_local_recv_queue_max #
+wsrep_local_recv_queue_min #
+wsrep_local_replays #
+wsrep_local_send_queue #
+wsrep_local_send_queue_avg #
+wsrep_local_send_queue_max #
+wsrep_local_send_queue_min #
+wsrep_local_state #
+wsrep_local_state_comment #
+wsrep_local_state_uuid #
+wsrep_protocol_version #
+wsrep_provider_name #
+wsrep_provider_vendor #
+wsrep_provider_version #
+wsrep_ready #
+wsrep_received #
+wsrep_received_bytes #
+wsrep_repl_data_bytes #
+wsrep_repl_keys #
+wsrep_repl_keys_bytes #
+wsrep_repl_other_bytes #
+wsrep_replicated #
+wsrep_replicated_bytes #
+wsrep_thread_count #
+
+SHOW GLOBAL STATUS LIKE 'wsrep_%';
+Variable_name Value
+wsrep_apply_oooe #
+wsrep_apply_oool #
+wsrep_apply_window #
+wsrep_causal_reads #
+wsrep_cert_deps_distance #
+wsrep_cert_index_size #
+wsrep_cert_interval #
+wsrep_cluster_conf_id #
+wsrep_cluster_size #
+wsrep_cluster_state_uuid #
+wsrep_cluster_status #
+wsrep_commit_oooe #
+wsrep_commit_oool #
+wsrep_commit_window #
+wsrep_connected #
+wsrep_flow_control_paused #
+wsrep_flow_control_paused_ns #
+wsrep_flow_control_recv #
+wsrep_flow_control_sent #
+wsrep_incoming_addresses #
+wsrep_last_committed #
+wsrep_local_bf_aborts #
+wsrep_local_cached_downto #
+wsrep_local_cert_failures #
+wsrep_local_commits #
+wsrep_local_index #
+wsrep_local_recv_queue #
+wsrep_local_recv_queue_avg #
+wsrep_local_recv_queue_max #
+wsrep_local_recv_queue_min #
+wsrep_local_replays #
+wsrep_local_send_queue #
+wsrep_local_send_queue_avg #
+wsrep_local_send_queue_max #
+wsrep_local_send_queue_min #
+wsrep_local_state #
+wsrep_local_state_comment #
+wsrep_local_state_uuid #
+wsrep_protocol_version #
+wsrep_provider_name #
+wsrep_provider_vendor #
+wsrep_provider_version #
+wsrep_ready #
+wsrep_received #
+wsrep_received_bytes #
+wsrep_repl_data_bytes #
+wsrep_repl_keys #
+wsrep_repl_keys_bytes #
+wsrep_repl_other_bytes #
+wsrep_replicated #
+wsrep_replicated_bytes #
+wsrep_thread_count #
+SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
+Variable_name Value
+wsrep_local_state_comment #
+# Should show nothing.
+SHOW STATUS LIKE 'x';
+Variable_name Value
+SET GLOBAL wsrep_provider=none;
+#
+# MDEV#6079: xtrabackup SST failing with maria-10.0-galera
+#
+
+SHOW STATUS LIKE 'wsrep_local_state_uuid';
+Variable_name Value
+wsrep_local_state_uuid #
+
+SHOW STATUS LIKE 'wsrep_last_committed';
+Variable_name Value
+wsrep_last_committed #
+SET GLOBAL wsrep_provider=none;
+
+#
+# MDEV#6206: wsrep_slave_threads subtracts from max_connections
+#
+call mtr.add_suppression("WSREP: Failed to get provider options");
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+libgalera_smm.so
+SELECT @@global.wsrep_slave_threads;
+@@global.wsrep_slave_threads
+1
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+NULL
+SHOW STATUS LIKE 'threads_connected';
+Variable_name Value
+Threads_connected 1
+SHOW STATUS LIKE 'wsrep_thread_count';
+Variable_name Value
+wsrep_thread_count 0
+
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+libgalera_smm.so
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+NULL
+SHOW STATUS LIKE 'threads_connected';
+Variable_name Value
+Threads_connected 1
+SHOW STATUS LIKE 'wsrep_thread_count';
+Variable_name Value
+wsrep_thread_count 0
+
+# Setting wsrep_cluster_address triggers the creation of
+# applier/rollbacker threads.
+SET GLOBAL wsrep_cluster_address= 'gcomm://';
+# Wait for applier threads to get created.
+SELECT @@global.wsrep_provider;
+@@global.wsrep_provider
+libgalera_smm.so
+SELECT @@global.wsrep_cluster_address;
+@@global.wsrep_cluster_address
+gcomm://
+SHOW STATUS LIKE 'threads_connected';
+Variable_name Value
+Threads_connected 1
+SHOW STATUS LIKE 'wsrep_thread_count';
+Variable_name Value
+wsrep_thread_count 2
+
+SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads;
+SET GLOBAL wsrep_slave_threads= 10;
+# Wait for applier threads to get created.
+SHOW STATUS LIKE 'threads_connected';
+Variable_name Value
+Threads_connected 1
+SHOW STATUS LIKE 'wsrep_thread_count';
+Variable_name Value
+wsrep_thread_count 11
+#
+# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
+#
+SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth= 'user:pass';
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+********
+SET @@global.wsrep_sst_auth= '';
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+
+SET @@global.wsrep_sst_auth= NULL;
+SELECT @@global.wsrep_sst_auth;
+@@global.wsrep_sst_auth
+NULL
+SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
+SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
+SET GLOBAL wsrep_provider= none;
+SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved;
+SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
+# End of test.
diff --git a/mysql-test/suite/wsrep/r/wsrep_rpl.result b/mysql-test/suite/wsrep/r/wsrep_rpl.result
new file mode 100644
index 00000000000..a5db3b28ec0
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/wsrep_rpl.result
@@ -0,0 +1,22 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-10714: Could not execute Delete_rows event on table;
+# wsrep_max_ws_rows exceeded. Error_Code 1180
+#
+CREATE TABLE t1(i INT) ENGINE = INNODB;
+SET @@GLOBAL.wsrep_max_ws_rows = 2;
+INSERT INTO t1 VALUES(1), (2);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+SET @@GLOBAL.wsrep_max_ws_rows = 2;
+DELETE FROM t1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+SET @@GLOBAL.wsrep_max_ws_rows = 0;
+SET @@GLOBAL.wsrep_max_ws_rows = 0;
+include/rpl_end.inc
+# End of test.
diff --git a/mysql-test/suite/wsrep/suite.pm b/mysql-test/suite/wsrep/suite.pm
new file mode 100644
index 00000000000..b6c5bf15ca1
--- /dev/null
+++ b/mysql-test/suite/wsrep/suite.pm
@@ -0,0 +1,36 @@
+package My::Suite::WSREP;
+use File::Basename;
+use My::Find;
+
+@ISA = qw(My::Suite);
+
+return "Not run for embedded server" if $::opt_embedded_server;
+
+return "WSREP is not compiled in" unless defined $::mysqld_variables{'wsrep-on'};
+
+my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
+ "/usr/lib/galera/libgalera_smm.so",
+ "/usr/lib64/galera/libgalera_smm.so";
+
+return "No wsrep provider library" unless -f $provider;
+
+$ENV{WSREP_PROVIDER} = $provider;
+
+my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
+return "No SST scripts" unless $spath;
+
+my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
+return "No my_print_defaults" unless $epath;
+
+push @::global_suppressions,
+ (
+ qr(WSREP: Could not open saved state file for reading: .*),
+ qr(WSREP: Could not open state file for reading: .*),
+ qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|,
+ );
+
+$ENV{PATH}="$epath:$ENV{PATH}";
+$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
+
+bless { };
+
diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.opt b/mysql-test/suite/wsrep/t/alter_table_innodb.opt
new file mode 100644
index 00000000000..1e84570d7f6
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/alter_table_innodb.opt
@@ -0,0 +1 @@
+--wsrep-on=0
diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.test b/mysql-test/suite/wsrep/t/alter_table_innodb.test
new file mode 100644
index 00000000000..ca06be02a85
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/alter_table_innodb.test
@@ -0,0 +1,10 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
+--echo #
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
+ALTER TABLE t1 MODIFY i FLOAT;
+DROP TABLE t1;
diff --git a/mysql-test/suite/wsrep/t/binlog_format.opt b/mysql-test/suite/wsrep/t/binlog_format.opt
new file mode 100644
index 00000000000..e3f2470c6e5
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/binlog_format.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
diff --git a/mysql-test/suite/wsrep/t/binlog_format.test b/mysql-test/suite/wsrep/t/binlog_format.test
new file mode 100644
index 00000000000..85864256862
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/binlog_format.test
@@ -0,0 +1,47 @@
+--source include/have_wsrep_provider.inc
+--source include/have_binlog_format_row.inc
+
+call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
+call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine.");
+
+--echo #
+--echo # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
+--echo #
+
+SHOW VARIABLES LIKE 'binlog_format';
+SET binlog_format=STATEMENT;
+SHOW WARNINGS;
+SHOW VARIABLES LIKE 'binlog_format';
+CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
+SET binlog_format=MIXED;
+SHOW WARNINGS;
+SHOW VARIABLES LIKE 'binlog_format';
+CREATE TABLE IF NOT EXISTS test.t2 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
+SET binlog_format=ROW;
+SHOW WARNINGS;
+SHOW VARIABLES LIKE 'binlog_format';
+CREATE TABLE IF NOT EXISTS test.t3 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+
+--echo #
+--echo # MDEV-7322: Option to allow setting the binlog_format with Galera
+--echo #
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET @@GLOBAL.binlog_format=STATEMENT;
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET @@GLOBAL.binlog_format=MIXED;
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET @@GLOBAL.binlog_format=DEFAULT;
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+
+SET @@GLOBAL.binlog_format=ROW;
+SHOW GLOBAL VARIABLES LIKE 'binlog_format';
+
+--echo # End of test.
diff --git a/mysql-test/suite/wsrep/t/foreign_key.opt b/mysql-test/suite/wsrep/t/foreign_key.opt
new file mode 100644
index 00000000000..e3f2470c6e5
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/foreign_key.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
diff --git a/mysql-test/suite/wsrep/t/foreign_key.test b/mysql-test/suite/wsrep/t/foreign_key.test
new file mode 100644
index 00000000000..71f6076a1d7
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/foreign_key.test
@@ -0,0 +1,20 @@
+--source include/have_wsrep_enabled.inc
+--source include/have_binlog_format_row.inc
+--source include/have_innodb.inc
+
+USE test;
+create table p(v varchar(20), i int, primary key(v,i)) engine=innodb character set = utf8;
+create table c(k int primary key, v varchar(20), i int, foreign key(v,i) references p(v,i)) engine=innodb character set = utf8;
+insert into p values (_utf32 0x000004100000041100000412, 1);
+insert into c values (1, _utf32 0x000004100000041100000412, 1);
+
+SELECT * FROM test.p;
+SELECT * FROM test.c;
+
+SELECT * FROM test.p;
+SELECT * FROM test.c;
+
+# Cleanup
+DROP TABLE c;
+DROP TABLE p;
+
diff --git a/mysql-test/suite/wsrep/t/mdev_10186.opt b/mysql-test/suite/wsrep/t/mdev_10186.opt
new file mode 100644
index 00000000000..e2655959c62
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_10186.opt
@@ -0,0 +1 @@
+--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=0
diff --git a/mysql-test/suite/wsrep/t/mdev_10186.test b/mysql-test/suite/wsrep/t/mdev_10186.test
new file mode 100644
index 00000000000..98ea5192634
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_10186.test
@@ -0,0 +1,13 @@
+--source include/have_wsrep_provider.inc
+--source include/have_binlog_format_row.inc
+
+--echo #
+--echo # MDEV-10186: mysqld crash when runtime setting
+--echo # wsrep_cluster_address without wsrep_on=ON
+--echo #
+
+SELECT @@wsrep_on;
+--replace_regex /.*libgalera_smm.so/libgalera_smm.so/
+SELECT @@GLOBAL.wsrep_provider;
+SET @@GLOBAL.wsrep_cluster_address='gcomm://';
+
diff --git a/mysql-test/suite/wsrep/t/mdev_6832.opt b/mysql-test/suite/wsrep/t/mdev_6832.opt
new file mode 100644
index 00000000000..16f8962dba2
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_6832.opt
@@ -0,0 +1 @@
+--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1
diff --git a/mysql-test/suite/wsrep/t/mdev_6832.test b/mysql-test/suite/wsrep/t/mdev_6832.test
new file mode 100644
index 00000000000..9efccface57
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_6832.test
@@ -0,0 +1,15 @@
+--source include/have_wsrep_provider.inc
+--source include/have_binlog_format_row.inc
+
+--echo #
+--echo # MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
+--echo #
+
+SHOW STATUS LIKE 'wsrep_ready';
+--disable_query_log
+eval SET @@global.wsrep_provider='$WSREP_PROVIDER';
+--enable_query_log
+SHOW STATUS LIKE 'wsrep_ready';
+SET @@global.wsrep_cluster_address='gcomm://';
+
+--echo # End of test.
diff --git a/mysql-test/suite/wsrep/t/mdev_7798.opt b/mysql-test/suite/wsrep/t/mdev_7798.opt
new file mode 100644
index 00000000000..1007d5c0b78
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_7798.opt
@@ -0,0 +1 @@
+--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1
diff --git a/mysql-test/suite/wsrep/t/mdev_7798.test b/mysql-test/suite/wsrep/t/mdev_7798.test
new file mode 100644
index 00000000000..9dfff0959bc
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_7798.test
@@ -0,0 +1,17 @@
+--source include/have_wsrep_provider.inc
+--source include/have_binlog_format_row.inc
+
+--echo #
+--echo # MDEV-7798: mysql.server init script can't stop mysqld when WSREP is
+--echo # turned off
+--echo #
+
+SELECT @@GLOBAL.WSREP_ON;
+SET GLOBAL WSREP_ON= 0;
+
+--echo Restart the node.
+--source include/restart_mysqld.inc
+
+SELECT @@GLOBAL.WSREP_ON;
+
+--echo # End of test.
diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test
new file mode 100644
index 00000000000..100e09d3afb
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test
@@ -0,0 +1,40 @@
+--source include/have_wsrep.inc
+--source include/have_symlink.inc
+--source include/not_windows.inc
+
+--echo #
+--echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
+--echo #
+
+--exec mkdir $MYSQLTEST_VARDIR/zoneinfo
+--exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix
+--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT
+--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/garbage
+--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/ignored.tab
+
+--echo # Verbose run
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQL_TZINFO_TO_SQL --verbose $MYSQLTEST_VARDIR/zoneinfo 2>&1
+
+--echo # Silent run
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1
+
+--echo #
+--echo # Testing with explicit timezonefile
+--echo #
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1
+
+--echo #
+--echo # Testing --leap
+--echo #
+
+--exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1
+
+#
+# Cleanup
+#
+
+--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo
diff --git a/mysql-test/suite/wsrep/t/plugin.test b/mysql-test/suite/wsrep/t/plugin.test
new file mode 100644
index 00000000000..60738440a55
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/plugin.test
@@ -0,0 +1,7 @@
+--source include/have_wsrep.inc
+
+#
+# MDEV-7604: wsrep plugin lists its status as Unknown
+#
+
+SELECT plugin_name,plugin_version,plugin_maturity FROM information_schema.plugins where plugin_name like 'wsrep' ORDER BY plugin_maturity,plugin_name; \ No newline at end of file
diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.opt b/mysql-test/suite/wsrep/t/pool_of_threads.opt
new file mode 100644
index 00000000000..814417e5b0f
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/pool_of_threads.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads
diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.test b/mysql-test/suite/wsrep/t/pool_of_threads.test
new file mode 100644
index 00000000000..dbf429e3f01
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/pool_of_threads.test
@@ -0,0 +1,12 @@
+--source include/have_wsrep.inc
+--source include/have_binlog_format_row.inc
+
+--echo
+--echo #
+--echo # MDEV#5687: Maria doesn't shutdown following upgrade to 5.5.35-galera
+--echo #
+
+# Note: This test is to ensure that server shuts down properly.
+SELECT @@GLOBAL.thread_handling;
+
+--echo # End of test.
diff --git a/mysql-test/suite/wsrep/t/trans.test b/mysql-test/suite/wsrep/t/trans.test
new file mode 100644
index 00000000000..d8c4a4722a0
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/trans.test
@@ -0,0 +1,14 @@
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-4222 : Assertion `( ((global_system_variables.wsrep_on) &&
+--echo # (thd && thd->variables.wsrep_on)) && srep_emulate_bin_log)
+--echo # || mysql_bin_log .is_open()' fails on SAVEPOINT with
+--echo # disabled wsrep_provider
+--echo #
+
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+SAVEPOINT A;
+
+--echo End of test.
diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
new file mode 100644
index 00000000000..1769f567848
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/variables.test
@@ -0,0 +1,140 @@
+--source include/have_wsrep.inc
+
+SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
+SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address;
+
+--echo
+--echo # MDEV#5534: mysql_tzinfo_to_sql generates wrong query
+--echo #
+--echo # Testing wsrep_replicate_myisam variable.
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_replicate_myisam;
+SELECT @@global.wsrep_replicate_myisam;
+
+--error ER_GLOBAL_VARIABLE
+SET SESSION wsrep_replicate_myisam= ON;
+SET GLOBAL wsrep_replicate_myisam= ON;
+
+# Reset it back.
+SET GLOBAL wsrep_replicate_myisam= OFF;
+SET GLOBAL wsrep_provider=none;
+
+--echo #
+--echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
+--echo # variables when using "_"
+--echo #
+
+CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
+
+--disable_query_log
+eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
+--let $galera_version=25.3.17
+source include/check_galera_version.inc;
+--enable_query_log
+
+--replace_column 2 #
+SHOW GLOBAL STATUS LIKE 'wsrep%';
+
+--echo
+--replace_column 2 #
+SHOW GLOBAL STATUS LIKE 'wsrep_%';
+
+--replace_column 2 #
+SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
+
+--echo # Should show nothing.
+SHOW STATUS LIKE 'x';
+
+# Reset it back.
+SET GLOBAL wsrep_provider=none;
+
+--echo #
+--echo # MDEV#6079: xtrabackup SST failing with maria-10.0-galera
+--echo #
+
+--disable_query_log
+eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
+--enable_query_log
+
+# The following 2 variables are used in innobackupex during xtrabackup-based
+# SST.
+--echo
+--replace_column 2 #
+SHOW STATUS LIKE 'wsrep_local_state_uuid';
+--echo
+--replace_column 2 #
+SHOW STATUS LIKE 'wsrep_last_committed';
+
+# Reset it back.
+SET GLOBAL wsrep_provider=none;
+
+--echo
+--echo #
+--echo # MDEV#6206: wsrep_slave_threads subtracts from max_connections
+--echo #
+call mtr.add_suppression("WSREP: Failed to get provider options");
+
+--disable_query_log
+eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
+--enable_query_log
+
+--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
+SELECT @@global.wsrep_provider;
+SELECT @@global.wsrep_slave_threads;
+SELECT @@global.wsrep_cluster_address;
+SHOW STATUS LIKE 'threads_connected';
+SHOW STATUS LIKE 'wsrep_thread_count';
+--echo
+
+--disable_query_log
+eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
+--enable_query_log
+
+--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
+SELECT @@global.wsrep_provider;
+SELECT @@global.wsrep_cluster_address;
+SHOW STATUS LIKE 'threads_connected';
+SHOW STATUS LIKE 'wsrep_thread_count';
+--echo
+
+--echo # Setting wsrep_cluster_address triggers the creation of
+--echo # applier/rollbacker threads.
+SET GLOBAL wsrep_cluster_address= 'gcomm://';
+--echo # Wait for applier threads to get created.
+sleep 3;
+
+--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
+SELECT @@global.wsrep_provider;
+SELECT @@global.wsrep_cluster_address;
+SHOW STATUS LIKE 'threads_connected';
+SHOW STATUS LIKE 'wsrep_thread_count';
+--echo
+
+SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads;
+SET GLOBAL wsrep_slave_threads= 10;
+--echo # Wait for applier threads to get created.
+sleep 3;
+SHOW STATUS LIKE 'threads_connected';
+SHOW STATUS LIKE 'wsrep_thread_count';
+
+--echo #
+--echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
+--echo #
+SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth= 'user:pass';
+SELECT @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth= '';
+SELECT @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth= NULL;
+SELECT @@global.wsrep_sst_auth;
+SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
+
+# Reset (for mtr internal checks)
+SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
+SET GLOBAL wsrep_provider= none;
+SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved;
+SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
+
+--echo # End of test.
+
diff --git a/mysql-test/suite/wsrep/t/wsrep_rpl.cnf b/mysql-test/suite/wsrep/t/wsrep_rpl.cnf
new file mode 100644
index 00000000000..56e874f22e1
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_rpl.cnf
@@ -0,0 +1 @@
+!include ../../rpl/my.cnf
diff --git a/mysql-test/suite/wsrep/t/wsrep_rpl.test b/mysql-test/suite/wsrep/t/wsrep_rpl.test
new file mode 100644
index 00000000000..4f34aadc365
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_rpl.test
@@ -0,0 +1,44 @@
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-10714: Could not execute Delete_rows event on table;
+--echo # wsrep_max_ws_rows exceeded. Error_Code 1180
+--echo #
+# Save wsrep_max_ws_rows on master and slave.
+connection master;
+let $wsrep_max_ws_rows_master = `SELECT @@GLOBAL.wsrep_max_ws_rows`;
+connection slave;
+let $wsrep_max_ws_rows_slave = `SELECT @@GLOBAL.wsrep_max_ws_rows`;
+
+connection master;
+CREATE TABLE t1(i INT) ENGINE = INNODB;
+
+SET @@GLOBAL.wsrep_max_ws_rows = 2;
+INSERT INTO t1 VALUES(1), (2);
+sync_slave_with_master;
+SELECT COUNT(*) = 2 FROM t1;
+
+connection slave;
+SET @@GLOBAL.wsrep_max_ws_rows = 2;
+
+connection master;
+DELETE FROM t1;
+
+sync_slave_with_master;
+SELECT COUNT(*) = 0 FROM t1;
+
+connection master;
+DROP TABLE t1;
+
+sync_slave_with_master;
+# Restore wsrep_max_ws_rows on master and slave
+connection master;
+eval SET @@GLOBAL.wsrep_max_ws_rows = $wsrep_max_ws_rows_master;
+connection slave;
+eval SET @@GLOBAL.wsrep_max_ws_rows = $wsrep_max_ws_rows_slave;
+
+--source include/rpl_end.inc
+--echo # End of test.
+
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 8fcc7d044e5..5cb33516ed2 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1783,14 +1783,14 @@ DROP TABLE `tab1`;
--echo #
--echo # MDEV-11548 Reproducible server crash after the 2nd ALTER TABLE ADD FOREIGN KEY IF NOT EXISTS
--echo #
-
+
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY);
CREATE TABLE t2 (id1 INT UNSIGNED NOT NULL);
-
+
ALTER TABLE t2
ADD FOREIGN KEY IF NOT EXISTS (id1)
REFERENCES t1 (id);
-
+
ALTER TABLE t2
ADD FOREIGN KEY IF NOT EXISTS (id1)
REFERENCES t1 (id);
@@ -1798,14 +1798,39 @@ REFERENCES t1 (id);
DROP TABLE t2;
DROP TABLE t1;
-
--echo #
--echo # MDEV-6390 CONVERT TO CHARACTER SET utf8 doesn't change DEFAULT CHARSET.
--echo #
-
+
CREATE TABLE t1 (id int(11) NOT NULL, a int(11) NOT NULL, b int(11))
ENGINE=InnoDB DEFAULT CHARSET=latin1;
SHOW CREATE TABLE t1;
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+--echo #
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
+--echo #
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
+ALTER TABLE t1 MODIFY i FLOAT;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment
+--echo #
+CREATE TABLE t1(a INT);
+CREATE INDEX i1 ON t1(a) COMMENT 'comment1';
+ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2';
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test
index 9062ecba35a..f5a40734535 100644
--- a/mysql-test/t/alter_table_online.test
+++ b/mysql-test/t/alter_table_online.test
@@ -286,3 +286,27 @@ ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
DROP TABLE t1;
# End of 10.0 tests
+
+#
+# MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rows
+#
+select @@global.delay_key_write;
+create table t1 (a int, b int, key(b));
+flush tables;
+flush status;
+show status like 'Feature_delay_key_write';
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+alter online table t1 delay_key_write=1;
+show status like 'Feature_delay_key_write';
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+alter online table t1 delay_key_write=0;
+show status like 'Feature_delay_key_write';
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+drop table t1;
+
+# End of 10.1 tests
diff --git a/mysql-test/t/analyze_format_json.test b/mysql-test/t/analyze_format_json.test
new file mode 100644
index 00000000000..88a907718d9
--- /dev/null
+++ b/mysql-test/t/analyze_format_json.test
@@ -0,0 +1,214 @@
+#
+# Tests for "ANALYZE FORMAT=JSON $statement" syntax
+#
+--disable_warnings
+drop table if exists t0,t1,t2,t3;
+--enable_warnings
+
+create table t0 (a int);
+INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+--echo # r_filtered=30%, because 3 rows match: 0,1,2
+--source include/analyze-format.inc
+analyze format=json select * from t0 where a<3;
+
+create table t1 (a int, b int, c int, key(a));
+insert into t1 select A.a*10 + B.a, A.a*10 + B.a, A.a*10 + B.a from t0 A, t0 B;
+
+--source include/analyze-format.inc
+analyze
+select * from t0, t1 where t1.a=t0.a and t0.a > 9;
+--source include/analyze-format.inc
+analyze format=json
+select * from t0, t1 where t1.a=t0.a and t0.a > 9;
+
+analyze
+select * from t0, t1 where t1.a=t0.a and t1.b<4;
+
+--source include/analyze-format.inc
+analyze format=json
+select * from t0, t1 where t1.a=t0.a and t1.b<4;
+
+analyze
+select * from t1 tbl1, t1 tbl2 where tbl1.b<2 and tbl2.b>5;
+
+--source include/analyze-format.inc
+analyze format=json
+select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60;
+
+--source include/analyze-format.inc
+analyze format=json
+select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60 and tbl1.c > tbl2.c;
+
+drop table t1;
+drop table t0;
+
+--echo #
+--echo # MDEV-7674: ANALYZE shows r_rows=0
+--echo #
+
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t2 (a int, key(a));
+insert into t2 values (0),(1);
+
+--source include/analyze-format.inc
+analyze format=json select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
+
+drop table t1,t2;
+
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+--echo #
+--echo # MDEV-7679: ANALYZE crashes when printing WHERE when no default db
+--echo #
+
+select database();
+connect (con1,localhost,root,,*NO-ONE*);
+connection con1;
+select database();
+--source include/analyze-format.inc
+analyze format=json select * from test.t1 where t1.a<5;
+disconnect con1;
+connection default;
+drop table t1;
+
+
+--echo #
+--echo # MDEV-7812: ANALYZE FORMAT=JSON UPDATE/DELETE doesnt print
+--echo # the r_total_time_ms
+--echo #
+
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t3(a int);
+insert into t3 select A.a + B.a* 10 + C.a * 100 from t2 A, t2 B, t2 C;
+
+create table t1 (pk int primary key);
+insert into t1 select a from t3;
+alter table t1 add b int;
+
+--source include/analyze-format.inc
+analyze format=json
+update t1 set b=pk;
+
+--source include/analyze-format.inc
+analyze format=json
+select * from t1 where pk < 10 and b > 4;
+
+--source include/analyze-format.inc
+analyze format=json
+delete from t1 where pk < 10 and b > 4;
+
+drop table t1, t3, t2;
+
+--echo #
+--echo # MDEV-7833:ANALYZE FORMAT=JSON and Range checked for each record
+--echo #
+create table t3(a int);
+insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t4(a int);
+insert into t4 select A.a + B.a* 10 + C.a * 100 from t3 A, t3 B, t3 C;
+
+create table t1 (lb1 int, rb1 int, lb2 int, rb2 int, c1 int, c2 int);
+
+insert into t1 values (1,2,10,20,15,15);
+insert into t1 values (3,5,10,20,15,15);
+insert into t1 values (10,20,10,20,15,15);
+insert into t1 values (10,20,1,2,15,15);
+insert into t1 values (10,20,10,20,1,3);
+
+create table t2 (key1 int, key2 int, key3 int, key4 int, col1 int,
+ key(key1), key(key2), key(key3), key(key4));
+insert into t2 select a,a,a,a,a from t3;
+insert into t2 select 15,15,15,15,15 from t4;
+
+--source include/analyze-format.inc
+analyze format=json
+select * from t1, t2 where (t2.key1 between t1.lb1 and t1.rb1) and
+ (t2.key2 between t1.lb2 and t1.rb2) and
+ (t2.key3=t1.c1 OR t2.key4=t1.c2);
+
+drop table t1,t2,t3,t4;
+
+--echo #
+--echo # MDEV-7904: ANALYZE FORMAT=JSON SELECT .. UNION SELECT doesn't print r_rows for union output
+--echo #
+create table t0 (a int);
+INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int);
+INSERT INTO t1 select * from t0;
+
+--source include/analyze-format.inc
+analyze format=json (select * from t1 tbl1 where a<5) union (select * from t1 tbl2 where a in (2,3));
+
+drop table t0, t1;
+
+
+--echo #
+--echo # MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING
+--echo #
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+create table t2 (
+ a int,
+ b int,
+ key (a)
+);
+insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
+--echo # normal HAVING
+--source include/analyze-format.inc
+analyze format=json select a, max(b) as TOP from t2 group by a having TOP > a;
+--echo # HAVING is always TRUE (not printed)
+--source include/analyze-format.inc
+analyze format=json select a, max(b) as TOP from t2 group by a having 1<>2;
+--echo # HAVING is always FALSE (intercepted by message)
+--source include/analyze-format.inc
+analyze format=json select a, max(b) as TOP from t2 group by a having 1=2;
+--echo # HAVING is absent
+--source include/analyze-format.inc
+analyze format=json select a, max(b) as TOP from t2 group by a;
+drop table t0, t1, t2;
+
+--echo #
+--echo # MDEV-7267: Server crashes in Item_field::print on ANALYZE FORMAT=JSON
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+
+--source include/analyze-format.inc
+ANALYZE FORMAT=JSON SELECT STRAIGHT_JOIN * FROM t1, t2 WHERE b IN ( SELECT a FROM t1 );
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-8864: Server crash #2 in Item_field::print on ANALYZE FORMAT=JSON
+--echo #
+CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (2),(3);
+
+CREATE TABLE t3 (f3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (3),(4);
+
+--source include/analyze-format.inc
+ANALYZE FORMAT=JSON
+SELECT GROUP_CONCAT(f3) AS gc, ( SELECT MAX(f1) FROM t1, t2 WHERE f2 = f3 ) sq
+FROM t2, t3
+WHERE f3 IN ( 1, 2 )
+GROUP BY sq ORDER BY gc;
+
+drop table t1,t2,t3;
+
diff --git a/mysql-test/t/analyze_stmt.test b/mysql-test/t/analyze_stmt.test
new file mode 100644
index 00000000000..d02139fe0c8
--- /dev/null
+++ b/mysql-test/t/analyze_stmt.test
@@ -0,0 +1,275 @@
+#
+# Tests for "ANALYZE $statement" feature
+#
+--disable_warnings
+drop table if exists t0,t1,t2,t3;
+--enable_warnings
+
+create table t0 (a int) engine=myisam;
+INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int) engine=myisam;
+INSERT INTO t1 select * from t0;
+
+--echo # Try a few basic selects to see that r_rows and r_filtered columns work
+analyze select * from t1;
+analyze select * from t1 where a<5;
+analyze select * from t1 where a>100;
+
+--echo # ANALYZE DELETE will delete rows:
+analyze delete from t1 where a in (2,3,4);
+select * from t1;
+drop table t1;
+
+--echo # ANALYZE UPDATE will make updates:
+create table t1(a int, b int);
+insert into t1 select a,a from t0;
+analyze update t1 set b=100+b where a in (6,7,8);
+select * from t1;
+drop table t1;
+
+--echo # Check that UNION works
+create table t1(a int, b int);
+insert into t1 select a,a from t0;
+analyze (select * from t1 A where a<5) union (select * from t1 B where a in (5,6));
+analyze (select * from t1 A where a<5) union (select * from t1 B where a in (1,2));
+drop table t1;
+drop table t0;
+
+--echo #
+--echo # Try a subquery.
+--echo #
+create table t0 (a int, b int);
+insert into t0 values
+ (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+
+create table t1 (a int, b int);
+insert into t1 values (1,1),(2,2),(3,3);
+
+#
+# t1 t0
+# a=1 (0,1) 2 rows
+# a=2 (0,1,2) 3 rows
+# a=3 (0,1,2,3) 4 rows
+#
+# TOTAL TOTAL= 9 rows. 3 executions, avg=3 rows.
+# WHERE is satisfied for 1 row per query, which gives filtered=33.3
+
+--echo # See .test file for the right values of r_rows and r_filtered.
+analyze select a, a in (select t0.b from t0 where t0.b+1=t1.b+1) from t1;
+
+--echo # Try a subquery that is never executed
+analyze select a, a in (select t0.b from t0 where t0.b+1=t1.b+1) from t1 where t1.a > 5;
+
+drop table t0, t1;
+
+--echo #
+--echo # Tests for join buffering
+--echo #
+create table t0 (a int, b int);
+insert into t0 values
+ (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+create table t1 like t0;
+insert into t1 select * from t0;
+
+explain select * from t0, t1 where t0.a<5 and t1.a<5;
+--echo # These should have filtered=50
+analyze select * from t0, t1 where t0.a<5 and t1.a<5;
+
+explain select * from t0, t1 where t0.a<5 and t1.b=t0.b;
+--echo # Now, t1 should have filtered=10
+analyze select * from t0, t1 where t0.a<5 and t1.b=t0.b;
+
+explain select * from t0, t1 where t0.a<5 and t1.a<5 and t1.b=t0.b;
+--echo # Now, t1 should have filtered=10
+analyze select * from t0, t1 where t0.a<5 and t1.a<5 and t1.b=t0.b;
+
+--echo # TODO: Check what is counted for "range checked for each record".
+
+--echo #
+--echo # Test for joins
+--echo #
+create table t2 (key1 int, key2x int, col1 int, key(key1), key(key2x));
+insert into t2 select A.a + 10 *B.a +100 * C.a,
+ (A.a + 10 *B.a +100 * C.a)*2,
+ A.a + 10 *B.a +100 * C.a
+ from t0 A, t0 B, t0 C;
+
+--echo # This always has matches, filtered=100%.
+analyze select * from t1,t2 where t2.key1=t1.a;
+
+--echo # This shows r_rows=0. It is actually 0.5 (should r_rows be changed to double?)
+analyze select * from t1,t2 where t2.key2x=t1.a;
+ select * from t1,t2 where t2.key2x=t1.a;
+
+--echo # This has t2.filtered=40% (there are 5 values: {0,1,2,3,4}. two of them have mod=0)
+analyze select * from t1,t2 where t2.key2x=t1.a and mod(t2.col1,4)=0;
+
+drop table t0,t1,t2;
+
+--echo #
+--echo # Check non-merged derived tables
+--echo #
+create table t0 (a int, b int);
+insert into t0 values
+ (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+
+update t0 set b=b/3;
+analyze select * from (select count(*),max(a),b from t0 group by b) T;
+drop table t0;
+
+--echo #
+--echo # Check ORDER/GROUP BY
+--echo #
+create table t0 (a int, b int);
+insert into t0 values
+ (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+
+analyze select count(*),max(a),b from t0 where a<7 group by b;
+drop table t0;
+
+--echo #
+--echo # Check multi-table UPDATE/DELETE.
+--echo #
+create table t0 (a int, b int);
+create table t1 (a int, b int);
+insert into t0 values (0,0),(2,2),(4,4), (8,8);
+insert into t1 values (0,0),(2,2), (6,6);
+
+analyze select * from t0,t1 where t0.a=t1.a;
+
+analyze update t0,t1 set t1.b=5555 where t0.a=t1.a;
+select * from t1;
+
+analyze delete t1 from t1, t0 where t0.a=t1.a;
+select * from t1;
+
+drop table t0, t1;
+
+--echo #
+--echo # MDEV-6393: ANALYZE SELECT crashes in Explain_query::print_explain with a non-existing column
+--echo #
+create table t1 (i int);
+insert into t1 values (1),(2);
+--error ER_BAD_FIELD_ERROR
+analyze select a from t1;
+
+--error ER_BAD_FIELD_ERROR
+analyze delete from t1 where a=2;
+
+--error ER_BAD_FIELD_ERROR
+analyze update t1 set a=2;
+
+create table t2 like t1;
+insert into t2 select * from t1;
+
+--error ER_BAD_FIELD_ERROR
+analyze update t2,t1 set t2.i=5 where t2.a=t1.a;
+
+--error ER_BAD_FIELD_ERROR
+analyze delete t1 from t2,t1 where t2.a=t1.a;
+
+drop table t1, t2;
+--echo #
+--echo # MDEV-6395: ANALYZE UPDATE/DELETE with impossible where does not produce any output
+--echo #
+create table t1 (a int, b int, key(a));
+insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5);
+
+analyze delete from t1 where 1 > 2;
+analyze delete from t1 where a > 30 and a < 10;
+
+analyze update t1 set b=12345 where 1 > 2;
+analyze update t1 set b=12345 where a > 30 and a < 10;
+
+drop table t1;
+--echo #
+--echo # MDEV-6398: ANALYZE UPDATE does not populate r_rows
+--echo #
+create table t1 (i int);
+insert into t1 values (1),(2),(3),(4);
+analyze update t1 set i=8;
+drop table t1;
+
+--echo #
+--echo # Check ANALYZE SELECT INTO
+--echo #
+create table t1 (i int);
+insert into t1 values (1);
+analyze select * from t1 into @var;
+drop table t1;
+
+--echo #
+--echo # MDEV-6394: ANALYZE DELETE .. RETURNING fails with ERROR 2027 Malformed packet
+--echo #
+create table t1 (i int);
+analyze delete from t1 returning *;
+drop table t1;
+
+--echo #
+--echo # MDEV-6396: ANALYZE INSERT/REPLACE is accepted, but does not produce a plan
+--echo #
+create table t1 (a int primary key, b int);
+analyze insert into t1 values (1,1);
+select * from t1;
+
+analyze replace t1 values (1,2);
+select * from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-6400 "ANALYZE SELECT ... INTO @var" doesn't set @var
+--echo #
+create table t1(a int);
+insert into t1 values (1),(2);
+
+analyze select a from t1 where a <2 into @var;
+--error ER_TOO_MANY_ROWS
+analyze select a from t1 into @var;
+
+analyze insert into t1 select * from t1;
+
+analyze select * into outfile '../../tmp/data1.tmp' from t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp
+
+drop table t1;
+
+
+--echo #
+--echo # MDEV-7024: Assertion `! is_set()' failed in
+--echo # Diagnostics_area::set_eof_status on executing ANALYZE SELECT via PS
+--echo #
+
+create table t1(a int);
+prepare stmt from "analyze select * from t1";
+execute stmt;
+drop table t1;
+
+--echo #
+--echo # MDEV-7674: ANALYZE shows r_rows=0
+--echo #
+
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t2 (a int, key(a));
+insert into t2 values (0),(1);
+
+analyze select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-8063: Unconditional ANALYZE DELETE does not delete rows
+--echo #
+
+create table t1 (i int);
+insert into t1 values (1),(2);
+analyze delete from t1;
+select * from t1;
+
+insert into t1 values (1),(2);
+explain delete from t1;
+select * from t1;
+
+drop table t1;
diff --git a/mysql-test/t/analyze_stmt_orderby.test b/mysql-test/t/analyze_stmt_orderby.test
new file mode 100644
index 00000000000..a1cfb58f31a
--- /dev/null
+++ b/mysql-test/t/analyze_stmt_orderby.test
@@ -0,0 +1,177 @@
+
+--source include/have_innodb.inc
+
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+
+create table t2 (
+ a int,
+ b int,
+ key (a)
+);
+
+insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
+
+--echo #
+--echo # Try an UPDATE that uses filesort:
+--echo #
+explain
+update t2 set b=b+1 order by b limit 5;
+explain format=json
+update t2 set b=b+1 order by b limit 5;
+--source include/analyze-format.inc
+analyze format=json
+update t2 set b=b+1 order by b limit 5;
+
+--echo #
+--echo # Try an UPDATE that uses buffering:
+--echo #
+explain
+update t2 set a=a+1 where a<10;
+explain format=json
+update t2 set a=a+1 where a<10;
+--source include/analyze-format.inc
+analyze format=json
+update t2 set a=a+1 where a<10;
+
+--echo #
+--echo # Try a DELETE that uses filesort:
+--echo #
+explain
+delete from t2 order by b limit 5;
+explain format=json
+delete from t2 order by b limit 5;
+--source include/analyze-format.inc
+analyze format=json
+delete from t2 order by b limit 5;
+
+--echo #
+--echo # Try a SELECT with QEP in form: filesort { tmp_table { join } }
+--echo #
+explain
+select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
+explain format=json
+select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
+--source include/analyze-format.inc
+analyze format=json
+select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
+
+
+--echo #
+--echo # Try a SELECT with QEP in form: join { filesort { table0 }, table2 }
+--echo #
+explain
+select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
+explain format=json
+select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
+--source include/analyze-format.inc
+analyze format=json
+select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
+
+drop table t2;
+
+
+create table t2 (
+ a int,
+ b int,
+ c int
+);
+insert into t2
+select
+ a.a+10*b.a+100*c.a,
+ b.a+10*c.a,
+ c.a
+from t0 a, t0 b, t0 c;
+
+--source include/analyze-format.inc
+analyze format=json
+select MAX(b) from t2 where mod(a,2)=0 group by c;
+
+drop table t2;
+
+--echo #
+--echo # MDEV-8282: crash in filesort() with simple ordered delete
+--echo #
+create table t3(a int) engine=innodb;
+delete from t3 order by a;
+
+--echo # EXPLAIN thinks it will use delete_all_rows():
+explain
+delete from t3 order by a;
+
+--echo # ANALYZE shows that delete_all_rows() didn't work and we deleted rows
+--echo # one-by-one:
+analyze
+delete from t3 order by a;
+
+drop table t3;
+
+--echo #
+--echo # A test for duplicate_removal()
+--echo #
+create table t3 (a int, b int);
+insert into t3 select a, 123 from t0;
+
+--source include/analyze-format.inc
+analyze format=json
+select distinct max(t3.b) Q from t0, t3 where t0.a=t3.a group by t0.a order by null;
+
+
+--echo #
+--echo # A query with two filesort calls:
+--echo # - first is needed to do group-by-group grouping to calculate COUNT(DISTINCT)
+--echo # - the second is need to produce ORDER BY.
+--echo # (see MDEV-7836 for description of the query plan)
+
+
+create table t5 (a int , b int) ;
+create table t6 like t5 ;
+create table t7 like t5 ;
+insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
+ (2, -1), (3, 10);
+insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1);
+insert into t7 values (3, 3), (2, 2), (1, 1);
+
+--echo # TODO: This ANALYZE output doesn't make it clear what is used for what.
+--source include/analyze-format.inc
+analyze format=json
+select count(distinct t5.b) as sum from t5, t6
+ where t5.a=t6.a and t6.b > 0 and t5.a <= 5
+ group by t5.a order by sum limit 1;
+
+explain format=json
+select count(distinct t5.b) as sum from t5, t6
+ where t5.a=t6.a and t6.b > 0 and t5.a <= 5
+ group by t5.a order by sum limit 1;
+drop table t5,t6,t7;
+drop table t3;
+
+--echo #
+--echo # Tabular ANALYZE must get its data from execution tracker (and not from
+--echo # the query plan)
+--echo #
+
+CREATE TABLE t2(
+ col1 int,
+ col2 int,
+ UNIQUE INDEX idx (col1, col2)) engine=myisam;
+
+INSERT INTO t2(col1, col2) VALUES
+ (1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11),
+ (11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1);
+
+flush status;
+explain
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+analyze
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+--source include/analyze-format.inc
+analyze format=json
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+drop table t2;
+
+
+drop table t0,t1;
diff --git a/mysql-test/t/analyze_stmt_privileges.test b/mysql-test/t/analyze_stmt_privileges.test
new file mode 100644
index 00000000000..b565f17c0f7
--- /dev/null
+++ b/mysql-test/t/analyze_stmt_privileges.test
@@ -0,0 +1,50 @@
+# Analyze <statement> privilege checks testcase.
+--source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-7025 and MDEV-7027 ANALYZE SELECT/INSERT/UPDATE/DELETE from a
+--echo # view does not check access permissions on the underlying table
+--echo #
+--enable_connect_log
+create database db;
+use db;
+create table t1 (i int, c varchar(8));
+insert into t1 values (1,'foo'),(2,'bar'),(3,'baz'),(4,'qux');
+create view v1 as select * from t1 where i > 1;
+CREATE USER u1@localhost;
+grant ALL on db.v1 to u1@localhost;
+
+--connect (con1,localhost,u1,,)
+
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from db.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+explain select * from db.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+analyze select * from db.t1;
+
+--sorted_result
+select * from db.v1;
+--error ER_VIEW_NO_EXPLAIN
+explain select * from db.v1;
+--error ER_VIEW_NO_EXPLAIN
+analyze select * from db.v1;
+
+UPDATE db.v1 SET i = 5;
+--error ER_VIEW_NO_EXPLAIN
+explain UPDATE db.v1 SET i = 5;
+--error ER_VIEW_NO_EXPLAIN
+analyze UPDATE db.v1 SET i = 5;
+
+DELETE FROM db.v1 WHERE i = 5;
+--error ER_VIEW_NO_EXPLAIN
+explain DELETE FROM db.v1 WHERE i = 5;
+--error ER_VIEW_NO_EXPLAIN
+analyze DELETE FROM db.v1 WHERE i = 5;
+
+
+--disconnect con1
+--connection default
+
+drop user u1@localhost;
+drop database db;
diff --git a/mysql-test/t/analyze_stmt_privileges2.test b/mysql-test/t/analyze_stmt_privileges2.test
new file mode 100644
index 00000000000..9a0299be535
--- /dev/null
+++ b/mysql-test/t/analyze_stmt_privileges2.test
@@ -0,0 +1,5403 @@
+################################################################################
+# The test ensures that permission checks are applied correctly to
+# ANALYZE INSERT/REPLACE/UPDATE/DELETE/SELECT (I/R/U/D/S further in the test)
+# when it's executed on a table or on a view.
+# ANALYZE <query> should require both permissions needed to execute the <query>,
+# and permissions needed to acquire query plan (to execute EXPLAIN <query>).
+# Thus, additionally execution of the query and EXPLAIN is checked.
+# See MDEV-406, MDEV-6382
+#
+# Disclaimer: the goal of this test is to check permissions for ANALYZE against
+# permissions for the query and EXPLAIN.
+# The expected result for queries and EXPLAINs is mostly empirical.
+# In many cases the current behavior is obscure and questionable,
+# but unless it is obviously wrong, the expected result is adjusted
+# to match it.
+# In cases when the behavior is really wrong, the adjustments
+# come with comments which point at the issues in the bug tracker.
+# Search for 'MDEV' to find all of them.
+################################################################################
+
+-- source include/not_embedded.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--enable_connect_log
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
+
+CREATE DATABASE privtest_db;
+
+# t1 is the main base table on which we'll perform DML
+# v1 is an "inner" view which selects from the base table
+# v2 is an "outer" view which selects from the inner view
+# t2 is an additional table for queries like INSERT .. SELECT
+# and multi-table UPDATEs/DELETEs
+
+CREATE TABLE privtest_db.t1 (a INT, b VARCHAR(3)) ENGINE=MyISAM;
+CREATE TABLE privtest_db.t2 (a INT, b VARCHAR(3)) ENGINE=MyISAM;
+CREATE VIEW privtest_db.v1 AS SELECT a, b FROM privtest_db.t1 WHERE b IS NOT NULL;
+CREATE VIEW privtest_db.v2 AS SELECT * FROM privtest_db.v1 WHERE a > 0;
+
+INSERT INTO privtest_db.t2 VALUES (1,'foo'), (2,'bar'), (3,'qux');
+
+GRANT SELECT ON privtest_db.t2 TO 'privtest'@'localhost';
+
+connect(con1,localhost,privtest,,privtest_db);
+
+--echo
+--echo #########################################################################
+--echo # Underlying table permission tests
+--echo # (we modify permissions on the base table, keeping ALL on views)
+--echo #########################################################################
+--echo
+
+connection default;
+GRANT ALL ON privtest_db.v1 TO 'privtest'@'localhost';
+GRANT ALL ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+--echo
+--echo #========================================================================
+--echo # Test: No permissions on the table
+--echo #========================================================================
+--echo
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the table
+--echo # Expectation: Cannot run query, EXPLAIN, ANALYZE on the table
+--echo # because the query itself cannot be executed
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT on the table
+--echo #========================================================================
+--echo
+
+connection default;
+GRANT SELECT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the table
+--echo # Expectation: Can only run SELECT, EXPLAIN SELECT, ANALYZE SELECT
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+
+SELECT * FROM t1;
+EXPLAIN SELECT * FROM t1;
+ANALYZE SELECT * FROM t1;
+
+SELECT * FROM t1 WHERE a = 10;
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+EXPLAIN SELECT * FROM v1;
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+# Commented due to MDEV-7034 (assertion failure)
+# EXPLAIN DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+# Commented due to MDEV-7034 (assertion failure)
+# EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+EXPLAIN SELECT * FROM v2;
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant INSERT on the table
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT INSERT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the table
+--echo # Expectation: Can only run INSERT, EXPLAIN INSERT, ANALYZE INSERT
+--echo #------------------------------------------------------------------------
+
+INSERT INTO t1 (a) VALUES (10);
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+
+INSERT INTO t1 SELECT * FROM t2;
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant UPDATE on the table
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT UPDATE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the table
+--echo # Expectation: Can only run UPDATE, EXPLAIN UPDATE, ANALYZE UPDATE
+--echo # when the UPDATE does not read any columns. UPDATEs which
+--echo # read columns fail with ER_COLUMNACCESS_DENIED_ERROR
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+
+UPDATE t1 SET a = 10;
+EXPLAIN UPDATE t1 SET a = 10;
+ANALYZE UPDATE t1 SET a = 10;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE t1 SET a = a + 1;
+--error ER_COLUMNACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = a + 1;
+--error ER_COLUMNACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = a + 1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_COLUMNACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_COLUMNACCESS_DENIED_ERROR
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant DELETE on the table
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the table
+--echo # Expectation: Can only run DELETE, EXPLAIN DELETE, ANALYZE DELETE
+--echo # when the DELETE does not read any columns. DELETEs which
+--echo # read columns fail with ER_COLUMNACCESS_DENIED_ERROR
+--echo #------------------------------------------------------------------------
+--echo # Note: ANALYZE DELETE FROM t1 USING t1, t2 ... fails due to MDEV-7043
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+
+DELETE FROM t1;
+EXPLAIN DELETE FROM t1;
+ANALYZE DELETE FROM t1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+DELETE FROM t1 WHERE a = 10;
+--error ER_COLUMNACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+--error ER_COLUMNACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 WHERE a = 10;
+
+# Unexpected errors due to MDEV-7043 (expected all three to succeed)
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2;
+
+# Unexpected error code due to MDEV-7043
+#--error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it would have revealed the structure of the table)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant DELETE, SELECT(a) on the table
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT SELECT(a), DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the table
+--echo # Expectation: Can run DELETE, EXPLAIN DELETE, ANALYZE DELETE
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+
+DELETE FROM t1;
+EXPLAIN DELETE FROM t1;
+ANALYZE DELETE FROM t1;
+
+DELETE FROM t1 WHERE a = 10;
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+ANALYZE DELETE FROM t1 WHERE a = 10;
+
+DELETE FROM t1 USING t1, t2;
+EXPLAIN DELETE FROM t1 USING t1, t2;
+ANALYZE DELETE FROM t1 USING t1, t2;
+
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run everything: SELECT access to the column `a`
+--echo # in the underlying table is enough to show EXPLAIN
+--echo # (that's how it works now)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+EXPLAIN SELECT * FROM v1;
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run everything: SELECT access to the column `a`
+--echo # in the underlying table is enough to show EXPLAIN
+--echo # (that's how it works now)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+EXPLAIN DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+EXPLAIN SELECT * FROM v2;
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT, INSERT, UPDATE, DELETE on the table
+--echo #========================================================================
+--echo
+
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+GRANT SELECT, INSERT, UPDATE, DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the table
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO t1 (a) VALUES (10);
+EXPLAIN INSERT INTO t1 (a) VALUES (10);
+ANALYZE INSERT INTO t1 (a) VALUES (10);
+
+INSERT INTO t1 SELECT * FROM t2;
+EXPLAIN INSERT INTO t1 SELECT * FROM t2;
+ANALYZE INSERT INTO t1 SELECT * FROM t2;
+
+REPLACE INTO t1 (a) VALUES (10);
+EXPLAIN REPLACE INTO t1 (a) VALUES (10);
+ANALYZE REPLACE INTO t1 (a) VALUES (10);
+
+REPLACE INTO t1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
+ANALYZE REPLACE INTO t1 SELECT * FROM t2;
+
+UPDATE t1 SET a = 10;
+EXPLAIN UPDATE t1 SET a = 10;
+ANALYZE UPDATE t1 SET a = 10;
+
+UPDATE t1 SET a = a + 1;
+EXPLAIN UPDATE t1 SET a = a + 1;
+ANALYZE UPDATE t1 SET a = a + 1;
+
+UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+ANALYZE UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+
+DELETE FROM t1;
+EXPLAIN DELETE FROM t1;
+ANALYZE DELETE FROM t1;
+
+DELETE FROM t1 WHERE a = 10;
+EXPLAIN DELETE FROM t1 WHERE a = 10;
+ANALYZE DELETE FROM t1 WHERE a = 10;
+
+DELETE FROM t1 USING t1, t2;
+EXPLAIN DELETE FROM t1 USING t1, t2;
+ANALYZE DELETE FROM t1 USING t1, t2;
+
+DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+
+SELECT * FROM t1;
+EXPLAIN SELECT * FROM t1;
+ANALYZE SELECT * FROM t1;
+
+SELECT * FROM t1 WHERE a = 10;
+EXPLAIN SELECT * FROM t1 WHERE a = 10;
+ANALYZE SELECT * FROM t1 WHERE a = 10;
+
+SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+EXPLAIN SELECT * FROM v1;
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+--echo # Note: some queries are commented due to MDEV-7034
+
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+EXPLAIN SELECT * FROM v2;
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #########################################################################
+--echo # Inner view permission tests
+--echo # (we modify permissions on the inner view, keeping ALL the rest)
+--echo #########################################################################
+--echo
+
+
+--echo
+--echo #========================================================================
+--echo # Test: No permissions on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+GRANT ALL ON privtest_db.t1 TO 'privtest'@'localhost';
+GRANT ALL ON privtest_db.v2 TO 'privtest'@'localhost';
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Cannot run anything
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the inner view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SHOW VIEW on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+GRANT SHOW VIEW ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Cannot run anything
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (that's how it works now)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run SELECT, but not EXPLAIN SELECT or ANALYZE SELECT
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+# Strange error code due to MDEV-7033
+# --error ER_TABLEACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the inner view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT, SHOW VIEW on the inner view
+--echo #========================================================================
+--echo
+
+--echo
+--echo #------------------------------------------------------------------------
+--echo # Test: SELECT + SHOW VIEW privileges allow ANALYZE SELECT for the inner
+--echo # view, and ANALYZE <anything> for the outer view
+--echo #------------------------------------------------------------------------
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT, SHOW VIEW ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run SELECT, EXPLAIN SELECT, ANALYZE SELECT
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+EXPLAIN SELECT * FROM v1;
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+EXPLAIN SELECT * FROM v2;
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant INSERT on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT INSERT ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run INSERT, but not EXPLAIN INSERT or ANALYZE INSERT
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the inner view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant UPDATE on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT UPDATE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run UPDATE which does not read any columns, but not
+--echo # but not EXPLAIN UPDATE or ANALYZE UPDATE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view).
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = 10;
+
+# Wrong result due to MDEV-7042
+#--error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+# Strange error code due to MDEV-7042
+#--error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+# Strange error code due to MDEV-7033, MDEV-7042
+#--error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the inner view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant UPDATE, SELECT(a) on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT(a), UPDATE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run UPDATE, but not EXPLAIN or ANALYZE for it
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the inner view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT, UPDATE on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT, UPDATE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run the UPDATE and SELECT queries, but not EXPLAIN
+--echo # or ANALYZE because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the inner view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant DELETE on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT DELETE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run DELETE which does not read any columns,
+--echo # but not EXPLAIN DELETE or ANALYZE DELETE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+# Strange error code due to MDEV-7033
+#--error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+# Unexpected error due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+# Unexpected error code due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+# Unexpected error code due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the inner view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant DELETE, SHOW VIEW on the inner view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SHOW VIEW, DELETE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run DELETE, EXPLAIN DELETE, UPDATE DELETE
+--echo # which don't read any columns
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ANALYZE DELETE FROM v1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+DELETE FROM v1 WHERE a = 10;
+--error ER_COLUMNACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+--error ER_COLUMNACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+# Unexpected error due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v1 USING v1, t2;
+# Unexpected error due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2;
+# Unexpected error due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+# Unexpected error code due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+# Unexpected error code due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+# Unexpected error code due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run the queries, but not EXPLAIN or ANALYZE
+--echo # because the query plan cannot be shown
+--echo # (that's how it works now)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT, INSERT, UPDATE, DELETE, SHOW VIEW
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v1 FROM 'privtest'@'localhost';
+GRANT SELECT, INSERT, UPDATE, DELETE, SHOW VIEW ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v1 (a) VALUES (10);
+EXPLAIN INSERT INTO v1 (a) VALUES (10);
+ANALYZE INSERT INTO v1 (a) VALUES (10);
+
+INSERT INTO v1 SELECT * FROM t2;
+EXPLAIN INSERT INTO v1 SELECT * FROM t2;
+ANALYZE INSERT INTO v1 SELECT * FROM t2;
+
+REPLACE INTO v1 (a) VALUES (10);
+EXPLAIN REPLACE INTO v1 (a) VALUES (10);
+ANALYZE REPLACE INTO v1 (a) VALUES (10);
+
+REPLACE INTO v1 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v1 SELECT * FROM t2;
+ANALYZE REPLACE INTO v1 SELECT * FROM t2;
+
+UPDATE v1 SET a = 10;
+EXPLAIN UPDATE v1 SET a = 10;
+ANALYZE UPDATE v1 SET a = 10;
+
+UPDATE v1 SET a = a + 1;
+EXPLAIN UPDATE v1 SET a = a + 1;
+ANALYZE UPDATE v1 SET a = a + 1;
+
+UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+EXPLAIN UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+ANALYZE UPDATE v1, t2 SET v1.a = v1.a + 1 WHERE v1.a = t2.a;
+
+DELETE FROM v1;
+EXPLAIN DELETE FROM v1;
+ANALYZE DELETE FROM v1;
+
+DELETE FROM v1 WHERE a = 10;
+EXPLAIN DELETE FROM v1 WHERE a = 10;
+ANALYZE DELETE FROM v1 WHERE a = 10;
+
+DELETE FROM v1 USING v1, t2;
+EXPLAIN DELETE FROM v1 USING v1, t2;
+ANALYZE DELETE FROM v1 USING v1, t2;
+
+DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+ANALYZE DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+
+SELECT * FROM v1;
+EXPLAIN SELECT * FROM v1;
+ANALYZE SELECT * FROM v1;
+
+SELECT * FROM v1 WHERE a = 10;
+EXPLAIN SELECT * FROM v1 WHERE a = 10;
+ANALYZE SELECT * FROM v1 WHERE a = 10;
+
+SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+EXPLAIN SELECT * FROM v2;
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+
+--echo
+--echo #########################################################################
+--echo # Outer view permission tests
+--echo # (we modify permissions on the outer view, keeping ALL the rest)
+--echo #########################################################################
+--echo
+
+--echo
+--echo #========================================================================
+--echo # Test: No permissions on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+GRANT ALL ON privtest_db.t1 TO 'privtest'@'localhost';
+GRANT ALL ON privtest_db.v1 TO 'privtest'@'localhost';
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Cannot run anything
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SHOW VIEW on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+GRANT SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Cannot run anything
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SHOW VIEW, SELECT(a) on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT(a), SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run SELECT, EXPLAIN SELECT and ANALYZE SELECT
+--echo # when only `a` column is involved
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT a FROM v2;
+EXPLAIN SELECT a FROM v2;
+ANALYZE SELECT a FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT a FROM v2 WHERE a = 10;
+EXPLAIN SELECT a FROM v2 WHERE a = 10;
+ANALYZE SELECT a FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run SELECT, but not EXPLAIN SELECT or ANALYZE SELECT
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+# Strange error code due to MDEV-7033, MDEV-7042
+# --error ER_TABLEACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SHOW VIEW, SELECT on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT, SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run SELECT, EXPLAIN SELECT, ANALYZE SELECT
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+EXPLAIN SELECT * FROM v2;
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant INSERT on the outer view
+--echo #========================================================================
+--echo
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT INSERT ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run INSERT, but not EXPLAIN INSERT or ANALYZE INSERT
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant UPDATE on the outer view
+--echo #========================================================================
+--echo
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT UPDATE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run UPDATE which does not read any columns,
+--echo # but not EXPLAIN UPDATE or ANALYZE UPDATE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = 10;
+
+# Wrong result due to MDEV-7042
+# --error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+# Strange error code due to MDEV-7042
+#--error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+# Strange error code due to MDEV-7042
+# --error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant UPDATE, SHOW VIEW on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SHOW VIEW, UPDATE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the inner view
+--echo # Expectation: Can run UPDATE, EXPLAIN UPDATE, ANALYZE UPDATE
+--echo # which do not read any columns
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ANALYZE UPDATE v2 SET a = 10;
+
+# Wrong result due to MDEV-7042
+# --error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+# Wrong result due to MDEV-7042
+# --error ER_COLUMNACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+# Wrong result due to MDEV-7042
+# --error ER_COLUMNACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_COLUMNACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_COLUMNACCESS_DENIED_ERROR
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant DELETE on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT DELETE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run DELETE which does not read any columns,
+--echo # but not EXPLAIN DELETE or ANALYZE DELETE
+--echo # because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+DELETE FROM v2 WHERE a = 10;
+# Strange error code due to MDEV-7042, MDEV-7033
+# --error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+# Unexpected error due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2;
+# Unexpected error code due to MDEV-7043
+# --error ER_VIEW_NO_EXPLAIN
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2;
+# Unexpected error code due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+# Unexpected error due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+# Unexpected error code due to MDEV-7043
+# --error ER_VIEW_NO_EXPLAIN
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+# Unexpected error code due to MDEV-7043
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant DELETE, SELECT on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT, DELETE ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run DELETE and SELECT, but not EXPLAIN or ANALYZE
+--echo # for them because the query plan cannot be shown
+--echo # (it could have revealed the structure of the view)
+--echo #------------------------------------------------------------------------
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+--error ER_TABLEACCESS_DENIED_ERROR
+REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = 10;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = 10;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+EXPLAIN UPDATE v2 SET a = a + 1;
+--error ER_TABLEACCESS_DENIED_ERROR
+ANALYZE UPDATE v2 SET a = a + 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+# Strange error code due to MDEV-7033
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+--error ER_VIEW_NO_EXPLAIN
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+--echo
+--echo #========================================================================
+--echo # Test: Grant SELECT, INSERT, UPDATE, DELETE, SHOW VIEW on the outer view
+--echo #========================================================================
+--echo
+
+connection default;
+REVOKE ALL PRIVILEGES ON privtest_db.v2 FROM 'privtest'@'localhost';
+GRANT SELECT, INSERT, UPDATE, DELETE, SHOW VIEW ON privtest_db.v2 TO 'privtest'@'localhost';
+connection con1;
+
+
+--echo #------------------------------------------------------------------------
+--echo # I/R/U/D/S on the outer view
+--echo # Expectation: Can run everything
+--echo #------------------------------------------------------------------------
+
+INSERT INTO v2 (a) VALUES (10);
+EXPLAIN INSERT INTO v2 (a) VALUES (10);
+ANALYZE INSERT INTO v2 (a) VALUES (10);
+
+INSERT INTO v2 SELECT * FROM t2;
+# Commented due to MDEV-7034
+EXPLAIN INSERT INTO v2 SELECT * FROM t2;
+ANALYZE INSERT INTO v2 SELECT * FROM t2;
+
+REPLACE INTO v2 (a) VALUES (10);
+EXPLAIN REPLACE INTO v2 (a) VALUES (10);
+ANALYZE REPLACE INTO v2 (a) VALUES (10);
+
+REPLACE INTO v2 SELECT * FROM t2;
+EXPLAIN REPLACE INTO v2 SELECT * FROM t2;
+ANALYZE REPLACE INTO v2 SELECT * FROM t2;
+
+UPDATE v2 SET a = 10;
+EXPLAIN UPDATE v2 SET a = 10;
+ANALYZE UPDATE v2 SET a = 10;
+
+UPDATE v2 SET a = a + 1;
+EXPLAIN UPDATE v2 SET a = a + 1;
+ANALYZE UPDATE v2 SET a = a + 1;
+
+UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+ANALYZE UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
+
+DELETE FROM v2;
+EXPLAIN DELETE FROM v2;
+ANALYZE DELETE FROM v2;
+
+DELETE FROM v2 WHERE a = 10;
+EXPLAIN DELETE FROM v2 WHERE a = 10;
+ANALYZE DELETE FROM v2 WHERE a = 10;
+
+DELETE FROM v2 USING v2, t2;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2;
+ANALYZE DELETE FROM v2 USING v2, t2;
+
+DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+# Commented due to MDEV-7034
+# EXPLAIN DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+ANALYZE DELETE FROM v2 USING v2, t2 WHERE v2.a = t2.a;
+
+SELECT * FROM v2;
+EXPLAIN SELECT * FROM v2;
+ANALYZE SELECT * FROM v2;
+
+SELECT * FROM v2 WHERE a = 10;
+EXPLAIN SELECT * FROM v2 WHERE a = 10;
+ANALYZE SELECT * FROM v2 WHERE a = 10;
+
+SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
+
+
+################################################################################################
+disconnect con1;
+connection default;
+
+DROP USER 'privtest'@localhost;
+USE test;
+DROP DATABASE privtest_db;
+
+set GLOBAL sql_mode=default;
+--source include/wait_until_count_sessions.inc
+
+
diff --git a/mysql-test/t/analyze_stmt_slow_query_log-master.opt b/mysql-test/t/analyze_stmt_slow_query_log-master.opt
new file mode 100644
index 00000000000..1c80c45b0c1
--- /dev/null
+++ b/mysql-test/t/analyze_stmt_slow_query_log-master.opt
@@ -0,0 +1 @@
+--slow-query-log --long-query-time=0.00001 --log-slow-verbosity=query_plan,explain
diff --git a/mysql-test/t/analyze_stmt_slow_query_log.test b/mysql-test/t/analyze_stmt_slow_query_log.test
new file mode 100644
index 00000000000..44865b652cb
--- /dev/null
+++ b/mysql-test/t/analyze_stmt_slow_query_log.test
@@ -0,0 +1,38 @@
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Remove old log file
+#
+let SLOW_LOG_FILE= `select @@slow_query_log_file`;
+
+SET @@global.slow_query_log = OFF;
+
+perl;
+ my $slow_log_file= $ENV{'SLOW_LOG_FILE'} or die "SLOW_LOG_FILE not set";
+ unlink($slow_log_file);
+EOF
+
+FLUSH SLOW LOGS;
+SET @@global.slow_query_log = ON;
+
+create table t1 (a int);
+INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+select * from t1 where a<3;
+drop table t1;
+let SLOW_LOG_FILE= `select @@slow_query_log_file`;
+
+# select @@slow_query_log_file;
+
+perl;
+
+ my $slow_log_file= $ENV{'SLOW_LOG_FILE'} or die "SLOW_LOG_FILE not set";
+ open(FILE, $slow_log_file) or die "Failed to open $slow_log_file";
+ while(<FILE>) {
+ next if 1../create table t1/; # skip entries generated by mtr prelude
+ print if /explain:/;
+ }
+ close(FILE);
+
+EOF
diff --git a/mysql-test/t/auth_named_pipe-master.opt b/mysql-test/t/auth_named_pipe-master.opt
new file mode 100644
index 00000000000..e534ae1eae5
--- /dev/null
+++ b/mysql-test/t/auth_named_pipe-master.opt
@@ -0,0 +1 @@
+--loose-enable-named-pipe
diff --git a/mysql-test/t/auth_named_pipe.test b/mysql-test/t/auth_named_pipe.test
new file mode 100644
index 00000000000..00577fbef05
--- /dev/null
+++ b/mysql-test/t/auth_named_pipe.test
@@ -0,0 +1,23 @@
+--source include/windows.inc
+
+INSTALL SONAME 'auth_named_pipe';
+
+--replace_result $USERNAME USERNAME
+eval CREATE USER '$USERNAME' IDENTIFIED WITH named_pipe;
+# Connect using named pipe, correct username
+connect(pipe_con,localhost,$USERNAME,,,,,PIPE);
+--replace_result $USERNAME USERNAME
+SELECT USER(),CURRENT_USER();
+disconnect pipe_con;
+connection default;
+--replace_result $USERNAME USERNAME
+eval DROP USER '$USERNAME';
+
+# test invalid user name
+CREATE USER nosuchuser IDENTIFIED WITH named_pipe;
+--disable_query_log
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+connect(pipe_con,localhost,nosuchuser,,,,,PIPE);
+--enable_query_log
+DROP USER nosuchuser;
+UNINSTALL SONAME 'auth_named_pipe'; \ No newline at end of file
diff --git a/mysql-test/t/blackhole_plugin.test b/mysql-test/t/blackhole_plugin.test
index 0cc7ae0817c..487fc5656f2 100644
--- a/mysql-test/t/blackhole_plugin.test
+++ b/mysql-test/t/blackhole_plugin.test
@@ -1,8 +1,9 @@
if (!$HA_BLACKHOLE_SO) {
--skip Need blackhole plugin
}
-
+set sql_mode="";
CREATE TABLE t1(a int) ENGINE=BLACKHOLE;
+set sql_mode=default;
DROP TABLE t1;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN blackhole SONAME '$HA_BLACKHOLE_SO';
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test
index 5ab736cee15..d1a597a535e 100644
--- a/mysql-test/t/bootstrap.test
+++ b/mysql-test/t/bootstrap.test
@@ -84,6 +84,7 @@ EOF
# Check that installed plugins are *not* automatically loaded in --bootstrap
#
--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql
+SET SQL_MODE="";
use test;
create table t1(a int) engine=example charset=latin1;
EOF
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index e077b1c7827..702592374b6 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -214,3 +214,76 @@ DROP TABLE t1;
CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a;
DESCRIBE t1;
DROP TABLE t1;
+
+--echo #
+--echo # Start of 10.1 test
+--echo #
+
+--echo #
+--echo # MDEV-8752 Wrong result for SELECT..WHERE CASE enum_field WHEN 1 THEN 1 ELSE 0 END AND a='5'
+--echo #
+CREATE TABLE t1 (a ENUM('5','6') CHARACTER SET BINARY);
+INSERT INTO t1 VALUES ('5'),('6');
+SELECT * FROM t1 WHERE a='5';
+SELECT * FROM t1 WHERE a=1;
+SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END;
+SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END AND a='5';
+--echo # Multiple comparison types in CASE, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END AND a='5';
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM('a','b','100'));
+INSERT INTO t1 VALUES ('a'),('b'),('100');
+SELECT * FROM t1 WHERE a='a';
+SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END;
+SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END AND a='a';
+--echo # String comparison in CASE and in the equality, ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END AND a='a';
+
+SELECT * FROM t1 WHERE a=3;
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END;
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a=3;
+--echo # Integer comparison in CASE and in the equality, not ok to propagate
+--echo # ENUM does not support this type of propagation yet.
+--echo # This can change in the future. See MDEV-8748.
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a=3;
+
+SELECT * FROM t1 WHERE a=3;
+SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END;
+SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END AND a=3;
+--echo # String comparison in CASE, integer comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END AND a=3;
+
+SELECT * FROM t1 WHERE a='100';
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END;
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a='100';
+--echo # Integer comparison in CASE, string comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a='100';
+
+SELECT * FROM t1 WHERE a='100';
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END;
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a='100';
+--echo # Multiple type comparison in CASE, string comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a='100';
+
+SELECT * FROM t1 WHERE a=3;
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END;
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=3;
+--echo # Multiple type comparison in CASE, integer comparison in the equality, not Ok to propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=3;
+
+DROP TABLE t1;
+--echo #
+--echo # End of MDEV-8752
+--echo #
+
+--echo #
+--echo # End of 10.1 test
+--echo #
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index b6c37cacd8a..5316c12c857 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -456,3 +456,58 @@ SELECT CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY;
SET SQL_MODE=ALLOW_INVALID_DATES;
SELECT DATE("foo");
+#
+# CAST and field definition using same fields in LEX
+#
+create table t1 (a int, b char(5) as (cast("a" as char(10) binary) + a) );
+show create table t1;
+drop table t1;
+
+#
+# CAST (... BINARY)
+#
+select collation(cast("a" as char(10) binary));
+select collation(cast("a" as char(10) charset utf8 binary));
+select collation(cast("a" as char(10) ascii binary));
+select collation(cast("a" as char(10) binary charset utf8));
+select collation(cast("a" as char(10) binary ascii));
+
+--echo #
+--echo # MDEV-11030 Assertion `precision > 0' failed in decimal_bin_size
+--echo #
+
+SELECT * FROM (SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL)) sq;
+
+CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT COALESCE(CONVERT(NULL, UNSIGNED), NULL);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT CASE WHEN TRUE THEN CONVERT(NULL, UNSIGNED) ELSE NULL END;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL,SIGNED),CONVERT(NULL,UNSIGNED)) AS a;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ -1,
+ CONVERT(NULL,SIGNED),
+ CONCAT(CONVERT(NULL,SIGNED)),
+ 1,
+ CONVERT(NULL,UNSIGNED),
+ CONCAT(CONVERT(NULL,UNSIGNED));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ CONVERT('',SIGNED),
+ CONCAT(CONVERT('',SIGNED)),
+ CONVERT('',UNSIGNED),
+ CONCAT(CONVERT('',UNSIGNED));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test
index 659354e9c48..c918224520d 100644
--- a/mysql-test/t/change_user.test
+++ b/mysql-test/t/change_user.test
@@ -1,10 +1,14 @@
+# This test is checking that old password authentication works
+set global secure_auth=0;
#
# functional change user tests
#
-
+create user test_nopw;
grant select on test.* to test_nopw;
-grant select on test.* to test_oldpw identified by password "09301740536db389";
-grant select on test.* to test_newpw identified by "newpw";
+create user test_oldpw identified by password "09301740536db389";
+grant select on test.* to test_oldpw;
+create user test_newpw identified by "newpw";
+grant select on test.* to test_newpw;
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
@@ -136,3 +140,5 @@ if ($after != $before){
die The value of com_select changed during change_user;
}
echo Value of com_select did not change;
+
+set global secure_auth=default;
diff --git a/mysql-test/t/compound.test b/mysql-test/t/compound.test
new file mode 100644
index 00000000000..cabdf96e00e
--- /dev/null
+++ b/mysql-test/t/compound.test
@@ -0,0 +1,159 @@
+#
+# MDEV-5317 Compound statement / anonymous blocks
+#
+source include/have_log_bin.inc;
+delimiter |;
+
+CREATE TABLE t1 (a INT PRIMARY KEY)|
+
+BEGIN NOT ATOMIC
+ INSERT INTO t1 VALUES (1);
+ INSERT INTO t1 VALUES (2);
+ INSERT INTO t1 VALUES (3);
+END|
+
+SELECT * FROM t1|
+PREPARE stmt FROM "BEGIN NOT ATOMIC
+ INSERT INTO t1 VALUES (4);
+ INSERT INTO t1 VALUES (5);
+ INSERT INTO t1 VALUES (?);
+END";
+SET @val = 6|
+reset master|
+EXECUTE stmt USING @val|
+SELECT * FROM t1|
+
+# see how ?-placeholder was replaced with the value
+delimiter ;|
+source include/show_binlog_events.inc;
+delimiter |;
+
+DROP TABLE t1|
+
+#
+# test for default database
+#
+# * SP db is different from the current db
+CREATE DATABASE mysqltest1|
+CREATE PROCEDURE mysqltest1.sp1()
+BEGIN
+ PREPARE stmt FROM "BEGIN NOT ATOMIC CREATE TABLE t1 AS SELECT DATABASE(); END";
+ EXECUTE stmt;
+END|
+
+CALL mysqltest1.sp1()|
+SELECT * FROM mysqltest1.t1|
+
+USE mysqltest1|
+DROP DATABASE mysqltest1|
+
+# * no current db
+--error ER_NO_DB_ERROR
+BEGIN NOT ATOMIC CREATE TABLE t1(a int); END|
+
+BEGIN NOT ATOMIC SET @a=1; CREATE TABLE test.t1(a int); END|
+
+USE test|
+show tables|
+drop table t1|
+
+# IF (without /**/ mysqltest treats if as its own command)
+/**/ if (select count(*) from information_schema.tables
+ where table_schema='test' and table_name='t1') = 0
+ then
+ create table t1 (a int);
+end if|
+show tables|
+/**/ if (select count(*) from information_schema.tables
+ where table_schema='test' and table_name='t1') = 0
+ then
+ create table t1 (a int);
+end if|
+show tables|
+
+# CASE simple
+case (select table_name from information_schema.tables where table_schema='test')
+ when 't1' then create table t2 (b int);
+ when 't2' then create table t3 (b int);
+ else signal sqlstate '42S02';
+end case|
+show tables|
+
+# CASE searched
+case
+ when database() = 'test' then create table t3 (test text);
+ when now() < date'2001-02-03' then create table oops (machine time);
+end case|
+show tables|
+
+# LOOP
+--error ER_TABLE_EXISTS_ERROR
+loop
+ create table t4 (a int);
+end loop|
+show tables|
+
+# REPEAT
+set @a=0;
+repeat
+ set @a = @a + 1;
+until @a > 5
+end repeat|
+select @a|
+
+# WHILE
+--vertical_results
+/**/ while (select count(*) from information_schema.tables where table_schema='test')
+do
+ select concat('drop table ', table_name) into @a
+ from information_schema.tables where table_schema='test' limit 1;
+ select @a as 'executing:';
+ prepare dt from @a;
+ execute dt;
+end while|
+--horizontal_results
+
+# see how ?-placeholder and SP variables are replaced with values
+create table t1 (x int)|
+create function fn(a int) returns int
+begin
+ insert t1 values (a+7);
+ return a+8;
+end|
+reset master|
+/**/ if fn(9) > 5 then
+ select 1;
+end if|
+prepare stmt from "if fn(?) > 6 then
+ begin
+ declare a int;
+ set a=?*2;
+ insert t1 values(a+?);
+ end;
+end if"|
+set @a=1, @b=2, @c=3|
+execute stmt using @a, @b, @c|
+delimiter ;|
+source include/show_binlog_events.inc;
+delimiter |;
+
+drop function fn|
+drop table t1|
+
+#
+# MDEV-6606 Server crashes in String::append on selecting sql_mode inside anonymous block
+# MDEV-6609 SQL inside an anonymous block is executed with wrong SQL_MODE
+#
+begin not atomic select @@sql_mode; end|
+create table t1 (a int)|
+select a from t1 having a > 1|
+begin not atomic select a from t1 having a > 1; end|
+drop table t1|
+
+--echo #
+--echo # MDEV-8615: Assertion `m_cpp_buf <= begin_ptr &&
+--echo # begin_ptr <= m_cpp_buf + m_buf_length' failed in
+--echo # Lex_input_stream::body_utf8_start
+--echo #
+--error ER_PARSE_ERROR
+--query b'
diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test
index fca588de8e8..20989e70ef9 100644
--- a/mysql-test/t/connect.test
+++ b/mysql-test/t/connect.test
@@ -12,6 +12,7 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
+SET global secure_auth=0;
--disable_warnings
drop table if exists t1,t2;
@@ -134,6 +135,7 @@ drop table t1;
--echo # -- which results in user lockout.
--echo
+CREATE USER mysqltest_u1@localhost;
GRANT USAGE ON *.* TO mysqltest_u1@localhost;
# NOTE: if the test case fails sporadically due to spurious connections,
@@ -397,8 +399,8 @@ connection default;
#
# cannot connect when password is set and plugin=mysql_native_password
#
-update mysql.user set password=authentication_string, authentication_string=''
- where user like 'mysqltest_up_';
+update mysql.user set plugin='mysql_native_password' where user = 'mysqltest_up1';
+update mysql.user set plugin='mysql_old_password' where user = 'mysqltest_up2';
select user, password, plugin, authentication_string from mysql.user
where user like 'mysqltest_up_';
flush privileges;
@@ -452,3 +454,6 @@ delimiter ;|
call p1(2);
drop procedure p1;
+
+
+SET global secure_auth=default;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 70acf745889..c6a91a18965 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -401,7 +401,7 @@ explain t2;
select * from t2;
drop table t1, t2;
-create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
+create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, l datetime, m enum('a','b'), n set('a','b'), o char(10));
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(i,i), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(n,n), ifnull(o,o) from t1;
show create table t2;
drop table t1,t2;
@@ -821,337 +821,6 @@ create table t1 (upgrade int);
drop table t1;
-#
-# Bug #26642: create index corrupts table definition in .frm
-#
-# Problem with creating keys with maximum key-parts and maximum name length
-# This test is made for a mysql server supporting names up to 64 bytes
-# and a maximum of 16 key segements per Key
-#
-
-create table t1 (
- c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
- c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
-
- key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
-);
-
-# Check that the table is not corrupted
-show create table t1;
-flush tables;
-show create table t1;
-
-# Repeat test using ALTER to add indexes
-
-drop table t1;
-create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
-c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
-
-alter table t1
-
- add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
-
-show create table t1;
-flush tables;
-show create table t1;
-
-# Test the server limits; if any of these pass, all above tests need
-# to be rewritten to hit the limit
-#
-# Ensure limit is really 64 keys
---error 1069
-alter table t1 add key
- a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
-
-drop table t1;
-
-# Ensure limit is really 16 key parts per key
-
-create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
-c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int,
-c16 int, c17 int, c18 int,c19 int,c20 int,c21 int,c22 int,c23 int,c24 int,c25 int,c26 int,c27 int,c28 int,c29 int,c30 int,c31 int,c32 int, c33 int);
-
-# Get error for max key parts
---error 1070
-alter table t1 add key i1 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16, c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31,c32,c33);
-
-# Get error for max key-name length
---error 1059
-alter table t1 add key
- a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
-
-show create table t1;
-
-drop table t1;
-
--echo
--echo Bug #26104 Bug on foreign key class constructor
--echo
@@ -1436,7 +1105,7 @@ DROP TABLE IF EXISTS t3;
--echo
-CREATE TABLE t1(c1 TIMESTAMP, c2 TIMESTAMP);
+CREATE TABLE t1(c1 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c2 TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
--echo
@@ -1448,7 +1117,7 @@ CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP DEFAULT 0);
--echo
--error ER_INVALID_DEFAULT
-CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP);
+CREATE TABLE t2(c1 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c2 TIMESTAMP NOT NULL);
--echo
--echo # -- Check that NULL column still can be created.
@@ -1622,12 +1291,18 @@ END ; |
INSERT INTO t1 (pk, int_key) SELECT `pk` , `int_key` FROM B ;
--delimiter |
---error ER_NOT_SUPPORTED_YET
+--error ER_TRG_ALREADY_EXISTS
CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
BEGIN
UPDATE A SET `pk`=1 WHERE `pk`=0 ;
END ;|
+--error ER_NOT_SUPPORTED_YET
+CREATE TRIGGER f1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ UPDATE A SET `pk`=1 WHERE `pk`=0 ;
+END ;|
+
--delimiter ;
DROP TABLE t1;
diff --git a/mysql-test/t/create_drop_binlog.test b/mysql-test/t/create_drop_binlog.test
new file mode 100644
index 00000000000..59a66d59e6f
--- /dev/null
+++ b/mysql-test/t/create_drop_binlog.test
@@ -0,0 +1,196 @@
+--source include/have_udf.inc
+--source include/have_log_bin.inc
+--source include/binlog_start_pos.inc
+
+--let $pos=`select $binlog_start_pos + 65`
+
+--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
+--let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1)
+
+CREATE OR REPLACE DATABASE d1;
+CREATE OR REPLACE DATABASE d1;
+DROP DATABASE d1;
+CREATE DATABASE IF NOT EXISTS d1;
+CREATE DATABASE IF NOT EXISTS d1;
+DROP DATABASE IF EXISTS d1;
+DROP DATABASE IF EXISTS d1;
+--echo "Runnig SHOW BINLOG EVENTS"
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VERSIONS/
+--disable_query_log
+--eval SHOW BINLOG EVENTS FROM $binlog_start;
+--enable_query_log
+RESET MASTER;
+USE test;
+
+
+CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 1;
+DROP FUNCTION f1;
+CREATE FUNCTION IF NOT EXISTS f1() RETURNS INT RETURN 1;
+CREATE FUNCTION IF NOT EXISTS f1() RETURNS INT RETURN 1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+
+CREATE TABLE t1 (a DATETIME);
+CREATE OR REPLACE PROCEDURE p1() DELETE FROM t1;
+CREATE OR REPLACE PROCEDURE p1() DELETE FROM t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE IF NOT EXISTS p1() DELETE FROM t1;
+CREATE PROCEDURE IF NOT EXISTS p1() DELETE FROM t1;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+DROP TABLE t1;
+RESET MASTER;
+
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME '$UDF_EXAMPLE_SO';
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME '$UDF_EXAMPLE_SO';
+DROP FUNCTION metaphon;
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME '$UDF_EXAMPLE_SO';
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME '$UDF_EXAMPLE_SO';
+DROP FUNCTION IF EXISTS metaphon;
+DROP FUNCTION IF EXISTS metaphon;
+--replace_column 1 # 2 # 5 #
+--replace_result $UDF_EXAMPLE_SO UDM_EXAMPLE_LIB
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+
+--echo #
+--echo # CREATE SERVER is not logged
+--echo #
+CREATE OR REPLACE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+CREATE OR REPLACE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+DROP SERVER s1;
+CREATE SERVER IF NOT EXISTS s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+CREATE SERVER IF NOT EXISTS s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
+DROP SERVER IF EXISTS s1;
+DROP SERVER IF EXISTS s1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+
+
+CREATE OR REPLACE VIEW v1 AS SELECT 1;
+CREATE OR REPLACE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+CREATE VIEW IF NOT EXISTS v1 AS SELECT 1;
+CREATE VIEW IF NOT EXISTS v1 AS SELECT 1;
+DROP VIEW IF EXISTS v1;
+DROP VIEW IF EXISTS v1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+CREATE OR REPLACE ROLE r1;
+CREATE OR REPLACE ROLE r1;
+DROP ROLE r1;
+CREATE ROLE IF NOT EXISTS r1;
+CREATE ROLE IF NOT EXISTS r1;
+DROP ROLE IF EXISTS r1;
+DROP ROLE IF EXISTS r1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+CREATE OR REPLACE USER u1@localhost;
+CREATE OR REPLACE USER u1@localhost;
+DROP USER u1@localhost;
+CREATE USER IF NOT EXISTS u1@localhost;
+CREATE USER IF NOT EXISTS u1@localhost;
+DROP USER IF EXISTS u1@localhost;
+DROP USER IF EXISTS u1@localhost;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+
+SET timestamp=UNIX_TIMESTAMP('2014-11-01 10:20:30');
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t1;
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t2;
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+DROP EVENT ev1;
+DROP EVENT IF EXISTS ev1;
+
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+CREATE TABLE t1 (a INT);
+CREATE OR REPLACE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=10;
+CREATE OR REPLACE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=11;
+DROP TRIGGER tr1;
+CREATE TRIGGER IF NOT EXISTS tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=20;
+CREATE TRIGGER IF NOT EXISTS tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=21;
+DROP TRIGGER IF EXISTS tr1;
+DROP TRIGGER IF EXISTS tr1;
+DROP TABLE t1;
+
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+
+CREATE TABLE t1(a INT, b INT);
+CREATE TABLE IF NOT EXISTS t1(a INT, b INT);
+CREATE OR REPLACE INDEX i1 ON t1(a);
+CREATE OR REPLACE INDEX i1 ON t1(a);
+CREATE OR REPLACE INDEX i1 ON t1(a,b);
+CREATE OR REPLACE INDEX i1 ON t1(a,b);
+DROP TABLE t1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
+# Test RESET MASTER TO
+
+RESET MASTER;
+--replace_result $pos <pos>
+SHOW MASTER STATUS;
+RESET MASTER TO 100;
+--replace_result $pos <pos>
+SHOW MASTER STATUS;
+RESET MASTER;
+--replace_result $pos <pos>
+SHOW MASTER STATUS;
+
+#
+# mdev-7817 ALTER TABLE {ADD|DROP} INDEX IF [NOT] EXISTS does not get written into binlog if nothing to do
+#
+
+CREATE TABLE t1(a INT, b INT);
+CREATE TABLE IF NOT EXISTS t1(a INT, b INT);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+SHOW CREATE TABLE t1;
+DROP INDEX IF EXISTS i1 ON t1;
+DROP INDEX IF EXISTS i1 ON t1;
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+--replace_column 1 # 2 # 5 #
+--replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Server.ver.*/VER/
+SHOW BINLOG EVENTS;
+RESET MASTER;
+
diff --git a/mysql-test/t/create_drop_db.test b/mysql-test/t/create_drop_db.test
new file mode 100644
index 00000000000..13391c35a4d
--- /dev/null
+++ b/mysql-test/t/create_drop_db.test
@@ -0,0 +1,32 @@
+# Enable diisplaying rows affected
+--enable_info
+
+CREATE DATABASE IF NOT EXISTS db1;
+
+CREATE DATABASE IF NOT EXISTS db1;
+CREATE TABLE db1.t1 (a INT);
+SHOW TABLES IN db1;
+
+CREATE OR REPLACE DATABASE db1;
+SHOW TABLES IN db1;
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE DATABASE IF NOT EXISTS db2;
+
+DROP DATABASE db1;
+
+DROP DATABASE IF EXISTS db1;
+
+--error ER_DB_DROP_EXISTS
+DROP DATABASE db1;
+
+CREATE OR REPLACE DATABASE db1;
+SHOW TABLES IN db1;
+
+--error ER_DB_CREATE_EXISTS
+CREATE DATABASE db1;
+
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db1;
+
+--disable_info
diff --git a/mysql-test/t/create_drop_event.test b/mysql-test/t/create_drop_event.test
new file mode 100644
index 00000000000..d885a39e453
--- /dev/null
+++ b/mysql-test/t/create_drop_event.test
@@ -0,0 +1,47 @@
+--source include/not_embedded.inc
+
+SET timestamp=UNIX_TIMESTAMP('2014-11-01 10:20:30');
+SET GLOBAL event_scheduler=off;
+
+CREATE TABLE t1 (a INT);
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db1;
+
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+--source include/count_sessions.inc
+SET GLOBAL event_scheduler=on;
+let $wait_condition= SELECT count(*)>0 FROM t1;
+--source include/wait_condition.inc
+SELECT DISTINCT a FROM t1;
+SET GLOBAL event_scheduler=off;
+--source include/wait_until_count_sessions.inc
+DELETE FROM t1;
+
+--error ER_EVENT_ALREADY_EXISTS
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+CREATE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (12);
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (13);
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+
+SET GLOBAL event_scheduler=on;
+let $wait_condition= SELECT count(*)>0 FROM t1;
+--source include/wait_condition.inc
+SELECT DISTINCT a FROM t1;
+SET GLOBAL event_scheduler=off;
+--source include/wait_until_count_sessions.inc
+DELETE FROM t1;
+
+DROP EVENT IF EXISTS ev1;
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+DROP EVENT IF EXISTS ev1;
+--error ER_EVENT_DOES_NOT_EXIST
+DROP EVENT ev1;
+SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
+
+DROP TABLE t1;
+
+SET timestamp=DEFAULT;
diff --git a/mysql-test/t/create_drop_function.test b/mysql-test/t/create_drop_function.test
new file mode 100644
index 00000000000..e4d3d684cd5
--- /dev/null
+++ b/mysql-test/t/create_drop_function.test
@@ -0,0 +1,41 @@
+SET timestamp=UNIX_TIMESTAMP('2014-09-30 08:00:00');
+
+CREATE FUNCTION f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello, ', str, '!');
+SELECT * FROM mysql.proc WHERE name like 'f1';
+SELECT f1('world');
+
+--error ER_SP_ALREADY_EXISTS
+CREATE FUNCTION f1(str char(20))
+RETURNS TEXT
+RETURN CONCAT('Hello2, ', str, '!');
+SELECT body FROM mysql.proc WHERE name like 'f1';
+
+CREATE FUNCTION IF NOT EXISTS f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello3, ', str, '!');
+SELECT body FROM mysql.proc WHERE name like 'f1';
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE FUNCTION IF NOT EXISTS f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello4, ', str, '!');
+SELECT body FROM mysql.proc WHERE name like 'f1';
+
+CREATE OR REPLACE FUNCTION f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello5, ', str, '!');
+SELECT body FROM mysql.proc WHERE name like 'f1';
+
+DROP FUNCTION f1;
+CREATE FUNCTION IF NOT EXISTS f1(str char(20))
+RETURNS CHAR(100)
+RETURN CONCAT('Hello6, ', str, '!');
+SELECT body FROM mysql.proc WHERE name like 'f1';
+SELECT f1('world');
+
+DROP FUNCTION IF EXISTS f1;
+SELECT body FROM mysql.proc WHERE name like 'f1';
+DROP FUNCTION IF EXISTS f1;
+
diff --git a/mysql-test/t/create_drop_index.test b/mysql-test/t/create_drop_index.test
new file mode 100644
index 00000000000..4c861266325
--- /dev/null
+++ b/mysql-test/t/create_drop_index.test
@@ -0,0 +1,16 @@
+CREATE TABLE t1(a INT, b INT);
+CREATE INDEX IF NOT EXISTS i1 ON t1(a);
+SHOW CREATE TABLE t1;
+DROP INDEX IF EXISTS i1 ON t1;
+SHOW CREATE TABLE t1;
+DROP INDEX IF EXISTS i1 ON t1;
+SHOW CREATE TABLE t1;
+
+CREATE OR REPLACE INDEX i1 ON t1(a);
+SHOW CREATE TABLE t1;
+CREATE OR REPLACE INDEX i1 ON t1(a,b);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE INDEX IF NOT EXISTS i1 ON t1(b,a);
diff --git a/mysql-test/t/create_drop_procedure.test b/mysql-test/t/create_drop_procedure.test
new file mode 100644
index 00000000000..50e6b1cc61c
--- /dev/null
+++ b/mysql-test/t/create_drop_procedure.test
@@ -0,0 +1,41 @@
+CREATE TABLE t1 (id INT);
+DELIMITER $$;
+CREATE PROCEDURE proc1 (OUT cnt INT) COMMENT 'comment1' BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+DELIMITER ;$$
+CALL proc1(@cnt);
+SELECT @cnt;
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+
+DELIMITER $$;
+--error ER_SP_ALREADY_EXISTS
+CREATE PROCEDURE proc1 (OUT cnt INT) COMMENT 'comment2'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) COMMENT 'comment3'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) COMMENT 'comment4'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) COMMENT 'comment5'
+ BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+SELECT comment FROM mysql.proc WHERE name='proc1'$$
+
+DELIMITER ;$$
+DROP PROCEDURE proc1;
+DELIMITER $$;
+CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
+DELIMITER ;$$
+INSERT INTO t1 VALUES (1), (2), (3);
+CALL proc1(@cnt);
+SELECT @cnt;
+
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS proc1;
+DROP PROCEDURE IF EXISTS proc1;
diff --git a/mysql-test/t/create_drop_role.test b/mysql-test/t/create_drop_role.test
new file mode 100644
index 00000000000..be33083e6c4
--- /dev/null
+++ b/mysql-test/t/create_drop_role.test
@@ -0,0 +1,56 @@
+--source include/not_embedded.inc
+
+CREATE ROLE IF NOT EXISTS role1 WITH ADMIN user1;
+SELECT * FROM mysql.roles_mapping;
+DROP ROLE role1;
+
+CREATE OR REPLACE ROLE role1 WITH ADMIN user2;
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+CREATE OR REPLACE ROLE role1 WITH ADMIN user3;
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+CREATE ROLE IF NOT EXISTS role1 WITH ADMIN user4;
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+DROP ROLE IF EXISTS role1;
+SELECT * FROM mysql.roles_mapping WHERE Role='role1';
+DROP ROLE IF EXISTS role1;
+
+
+CREATE ROLE role_1;
+
+CREATE ROLE IF NOT EXISTS role_1;
+CREATE OR REPLACE ROLE role_1;
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE ROLE IF NOT EXISTS role_1;
+
+--error ER_CANNOT_USER
+CREATE ROLE role_1;
+
+CREATE USER u1@localhost;
+REVOKE SHOW DATABASES ON *.* FROM 'u1'@'localhost';
+GRANT SHOW DATABASES ON *.* TO role_1;
+GRANT role_1 TO u1@localhost;
+
+connect (user_a, localhost, u1,,);
+connection user_a;
+
+SELECT CURRENT_USER;
+
+SHOW DATABASES;
+SELECT CURRENT_ROLE;
+SET ROLE role_1;
+SELECT CURRENT_ROLE;
+SHOW DATABASES;
+SET ROLE NONE;
+
+connect (user_b, localhost, root,,);
+connection user_b;
+
+--echo # Clearing up
+DROP ROLE role_1;
+DROP ROLE IF EXISTS role_1;
+
+--error ER_CANNOT_USER
+DROP ROLE role_1;
+
+DROP USER u1@localhost;
diff --git a/mysql-test/t/create_drop_server.test b/mysql-test/t/create_drop_server.test
new file mode 100644
index 00000000000..d634cc1ccf1
--- /dev/null
+++ b/mysql-test/t/create_drop_server.test
@@ -0,0 +1,25 @@
+--echo #
+--echo # MDEV-7285 SERVER: CREATE OR REPLACE and CREATE IF NOT EXISTS
+--echo #
+
+CREATE SERVER IF NOT EXISTS server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user1', HOST 'localhost', DATABASE 'test0');
+SELECT server_name, username, db FROM mysql.servers;
+CREATE SERVER IF NOT EXISTS server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user2', HOST 'localhost', DATABASE 'test1');
+SELECT server_name, username, db FROM mysql.servers;
+CREATE OR REPLACE SERVER server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user3', HOST 'localhost', DATABASE 'test2');
+SELECT server_name, username, db FROM mysql.servers;
+DROP SERVER IF EXISTS server1;
+SELECT server_name, username, db FROM mysql.servers;
+DROP SERVER IF EXISTS server1;
+
+
+CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test0');
+--error ER_FOREIGN_SERVER_EXISTS
+CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test1');
+CREATE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
+SELECT server_name, username, db FROM mysql.servers;
+--error ER_WRONG_USAGE
+CREATE OR REPLACE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test3');
+CREATE OR REPLACE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test4');
+SELECT server_name, username, db FROM mysql.servers;
+DROP SERVER server_1;
diff --git a/mysql-test/t/create_drop_trigger.test b/mysql-test/t/create_drop_trigger.test
new file mode 100644
index 00000000000..a8afc8716d6
--- /dev/null
+++ b/mysql-test/t/create_drop_trigger.test
@@ -0,0 +1,31 @@
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE t1 (val INT);
+CREATE TRIGGER IF NOT EXISTS val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val;
+SET @sum=0;
+INSERT INTO t1 VALUES (10), (20), (30);
+SELECT @sum;
+
+--error ER_NOT_SUPPORTED_YET
+CREATE TRIGGER IF NOT EXISTS val_sum_new BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val;
+
+CREATE TRIGGER IF NOT EXISTS val_sum AFTER INSERT ON t1 FOR EACH ROW SET @sum = @sum + 1 + NEW.val;
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE TRIGGER IF NOT EXISTS val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + 2 + NEW.val;
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+
+CREATE OR REPLACE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + 3 + NEW.val;
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+
+--error ER_TRG_ALREADY_EXISTS
+CREATE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + 4 + NEW.val;
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+
+--echo # Clearing up
+DROP TRIGGER IF EXISTS val_sum;
+SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
+DROP TRIGGER IF EXISTS val_sum;
+
+DROP TABLE t1;
+DROP DATABASE db1;
diff --git a/mysql-test/t/create_drop_udf.test b/mysql-test/t/create_drop_udf.test
new file mode 100644
index 00000000000..5908bf04e90
--- /dev/null
+++ b/mysql-test/t/create_drop_udf.test
@@ -0,0 +1,37 @@
+--source include/have_udf.inc
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--error ER_UDF_EXISTS
+CREATE FUNCTION metaphon RETURNS INT SONAME "$UDF_EXAMPLE_SO";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+
+DROP FUNCTION IF EXISTS metaphon;
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--error ER_WRONG_USAGE
+eval CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+SELECT ret FROM mysql.func WHERE name like 'metaphon';
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--error ER_UDF_EXISTS
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+SELECT metaphon('mariadb');
+
+DROP FUNCTION metaphon;
+DROP FUNCTION IF EXISTS metaphon;
diff --git a/mysql-test/t/create_drop_user.test b/mysql-test/t/create_drop_user.test
new file mode 100644
index 00000000000..949782a2daf
--- /dev/null
+++ b/mysql-test/t/create_drop_user.test
@@ -0,0 +1,46 @@
+--source include/not_embedded.inc
+
+CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw1';
+SELECT password FROM mysql.user WHERE user='u1';
+
+CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw2';
+SELECT password FROM mysql.user WHERE user='u1';
+
+CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'pw3';
+SELECT password FROM mysql.user WHERE user='u1';
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pw4';
+SELECT password FROM mysql.user WHERE user='u1';
+
+DROP USER IF EXISTS u1@localhost;
+DROP USER IF EXISTS u1@localhost;
+
+--error ER_CANNOT_USER
+DROP USER u1@localhost;
+
+CREATE OR REPLACE USER u1@localhost;
+
+--error ER_CANNOT_USER
+CREATE USER u1@localhost;
+
+DROP USER u1@localhost;
+
+CREATE USER u1;
+
+--error ER_CANNOT_USER
+CREATE USER u1, u2;
+
+--error ER_CANNOT_USER
+CREATE USER u2;
+
+--error ER_PASSWD_LENGTH
+CREATE OR REPLACE USER u1 IDENTIFIED BY PASSWORD 'password', u2;
+
+CREATE OR REPLACE USER u1 IDENTIFIED BY PASSWORD 'abcdefghijklmnop', u2;
+
+DROP USER u1;
+DROP USER IF EXISTS u1, u2;
+
+--error ER_CANNOT_USER
+DROP USER u2;
diff --git a/mysql-test/t/create_drop_view.test b/mysql-test/t/create_drop_view.test
new file mode 100644
index 00000000000..5f5df43a7e0
--- /dev/null
+++ b/mysql-test/t/create_drop_view.test
@@ -0,0 +1,27 @@
+CREATE TABLE t1(id INT);
+CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
+INSERT INTO t1 VALUES (5), (8), (10), (20), (30);
+SELECT * FROM t1;
+SELECT * FROM v1;
+
+--error ER_TABLE_EXISTS_ERROR
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>11;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+
+CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>12;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+
+--error ER_WRONG_USAGE
+CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>13;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE id>14;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+
+INSERT INTO t1 VALUES (50), (80), (3), (2), (40);
+SELECT * FROM t1;
+SELECT * FROM v1;
+
+DROP VIEW IF EXISTS v1;
+DROP VIEW IF EXISTS v1;
+DROP TABLE t1;
diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test
index b37417f39d0..abf470b62d5 100644
--- a/mysql-test/t/create_or_replace.test
+++ b/mysql-test/t/create_or_replace.test
@@ -21,8 +21,6 @@ INSERT INTO t2 VALUES(1),(2),(3);
--error ER_WRONG_USAGE
CREATE OR REPLACE TABLE IF NOT EXISTS t1 (a int);
---error ER_WRONG_USAGE
-create or replace trigger trg before insert on t1 for each row set @a:=1;
# check that we don't try to create a log table in use
--error ER_BAD_LOG_STATEMENT
diff --git a/mysql-test/t/create_or_replace_permission.test b/mysql-test/t/create_or_replace_permission.test
new file mode 100644
index 00000000000..0e833a125bd
--- /dev/null
+++ b/mysql-test/t/create_or_replace_permission.test
@@ -0,0 +1,71 @@
+--source include/have_udf.inc
+# Grant tests not performed with embedded server
+-- source include/not_embedded.inc
+
+set local sql_mode="";
+set global sql_mode="";
+--echo #
+--echo # Tests for checking permission denied on CREATE OR REPLACE if DROP
+--echo # access is revoked
+--echo #
+
+--echo # These statements do not need special tests for CREATE OR REPLACE,
+--echo # because they do not have separate permissions for create and drop:
+--echo # CREATE OR REPLACE EVENT (uses EVENT_ACL for both CREATE and DROP)
+--echo # CREATE OR DROP SERVER (uses SUPER_ALC for both CREATE and DROP)
+--echo # CREATE OR DROP TRIGGER (uses TRIGGER_ACL for both CREATE and DROP)
+
+SELECT CURRENT_USER;
+CREATE DATABASE db1;
+GRANT ALL ON db1.* TO mysqltest_1@localhost;
+REVOKE DROP ON db1.* FROM mysqltest_1@localhost;
+REVOKE ALTER ROUTINE ON db1.* FROM mysqltest_1@localhost;
+GRANT DELETE ON mysql.* TO mysqltest_1@localhost;
+REVOKE DELETE ON mysql.* FROM mysqltest_1@localhost;
+FLUSH PRIVILEGES;
+
+connect (user_a, localhost, mysqltest_1,,);
+connection user_a;
+SELECT CURRENT_USER;
+
+# mysqltest_1 has CREATE privilege on db1
+--error ER_DB_CREATE_EXISTS
+CREATE DATABASE db1;
+
+# mysqltest_1 has no DROP privilege on db1
+--error ER_DBACCESS_DENIED_ERROR
+CREATE OR REPLACE DATABASE db1;
+
+# mysqltest_1 has no any privileges on db2
+--error ER_DBACCESS_DENIED_ERROR
+CREATE OR REPLACE DATABASE db2;
+
+USE db1;
+--error ER_TABLEACCESS_DENIED_ERROR
+CREATE OR REPLACE TABLE t1(id INT);
+
+--error ER_PROCACCESS_DENIED_ERROR
+CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN END;
+
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--error ER_DBACCESS_DENIED_ERROR
+eval CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
+
+--error ER_PROCACCESS_DENIED_ERROR
+CREATE OR REPLACE FUNCTION hello(str char(20)) RETURNS TEXT RETURN CONCAT('Hello, ', str, '!');
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+CREATE OR REPLACE USER u1@localhost;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+CREATE OR REPLACE ROLE developer;
+
+connection default;
+SELECT CURRENT_USER;
+REVOKE ALL ON db1.* FROM mysqltest_1@localhost;
+DROP DATABASE IF EXISTS db2;
+DROP DATABASE db1;
+DROP USER mysqltest_1@localhost;
+
+
+set global sql_mode=default;
diff --git a/mysql-test/t/create_w_max_indexes_128.test b/mysql-test/t/create_w_max_indexes_128.test
new file mode 100644
index 00000000000..46aa3c3b671
--- /dev/null
+++ b/mysql-test/t/create_w_max_indexes_128.test
@@ -0,0 +1,571 @@
+--source include/no_valgrind_without_big.inc
+--source include/have_max_indexes_128.inc
+
+create table t1 (
+ c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
+ c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
+
+ key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a066_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a067_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a068_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a069_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a070_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a071_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a072_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a073_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a074_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a075_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a076_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a077_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a078_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a079_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a080_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a081_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a082_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a083_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a084_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a085_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a086_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a087_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a088_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a089_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a090_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a091_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a092_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a093_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a094_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a095_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a096_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a097_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a098_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a099_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a100_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a101_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a102_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a103_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a104_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a105_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a106_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a107_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a108_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a109_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a110_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a111_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a112_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a113_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a114_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a115_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a116_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a117_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a118_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a119_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a120_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a121_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a122_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a123_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a124_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a125_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a126_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a127_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a128_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
+);
+
+# Check that the table is not corrupted
+show create table t1;
+flush tables;
+show create table t1;
+
+# Repeat test using ALTER to add indexes
+
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
+
+alter table t1
+
+ add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a066_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a067_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a068_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a069_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a070_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a071_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a072_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a073_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a074_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a075_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a076_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a077_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a078_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a079_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a080_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a081_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a082_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a083_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a084_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a085_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a086_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a087_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a088_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a089_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a090_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a091_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a092_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a093_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a094_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a095_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a096_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a097_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a098_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a099_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a100_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a101_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a102_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a103_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a104_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a105_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a106_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a107_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a108_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a109_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a110_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a111_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a112_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a113_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a114_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a115_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a116_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a117_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a118_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a119_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a120_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a121_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a122_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a123_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a124_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a125_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a126_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a127_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a128_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+
+show create table t1;
+flush tables;
+show create table t1;
+
+--error ER_TOO_MANY_KEYS
+alter table t1 add key
+ a129_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+
+drop table t1;
+
+--echo "End of tests"
diff --git a/mysql-test/t/create_w_max_indexes_64.test b/mysql-test/t/create_w_max_indexes_64.test
new file mode 100644
index 00000000000..6e614ecf2e5
--- /dev/null
+++ b/mysql-test/t/create_w_max_indexes_64.test
@@ -0,0 +1,334 @@
+--source include/no_valgrind_without_big.inc
+--source include/have_max_indexes_64.inc
+#
+# Bug #26642: create index corrupts table definition in .frm
+#
+# Problem with creating keys with maximum key-parts and maximum name length
+# This test is made for a mysql server supporting names up to 64 bytes
+# and a maximum of 16 key segements per Key
+#
+
+create table t1 (
+ c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
+ c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
+
+ key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
+);
+
+# Check that the table is not corrupted
+show create table t1;
+flush tables;
+show create table t1;
+
+# Repeat test using ALTER to add indexes
+
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
+
+alter table t1
+
+ add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+
+show create table t1;
+flush tables;
+show create table t1;
+
+# Test the server limits; if any of these pass, all above tests need
+# to be rewritten to hit the limit
+#
+# Ensure limit is really 64 keys
+--error 1069
+alter table t1 add key
+ a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+
+drop table t1;
+
+# Ensure limit is really 16 key parts per key
+
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int,
+c16 int, c17 int, c18 int,c19 int,c20 int,c21 int,c22 int,c23 int,c24 int,c25 int,c26 int,c27 int,c28 int,c29 int,c30 int,c31 int,c32 int, c33 int);
+
+# Get error for max key parts
+--error 1070
+alter table t1 add key i1 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16, c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31,c32,c33);
+
+# Get error for max key-name length
+--error 1059
+alter table t1 add key
+ a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
+
+show create table t1;
+
+drop table t1;
+
+--echo "End of tests"
diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test
index 5c0bdff4633..46bb29514ff 100644
--- a/mysql-test/t/ctype_big5.test
+++ b/mysql-test/t/ctype_big5.test
@@ -121,7 +121,7 @@ DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
SELECT COUNT(*) FROM t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
#
# Display all characters that have upper or lower case mapping.
#
diff --git a/mysql-test/t/ctype_binary.test b/mysql-test/t/ctype_binary.test
index 3d3f90b444b..8da4eaff572 100644
--- a/mysql-test/t/ctype_binary.test
+++ b/mysql-test/t/ctype_binary.test
@@ -27,3 +27,50 @@ SELECT _binary 0x7E, _binary X'7E', _binary B'01111110';
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
+--echo #
+CREATE TABLE t1 (a VARBINARY(10));
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE CRC32(a)=3904355907;
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+--echo # Okey to propagate 'a' into CRC32(a)
+EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61';
+SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+--echo # Okey to propagate 'a' into HEX(a)
+EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+SELECT * FROM t1 WHERE a='a';
+SELECT * FROM t1 WHERE LENGTH(a)=2;
+SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+--echo # Okey to propagate 'a' into LENGTH(a)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+SELECT * FROM t1 WHERE a='a ';
+SELECT * FROM t1 WHERE a='a ' AND LENGTH(a)=2;
+--echo # Okey to propagate 'a ' into LENGTH(a)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a ' AND LENGTH(a)=2;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8723 Wrong result for SELECT..WHERE COLLATION(a)='binary' AND a='a'
+--echo #
+CREATE TABLE t1 (a VARBINARY(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE COLLATION(a)='binary' AND a='a';
+SELECT * FROM t1 WHERE CHARSET(a)='binary' AND a='a';
+SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
+SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COLLATION(a)='binary' AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE CHARSET(a)='binary' AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test
index f5c241fb679..0bbe4cafca6 100644
--- a/mysql-test/t/ctype_cp1250_ch.test
+++ b/mysql-test/t/ctype_cp1250_ch.test
@@ -12,6 +12,7 @@ SHOW COLLATION LIKE 'cp1250_czech_cs';
SET @test_character_set= 'cp1250';
SET @test_collation= 'cp1250_general_ci';
-- source include/ctype_common.inc
+-- source include/ctype_like_cond_propagation.inc
SET @test_character_set= 'cp1250';
SET @test_collation= 'cp1250_czech_cs';
diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test
index 0455f579922..93fd5cc9a1a 100644
--- a/mysql-test/t/ctype_cp1251.test
+++ b/mysql-test/t/ctype_cp1251.test
@@ -107,3 +107,38 @@ DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8688 Wrong result for SELECT..WHERE varchar_column IN (1,2,3) AND varchar_column=' 1';
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
+INSERT INTO t1 VALUES (' 1'),('`1');
+SELECT * FROM t1 WHERE a IN (1,2,3);
+SELECT * FROM t1 WHERE a IN (1,2,3) AND a=' 1';
+SELECT * FROM t1 WHERE a IN (1,2,3,'4') AND a=' 1';
+# Equality should not propagate ' 1' to IN: incompatible comparison context
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,3) AND a=' 1';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,3,'x') AND a=' 1';
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8671 Wrong result for SELECT..WHERE varchar_column=' 1' AND (varchar_column XOR '1')
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
+INSERT INTO t1 VALUES (' 1'),('`1');
+SELECT * FROM t1 WHERE a=' 1';
+SELECT * FROM t1 WHERE (a XOR '0');
+SELECT * FROM t1 WHERE a=' 1' AND (a XOR '0');
+--echo # ' 1' should not be propagated into (a XIR '0')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=' 1' AND (a XOR '0');
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test
index 304c9f5d05c..1b92006c949 100644
--- a/mysql-test/t/ctype_cp932_binlog_stm.test
+++ b/mysql-test/t/ctype_cp932_binlog_stm.test
@@ -99,7 +99,7 @@ DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=1;
+SELECT COUNT(*) FROM t1 WHERE a<>'?' AND OCTET_LENGTH(a)=1;
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
#
# Display all characters that have upper or lower case mapping.
diff --git a/mysql-test/t/ctype_eucjpms.test b/mysql-test/t/ctype_eucjpms.test
index 49ca81850ed..d533e38b2a2 100644
--- a/mysql-test/t/ctype_eucjpms.test
+++ b/mysql-test/t/ctype_eucjpms.test
@@ -446,6 +446,7 @@ SHOW CREATE TABLE t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND a<>'?';
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
SELECT * FROM t1 WHERE CHAR_LENGTH(a)=2;
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=3;
@@ -540,3 +541,28 @@ SELECT _eucjpms 0x8EA0;
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character"
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET eucjpms, KEY(a));
+# [x00-x7F] # ASCII/JIS-Roman
+# [x8E][xA1-xDF] # half-width katakana
+# [x8F][xA1-xFE][xA1-xFE] # JIS X 0212-1990
+# [xA1-xFE][xA1-xFE] # JIS X 0208:1997
+INSERT INTO t1 VALUES ('a'),(0x7F);
+INSERT INTO t1 VALUES (0x8EA1),(0x8EDF);
+INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE);
+INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE);
+SELECT HEX(a) FROM t1 ORDER BY a;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET eucjpms COLLATE eucjpms_bin;
+SELECT HEX(a) FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_euckr.test b/mysql-test/t/ctype_euckr.test
index 155b8ebed00..33b3e96cba8 100644
--- a/mysql-test/t/ctype_euckr.test
+++ b/mysql-test/t/ctype_euckr.test
@@ -95,8 +95,8 @@ WHERE t11.a >= 0x81 AND t11.a <= 0xFE
AND t12.a >= 0x41 AND t12.a <= 0xFE
ORDER BY t11.a, t12.a;
--enable_warnings
-SELECT s as bad_code FROM t2 WHERE a='' ORDER BY s;
-DELETE FROM t2 WHERE a='';
+SELECT s as bad_code FROM t2 WHERE a='?' ORDER BY s;
+DELETE FROM t2 WHERE a='?';
ALTER TABLE t2 ADD u VARCHAR(1) CHARACTER SET utf8, ADD a2 VARCHAR(1) CHARACTER SET euckr;
--disable_warnings
UPDATE t2 SET u=a, a2=u;
@@ -145,7 +145,7 @@ ORDER BY head, tail;
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
#
# Display all characters that have upper or lower case mapping.
#
diff --git a/mysql-test/t/ctype_filename.test b/mysql-test/t/ctype_filename.test
index 4c501a8b826..7ec07293a2b 100644
--- a/mysql-test/t/ctype_filename.test
+++ b/mysql-test/t/ctype_filename.test
@@ -22,3 +22,8 @@ drop table `clock$`;
select convert(convert(',' using filename) using binary);
+--echo #
+--echo # MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member
+--echo #
+SET NAMES utf8;
+SELECT @a:=CONVERT('aÑ' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a), HEX(REVERSE(@a));
diff --git a/mysql-test/t/ctype_gb2312.test b/mysql-test/t/ctype_gb2312.test
index e3dd448f54c..3ca6941705c 100644
--- a/mysql-test/t/ctype_gb2312.test
+++ b/mysql-test/t/ctype_gb2312.test
@@ -69,7 +69,7 @@ ORDER BY head, tail;
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
#
# Display all characters that have upper or lower case mapping.
#
diff --git a/mysql-test/t/ctype_gbk.test b/mysql-test/t/ctype_gbk.test
index 454377d98a7..022d4a3705a 100644
--- a/mysql-test/t/ctype_gbk.test
+++ b/mysql-test/t/ctype_gbk.test
@@ -104,7 +104,7 @@ ORDER BY head, tail;
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
#
# Display all characters that have upper or lower case mapping.
#
@@ -217,3 +217,235 @@ DROP TABLE t1;
--echo #
--echo # End of 10.0 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion
+--echo #
+
+CREATE TABLE t1 (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ b VARBINARY(16),
+ type SET('ascii','bad','head','tail','mb2','unassigned')
+);
+INSERT INTO t1 (b, type) VALUES (0x40, 'ascii,tail');
+INSERT INTO t1 (b, type) VALUES (0x80, 'tail');
+INSERT INTO t1 (b, type) VALUES (0x81, 'head,tail');
+INSERT INTO t1 (b, type) VALUES (0xFF, 'bad');
+INSERT INTO t1 (b, type) VALUES (0xA140, 'mb2,unassigned');
+INSERT INTO t1 (b, type) VALUES (0xA1A3, 'mb2');
+INSERT INTO t1 (b, type) VALUES (0xFE40, 'mb2');
+CREATE TABLE t2 AS SELECT
+ CONCAT(t1.b,t2.b) AS b,
+ t1.type AS type1,
+ t2.type AS type2,
+ CONCAT('[',t1.type,'][',t2.type,']') AS comment
+FROM t1, t1 t2;
+
+CREATE TABLE t3
+(
+ b VARBINARY(16),
+ c VARCHAR(16) CHARACTER SET gbk,
+ comment VARCHAR(128)
+);
+--echo #
+--echo # A combination of two valid characters, should give no warnings
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE
+ (FIND_IN_SET('ascii',type1) OR FIND_IN_SET('mb2',type1)) AND
+ (FIND_IN_SET('ascii',type2) OR FIND_IN_SET('mb2',type2))
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+--echo #
+--echo # Sequences that start with a tail or a bad byte,
+--echo # or end with a bad byte, all should be fixed.
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE type1='tail' OR type1='bad' OR type2='bad'
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+--echo #
+--echo # Sequences that start with an ASCII or an MB2 character,
+--echo # followed by a non-ASCII tail, all should be fixed.
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('mb2',type1) OR FIND_IN_SET('ascii',type1))
+ AND (FIND_IN_SET('tail',type2) AND NOT FIND_IN_SET('ascii',type2))
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+--echo #
+--echo # Other sequences
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2 ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t3;
+DROP TABLE t3;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ CONCAT(t1.b,t2.b,t3.b) AS b,
+ t1.type AS type1,
+ t2.type AS type2,
+ t3.type AS type3,
+ CONCAT('[',t1.type,'][',t2.type,'][',t3.type,']') AS comment
+FROM t1, t1 t2,t1 t3;
+SELECT COUNT(*) FROM t2;
+
+CREATE TABLE t3
+(
+ b VARBINARY(16),
+ c VARCHAR(16) CHARACTER SET gbk,
+ comment VARCHAR(128)
+);
+
+--echo #
+--echo # A combination of three valid characters, should give no warnings
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE
+ (FIND_IN_SET('ascii',type1) OR FIND_IN_SET('mb2',type1)) AND
+ (FIND_IN_SET('ascii',type2) OR FIND_IN_SET('mb2',type2)) AND
+ (FIND_IN_SET('ascii',type3) OR FIND_IN_SET('mb2',type3))
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+--echo #
+--echo # Sequences that start with a tail or a bad byte,
+--echo # or have a bad byte, all should be fixed.
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE type1='tail' OR type1='bad' OR type2='bad' OR type3='bad'
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+--echo #
+--echo # Sequences that start with an ASCII or an MB2 character,
+--echo # followed by a pure non-ASCII tail, all should be fixed.
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('mb2',type1) OR FIND_IN_SET('ascii',type1))
+ AND type2='tail'
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+--echo #
+--echo # Sequences that consist of two ASCII or MB2 characters,
+--echo # followed by a pure non-ASCII tail, all should be fixed.
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('mb2',type1) OR FIND_IN_SET('ascii',type1)) AND
+ (FIND_IN_SET('mb2',type2) OR FIND_IN_SET('ascii',type2)) AND
+ type3='tail'
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+
+--echo #
+--echo # Sequences that consist of two MB2 characters,
+--echo # followed by a non-ASCII head or tail, all should be fixed.
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE FIND_IN_SET('mb2',type1) AND FIND_IN_SET('mb2',type2)
+ AND NOT FIND_IN_SET('ascii',type3)
+ AND NOT FIND_IN_SET('mb2',type3)
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+
+--echo #
+--echo # Sequences that consist of head + tail + MB2 should go without warnings
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE FIND_IN_SET('head',type1)
+ AND FIND_IN_SET('tail',type2)
+ AND FIND_IN_SET('mb2',type3)
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+--echo #
+--echo # Sequences that consist of (ascii or mb2) + head + tail should go without warnings
+--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2
+WHERE (FIND_IN_SET('ascii',type1) OR FIND_IN_SET('mb2',type1))
+ AND FIND_IN_SET('head',type2)
+ AND FIND_IN_SET('tail',type3)
+ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+DELETE FROM t2 WHERE b IN (SELECT b FROM t3);
+DELETE FROM t3;
+
+
+#--echo #
+#--echo # Other sequences
+#--echo #
+INSERT INTO t3 (b,c,comment) SELECT b,b,comment FROM t2 ORDER BY b;
+SELECT COUNT(*) FROM t3;
+SELECT HEX(c),comment FROM t3 WHERE b=c ORDER BY b;
+SELECT HEX(c),HEX(b),comment FROM t3 WHERE b<>c ORDER BY b;
+
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+
+--echo #
+--echo # END OF MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion
+--echo #
+
+--echo #
+--echo # MDEV-7661 Unexpected result for: CAST(0xHHHH AS CHAR CHARACTER SET xxx) for incorrect byte sequences
+--echo #
+SELECT HEX(CAST(0xA341 AS CHAR CHARACTER SET gb2312));
+SELECT HEX(CONVERT(CAST(0xA341 AS CHAR CHARACTER SET gb2312) USING utf8));
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index 8a188b71e24..1ee48eed18c 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -264,3 +264,131 @@ DROP TABLE t1;
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8661 Wrong result for SELECT..WHERE a='a' AND a='a' COLLATE latin1_bin
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (a CHAR(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a' AND a='a' COLLATE latin1_bin;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a' COLLATE latin1_bin AND a='A' COLLATE latin1_swedish_ci;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8679 Equal field propagation is not used for VARCHAR when it safely could
+--echo #
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('10'),('11'),('12');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='10' AND IF(a='10',1,0)=1;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='10' AND CASE WHEN a='10' THEN 1 ELSE 0 END;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8680 Wrong result for SELECT..WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='a'
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b');
+SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='a';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8698 Wrong result for SELECT..WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin;
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a'),('A'),('b'),('B'),('c'),('C');
+SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin;
+SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin AND a='a';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8707 Wrong result for SELECT..WHERE varchar_column=DATE'2001-01-01' AND varchar_column='2001-01-01'
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(40));
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01x');
+SELECT * FROM t1 WHERE a=DATE'2001-01-01' AND a='2001-01-01';
+SELECT * FROM t1 WHERE a='2001-01-01' AND a=DATE'2001-01-01';
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01x',DATE'2001-01-01');
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01x');
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01',DATE'2001-01-01');
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01');
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('2001-01-01','2001-01-01x'));
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01x');
+SELECT * FROM t1 WHERE a=DATE'2001-01-01' AND a='2001-01-01';
+SELECT * FROM t1 WHERE a='2001-01-01' AND a=DATE'2001-01-01';
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01x',DATE'2001-01-01');
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01x');
+SELECT * FROM t1 WHERE (a,a)=('2001-01-01',DATE'2001-01-01');
+SELECT * FROM t1 WHERE (a,a)=(DATE'2001-01-01','2001-01-01');
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(40),b VARCHAR(40));
+INSERT INTO t1 VALUES ('2001-01-01','2001-01-01x');
+SELECT * FROM t1 WHERE a=b AND a=DATE'2001-01-01';
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('2001-01-01','2001-01-01x'),b ENUM('2001-01-01','2001-01-01x'));
+INSERT INTO t1 VALUES ('2001-01-01','2001-01-01x');
+SELECT * FROM t1 WHERE a=b AND a=DATE'2001-01-01';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE CRC32(a)=3904355907;
+SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+--echo # 'a' should not be propagated into CRC32(a)
+EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
+SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61';
+SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+--echo # 'a' should not be propagated into HEX(a)
+EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
+SELECT * FROM t1 WHERE a='a';
+SELECT * FROM t1 WHERE LENGTH(a)=2;
+SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+--echo # 'a' should not be propagated into LENGTH(a)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8712 Wrong result for SELECT..WHERE latin1_bin_column=_latin1'a' AND latin1_bin_column='A'
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (a VARCHAR(20) COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT * FROM t1 WHERE a='A';
+SELECT * FROM t1 WHERE a='A' AND a=_latin1'a';
+SELECT * FROM t1 WHERE a=_latin1'a' AND a='A';
+SELECT * FROM t1 WHERE a=_latin1'A';
+SELECT * FROM t1 WHERE a=_latin1'A' AND a=_latin1'a';
+SELECT * FROM t1 WHERE a=_latin1'a' AND a=_latin1'A';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8253 EXPLAIN SELECT prints unexpected characters
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (a DECIMAL(10,1),b DECIMAL(10,1),c VARCHAR(10),d VARCHAR(10));
+INSERT INTO t1 VALUES (1.5,1.5,'1','1'),(3.5,3.5,'3','3');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(c,0)='3 ' AND COALESCE(d,0)=COALESCE(c,0);
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_latin2_ch.test b/mysql-test/t/ctype_latin2_ch.test
index acd93aad6d6..06ccd2c9782 100644
--- a/mysql-test/t/ctype_latin2_ch.test
+++ b/mysql-test/t/ctype_latin2_ch.test
@@ -33,6 +33,7 @@ drop table t1;
set names latin2 collate latin2_czech_cs;
--source include/ctype_pad_space.inc
+--source include/ctype_like_cond_propagation.inc
# We can not use ctype_filesort.inc because
# order of SPACE and TAB is not strict
@@ -143,6 +144,7 @@ SELECT * FROM t1 GROUP BY s1;
SELECT * FROM t1 ORDER BY s1;
DROP TABLE t1;
+set sql_mode="";
--disable_warnings
CREATE TABLE t1 ENGINE=INNODB AS SELECT repeat('a', 5) AS s1 LIMIT 0;
--enable_warnings
@@ -182,6 +184,7 @@ DROP TABLE t1;
SET NAMES latin2;
+
#
# Bug#37854 Test fails/aborts for collate latin2_czech_cs used with SET and ENUM datatypes
#
diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
index 1b9d7c9d4ad..1ea8002a2eb 100644
--- a/mysql-test/t/ctype_ldml.test
+++ b/mysql-test/t/ctype_ldml.test
@@ -397,3 +397,15 @@ perl;
print "Occurances : $count_error\n";
close(FILE);
EOF
+
+
+--echo #
+--echo # MDEV-8686 A user defined collation utf8_confusables doesn't work
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_implicit_weights_ci);
+INSERT INTO t1 VALUES ('a'),('b'),('c');
+INSERT INTO t1 VALUES (_ucs2 0x1500),(_ucs2 0x1501);
+INSERT INTO t1 VALUES (_ucs2 0x3400),(_ucs2 0x3560),(_ucs2 0x3561),(_ucs2 0x3600);
+INSERT INTO t1 VALUES (_ucs2 0x3700),(_ucs2 0x3701);
+SELECT HEX(CONVERT(a USING ucs2)) AS ch, HEX(WEIGHT_STRING(a)) AS w, HEX(WEIGHT_STRING(a COLLATE utf8_unicode_ci)) AS ducet FROM t1 ORDER BY a,ch;
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_like_range.test b/mysql-test/t/ctype_like_range.test
index 02f2f79d168..e9387e46eb4 100644
--- a/mysql-test/t/ctype_like_range.test
+++ b/mysql-test/t/ctype_like_range.test
@@ -4,6 +4,8 @@
--source include/have_utf32.inc
--source include/have_utf8mb4.inc
+SET NAMES utf8;
+
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
@@ -38,6 +40,8 @@ ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
+INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F);
+INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F);
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
@@ -52,6 +56,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci;
SELECT * FROM v1;
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_thai_520_w2;
+SELECT * FROM v1;
+
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4;
SELECT * FROM v1;
@@ -67,6 +74,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci;
SELECT * FROM v1;
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2;
+SELECT * FROM v1;
+
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
SELECT * FROM v1;
@@ -82,6 +92,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
SELECT * FROM v1;
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2;
+SELECT * FROM v1;
+
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
SELECT * FROM v1;
@@ -97,6 +110,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci;
SELECT * FROM v1;
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_thai_520_w2;
+SELECT * FROM v1;
+
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci;
SELECT * FROM v1;
@@ -112,6 +128,9 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci;
SELECT * FROM v1;
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_thai_520_w2;
+SELECT * FROM v1;
+
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci;
SELECT * FROM v1;
diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test
index 11ad942e19c..a51ead67eb2 100644
--- a/mysql-test/t/ctype_many.test
+++ b/mysql-test/t/ctype_many.test
@@ -331,3 +331,22 @@ CREATE TABLE t2 (a BINARY(1));
SELECT * FROM t2 WHERE a=(SELECT a FROM t1) AND a=_LATIN1'x';
DROP TABLE t2;
DROP TABLE t1;
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8362 dash '-' is not recognized in charset armscii8 on select where query
+--echo #
+CREATE TABLE t1 (a VARCHAR(64) CHARACTER SET armscii8);
+INSERT INTO t1 VALUES ('abc-def');
+SELECT * FROM t1 WHERE a='abc-def';
+SELECT * FROM t1 WHERE a LIKE 'abc%';
+DROP TABLE t1;
+SELECT HEX(CONVERT(_utf8 0x2728292C2D2E USING armscii8));
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test
index ae110b20cb2..2777cf6a035 100644
--- a/mysql-test/t/ctype_sjis.test
+++ b/mysql-test/t/ctype_sjis.test
@@ -145,7 +145,7 @@ DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=1;
+SELECT COUNT(*) FROM t1 WHERE a<>'?' AND OCTET_LENGTH(a)=1;
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
#
# Display all characters that have upper or lower case mapping.
diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test
index b536a00bec9..ba5db9df54f 100644
--- a/mysql-test/t/ctype_tis620.test
+++ b/mysql-test/t/ctype_tis620.test
@@ -157,9 +157,11 @@ SET collation_connection='tis620_thai_ci';
-- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
--source include/ctype_ascii_order.inc
+-- source include/ctype_like_cond_propagation.inc
SET collation_connection='tis620_bin';
-- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
+-- source include/ctype_like_cond_propagation.inc
# End of 4.1 tests
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 5e8195e4718..7406bafc5e6 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -70,6 +70,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_german2_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_520_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_vietnamese_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_thai_520_w2;
ALTER TABLE t1 CONVERT TO CHARACTER SET ucs2 COLLATE ucs2_bin;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_unicode_ci;
@@ -620,3 +621,38 @@ DROP TABLE t1;
--echo #
--echo # End of MariaDB-10.0 tests
--echo #
+
+--echo #
+--echo # Start of MariaDB-10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-6973 XOR aggregates argument collations
+--echo #
+SELECT '10' COLLATE utf8_general_ci XOR '20' COLLATE utf8_unicode_ci;
+
+--echo #
+--echo # MDEV-8705 Wrong result for SELECT..WHERE latin1_bin_column='a' AND latin1_bin_column='A'
+--echo #
+SET NAMES utf8 COLLATE utf8_german2_ci;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a';
+SELECT * FROM t1 WHERE a=_utf8'a';
+# Make sure this does not return "Illegal mix of collations"
+SELECT * FROM t1 WHERE a='a' AND a=_utf8'a';
+DROP TABLE t1;
+
+
+SET NAMES utf8 COLLATE utf8_thai_520_w2;
+--source include/ctype_uca_w2.inc
+--source include/ctype_thai.inc
+
+SET NAMES utf8;
+SET collation_connection=ucs2_thai_520_w2;
+--source include/ctype_uca_w2.inc
+--source include/ctype_thai.inc
+
+--echo #
+--echo # End of MariaDB-10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_uca_partitions.test b/mysql-test/t/ctype_uca_partitions.test
new file mode 100644
index 00000000000..5734bb52008
--- /dev/null
+++ b/mysql-test/t/ctype_uca_partitions.test
@@ -0,0 +1,38 @@
+--source include/have_partition.inc
+
+SET NAMES utf8;
+
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2)
+PARTITION BY KEY(c1) PARTITIONS 3;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…');
+INSERT INTO t1 VALUES ('B');
+INSERT INTO t1 VALUES ('C');
+INSERT INTO t1 VALUES ('D');
+INSERT INTO t1 VALUES ('E');
+INSERT INTO t1 VALUES ('F');
+INSERT INTO t1 VALUES ('G');
+INSERT INTO t1 VALUES ('H');
+INSERT INTO t1 VALUES ('I');
+INSERT INTO t1 VALUES ('J');
+INSERT INTO t1 VALUES ('K');
+INSERT INTO t1 VALUES ('L'),('Ĺ'),('Ä»'),('Ľ'),('Ä¿'),('Å');
+INSERT INTO t1 VALUES ('M');
+INSERT INTO t1 VALUES ('N');
+INSERT INTO t1 VALUES ('O'),('Ò'),('Ó'),('Ô'),('Õ'),('Ö'),('Ø');
+INSERT INTO t1 VALUES ('P');
+INSERT INTO t1 VALUES ('Q');
+INSERT INTO t1 VALUES ('R');
+INSERT INTO t1 VALUES ('S');
+INSERT INTO t1 VALUES ('T');
+INSERT INTO t1 VALUES ('U');
+INSERT INTO t1 VALUES ('V');
+INSERT INTO t1 VALUES ('W');
+INSERT INTO t1 VALUES ('X');
+INSERT INTO t1 VALUES ('Y');
+INSERT INTO t1 VALUES ('Z');
+
+SELECT * FROM t1 PARTITION (p0) ORDER BY c1;
+SELECT * FROM t1 PARTITION (p1) ORDER BY c1;
+SELECT * FROM t1 PARTITION (p2) ORDER BY c1;
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 544de37df3e..e21cd1f0022 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -440,9 +440,11 @@ drop table t1;
#
# Bug #14583 Bug on query using a LIKE on indexed field with ucs2_bin collation
#
+set sql_mode="";
--disable_warnings
create table t1(f1 varchar(5) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL) engine=InnoDB;
--enable_warnings
+set sql_mode=default;
insert into t1 values('a');
create index t1f1 on t1(f1);
select f1 from t1 where f1 like 'a%';
@@ -735,7 +737,10 @@ DROP TABLE t1;
--echo #
--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
--echo #
+--disable_warnings
+# Enable warnings when "MDEV-8844 Unreadable control characters printed as is in warnings" is fixed
SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
+--enable_warnings
SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED);
--echo End of 5.0 tests
@@ -911,7 +916,7 @@ DO CAST(CONVERT('' USING ucs2) AS UNSIGNED);
CREATE TABLE t1 (a DECIMAL(2,0));
SET sql_mode='strict_all_tables';
---error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t1 VALUES (CONVERT('9e99999999' USING ucs2));
SET sql_mode=DEFAULT;
@@ -945,7 +950,6 @@ SELECT CONCAT(CONVERT('pi=' USING ucs2),PI()) AS PI;
SET NAMES utf8, character_set_connection=ucs2;
SELECT 'a','aa';
-
--echo #
--echo # MDEV-10306 Wrong results with combination of CONCAT, SUBSTR and CONVERT in subquery
--echo #
@@ -965,3 +969,38 @@ SET optimizer_switch=@save_optimizer_switch;
--echo #
--echo # End of 10.0 tests
--echo #
+
+#
+# CAST (... BINARY)
+#
+select collation(cast("a" as char(10) unicode binary));
+select collation(cast("a" as char(10) binary unicode));
+
+--echo #
+--echo # MDEV-8222 "string_field LIKE int_const" returns a wrong result in case of UCS2
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARSET ucs2);
+INSERT INTO t1 VALUES ('1');
+SELECT * FROM t1 WHERE a LIKE 1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8253 EXPLAIN SELECT prints unexpected characters
+--echo #
+SET NAMES latin1, character_set_connection=ucs2;
+CREATE TABLE t1 (a DECIMAL(10,1),b DECIMAL(10,1),c VARCHAR(10),d VARCHAR(10));
+INSERT INTO t1 VALUES (1.5,1.5,'1','1'),(3.5,3.5,'3','3');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(c,0)='3 ' AND COALESCE(d,0)=COALESCE(c,0);
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
+--echo #
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED);
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test
index 48dc0e63058..3f444580b13 100644
--- a/mysql-test/t/ctype_ujis.test
+++ b/mysql-test/t/ctype_ujis.test
@@ -87,6 +87,7 @@ DROP TABLE t1;
#
# Bug #6345 Unexpected behaviour with partial indices
#
+set sql_mode="";
--disable_warnings
CREATE TABLE t1
(
@@ -96,6 +97,7 @@ CREATE TABLE t1
KEY b (b(10))
) ENGINE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
--enable_warnings
+set sql_mode=default;
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
@@ -1276,7 +1278,7 @@ SHOW CREATE TABLE t1;
UPDATE t1 SET a=unhex(code) ORDER BY code;
SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t1 WHERE a<>'';
+SELECT COUNT(*) FROM t1 WHERE a<>'?';
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=3;
#
@@ -1369,3 +1371,28 @@ SELECT _ujis 0x8EA0;
--echo #
--echo # End of 10.0 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character"
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ujis, KEY(a));
+# [x00-x7F] # ASCII/JIS-Roman
+# [x8E][xA1-xDF] # half-width katakana
+# [x8F][xA1-xFE][xA1-xFE] # JIS X 0212-1990
+# [xA1-xFE][xA1-xFE] # JIS X 0208:1997
+INSERT INTO t1 VALUES ('a'),(0x7F);
+INSERT INTO t1 VALUES (0x8EA1),(0x8EDF);
+INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE);
+INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE);
+SELECT HEX(a) FROM t1 ORDER BY a;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ujis COLLATE ujis_bin;
+SELECT HEX(a) FROM t1 ORDER BY a;DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_upgrade.test b/mysql-test/t/ctype_upgrade.test
index cc59d1e4401..62567c5afe4 100644
--- a/mysql-test/t/ctype_upgrade.test
+++ b/mysql-test/t/ctype_upgrade.test
@@ -191,6 +191,7 @@ SELECT GROUP_CONCAT(a ORDER BY BINARY a) FROM maria100004_xxx_croatian_ci GROUP
SHOW CREATE TABLE mysql050614_xxx_croatian_ci;
SELECT GROUP_CONCAT(a ORDER BY BINARY a) FROM mysql050614_xxx_croatian_ci GROUP BY a;
+remove_file $MYSQLD_DATADIR/mysql_upgrade_info;
DROP TABLE maria050313_ucs2_croatian_ci_def;
DROP TABLE maria050313_utf8_croatian_ci;
DROP TABLE maria050533_xxx_croatian_ci;
diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test
index cda85239512..4b95257cbde 100644
--- a/mysql-test/t/ctype_utf16.test
+++ b/mysql-test/t/ctype_utf16.test
@@ -869,3 +869,38 @@ DEALLOCATE PREPARE stmt;
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+--echo #
+CREATE TABLE t1 (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ a VARCHAR(10) CHARACTER SET utf16, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0x61);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16 COLLATE utf16_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING utf16) AS SIGNED)
+--echo #
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING utf16) AS SIGNED);
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf16_uca.test b/mysql-test/t/ctype_utf16_uca.test
index 63799054ae8..160d5b19d12 100644
--- a/mysql-test/t/ctype_utf16_uca.test
+++ b/mysql-test/t/ctype_utf16_uca.test
@@ -208,3 +208,16 @@ SET collation_connection=utf16_myanmar_ci;
--echo #
--echo # End of MariaDB-10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+SET NAMES utf8;
+SET collation_connection=utf16_thai_520_w2;
+--source include/ctype_uca_w2.inc
+--source include/ctype_thai.inc
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf16le.test b/mysql-test/t/ctype_utf16le.test
index a8326900847..42017f9a635 100644
--- a/mysql-test/t/ctype_utf16le.test
+++ b/mysql-test/t/ctype_utf16le.test
@@ -744,3 +744,37 @@ SET NAMES utf8, collation_connection=utf16le_bin;
--echo #
--echo # End of 5.6 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+--echo #
+CREATE TABLE t1 (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ a VARCHAR(10) CHARACTER SET utf16le, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0x61);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF);
+INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16le COLLATE utf16le_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
+--echo #
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED);
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test
index c747abb8b08..3bef1524e5b 100644
--- a/mysql-test/t/ctype_utf32.test
+++ b/mysql-test/t/ctype_utf32.test
@@ -983,3 +983,26 @@ DEALLOCATE PREPARE stmt;
--echo # End of 10.0 tests
--echo #
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character"
+--echo #
+# Make sure that all non-BMP characters are compared as equal
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32, KEY(a));
+INSERT INTO t1 VALUES (0x10000),(0x10001),(0x10002);
+SELECT COUNT(DISTINCT a) FROM t1;
+DROP TABLE t1;
+SELECT _utf32 0x10001=_utf32 0x10002;
+
+--echo #
+--echo # MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
+--echo #
+SET NAMES utf8;
+SELECT CAST(CONVERT('1IJ3' USING utf32) AS SIGNED);
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test
index 6052ea7b334..fb691221db8 100644
--- a/mysql-test/t/ctype_utf32_uca.test
+++ b/mysql-test/t/ctype_utf32_uca.test
@@ -229,3 +229,16 @@ SET collation_connection=utf32_myanmar_ci;
--echo #
--echo # End of MariaDB-10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+SET NAMES utf8;
+SET collation_connection=utf32_thai_520_w2;
+--source include/ctype_uca_w2.inc
+--source include/ctype_thai.inc
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 2524daffa9e..e013109d0a7 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1577,7 +1577,8 @@ SET NAMES utf8;
--echo #
--echo # Bug#57687 crash when reporting duplicate group_key error and utf8
---echo # Make sure to modify this when Bug#58081 is fixed.
+--echo # Bug#58081 Duplicate entry error when doing GROUP BY
+--echo # MDEV-9332 Bug after upgrade to 10.1.10
--echo #
SET NAMES utf8;
CREATE TABLE t1 (a INT);
@@ -1883,3 +1884,146 @@ DROP VIEW v1;
--echo #
--echo # End of 10.0 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database
+--echo #
+SET NAMES utf8;
+--error ER_INVALID_CHARACTER_STRING
+SELECT * FROM `testðŸ˜ðŸ˜test`;
+
+--echo #
+--echo #MDEV-8256 A part of a ROW comparison is erroneously optimized away
+--echo #
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
+INSERT INTO t1 VALUES ('1e1'),('1é1');
+SELECT * FROM t1 WHERE a=10;
+SELECT * FROM t1 WHERE a='1e1';
+SELECT * FROM t1 WHERE a=10 AND a='1e1';
+SELECT * FROM t1 WHERE (a,a)=(10,'1e1');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,a)=(10,'1e1');
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8688 Wrong result for SELECT..WHERE varchar_column IN (1,2,3) AND varchar_column=' 1';
+--echo #
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('1e1'),('1ë1');
+SELECT * FROM t1 WHERE a IN (1,2);
+SELECT * FROM t1 WHERE a IN (1,2) AND a='1ë1';
+SELECT * FROM t1 WHERE a IN (1,2,'x') AND a='1ë1';
+# Equality should not propagate '1ë1' to IN: incompatible comparison context
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2) AND a='1ë1';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,'x') AND a='1ë1';
+DROP TABLE IF EXISTS t1;
+
+
+--echo #
+--echo # MDEV-8816 Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_swedish_ci AND varbinary_column='A';
+--echo #
+CREATE TABLE t1 (c VARBINARY(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE c>=_utf8'a' COLLATE utf8_general_ci AND c='A';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE c>=_utf8'a' COLLATE utf8_general_ci AND c='A';
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '\'', "\"";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""", N'\'', N"\"";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+DELIMITER ;$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+DROP PROCEDURE p1;
+
+SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+DELIMITER ;$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+DROP PROCEDURE p1;
+SET @@SQL_MODE=default;
+
+
+# TODO: Uncomment the below test whe we fix:
+# MDEV-9623INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION does not handle binary literals well
+#
+#SET NAMES binary;
+#CREATE FUNCTION f1() RETURNS TEXT RETURN CONCAT('i','й');
+#SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+#WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1';
+#SELECT body_utf8 FROM mysql.proc WHERE name='f1';
+#DROP FUNCTION f1;
+#SET NAMES utf8;
+
+--echo #
+--echo # MDEV-10191 non convertible chars convert() resulted in Null instead "?" on Windows
+--echo #
+
+SET sql_mode='STRICT_TRANS_TABLES';
+SELECT CONVERT(_utf8 0xC499 USING latin1);
+SELECT CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1);
+
+SET sql_mode=default;
+SELECT CONVERT(_utf8 0xC499 USING latin1);
+SELECT CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1);
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf8mb4.test b/mysql-test/t/ctype_utf8mb4.test
index 10786183ad0..77ace195217 100644
--- a/mysql-test/t/ctype_utf8mb4.test
+++ b/mysql-test/t/ctype_utf8mb4.test
@@ -1877,6 +1877,43 @@ SELECT HEX(a) FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion
+--echo #
+
+--echo #
+--echo # This test sets session character set to 3-byte utf8,
+--echo # but then sends a 4-byte sequence (which is wrong for 3-byte utf8).
+--echo # It should be replaced to four question marks: '????' in both columns
+--echo # (i.e. four unknown bytes are replaced to four question marks),
+--echo # then the rest of the string should be stored, so we get 'a ???? b'.
+--echo #
+SET NAMES utf8;
+CREATE TABLE t1 (
+ a VARCHAR(32) CHARACTER SET utf8mb4,
+ b VARCHAR(32) CHARACTER SET utf8
+);
+INSERT INTO t1 SELECT 'a 😠b', 'a 😠b';
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # This test sets session character set to 4-byte utf8,
+--echo # then normally sends a 4-byte sequence.
+--echo # It should be stored AS IS into the utf8mb4 column (a),
+--echo # and should be replaced to a single question mark in the utf8 column (b)
+--echo # (i.e. one character that cannot be converted is replaced to one question mark).
+--echo #
+
+SET NAMES utf8mb4;
+CREATE TABLE t1 (
+ a VARCHAR(32) CHARACTER SET utf8mb4,
+ b VARCHAR(32) CHARACTER SET utf8
+);
+INSERT INTO t1 SELECT 'a 😠b', 'a 😠b';
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # MDEV-8949: COLUMN_CREATE unicode name breakage
--echo #
@@ -1894,8 +1931,33 @@ DROP TABLE t1;
SET NAMES default;
+--echo #
--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database
+--echo #
+SET NAMES utf8mb4;
+--error ER_INVALID_CHARACTER_STRING
+SELECT * FROM `testðŸ˜ðŸ˜test`;
+
+--echo #
+--echo # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+--echo #
+# Non-BMP characters should be replaced to '?' in ROUTINE_DEFINITION/body_utf8
+SET NAMES utf8mb4;
+CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8mb4
+RETURN CONCAT('😎','x😎','😎y','x😎y');
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1';
+SELECT body_utf8 FROM mysql.proc WHERE name='f1';
+DROP FUNCTION f1;
--echo #
---echo # End of tests
+--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/t/ctype_utf8mb4_uca.test b/mysql-test/t/ctype_utf8mb4_uca.test
index a5493e78c47..e56c6d7b884 100644
--- a/mysql-test/t/ctype_utf8mb4_uca.test
+++ b/mysql-test/t/ctype_utf8mb4_uca.test
@@ -70,3 +70,16 @@ SET NAMES utf8mb4 COLLATE utf8mb4_myanmar_ci;
--echo #
--echo # End of MariaDB-10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+SET NAMES utf8;
+SET collation_connection=utf8mb4_thai_520_w2;
+--source include/ctype_uca_w2.inc
+--source include/ctype_thai.inc
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test
index 40f8d07c55d..0a62a8ba0f8 100644
--- a/mysql-test/t/ddl_i18n_koi8r.test
+++ b/mysql-test/t/ddl_i18n_koi8r.test
@@ -24,6 +24,8 @@
# - restore object;
#
+set sql_mode="";
+
###########################################################################
#
# NOTE: this file contains text in UTF8 and KOI8-R encodings.
diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test
index 35109e62100..023047b952e 100644
--- a/mysql-test/t/ddl_i18n_utf8.test
+++ b/mysql-test/t/ddl_i18n_utf8.test
@@ -30,6 +30,8 @@
#
###########################################################################
+set sql_mode="";
+
# Test requires server to accept client connections (for mysqldump portions)
--source include/not_embedded.inc
--source include/have_utf8.inc
diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test
index 432df9d4452..cf09ba048b8 100644
--- a/mysql-test/t/default.test
+++ b/mysql-test/t/default.test
@@ -9,6 +9,7 @@ drop database if exists mysqltest;
# Bug 10838
# Insert causes warnings for no default values and corrupts tables
#
+set sql_mode="";
CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ',
b varchar(1) binary NOT NULL DEFAULT ' ',
c varchar(4) binary NOT NULL DEFAULT '0000',
@@ -39,6 +40,7 @@ CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ',
b1 tinyblob NULL)
ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin;
--enable_warnings
+set sql_mode=default;
INSERT into t1 (b) values ('1');
SHOW WARNINGS;
@@ -209,3 +211,18 @@ DROP TABLE t1;
--echo # End of 10.0 tests
--echo #
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+# Using DEFAULT(col) in WHERE condition
+CREATE TABLE t1 (a INT DEFAULT 100, b INT DEFAULT NULL);
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1 WHERE DEFAULT(a);
+SELECT * FROM t1 WHERE DEFAULT(b);
+DROP TABLE IF EXISTS t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 2886dff8f91..644cbfbe6ce 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -1,5 +1,12 @@
# delayed works differently in embedded server
--source include/not_embedded.inc
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+# Binary must be compiled with debug for crash to occur
+--source include/have_debug_sync.inc
+
#
# test of DELAYED insert and timestamps
# (Can't be tested with purify :( )
@@ -629,3 +636,37 @@ disconnect con1;
--echo # Connection 'default'.
connection default;
drop tables tm, t1, t2;
+
+--echo #
+--echo # MDEV-9621 INSERT DELAYED fails on insert for tables with many columns
+--echo #
+
+CREATE TABLE t1 (
+ a int,b int,c int,d int,e int,f int,g int,h int,i int,j int,k int,l int,m int,n int,o int,p int,q int,r int,s int,t int,u int,v int,x int,y int,z int
+) ENGINE=MyISAM;
+
+INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z)
+values (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);
+INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z)
+values (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);
+drop table t1;
+
+--echo #
+--echo # INSERT DELAYED hangs if table was crashed
+--echo #
+
+create table t1 (a int, b int) engine=myisam;
+insert into t1 values (1,1);
+
+# Will come back with t1 crashed.
+--source include/crash_mysqld.inc
+
+call mtr.add_suppression(" marked as crashed and should be repaired");
+call mtr.add_suppression("Checking table");
+
+--replace_result '\\' '/'
+insert delayed into t1 values (2,2);
+insert delayed into t1 values (3,3);
+flush tables t1;
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/delete_returning_grant.test b/mysql-test/t/delete_returning_grant.test
index f67a766b936..67613603a72 100644
--- a/mysql-test/t/delete_returning_grant.test
+++ b/mysql-test/t/delete_returning_grant.test
@@ -3,6 +3,9 @@
#
--source include/not_embedded.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
+
CREATE TABLE t1 (a int(11), b varchar(32));
INSERT INTO t1 VALUES (7,'ggggggg'),(1,'a'),(3,'ccc'),(4,'dddd'),(1,'A'),
(2,'BB'),(4,'DDDD'),(5,'EEEEE'),(7,'GGGGGGG'),(2,'bb');
@@ -76,3 +79,4 @@ DROP USER mysqltest_1@localhost;
DROP VIEW v1;
DROP TABLE t1;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/t/delimiter_case_mdev_10728.sql b/mysql-test/t/delimiter_case_mdev_10728.sql
new file mode 100644
index 00000000000..72a1dcd9a9e
--- /dev/null
+++ b/mysql-test/t/delimiter_case_mdev_10728.sql
@@ -0,0 +1,3 @@
+DeLiMiTeR A;
+SELECT 1 A;
+delimiter ;
diff --git a/mysql-test/t/delimiter_command_case_sensitivity.test b/mysql-test/t/delimiter_command_case_sensitivity.test
new file mode 100644
index 00000000000..11d1cf75aa0
--- /dev/null
+++ b/mysql-test/t/delimiter_command_case_sensitivity.test
@@ -0,0 +1,4 @@
+source include/not_embedded.inc;
+
+# MDEV-10728
+--exec $MYSQL --default-character-set=binary < "t/delimiter_case_mdev_10728.sql"
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 00a88032f72..b0415cf3b04 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -937,3 +937,37 @@ drop view v1;
drop table t1;
--echo # end of 5.5
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8747 Wrong result for SELECT..WHERE derived_table_column='a' AND derived_table_column<>_latin1'A' COLLATE latin1_bin
+--echo #
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a' AND a <> _latin1'A' COLLATE latin1_bin;
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='a' AND a <> _latin1'A' COLLATE latin1_bin;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5';
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a=1;
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5' AND a=1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8749 Wrong result for SELECT..WHERE derived_table_enum_column='number' AND derived_table_enum_column OP number2
+--echo #
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5';
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a=1;
+SELECT * FROM (SELECT * FROM t1) AS table1 WHERE a='5' AND a=1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test
index 07fbe4980a5..1c0749346ca 100644
--- a/mysql-test/t/derived_view.test
+++ b/mysql-test/t/derived_view.test
@@ -1600,7 +1600,7 @@ CREATE TABLE IF NOT EXISTS `galleries` (
`year` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `pictures` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -1614,7 +1614,7 @@ CREATE TABLE IF NOT EXISTS `pictures` (
`type` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `gallery_id` (`gallery_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
+) DEFAULT CHARSET=utf8 ;
ALTER TABLE `pictures`
ADD CONSTRAINT `pictures_ibfk_1` FOREIGN KEY (`gallery_id`) REFERENCES `galleries` (`id`);
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 952609be7e0..7cf3d6810bb 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -561,7 +561,7 @@ DROP TABLE t1;
#
# Bug #34928: Confusion by having Primary Key and Index
#
-CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT,
+CREATE TABLE t1(a INT, b INT, c INT, d INT default 0, e INT default 0,
PRIMARY KEY(a,b,c,d,e),
KEY(a,b,d,c)
);
@@ -727,10 +727,12 @@ SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
set join_buffer_size=1024;
+--sorted_result
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
set join_buffer_size=1024*16;
+--sorted_result
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
diff --git a/mysql-test/t/drop_bad_db_type.test b/mysql-test/t/drop_bad_db_type.test
index 69e1a889b18..00b79dabddf 100644
--- a/mysql-test/t/drop_bad_db_type.test
+++ b/mysql-test/t/drop_bad_db_type.test
@@ -15,6 +15,12 @@ insert t1 values (1),(2),(3);
flush tables;
uninstall soname 'ha_archive';
+--vertical_results
+select table_schema, table_name from information_schema.tables where table_name like 't1';
+select table_schema, table_name, engine, version from information_schema.tables where table_name like 't1';
+select table_schema, table_name, engine, row_format from information_schema.tables where table_name like 't1';
+--horizontal_results
+
install soname 'ha_archive';
--list_files $mysqld_datadir/test
drop table t1;
diff --git a/mysql-test/t/enforce_storage_engine.test b/mysql-test/t/enforce_storage_engine.test
new file mode 100644
index 00000000000..6b422477fe6
--- /dev/null
+++ b/mysql-test/t/enforce_storage_engine.test
@@ -0,0 +1,111 @@
+-- source include/not_embedded.inc
+
+set local sql_mode="";
+set global sql_mode="";
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+SET SESSION enforce_storage_engine=MyISAM;
+select @@session.enforce_storage_engine;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 values (1,'abba');
+
+--error 1286
+CREATE TABLE t2 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+
+SET SESSION sql_mode='';
+
+SET SESSION enforce_storage_engine=MyISAM;
+select @@session.enforce_storage_engine;
+select * from t1;
+drop table t1;
+
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--error 1286
+SET SESSION enforce_storage_engine=FooBar;
+
+select @@session.enforce_storage_engine;
+
+--source include/add_anonymous_users.inc
+
+connect (con1,localhost,user_1,,);
+connection con1;
+--error 1227
+SET SESSION enforce_storage_engine=MyISAM;
+disconnect con1;
+
+connection default;
+
+--source include/delete_anonymous_users.inc
+
+SET SESSION enforce_storage_engine=NULL;
+
+SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+SET GLOBAL enforce_storage_engine=Memory;
+SET SESSION sql_mode='';
+
+connect (con1,localhost,root,,);
+connection con1;
+select @@session.enforce_storage_engine;
+select @@global.enforce_storage_engine;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+connection default;
+disconnect con1;
+
+set global sql_mode=default;
+SET SESSION enforce_storage_engine=NULL;
+SET GLOBAL enforce_storage_engine=NULL;
+
+#
+# MDEV-8577: With enforce-storage-engine mysql_upgrade corrupts the schema:
+# ALTER TABLE should either bypass enforce-storage-engine, or mysql_upgrade
+# should refuse to run
+#
+CREATE TABLE t3 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t3 values (NULL, 'test');
+SET SESSION enforce_storage_engine=Memory;
+ALTER TABLE t3 ENGINE=MyISAM;
+SHOW CREATE TABLE t3;
+DROP TABLE t3;
+SET SESSION enforce_storage_engine=NULL;
+CREATE TABLE t3 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t3 values (NULL, 'test');
+SET SESSION enforce_storage_engine=Memory;
+ALTER TABLE t3 ADD COLUMN c3 INT;
+SHOW CREATE TABLE t3;
+DROP TABLE t3;
+
+SET SESSION enforce_storage_engine=NULL;
+SET GLOBAL enforce_storage_engine=NULL; \ No newline at end of file
diff --git a/mysql-test/t/enforce_storage_engine_opt.opt b/mysql-test/t/enforce_storage_engine_opt.opt
new file mode 100644
index 00000000000..9f09b57e395
--- /dev/null
+++ b/mysql-test/t/enforce_storage_engine_opt.opt
@@ -0,0 +1 @@
+--enforce-storage-engine=myisam
diff --git a/mysql-test/t/enforce_storage_engine_opt.test b/mysql-test/t/enforce_storage_engine_opt.test
new file mode 100644
index 00000000000..7ca7f94d3dc
--- /dev/null
+++ b/mysql-test/t/enforce_storage_engine_opt.test
@@ -0,0 +1,7 @@
+SET SQL_MODE="";
+create table t1 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory;
+show create table t1;
+set session sql_mode='no_engine_substitution';
+--error 1286
+create table t2 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory;
+drop table t1;
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index 6ce6e439919..55461002fd4 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -1,6 +1,7 @@
#
# Test some error conditions
#
+--source include/have_sequence.inc
--disable_warnings
drop table if exists t1;
@@ -198,3 +199,17 @@ CREATE TABLE t1 (a CHAR(3), b BLOB);
UPDATE t1 SET a = 'new'
WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL;
drop table t1;
+
+#
+# errors caused by max_session_mem_used
+#
+--disable_result_log
+set max_session_mem_used = 50000;
+--error 0,ER_OPTION_PREVENTS_STATEMENT
+select * from seq_1_to_1000;
+set max_session_mem_used = 8192;
+--error 0,ER_OPTION_PREVENTS_STATEMENT
+select * from seq_1_to_1000;
+--enable_result_log
+# We may not be able to execute any more queries with this connection
+# because of too little memory#
diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test
index 250b0d004dc..9768127f458 100644
--- a/mysql-test/t/events_1.test
+++ b/mysql-test/t/events_1.test
@@ -4,6 +4,8 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
+set sql_mode="";
+
call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
--disable_warnings
diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test
index bc906e37457..12ce9210b0a 100644
--- a/mysql-test/t/events_2.test
+++ b/mysql-test/t/events_2.test
@@ -3,6 +3,8 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
+set sql_mode="";
+
--disable_warnings
drop database if exists events_test;
--enable_warnings
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index c33497f643d..cace397e92a 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -8,6 +8,7 @@
# Bug#41925 Warning 1366 Incorrect string value: ... for column processlist.info
#
# Please set $
+SET SQL_MODE="";
let $fixed_bug41925= 0;
#
# Dear maintainer of this test. Please do NOT remove the next big comment.
@@ -508,13 +509,13 @@ drop database mysqltest_db1;
#
# START - BUG#16394: Events: Crash if schedule contains SELECT
#
---error ER_NOT_SUPPORTED_YET
+--error ER_SUBQUERIES_NOT_SUPPORTED
create event e_53 on schedule at (select s1 from ttx) do drop table t;
---error ER_NOT_SUPPORTED_YET
+--error ER_SUBQUERIES_NOT_SUPPORTED
create event e_53 on schedule every (select s1 from ttx) second do drop table t;
---error ER_NOT_SUPPORTED_YET
+--error ER_SUBQUERIES_NOT_SUPPORTED
create event e_53 on schedule every 5 second starts (select s1 from ttx) do drop table t;
---error ER_NOT_SUPPORTED_YET
+--error ER_SUBQUERIES_NOT_SUPPORTED
create event e_53 on schedule every 5 second ends (select s1 from ttx) do drop table t;
#
# END - BUG#16394: Events: Crash if schedule contains SELECT
@@ -570,7 +571,7 @@ begin
select release_lock('ee_22830');
end|
---error ER_NOT_SUPPORTED_YET
+--error ER_SUBQUERIES_NOT_SUPPORTED
create event e22830 on schedule every f22830() second do
begin
call p22830_wait();
@@ -1319,5 +1320,4 @@ DROP DATABASE events_test;
SET GLOBAL event_scheduler= 'ON';
--source include/running_event_scheduler.inc
SET @@global.concurrent_insert= @concurrent_insert;
-
# THIS MUST BE THE LAST LINE in this file.
diff --git a/mysql-test/t/events_trans.test b/mysql-test/t/events_trans.test
index 6d829379fea..eea24f19577 100644
--- a/mysql-test/t/events_trans.test
+++ b/mysql-test/t/events_trans.test
@@ -4,6 +4,8 @@
-- source include/have_innodb.inc
-- source include/not_embedded.inc
+set sql_mode="";
+
--disable_warnings
drop database if exists events_test;
drop database if exists mysqltest_no_such_database;
diff --git a/mysql-test/t/events_trans_notembedded.test b/mysql-test/t/events_trans_notembedded.test
index 0353d183386..3cf823bf713 100644
--- a/mysql-test/t/events_trans_notembedded.test
+++ b/mysql-test/t/events_trans_notembedded.test
@@ -13,6 +13,7 @@ use events_test;
#
# Privilege checks
#
+create user mysqltest_user1@localhost;
grant create, insert, select, delete on mysqltest_db2.*
to mysqltest_user1@localhost;
create database mysqltest_db2;
diff --git a/mysql-test/t/explain_json.test b/mysql-test/t/explain_json.test
new file mode 100644
index 00000000000..2ca91c1f200
--- /dev/null
+++ b/mysql-test/t/explain_json.test
@@ -0,0 +1,398 @@
+#
+# EXPLAIN FORMAT=JSON tests. These are tests developed for MariaDB.
+#
+--disable_warnings
+drop table if exists t0,t1,t2;
+--enable_warnings
+
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+explain format=json select * from t0;
+
+explain format=json select * from t0 where 1>2;
+
+explain format=json select * from t0 where a<3;
+
+--echo # Try a basic join
+create table t1 (a int, b int, filler char(32), key(a));
+insert into t1
+select
+ a.a + b.a* 10 + c.a * 100,
+ a.a + b.a* 10 + c.a * 100,
+ 'filler'
+from t0 a, t0 b, t0 c;
+
+explain format=json select * from t0,t1 where t1.a=t0.a;
+
+--echo # Try range and index_merge
+create table t2 (a1 int, a2 int, b1 int, b2 int, key(a1,a2), key(b1,b2));
+insert into t2 select a,a,a,a from t1;
+
+explain format=json select * from t2 where a1<5;
+
+explain format=json select * from t2 where a1=1 or b1=2;
+explain format=json select * from t2 where a1=1 or (b1=2 and b2=3);
+
+explain format=json select * from t2 where (a1=1 and a2=1) or
+ (b1=2 and b2=1);
+
+--echo # Try ref access on two key components
+
+explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
+
+drop table t1,t2;
+
+--echo #
+--echo # Try a UNION
+--echo #
+explain format=json select * from t0 A union select * from t0 B;
+explain format=json select * from t0 A union all select * from t0 B;
+
+--echo #
+--echo # Subqueries
+--echo #
+create table t1 (a int, b int);
+insert into t1 select a,a from t0;
+explain format=json select a, a > (select max(b) from t1 where t1.b=t0.a) from t0;
+
+explain format=json
+select * from t0 where
+ a > (select max(b) from t1 where t1.b=t0.a) or a < 3 ;
+
+drop table t1;
+
+--echo #
+--echo # Join buffering
+--echo #
+create table t1 (a int, b int);
+insert into t1 select tbl1.a+10*tbl2.a, tbl1.a+10*tbl2.a from t0 tbl1, t0 tbl2;
+
+explain format=json
+select * from t1 tbl1, t1 tbl2 where tbl1.a=tbl2.a and tbl1.b < 3 and tbl2.b < 5;
+
+drop table t1;
+
+--echo #
+--echo # Single-table UPDATE/DELETE, INSERT
+--echo #
+explain format=json delete from t0;
+explain format=json delete from t0 where 1 > 2;
+
+explain format=json delete from t0 where a < 3;
+
+explain format=json update t0 set a=3 where a in (2,3,4);
+
+explain format=json insert into t0 values (1);
+
+create table t1 like t0;
+explain format=json insert into t1 values ((select max(a) from t0));
+
+drop table t1;
+
+--echo #
+--echo # A derived table
+--echo #
+create table t1 (a int, b int);
+insert into t1 select a,a from t0;
+explain format=json
+select * from (select a, count(*) as cnt from t1 group by a) as tbl
+where cnt>0;
+
+explain format=json
+select * from (select a, count(*) as cnt from t1 group by a) as tbl1, t1 as
+tbl2 where cnt=tbl2.a;
+
+--echo #
+--echo # Non-merged semi-join (aka JTBM)
+--echo #
+explain format=json
+select * from t1 where a in (select max(a) from t1 group by b);
+
+--echo #
+--echo # Semi-join Materialization
+--echo #
+create table t2 like t1;
+insert into t2 select * from t1;
+explain format=json
+select * from t1,t2 where t1.a in ( select a from t0);
+
+--echo #
+--echo # First-Match
+--echo #
+explain
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+explain format=json
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+
+--echo #
+--echo # Duplicate Weedout
+--echo #
+set @tmp= @@optimizer_switch;
+set optimizer_switch='firstmatch=off';
+explain
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+explain format=json
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+set optimizer_switch=@tmp;
+
+drop table t1,t2;
+
+--echo #
+--echo # MRR for range access (no BKA, just MRR)
+--echo #
+create table t1 (a int, b int, key(a));
+insert into t1 select tbl1.a+10*tbl2.a, 12345 from t0 tbl1, t0 tbl2;
+set @tmp= @@optimizer_switch;
+set optimizer_switch='mrr=on,mrr_sort_keys=on';
+
+explain format=json select * from t1 where a < 3;
+
+--echo # 'Range checked for each record'
+set optimizer_switch=@tmp;
+explain format=json
+select * from t1 tbl1, t1 tbl2 where tbl2.a < tbl1.b;
+
+drop table t1;
+drop table t0;
+
+--echo #
+--echo # MDEV-7265: "Full scan on NULL key", the join case
+--echo #
+
+CREATE TABLE t1 (a INT, KEY(a));
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+
+EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM t1, t2 WHERE b <> outer_t1.a );
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Join's constant expression
+--echo #
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1(a int, b int);
+insert into t1 select tbl1.a+10*tbl2.a, 1234 from t0 tbl1, t0 tbl2;
+
+explain format=json
+select * from t0
+where
+ 20000 > all (select max(tbl1.a + tbl2.a)
+ from t1 tbl1, t1 tbl2 where tbl1.b=tbl2.b);
+
+drop table t1;
+drop table t0;
+
+--echo #
+--echo # MDEV-7264: Assertion `0' failed in subselect_engine::get_identifier() on EXPLAIN JSON
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a <> ALL ( SELECT b FROM t2 );
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-7927: Server crashes in in Time_and_counter_tracker::incr_loops
+--echo #
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN SELECT * FROM t1 WHERE 3 IN ( SELECT 4 UNION SELECT 5 );
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-7860: EXPLAIN FORMAT=JSON crashes for loose scan query
+--echo #
+
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int, c int, d int, key(a,b,c));
+insert into t1 select A.a, B.a, C.a, D.a from t2 A, t2 B, t2 C, t2 D;
+explain select count(distinct b) from t1 group by a;
+explain format=json select count(distinct b) from t1 group by a;
+--source include/analyze-format.inc
+analyze format=json select count(distinct b) from t1 group by a;
+drop table t1,t2;
+
+--echo #
+--echo # Try both variants of LooseScan (data/queries borrowed from group_min_max.test)
+--echo #
+
+create table t1 (
+ a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(248) default ' '
+);
+
+insert into t1 (a1, a2, b, c, d) values
+('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
+('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
+('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
+('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
+('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
+('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
+('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
+('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
+('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
+('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
+('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
+('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
+('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
+('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
+('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
+('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'),
+('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
+('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
+('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
+('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
+('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
+('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
+('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
+('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
+('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
+('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
+('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
+('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
+('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
+('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
+('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
+('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4');
+
+create index idx_t1_0 on t1 (a1);
+create index idx_t1_1 on t1 (a1,a2,b,c);
+create index idx_t1_2 on t1 (a1,a2,b);
+analyze table t1;
+
+explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
+explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+
+explain format=json select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
+explain format=json select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+
+drop table t1;
+
+--echo #
+--echo # MDEV-8786 Wrong result for SELECT FORMAT=JSON * FROM t1 WHERE a=_latin1 0xDF
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('b');
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a=_latin1 0xDF;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8785 Wrong results for EXPLAIN EXTENDED...WHERE NULLIF(latin1_col, _utf8'a' COLLATE utf8_bin) IS NOT NULL
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('A');
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE NULLIF(a,_utf8'a' COLLATE utf8_bin);
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING
+--echo #
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+create table t2 (
+ a int,
+ b int,
+ key (a)
+);
+insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
+--echo # normal HAVING
+explain format=json select a, max(b) as TOP from t2 group by a having TOP > a;
+--echo # HAVING is always TRUE (not printed)
+explain format=json select a, max(b) as TOP from t2 group by a having 1<>2;
+--echo # HAVING is always FALSE (intercepted by message)
+explain format=json select a, max(b) as TOP from t2 group by a having 1=2;
+--echo # HAVING is absent
+explain format=json select a, max(b) as TOP from t2 group by a;
+drop table t0, t1, t2;
+
+--echo #
+--echo # MDEV-8829: Assertion `0' failed in Explain_table_access::tag_to_json
+--echo #
+
+--echo # Check ET_CONST_ROW_NOT_FOUND
+create table t1 (i int) engine=myisam;
+explain
+select * from t1;
+explain format=json
+select * from t1;
+analyze format=json
+select * from t1;
+drop table t1;
+
+--echo # Check ET_IMPOSSIBLE_ON_CONDITION
+create table t1 (a int);
+create table t2 (pk int primary key);
+
+insert into t1 values (1),(2);
+insert into t2 values (1),(2);
+
+explain
+select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
+explain format=json
+select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
+--source include/analyze-format.inc
+analyze format=json
+select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
+
+--echo # Check ET_NOT_EXISTS:
+explain
+select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
+explain format=json
+select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
+--source include/analyze-format.inc
+analyze format=json
+select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
+
+--echo # Check ET_DISTINCT
+explain
+select distinct t1.a from t1 join t2 on t2.pk=t1.a;
+explain format=json
+select distinct t1.a from t1 join t2 on t2.pk=t1.a;
+--source include/analyze-format.inc
+analyze format=json
+select distinct t1.a from t1 join t2 on t2.pk=t1.a;
+drop table t1,t2;
+
+--echo # Check ET_USING_INDEX_CONDITION_BKA
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t2(a int);
+insert into t2 select A.a + B.a* 10 + C.a * 100 from t1 A, t1 B, t1 C;
+
+create table t3(a int, b int);
+insert into t3 select a,a from t1;
+
+create table t4(a int, b int, c int, filler char(100), key (a,b));
+insert into t4 select a,a,a, 'filler-data' from t2;
+
+set @tmp_optimizer_switch=@@optimizer_switch;
+set @tmp_join_cache_level=@@join_cache_level;
+set optimizer_switch='mrr=on';
+set join_cache_level=6;
+explain
+select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
+explain format=json
+select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
+--source include/analyze-format.inc
+analyze format=json
+select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
+set optimizer_switch=@tmp_optimizer_switch;
+set join_cache_level=@tmp_join_cache_level;
+
+drop table t1,t2,t3,t4;
+
+
+
diff --git a/mysql-test/t/explain_json_format_partitions.test b/mysql-test/t/explain_json_format_partitions.test
new file mode 100644
index 00000000000..4c7d3f165d1
--- /dev/null
+++ b/mysql-test/t/explain_json_format_partitions.test
@@ -0,0 +1,17 @@
+
+--source include/have_partition.inc
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+ a int not null
+) partition by key(a);
+insert into t1 select a from t2;
+explain partitions select * from t1 where a in (2,3,4);
+explain format=json select * from t1 where a in (2,3,4);
+--source include/analyze-format.inc
+analyze format=json select * from t1 where a in (2,3,4);
+--source include/analyze-format.inc
+analyze format=json update t1 set a=a+10 where a in (2,3,4);
+--source include/analyze-format.inc
+analyze format=json delete from t1 where a in (20,30,40);
+drop table t1,t2;
diff --git a/mysql-test/t/explain_json_innodb.test b/mysql-test/t/explain_json_innodb.test
new file mode 100644
index 00000000000..f70df5d5349
--- /dev/null
+++ b/mysql-test/t/explain_json_innodb.test
@@ -0,0 +1,28 @@
+#
+# MariaDB's EXPLAIN FORMAT=JSON tests that require InnoDB.
+#
+--source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t0,t1,t2;
+--enable_warnings
+
+--echo #
+--echo # MDEV-7266: Assertion `!element_started' failed in Json_writer& Json_writer::add_member
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (column_name_1 INT, column_name_2 VARCHAR(52)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (3,'United States');
+
+CREATE TABLE t3 (b INT, c VARCHAR(3), PRIMARY KEY (c,b)) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (4,'USA'),(5,'CAN');
+
+EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE 0 < ALL (
+ SELECT tbl_alias1.column_name_1 FROM t2 AS tbl_alias1, t3 AS tbl_alias2
+ WHERE tbl_alias2.b = tbl_alias1.column_name_1 AND tbl_alias2.c = tbl_alias1.column_name_2
+);
+
+drop table t1,t2,t3;
diff --git a/mysql-test/t/fast_prefix_index_fetch_innodb.test b/mysql-test/t/fast_prefix_index_fetch_innodb.test
new file mode 100644
index 00000000000..e563e65ec2a
--- /dev/null
+++ b/mysql-test/t/fast_prefix_index_fetch_innodb.test
@@ -0,0 +1,150 @@
+-- source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists prefixinno;
+--enable_warnings
+
+set global innodb_prefix_index_cluster_optimization = ON;
+show variables like 'innodb_prefix_index_cluster_optimization';
+
+--echo # Create a table with a large varchar field that we index the prefix
+--echo # of and ensure we only trigger cluster lookups when we expect it.
+create table prefixinno (
+ id int not null,
+ fake_id int not null,
+ bigfield varchar(4096),
+ primary key(id),
+ index bigfield_idx (bigfield(32)),
+ index fake_id_bigfield_prefix (fake_id, bigfield(32))
+) engine=innodb;
+
+insert into prefixinno values (1, 1001, repeat('a', 1)),
+ (8, 1008, repeat('b', 8)),
+ (24, 1024, repeat('c', 24)),
+ (31, 1031, repeat('d', 31)),
+ (32, 1032, repeat('x', 32)),
+ (33, 1033, repeat('y', 33)),
+ (128, 1128, repeat('z', 128));
+
+select * from prefixinno;
+
+let $show_count_statement = show status like 'innodb_secondary_index_triggered_cluster_reads';
+let $show_opt_statement = show status like 'innodb_secondary_index_triggered_cluster_reads_avoided';
+
+--disable_query_log
+
+--echo # Baseline sanity check: 0, 0.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select "no-op query";
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_avoided_matched;
+
+--echo # Eligible for optimization.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where bigfield = repeat('d', 31);
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_avoided_matched;
+
+--echo # Eligible for optimization, access via fake_id only.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where fake_id = 1031;
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_avoided_matched;
+
+--echo # Not eligible for optimization, access via fake_id of big row.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where fake_id = 1033;
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_avoided_matched;
+
+--echo # Not eligible for optimization.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where bigfield = repeat('x', 32);
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_avoided_matched;
+
+--echo # Not eligible for optimization.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where bigfield = repeat('y', 33);
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_avoided_matched;
+
+--echo # Eligible, should not increment lookup counter.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where bigfield = repeat('b', 8);
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_avoided_matched;
+
+--echo # Eligible, should not increment lookup counter.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where bigfield = repeat('c', 24);
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_avoided_matched;
+
+--echo # Should increment lookup counter.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+select id, bigfield from prefixinno where bigfield = repeat('z', 128);
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_avoided_matched;
+
+--echo # Disable optimization, confirm we still increment counter.
+--let $base_count = query_get_value($show_count_statement, Value, 1)
+--let $base_opt = query_get_value($show_opt_statement, Value, 1)
+set global innodb_prefix_index_cluster_optimization = OFF;
+select id, bigfield from prefixinno where fake_id = 1033;
+--let $count = query_get_value($show_count_statement, Value, 1)
+eval select $count - $base_count into @cluster_lookups;
+select @cluster_lookups = 1 as cluster_lookups_matched;
+--let $opt = query_get_value($show_opt_statement, Value, 1)
+eval select $opt - $base_opt into @cluster_lookups;
+select @cluster_lookups = 0 as cluster_lookups_avoided_matched;
+
+
+--echo # make test suite happy by cleaning up our mess
+drop table prefixinno;
+set global innodb_prefix_index_cluster_optimization = OFF;
diff --git a/mysql-test/t/features.test b/mysql-test/t/features.test
index f2ac5a5bba6..225ab40b361 100644
--- a/mysql-test/t/features.test
+++ b/mysql-test/t/features.test
@@ -6,6 +6,8 @@
drop table if exists t1;
--enable_warnings
+set sql_mode="";
+
flush status;
show status like "feature%";
diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test
index 186394df4e3..4734a0294f0 100644
--- a/mysql-test/t/file_contents.test
+++ b/mysql-test/t/file_contents.test
@@ -17,21 +17,21 @@ if ($dir_bin eq '/usr/') {
$dir_docs =~ s|/lib|/share/doc|;
if(-d "$dir_docs/packages") {
# SuSE: "packages/" in the documentation path
- $dir_docs = glob "$dir_docs/packages/*-server*";
+ $dir_docs = glob "$dir_docs/packages/MariaDB-server*";
} else {
# RedHat: version number in directory name
- $dir_docs = glob "$dir_docs/MySQL-server*";
+ $dir_docs = glob "$dir_docs/MariaDB-server*";
}
} elsif ($dir_bin eq '/usr') {
# RPM build during development
$dir_docs = "$dir_bin/share/doc";
if(-d "$dir_docs/packages") {
# SuSE: "packages/" in the documentation path
- $dir_docs = glob "$dir_docs/packages/*-server*";
+ $dir_docs = glob "$dir_docs/packages/MariaDB-server*";
} else {
# RedHat/Debian: version number in directory name
$dir_docs = glob "$dir_docs/mariadb-server-*";
- $dir_docs = glob "$dir_docs/MySQL-server*" unless -d $dir_docs;
+ $dir_docs = glob "$dir_docs/MariaDB-server*" unless -d $dir_docs;
}
# Slackware
$dir_docs = glob "$dir_bin/doc/mariadb-[0-9]*" unless -d $dir_docs;
@@ -44,11 +44,11 @@ if ($dir_bin eq '/usr/') {
$dir_docs = "$dir_docs/Docs"; # development tree
}
}
-$found_version = "No line 'MySQL source #.#.#' in $dir_docs/INFO_SRC";
+$found_version = "No line 'MariaDB source #.#.#' in $dir_docs/INFO_SRC";
$found_revision = "No line 'revision-id: .....' in $dir_docs/INFO_SRC";
open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
while(defined ($line = <I_SRC>)) {
- if ($line =~ m|^MySQL source \d+\.\d\.\d+|) {$found_version = "Found MySQL version number";}
+ if ($line =~ m|^MariaDB source \d+\.\d\.\d+|) {$found_version = "Found MariaDB version number";}
if ($line =~ m|^commit: \w{40}$|) {$found_revision = "Found GIT revision id";}
}
close I_SRC;
diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test
index f68c8b518c8..293d3915a05 100644
--- a/mysql-test/t/fix_priv_tables.test
+++ b/mysql-test/t/fix_priv_tables.test
@@ -22,6 +22,8 @@ if (!$MYSQL_FIX_PRIVILEGE_TABLES)
drop table if exists t1,t1aa,t2aa;
--enable_warnings
+set sql_mode="";
+
#
# Bug #20589 Missing some table level privileges after upgrade
#
diff --git a/mysql-test/t/flush-innodb-notembedded.test b/mysql-test/t/flush-innodb-notembedded.test
index d08a0647ff5..15bfeb53475 100644
--- a/mysql-test/t/flush-innodb-notembedded.test
+++ b/mysql-test/t/flush-innodb-notembedded.test
@@ -1,6 +1,8 @@
--source include/have_innodb.inc
--source include/not_embedded.inc
+set sql_mode="";
+
--echo # Test 7: Check privileges required.
--echo #
diff --git a/mysql-test/t/flush2.test b/mysql-test/t/flush2.test
index 7582ab8426b..496b57ccea4 100644
--- a/mysql-test/t/flush2.test
+++ b/mysql-test/t/flush2.test
@@ -1,9 +1,16 @@
#
# Bug#17733 Flushing logs causes daily server crash
#
+
+--source include/not_embedded.inc
+
flush logs;
set global expire_logs_days = 3;
show variables like 'log_bin%';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show variables like 'relay_log%';
flush logs;
show variables like 'log_bin%';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show variables like 'relay_log%';
set global expire_logs_days = 0;
diff --git a/mysql-test/t/flush_read_lock.test b/mysql-test/t/flush_read_lock.test
index e8ec07392b5..7ba80ea38ac 100644
--- a/mysql-test/t/flush_read_lock.test
+++ b/mysql-test/t/flush_read_lock.test
@@ -13,6 +13,8 @@
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
+set global sql_mode="";
+set local sql_mode="";
--echo # FTWRL takes two global metadata locks -- a global shared
--echo # metadata lock and the commit blocker lock.
--echo # The first lock prevents DDL from taking place.
@@ -2161,6 +2163,7 @@ disconnect con1;
disconnect con2;
disconnect con3;
+set global sql_mode=default;
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test
index 0f800e5c077..9fddf3b2fec 100644
--- a/mysql-test/t/fulltext_order_by.test
+++ b/mysql-test/t/fulltext_order_by.test
@@ -80,7 +80,7 @@ CREATE TABLE t3 (
FULLTEXT KEY betreff (betreff)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=996 ;
---error ER_CANT_USE_OPTION_HERE
+--error ER_TABLENAME_NOT_ALLOWED_HERE
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -100,7 +100,7 @@ group by
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
---error ER_CANT_USE_OPTION_HERE
+--error ER_TABLENAME_NOT_ALLOWED_HERE
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
@@ -117,7 +117,6 @@ where
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
---error ER_CANT_USE_OPTION_HERE
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test
index fc3d2697426..6305df3952d 100644
--- a/mysql-test/t/func_compress.test
+++ b/mysql-test/t/func_compress.test
@@ -5,6 +5,10 @@
# Note that this test gives error in the gzip library when running under
# valgrind, but these warnings can be ignored
+set global max_allowed_packet=1048576;
+connect (conn1,localhost,root,,);
+connection conn1;
+
select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ';
select length(@test_compress_string);
@@ -142,6 +146,28 @@ DROP TABLE t1;
#
SELECT UNCOMPRESS(CAST(0 AS BINARY(5)));
+disconnect conn1;
+connection default;
+set global max_allowed_packet=default;
--echo #
--echo # End of 5.5 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
+--echo #
+
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',compress('test')), ('TEST', compress('TEST'));
+SELECT f1,HEX(f2) FROM t1 ignore index(k1) WHERE f1='test' AND (f2= compress("test") OR f2= compress("TEST"));
+SELECT f1,HEX(f2) FROM t1 WHERE f1='test' AND (f2= compress("test") OR f2= compress("TEST"));
+SELECT f1,HEX(f2) FROM t1 WHERE f1='test' AND (f2= compress("TEST") OR f2= compress("test"));
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test
index 785cc63d3f1..effa3c903a7 100644
--- a/mysql-test/t/func_crypt.test
+++ b/mysql-test/t/func_crypt.test
@@ -70,8 +70,6 @@ SELECT OLD_PASSWORD(c1), PASSWORD(c1) FROM t1;
DROP TABLE t1;
--echo End of 5.0 tests
-
-
--echo #
--echo # Start of 10.0 tests
--echo #
@@ -94,3 +92,29 @@ SET optimizer_switch=@save_optimizer_switch;
--echo #
--echo # End of 10.0 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--let func=password
+--source include/func_str_ascii_checksum.inc
+--let func=old_password
+--source include/func_str_ascii_checksum.inc
+
+--echo #
+--echo # MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
+--echo #
+
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',encrypt('test','key')), ('TEST', encrypt('TEST','key'));
+SELECT f1 FROM t1 ignore index(k1) WHERE f1='test' AND (f2= encrypt('test','key') OR f2= encrypt('TEST','key'));
+SELECT f1 FROM t1 WHERE f1='test' AND (f2= encrypt('test','key') OR f2= encrypt('TEST','key'));
+SELECT f1 FROM t1 WHERE f1='test' AND (f2= encrypt('TEST','key') OR f2= encrypt('test','key'));
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_digest.test b/mysql-test/t/func_digest.test
index 81f19c7e091..39edb64fef2 100644
--- a/mysql-test/t/func_digest.test
+++ b/mysql-test/t/func_digest.test
@@ -494,3 +494,29 @@ SET NAMES latin1;
SELECT sha2('1',224);
--disable_metadata
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BAS E64('TEST'))
+--echo #
+
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('test',SHA2('test',224)), ('TEST', SHA2('TEST',224));
+SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= SHA2("test",224) OR f2= SHA2("TEST",224));
+SELECT * FROM t1 WHERE f1='test' AND (f2= SHA2("test",224) OR f2= SHA2("TEST",224));
+SELECT * FROM t1 WHERE f1='test' AND (f2= SHA2("TEST",224) OR f2= SHA2("test",224));
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
+--echo #
+
+PREPARE stmt FROM "SELECT SHA2(CONVERT('foo' USING latin1), 224)";
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_encrypt.test b/mysql-test/t/func_encrypt.test
index e24cb80f995..ed3e0a7b2d1 100644
--- a/mysql-test/t/func_encrypt.test
+++ b/mysql-test/t/func_encrypt.test
@@ -103,3 +103,21 @@ insert into t1 values (-15818,'requirement\'s');
select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
--enable_result_log
drop table t1;
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+--echo #
+CREATE TABLE t1 (a INT(6) ZEROFILL);
+INSERT INTO t1 VALUES (1),(2);
+# This should not propagate a=1 into DES_ENCRYPT
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND DES_ENCRYPT('test',a)=_latin1 'abc' COLLATE latin1_bin;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 5550eebf1a3..3cc244339d3 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -832,3 +832,44 @@ PREPARE stmt FROM "SELECT GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0) FROM t1 AS t1a
EXECUTE stmt;
EXECUTE stmt;
DROP TABLE t1;
+
+--echo #
+--echo # WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
+--echo # Bug#13387020 GROUP_CONCAT WITH ORDER BY RESULTS ARE TRUNCATED.
+--echo #
+
+
+SET group_concat_max_len= 9999999;
+CREATE TABLE t1 (f1 LONGTEXT , f2 INTEGER);
+INSERT INTO t1 VALUES (REPEAT('a', 500000), 0), (REPEAT('b', 500000), 1), (REPEAT('c', 500000), 2);
+
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC)) FROM t1;
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1)) FROM t1;
+
+SELECT LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2)) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1)) FROM t1;
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1))) FROM t1;
+
+CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+SET group_concat_max_len= DEFAULT;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+
+SET group_concat_max_len= 499999;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 WHERE f2 = 0;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+
+INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+
+DROP TABLE t1;
+SET group_concat_max_len= DEFAULT;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 7013009fae7..1e75099a1fe 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1596,3 +1596,98 @@ DROP TABLE t1;
--echo #
SELECT STDDEV_POP(f) FROM (SELECT "1e+309" AS f UNION SELECT "-1e+309" AS f) tbl;
SELECT STDDEV(f) FROM (SELECT 1.7976931348623157e+308 AS f UNION SELECT -1.7976931348623157e+308 AS f) tbl;
+
+--echo #
+--echo # MDEV-8852 Implicit or explicit CAST from MAX(string) to INT,DOUBLE,DECIMAL does not produce warnings
+--echo #
+SELECT MAX('x') << 1, CAST(MAX('x') AS DOUBLE), CAST(MAX('x') AS DECIMAL);
+
+
+--echo #
+--echo # MDEV-8918 Wrong result for CAST(AVG(a) AS SIGNED)
+--echo #
+CREATE TABLE t1 (id INT, a BIGINT);
+INSERT INTO t1 VALUES (1,0x7FFFFFFFFFFFFFFF),(2,0x7FFFFFFFFFFFFFFF);
+SELECT id, AVG(a) AS avg, CAST(MIN(a) AS SIGNED) AS cast_min FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id;
+SELECT id, AVG(a) AS avg, CAST(AVG(a) AS SIGNED) AS cast_avg FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field()
+--echo #
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT DISTINCT VAR_POP(1) FROM t1 GROUP BY @a := 's';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED)
+--echo #
+CREATE TABLE t1 (id INT, a DOUBLE);
+INSERT INTO t1 VALUES (1,0x7FFFFFFFFFFFFFFF),(2,0x7FFFFFFFFFFFFFFF);
+SELECT id, AVG(a) AS avg, CAST(MIN(a) AS SIGNED) AS cast_min,CAST(AVG(a) AS SIGNED) AS cast_avg FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id;
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
+SELECT MIN(a), SUM(a), CAST(SUM(a) AS SIGNED), CAST(AVG(a) AS SIGNED) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-7195 AVG() loses precision in INT context
+--echo #
+CREATE TABLE t1 (
+ auto SERIAL,
+ fld1 bigint unsigned NOT NULL,
+ companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+ UNIQUE fld1 (fld1)
+);
+INSERT INTO t1 VALUES (1,0x7FFFFFFFFFFFFFFF,00);
+INSERT INTO t1 VALUES (2,0x7FFFFFFFFFFFFFFE,37);
+INSERT INTO t1 VALUES (3,0x7FFFFFFFFFFFFFFC,37);
+SELECT companynr, AVG(fld1), AVG(fld1)<<0 AS avg1, CAST(AVG(fld1) AS UNSIGNED)<<0 AS avg2 FROM t1 GROUP BY companynr;
+DROP TABLE t1;
+
+--echo #
+--echo # case where aggregate resolved in the local SELECT
+--echo # but outer ones are checked
+--echo #
+create table t10 (a int , b int, c int);
+insert into t10 values (0,0,0),(1,1,1);
+create table t11 as select * from t10;
+create table t12 as select * from t10;
+explain extended select a from t10 where c<3 or a in (select c from t12 union select max(t10.b) from t11 group by t11.c);
+drop table t10,t11,t12;
+--echo #
+--echo # MDEV-10017: Get unexpected `Empty Set` for correlated subquery
+--echo # with aggregate functions
+--echo #
+
+create table t1(c1 int, c2 int, c3 int);
+insert into t1 values(1,1,1),(2,2,2),(3,3,3);
+select * from t1;
+create table t2(c1 int, c2 int);
+insert into t2 values(2,2);
+select * from t2;
+--error ER_INVALID_GROUP_FUNC_USE
+explain extended
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+c) from t2 tt));
+--error ER_INVALID_GROUP_FUNC_USE
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+c) from t2 tt));
+
+explain extended
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+tt.c1) from t2 tt));
+select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+tt.c1) from t2 tt));
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-10556 Assertion `0' failed in virtual void Item_sum_field::set_result_field(Field*)
+--echo #
+
+CREATE TABLE t1 (i INT, KEY(i)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (10),(20),(30);
+SELECT DISTINCT STDDEV(1) FROM t1 GROUP BY i ORDER BY BENCHMARK(0, BIT_XOR(i));
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_hybrid_type.test b/mysql-test/t/func_hybrid_type.test
new file mode 100644
index 00000000000..dd8a399025b
--- /dev/null
+++ b/mysql-test/t/func_hybrid_type.test
@@ -0,0 +1,461 @@
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8865 Wrong field type or metadata for COALESCE(signed_int_column, unsigned_int_column)
+--echo #
+
+--echo #
+CREATE TABLE t1 (a INT, b INT UNSIGNED);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-1,1);
+INSERT INTO t1 VALUES (-2147483648,4294967295);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-2147483648,2147483647);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a BIGINT, b BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-9223372036854775808,0xFFFFFFFFFFFFFFFF);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a BIGINT, b BIGINT);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (-9223372036854775808,9223372036854775807);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+# Testing BIT(N) types.
+# Using safe BIT(N) type and value to make sure
+# that "file func_hybrid_type.test" tells "ASCII text".
+
+--echo #
+CREATE TABLE t1 (a INT, b BIT(8));
+INSERT INTO t1 VALUES (-2147483648,0x32);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a INT UNSIGNED, b BIT(8));
+INSERT INTO t1 VALUES (4294967295,0x32);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a BIT(7), b BIT(8));
+INSERT INTO t1 VALUES (0x32,0x32);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a FLOAT, b SMALLINT);
+INSERT INTO t1 VALUES (1,-32678);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a VARCHAR(10), b ENUM('b'));
+INSERT INTO t1 VALUES ('a','b');
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a INT, b YEAR);
+INSERT INTO t1 VALUES (-2147483648,2015);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+CREATE TABLE t1 (a INT UNSIGNED, b YEAR);
+INSERT INTO t1 VALUES (4294967295,2015);
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a DATE, b TIME);
+INSERT INTO t1 VALUES ('2010-01-01','10:20:30');
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a TIMESTAMP, b TIME);
+INSERT INTO t1 VALUES ('2010-01-01 00:00:00','10:20:30');
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a DATETIME, b TIME);
+INSERT INTO t1 VALUES ('2010-01-01 00:00:00','10:20:30');
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+CREATE TABLE t1 (a DATETIME, b DATE);
+INSERT INTO t1 VALUES ('2010-01-01 10:20:30','2001-01-02');
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+
+--echo #
+--echo # MDEV-8873 Wrong field type or metadata for LEAST(int_column,string_column)
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (-2147483648,'100x');
+--source include/func_hybrid_type.inc
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-4848 Wrong metadata or column type for LEAST(1.0,'10')
+--echo #
+--disable_ps_protocol
+--enable_metadata
+SELECT LEAST(1.0,'10');
+--disable_metadata
+--enable_ps_protocol
+CREATE TABLE t1 AS SELECT LEAST(1.0,'10');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-657 LP:873142 - GREATEST() does not always return same signness of argument types
+--echo #
+CREATE TABLE t1 (a BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY);
+INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
+INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-5694 GREATEST(date, time) returns a wrong data type
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2010-01-01 01:02:03');
+--disable_ps_protocol
+--enable_metadata
+# Expect DATETIME type (12) in metadata
+SELECT GREATEST(CURRENT_TIME, CURRENT_DATE), COALESCE(CURRENT_TIME, CURRENT_DATE);
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES ('2010-01-01 10:20:30');
+# Expect TIMESTAMP type (7) in metadata
+SELECT GREATEST(a,a) FROM t1;
+DROP TABLE t1;
+--disable_metadata
+--enable_ps_protocol
+CREATE TABLE t1 (a TIMESTAMP, b DATETIME);
+CREATE TABLE t2 AS SELECT LEAST(a,a),LEAST(b,b),LEAST(a,b) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+--echo #
+--echo # MDEV-8910 Wrong metadata or field type for MAX(COALESCE(string_field))
+--echo #
+CREATE TABLE t1 (c1 TINYBLOB, c2 MEDIUMBLOB, c3 BLOB, c4 LONGBLOB);
+CREATE TABLE t2 AS
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2,
+ MAX(COALESCE(c3)) AS c3,
+ MAX(COALESCE(c4)) AS c4
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2,
+ MAX(COALESCE(c3)) AS c3,
+ MAX(COALESCE(c4)) AS c4
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2,
+ MAX(COALESCE(c3)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2,
+ MAX(COALESCE(c3)) AS c3
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2,
+ MAX(COALESCE(c3)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ MAX(COALESCE(c1)) AS c1,
+ MAX(COALESCE(c2)) AS c2,
+ MAX(COALESCE(c3)) AS c3
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+ MAX(COALESCE(c1)) AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ MAX(COALESCE(c1)) AS c1
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+ MAX(COALESCE(c1)) AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ MAX(COALESCE(c1)) AS c1
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8912 Wrong metadata or type for @c:=string_or_blob_field
+--echo #
+CREATE TABLE t1 (c1 TINYBLOB, c2 BLOB, c3 MEDIUMBLOB, c4 LONGBLOB);
+CREATE TABLE t2 AS
+SELECT
+ @c1:=c1 AS c1,
+ @c2:=c2 AS c2,
+ @c3:=c3 AS c3,
+ @c4:=c4 AS c4
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ @c1:=c1 AS c1,
+ @c2:=c2 AS c2,
+ @c3:=c3 AS c3,
+ @c4:=c4 AS c4
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+ @c1:=c1 AS c1,
+ @c2:=c2 AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ @c1:=c1 AS c1,
+ @c2:=c2 AS c2
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 CHAR(1), c2 CHAR(255)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+ @c1:=c1 AS c1,
+ @c2:=c2 AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ @c1:=c1 AS c1,
+ @c2:=c2 AS c2
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+ @c:=c1 AS c1,
+ @c:=c2 AS c2,
+ @c:=c3 AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ @c:=c1 AS c1,
+ @c:=c2 AS c2,
+ @c:=c3 AS c3
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 VARCHAR(1), c2 VARCHAR(255), c3 VARCHAR(20000)) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+ @c:=c1 AS c1,
+ @c:=c2 AS c2,
+ @c:=c3 AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ @c:=c1 AS c1,
+ @c:=c2 AS c2,
+ @c:=c3 AS c3
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET latin1;
+CREATE TABLE t2 AS
+SELECT
+ @c:=c1 AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ @c:=c1 AS c1
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 ENUM('a')) CHARACTER SET utf8;
+CREATE TABLE t2 AS
+SELECT
+ @c:=c1 AS c1
+FROM t1;
+SHOW CREATE TABLE t2;
+--disable_ps_protocol
+--enable_metadata
+SELECT
+ @c:=c1 AS c1
+FROM t1;
+--disable_metadata
+--enable_ps_protocol
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+--echo #
+SELECT CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END;
+SELECT CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END;
+SELECT CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END;
+
+--disable_ps_protocol
+--enable_metadata
+SELECT COALESCE(COALESCE(NULL), 1.1) AS c0, IF(0, COALESCE(NULL), 1.1) AS c1;
+--disable_metadata
+--enable_ps_protocol
+
+
+--echo #
+--echo # MDEV-9752 Wrong data type for COALEASCE(?,1) in prepared statements
+--echo #
+PREPARE stmt FROM "CREATE TABLE t1 AS SELECT CONCAT(COALESCE(?,1)) AS a, CONCAT(CASE WHEN TRUE THEN ? ELSE 1 END) AS b";
+SET @a=1;
+EXECUTE stmt USING @a,@a;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 8fdba77db9b..dc6749da26f 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -212,7 +212,7 @@ SELECT if(1, NULL, (SELECT min('hello')));
--echo #
CREATE TABLE `t1` (
`datas` VARCHAR(25) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) DEFAULT CHARSET=utf8;
INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4');
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index d3b031d4c81..8a1af6ef872 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -605,7 +605,9 @@ EXECUTE s;
DROP TABLE t1;
+--echo #
--echo # End of 5.3 tests
+--echo #
#
# Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
@@ -616,7 +618,7 @@ select * from t1 where 1 in (a, name_const('a', null));
drop table t1;
--echo #
---echo # Start of 10.0 tests
+--echo # End of 5.5 tests
--echo #
--echo #
@@ -635,3 +637,16 @@ DROP TABLE t1;
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # MDEV-8755 Equal field propagation is not performed any longer for the IN list when multiple comparison types
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+--echo # Ok to propagate equalities into the left IN argument in case of a single comparison type
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a IN (1,2,3);
+--echo # Ok to propagate equalities into IN () list, even if multiple comparison types
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND 1 IN (1,a,'3');
+--echo # Not Ok to propagate equalities into the left IN argument in case of multiple comparison types
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a IN (1,2,'3');
+DROP TABLE t1;
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index bc64504c742..d1b9b170a3b 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -143,3 +143,45 @@ SELECT '' LIKE '1' ESCAPE COUNT(1);
--echo #
SELECT 'a' LIKE REPEAT('',0);
SELECT 'a' LIKE EXTRACTVALUE('bar','qux');
+
+--echo #
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8257 Erroneous "Impossible where" when mixing decimal comparison and LIKE
+--echo #
+CREATE TABLE t1 (a DECIMAL(8,2));
+INSERT INTO t1 VALUES (10),(20);
+SELECT * FROM t1 WHERE a=10.0;
+SELECT * FROM t1 WHERE a LIKE 10.00;
+SELECT * FROM t1 WHERE a=10.0 AND a LIKE 10.00;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10.0 AND a LIKE 10.00;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8599 "WHERE varchar_field LIKE temporal_const" does not use range optimizer
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('00:00:00');
+INSERT INTO t1 VALUES ('00:00:01');
+INSERT INTO t1 VALUES ('00:00:02');
+INSERT INTO t1 VALUES ('00:00:03');
+INSERT INTO t1 VALUES ('00:00:04');
+INSERT INTO t1 VALUES ('00:00:05');
+INSERT INTO t1 VALUES ('00:00:06');
+INSERT INTO t1 VALUES ('00:00:07');
+EXPLAIN SELECT * FROM t1 WHERE a LIKE '00:00:00';
+EXPLAIN SELECT * FROM t1 WHERE a LIKE TIME'00:00:00';
+SELECT * FROM t1 WHERE a LIKE '00:00:00';
+SELECT * FROM t1 WHERE a LIKE TIME'00:00:00';
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 904e8700d26..8cacb4c575a 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -136,9 +136,11 @@ DROP TABLE t1;
#
# InnoDB is required to reproduce the fault, but it is okay if we default to
# MyISAM when testing.
+set sql_mode="";
--disable_warnings
create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
--enable_warnings
+set sql_mode=default;
insert into t1 values ('http://www.foo.com/', now());
select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
drop table t1;
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index dc7202268d6..ffb7838ee78 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -379,7 +379,7 @@ CREATE TABLE t1 (a char(2) not null );
INSERT INTO t1 VALUES (4),(7),(1);
set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='materialization=off';
-CREATE TABLE tv (e char(2) not null ) engine=mysql;
+CREATE TABLE tv (e char(2) not null );
INSERT INTO tv VALUES (1);
CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv;
CREATE ALGORITHM=MERGE VIEW vm AS SELECT * FROM tv;
@@ -1077,6 +1077,33 @@ SELECT INET6_NTOA(ip), HEX(ip), LENGTH(ip) FROM t2;
DROP TABLE t1;
DROP TABLE t2;
+--echo #
+--echo # MDEV-4018 : Microseconds in GET_LOCK()
+--echo #
+
+--echo # -> Switching to connection 'default'
+connection default;
+select is_used_lock('test') = connection_id();
+
+--echo # GET_LOCK returns 1 if it manages to acquire a lock
+select get_lock('test', 0);
+
+connect (con1,localhost,root,,);
+--echo # -> Switching to connection 'con1'
+connection con1;
+select is_used_lock('test') = connection_id();
+select get_lock('test', 0);
+select get_lock('test', 1.0);
+select get_lock('test', 1.5);
+select get_lock('test', 0.1);
+select get_lock('test', 0.000001);
+select get_lock('test', 0.0000000000000001);
+
+--echo # -> Switching to connection 'default'
+connection default;
+select is_used_lock('test') = connection_id();
+select release_lock('test');
+
--echo
--echo # -- Done.
--echo
diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test
index 8f8273bcecb..83a17e16831 100644
--- a/mysql-test/t/func_regexp_pcre.test
+++ b/mysql-test/t/func_regexp_pcre.test
@@ -434,18 +434,25 @@ SELECT 1 FROM dual WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,
#
# MDEV-13173 An RLIKE that previously worked on 10.0 now returns "Got error 'pcre_exec: recursion limit of 100 exceeded' from regexp"
#
-SELECT CONCAT(REPEAT('100,',190),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
+SELECT CONCAT(REPEAT('100,',60),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT CONCAT(REPEAT('100,',600),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
+SELECT CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
-SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',190),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
+SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',600),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
+SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
-SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',190/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
+SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',600/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
+SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
-SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',190/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
+SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',600/3),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
+SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
+
+#
+# MDEV-12942 REGEXP_INSTR returns 1 when using brackets
+#
+SELECT REGEXP_INSTR('a_kollision', 'oll');
+SELECT REGEXP_INSTR('a_kollision', '(oll)');
+SELECT REGEXP_INSTR('a_kollision', 'o([lm])\\1');
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index bdeca8d0d86..b3143ecbc86 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -6,6 +6,10 @@
drop table if exists t1,t2;
--enable_warnings
+set global max_allowed_packet=1048576;
+connect (conn1,localhost,root,,);
+connection conn1;
+
let $mysqld_datadir= `select @@datadir`;
set names latin1;
@@ -105,6 +109,7 @@ select aes_decrypt(NULL,"a");
select aes_decrypt("a",NULL);
select aes_decrypt("a","a");
select aes_decrypt(aes_encrypt("","a"),"a");
+select aes_decrypt("", "a");
select repeat('monty',5),concat('*',space(5),'*');
select reverse('abc'),reverse('abcd');
select rpad('a',4,'1'),rpad('a',4,'12'),rpad('abcd',3,'12'), rpad(11, 10 , 22), rpad("ab", 10, 22);
@@ -1544,7 +1549,12 @@ format(rpad('111111111.1',
'999999999999999999999999999999999999999999'),0,'be_BY')
;
-DO
+#
+# Originally it was DO instead of SELECT here.
+# But in mysqltest --disable_prepare_warnings affects SELECT queries only
+# and can't suppress prepare time warnings for DO.
+#
+SELECT
round(
concat( (
coalesce( (
@@ -1559,9 +1569,9 @@ round(
)
)
)
-);
+) AS r;
---connection default
+--connection conn1
SET @@global.max_allowed_packet:= @tmp_max;
--disconnect newconn
#
@@ -1738,6 +1748,9 @@ EXECUTE stmt;
SET NAMES latin2;
EXECUTE stmt;
+disconnect conn1;
+connection default;
+set global max_allowed_packet=default;
--echo #
--echo # End of 5.6 tests
@@ -1754,3 +1767,51 @@ EXECUTE stmt;
EXPLAIN EXTENDED SELECT CHAR(0xDF USING latin1);
EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
EXPLAIN EXTENDED SELECT CHAR(0xDF);
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+--echo #
+CREATE TABLE t1 (a BIGINT(20) ZEROFILL);
+INSERT INTO t1 VALUES (18446744073709551615),(0);
+SELECT * FROM t1 WHERE a=18446744073709551615;
+SELECT * FROM t1 WHERE FORMAT(a,0)='18,446,744,073,709,551,615';
+SELECT * FROM t1 WHERE a=18446744073709551615 AND FORMAT(a,0)='18,446,744,073,709,551,615';
+# This should not propagate the equality into FORMAT()
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=18446744073709551615 AND FORMAT(a,0)='18,446,744,073,709,551,615';
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#58081 Duplicate entry error when doing GROUP BY
+--echo # MDEV-9332 Bug after upgrade to 10.1.10
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0),(0),(1),(0),(0);
+SELECT COUNT(*) FROM t1, t1 t2 GROUP BY INSERT('', t2.a, t1.a, @@global.max_binlog_size);
+DROP TABLE t1;
+
+--let func=hex
+--source include/func_str_ascii_checksum.inc
+
+--let func=to_base64
+--source include/func_str_ascii_checksum.inc
+
+--echo #
+--echo # MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
+--echo #
+
+CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(128), UNIQUE KEY k1 (f1,f2));
+INSERT INTO t1 VALUES ('YQ==',from_base64('YQ==')), ('Yq==', from_base64('Yq=='));
+SELECT f1,HEX(f2) FROM t1 ignore index(k1) WHERE f1='YQ==' AND (f2= from_base64("YQ==") OR f2= from_base64("Yq=="));
+SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64("YQ==") OR f2= from_base64("Yq=="));
+SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64("Yq==") OR f2= from_base64("YQ=="));
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test
index d3703de26c5..b7bca957e5b 100644
--- a/mysql-test/t/func_test.test
+++ b/mysql-test/t/func_test.test
@@ -194,3 +194,50 @@ EXPLAIN EXTENDED SELECT NOT NOT strcmp('a','b');
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8167 XOR returns bad results for an indexed column
+--echo #
+CREATE TABLE t1 (
+ id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ k INTEGER UNSIGNED DEFAULT '0' NOT NULL,
+ c CHAR(120) DEFAULT '' NOT NULL,
+ pad CHAR(60) DEFAULT '' NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (k, c, pad) VALUES (10, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (11, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (12, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (13, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (14, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (15, 'a', 'xxx');
+INSERT INTO t1 (k, c, pad) VALUES (16, 'a', 'xxx');
+SELECT * FROM t1 WHERE id XOR 0;
+SELECT * FROM t1 IGNORE KEY(PRIMARY) WHERE id XOR 0;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8871 Wrong result for CREATE TABLE .. SELECT LEAST(unsigned_column,unsigned_column)
+--echo #
+CREATE TABLE t1 (a INT,b INT UNSIGNED);
+INSERT INTO t1 VALUES (-2147483648,4294967295);
+--vertical_results
+SELECT a, b, LEAST(a,a), LEAST(b,b), LEAST(a,b), LEAST(b,a), GREATEST(a,b), GREATEST(b,a) FROM t1;
+--horizontal_results
+CREATE TABLE t2 AS
+SELECT a, b, LEAST(a,a), LEAST(b,b), LEAST(a,b), LEAST(b,a), GREATEST(a,b), GREATEST(b,a) FROM t1;
+SHOW CREATE TABLE t2;
+--vertical_results
+SELECT * FROM t2;
+--horizontal_results
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 1f1f3a29574..bc553e6f049 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1036,10 +1036,12 @@ SET time_zone=DEFAULT;
SELECT min(timestampadd(month, 1>'', from_days('%Z')));
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 00:00:00');
create table t1(a time);
insert into t1 values ('00:00:00'),('00:01:00');
select 1 from t1 where 1 < some (select cast(a as datetime) from t1);
drop table t1;
+SET timestamp=DEFAULT;
--echo #
--echo # Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6
@@ -1196,6 +1198,7 @@ SET timestamp=UNIX_TIMESTAMP('2014-06-01 10:20:30');
select greatest(cast("0-0-0" as date), cast("10:20:05" as time));
select greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '0000-00-00';
select greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '2014-06-01';
+select greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '2014-06-01 10:20:05';
select cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetime(6));
SET timestamp=DEFAULT;
@@ -1645,11 +1648,12 @@ SET timestamp=DEFAULT;
--echo #
--echo # MDEV-5750 Assertion `ltime->year == 0' fails on a query with EXTRACT DAY_MINUTE and TIME column
--echo #
+SET timestamp=UNIX_TIMESTAMP('2010-01-01 00:00:00');
CREATE TABLE t1 ( d DATE, t TIME );
INSERT INTO t1 VALUES ('2008-12-05','22:34:09'),('2005-03-27','14:26:02');
SELECT EXTRACT(DAY_MINUTE FROM GREATEST(t,d)), GREATEST(t,d) FROM t1;
DROP TABLE t1;
-
+SET timestamp=DEFAULT;
--echo #
--echo # MDEV-7221 from_days fails after null value
@@ -1762,3 +1766,77 @@ SELECT ADDDATE(DATE'0000-01-01', INTERVAL '0:0:5259490559:315569433599' DAY_SECO
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-10317 EXCTACT(MINUTE_MICROSECOND) truncates data
+--echo #
+
+let $query=
+SELECT
+ a,
+ EXTRACT(YEAR FROM a),
+ EXTRACT(YEAR_MONTH FROM a),
+ EXTRACT(QUARTER FROM a),
+ EXTRACT(MONTH FROM a),
+ EXTRACT(WEEK FROM a),
+ EXTRACT(DAY FROM a),
+ EXTRACT(DAY_HOUR FROM a),
+ EXTRACT(DAY_MINUTE FROM a),
+ EXTRACT(DAY_SECOND FROM a),
+ EXTRACT(HOUR FROM a),
+ EXTRACT(HOUR_MINUTE FROM a),
+ EXTRACT(HOUR_SECOND FROM a),
+ EXTRACT(MINUTE FROM a),
+ EXTRACT(MINUTE_SECOND FROM a),
+ EXTRACT(SECOND FROM a),
+ EXTRACT(MICROSECOND FROM a),
+ EXTRACT(DAY_MICROSECOND FROM a),
+ EXTRACT(HOUR_MICROSECOND FROM a),
+ EXTRACT(MINUTE_MICROSECOND FROM a),
+ EXTRACT(SECOND_MICROSECOND FROM a)
+FROM t1;
+
+
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('1999-12-31 23:59:59.999999');
+
+--vertical_results
+--enable_metadata
+--disable_ps_protocol
+--eval $query
+--enable_ps_protocol
+--disable_metadata
+--horizontal_results
+
+--eval CREATE TABLE t2 AS $query
+--vertical_results
+SELECT * FROM t2;
+--horizontal_results
+SHOW CREATE TABLE t2;
+DROP TABLE t1,t2;
+
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('-838:59:59.999999'),('838:59:59.999999');
+
+--vertical_results
+--enable_metadata
+--disable_ps_protocol
+--eval $query
+--enable_ps_protocol
+--disable_metadata
+--horizontal_results
+
+--eval CREATE TABLE t2 AS $query
+--vertical_results
+SELECT * FROM t2;
+--horizontal_results
+SHOW CREATE TABLE t2;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/func_weight_string.test b/mysql-test/t/func_weight_string.test
index 6c34ce1e460..b8fdfd8b250 100644
--- a/mysql-test/t/func_weight_string.test
+++ b/mysql-test/t/func_weight_string.test
@@ -2,6 +2,11 @@
drop table if exists t1;
--enable_warnings
+
+set global max_allowed_packet=1048576;
+connect (conn1,localhost,root,,);
+connection conn1;
+
set names latin1;
#
@@ -111,3 +116,34 @@ drop table t1;
SELECT HEX(WEIGHT_STRING('ab' AS CHAR(1000000000000000000)));
SELECT HEX(WEIGHT_STRING('ab' AS BINARY(1000000000000000000)));
+disconnect conn1;
+connection default;
+set global max_allowed_packet=default;
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+--echo #
+CREATE TABLE t1 (a INT(6) ZEROFILL);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE a=1;
+SELECT * FROM t1 WHERE WEIGHT_STRING(a) IS NULL;
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+ALTER TABLE t1 MODIFY a DOUBLE ZEROFILL;
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+ALTER TABLE t1 MODIFY a DECIMAL(10,1) ZEROFILL;
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test
index c6cf42e86e4..7391b2114f3 100644
--- a/mysql-test/t/gis-precise.test
+++ b/mysql-test/t/gis-precise.test
@@ -357,5 +357,29 @@ SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER( POLYGONFROMTEXT( 'POLYGON( ( 0.0
# MDEV-5615 crash in Gcalc_function::add_operation
select astext(buffer(st_linestringfromwkb(linestring(point(-1,1), point(-1,-2))),-1));
+# MDEV-7925 Inconsistent behavior of ST_Touches with a POINT as one of arguments
+select ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)'));
+select ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)'));
+select ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'));
+
+# MDEV-12705 10.1.18-MariaDB-1~jessie - mysqld got signal 11.
+SELECT ST_RELATE(
+ ST_DIFFERENCE(
+ GEOMETRYFROMTEXT('
+ MULTILINESTRING(
+ ( 12841 36140, 8005 31007, 26555 31075, 52765 41191,
+ 28978 6548, 45720 32057, 53345 3221 ),
+ ( 8304 59107, 25233 31592, 40502 25303, 8205 42940 ),
+ ( 7829 7305, 58841 56759, 64115 8512, 37562 54145, 2210 14701 ),
+ ( 20379 2805, 40807 27770, 28147 14883, 26439 29383, 55663 5086 ),
+ ( 35944 64702, 14433 23728, 49317 26241, 790 16941 )
+ )
+ '),
+ GEOMETRYFROMTEXT('POINT(46061 13545)')
+ ),
+ GEOMETRYFROMTEXT('POINT(4599 60359)'),
+ 'F*FFFF**F'
+ ) as relate_res;
+
--source include/gis_debug.inc
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 404f0447f56..acd91a91c27 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -976,3 +976,37 @@ SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRContains(l, GEOMFROMTEXT('POINT(
SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'), l);
DROP TABLE t1;
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
+--echo #
+CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (Point(1,2)),(Point(1,3));
+EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(a,Point(1,2));
+EXPLAIN SELECT * FROM t1 WHERE ST_INTERSECTS(a,Point(1,2));
+EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(Point(1,2),a);
+EXPLAIN SELECT * FROM t1 WHERE ST_INTERSECTS(Point(1,2),a);
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8610 "WHERE CONTAINS(indexed_geometry_column,1)" causes full table scan
+--echo #
+CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (Point(1,1)),(Point(2,2)),(Point(3,3));
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1);
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1.0);
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1e0);
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,TIME'00:00:00');
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,DATE'2001-01-01');
+EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,TIMESTAMP'2001-01-01 00:00:00');
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 4192a3284b7..ca43e8d4e2f 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -5,11 +5,6 @@
# Spatial objects
#
---disable_warnings
-DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-
CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
@@ -1120,33 +1115,27 @@ FROM named_places
WHERE name = 'Goose Island';
--echo # Conformance Item T10
-# TODO: ST_SRID() alias
SELECT SRID(boundary)
FROM named_places
WHERE name = 'Goose Island';
--echo # Conformance Item T11
-# TODO: ST_IsEmpty() alias
SELECT IsEmpty(centerline)
FROM road_segments
WHERE name = 'Route 5'
AND aliases = 'Main Street';
-# FIXME: get wrong result:0, expected 1.
-#--echo # Conformance Item T12
-# TODO: ST_IsSimple() alias
-#SELECT IsSimple(shore)
-#FROM lakes
-#WHERE name = 'Blue Lake';
+--echo # Conformance Item T12
+SELECT IsSimple(shore)
+FROM lakes
+WHERE name = 'Blue Lake';
-# TODO: WL#2377
-#--echo # Conformance Item T13
-#SELECT AsText(Boundary((boundary),101)
-#FROM named_places
-#WHERE name = 'Goose Island';
+--echo # Conformance Item T13
+SELECT AsText(ST_Boundary(boundary))
+FROM named_places
+WHERE name = 'Goose Island';
--echo # Conformance Item T14
-# TODO: ST_Envelope( ) alias
# FIXME: we get anticlockwise, GIS suggests clockwise
SELECT AsText(Envelope(boundary))
FROM named_places
@@ -1171,122 +1160,100 @@ FROM road_segments
WHERE fid = 102;
--echo # Conformance Item T18
-# TODO: ST_EndPoint
SELECT AsText(EndPoint(centerline))
FROM road_segments
WHERE fid = 102;
-# TODO: WL#2377
-#--echo # Conformance Item T19
-# TODO: ST_LineFromWKB() alias
-#SELECT IsClosed(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
-#FROM named_places
-#WHERE name = 'Goose Island';
+SELECT IsClosed(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
+FROM named_places
+WHERE name = 'Goose Island';
-# TODO: WL#2377
-#--echo # Conformance Item T20
-#SELECT IsRing(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
-#FROM named_places
-#WHERE name = 'Goose Island';
+--echo # Conformance Item T20
+SELECT IsRing(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary)))
+FROM named_places
+WHERE name = 'Goose Island';
--echo # Conformance Item T21
-# TODO: ST_Length() alias
SELECT GLength(centerline)
FROM road_segments
WHERE fid = 106;
--echo # Conformance Item T22
-# TODO: ST_NumPoints() alias
SELECT NumPoints(centerline)
FROM road_segments
WHERE fid = 102;
--echo # Conformance Item T23
-# TODO: ST_PointN() alias
SELECT AsText(PointN(centerline, 1))
FROM road_segments
WHERE fid = 102;
--echo # Conformance Item T24
-# TODO: ST_Centroid() alias
SELECT AsText(Centroid(boundary))
FROM named_places
WHERE name = 'Goose Island';
-# TODO: WL#2377
-#--echo # Conformance Item T25
-#SELECT Contains(boundary, PointOnSurface(boundary))
-#FROM named_places
-#WHERE name = 'Goose Island';
+SELECT ST_Contains(boundary, PointOnSurface(boundary))
+FROM named_places
+WHERE name = 'Goose Island';
--echo # Conformance Item T26
-# TODO: ST_Area() alias
SELECT Area(boundary)
FROM named_places
WHERE name = 'Goose Island';
--echo # Conformance Item T27
-# TODO: ST_ExteriorRing() alias
SELECT AsText(ExteriorRing(shore))
FROM lakes
WHERE name = 'Blue Lake';
--echo # Conformance Item T28
-# TODO: ST_NumInteriorRings() alias
SELECT NumInteriorRings(shore)
FROM lakes
WHERE name = 'Blue Lake';
--echo # Conformance Item T29
-# TODO: ST_InteriorRingN() alias
SELECT AsText(InteriorRingN(shore, 1))
FROM lakes
WHERE name = 'Blue Lake';
--echo # Conformance Item T30
-# TODO: ST_NumGeometries() alias
SELECT NumGeometries(centerlines)
FROM divided_routes
WHERE name = 'Route 75';
--echo # Conformance Item T31
-# TODO: ST_GeometryN() alias
SELECT AsText(GeometryN(centerlines, 2))
FROM divided_routes
WHERE name = 'Route 75';
--echo # Conformance Item T32
-# TODO: ST_IsClosed() alias
SELECT IsClosed(centerlines)
FROM divided_routes
WHERE name = 'Route 75';
--echo # Conformance Item T33
-# TODO: ST_Length() alias
SELECT GLength(centerlines)
FROM divided_routes
WHERE name = 'Route 75';
--echo # Conformance Item T34
-# TODO: ST_Centroid() alias
SELECT AsText(Centroid(shores))
FROM ponds
WHERE fid = 120;
# TODO: WL#2377
-#--echo # Conformance Item T35
-#SELECT Contains(shores, PointOnSurface(shores))
-#FROM ponds
-#WHERE fid = 120;
+--echo # Conformance Item T35
+SELECT Contains(shores, PointOnSurface(shores))
+FROM ponds
+WHERE fid = 120;
--echo # Conformance Item T36
-# TODO: ST_Area() alias
SELECT Area(shores)
FROM ponds
WHERE fid = 120;
--echo # Conformance Item T37
-# TODO: ST_PolyFromText() alias
SELECT ST_Equals(boundary,
PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1))
FROM named_places
@@ -1304,22 +1271,19 @@ FROM streams, lakes
WHERE streams.name = 'Cam Stream'
AND lakes.name = 'Blue Lake';
-# FIXME: wrong result: get 0, expected 1
-#--echo # Conformance Item T40
-#SELECT ST_Within(boundary, footprint)
-#FROM named_places, buildings
-#WHERE named_places.name = 'Ashton'
-#AND buildings.address = '215 Main Street';
+--echo # Conformance Item T40
+SELECT ST_Within(footprint, boundary)
+FROM named_places, buildings
+WHERE named_places.name = 'Ashton'
+AND buildings.address = '215 Main Street';
-# FIXME: wrong result: get 0, expected 1
-#--echo # Conformance Item T41
-#SELECT ST_Overlaps(forests.boundary, named_places.boundary)
-#FROM forests, named_places
-#WHERE forests.name = 'Green Forest'
-#AND named_places.name = 'Ashton';
+--echo # Conformance Item T41
+SELECT ST_Overlaps(forests.boundary, named_places.boundary)
+FROM forests, named_places
+WHERE forests.name = 'Green Forest'
+AND named_places.name = 'Ashton';
--echo # Conformance Item T42
-# FIXME: TODO: ST_Crosses() alias
SELECT Crosses(road_segments.centerline, divided_routes.centerlines)
FROM road_segments, divided_routes
WHERE road_segments.fid = 102
@@ -1337,12 +1301,11 @@ FROM forests, named_places
WHERE forests.name = 'Green Forest'
AND named_places.name = 'Ashton';
-# TODO: WL#2377
-#--echo # Conformance Item T45
-#SELECT Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT')
-#FROM forests, named_places
-#WHERE forests.name = 'Green Forest'
-#AND named_places.name = 'Ashton';
+--echo # Conformance Item T45
+SELECT ST_Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT')
+FROM forests, named_places
+WHERE forests.name = 'Green Forest'
+AND named_places.name = 'Ashton';
--echo # Conformance Item T46
SELECT ST_Distance(position, boundary)
@@ -1350,12 +1313,11 @@ FROM bridges, named_places
WHERE bridges.name = 'Cam Bridge'
AND named_places.name = 'Ashton';
-# FIXME: wrong result: NULL, expected 12
-#--echo # Conformance Item T47
-#SELECT AsText(ST_Intersection(centerline, shore))
-#FROM streams, lakes
-#WHERE streams.name = 'Cam Stream'
-#AND lakes.name = 'Blue Lake';
+--echo # Conformance Item T47
+SELECT AsText(ST_Intersection(centerline, shore))
+FROM streams, lakes
+WHERE streams.name = 'Cam Stream'
+AND lakes.name = 'Blue Lake';
--echo # Conformance Item T48
SELECT AsText(ST_Difference(named_places.boundary, forests.boundary))
@@ -1380,11 +1342,10 @@ SELECT count(*)
FROM buildings, bridges
WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1;
-# TODO: WL#2377
-#--echo # Conformance Item T52
-#SELECT AsText(ConvexHull(shore))
-#FROM lakes
-#WHERE lakes.name = 'Blue Lake';
+--echo # Conformance Item T52
+SELECT AsText(ConvexHull(shore))
+FROM lakes
+WHERE lakes.name = 'Blue Lake';
DROP DATABASE gis_ogs;
USE test;
@@ -1412,6 +1373,7 @@ insert into t1 values(geomfromtext("POINT(0 0)"));
insert into t1 values(geomfromtext("POINT(0 9.2233720368548e18)"));
insert into t1 values(geomfromtext("POINT(0 9.2233720368548e18)"));
select equals(`a`,convert(`a` using utf8)) from `t1`;
+select equals(`a`,left(`a`,23)) from `t1`;
drop table t1;
--echo #
@@ -1520,3 +1482,74 @@ SET optimizer_switch=@save_optimizer_switch;
--echo #
--echo # End 10.0 tests
--echo #
+
+SHOW CREATE TABLE information_schema.geometry_columns;
+SHOW CREATE TABLE information_schema.spatial_ref_sys;
+
+create table t1(g GEOMETRY, pt POINT);
+create table t2(g LINESTRING, pl POLYGON);
+select * from information_schema.geometry_columns where f_table_schema='test';
+drop table t1, t2;
+
+--echo 10.1 tests
+create table t1(g GEOMETRY(9,4) REF_SYSTEM_ID=101, pt POINT(8,2), pg GEOMETRY REF_SYSTEM_ID=102);
+SELECT SRID from information_schema.geometry_columns WHERE f_table_schema='test' and G_TABLE_NAME='t1';
+drop table t1;
+
+-- echo # Expect an int(1) column to be created
+CREATE TABLE t1 AS SELECT CONTAINS(NULL, NULL);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-7334 valgrind warning "unitialized bytes" in 10.1.
+--echo #
+CREATE TABLE t1 (
+ gp point,
+ ln linestring,
+ pg polygon,
+ mp multipoint,
+ mln multilinestring,
+ mpg multipolygon,
+ gc geometrycollection,
+ gm geometry
+);
+ALTER TABLE t1 ADD fid INT NOT NULL;
+select SRID from information_schema.geometry_columns where F_TABLE_NAME='t1';
+drop table t1;
+
+--echo #
+--echo # MDEV-7510 GIS: IsRing returns false for a primitive triangle.
+--echo #
+select ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)'));
+select ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,-10 -10, 0 -10, 0 0)'));
+
+--echo #
+--echo # MDEV-7514 GIS: PointOnSurface returns NULL instead of the point.
+--echo #
+SELECT ST_GEOMETRYTYPE(ST_PointOnSurface(ST_PolyFromText('POLYGON((-70.916 42.1002,-70.9468 42.0946,-70.9754 42.0875,-70.9749 42.0879,-70.9759 42.0897,-70.916 42.1002))')));
+
+--echo #
+--echo # MDEV-7529 GIS: ST_Relate returns unexpected results for POINT relations
+--echo #
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'T*F**FFF*') AS equals;
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'T*****FF*') AS contains;
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'T*F**F***') AS within;
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(1 1)'),'FF*FF****') as disjoint;
+select ST_Relate(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'),'FF*FF****') as disjoint;
+
+
+--echo #
+--echo # MDEV-7528 GIS: Functions return NULL instead of specified -1 for NULL arguments.
+--echo #
+
+select ST_IsRing(NULL);
+
+--echo #
+--echo # MDEV-8675 Different results of GIS functions on NULL vs NOT NULL columns
+--echo #
+CREATE TABLE t1 (g1 GEOMETRY NOT NULL,g2 GEOMETRY NULL);
+CREATE TABLE t2 AS SELECT WITHIN(g1,g1) as w1,WITHIN(g2,g2) AS w2 FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 0be4c254269..a8ddf350b73 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -6,6 +6,8 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
@@ -47,10 +49,10 @@ flush privileges;
#
delete from mysql.user where user='mysqltest_1';
flush privileges;
-grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
+grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10 max_statement_time 60;
query_vertical select * from mysql.user where user="mysqltest_1";
show grants for mysqltest_1@localhost;
-grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
+grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30 max_statement_time 0;
query_vertical select * from mysql.user where user="mysqltest_1";
show grants for mysqltest_1@localhost;
# This is just to double check that one won't ignore results of selects
@@ -2270,5 +2272,6 @@ disconnect con1;
DROP USER untrusted@localhost;
DROP DATABASE secret;
+set GLOBAL sql_mode=default;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 8590dccd1d1..a40fd2afb18 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -5,6 +5,8 @@
--source include/count_sessions.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
SET NAMES binary;
#
@@ -1029,5 +1031,6 @@ DROP USER mysqltest_u4@localhost;
DROP USER mysqltest_u5@localhost;
+set GLOBAL sql_mode=default;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index d24b2de17eb..27f565916f7 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -4,6 +4,8 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
+set global sql_mode="";
+set local sql_mode="";
# Test of GRANT commands
@@ -204,6 +206,7 @@ connection default;
DROP USER 'user2'@'%';
DROP DATABASE temp;
+set global sql_mode=default;
--echo End of 5.0 tests
# Wait till we reached the initial number of concurrent sessions
diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test
index 756454237f5..a3578c9b85a 100644
--- a/mysql-test/t/grant4.test
+++ b/mysql-test/t/grant4.test
@@ -4,6 +4,8 @@
--disable_warnings
drop database if exists mysqltest_db1;
--enable_warnings
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
create database mysqltest_db1;
use mysqltest_db1;
create table t_column_priv_only (a int, b int);
@@ -201,3 +203,37 @@ disconnect con1;
connection default;
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
+
+create user foo1 identified by password '11111111111111111111111111111111111111111';
+create user foo2 identified by password '2222222222222222';
+create user foo3 identified via mysql_native_password using '11111111111111111111111111111111111111111';
+create user foo4 identified via mysql_old_password using '2222222222222222';
+
+grant select on test.* to foo5 identified by password '11111111111111111111111111111111111111111';
+grant select on test.* to foo6 identified by password '2222222222222222';
+grant select on test.* to foo7 identified via mysql_native_password using '11111111111111111111111111111111111111111';
+grant select on test.* to foo8 identified via mysql_old_password using '2222222222222222';
+
+--sorted_result
+select user,password,plugin,authentication_string from mysql.user where user like 'foo%';
+
+drop user foo1;
+drop user foo2;
+drop user foo3;
+drop user foo4;
+drop user foo5;
+drop user foo6;
+drop user foo7;
+drop user foo8;
+
+--error ER_PASSWD_LENGTH
+create user foo1 identified via mysql_native_password using '00';
+--error ER_PASSWD_LENGTH
+create user foo2 identified via mysql_native_password using '2222222222222222';
+--error ER_PASSWD_LENGTH
+create user foo3 identified via mysql_old_password using '00';
+--error ER_PASSWD_LENGTH
+create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111';
+
+
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/t/grant_4332.test b/mysql-test/t/grant_4332.test
index d3c3b2d5652..41e0b822f98 100644
--- a/mysql-test/t/grant_4332.test
+++ b/mysql-test/t/grant_4332.test
@@ -6,6 +6,8 @@
#
--source include/not_embedded.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
alter table mysql.user modify User char(16) binary not null default '';
alter table mysql.db modify User char(16) binary not null default '';
@@ -40,3 +42,4 @@ flush privileges;
select user();
--disable_metadata
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/t/grant_explain_non_select.test b/mysql-test/t/grant_explain_non_select.test
index d59a8f3d8ce..701586be325 100644
--- a/mysql-test/t/grant_explain_non_select.test
+++ b/mysql-test/t/grant_explain_non_select.test
@@ -8,6 +8,9 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
+
CREATE DATABASE privtest_db;
CREATE TABLE privtest_db.t1 (a INT);
@@ -254,5 +257,7 @@ DROP USER 'privtest'@localhost;
USE test;
DROP DATABASE privtest_db;
+set GLOBAL sql_mode=default;
+set LOCAL sql_mode=default;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant_lowercase.test b/mysql-test/t/grant_lowercase.test
index 4fc5facf808..e31a72b890e 100644
--- a/mysql-test/t/grant_lowercase.test
+++ b/mysql-test/t/grant_lowercase.test
@@ -4,7 +4,7 @@
#
# http://seclists.org/fulldisclosure/2012/Dec/4
#
-
+set sql_mode="";
# in acl_get(), check_grant_db(), mysql_grant()
grant file on *.* to user1@localhost with grant option;
grant select on `a%`.* to user1@localhost with grant option;
@@ -19,13 +19,12 @@ drop user user1@localhost;
# in acl_load()
call mtr.add_suppression("Incorrect database name");
alter table mysql.host modify Db varchar(200);
-alter table mysql.db modify User char(16), modify Db varchar(200);
+alter table mysql.db modify User char(16) default "", modify Db varchar(200) default "";
insert mysql.host set db=concat('=>', repeat(_utf8 'й', 200));
insert mysql.db set db=concat('=>', repeat(_utf8 'й', 200));
flush privileges; # shouldn't crash here
delete from mysql.host where db like '=>%';
delete from mysql.db where db like '=>%';
-alter table mysql.host modify Db char(64);
-alter table mysql.db modify Db char(64), modify User char(80);
+alter table mysql.host modify Db char(64) default "";
+alter table mysql.db modify Db char(64) default "", modify User char(80) default "";
flush privileges;
-
diff --git a/mysql-test/t/grant_lowercase_fs.test b/mysql-test/t/grant_lowercase_fs.test
index f57f950ec8c..92191829c58 100644
--- a/mysql-test/t/grant_lowercase_fs.test
+++ b/mysql-test/t/grant_lowercase_fs.test
@@ -6,6 +6,8 @@
# Bug#41049 does syntax "grant" case insensitive?
#
create database db1;
+create user user_1@localhost;
+create user USER_1@localhost;
GRANT CREATE ON db1.* to user_1@localhost;
GRANT SELECT ON db1.* to USER_1@localhost;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index d941fa22830..0401ad9780c 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -394,6 +394,7 @@ select a,count(*) from t1 group by a;
set big_tables=1;
select a,count(*) from t1 group by a;
drop table t1;
+set big_tables=0;
#
# Test of GROUP BY ... ORDER BY NULL optimization
@@ -485,9 +486,12 @@ create table t1 (a integer, b integer, c integer);
insert into t1 (a,b) values (1,2),(1,3),(2,5);
select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1;
# rand(100)*10 will be < 2 only for the first row (of 6)
-select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2;
+select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2;
+select a, round(rand(100)*10) r2, sum(1) r1 from t1 group by a having r1>1 and r2<=2;
select a,sum(b) from t1 where a=1 group by c;
select a*sum(b) from t1 where a=1 group by c;
+select a*sum(b) as f1 from t1 where a=1 group by c having f1 <= 10;
+select a,a*sum(b) as f1 from t1 where a=1 group by c having a*sum(b)+0 <= 10;
select sum(a)*sum(b) from t1 where a=1 group by c;
select a,sum(b) from t1 where a=1 group by c having a=1;
select a as d,sum(b) from t1 where a=1 group by c having d=1;
@@ -1346,9 +1350,9 @@ let $query=SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2
FROM t1 GROUP BY field1, field2;
# Needs to be range to exercise bug
---eval EXPLAIN $query;
+--eval EXPLAIN $query
FLUSH STATUS;
---eval $query;
+--eval $query
SHOW SESSION STATUS LIKE 'Sort_scan%';
CREATE VIEW v1 AS SELECT * FROM t1;
@@ -1369,6 +1373,14 @@ select col1 f1, col1 f2 from t1 order by f2, f1+0;
select col1 f1, col1 f2 from t1 order by f2, f1+0;
explain
+select col1 f1, col1 f2 from t1 group by f1;
+select col1 f1, col1 f2 from t1 group by f1;
+
+explain
+select col1 f1, col1 f2 from t1 group by f1, f2;
+select col1 f1, col1 f2 from t1 group by f1, f2;
+
+explain
select col1 f1, col1 f2 from t1 group by f2 order by f2, f1;
select col1 f1, col1 f2 from t1 group by f2 order by f2, f1;
@@ -1376,6 +1388,7 @@ explain
select col1 f1, col1 f2 from t1 group by f1, f2 order by f2, f1;
select col1 f1, col1 f2 from t1 group by f1, f2 order by f2, f1;
+
CREATE TABLE t2(
col1 int,
col2 int,
@@ -1386,10 +1399,21 @@ INSERT INTO t2(col1, col2) VALUES
(11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1);
explain
+select col1 f1, col2 f2, col1 f3 from t2 group by f1;
+explain
+select SQL_BIG_RESULT col1 f1, col2 f2, col1 f3 from t2 group by f1;
+explain
+select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2;
+explain
+select col1 f1, col1 f2 from t2 group by f1, 1+1;
+
+explain
select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2, f3+0;
select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2, f3+0;
explain
+select col1 f1, col2 f2, col1 f3 from t2 order by f1,f2;
+explain
select col1 f1, col2 f2, col1 f3 from t2 order by f1, f2, f3+0;
select col1 f1, col2 f2, col1 f3 from t2 order by f1, f2, f3+0;
@@ -1819,3 +1843,75 @@ DROP TABLE where_subselect;
--echo # End of Bug #58782
+--echo #
+--echo # MDEV-8988: Apparently valid SQL query gives wrong result (nested WHERE)
+--echo #
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int, b int, c int);
+insert into t1 select A.a + 10*B.a, A.a, A.a + 10*B.a from t0 A, t0 B;
+insert into t1 values (NULL, NULL, NULL);
+
+create table t2 (c int, col1 int, key(c));
+insert into t2 select t1.a, 100000 from t1;
+analyze table t2;
+
+explain
+select
+ max(a)+ (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+
+select
+ max(a) + (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+
+drop table t0,t1,t2;
+
+--echo #
+--echo # MDEV-9602 crash in st_key::actual_rec_per_key when group by constant
+--echo #
+
+create table t1 (a date not null,unique (a)) engine=innodb;
+select distinct a from t1 group by 'a';
+insert into t1 values("2001-02-02"),("2001-02-03");
+select distinct a from t1 group by 'a';
+drop table t1;
+
+--echo #
+--echo # MDEV-10324: Server crash in get_sel_arg_for_keypart or Assertion `n < size()' failed in Mem_root_array
+--echo #
+CREATE TABLE t1 (
+ job_id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ job_cmd varbinary(60) NOT NULL DEFAULT '',
+ job_namespace int(11) NOT NULL,
+ job_title varbinary(255) NOT NULL,
+ job_params blob NOT NULL,
+ job_timestamp varbinary(14) DEFAULT NULL,
+ job_random int(10) unsigned NOT NULL DEFAULT '0',
+ job_token varbinary(32) NOT NULL DEFAULT '',
+ job_token_timestamp varbinary(14) DEFAULT NULL,
+ job_sha1 varbinary(32) NOT NULL DEFAULT '',
+ job_attempts int(10) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (job_id),
+ KEY job_cmd (job_cmd,job_namespace,job_title,job_params(128)),
+ KEY job_timestamp (job_timestamp),
+ KEY job_sha1 (job_sha1),
+ KEY job_cmd_token (job_cmd,job_token,job_random),
+ KEY job_cmd_token_id (job_cmd,job_token,job_id)
+);
+
+INSERT INTO t1 VALUES
+ (NULL, 'foo', 1, 'foo', 'foo', 'foo', 1, 'foo', 'foo', 'foo', 1),
+ (NULL, 'bar', 2, 'bar', 'bar', 'bar', 2, 'bar', 'bar', 'bar', 2);
+
+SELECT DISTINCT job_cmd FROM t1 WHERE job_cmd IN ('foobar','null');
+drop table t1;
+
+CREATE TABLE t1 (f1 INT NOT NULL, f2 VARCHAR(3) NOT NULL, KEY(f1), KEY(f2, f1));
+INSERT INTO t1 VALUES (0,'foo'),(1,'bar');
+SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
+drop table t1;
+
diff --git a/mysql-test/t/group_by_innodb.test b/mysql-test/t/group_by_innodb.test
index 074df222294..f7e035a1b54 100644
--- a/mysql-test/t/group_by_innodb.test
+++ b/mysql-test/t/group_by_innodb.test
@@ -134,5 +134,35 @@ SELECT ( SELECT DISTINCT GROUP_CONCAT(SLEEP(0)) FROM t1 GROUP BY i );
SELECT i FROM t1 order by i LIMIT 1;
DROP TABLE t1;
+--echo # Port of testcase:
+--echo #
+--echo # Bug#20819199 ASSERTION FAILED IN TEST_IF_SKIP_SORT_ORDER
+--echo #
+
+CREATE TABLE t0 ( a INT );
+INSERT INTO t0 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+CREATE TABLE t1 (
+ pk INT NOT NULL AUTO_INCREMENT,
+ a INT,
+ b INT,
+ PRIMARY KEY (pk),
+ KEY idx1 (a),
+ KEY idx2 (b, a),
+ KEY idx3 (a, b)
+) ENGINE = InnoDB;
+
+INSERT INTO t1 (a, b) SELECT t01.a, t02.a FROM t0 t01, t0 t02;
+
+ANALYZE TABLE t1;
+
+let $query=
+SELECT DISTINCT a, MAX(b) FROM t1 WHERE a >= 0 GROUP BY a,a;
+
+eval EXPLAIN $query;
+eval $query;
+
+DROP TABLE t0, t1;
+
--echo # End of tests
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 8c9be0ca8db..b0bc42d7f8c 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -1524,3 +1524,90 @@ DROP TABLE t1;
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-6990 GROUP_MIN_MAX optimization is not applied in some cases when it could
+--echo #
+CREATE TABLE t1 (id INT NOT NULL, a DATE, KEY(id,a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,'2001-01-01');
+INSERT INTO t1 VALUES (1,'2001-01-02');
+INSERT INTO t1 VALUES (1,'2001-01-03');
+INSERT INTO t1 VALUES (1,'2001-01-04');
+INSERT INTO t1 VALUES (2,'2001-01-01');
+INSERT INTO t1 VALUES (2,'2001-01-02');
+INSERT INTO t1 VALUES (2,'2001-01-03');
+INSERT INTO t1 VALUES (2,'2001-01-04');
+INSERT INTO t1 VALUES (3,'2001-01-01');
+INSERT INTO t1 VALUES (3,'2001-01-02');
+INSERT INTO t1 VALUES (3,'2001-01-03');
+INSERT INTO t1 VALUES (3,'2001-01-04');
+INSERT INTO t1 VALUES (4,'2001-01-01');
+INSERT INTO t1 VALUES (4,'2001-01-02');
+INSERT INTO t1 VALUES (4,'2001-01-03');
+INSERT INTO t1 VALUES (4,'2001-01-04');
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>='2001-01-04' GROUP BY id;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104.0 GROUP BY id;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>='2001-01-04' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104.0 GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8229 GROUP_MIN_MAX is erroneously applied for BETWEEN in some cases
+--echo #
+SET NAMES latin1;
+CREATE TABLE t1 (id INT NOT NULL, a VARCHAR(20)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,'2001-01-01');
+INSERT INTO t1 VALUES (1,'2001-01-02');
+INSERT INTO t1 VALUES (1,'2001-01-03');
+INSERT INTO t1 VALUES (1,' 2001-01-04');
+INSERT INTO t1 VALUES (2,'2001-01-01');
+INSERT INTO t1 VALUES (2,'2001-01-02');
+INSERT INTO t1 VALUES (2,'2001-01-03');
+INSERT INTO t1 VALUES (2,' 2001-01-04');
+INSERT INTO t1 VALUES (3,'2001-01-01');
+INSERT INTO t1 VALUES (3,'2001-01-02');
+INSERT INTO t1 VALUES (3,'2001-01-03');
+INSERT INTO t1 VALUES (3,' 2001-01-04');
+INSERT INTO t1 VALUES (4,'2001-01-01');
+INSERT INTO t1 VALUES (4,'2001-01-02');
+INSERT INTO t1 VALUES (4,'2001-01-03');
+INSERT INTO t1 VALUES (4,' 2001-01-04');
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN ' 2001-01-04' AND '2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND '2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+ALTER TABLE t1 ADD KEY(id,a);
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN ' 2001-01-04' AND '2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND '2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id;
+SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN ' 2001-01-04' AND '2001-01-05' GROUP BY id;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND '2001-01-05' GROUP BY id;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id;
+DROP TABLE t1;
+
+--echo #
+--echo # MIN() optimization didn't work correctly with BETWEEN when using too
+--echo # long strings.
+--echo #
+
+create table t1 (a varchar(10), key (a)) engine=myisam;
+insert into t1 values("bar"),("Cafe");
+explain select min(a) from t1 where a between "a" and "Cafe2";
+explain select min(a) from t1 where a between "a" and "Cafeeeeeeeeeeeeeeeeeeeeeeeeee";
+explain select min(a) from t1 where a between "abbbbbbbbbbbbbbbbbbbb" and "Cafe2";
+drop table t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 1682fe5b874..1bbde3e7c5e 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -760,3 +760,18 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1;
DROP TABLE t1,t2;
--echo End of 10.0 tests
+
+--echo #
+--echo # MDEV-10716: Assertion `real_type() != FIELD_ITEM' failed in
+--echo # Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**)
+--echo #
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT i, COUNT(*) FROM t1 GROUP BY i HAVING i<>0 AND 1;
+SELECT i-1 A, COUNT(*) FROM t1 GROUP BY i HAVING A AND 1;
+CREATE VIEW v1 as select i, i-1 as A from t1;
+SELECT A, COUNT(*) FROM v1 GROUP BY i HAVING A AND 1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo End of 10.1 tests
diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test
index 881299a216c..dc5dc1cee5f 100644
--- a/mysql-test/t/help.test
+++ b/mysql-test/t/help.test
@@ -69,12 +69,14 @@ help 'impossible_function_1';
SET sql_mode=DEFAULT;
##############
+set sql_mode="";
--disable_warnings
alter table mysql.help_relation engine=innodb;
alter table mysql.help_keyword engine=innodb;
alter table mysql.help_topic engine=innodb;
alter table mysql.help_category engine=innodb;
--enable_warnings
+set sql_mode=default;
##############
help 'function_of_my_dream';
diff --git a/mysql-test/t/host_cache_size_functionality.test b/mysql-test/t/host_cache_size_functionality.test
index 1696c2fcb97..5a7376cc5eb 100644
--- a/mysql-test/t/host_cache_size_functionality.test
+++ b/mysql-test/t/host_cache_size_functionality.test
@@ -35,7 +35,7 @@ SELECT COUNT(@@GLOBAL.Host_Cache_Size);
--echo 1 Expected
#set @Default_host_cache_size=(select if(if(@@global.max_connections<500,128+@@global.max_connections,128+@@global.max_connections+floor((@@global.max_connections-500)/20))>2000,2000,if(@@global.max_connections<500,128+@@global.max_connections,128+@@global.max_connections+floor((@@global.max_connections-500)/20))));
-set @Default_host_cache_size=128;
+set @Default_host_cache_size=279;
select @@global.Host_Cache_Size=@Default_host_cache_size;
--echo 1 Expected
diff --git a/mysql-test/t/implicit_commit.test b/mysql-test/t/implicit_commit.test
index 59f8dc3a44c..bcc43865395 100644
--- a/mysql-test/t/implicit_commit.test
+++ b/mysql-test/t/implicit_commit.test
@@ -2,6 +2,8 @@ source include/have_innodb.inc;
source include/not_embedded.inc;
source include/have_profiling.inc;
+SET SQL_MODE="";
+
SET GLOBAL EVENT_SCHEDULER = OFF;
SET BINLOG_FORMAT = STATEMENT;
diff --git a/mysql-test/t/index_intersect.test b/mysql-test/t/index_intersect.test
index 001c698029e..19918c03479 100644
--- a/mysql-test/t/index_intersect.test
+++ b/mysql-test/t/index_intersect.test
@@ -428,7 +428,7 @@ CREATE TABLE t1 (
f5 int,
PRIMARY KEY (f1),
KEY (f4)
-) ENGINE=InnoDB;
+);
INSERT INTO t1 VALUES
(5,'H',1), (9,'g',0), (527,'i',0), (528,'y',1), (529,'S',6),
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 2a00ad75a8d..5b3fa7b653c 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -14,6 +14,8 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
+set global sql_mode="";
+set local sql_mode="";
# Test for information_schema.schemata &
# show databases
@@ -50,19 +52,22 @@ insert into t5 values (10);
create view v1 (c) as
SELECT table_name FROM information_schema.TABLES
WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND
- table_name not like 'ndb_%' AND table_name not like 'innodb_%' AND
+ table_name not like 'innodb_%' AND
table_name not like 'xtradb_%';
--sorted_result
select * from v1;
+--sorted_result
select c,table_name from v1
inner join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
+--sorted_result
select c,table_name from v1
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
+--sorted_result
select c, v2.table_name from v1
right join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
@@ -368,17 +373,20 @@ drop view vo;
select TABLE_NAME,TABLE_TYPE,ENGINE
from information_schema.tables
where table_schema='information_schema' limit 2;
+--sorted_result
show tables from information_schema like "T%";
--error ER_DBACCESS_DENIED_ERROR
create database information_schema;
use information_schema;
+--sorted_result
show full tables like "T%";
--error ER_DBACCESS_DENIED_ERROR
create table t1(a int);
use test;
show tables;
use information_schema;
+--sorted_result
show tables like "T%";
#
@@ -1366,6 +1374,8 @@ drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;";
select * from information_schema.global_variables where variable_name='init_connect';
+--replace_regex /at row [123]/at row #/
+select * from information_schema.global_variables where variable_name like 'init%' order by variable_name;
set global init_connect="";
#
@@ -1899,3 +1909,30 @@ disconnect con1;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
+set global sql_mode=default;
+
+USE test;
+
+--echo #
+--echo # End of 10.0 tests
+--echo #
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+
+--echo #
+--echo # MDEV-13242 Wrong results for queries with row constructors and information_schema
+--echo #
+
+CREATE TABLE tt1(c1 INT);
+CREATE TABLE tt2(c2 INT);
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (('tt1', 'c1'));
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (('tt2', 'c2'));
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (('tt1','c1'),('tt2', 'c2'));
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name, column_name) IN (SELECT 'tt1','c1' FROM dual UNION SELECT 'tt2', 'c2' FROM dual);
+SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name='tt1' AND column_name='c1') OR (table_name='tt2' AND column_name='c2');
+SELECT column_name FROM information_schema.columns WHERE (table_name, column_name) IN (('tt1','c1'),('tt2', 'c2')) ORDER BY column_name;
+DROP TABLE tt1, tt2;
diff --git a/mysql-test/t/information_schema_all_engines-master.opt b/mysql-test/t/information_schema_all_engines-master.opt
index e37aeaac933..43411c5033a 100644
--- a/mysql-test/t/information_schema_all_engines-master.opt
+++ b/mysql-test/t/information_schema_all_engines-master.opt
@@ -13,3 +13,6 @@
--loose-innodb-sys-foreign-cols
--loose-innodb-sys-tables
--loose-innodb-sys-tablestats
+--loose-innodb-mutexes
+--loose-innodb-tablespaces-encryption
+--loose-innodb-tablespaces-scrubbing
diff --git a/mysql-test/t/information_schema_all_engines.test b/mysql-test/t/information_schema_all_engines.test
index 9b2a3e68bcd..8c898909c1e 100644
--- a/mysql-test/t/information_schema_all_engines.test
+++ b/mysql-test/t/information_schema_all_engines.test
@@ -84,4 +84,4 @@ group by t.table_name order by num1, t.table_name;
# Bug #9404 information_schema: Weird error messages
# with SELECT SUM() ... GROUP BY queries
#
-SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
+SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test
index a2a32a4fac5..70ad9b5b920 100644
--- a/mysql-test/t/information_schema_db.test
+++ b/mysql-test/t/information_schema_db.test
@@ -7,6 +7,9 @@
-- source include/testdb_only.inc
+set local sql_mode="";
+set global sql_mode="";
+
--disable_warnings
drop table if exists t1,t2;
drop view if exists v1,v2;
@@ -15,6 +18,7 @@ drop function if exists f2;
--enable_warnings
--replace_result 'Tables_in_INFORMATION_SCHEMA (T%)' 'Tables_in_information_schema (T%)'
+--sorted_result
show tables from INFORMATION_SCHEMA like 'T%';
create database `inf%`;
create database mbase;
@@ -249,3 +253,5 @@ connection user1;
disconnect user1;
--source include/wait_until_disconnected.inc
connection default;
+
+set global sql_mode=default;
diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test
index 657d0effd7e..9a9658e9027 100644
--- a/mysql-test/t/information_schema_inno.test
+++ b/mysql-test/t/information_schema_inno.test
@@ -109,3 +109,9 @@ CREATE TABLE t1 engine = InnoDB AS
DROP TABLE t1;
DROP VIEW v1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t1(i int) ENGINE=Innodb ROW_FORMAT=REDUNDANT DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME='t1';
+DROP TABLE t1;
diff --git a/mysql-test/t/information_schema_linux.test b/mysql-test/t/information_schema_linux.test
new file mode 100644
index 00000000000..0e3170080c3
--- /dev/null
+++ b/mysql-test/t/information_schema_linux.test
@@ -0,0 +1,10 @@
+--source include/linux.inc
+
+--echo #
+--echo # MDEV-6756: map a linux pid (child pid) to a connection id shown in
+--echo # the output of SHOW PROCESSLIST
+--echo #
+--connect (con1,localhost,root)
+SELECT max(tid) != min(tid) FROM information_schema.processlist;
+--connection default
+--disconnect con1
diff --git a/mysql-test/t/information_schema_routines.test b/mysql-test/t/information_schema_routines.test
index c578176a85d..190410c2b82 100644
--- a/mysql-test/t/information_schema_routines.test
+++ b/mysql-test/t/information_schema_routines.test
@@ -54,6 +54,8 @@
# the routine; otherwise NULL),
# DEFINER (shows the user who created the routine).
################################################################################
+set sql_mode="";
+set sql_mode="";
-- echo # ========== routines.1 ==========
USE INFORMATION_SCHEMA;
--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" ""
diff --git a/mysql-test/t/innodb_ext_key.test b/mysql-test/t/innodb_ext_key.test
index 9f3a89ff948..c8acfc5db2e 100644
--- a/mysql-test/t/innodb_ext_key.test
+++ b/mysql-test/t/innodb_ext_key.test
@@ -693,5 +693,141 @@ drop table t1, t2;
set optimizer_switch=@save_optimizer_switch;
+--echo #
+--echo # MDEV-10325: Queries examines all rows of a tables when it should not
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (
+ pk int not null,
+ col1 varchar(32),
+ filler varchar(100),
+ key idx1(col1(10)),
+ primary key (pk)
+)engine=innodb;
+
+insert into t1
+select
+ A.a + 10*B.a + 100*C.a,
+ concat('1234567890-', 1000+ A.a + 10*B.a + 100*C.a),
+ repeat('filler-data-', 4)
+from
+ t0 A, t0 B, t0 C;
+
+let $q=explain select * from t1 where col1='1234567890-a';
+let $rows=query_get_value($q, rows, 1);
+if ($rows < 2)
+{
+ --echo The EXPLAIN should not produce a query plan with type=ref, rows=1
+ --die Fix for MDEV-10325 didnt work;
+}
+
+drop table t0,t1;
+
+--echo #
+--echo # MDEV-10360: Extended keys: index properties depend on index order
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (
+ index_id bigint(20) unsigned NOT NULL,
+ index_class varchar(265) COLLATE latin1_general_ci DEFAULT NULL ,
+ index_object_id int(10) unsigned NOT NULL DEFAULT '0' ,
+ index_date_updated int(10) unsigned DEFAULT NULL ,
+
+ PRIMARY KEY (index_id),
+ KEY object (index_class(181),index_object_id),
+ KEY index_date_updated (index_date_updated)
+) engine=innodb;
+
+create table t2 (
+ index_id bigint(20) unsigned NOT NULL,
+ index_class varchar(265) COLLATE latin1_general_ci DEFAULT NULL ,
+ index_object_id int(10) unsigned NOT NULL DEFAULT '0' ,
+ index_date_updated int(10) unsigned DEFAULT NULL ,
+
+ PRIMARY KEY (index_id),
+ KEY index_date_updated (index_date_updated),
+ KEY object (index_class(181),index_object_id)
+) engine=innodb;
+
+insert into t1 select
+ @a:=A.a + 10*B.a + 100*C.a,
+ concat('val-', @a),
+ 123456,
+ A.a + 10*B.a
+from
+ t0 A, t0 B, t0 C;
+
+insert into t2 select * from t1;
+
+--echo # This must have the same query plan as the query below it:
+--echo # type=range, key=index_date_updated, key_len=13
+--replace_column 9 #
+explain
+select * from t1 force index(index_date_updated)
+where index_date_updated= 10 and index_id < 800;
+
+--echo # This used to work from the start:
+--replace_column 9 #
+explain
+select * from t2 force index(index_date_updated)
+where index_date_updated= 10 and index_id < 800;
+
+drop table t0,t1,t2;
+
+
+--echo #
+--echo # MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'
+--echo # was corrupted, server crashes in opt_sum_query
+
+set @save_innodb_file_format= @@innodb_file_format;
+set @save_innodb_large_prefix= @@innodb_large_prefix;
+set global innodb_file_format = BARRACUDA;
+set global innodb_large_prefix = ON;
+
+CREATE TABLE t1 (
+ pk INT,
+ f1 VARCHAR(3),
+ f2 VARCHAR(1024),
+ PRIMARY KEY (pk),
+ KEY(f2)
+) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
+
+INSERT INTO t1 VALUES (1,'foo','abc'),(2,'bar','def');
+SELECT MAX(t2.pk) FROM t1 t2 INNER JOIN t1 t3 ON t2.f1 = t3.f1 WHERE t2.pk <= 4;
+drop table t1;
+
+CREATE TABLE t1 (
+ pk1 INT,
+ pk2 INT,
+ f1 VARCHAR(3),
+ f2 VARCHAR(1021),
+ PRIMARY KEY (pk1,pk2),
+ KEY(f2)
+) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
+
+INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
+explain format= json
+select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3';
+drop table t1;
+
+CREATE TABLE t1 (
+f2 INT,
+pk2 INT,
+f1 VARCHAR(3),
+pk1 VARCHAR(1000),
+PRIMARY KEY (pk1,pk2),
+KEY k1(pk1,f2)
+) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
+INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
+explain format= json
+select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3';
+drop table t1;
+
set optimizer_switch=@save_ext_key_optimizer_switch;
+set global innodb_file_format = @save_innodb_file_format;
+set global innodb_large_prefix = @save_innodb_large_prefix;
SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/t/innodb_group.test b/mysql-test/t/innodb_group.test
new file mode 100644
index 00000000000..56c8d54003e
--- /dev/null
+++ b/mysql-test/t/innodb_group.test
@@ -0,0 +1,22 @@
+#
+# Tests involving GROUP BY, aggregate functions and InnoDB
+#
+
+
+--source include/have_innodb.inc
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-10556 Assertion `0' failed in virtual void Item_sum_field::set_result_field(Field*)
+--echo #
+
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+SELECT DISTINCT STDDEV(1) FROM t1 GROUP BY i ORDER BY BENCHMARK(0, BIT_XOR(i));
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/innodb_load_xa.opt b/mysql-test/t/innodb_load_xa.opt
index 4ff27e659ce..9e9ea9a1600 100644
--- a/mysql-test/t/innodb_load_xa.opt
+++ b/mysql-test/t/innodb_load_xa.opt
@@ -1 +1 @@
---ignore-builtin-innodb --loose-innodb --log-bin
+--ignore-builtin-innodb --loose-innodb
diff --git a/mysql-test/t/innodb_load_xa.test b/mysql-test/t/innodb_load_xa.test
index 9ecddde5d13..65b74120e8e 100644
--- a/mysql-test/t/innodb_load_xa.test
+++ b/mysql-test/t/innodb_load_xa.test
@@ -3,6 +3,10 @@
#
--source include/not_embedded.inc
+# this test needs exactly one (1) XA-capable engine running initially.
+# it's binlog "engine" in 10.0 but wsrep in here, because it cannot be disabled
+--source include/have_wsrep.inc
+
if (!$HA_INNODB_SO) {
--skip Need InnoDB plugin
}
@@ -13,7 +17,7 @@ start transaction;
insert t1 values (1);
insert t1 values (2);
commit;
---source include/show_binlog_events.inc
+show status like 'Handler_prepare';
drop table t1;
uninstall plugin innodb;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 9e84bf3ee5f..3092608f893 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -30,7 +30,7 @@ drop table t1;
# Test insert syntax
#
-create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int);
+create table t1 (a int not null auto_increment, primary key (a), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c char(10) default "hello", i int);
insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default);
select a,t>0,c,i from t1;
truncate table t1;
diff --git a/mysql-test/t/insert_notembedded.test b/mysql-test/t/insert_notembedded.test
index 4e5fe6f6755..713eaf5db40 100644
--- a/mysql-test/t/insert_notembedded.test
+++ b/mysql-test/t/insert_notembedded.test
@@ -1,5 +1,8 @@
-- source include/not_embedded.inc
+set local sql_mode="";
+set global sql_mode="";
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -188,3 +191,6 @@ disconnect select;
unlock tables;
drop table t1;
set low_priority_updates=default;
+
+set local sql_mode=default;
+set global sql_mode=default;
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index de38ae0b0d3..7234973eeb8 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -170,6 +170,7 @@ DROP TABLE t1,t2;
SET SQL_MODE = 'TRADITIONAL';
CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL);
+INSERT INTO t1 VALUES (1,1);
--error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1);
@@ -177,7 +178,10 @@ INSERT INTO t1 (a) VALUES (1);
--error ER_NO_DEFAULT_FOR_FIELD
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b;
---error ER_NO_DEFAULT_FOR_FIELD
+# this one is ok
+INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = a;
+
+# arguably the statement below should fail
INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b;
SELECT * FROM t1;
diff --git a/mysql-test/t/join_cache.test b/mysql-test/t/join_cache.test
index 8507d58eecd..ee3e324cd80 100644
--- a/mysql-test/t/join_cache.test
+++ b/mysql-test/t/join_cache.test
@@ -2505,6 +2505,18 @@ SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
+# MDEV-8189 field<>const and const<>field are not symmetric
+# Do the same EXPLAIN and SELECT
+# for "t2.v <> t3.v" instead of "t3.v <> t2.v"
+
+EXPLAIN
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+ GROUP BY t2.v ORDER BY t1.pk,t2.v;
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+ GROUP BY t2.v ORDER BY t1.pk,t2.v;
+
SET SESSION join_cache_level=6;
EXPLAIN
SELECT t2.v FROM t1, t2, t3
@@ -2514,6 +2526,17 @@ SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
+# MDEV-8189 field<>const and const<>field are not symmetric
+# Do the same EXPLAIN and SELECT
+# for "t2.v <> t3.v" instead of "t3.v <> t2.v"
+EXPLAIN
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+ GROUP BY t2.v ORDER BY t1.pk,t2.v;
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+ GROUP BY t2.v ORDER BY t1.pk,t2.v;
+
SET SESSION join_cache_level=4;
EXPLAIN
SELECT t2.v FROM t1, t2, t3
@@ -2523,6 +2546,17 @@ SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
+# MDEV-8189 field<>const and const<>field are not symmetric
+# Do the same EXPLAIN and SELECT
+# for "t2.v <> t3.v" instead of "t3.v <> t2.v"
+EXPLAIN
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+ GROUP BY t2.v ORDER BY t1.pk,t2.v;
+SELECT t2.v FROM t1, t2, t3
+WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
+ GROUP BY t2.v ORDER BY t1.pk,t2.v;
+
DROP TABLE t1,t2,t3;
SET SESSION join_cache_level=DEFAULT;
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 896cc137e07..acbe19b5e87 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1800,6 +1800,87 @@ SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a
DROP TABLE t1,t2,t3;
+--echo #
+--echo # MDEV-6634: Wrong estimates for ref(const) and key IS NULL predicate
+--echo #
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, b int, c int, key(b), key(c));
+
+insert into t2 select
+ @a:=A.a + 10*B.a+100*C.a,
+ IF(@a<900, NULL, @a),
+ IF(@a<500, NULL, @a)
+from t1 A, t1 B, t1 C;
+
+delete from t1 where a=0;
+
+--echo # Check that there are different #rows of NULLs for b and c, both !=10:
+explain select * from t2 force index (b) where b is null;
+explain select * from t2 force index (c) where c is null;
+
+explain select * from t1 left join t2 on t2.b is null;
+explain select * from t1 left join t2 on t2.c is null;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause
+--echo #
+
+CREATE TABLE t1(i1 int primary key, v1 int, key(v1));
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (3, 3);
+INSERT INTO t1 VALUES (4, 4);
+INSERT INTO t1 VALUES (5, 3);
+INSERT INTO t1 VALUES (6, 6);
+INSERT INTO t1 VALUES (7, 7);
+INSERT INTO t1 VALUES (8, 8);
+INSERT INTO t1 VALUES (9, 9);
+
+CREATE TABLE t2(i2 int primary key, v2 int, key(v2));
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 3);
+INSERT INTO t2 VALUES (4, 4);
+INSERT INTO t2 VALUES (5, 3);
+INSERT INTO t2 VALUES (6, 6);
+INSERT INTO t2 VALUES (7, 7);
+INSERT INTO t2 VALUES (8, 8);
+INSERT INTO t2 VALUES (9, 9);
+
+CREATE TABLE t3(i3 int primary key, v3 int, key(v3));
+INSERT INTO t3 VALUES (2, 2);
+INSERT INTO t3 VALUES (4, 4);
+INSERT INTO t3 VALUES (6, 6);
+INSERT INTO t3 VALUES (8, 8);
+
+--echo # This should have a join order of t3,t1,t2 (or t3,t2,t1, the idea is that t3 is the first one)
+EXPLAIN EXTENDED
+SELECT * FROM
+ (SELECT t1.i1 as i1, t1.v1 as v1,
+ t2.i2 as i2, t2.v2 as v2,
+ t3.i3 as i3, t3.v3 as v3
+ FROM t1 JOIN t2 on t1.i1 = t2.i2
+ LEFT JOIN t3 on t2.i2 = t3.i3
+ ) as w1
+WHERE v3 = 4;
+
+--echo # This should have the same join order like the query above:
+EXPLAIN EXTENDED
+SELECT * FROM
+ (SELECT t1.i1 as i1, t1.v1 as v1,
+ t2.i2 as i2, t2.v2 as v2,
+ t3.i3 as i3, t3.v3 as v3
+ FROM t1 JOIN t2 on t1.i1 = t2.i2
+ LEFT JOIN t3 on t2.i2 = t3.i3
+ WHERE t1.i1 = t2.i2
+ AND 1 = 1
+ ) as w2
+WHERE v3 = 4;
+
+drop table t1,t2,t3;
--echo #
--echo # MDEV-11958: LEFT JOIN with stored routine produces incorrect result
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 355c5ef53a4..e2697effeb6 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -395,7 +395,7 @@ create table t1 (
c1 int,
c2 char(12),
c3 varchar(123),
- c4 timestamp,
+ c4 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
index (c1),
index i1 (c1),
index i2 (c2),
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index 06933bcb0b9..aaf931a2e7f 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -10,6 +10,8 @@
-- source include/not_embedded.inc
-- source include/have_debug_sync.inc
-- source include/not_threadpool.inc
+set local sql_mode="";
+set global sql_mode="";
--disable_warnings
SET DEBUG_SYNC = 'RESET';
@@ -70,7 +72,7 @@ connection con2;
SELECT 4;
connection default;
---error ER_NOT_SUPPORTED_YET
+--error ER_SUBQUERIES_NOT_SUPPORTED
KILL (SELECT COUNT(*) FROM mysql.user);
connection con1;
@@ -647,5 +649,33 @@ reap;
--error ER_NO_SUCH_QUERY
KILL QUERY ID 0;
+--echo #
+--echo # MDEV-5096 - Wrong error message on attempt to kill somebody else's
+--echo # query ID
+--echo #
+CREATE USER u1@localhost;
+send SELECT SLEEP(1000);
+
+connection con1;
+let $wait_condition= SELECT @id:=QUERY_ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO='SELECT SLEEP(1000)';
+source include/wait_condition.inc;
+let $id= `SELECT @id`;
+
+connect(con5, localhost, u1,,);
+--replace_result $id ID
+--error ER_KILL_QUERY_DENIED_ERROR
+eval KILL QUERY ID $id;
+
+connection con1;
+KILL QUERY ID @id;
+
+connection default;
+reap;
+disconnect con5;
+DROP USER u1@localhost;
+
+
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
+
+set global sql_mode=default;
diff --git a/mysql-test/t/loadxml.test b/mysql-test/t/loadxml.test
index 93e6e82189f..0bd97a81649 100644
--- a/mysql-test/t/loadxml.test
+++ b/mysql-test/t/loadxml.test
@@ -130,3 +130,16 @@ CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER);
LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY col1, col2, col3;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-12696 Crash with LOAD XML and non-updatable VIEW column
+--echo #
+
+CREATE TABLE t1 (c1 TEXT);
+CREATE VIEW v1 AS SELECT CONCAT(c1,'') AS c1, NULL AS c2 FROM t1;
+--error ER_NONUPDATEABLE_COLUMN
+LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c1);
+--error ER_NONUPDATEABLE_COLUMN
+LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c2);
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 753b6bd6379..efd0fe5d630 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -324,9 +324,11 @@ DROP DATABASE mysqltest_1;
#
connection locker;
# Disable warnings to allow test to run also without InnoDB
+set sql_mode="";
--disable_warnings
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
--enable_warnings
+set sql_mode=default;
lock tables t1 write;
connection writer;
send
diff --git a/mysql-test/t/lock_sync-master.opt b/mysql-test/t/lock_sync-master.opt
index 96f0ce3f36c..a6700b8d18e 100644
--- a/mysql-test/t/lock_sync-master.opt
+++ b/mysql-test/t/lock_sync-master.opt
@@ -1 +1,2 @@
--default-storage-engine=MyISAM
+--innodb-defragment=0
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index 3231769a4bf..12c7a7fd92b 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -52,12 +52,18 @@ select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
connection default;
set global slow_query_log= ON;
+set local slow_query_log= ON;
--echo # Switch to connection con1
connection con1;
set session long_query_time = @long_query_time;
select sleep(@long_query_time + 1);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME 12 THREAD_ID
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+set local slow_query_log= ON;
+select sleep(@long_query_time + 2);
+--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME 12 THREAD_ID
+select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+
--echo # Switch to connection default
connection default;
show global variables
@@ -69,6 +75,7 @@ set global general_log= OFF;
set global slow_query_log= ON;
set global slow_query_log= OFF;
set global slow_query_log= OFF;
+set local slow_query_log= ON;
set global general_log= ON;
truncate table mysql.general_log;
@@ -127,6 +134,7 @@ set global general_log_file= default;
set global slow_query_log_file= default;
show variables like 'general_log';
show variables like 'slow_query_log';
+show global variables like 'slow_query_log';
set global general_log=ON;
set global log_output=default;
show variables like 'log_output';
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index 6fd26ab2011..a4158ba6a24 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -6,6 +6,7 @@
# check that CSV engine was compiled in
--source include/have_csv.inc
+SET SQL_MODE="";
SET @old_general_log_state = @@global.general_log;
SET @old_log_output= @@global.log_output;
SET @old_slow_query_log= @@global.slow_query_log;
@@ -265,8 +266,6 @@ alter table mysql.slow_log engine=NonExistentEngine;
--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=memory;
#--error ER_UNSUPORTED_LOG_ENGINE
-#alter table mysql.slow_log engine=ndb;
-#--error ER_UNSUPORTED_LOG_ENGINE
#alter table mysql.slow_log engine=innodb;
#--error ER_UNSUPORTED_LOG_ENGINE
#alter table mysql.slow_log engine=archive;
@@ -311,7 +310,8 @@ CREATE TABLE `slow_log` (
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
- `thread_id` BIGINT(21) UNSIGNED NOT NULL
+ `thread_id` BIGINT(21) UNSIGNED NOT NULL,
+ `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
set global general_log='ON';
@@ -728,7 +728,8 @@ CREATE TABLE `db_17876.slow_log_data` (
`insert_id` int(11) default NULL,
`server_id` int(11) default NULL,
`sql_text` mediumtext,
- `thread_id` bigint(21) unsigned default NULL
+ `thread_id` bigint(21) unsigned default NULL,
+ `rows_affected` int(11) default NULL
);
CREATE TABLE `db_17876.general_log_data` (
@@ -746,7 +747,7 @@ CREATE procedure `db_17876.archiveSlowLog`()
BEGIN
DECLARE start_time, query_time, lock_time CHAR(28);
DECLARE user_host MEDIUMTEXT;
- DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT;
+ DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id, rows_affected INT;
DECLARE thread_id BIGINT UNSIGNED;
DECLARE dbname MEDIUMTEXT;
DECLARE sql_text BLOB;
@@ -765,7 +766,7 @@ BEGIN
FETCH cur1 INTO
start_time, user_host, query_time, lock_time,
rows_set, rows_examined, dbname, last_insert_id,
- insert_id, server_id, sql_text, thread_id;
+ insert_id, server_id, sql_text, thread_id, rows_affected;
END;
IF NOT done THEN
@@ -773,7 +774,8 @@ BEGIN
INSERT INTO
`db_17876.slow_log_data`
VALUES(start_time, user_host, query_time, lock_time, rows_set, rows_examined,
- dbname, last_insert_id, insert_id, server_id, sql_text, thread_id);
+ dbname, last_insert_id, insert_id, server_id, sql_text, thread_id,
+ rows_affected);
END;
END IF;
END;
diff --git a/mysql-test/t/log_tables_upgrade.test b/mysql-test/t/log_tables_upgrade.test
index d08d74174db..36802fb38ad 100644
--- a/mysql-test/t/log_tables_upgrade.test
+++ b/mysql-test/t/log_tables_upgrade.test
@@ -24,4 +24,5 @@ RENAME TABLE test.bug49823 TO general_log;
DROP TABLE general_log;
RENAME TABLE renamed_general_log TO general_log;
SET GLOBAL general_log = @saved_general_log;
+remove_file $MYSQLD_DATADIR/mysql_upgrade_info;
USE test;
diff --git a/mysql-test/t/long_tmpdir-master.sh b/mysql-test/t/long_tmpdir-master.sh
index 7bcbee26105..318955fbcca 100755..100644
--- a/mysql-test/t/long_tmpdir-master.sh
+++ b/mysql-test/t/long_tmpdir-master.sh
@@ -1,4 +1,3 @@
-#!/bin/sh
d="$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789"
test -d "$d" || mkdir "$d"
rm -f "$d"/*
diff --git a/mysql-test/t/lowercase_fs_off.test b/mysql-test/t/lowercase_fs_off.test
index 01989ef5367..b8a9795db9a 100644
--- a/mysql-test/t/lowercase_fs_off.test
+++ b/mysql-test/t/lowercase_fs_off.test
@@ -5,6 +5,8 @@
-- source include/have_case_sensitive_file_system.inc
-- source include/not_embedded.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
connect (master,localhost,root,,);
connection master;
create database d1;
@@ -110,3 +112,5 @@ create table t1 (a int);
create trigger t1_bi before insert on t1 for each row set new.a= 1;
show triggers like '%T1%';
drop table t1;
+
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/t/lowercase_fs_on.test b/mysql-test/t/lowercase_fs_on.test
index 6da3ef32a0b..1d306826e27 100644
--- a/mysql-test/t/lowercase_fs_on.test
+++ b/mysql-test/t/lowercase_fs_on.test
@@ -26,7 +26,7 @@ let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
--exec $MYSQLD_CMD --lower_case_table_names=0 > $SEARCH_FILE 2>&1
#Search for the error messege in the server error log.
-let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination\. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode\.;
+let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names;
--source include/search_pattern_in_file.inc
#Restart the server
diff --git a/mysql-test/t/lowercase_mixed_tmpdir-master.sh b/mysql-test/t/lowercase_mixed_tmpdir-master.sh
index 9330d0581ee..95c26e3aa02 100755..100644
--- a/mysql-test/t/lowercase_mixed_tmpdir-master.sh
+++ b/mysql-test/t/lowercase_mixed_tmpdir-master.sh
@@ -1,4 +1,3 @@
-#!/bin/sh
# This test requires a non-lowercase tmpdir directory on a case-sensitive
# filesystem.
diff --git a/mysql-test/t/lowercase_table4.test b/mysql-test/t/lowercase_table4.test
index 435ff0dae66..981c8a14564 100644
--- a/mysql-test/t/lowercase_table4.test
+++ b/mysql-test/t/lowercase_table4.test
@@ -8,6 +8,8 @@
CREATE DATABASE XY;
USE XY;
+set @old_table_open_cache=@@table_open_cache;
+set global table_open_cache = 512;
#
# Logs are disabled, since the number of creates tables
@@ -52,6 +54,7 @@ eval SELECT * FROM XY.T_$tcs LIMIT 1;
--enable_query_log
--enable_result_log
+set global table_open_cache = @old_table_open_cache;
DROP DATABASE XY;
USE TEST;
diff --git a/mysql-test/t/lowercase_table_grant.test b/mysql-test/t/lowercase_table_grant.test
index 7449231fca5..2f98f570e29 100644
--- a/mysql-test/t/lowercase_table_grant.test
+++ b/mysql-test/t/lowercase_table_grant.test
@@ -3,6 +3,7 @@
# Test of grants when lower_case_table_names is on
use mysql;
+set sql_mode="";
# mixed-case database name for testing
create database MYSQLtest;
diff --git a/mysql-test/t/lowercase_table_qcache.test b/mysql-test/t/lowercase_table_qcache.test
index e63ad3b2c16..ab05755bec1 100644
--- a/mysql-test/t/lowercase_table_qcache.test
+++ b/mysql-test/t/lowercase_table_qcache.test
@@ -3,6 +3,8 @@
# Test of query cache with --lower-case-table-names
#
set GLOBAL query_cache_size=1355776;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
--disable_warnings
drop database if exists MySQLtesT;
@@ -26,6 +28,7 @@ select * from MySQL.db;
enable_result_log;
show status like "Qcache_queries_in_cache";
-set GLOBAL query_cache_size=0;
+set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=default;
# End of 4.1 tests
diff --git a/mysql-test/t/max_statement_time.test b/mysql-test/t/max_statement_time.test
new file mode 100644
index 00000000000..0882daff139
--- /dev/null
+++ b/mysql-test/t/max_statement_time.test
@@ -0,0 +1,228 @@
+#
+# Test behavior of MAX_STATEMENT_TIME.
+# We can't do this under valgrind as valgrind interferes with thread scheduling
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/not_valgrind.inc
+
+--echo
+--echo # Test the MAX_STATEMENT_TIME option.
+--echo
+
+SET @@MAX_STATEMENT_TIME=2;
+select @@max_statement_time;
+SELECT SLEEP(1);
+SELECT SLEEP(3);
+SET @@MAX_STATEMENT_TIME=0;
+SELECT SLEEP(1);
+SHOW STATUS LIKE "max_statement_time_exceeded";
+
+CREATE TABLE t1 (a INT, b VARCHAR(300)) engine=myisam;
+
+INSERT INTO t1 VALUES (1, 'string');
+
+--disable_result_log
+--disable_query_log
+
+SET @@MAX_STATEMENT_TIME=2;
+
+SET @@MAX_STATEMENT_TIME=0.1;
+WHILE (! $mysql_errno)
+{
+ SET @@MAX_STATEMENT_TIME=0;
+ INSERT INTO t1 SELECT * FROM t1;
+ SET @@MAX_STATEMENT_TIME=0.1;
+ --error 0,ER_STATEMENT_TIMEOUT
+ SELECT COUNT(*) FROM t1 WHERE b LIKE '%z%';
+}
+SET @@MAX_STATEMENT_TIME=0;
+
+--enable_query_log
+--enable_result_log
+
+eval SELECT $mysql_errno;
+
+--echo
+--echo # Test the MAX_STATEMENT_TIME option with SF (should have no effect).
+--echo
+
+DELIMITER |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ declare tmp int;
+ SET @@MAX_STATEMENT_TIME=0.0001;
+ SELECT COUNT(*) INTO tmp FROM t1 WHERE b LIKE '%z%';
+ SET @@MAX_STATEMENT_TIME=0;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SET @@MAX_STATEMENT_TIME=5;
+END|
+
+DELIMITER ;|
+
+SELECT @@MAX_STATEMENT_TIME;
+CALL p1();
+CALL p2();
+SELECT @@MAX_STATEMENT_TIME;
+SET @@MAX_STATEMENT_TIME=0;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+--echo
+--echo # MAX_STATEMENT_TIME account resource
+--echo
+
+set statement sql_mode="" for
+GRANT USAGE ON *.* TO user1@localhost WITH MAX_STATEMENT_TIME 1.005;
+
+--echo # con1
+connect(con1,localhost,user1,,test,,);
+SELECT @@max_statement_time;
+disconnect con1;
+
+--echo # restart and reconnect
+connection default;
+source include/restart_mysqld.inc;
+
+set @global.userstat=1;
+connect(con1,localhost,user1,,test,,);
+SELECT @@global.max_statement_time,@@session.max_statement_time;
+select sleep(100);
+SHOW STATUS LIKE "max_statement_time_exceeded";
+disconnect con1;
+
+connection default;
+show grants for user1@localhost;
+--disable_parsing
+select max_user_timeouts from information_schema.user_statistics where user="user1";
+--enable_parsing
+
+set @global.userstat=0;
+DROP USER user1@localhost;
+
+--echo
+--echo # MAX_STATEMENT_TIME status variables.
+--echo
+
+flush status;
+
+SET @@max_statement_time=0;
+SELECT CONVERT(VARIABLE_VALUE, UNSIGNED) INTO @time_exceeded
+ FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+ WHERE VARIABLE_NAME = 'max_statement_time_exceeded';
+
+SET @@max_statement_time=0.5;
+SELECT SLEEP(2);
+SHOW STATUS LIKE '%timeout%';
+SET @@max_statement_time=0;
+
+--echo # Ensure that the counters for:
+--echo # - statements that exceeded their maximum execution time
+--echo # are incremented.
+
+SELECT 1 AS STATUS FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+ WHERE VARIABLE_NAME = 'max_statement_time_exceeded'
+ AND CONVERT(VARIABLE_VALUE, UNSIGNED) > @time_exceeded;
+
+--echo
+--echo # Check that the appropriate error status is set.
+--echo
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+START TRANSACTION;
+SELECT * FROM t1 FOR UPDATE;
+
+connect (con1,localhost,root,,test,,);
+SET @@SESSION.max_statement_time = 0.5;
+--error ER_STATEMENT_TIMEOUT
+UPDATE t1 SET a = 2;
+SHOW WARNINGS;
+disconnect con1;
+
+connection default;
+ROLLBACK;
+DROP TABLE t1;
+
+--echo
+--echo # Test interaction with lock waits.
+--echo
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+connect (con1,localhost,root,,test,,);
+SET @@SESSION.max_statement_time= 0.5;
+
+connection default;
+LOCK TABLES t1 WRITE;
+
+connection con1;
+SELECT @@SESSION.max_statement_time;
+--error ER_STATEMENT_TIMEOUT
+LOCK TABLES t1 READ;
+
+connection default;
+UNLOCK TABLES;
+BEGIN;
+SELECT * FROM t1;
+
+connection con1;
+--error ER_STATEMENT_TIMEOUT
+ALTER TABLE t1 ADD COLUMN b INT;
+
+connection default;
+ROLLBACK;
+SELECT GET_LOCK('lock', 1);
+
+connection con1;
+SELECT GET_LOCK('lock', 1);
+
+disconnect con1;
+connection default;
+SELECT RELEASE_LOCK('lock');
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-7011:MAX_STATEMENT_TIME has no effect in a procedure after
+--echo # a previous successful statement
+--echo #
+create table t1 (i int);
+insert into t1 values (1),(2),(3),(4);
+insert into t1 select a.* from t1 a, t1 b, t1 c, t1 d, t1 e, t1 f, t1 g;
+delimiter |;
+create procedure pr()
+ begin
+ select 1;
+ select sql_no_cache * from t1 where i > 5;
+ select sql_no_cache * from t1 where i > 5;
+ select sleep(2);
+ end |
+delimiter ;|
+set max_statement_time = 0.001;
+--error ER_STATEMENT_TIMEOUT
+call pr();
+set max_statement_time = 0;
+drop procedure pr;
+delimiter |;
+create procedure pr()
+ begin
+ select sql_no_cache * from t1 where i > 5;
+ select sql_no_cache * from t1 where i > 5;
+ select sleep(2);
+ end |
+delimiter ;|
+set max_statement_time = 0.001;
+--error ER_STATEMENT_TIMEOUT
+call pr();
+set max_statement_time = 0;
+drop procedure pr;
+drop table t1;
diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test
index 8e809788a08..c479c2a4854 100644
--- a/mysql-test/t/mdl_sync.test
+++ b/mysql-test/t/mdl_sync.test
@@ -4806,6 +4806,30 @@ disconnect con2;
disconnect con3;
+--echo #
+--echo # MDEV-12620 - set lock_wait_timeout = 1;flush tables with read lock;
+--echo # lock not released after timeout
+--echo #
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+SET debug_sync='open_tables_after_open_and_process_table SIGNAL ready WAIT_FOR go';
+send SELECT * FROM t1;
+
+connect (con1,localhost,root,,);
+SET debug_sync='now WAIT_FOR ready';
+# lock_wait_timeout should be 0 in 10.3, so that we don't have to wait at all
+SET lock_wait_timeout=1;
+--error ER_LOCK_WAIT_TIMEOUT
+FLUSH TABLES WITH READ LOCK;
+SET debug_sync='now SIGNAL go';
+
+connection default;
+reap;
+SET debug_sync='RESET';
+DROP TABLE t1;
+
+disconnect con1;
+
+
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 311eb6f12f3..d2f4ce0e44a 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1895,13 +1895,14 @@ DROP TABLE t1;
--disable_warnings
drop table if exists t_parent;
--enable_warnings
-set @save_table_definition_cache=@@global.table_definition_cache;
+set @save_table_open_cache=@@global.table_open_cache;
--echo #
---echo # Set @@global.table_definition_cache to minimum
+--echo # Set @@global.table_open_cache to minimum
--echo #
-set @@global.table_definition_cache=400;
+set @@global.table_open_cache=400;
+select @@table_open_cache;
set @a=null;
-let $1 = 400;
+let $1 = `select @@table_open_cache;`;
--echo #
--echo # Create 400 merge children
--echo #
@@ -1935,7 +1936,7 @@ deallocate prepare stmt;
--echo #
--echo # Cleanup
--echo #
-let $1 = 400;
+let $1 = `select @@table_open_cache;`;
--disable_query_log
while ($1)
{
@@ -1944,7 +1945,7 @@ while ($1)
}
--enable_query_log
drop table t_parent;
-set @@global.table_definition_cache=@save_table_definition_cache;
+set @@global.table_open_cache=@save_table_open_cache;
#
# WL#4144 - Lock MERGE engine children
diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test
index a859f39e51d..f5ed65cf7e2 100644
--- a/mysql-test/t/metadata.test
+++ b/mysql-test/t/metadata.test
@@ -15,7 +15,7 @@ drop table if exists t1,t2;
select 1, 1.0, -1, "hello", NULL;
-create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
+create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, l datetime, m enum('a','b'), n set('a','b'), o char(10));
select * from t1;
select a b, b c from t1 as t2;
drop table t1;
@@ -176,7 +176,7 @@ dcol_uns double unsigned,
# date/time types
date_col date,
time_col time,
-timestamp_col timestamp,
+timestamp_col timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
year_col year,
datetime_col datetime,
# string types
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 04611fef7dc..0297280340d 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -195,8 +195,8 @@ UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
set sql_safe_updates=0;
drop table t1,t2;
set timestamp=1038401397;
-create table t1 (n int(10) not null primary key, d int(10), t timestamp);
-create table t2 (n int(10) not null primary key, d int(10), t timestamp);
+create table t1 (n int(10) not null primary key, d int(10), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+create table t2 (n int(10) not null primary key, d int(10), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values(1,1,NULL);
insert into t2 values(1,10,NULL),(2,20,NULL);
set timestamp=1038000000;
@@ -378,6 +378,7 @@ create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key (a));
create table mysqltest.t2 (a int, b int, primary key (a));
create table mysqltest.t3 (a int, b int, primary key (a));
+create user mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
grant update on mysqltest.t1 to mysqltest_1@localhost;
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
diff --git a/mysql-test/t/myisam-optimize.test b/mysql-test/t/myisam-optimize.test
new file mode 100644
index 00000000000..7c1fe4ec1c8
--- /dev/null
+++ b/mysql-test/t/myisam-optimize.test
@@ -0,0 +1,58 @@
+--echo #
+--echo # MDEV-8475 stale .TMM file causes Aria engine to stop serving the table
+--echo #
+create table t1 (pk int primary key, i int) engine=MyISAM;
+insert into t1 values (1,1),(2,2);
+--let $datadir=`SELECT @@datadir`
+
+--write_file $datadir/test/t1.TMM
+EOF
+
+--connect (con1,localhost,root,,)
+SHOW CREATE TABLE t1;
+OPTIMIZE TABLE t1;
+--disconnect con1
+
+--connect (con1,localhost,root,,)
+SHOW CREATE TABLE t1;
+OPTIMIZE TABLE t1;
+--disconnect con1
+
+--connect (con1,localhost,root,,)
+SHOW CREATE TABLE t1;
+OPTIMIZE TABLE t1;
+--disconnect con1
+
+# Cleanup
+--connection default
+DROP TABLE t1;
+
+#
+# Test also Aria
+#
+
+create table t1 (pk int primary key, i int) engine=aria;
+insert into t1 values (1,1),(2,2);
+--let $datadir=`SELECT @@datadir`
+
+--write_file $datadir/test/t1.TMM
+EOF
+
+--connect (con1,localhost,root,,)
+SHOW CREATE TABLE t1;
+OPTIMIZE TABLE t1;
+--disconnect con1
+
+--connect (con1,localhost,root,,)
+SHOW CREATE TABLE t1;
+OPTIMIZE TABLE t1;
+--disconnect con1
+
+--connect (con1,localhost,root,,)
+SHOW CREATE TABLE t1;
+OPTIMIZE TABLE t1;
+--disconnect con1
+
+# Cleanup
+--connection default
+DROP TABLE t1;
diff --git a/mysql-test/t/myisam_recover-master.opt b/mysql-test/t/myisam_recover-master.opt
index 875a25ad513..fca5ea079e3 100644
--- a/mysql-test/t/myisam_recover-master.opt
+++ b/mysql-test/t/myisam_recover-master.opt
@@ -1 +1 @@
---myisam-recover=force
+--myisam-recover-options=force
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 4403a9d668f..300695612fd 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -4,6 +4,8 @@
#
# Testing the MySQL command line client(mysql)
#
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
--disable_warnings
drop table if exists t1,t2,t3;
@@ -616,6 +618,31 @@ EOF
#
--exec $MYSQL -t -N -e "SELECT 'a' union select 'aaaaaaaaaaaaaaaaa'"
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database
+--echo #
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
+
+--error 1
+--exec $MYSQL --default-character-set=utf8 -e "select 1" "test😠" 2>&1
+--error 1
+--exec $MYSQL --default-character-set=binary -e "select 1" "test😠" 2>&1
+--write_file $MYSQLTEST_VARDIR/tmp/mdev-6572.sql
+SET NAMES utf8;
+USE test😠;
+EOF
+--error 1
+--exec $MYSQL --default-character-set=utf8 < $MYSQLTEST_VARDIR/tmp/mdev-6572.sql 2>&1
+--remove_file $MYSQLTEST_VARDIR/tmp/mdev-6572.sql
+
+set GLOBAL sql_mode=default;
--echo
--echo End of tests
diff --git a/mysql-test/t/mysql_comments.test b/mysql-test/t/mysql_comments.test
index 1f997aeb1ab..7b00f17e259 100644
--- a/mysql-test/t/mysql_comments.test
+++ b/mysql-test/t/mysql_comments.test
@@ -10,6 +10,8 @@
# #
########################################################################
+set global sql_mode="";
+
#
# Bug #11230: Keeping comments when storing stored procedures
#
@@ -34,4 +36,6 @@ drop trigger if exists t1_bi;
--echo "Pass 2 : --enable-comments"
--exec $MYSQL --enable-comments test 2>&1 < "./t/mysql_comments.sql"
+
+set global sql_mode=default;
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysql_plugin.test b/mysql-test/t/mysql_plugin.test
deleted file mode 100644
index 10bc03e0f06..00000000000
--- a/mysql-test/t/mysql_plugin.test
+++ /dev/null
@@ -1,368 +0,0 @@
-#
-# Test mysql_plugin tool
-#
-# This test contains test cases for testing the mysql_plugin client with
-# the daemon_example plugin. Test cases include tests for:
-#
-# - successful enable/disable
-# - incorrect paths
-# - missing paths/options
-#
-# Implementation Notes
-#
-# The mysql_plugin tool now accepts --mysqld the path to mysqld server. The
-# mysqld path is extracted from MYSQLD_BOOTSTRAP_CMD line. We also extract
-# the path of MYSQLD_BASEDIR (where mysql exists) and use it for the errmsg
-# file. The directories differ between Windows and Unix but the Perl script
-# included below will pick as per platform.
-#
-# The test is also designed to issue the --skip directive if the location of
-# the mysqld, my_print_defaults, or daemon_example.ini files cannot be found.
-#
-
---source include/not_embedded.inc
-
-# Add the datadir, basedir, plugin_dir to the bootstrap command
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $MYSQL_BASEDIR= `select @@basedir`;
-let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`;
-let $PLUGIN_DIR=`select @@plugin_dir`;
-
---disable_abort_on_error
-
-# Perl script to extract the location of the basedir from environment
-# variables. This is needed to ensure the test will run on the PB machines
-# designed to test release as well as debug builds. It also checks for the
-# location of the my_print_defaults and daemon_example.ini files.
-
-perl;
-use File::Basename;
- my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
- my $mysqld_basedir=dirname($mysqld);
- my $my_print_defaults= $ENV{MYSQL_MY_PRINT_DEFAULTS};
- my $my_print_defaults_basedir=dirname($my_print_defaults);
- my $daemonexample_ini= "$ENV{DAEMONEXAMPLE_DIR}/daemon_example.ini";
- my $plugindir_ini= "$ENV{PLUGIN_DIR}/daemon_example.ini";
- my $notfound= "";
- open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
- print FILE "let \$MYSQLD_BASEDIR= $mysqld_basedir;\n";
- print FILE "let \$MYSQL_MY_PRINT_DEFAULTS_BASEDIR= $my_print_defaults_basedir;\n";
- if ((!-e $daemonexample_ini) || (!-r $daemonexample_ini))
- {
- print FILE "let \$DAEMONEXAMPLE_DIR= $not_found;\n";
- }
- if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
- {
- print FILE "let \$PLUGIN_DIR= $not_found;\n";
- }
- close FILE;
-EOF
-
-
-source $MYSQL_TMP_DIR/mysqld.inc;
-remove_file $MYSQL_TMP_DIR/mysqld.inc;
-
-# The mysql_plugin tool expects a directory structure like in the installed
-# mysql version, so errmsg.sys will be copied to "basedir/share", we create
-# and remove this structure.
-
---mkdir $MYSQLD_BASEDIR/share
---mkdir $MYSQLD_BASEDIR/share/mysql
---copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
---copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/mysql/errmsg.sys
-
-# The mysql_plugin tool now accepts --my-print-defaults which points to the
-# executable my_print_defaults.exe we can get this path from the variable
-# $MYSQL_MY_PRINT_DEFAULTS.
-
-# Check for my_print_defaults location. Skip if not found.
-if ($MYSQL_MY_PRINT_DEFAULTS_BASEDIR == '')
-{
- --skip Test requires known location of my_print_defaults executable.
-}
-
-# Check for mysqld location. Skip if not found.
-if ($MYSQLD == '')
-{
- --skip Test requires known location of mysqld executable.
-}
-
-# Check for daemon_example.ini location. Skip if not found in either
-# the plugin_dir path or the daemon_example_dir path.
-if ($PLUGIN_DIR == '')
-{
- if ($DAEMONEXAMPLE_DIR == '')
- {
- --skip Test requires known location of daemon_example.ini file.
- }
- let $PLUGIN_DIR = $DAEMONEXAMPLE_DIR;
-}
-
-# Build client command for reuse.
-
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
-
---echo #
---echo # Ensure the plugin isn't loaded.
---echo #
-SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
-
---echo #
---echo # Enable the plugin...
---echo #
-
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---shutdown_server 10
---source include/wait_until_disconnected.inc
-
-#
-# Enable the plugin
-#
---exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
-
-#
-# Ensure enabling an enabled plugin doesn't fail
---exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
-
-#
-# Restart the server
-#
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
-
---echo #
---echo # Simulate loading a plugin libary with multiple entry points.
---echo # This will test the DISABLE to ensure all rows are removed.
---echo #
---replace_regex /\.dll/.so/
-eval INSERT INTO mysql.plugin VALUES ('wicky', '$DAEMONEXAMPLE');
---replace_regex /\.dll/.so/
-eval INSERT INTO mysql.plugin VALUES ('wacky', '$DAEMONEXAMPLE');
---replace_regex /\.dll/.so/
-eval INSERT INTO mysql.plugin VALUES ('wonky', '$DAEMONEXAMPLE');
-
---echo #
---echo # Ensure the plugin is now loaded.
---echo #
---replace_regex /\.dll/.so/
-SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
-
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---shutdown_server 10
---source include/wait_until_disconnected.inc
-
-#
-# Disable the plugin - to remove winky, wonky entries
-#
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example
-
-#
-# Enable the plugin again
-#
---exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
-
-#
-# Restart the server
-#
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
-
---echo #
---echo # Ensure the plugin is loaded.
---echo #
---replace_regex /\.dll/.so/
-SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
-
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---shutdown_server 10
---source include/wait_until_disconnected.inc
-
-# To test the case where the same plugin is reloaded with a different soname,
-# we must copy the example daemon to a new location renaming it.
-
-let $DAEMON_RELOAD = lib$DAEMONEXAMPLE;
---copy_file $PLUGIN_DIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD
---copy_file include/libdaemon_example.ini $PLUGIN_DIR/libdaemon_example.ini
-
-# Now reload it and see that it is a different name.
---exec $MYSQL_PLUGIN_CMD ENABLE libdaemon_example
-
-#
-# Restart the server
-#
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
-
---echo #
---echo # Ensure the plugin is replaced.
---echo #
---replace_regex /\.dll/.so/
-SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
-
---echo #
---echo # Disable the plugin...
---echo #
-
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---shutdown_server 10
---source include/wait_until_disconnected.inc
-
-#
-# Disable the plugin
-#
---exec $MYSQL_PLUGIN_CMD DISABLE libdaemon_example
-
-# Remove files for last test case.
-
---remove_file $PLUGIN_DIR/$DAEMON_RELOAD
---remove_file $DAEMONEXAMPLE_DIR/libdaemon_example.ini
-
-#
-# Restart the server
-#
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
-
---echo #
---echo # Ensure the plugin isn't loaded.
---echo #
-SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
-
-#
-# Stop the server for error conditions
-#
-
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---shutdown_server 10
---source include/wait_until_disconnected.inc
-
---echo #
---echo # Attempt to load non-existant plugin
---echo #
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE NOT_THERE_AT_ALL 2>&1
-
---echo #
---echo # Attempt to use non-existant plugin.ini file
---echo #
---error 1,2,7,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example --plugin-ini=/NOT/THERE/pi.ini 2>&1
-
---echo #
---echo # Attempt to omit the plugin
---echo #
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE 2>&1
-
---echo #
---echo # Attempt to omit DISABLE|ENABLE
---echo #
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD daemon_example 2>&1
-
---echo #
---echo # Attempt to use bad paths - datadir
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=/data_not_there/ --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Attempt to use bad paths - basedir
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=/basedir_not_there/ --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
-replace_result "/basedir_not_there//" "/basedir_not_there/";
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Attempt to use bad paths - plugin_dir
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=/plugin_not_there/ --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Attempt to use bad paths - mysqld
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=/mysqld_not_there/ --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Attempt to use bad paths - my_print_defaults
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=/my_print_defaults_not_there/;
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
-
---echo #
---echo # Missing library
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_soname.ini --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Bad format for config file
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_format.ini --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Missing base_dir option
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,139,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Missing data_dir option
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,139,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Missing plugin_dir option
---echo #
-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQL_BASEDIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
---error 1,2,139,256
---exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
-
---echo #
---echo # Show the help.
---echo #
-replace_result $MYSQL_PLUGIN mysql_plugin;
---replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/
---exec $MYSQL_PLUGIN --help
-
-replace_result $MYSQL_PLUGIN mysql_plugin;
---replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/
---exec $MYSQL_PLUGIN --version
-
-#
-# Restart the server
-#
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-#
-# Cleanup
-
---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
-# Cleanup the share folder in the binary path.
---remove_file $MYSQLD_BASEDIR/share/errmsg.sys
---rmdir $MYSQLD_BASEDIR/share/mysql
---rmdir $MYSQLD_BASEDIR/share
-
---enable_abort_on_error
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index f8026df8770..681e47f778a 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -3,6 +3,8 @@
-- source include/have_innodb.inc
-- source include/have_partition.inc
+set sql_mode="";
+
#
# Basic test that we can run mysql_upgrde and that it finds the
# expected binaries it uses.
@@ -171,6 +173,7 @@ DROP PROCEDURE test.pr;
# MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 chars
#
use test;
+call mtr.add_suppression('Column last_update in table "mysql"."innodb_table_stats" is INT NOT NULL but should be');
alter table mysql.innodb_table_stats modify last_update int not null;
create table extralongname_extralongname_extralongname_extralongname_ext (
@@ -190,3 +193,29 @@ select length(table_name) from mysql.innodb_table_stats;
drop table extralongname_extralongname_extralongname_extralongname_ext;
--echo End of 10.0 tests
+
+set sql_mode=default;
+
+#
+# Enforce storage engine option should not effect mysql_upgrade
+#
+--echo # Droping the previously created mysql_upgrade_info file..
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+create table test.t1(a int) engine=MyISAM;
+--echo # Trying to enforce InnoDB for all tables
+SET GLOBAL enforce_storage_engine=InnoDB;
+
+--replace_result $MYSQLTEST_VARDIR var
+--exec $MYSQL_UPGRADE --force 2>&1
+
+--echo # Should return 2
+SELECT count(*) FROM information_schema.tables where ENGINE="InnoDB";
+SHOW CREATE TABLE test.t1;
+DROP TABLE test.t1;
+# mysql_upgrade must have created mysql_upgrade_info file,
+# so the following command should never fail.
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+SET GLOBAL enforce_storage_engine=NULL;
+
+--echo End of 10.1 tests
diff --git a/mysql-test/t/mysql_upgrade_noengine.test b/mysql-test/t/mysql_upgrade_noengine.test
new file mode 100644
index 00000000000..cfc3a1dc406
--- /dev/null
+++ b/mysql-test/t/mysql_upgrade_noengine.test
@@ -0,0 +1,57 @@
+#
+# MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not handling the situation
+#
+source include/have_innodb.inc;
+source include/not_embedded.inc;
+
+if (!$HA_BLACKHOLE_SO) {
+ skip Need blackhole plugin;
+}
+if (!$HA_ARCHIVE_SO) {
+ skip Need Archive plugin;
+}
+
+let $datadir= `select @@datadir`;
+
+install soname 'ha_blackhole';
+install soname 'ha_archive';
+
+vertical_results;
+create table t1 (a int) engine=blackhole;
+create table t2 (a int) engine=archive;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+
+flush tables;
+uninstall plugin blackhole;
+uninstall plugin archive;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+
+# upgrade from 10.1 - engines aren't enabled
+exec $MYSQL_UPGRADE 2>&1;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+
+# pretend it's an upgrade from 10.0
+alter table mysql.user drop column default_role, drop column max_statement_time;
+
+# but mysql_upgrade_info tells otherwise
+remove_file $datadir/mysql_upgrade_info;
+write_file $datadir/mysql_upgrade_info;
+10.1.10-MariaDB
+EOF
+
+# still upgrade from 10.1
+exec $MYSQL_UPGRADE 2>&1;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+
+alter table mysql.user drop column default_role, drop column max_statement_time;
+remove_file $datadir/mysql_upgrade_info;
+
+# upgrade from 10.0 - engines are enabled
+exec $MYSQL_UPGRADE 2>&1;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
+
+drop table t1, t2;
+
+remove_file $datadir/mysql_upgrade_info;
+uninstall plugin blackhole;
+uninstall plugin archive;
diff --git a/mysql-test/t/mysql_upgrade_ssl.test b/mysql-test/t/mysql_upgrade_ssl.test
index 9049bf73821..daf5fad3df7 100644
--- a/mysql-test/t/mysql_upgrade_ssl.test
+++ b/mysql-test/t/mysql_upgrade_ssl.test
@@ -8,4 +8,5 @@
--echo # Bug#55672 mysql_upgrade dies with internal error
--echo #
--exec $MYSQL_UPGRADE --skip-verbose --skip-silent --ssl --force 2>&1
---exit
+--let $datadir= `select @@datadir`
+--remove_file $datadir/mysql_upgrade_info
diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test
index c98c88f840e..6a496858d22 100644
--- a/mysql-test/t/mysql_upgrade_view.test
+++ b/mysql-test/t/mysql_upgrade_view.test
@@ -127,6 +127,7 @@ show create view v4;
--replace_result $MYSQLTEST_VARDIR var
--exec $MYSQL_UPGRADE --force 2>&1
+flush tables;
show create view v1;
show create view v2;
show create view v3;
@@ -182,5 +183,6 @@ flush tables;
# back to mariadb default
drop table mysql.event;
rename table mysql.ev_bk to mysql.event;
+remove_file $MYSQLD_DATADIR/mysql_upgrade_info;
drop view v1,v2,v3;
drop table t1;
diff --git a/mysql-test/t/mysqlbinlog-innodb.test b/mysql-test/t/mysqlbinlog-innodb.test
index 49702e8db38..c8bf8095705 100644
--- a/mysql-test/t/mysqlbinlog-innodb.test
+++ b/mysql-test/t/mysqlbinlog-innodb.test
@@ -1,7 +1,6 @@
-- source include/have_binlog_format_statement.inc
-- source include/have_log_bin.inc
-- source include/have_innodb.inc
-
#
# MBug#702303: Spurious `use` statements in output from mysqlbinlog --rewrite-db="a->b"
#
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 7e680702a7a..6988b2a8e9b 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -477,21 +477,6 @@ FLUSH LOGS;
# rollback;
# Transaction2 end
-# Test case3: Test if the 'BEGIN' and 'COMMIT' are output for the 'test' database
-# in transaction3 base on NDB engine tables
-# use test;
-# create table t5(a int) engine= NDB;
-# use mysql;
-# create table t6(a int) engine= NDB;
-# Transaction3 begin
-# begin;
-# use test;
-# insert into t5 (a) values (3);
-# use mysql;
-# insert into t6 (a) values (3);
-# commit;
-# Transaction3 end
-
--echo #
--echo # Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified exists
--exec $MYSQL_BINLOG --database=test --short-form $MYSQLTEST_VARDIR/std_data/binlog_transaction.000001
@@ -566,6 +551,7 @@ DROP TABLE t1;
DROP DATABASE test1;
let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
let $MYSQLD_DATADIR= `SELECT @@datadir`;
exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1;
diff --git a/mysql-test/t/mysqlbinlog_raw_mode.test b/mysql-test/t/mysqlbinlog_raw_mode.test
new file mode 100644
index 00000000000..26fb31516f6
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog_raw_mode.test
@@ -0,0 +1,387 @@
+--source include/have_log_bin.inc
+reset master;
+
+# we need this for getting fixed timestamps inside of this test
+set timestamp=1000000000;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+CREATE TABLE t1 (c01 BIT);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+
+CREATE TABLE t1 (c01 BIT(7));
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (16);
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (64);
+INSERT INTO t1 VALUES (127);
+DELETE FROM t1 WHERE c01=127;
+UPDATE t1 SET c01=15 WHERE c01=16;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BIT(20), b CHAR(2));
+INSERT INTO t1 VALUES (b'00010010010010001001', 'ab');
+DROP TABLE t1;
+
+CREATE TABLE t1 (c02 BIT(64));
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (128);
+INSERT INTO t1 VALUES (b'1111111111111111111111111111111111111111111111111111111111111111');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (c03 TINYINT);
+INSERT INTO t1 VALUES (1),(2),(3);
+INSERT INTO t1 VALUES (-128);
+UPDATE t1 SET c03=2 WHERE c03=1;
+DELETE FROM t1 WHERE c03=-128;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c04 TINYINT UNSIGNED);
+INSERT INTO t1 VALUES (128), (255);
+UPDATE t1 SET c04=2 WHERE c04=1;
+DELETE FROM t1 WHERE c04=255;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c06 BOOL);
+INSERT INTO t1 VALUES (TRUE);
+DELETE FROM t1 WHERE c06=TRUE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c07 SMALLINT);
+INSERT INTO t1 VALUES (1234);
+DELETE FROM t1 WHERE c07=1234;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c08 SMALLINT UNSIGNED);
+INSERT INTO t1 VALUES (32768), (65535);
+UPDATE t1 SET c08=2 WHERE c08=32768;
+DELETE FROM t1 WHERE c08=65535;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c10 MEDIUMINT);
+INSERT INTO t1 VALUES (12345);
+DELETE FROM t1 WHERE c10=12345;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c11 MEDIUMINT UNSIGNED);
+INSERT INTO t1 VALUES (8388608), (16777215);
+UPDATE t1 SET c11=2 WHERE c11=8388608;
+DELETE FROM t1 WHERE c11=16777215;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c13 INT);
+INSERT INTO t1 VALUES (123456);
+DELETE FROM t1 WHERE c13=123456;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c14 INT UNSIGNED);
+INSERT INTO t1 VALUES (2147483648), (4294967295);
+UPDATE t1 SET c14=2 WHERE c14=2147483648;
+DELETE FROM t1 WHERE c14=4294967295;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c16 BIGINT);
+INSERT INTO t1 VALUES (1234567890);
+DELETE FROM t1 WHERE c16=1234567890;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c17 BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (9223372036854775808), (18446744073709551615);
+UPDATE t1 SET c17=2 WHERE c17=9223372036854775808;
+DELETE FROM t1 WHERE c17=18446744073709551615;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c19 FLOAT);
+INSERT INTO t1 VALUES (123.2234);
+DELETE FROM t1 WHERE c19>123;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c22 DOUBLE);
+INSERT INTO t1 VALUES (123434.22344545);
+DELETE FROM t1 WHERE c22>123434;
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c25 DECIMAL(10,5));
+INSERT INTO t1 VALUES (124.45);
+INSERT INTO t1 VALUES (-543.21);
+DELETE FROM t1 WHERE c25=124.45;
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c28 DATE);
+INSERT INTO t1 VALUES ('2001-02-03');
+DELETE FROM t1 WHERE c28='2001-02-03';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c29 DATETIME);
+INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
+DELETE FROM t1 WHERE c29='2001-02-03 10:20:30';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c30 TIMESTAMP);
+INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
+DELETE FROM t1 WHERE c30='2001-02-03 10:20:30';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c31 TIME);
+INSERT INTO t1 VALUES ('11:22:33');
+DELETE FROM t1 WHERE c31='11:22:33';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c32 YEAR);
+INSERT INTO t1 VALUES ('2001');
+DELETE FROM t1 WHERE c32=2001;
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c33 CHAR);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c33='a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c34 CHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c34='';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c35 CHAR(1));
+INSERT INTO t1 VALUES ('b');
+DELETE FROM t1 WHERE c35='b';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c36 CHAR(255));
+INSERT INTO t1 VALUES (repeat('c',255));
+DELETE FROM t1 WHERE c36>'c';
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c37 NATIONAL CHAR);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c37='a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c38 NATIONAL CHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c38='';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c39 NATIONAL CHAR(1));
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c39='a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c40 NATIONAL CHAR(255));
+INSERT INTO t1 VALUES (repeat('a', 255));
+INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
+DELETE FROM t1 WHERE c40>'a';
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c45 VARCHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c45='';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c46 VARCHAR(1));
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c46='a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c47 VARCHAR(255));
+INSERT INTO t1 VALUES (repeat('a',255));
+DELETE FROM t1 WHERE c47>'a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c48 VARCHAR(261));
+INSERT INTO t1 VALUES (repeat('a',261));
+DELETE FROM t1 WHERE c48>'a';
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c49 NATIONAL VARCHAR(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c49='';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c50 NATIONAL VARCHAR(1));
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c50='a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c51 NATIONAL VARCHAR(255));
+INSERT INTO t1 VALUES (repeat('a',255));
+INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
+DELETE FROM t1 WHERE c51>'a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c52 NATIONAL VARCHAR(261));
+INSERT INTO t1 VALUES (repeat('a',261));
+INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 261));
+DELETE FROM t1 WHERE c52>'a';
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c57 BINARY);
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c57='a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c58 BINARY(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c58='';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c59 BINARY(1));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c59='a';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c60 BINARY(255));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES (repeat('a\0',120));
+DELETE FROM t1 WHERE c60<0x02;
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c61 VARBINARY(0));
+INSERT INTO t1 VALUES ('');
+DELETE FROM t1 WHERE c61='';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c62 VARBINARY(1));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES ('a');
+DELETE FROM t1 WHERE c62=0x02;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c63 VARBINARY(255));
+INSERT INTO t1 VALUES (0x00);
+INSERT INTO t1 VALUES (0x02);
+INSERT INTO t1 VALUES (repeat('a\0',120));
+DELETE FROM t1 WHERE c63=0x02;
+DROP TABLE t1;
+
+#
+flush logs;
+
+CREATE TABLE t1 (c65 TINYBLOB);
+INSERT INTO t1 VALUES ('tinyblob1');
+DELETE FROM t1 WHERE c65='tinyblob1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c68 BLOB);
+INSERT INTO t1 VALUES ('blob1');
+DELETE FROM t1 WHERE c68='blob1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c71 MEDIUMBLOB);
+INSERT INTO t1 VALUES ('mediumblob1');
+DELETE FROM t1 WHERE c71='mediumblob1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c74 LONGBLOB);
+INSERT INTO t1 VALUES ('longblob1');
+DELETE FROM t1 WHERE c74='longblob1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c66 TINYTEXT);
+INSERT INTO t1 VALUES ('tinytext1');
+DELETE FROM t1 WHERE c66='tinytext1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c69 TEXT);
+INSERT INTO t1 VALUES ('text1');
+DELETE FROM t1 WHERE c69='text1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c72 MEDIUMTEXT);
+INSERT INTO t1 VALUES ('mediumtext1');
+DELETE FROM t1 WHERE c72='mediumtext1';
+DROP TABLE t1;
+
+CREATE TABLE t1 (c75 LONGTEXT);
+INSERT INTO t1 VALUES ('longtext1');
+DELETE FROM t1 WHERE c75='longtext1';
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c77 ENUM('a','b','c'));
+INSERT INTO t1 VALUES ('b');
+DELETE FROM t1 WHERE c77='b';
+DROP TABLE t1;
+
+#
+
+CREATE TABLE t1 (c78 SET('a','b','c','d','e','f'));
+INSERT INTO t1 VALUES ('a,b');
+INSERT INTO t1 VALUES ('a,c');
+INSERT INTO t1 VALUES ('b,c');
+INSERT INTO t1 VALUES ('a,b,c');
+INSERT INTO t1 VALUES ('a,b,c,d');
+INSERT INTO t1 VALUES ('a,b,c,d,e');
+INSERT INTO t1 VALUES ('a,b,c,d,e,f');
+DELETE FROM t1 WHERE c78='a,b';
+DROP TABLE t1;
+
+#
+# Check multi-table update
+#
+CREATE TABLE t1 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
+CREATE TABLE t2 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
+INSERT INTO t1 SET a=1;
+INSERT INTO t1 SET b=1;
+INSERT INTO t2 SET a=1;
+INSERT INTO t2 SET b=1;
+UPDATE t1, t2 SET t1.a=10, t2.a=20;
+DROP TABLE t1,t2;
+
+flush logs;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+# Test reading one file in raw mode
+--exec $MYSQL_BINLOG --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001
+--diff_files $MYSQLTEST_VARDIR/tmp/master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
+--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000001
+
+# Test reading all files in raw mode
+# Don't test the end file since this is still open with mysqld so will be different
+--exec $MYSQL_BINLOG --raw --read-from-remote-server --to-last-log --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001
+--diff_files $MYSQLTEST_VARDIR/tmp/master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
+--diff_files $MYSQLTEST_VARDIR/tmp/master-bin.000002 $MYSQLD_DATADIR/master-bin.000002
+
+--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000001
+--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000002
+--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000003
+
+
+# Test output to different filename
+--exec $MYSQL_BINLOG --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --result-file=$MYSQLTEST_VARDIR/tmp/server1- master-bin.000001
+--diff_files $MYSQLTEST_VARDIR/tmp/server1-master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
+--remove_file $MYSQLTEST_VARDIR/tmp/server1-master-bin.000001
+
+--echo End of tests
diff --git a/mysql-test/t/mysqlbinlog_row_minimal.opt b/mysql-test/t/mysqlbinlog_row_minimal.opt
new file mode 100644
index 00000000000..0e90a53dd3a
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog_row_minimal.opt
@@ -0,0 +1 @@
+--binlog-row-image=minimal
diff --git a/mysql-test/t/mysqlbinlog_row_minimal.test b/mysql-test/t/mysqlbinlog_row_minimal.test
new file mode 100644
index 00000000000..216cb43eb6f
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog_row_minimal.test
@@ -0,0 +1,33 @@
+#
+# Test for minimal row format
+#
+
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row.inc
+
+#
+# MDEV-8426
+# mysqlbinlog: "Corrupted replication event was detected. Not printing the
+# value" with binlog-row-image=minimal
+#
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1));
+CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1));
+INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "");
+INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL);
+INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A");
+INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A");
+INSERT INTO t2 SELECT * FROM t1;
+UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL;
+DELETE FROM t1;
+DELETE FROM t2;
+
+--let $binlog = query_get_value(SHOW MASTER STATUS, File, 1)
+--let $datadir = `SELECT @@datadir`
+
+FLUSH BINARY LOGS;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/
+--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index 96774d829ec..3fb924b9199 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -23,16 +23,16 @@ perl;
log-slow-queries pid-file slow-query-log-file log-basename
datadir slave-load-tmpdir tmpdir socket thread-pool-size
large-files-support lower-case-file-system system-time-zone
- collation-server character-set-server
- version.*/;
+ collation-server character-set-server log-tc-size version.*/;
# Plugins which may or may not be there:
- @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster
+ @plugins=qw/innodb archive blackhole federated partition
feedback debug temp-pool ssl des-key-file xtradb sequence
thread-concurrency super-large-pages mutex-deadlock-detector
connect null-audit aria oqgraph sphinx thread-handling
test-sql-discovery rpl-semi-sync query-cache-info
- query-response-time metadata-lock-info locales unix-socket/;
+ query-response-time metadata-lock-info locales unix-socket
+ wsrep file-key-management cracklib-password-check/;
# And substitute the content some environment variables with their
# names:
@@ -42,6 +42,7 @@ perl;
$re2=join('|', @plugins);
$skip=0;
open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die;
+ print "Windows bug: happens when a new line is exactly at the right offset.\n";
while (<F>) {
next if 1../The following groups are read/;
# formatting, skip line consisting entirely of dashes and blanks
diff --git a/mysql-test/t/mysqld_help_crash-9183.test b/mysql-test/t/mysqld_help_crash-9183.test
new file mode 100644
index 00000000000..ff7df32e1d6
--- /dev/null
+++ b/mysql-test/t/mysqld_help_crash-9183.test
@@ -0,0 +1,9 @@
+#
+# MDEV-9183 MariaDB 10.1 crash on `mysqld --verbose --help`
+#
+
+rename table mysql.plugin to test.plugin;
+flush tables;
+--exec $MYSQLD_CMD --help --verbose >/dev/null 2>&1
+rename table test.plugin to mysql.plugin;
+
diff --git a/mysql-test/t/mysqldump-max.test b/mysql-test/t/mysqldump-max.test
index d0a4870ba31..3f73f046959 100644
--- a/mysql-test/t/mysqldump-max.test
+++ b/mysql-test/t/mysqldump-max.test
@@ -1193,12 +1193,16 @@ DROP TABLE t1;
DROP TABLE t2;
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mwl136.sql
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS LIMIT 7,3;
+let $binlog_limit= 7, 3;
+source include/show_binlog_events.inc;
+source include/binlog_start_pos.inc;
+let _BINLOG_START_POS= $binlog_start_pos;
--perl
my $f= "$ENV{MYSQLTEST_VARDIR}/tmp/mwl136.sql";
+my $pos=$ENV{_BINLOG_START_POS} + 691;
open F, '<', $f or die "Failed to open $f: $!\n";
while (<F>) {
+ s/$pos/<pos>/;
print if /CHANGE MASTER TO/;
}
EOF
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index bb5a9ae1846..fca334a7fee 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1,5 +1,6 @@
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");
-
+#select * from mysql.user;
+#checksum table mysql.user;
# Embedded server doesn't support external clients
--source include/not_embedded.inc
@@ -139,7 +140,7 @@ create table t1(a int);
set global sql_mode='ANSI_QUOTES';
--exec $MYSQL_DUMP --comments=0 test
--exec $MYSQL_DUMP --comments=0 --compatible=ansi test
-set global sql_mode='';
+set global sql_mode=default;
drop table t1;
--echo #
@@ -1074,7 +1075,7 @@ drop table t1;
drop table if exists t1;
--enable_warnings
-create table t1 (`d` timestamp, unique (`d`));
+create table t1 (`d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, unique (`d`));
set time_zone='+00:00';
insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00');
# results should show two different time values
@@ -2482,6 +2483,7 @@ SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;
DROP DATABASE db_20772273;
+USE test;
--echo #
--echo # Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERY
@@ -2547,7 +2549,6 @@ DROP DATABASE bug25717383;
--exec $MYSQL_DUMP --user=foo 2>&1 > $MYSQLTEST_VARDIR/tmp/bug6056.out
--exec $MYSQL_DUMP --help > $MYSQLTEST_VARDIR/tmp/bug6056.out
-
--echo #
--echo # MDEV-9001 - [PATCH] Fix DB name quoting in mysqldump --routine
--echo #
@@ -2564,6 +2565,62 @@ if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Wind
DROP DATABASE `a\"'``b`;
#"
+use test;
+
+--echo #
+--echo # Test mysqldump with --disable-query-logs
+--echo #
+
+create table t1 (a int);
+insert into t1 values (1);
+
+--exec $MYSQL_DUMP --hex-blob --character-sets-dir=$MYSQL_SHAREDIR/charsets --tab=$MYSQLTEST_VARDIR/tmp/ test t1
+--exec $MYSQL_DUMP --disable-log-queries --skip-comments test t1 >$MYSQLTEST_VARDIR/tmp/mysqldump-test.out
+drop table t1;
+
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqldump-test.out
+select * from t1;
+drop table t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqldump-test.out
+#select * from mysql.user;
+#checksum table mysql.user;
+
+--echo #
+--echo # MDEV-9124 mysqldump does not dump data if table name is same as view earlier on
+--echo #
+
+CREATE DATABASE db1 CHARSET=utf8;
+CREATE DATABASE db2 CHARSET=utf8;
+USE db2;
+CREATE TABLE nonunique_table_name (i1 serial) ENGINE=MEMORY;
+INSERT INTO nonunique_table_name VALUES (1),(2);
+CREATE TABLE nonunique_table_view_name (i2 int) ENGINE=InnoDB;
+INSERT INTO nonunique_table_view_name VALUES (3),(4);
+use db1;
+CREATE TABLE basetable (id smallint) ENGINE=MyISAM;
+CREATE TABLE nonunique_table_name (i3 smallint) ENGINE=MERGE UNION (basetable) INSERT_METHOD=LAST;
+INSERT INTO nonunique_table_name VALUES (5),(6);
+CREATE VIEW nonunique_table_view_name AS SELECT 1;
+
+--echo
+--echo ##################################################
+--echo # --compact --databases db1 db2
+--exec $MYSQL_DUMP --compact --databases db1 db2
+--echo
+--echo ##################################################
+--echo # --compact db2
+--echo
+--exec $MYSQL_DUMP --compact db2
+--echo
+--echo ##################################################
+--echo # --compact --delayed-insert --no-data-med=0 --databases db2 db1
+--exec $MYSQL_DUMP --compact --delayed-insert --no-data-med=0 --databases db2 db1
+--echo
+
+DROP DATABASE db1;
+DROP DATABASE db2;
+
+#"
# MDEV-11505 wrong databasename in mysqldump comment
#
let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/bug11505.sql;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index aea4ba6432d..b2eb101a37c 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -406,7 +406,7 @@ select 3 from t1 ;
--disable_abort_on_error ONCE
garbage;
--disable_abort_on_error ONCE
---remove_file DoesNotExist
+--remove_file $MYSQLTEST_VARDIR/DoesNotExist
--disable_result_log
select 2;
@@ -1940,8 +1940,6 @@ remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result;
remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.reject;
--error 0,1
remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.log;
---error 0,1
-remove_file $MYSQL_TEST_DIR/r/zero_length_file.reject;
--enable_warnings
#
@@ -2084,9 +2082,11 @@ drop table t1;
--let $patt= /a /b / /less/more/
--replace_regex $patt
select "a is a and less is more" as txt;
+--replace_regex $patt /and /or /
+select "a is a and less is more" as txt2;
--let $patt=
--replace_regex $patt
-select "a is a and less is more" as txt;
+select "a is a and less is more" as txt3;
--enable_query_log
#
@@ -2194,7 +2194,7 @@ drop table t1;
--exec echo "remove_file ;" | $MYSQL_TEST 2>&1
--error 1
-remove_file non_existing_file;
+remove_file $MYSQLTEST_VARDIR/non_existing_file;
--enable_warnings
# ----------------------------------------------------------------------------
@@ -2205,10 +2205,10 @@ remove_file non_existing_file;
--exec echo "remove_files_wildcard ;" | $MYSQL_TEST 2>&1
--error 1
-remove_files_wildcard non_existing_dir;
+remove_files_wildcard $MYSQLTEST_VARDIR/non_existing_dir;
--error 1
-remove_files_wildcard non_existing_dir non_existing_file;
+remove_files_wildcard $MYSQLTEST_VARDIR/non_existing_dir non_existing_file;
# ----------------------------------------------------------------------------
# test for write_file
@@ -2217,7 +2217,7 @@ remove_files_wildcard non_existing_dir non_existing_file;
--exec echo "write_file ;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "write_file filename ;" | $MYSQL_TEST 2>&1
+--exec echo "write_file $MYSQLTEST_VARDIR/filename ;" | $MYSQL_TEST 2>&1
# Comment out this test as it confuses cmd.exe with unmatched "
#--error 1
@@ -2463,19 +2463,19 @@ remove_file $MYSQLTEST_VARDIR/tmp/file1.tmp;
--exec echo "chmod ;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "chmod 0 from_file;" | $MYSQL_TEST 2>&1
+--exec echo "chmod 0 $MYSQLTEST_VARDIR/from_file;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "chmod 08 from_file;" | $MYSQL_TEST 2>&1
+--exec echo "chmod 08 $MYSQLTEST_VARDIR/from_file;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "chmod from_file;" | $MYSQL_TEST 2>&1
+--exec echo "chmod $MYSQLTEST_VARDIR/from_file;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "chmod ABZD from_file;" | $MYSQL_TEST 2>&1
+--exec echo "chmod ABZD $MYSQLTEST_VARDIR/from_file;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "chmod 06789 from_file;" | $MYSQL_TEST 2>&1
+--exec echo "chmod 06789 $MYSQLTEST_VARDIR/from_file;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
@@ -2876,8 +2876,6 @@ list_files_append_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR
list_files_write_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR/tmp/testdir file?.txt;
list_files_append_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt $MYSQLTEST_VARDIR/tmp/testdir file*.txt;
diff_files $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR/tmp/testdir/file3.txt;
---error 1
-rmdir $MYSQLTEST_VARDIR/tmp/testdir;
cat_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt;
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index e74da3a8ff4..f22bf8cd7b5 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -6,7 +6,7 @@
# End of 4.1 tests
-call mtr.add_suppression("Can't open and lock privilege tables: Table 'host' was not locked with LOCK TABLES");
+call mtr.add_suppression("Can't open and lock privilege tables: Table 'user' was not locked with LOCK TABLES");
#
# Bug#43835: SHOW VARIABLES does not include 0 for slave_skip_errors
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 40f66946822..a55f5ce58d3 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -308,3 +308,733 @@ SELECT NOT NOT NULLIF(2,3);
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-7146 NULLIF returns unexpected result with a YEAR field
+--echo #
+CREATE TABLE t1 (a YEAR(2));
+INSERT INTO t1 VALUES (0);
+SELECT a,NULLIF(a,2000),NULLIF(2000,a) FROM t1;
+SELECT a,NULLIF(a,2001),NULLIF(2001,a) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-7005 NULLIF does not work as documented
+--echo #
+
+CREATE TABLE t1 (a TIME);
+CREATE TABLE t2 AS SELECT a,NULLIF(a,a), CASE WHEN a=a THEN NULL ELSE a END FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1,t2;
+
+--error ER_CANT_AGGREGATE_2COLLATIONS
+SELECT NULLIF(_latin1'a' COLLATE latin1_general_ci, _latin1'a' COLLATE latin1_bin);
+
+CREATE TABLE t1 AS SELECT
+ NULLIF(1,1),
+ NULLIF(1,1.0),
+ NULLIF(1,1e0),
+ NULLIF(1,'2001-01-01'),
+ NULLIF(1,TIME'00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ NULLIF(1.0,1),
+ NULLIF(1.0,1.0),
+ NULLIF(1.0,1e0),
+ NULLIF(1.0,'2001-01-01'),
+ NULLIF(1.0,TIME'00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ NULLIF(1e0,1),
+ NULLIF(1e0,1.0),
+ NULLIF(1e0,1e0),
+ NULLIF(1e0,'2001-01-01'),
+ NULLIF(1e0,TIME'00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ NULLIF('1',1),
+ NULLIF('1',1.0),
+ NULLIF('1',1e0),
+ NULLIF('1','2001-01-01'),
+ NULLIF('1',TIME'00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ NULLIF(TIMESTAMP'2001-01-01 00:00:00',1),
+ NULLIF(TIMESTAMP'2001-01-01 00:00:00',1.0),
+ NULLIF(TIMESTAMP'2001-01-01 00:00:00',1e0),
+ NULLIF(TIMESTAMP'2001-01-01 00:00:00','2001-01-01'),
+ NULLIF(TIMESTAMP'2001-01-01 00:00:00',TIME'00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ NULLIF(DATE'2001-01-01',1),
+ NULLIF(DATE'2001-01-01',1.0),
+ NULLIF(DATE'2001-01-01',1e0),
+ NULLIF(DATE'2001-01-01','2001-01-01'),
+ NULLIF(DATE'2001-01-01',TIME'00:00:00');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT
+ NULLIF(TIME'00:00:01',1),
+ NULLIF(TIME'00:00:01',1.0),
+ NULLIF(TIME'00:00:01',1e0),
+ NULLIF(TIME'00:00:01','00:00:00'),
+ NULLIF(TIME'00:00:01',DATE'2001-01-01');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1
+(
+ c_tinyint TINYINT,
+ c_smallint SMALLINT,
+ c_int INT,
+ c_bigint BIGINT,
+ c_float FLOAT,
+ c_double DOUBLE,
+ c_decimal103 DECIMAL(10,3),
+ c_varchar10 VARCHAR(10),
+ c_text TEXT,
+ c_blob BLOB,
+ c_enum ENUM('one','two','tree'),
+ c_datetime3 DATETIME(3),
+ c_timestamp3 TIMESTAMP(3),
+ c_date DATE,
+ c_time TIME
+);
+
+--echo #
+--echo # Checking that the return type depends only on args[0], even when compared to a super type
+--echo #
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_tinyint, 1),
+ NULLIF(c_tinyint, c_smallint),
+ NULLIF(c_tinyint, c_tinyint),
+ NULLIF(c_tinyint, c_int),
+ NULLIF(c_tinyint, c_bigint),
+ NULLIF(c_tinyint, c_float),
+ NULLIF(c_tinyint, c_double),
+ NULLIF(c_tinyint, c_decimal103),
+ NULLIF(c_tinyint, c_varchar10),
+ NULLIF(c_tinyint, c_text),
+ NULLIF(c_tinyint, c_blob),
+ NULLIF(c_tinyint, c_enum),
+ NULLIF(c_tinyint, c_datetime3),
+ NULLIF(c_tinyint, c_timestamp3),
+ NULLIF(c_tinyint, c_date),
+ NULLIF(c_tinyint, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_smallint, 1),
+ NULLIF(c_smallint, c_smallint),
+ NULLIF(c_smallint, c_tinyint),
+ NULLIF(c_smallint, c_int),
+ NULLIF(c_smallint, c_bigint),
+ NULLIF(c_smallint, c_float),
+ NULLIF(c_smallint, c_double),
+ NULLIF(c_smallint, c_decimal103),
+ NULLIF(c_smallint, c_varchar10),
+ NULLIF(c_smallint, c_text),
+ NULLIF(c_smallint, c_blob),
+ NULLIF(c_smallint, c_enum),
+ NULLIF(c_smallint, c_datetime3),
+ NULLIF(c_smallint, c_timestamp3),
+ NULLIF(c_smallint, c_date),
+ NULLIF(c_smallint, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_int, 1),
+ NULLIF(c_int, c_smallint),
+ NULLIF(c_int, c_tinyint),
+ NULLIF(c_int, c_int),
+ NULLIF(c_int, c_bigint),
+ NULLIF(c_int, c_float),
+ NULLIF(c_int, c_double),
+ NULLIF(c_int, c_decimal103),
+ NULLIF(c_int, c_varchar10),
+ NULLIF(c_int, c_text),
+ NULLIF(c_int, c_blob),
+ NULLIF(c_int, c_enum),
+ NULLIF(c_int, c_datetime3),
+ NULLIF(c_int, c_timestamp3),
+ NULLIF(c_int, c_date),
+ NULLIF(c_int, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_bigint, 1),
+ NULLIF(c_bigint, c_smallint),
+ NULLIF(c_bigint, c_tinyint),
+ NULLIF(c_bigint, c_int),
+ NULLIF(c_bigint, c_bigint),
+ NULLIF(c_bigint, c_float),
+ NULLIF(c_bigint, c_double),
+ NULLIF(c_bigint, c_decimal103),
+ NULLIF(c_bigint, c_varchar10),
+ NULLIF(c_bigint, c_text),
+ NULLIF(c_bigint, c_blob),
+ NULLIF(c_bigint, c_enum),
+ NULLIF(c_bigint, c_datetime3),
+ NULLIF(c_bigint, c_timestamp3),
+ NULLIF(c_bigint, c_date),
+ NULLIF(c_bigint, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+# QQ: this should probably create a FLOAT column instead of a DOUBLE column
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_float, 1),
+ NULLIF(c_float, c_smallint),
+ NULLIF(c_float, c_tinyint),
+ NULLIF(c_float, c_int),
+ NULLIF(c_float, c_bigint),
+ NULLIF(c_float, c_float),
+ NULLIF(c_float, c_double),
+ NULLIF(c_float, c_decimal103),
+ NULLIF(c_float, c_varchar10),
+ NULLIF(c_float, c_text),
+ NULLIF(c_float, c_blob),
+ NULLIF(c_float, c_enum),
+ NULLIF(c_float, c_datetime3),
+ NULLIF(c_float, c_timestamp3),
+ NULLIF(c_float, c_date),
+ NULLIF(c_float, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_double, 1),
+ NULLIF(c_double, c_smallint),
+ NULLIF(c_double, c_tinyint),
+ NULLIF(c_double, c_int),
+ NULLIF(c_double, c_bigint),
+ NULLIF(c_double, c_float),
+ NULLIF(c_double, c_double),
+ NULLIF(c_double, c_decimal103),
+ NULLIF(c_double, c_varchar10),
+ NULLIF(c_double, c_text),
+ NULLIF(c_double, c_blob),
+ NULLIF(c_double, c_enum),
+ NULLIF(c_double, c_datetime3),
+ NULLIF(c_double, c_timestamp3),
+ NULLIF(c_double, c_date),
+ NULLIF(c_double, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_decimal103, 1),
+ NULLIF(c_decimal103, c_smallint),
+ NULLIF(c_decimal103, c_tinyint),
+ NULLIF(c_decimal103, c_int),
+ NULLIF(c_decimal103, c_bigint),
+ NULLIF(c_decimal103, c_float),
+ NULLIF(c_decimal103, c_double),
+ NULLIF(c_decimal103, c_decimal103),
+ NULLIF(c_decimal103, c_varchar10),
+ NULLIF(c_decimal103, c_text),
+ NULLIF(c_decimal103, c_blob),
+ NULLIF(c_decimal103, c_enum),
+ NULLIF(c_decimal103, c_datetime3),
+ NULLIF(c_decimal103, c_timestamp3),
+ NULLIF(c_decimal103, c_date),
+ NULLIF(c_decimal103, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_varchar10, 1),
+ NULLIF(c_varchar10, c_smallint),
+ NULLIF(c_varchar10, c_tinyint),
+ NULLIF(c_varchar10, c_int),
+ NULLIF(c_varchar10, c_bigint),
+ NULLIF(c_varchar10, c_float),
+ NULLIF(c_varchar10, c_double),
+ NULLIF(c_varchar10, c_decimal103),
+ NULLIF(c_varchar10, c_varchar10),
+ NULLIF(c_varchar10, c_text),
+ NULLIF(c_varchar10, c_blob),
+ NULLIF(c_varchar10, c_enum),
+ NULLIF(c_varchar10, c_datetime3),
+ NULLIF(c_varchar10, c_timestamp3),
+ NULLIF(c_varchar10, c_date),
+ NULLIF(c_varchar10, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_text, 1),
+ NULLIF(c_text, c_smallint),
+ NULLIF(c_text, c_tinyint),
+ NULLIF(c_text, c_int),
+ NULLIF(c_text, c_bigint),
+ NULLIF(c_text, c_float),
+ NULLIF(c_text, c_double),
+ NULLIF(c_text, c_decimal103),
+ NULLIF(c_text, c_varchar10),
+ NULLIF(c_text, c_text),
+ NULLIF(c_text, c_blob),
+ NULLIF(c_text, c_enum),
+ NULLIF(c_text, c_datetime3),
+ NULLIF(c_text, c_timestamp3),
+ NULLIF(c_text, c_date),
+ NULLIF(c_text, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+# QQ: this should probably create BLOB instead of LONGBLOB
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_blob, 1),
+ NULLIF(c_blob, c_smallint),
+ NULLIF(c_blob, c_tinyint),
+ NULLIF(c_blob, c_int),
+ NULLIF(c_blob, c_bigint),
+ NULLIF(c_blob, c_float),
+ NULLIF(c_blob, c_double),
+ NULLIF(c_blob, c_decimal103),
+ NULLIF(c_blob, c_varchar10),
+ NULLIF(c_blob, c_text),
+ NULLIF(c_blob, c_blob),
+ NULLIF(c_blob, c_enum),
+ NULLIF(c_blob, c_datetime3),
+ NULLIF(c_blob, c_timestamp3),
+ NULLIF(c_blob, c_date),
+ NULLIF(c_blob, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+# QQ: this should probably create a ENUM column instead of VARCHAR(4)
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_enum, 1),
+ NULLIF(c_enum, c_smallint),
+ NULLIF(c_enum, c_tinyint),
+ NULLIF(c_enum, c_int),
+ NULLIF(c_enum, c_bigint),
+ NULLIF(c_enum, c_float),
+ NULLIF(c_enum, c_double),
+ NULLIF(c_enum, c_decimal103),
+ NULLIF(c_enum, c_varchar10),
+ NULLIF(c_enum, c_text),
+ NULLIF(c_enum, c_blob),
+ NULLIF(c_enum, c_enum),
+ NULLIF(c_enum, c_datetime3),
+ NULLIF(c_enum, c_timestamp3),
+ NULLIF(c_enum, c_date),
+ NULLIF(c_enum, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_datetime3, 1),
+ NULLIF(c_datetime3, c_smallint),
+ NULLIF(c_datetime3, c_tinyint),
+ NULLIF(c_datetime3, c_int),
+ NULLIF(c_datetime3, c_bigint),
+ NULLIF(c_datetime3, c_float),
+ NULLIF(c_datetime3, c_double),
+ NULLIF(c_datetime3, c_decimal103),
+ NULLIF(c_datetime3, c_varchar10),
+ NULLIF(c_datetime3, c_text),
+ NULLIF(c_datetime3, c_blob),
+ NULLIF(c_datetime3, c_enum),
+ NULLIF(c_datetime3, c_datetime3),
+ NULLIF(c_datetime3, c_timestamp3),
+ NULLIF(c_datetime3, c_date),
+ NULLIF(c_datetime3, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_timestamp3, 1),
+ NULLIF(c_timestamp3, c_smallint),
+ NULLIF(c_timestamp3, c_tinyint),
+ NULLIF(c_timestamp3, c_int),
+ NULLIF(c_timestamp3, c_bigint),
+ NULLIF(c_timestamp3, c_float),
+ NULLIF(c_timestamp3, c_double),
+ NULLIF(c_timestamp3, c_decimal103),
+ NULLIF(c_timestamp3, c_varchar10),
+ NULLIF(c_timestamp3, c_text),
+ NULLIF(c_timestamp3, c_blob),
+ NULLIF(c_timestamp3, c_enum),
+ NULLIF(c_timestamp3, c_datetime3),
+ NULLIF(c_timestamp3, c_timestamp3),
+ NULLIF(c_timestamp3, c_date),
+ NULLIF(c_timestamp3, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_date, 1),
+ NULLIF(c_date, c_smallint),
+ NULLIF(c_date, c_tinyint),
+ NULLIF(c_date, c_int),
+ NULLIF(c_date, c_bigint),
+ NULLIF(c_date, c_float),
+ NULLIF(c_date, c_double),
+ NULLIF(c_date, c_decimal103),
+ NULLIF(c_date, c_varchar10),
+ NULLIF(c_date, c_text),
+ NULLIF(c_date, c_blob),
+ NULLIF(c_date, c_enum),
+ NULLIF(c_date, c_datetime3),
+ NULLIF(c_date, c_timestamp3),
+ NULLIF(c_date, c_date),
+ NULLIF(c_date, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(c_time, 1),
+ NULLIF(c_time, c_smallint),
+ NULLIF(c_time, c_tinyint),
+ NULLIF(c_time, c_int),
+ NULLIF(c_time, c_bigint),
+ NULLIF(c_time, c_float),
+ NULLIF(c_time, c_double),
+ NULLIF(c_time, c_decimal103),
+ NULLIF(c_time, c_varchar10),
+ NULLIF(c_time, c_text),
+ NULLIF(c_time, c_blob),
+ NULLIF(c_time, c_enum),
+ NULLIF(c_time, c_datetime3),
+ NULLIF(c_time, c_timestamp3),
+ NULLIF(c_time, c_date),
+ NULLIF(c_time, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+--echo #
+--echo # Checking that the return type depends only on args[0], even if compared to a field
+--echo #
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(1, 1),
+ NULLIF(1, c_smallint),
+ NULLIF(1, c_tinyint),
+ NULLIF(1, c_int),
+ NULLIF(1, c_bigint),
+ NULLIF(1, c_float),
+ NULLIF(1, c_double),
+ NULLIF(1, c_decimal103),
+ NULLIF(1, c_varchar10),
+ NULLIF(1, c_text),
+ NULLIF(1, c_blob),
+ NULLIF(1, c_enum),
+ NULLIF(1, c_datetime3),
+ NULLIF(1, c_timestamp3),
+ NULLIF(1, c_date),
+ NULLIF(1, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(1.0, 1),
+ NULLIF(1.0, c_smallint),
+ NULLIF(1.0, c_tinyint),
+ NULLIF(1.0, c_int),
+ NULLIF(1.0, c_bigint),
+ NULLIF(1.0, c_float),
+ NULLIF(1.0, c_double),
+ NULLIF(1.0, c_decimal103),
+ NULLIF(1.0, c_varchar10),
+ NULLIF(1.0, c_text),
+ NULLIF(1.0, c_blob),
+ NULLIF(1.0, c_enum),
+ NULLIF(1.0, c_datetime3),
+ NULLIF(1.0, c_timestamp3),
+ NULLIF(1.0, c_date),
+ NULLIF(1.0, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(1e0, 1),
+ NULLIF(1e0, c_smallint),
+ NULLIF(1e0, c_tinyint),
+ NULLIF(1e0, c_int),
+ NULLIF(1e0, c_bigint),
+ NULLIF(1e0, c_float),
+ NULLIF(1e0, c_double),
+ NULLIF(1e0, c_decimal103),
+ NULLIF(1e0, c_varchar10),
+ NULLIF(1e0, c_text),
+ NULLIF(1e0, c_blob),
+ NULLIF(1e0, c_enum),
+ NULLIF(1e0, c_datetime3),
+ NULLIF(1e0, c_timestamp3),
+ NULLIF(1e0, c_date),
+ NULLIF(1e0, c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF('1', 1),
+ NULLIF('1', c_smallint),
+ NULLIF('1', c_tinyint),
+ NULLIF('1', c_int),
+ NULLIF('1', c_bigint),
+ NULLIF('1', c_float),
+ NULLIF('1', c_double),
+ NULLIF('1', c_decimal103),
+ NULLIF('1', c_varchar10),
+ NULLIF('1', c_text),
+ NULLIF('1', c_blob),
+ NULLIF('1', c_enum),
+ NULLIF('1', c_datetime3),
+ NULLIF('1', c_timestamp3),
+ NULLIF('1', c_date),
+ NULLIF('1', c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ NULLIF(TIME'10:10:10', 1),
+ NULLIF(TIME'10:10:10', c_smallint),
+ NULLIF(TIME'10:10:10', c_tinyint),
+ NULLIF(TIME'10:10:10', c_int),
+ NULLIF(TIME'10:10:10', c_bigint),
+ NULLIF(TIME'10:10:10', c_float),
+ NULLIF(TIME'10:10:10', c_double),
+ NULLIF(TIME'10:10:10', c_decimal103),
+ NULLIF(TIME'10:10:10', c_varchar10),
+ NULLIF(TIME'10:10:10', c_text),
+ NULLIF(TIME'10:10:10', c_blob),
+ NULLIF(TIME'10:10:10', c_enum),
+ NULLIF(TIME'10:10:10', c_datetime3),
+ NULLIF(TIME'10:10:10', c_timestamp3),
+ NULLIF(TIME'10:10:10', c_date),
+ NULLIF(TIME'10:10:10', c_time)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-7759 NULLIF(x,y) is not equal to CASE WHEN x=y THEN NULL ELSE x END
+--echo #
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2020);
+SELECT * FROM t1 WHERE a=2010 AND NULLIF(10.1,a) IS NULL;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND NULLIF(10.1,a) IS NULL;
+SELECT * FROM t1 WHERE a=2010 AND CASE WHEN 10.1=a THEN NULL ELSE 10.1 END IS NULL;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND CASE WHEN 10.1=a THEN NULL ELSE 10.1 END IS NULL;
+DROP TABLE t1;
+
+--echo # Two warnings expected
+CREATE TABLE t1 AS SELECT
+ NULLIF(TIMESTAMP'2001-01-01 00:00:00',1) AS a,
+ CASE WHEN TIMESTAMP'2001-01-01 00:00:00'=1 THEN NULL
+ ELSE TIMESTAMP'2001-01-01 00:00:00'
+ END AS b;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8785 Wrong results for EXPLAIN EXTENDED...WHERE NULLIF(latin1_col, _utf8'a' COLLATE utf8_bin) IS NOT NULL
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT a, NULLIF(a,_utf8'a' COLLATE utf8_bin) IS NULL FROM t1;
+SELECT CHARSET(NULLIF(a,_utf8'a' COLLATE utf8_bin)) FROM t1;
+EXPLAIN EXTENDED SELECT NULLIF(a,_utf8'a' COLLATE utf8_bin) IS NULL AS expr FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8740 Wrong result for SELECT..WHERE year_field=10 AND NULLIF(year_field,2011.1)='2011'
+--echo #
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2011);
+SELECT a=10 AND NULLIF(a,2011.1)='2011' AS cond FROM t1;
+SELECT * FROM t1 WHERE a=10;
+SELECT * FROM t1 WHERE NULLIF(a,2011.1)='2011';
+SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)='2011';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)='2011';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)=CONCAT('2011',RAND());
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8754 Wrong result for SELECT..WHERE year_field=2020 AND NULLIF(year_field,2010)='2020'
+--echo #
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2020);
+SELECT * FROM t1 WHERE a=2020;
+SELECT * FROM t1 WHERE NULLIF(a,2010)='2020';
+SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)='2020';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)='2020';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)=CONCAT('2020',RAND());
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9181 (NULLIF(count(table.col)), 0) gives wrong result on 10.1.x
+--echo #
+CREATE TABLE t1 (c1 varchar(50) DEFAULT NULL);
+INSERT INTO t1 (c1) VALUES ('hello'), ('hello\r\n'), ('hello'),('hello');
+SELECT NULLIF(COUNT(c1),0) FROM t1;
+SELECT CASE WHEN COUNT(c1)=0 THEN NULL ELSE COUNT(c1) END FROM t1;
+SELECT NULLIF(COUNT(c1)+0,0) AS c1,NULLIF(CAST(COUNT(c1) AS SIGNED),0) AS c2,NULLIF(CONCAT(COUNT(c1)),0) AS c3 FROM t1;
+SELECT NULLIF(COUNT(DISTINCT c1),0) FROM t1;
+SELECT CASE WHEN COUNT(DISTINCT c1)=0 THEN NULL ELSE COUNT(DISTINCT c1) END FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ id INT NOT NULL,
+ c1 INT DEFAULT NULL
+);
+INSERT INTO t1 VALUES (1,1),(1,2),(2,3),(2,4);
+SELECT NULLIF(COUNT(c1),0) AS c1,NULLIF(COUNT(c1)+0,0) AS c1_wrapped,CASE WHEN COUNT(c1) IS NULL THEN 0 ELSE COUNT(c1) END AS c1_case FROM t1 GROUP BY id;
+DROP TABLE t1;
+
+# Testing with side effects
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SET @a=0;
+SELECT NULLIF(LAST_VALUE(@a:=@a+1,a),0) FROM t1;
+SELECT @a;
+SET @a=0;
+SELECT NULLIF(AVG(a),0), NULLIF(AVG(LAST_VALUE(@a:=@a+1,a)),0) FROM t1;
+SELECT @a;
+
+# There should not be cache in here:
+
+EXPLAIN EXTENDED SELECT NULLIF(a,0) FROM t1;
+
+# But there should be a cache in here:
+EXPLAIN EXTENDED SELECT NULLIF(AVG(a),0) FROM t1;
+
+DROP TABLE t1;
+
+#
+# MDEV-9576 syntax error on view with nullif and count
+#
+create table t1 (col1 varchar(50));
+create view v1 AS select nullif(count(distinct col1),0) from t1;
+show create view v1;
+drop view v1;
+drop table t1;
+
+#
+# MDEV-9637 select nullif(count(col1),0) gives wrong result if in a view
+#
+create table t1 (col1 varchar(50) default null);
+insert into t1 (col1) values ('hello'), ('hello'), ('hello');
+create view v1 as select nullif(count(col1),0) from t1;
+select * from v1;
+select nullif(count(col1),0) from t1;
+drop view v1;
+drop table t1;
+
+#
+# MDEV-9644 Assertion `args[0] == args[2] || thd->stmt_arena->is_stmt_execute()' failed in Item_func_nullif::fix_length_and_dec()
+#
+select nullif((select 1), (select 2));
+create table t1 (f int);
+insert into t1 values (1),(2);
+select nullif( not f, 1 ) from t1;
+drop table t1;
+
+#
+# MDEV-9641 Assertion `args[0] == args[2] || _current_thd()->lex->context_analysis_only' failed in Item_func_nullif::print(String*, enum_query_type)
+#
+set names utf8;
+create table t1 (f1 varchar(10));
+insert into t1 values ('2015-12-31');
+--error ER_DATA_OUT_OF_RANGE
+select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
+drop table t1;
+
+#
+# MDEV-9682 Assertion `0' failed in Item_cache_row::illegal_method_call on 2nd execution of PS with NULLIF
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM "SELECT * FROM t1 WHERE NULLIF( ( 1, 2 ) IN ( SELECT 3, 4 ), 1 )";
+EXECUTE stmt;
+EXECUTE stmt;
+DROP TABLE t1;
+
+#
+# MDEV-9683 Server crashes in Item::basic_const_item on numerous nested NULLIFs
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-10347 mysqld got signal 11
+--echo #
+
+CREATE TABLE t1 (f1 VARCHAR(10), f2 VARCHAR(40));
+CREATE TABLE t2 (f3 VARCHAR(20));
+PREPARE stmt FROM "
+ SELECT (
+ SELECT IFNULL(f3,4) FROM t2
+ WHERE IFNULL(NULLIF(f1,''),1)
+ ) AS sq
+ FROM t1
+ GROUP BY f2
+";
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t2,t1;
+
+--echo #
+--echo # MDEV-10236 Where expression with NOT function gives incorrect result
+--echo #
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL;
+SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/old-mode.test b/mysql-test/t/old-mode.test
index c2a43f91ecb..ed33da523c7 100644
--- a/mysql-test/t/old-mode.test
+++ b/mysql-test/t/old-mode.test
@@ -68,8 +68,52 @@ DROP TABLE t1;
--echo #
--echo # MDEV-6649 Different warnings for TIME and TIME(N) when @@old_mode=zero_date_time_cast
--echo #
+SET @@global.mysql56_temporal_format=true;
SET @@old_mode=zero_date_time_cast;
CREATE TABLE t1 (a TIME,b TIME(1));
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
DROP TABLE t1;
+
+SET @@global.mysql56_temporal_format=false;
+SET @@old_mode=zero_date_time_cast;
+CREATE TABLE t1 (a TIME,b TIME(1));
+INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
+SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
+DROP TABLE t1;
+SET @@global.mysql56_temporal_format=DEFAULT;
+
+#
+# MDEV-12672 Replicated TIMESTAMP fields given wrong value near DST change
+#
+
+# Copy_field
+set time_zone='Europe/Moscow';
+set global mysql56_temporal_format=false;
+create table t1 (a timestamp);
+set timestamp=1288477526;
+insert t1 values (null);
+set timestamp=1288481126;
+insert t1 values (null);
+select a, unix_timestamp(a) from t1;
+set global mysql56_temporal_format=true;
+select a, unix_timestamp(a) from t1;
+alter table t1 modify a timestamp;
+select a, unix_timestamp(a) from t1;
+drop table t1;
+
+# field_conv_incompatible()
+set global mysql56_temporal_format=false;
+create table t1 (a timestamp);
+set timestamp=1288477526;
+insert t1 values (null);
+set timestamp=1288481126;
+insert t1 values (null);
+select a, unix_timestamp(a) from t1;
+set global mysql56_temporal_format=true;
+select a, unix_timestamp(a) from t1;
+create table t2 (a timestamp);
+insert t2 select a from t1;
+select a, unix_timestamp(a) from t2;
+drop table t1, t2;
+set time_zone=DEFAULT;
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 7063cffbb36..28f666263d2 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -6,6 +6,8 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
+set local sql_mode="";
+set global sql_mode="";
--disable_warnings
drop table if exists t1;
@@ -219,8 +221,8 @@ DROP TABLE t1;
#
# Common ciphers to openssl and yassl
---exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=DHE-RSA-AES256-SHA
---exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=AES256-SHA
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=AES128-SHA
--disable_query_log
--disable_result_log
@@ -261,6 +263,7 @@ disconnect con1;
connection default;
DROP USER bug42158@localhost;
+set global sql_mode=default;
--echo End of 5.1 tests
#
diff --git a/mysql-test/t/openssl_6975.test b/mysql-test/t/openssl_6975.test
index 89e6983cf47..49889a36a23 100644
--- a/mysql-test/t/openssl_6975.test
+++ b/mysql-test/t/openssl_6975.test
@@ -7,7 +7,10 @@ source include/have_ssl_communication.inc;
# this is OpenSSL test.
-grant select on test.* to ssl_sslv3@localhost require cipher "RC4-SHA";
+create user ssl_sslv3@localhost;
+# grant select on test.* to ssl_sslv3@localhost require cipher "AES128-SHA";
+grant select on test.* to ssl_sslv3@localhost require cipher "AES128-SHA";
+create user ssl_tls12@localhost;
grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256";
let $mysql=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1;
@@ -15,9 +18,9 @@ let $mysql=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$
disable_abort_on_error;
echo TLS1.2 ciphers: user is ok with any cipher;
exec $mysql --ssl-cipher=AES128-SHA256;
---replace_result DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-GCM-SHA384
+--replace_result DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-GCM-SHA384
exec $mysql --ssl-cipher=TLSv1.2;
-echo TLS1.2 ciphers: user requires SSLv3 cipher RC4-SHA;
+echo TLS1.2 ciphers: user requires SSLv3 cipher AES128-SHA;
exec $mysql --user ssl_sslv3 --ssl-cipher=AES128-SHA256;
exec $mysql --user ssl_sslv3 --ssl-cipher=TLSv1.2;
echo TLS1.2 ciphers: user requires TLSv1.2 cipher AES128-SHA256;
@@ -25,13 +28,13 @@ exec $mysql --user ssl_tls12 --ssl-cipher=AES128-SHA256;
exec $mysql --user ssl_tls12 --ssl-cipher=TLSv1.2;
echo SSLv3 ciphers: user is ok with any cipher;
-exec $mysql --ssl-cipher=RC4-SHA;
+exec $mysql --ssl-cipher=AES256-SHA;
exec $mysql --ssl-cipher=SSLv3;
-echo SSLv3 ciphers: user requires SSLv3 cipher RC4-SHA;
-exec $mysql --user ssl_sslv3 --ssl-cipher=RC4-SHA;
+echo SSLv3 ciphers: user requires SSLv3 cipher AES128-SHA;
+exec $mysql --user ssl_sslv3 --ssl-cipher=AES128-SHA;
exec $mysql --user ssl_sslv3 --ssl-cipher=SSLv3;
echo SSLv3 ciphers: user requires TLSv1.2 cipher AES128-SHA256;
-exec $mysql --user ssl_tls12 --ssl-cipher=RC4-SHA;
+exec $mysql --user ssl_tls12 --ssl-cipher=AES128-SHA;
exec $mysql --user ssl_tls12 --ssl-cipher=SSLv3;
drop user ssl_sslv3@localhost;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index e48bcbe00de..1ca258d1d48 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -2006,3 +2006,138 @@ select A.a + 10 * B.a + 100 * C.a, 1234 from t2 A, t2 B, t2 C;
--echo # Should show rows=2, not rows=100
explain update t1 set key1=key1+1 where key1 between 10 and 110 order by key1 limit 2;
drop table t1,t2;
+
+--echo #
+--echo # MDEV-465: Optimizer : wrong index choice, leading to strong performances issues
+--echo #
+CREATE TABLE t1 (
+ id1 int(10) unsigned NOT NULL auto_increment,
+ id2 tinyint(3) unsigned NOT NULL default '0',
+ id3 tinyint(3) unsigned NOT NULL default '0',
+ id4 int(10) unsigned NOT NULL default '0',
+ date timestamp NOT NULL default CURRENT_TIMESTAMP,
+ PRIMARY KEY (id1),
+ KEY id_234_date (id2,id3,id4,date),
+ KEY id_23_date (id2,id3,date)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--echo # t1 has "bad" index declaration order..
+
+CREATE TABLE t2 (
+ id1 int(10) unsigned NOT NULL auto_increment,
+ id2 tinyint(3) unsigned NOT NULL default '0',
+ id3 tinyint(3) unsigned NOT NULL default '0',
+ id4 int(10) unsigned NOT NULL default '0',
+ date timestamp NOT NULL default CURRENT_TIMESTAMP,
+ PRIMARY KEY (id1),
+ KEY id_23_date (id2,id3,date),
+ KEY id_234_date (id2,id3,id4,date)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+--echo # t2 has a "good" index declaration order
+
+INSERT INTO t1 (id2,id3,id4) VALUES (1,1,1),(1,1,1),(1,1,1),(1,1,1),(1,0,1),(1,2,1),(1,3,1);
+INSERT INTO t2 (id2,id3,id4) VALUES (1,1,1),(1,1,1),(1,1,1),(1,1,1),(1,0,1),(1,2,1),(1,3,1);
+
+--echo # The following two must both use id_23_date and no "using filesort":
+EXPLAIN SELECT id1 FROM t1 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4;
+--echo # See above query
+EXPLAIN SELECT id1 FROM t2 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-8989: ORDER BY optimizer ignores equality propagation
+--echo #
+set @tmp_8989=@@optimizer_switch;
+set optimizer_switch='orderby_uses_equalities=on';
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+
+create table t2 (
+ pk int primary key,
+ a int, b int,
+ filler char(200),
+ key(a)
+);
+insert into t2 select a, 1000-a, 1000-a, repeat('abc-',50) from t1 where a<200 limit 200;
+
+create table t3 (
+ pk int primary key,
+ a int, b int,
+ filler char(200),
+ key(a)
+);
+insert into t3 select a, 1000-a, 1000-a, repeat('abc-',50) from t1;
+insert into t3 select a+1000, 1000+a, 1000+a, repeat('abc-',50) from t1;
+
+--echo # The optimizer produces an order of 't2,t3' for this join
+--echo #
+--echo # Case #1 (from the bug report):
+--echo # Q1 can take advantage of t2.a to resolve ORDER BY limit w/o sorting
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 5;
+
+--echo #
+--echo # This is Q2 which used to have "Using temporary; using filesort" but
+--echo # has the same query plan as Q1:
+--echo #
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 5;
+
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 5;
+
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 5;
+
+
+--echo #
+--echo # Case #2: here, only "Using temporary" is removed. "Using filesort" remains.
+--echo #
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 25;
+
+explain
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 25;
+
+
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t2.a limit 25;
+
+
+select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
+from t2, t3 where t2.a=t3.a order by t3.a limit 25;
+
+--echo #
+--echo # Case #3: single table access (the code that decides whether we need
+--echo # "Using temporary" is not invoked)
+--echo #
+explain select * from t3 where b=a order by a limit 10;
+
+--echo # This must not use filesort. The query plan should be like the query above:
+explain select * from t3 where b=a order by b limit 10;
+drop table t0,t1,t2,t3;
+
+set @@optimizer_switch=@tmp_8989;
+
+set optimizer_switch='orderby_uses_equalities=on';
+
+
+--echo #
+--echo # MDEV-10880: Assertions `keypart_map' or
+--echo # `prebuilt->search_tuple->n_fields > 0' fail on DISTINCT and
+--echo # GROUP BY constant
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT DISTINCT pk FROM t1 GROUP BY 'foo';
+SELECT DISTINCT pk FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/order_by_innodb.test b/mysql-test/t/order_by_innodb.test
index c20eaceb053..097eddd24f1 100644
--- a/mysql-test/t/order_by_innodb.test
+++ b/mysql-test/t/order_by_innodb.test
@@ -21,3 +21,43 @@ SELECT * FROM t1 WHERE a = 8 AND (b = 1 OR b IS NULL) ORDER BY c;
DROP TABLE t1;
+--echo #
+--echo # MDEV-9457: Poor query plan chosen for ORDER BY query by a recent 10.1
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (
+ pk int primary key,
+ key1 int,
+ key2 int,
+ col1 char(255),
+ key(key1),
+ key(key2)
+) engine=innodb;
+
+set @a=-1;
+insert into t1
+select
+ @a:=@a+1,
+ @a,
+ @a,
+ repeat('abcd', 63)
+from t0 A, t0 B, t0 C, t0 D;
+
+--echo # The following must NOT use 'index' on PK.
+--echo # It should use index_merge(key1,key2) + filesort
+--replace_column 9 #
+explain
+select *
+from t1
+where key1<3 or key2<3
+order by pk;
+
+--replace_column 9 #
+explain
+select *
+from t1
+where key1<3 or key2<3;
+
+drop table t0, t1;
diff --git a/mysql-test/t/order_by_optimizer_innodb.test b/mysql-test/t/order_by_optimizer_innodb.test
new file mode 100644
index 00000000000..90430d11549
--- /dev/null
+++ b/mysql-test/t/order_by_optimizer_innodb.test
@@ -0,0 +1,98 @@
+--source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t0,t1,t2,t3;
+--enable_warnings
+
+--echo #
+--echo # MDEV-6402: Optimizer doesn't choose best execution plan when composite key is used
+--echo #
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
+
+CREATE TABLE t2 (
+ pk1 int(11) NOT NULL,
+ pk2 int(11) NOT NULL,
+ fd5 bigint(20) DEFAULT NULL,
+ filler1 char(200),
+ filler2 char(200),
+ PRIMARY KEY (pk1,pk2),
+ UNIQUE KEY ux_pk1_fd5 (pk1,fd5)
+ ) ENGINE=InnoDB;
+
+insert into t2
+select
+ round(log(2,t1.a+1)),
+ t1.a,
+ t1.a,
+ REPEAT('filler-data-', 10),
+ REPEAT('filler-data-', 10)
+from
+ t1;
+
+select pk1, count(*) from t2 group by pk1;
+
+--echo # The following should use range(ux_pk1_fd5), two key parts (key_len=5+8=13)
+EXPLAIN SELECT * FROM t2 USE INDEX(ux_pk1_fd5) WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10;
+--echo # This also must use range, not ref. key_len must be 13
+EXPLAIN SELECT * FROM t2 WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10;
+
+drop table t0,t1, t2;
+
+--echo #
+--echo # MDEV-6814: Server crashes in calculate_key_len on query with ORDER BY
+--echo #
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, KEY(f2),KEY(f2,f1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,5,0),(2,6,0);
+SELECT * FROM t1 WHERE f1 < 3 AND f2 IS NULL ORDER BY f1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-6796: Unable to skip filesort when using implicit extended key
+--echo #
+
+CREATE TABLE t1 (
+ pk1 int(11) NOT NULL,
+ pk2 varchar(64) NOT NULL,
+ col1 varchar(16) DEFAULT NULL,
+ PRIMARY KEY (pk1,pk2),
+ KEY key1 (pk1,col1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE t2 (
+ pk1 int(11) NOT NULL,
+ pk2 varchar(64) NOT NULL,
+ col1 varchar(16) DEFAULT NULL,
+ PRIMARY KEY (pk1,pk2),
+ KEY key1 (pk1,col1,pk2)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `t1` VALUES
+(12321321,'a8f5f167f44f4964e6c998dee827110c','video'),
+(12321321,'d77a17a3659ffa60c54e0ea17b6c6d16','video'),
+(12321321,'wwafdsafdsafads','video'),
+(12321321,'696aa249f0738e8181957dd57c2d7d0b','video-2014-09-23'),
+(12321321,'802f9f29584b486f356693e3aa4ef0af','video=sdsd'),
+(12321321,'2f94543ff74aab82e9a058b4e8316d75','video=sdsdsds'),
+(12321321,'c1316b9df0d203fd1b9035308de52a0a','video=sdsdsdsdsd');
+
+insert into t2 select * from t1;
+
+--echo # this must not use filesort:
+explain SELECT pk2
+FROM t1 USE INDEX(key1)
+WHERE pk1 = 123
+AND col1 = 'video'
+ORDER BY pk2 DESC LIMIT 21;
+
+--echo # this must not use filesort, either:
+explain SELECT pk2
+FROM t2 USE INDEX(key1)
+WHERE pk1 = 123 AND col1 = 'video'
+ORDER BY pk2 DESC LIMIT 21;
+
+drop table t1, t2;
+
diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test
index 3058a70eefc..e27db9c4e48 100644
--- a/mysql-test/t/parser.test
+++ b/mysql-test/t/parser.test
@@ -780,3 +780,270 @@ CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\;
--error ER_PARSE_ERROR
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
DROP TABLE t1;
+
+#
+# start of 10.1 tests
+#
+
+--echo #
+--echo # MDEV-7792 - SQL Parsing Error - UNION AND ORDER BY WITH JOIN
+--echo #
+CREATE TABLE t1(a INT);
+SELECT * FROM t1 JOIN ((SELECT 1 AS b) UNION ALL (SELECT 2 AS b) ORDER BY b DESC) s1 WHERE a=1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Test of collective fix for three parser bugs:
+--echo #
+--echo # Bug #17727401, Bug #17426017, Bug #17473479:
+--echo # The server accepts wrong syntax and then fails in different ways
+--echo #
+
+CREATE TABLE t1 (i INT);
+
+--echo # bug #17426017
+--error ER_PARSE_ERROR
+SELECT (SELECT EXISTS(SELECT * LIMIT 1 ORDER BY VALUES (c00)));
+
+--echo # bug#17473479
+CREATE TABLE a(a int);
+CREATE TABLE b(a int);
+--error ER_PARSE_ERROR
+DELETE FROM b ORDER BY(SELECT 1 FROM a ORDER BY a ORDER BY a);
+DROP TABLE a, b;
+
+--echo # bug #17727401
+--error ER_PARSE_ERROR
+SELECT '' IN (SELECT '1' c FROM t1 ORDER BY '' ORDER BY '') FROM t1;
+
+--echo # regression & coverage tests
+
+--echo # uniform syntax for FROM DUAL clause:
+
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ FOR UPDATE;
+
+--error ER_ORDER_WITH_PROC
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ PROCEDURE ANALYSE() FOR UPDATE;
+
+SELECT 1 FROM
+ (SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ FOR UPDATE) a;
+
+--error ER_WRONG_USAGE
+SELECT 1 FROM
+ (SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ PROCEDURE ANALYSE() FOR UPDATE) a;
+
+SELECT 1 FROM t1
+ WHERE EXISTS(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ FOR UPDATE);
+
+--error ER_WRONG_USAGE
+SELECT 1 FROM t1
+ WHERE EXISTS(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ PROCEDURE ANALYSE() FOR UPDATE);
+
+SELECT 1 FROM t1
+UNION
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ FOR UPDATE;
+
+--error ER_WRONG_USAGE
+SELECT 1 FROM t1
+UNION
+SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ PROCEDURE ANALYSE() FOR UPDATE;
+
+--error ER_WRONG_USAGE
+SELECT 1 FROM DUAL PROCEDURE ANALYSE()
+UNION
+SELECT 1 FROM t1;
+
+(SELECT 1 FROM t1)
+UNION
+(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ FOR UPDATE);
+
+--error ER_WRONG_USAGE
+(SELECT 1 FROM t1)
+UNION
+(SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1
+ PROCEDURE ANALYSE() FOR UPDATE);
+
+--echo # "FOR UPDATE" tests
+
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1;
+SELECT 1 FROM t1 FOR UPDATE UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1;
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 FOR UPDATE;
+
+
+--echo # "INTO" clause tests
+
+SELECT 1 FROM t1 INTO @var17727401;
+SELECT 1 FROM DUAL INTO @var17727401;
+SELECT 1 INTO @var17727401;
+
+SELECT 1 INTO @var17727401 FROM t1;
+SELECT 1 INTO @var17727401 FROM DUAL;
+
+--error ER_WRONG_USAGE
+SELECT 1 INTO @var17727401_1 FROM t1 INTO @var17727401_2;
+
+--error ER_WRONG_USAGE
+SELECT 1 INTO @var17727401_1 FROM DUAL
+ INTO @var17727401_2;
+
+SELECT 1 INTO @var17727401 FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1;
+SELECT 1 FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1 INTO @var17727401;
+
+--error ER_PARSE_ERROR
+SELECT 1 FROM t1 WHERE 1 INTO @var17727401 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1;
+
+--error ER_WRONG_USAGE
+SELECT 1 INTO @var17727401_1
+ FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1
+ INTO @var17727401_2;
+
+--error ER_PARSE_ERROR
+SELECT (SELECT 1 FROM t1 INTO @var17727401);
+--error ER_PARSE_ERROR
+SELECT 1 FROM (SELECT 1 FROM t1 INTO @var17727401) a;
+--error ER_PARSE_ERROR
+SELECT EXISTS(SELECT 1 FROM t1 INTO @var17727401);
+
+--error ER_WRONG_USAGE
+SELECT 1 FROM t1 INTO @var17727401 UNION SELECT 1 FROM t1 INTO t1;
+--error ER_WRONG_USAGE
+(SELECT 1 FROM t1 INTO @var17727401) UNION (SELECT 1 FROM t1 INTO t1);
+
+SELECT 1 FROM t1 UNION SELECT 1 FROM t1 INTO @var17727401;
+
+--error ER_WRONG_USAGE
+SELECT 1 INTO @var17727401 FROM t1 PROCEDURE ANALYSE();
+
+--error ER_WRONG_USAGE
+SELECT 1 FROM t1 PROCEDURE ANALYSE() INTO @var17727401;
+
+--echo # ORDER and LIMIT clause combinations
+
+# Limited support for (SELECT ...) ORDER/LIMIT:
+
+(SELECT 1 FROM t1 ORDER BY 1) ORDER BY 1;
+(SELECT 1 FROM t1 LIMIT 1) LIMIT 1;
+
+--error ER_PARSE_ERROR
+((SELECT 1 FROM t1 ORDER BY 1) ORDER BY 1) ORDER BY 1;
+--error ER_PARSE_ERROR
+((SELECT 1 FROM t1 LIMIT 1) LIMIT 1) LIMIT 1;
+
+(SELECT 1 FROM t1 ORDER BY 1) LIMIT 1;
+(SELECT 1 FROM t1 LIMIT 1) ORDER BY 1;
+
+--error ER_PARSE_ERROR
+((SELECT 1 FROM t1 ORDER BY 1) LIMIT 1) ORDER BY 1);
+--error ER_PARSE_ERROR
+((SELECT 1 FROM t1 LIMIT 1) ORDER BY 1) LIMIT 1);
+
+# ORDER/LIMIT and UNION:
+
+let $q=SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1;
+eval $q;
+eval SELECT ($q);
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1;
+eval $q;
+eval SELECT ($q);
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1;
+eval $q;
+eval SELECT ($q);
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1 ORDER BY 1;
+--error ER_PARSE_ERROR
+eval $q;
+--error ER_PARSE_ERROR
+eval SELECT ($q);
+--error ER_PARSE_ERROR
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1;
+--error ER_WRONG_USAGE
+eval $q;
+--error ER_WRONG_USAGE
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1;
+--error ER_WRONG_USAGE
+eval $q;
+--error ER_WRONG_USAGE
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 UNION SELECT 1 FROM t1;
+--error ER_WRONG_USAGE
+eval $q;
+--error ER_WRONG_USAGE
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 LIMIT 1 ORDER BY 1 UNION SELECT 1 FROM t1;
+--error ER_PARSE_ERROR
+eval $q;
+--error ER_PARSE_ERROR
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 ORDER BY 1;
+--error ER_WRONG_USAGE
+eval $q;
+--error ER_WRONG_USAGE
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 LIMIT 1;
+--error ER_WRONG_USAGE
+eval $q;
+--error ER_WRONG_USAGE
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 ORDER BY 1;
+--error ER_WRONG_USAGE
+eval $q;
+--error ER_WRONG_USAGE
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+let $q=SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 LIMIT 1;
+--error ER_WRONG_USAGE
+eval $q;
+--error ER_WRONG_USAGE
+eval SELECT ($q);
+--error ER_WRONG_USAGE
+eval SELECT 1 FROM ($q) a;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8380: Subquery parse error
+--echo #
+CREATE TABLE t1 ( a INT);
+INSERT INTO t1 VALUES ( 2 );
+SELECT *
+FROM ( (SELECT a FROM t1 ORDER BY a) UNION (SELECT 1 as b ORDER BY b ) ) AS a1
+WHERE a1.a = 1 OR a1.a = 2;
+DROP TABLE t1;
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 1c8cd0375d6..35dfdead916 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -2897,3 +2897,17 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+--echo #
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-8283 crash in get_mm_leaf with xor on binary col
+--echo #
+CREATE TABLE t1(a BINARY(80)) PARTITION BY KEY(a) PARTITIONS 3;
+SELECT 1 FROM t1 WHERE a XOR 'a';
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/partition_alter.test b/mysql-test/t/partition_alter.test
index 592d8fdaeaa..feb792624ab 100644
--- a/mysql-test/t/partition_alter.test
+++ b/mysql-test/t/partition_alter.test
@@ -1,3 +1,4 @@
+--source include/have_innodb.inc
--source include/have_partition.inc
CREATE TABLE `test_data` (
@@ -64,3 +65,50 @@ deallocate prepare stmt;
drop table test_data;
+#
+# MDEV-12389 ADD CHECK leaves an orphaned .par file
+#
+
+--let $datadir=`SELECT @@datadir`
+
+# InnoDB
+create table t1(id int, d date not null, b bool not null default 0, primary key(id,d))
+engine=innodb
+partition by range columns (d) (
+partition p1 values less than ('2016-10-18'),
+partition p2 values less than ('2020-10-19'));
+insert t1 values (0, '2000-01-02', 0);
+insert t1 values (1, '2020-01-02', 10);
+# should fail in 10.2
+alter table t1 add check (b in (0, 1));
+# should have CHECK in 10.2
+show create table t1;
+# should fail in 10.2
+insert t1 values (2, '2020-01-03', 20);
+drop table t1;
+--list_files $datadir/test
+
+# MyISAM, different execution path
+create table t1(id int, d date not null, b bool not null default 0, primary key(id,d))
+partition by range columns (d) (
+partition p1 values less than ('2016-10-18'),
+partition p2 values less than ('2020-10-19'));
+insert t1 values (0, '2000-01-02', 0);
+insert t1 values (1, '2020-01-02', 10);
+# should fail in 10.2
+alter table t1 add check (b in (0, 1));
+# should have CHECK in 10.2
+show create table t1;
+# should fail in 10.2
+insert t1 values (2, '2020-01-03', 20);
+drop table t1;
+--list_files $datadir/test
+
+#
+# MDEV-13097 Online alter of a partitioned MyISAM table with auto_increment
+#
+create table t1 (id_1 int auto_increment, id_2 int, id_3 int, d1 date, dt1 datetime default current_timestamp, dt2 datetime default current_timestamp on update current_timestamp, primary key (id_2, id_3), key(id_1)) partition by hash(id_2) partitions 3 (partition p01, partition p02, partition p03);
+insert into t1 values(0, 1, 1, NULL, now(), now());
+alter online table t1 delay_key_write=1;
+show create table t1;
+drop table t1;
diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test
index 720d483e8ed..75544f58ce8 100644
--- a/mysql-test/t/partition_bug18198.test
+++ b/mysql-test/t/partition_bug18198.test
@@ -163,7 +163,7 @@ create table t1 (col1 date)
partition by range(unix_timestamp(col1))
(partition p0 values less than (10), partition p1 values less than (30));
--- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+-- error ER_PARSE_ERROR
create table t1 (col1 datetime)
partition by range(week(col1))
(partition p0 values less than (10), partition p1 values less than (30));
diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test
index 95a2be36395..be34e4eac63 100644
--- a/mysql-test/t/partition_column.test
+++ b/mysql-test/t/partition_column.test
@@ -398,7 +398,7 @@ drop table t1;
create table t1 as select to_seconds(null) as to_seconds;
select data_type from information_schema.columns
-where column_name='to_seconds';
+where table_schema='test' and column_name='to_seconds';
drop table t1;
--error ER_PARSE_ERROR
diff --git a/mysql-test/t/partition_grant.test b/mysql-test/t/partition_grant.test
index cf944e507fd..a5df218bb10 100644
--- a/mysql-test/t/partition_grant.test
+++ b/mysql-test/t/partition_grant.test
@@ -21,6 +21,7 @@ insert into t1 values (1),(2);
# cleanup possible grants for mysqltest_1 left by previous tests
# and ensure consistent results of SHOW GRANTS command below.
--disable_warnings
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
revoke all privileges on *.* from mysqltest_1@localhost;
--enable_warnings
diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test
index 5b9aa5707b9..c8f473a0477 100644
--- a/mysql-test/t/partition_hash.test
+++ b/mysql-test/t/partition_hash.test
@@ -135,12 +135,14 @@ drop table t1;
#
# Disable warnings to allow this test case to run without
# the Blackhole storage engine.
+set sql_mode="";
--disable_warnings
CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1);
--enable_warnings
--error 0,ER_BINLOG_LOGGING_IMPOSSIBLE
INSERT INTO t1 VALUES (0);
DROP TABLE t1;
+set sql_mode=default;
#
# BUG 18423 Hash partitioning can lose rows in some queries
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index f6faa4cb0e6..00af34f9d26 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -478,6 +478,7 @@ drop table t1;
#
# Bug 20397: Partitions: Crash when using non-existing engine
#
+SET SQL_MODE="";
create table t1 (a int)
engine = x
partition by key (a);
@@ -492,6 +493,7 @@ partition by list (a)
alter table t1 engine = x;
show create table t1;
drop table t1;
+SET SQL_MODE=default;
# BUG#26117: index_merge sort-union over partitioned table crashes
diff --git a/mysql-test/t/partition_not_blackhole.test b/mysql-test/t/partition_not_blackhole.test
index fe7452432b2..d9e653b5252 100644
--- a/mysql-test/t/partition_not_blackhole.test
+++ b/mysql-test/t/partition_not_blackhole.test
@@ -17,7 +17,7 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
--copy_file std_data/parts/t1_blackhole.par $MYSQLD_DATADIR/test/t1.par
SHOW TABLES;
--replace_result $MYSQLD_DATADIR ./
---error ER_NOT_FORM_FILE
+--error ER_FAILED_READ_FROM_PAR_FILE
SHOW CREATE TABLE t1;
# The replace is needed for Solaris
diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test
index f2e3eba5de6..8f6e837299a 100644
--- a/mysql-test/t/partition_symlink.test
+++ b/mysql-test/t/partition_symlink.test
@@ -38,11 +38,10 @@ SHOW CREATE TABLE t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SHOW CREATE TABLE t2;
INSERT INTO t1 VALUES (0), (1), (2);
---error ER_TABLES_DIFFERENT_METADATA
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
--error ER_TABLES_DIFFERENT_METADATA
ALTER TABLE t1 EXCHANGE PARTITION p2 WITH TABLE t2;
---sorted_result
+SELECT * FROM t1;
SELECT * FROM t2;
DROP TABLE t1, t2;
# skipped because of bug#52354
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
index ec7117bb832..68c4d5afd64 100644
--- a/mysql-test/t/plugin.test
+++ b/mysql-test/t/plugin.test
@@ -1,8 +1,8 @@
--source include/not_windows_embedded.inc
--source include/have_example_plugin.inc
+--error ER_UNKNOWN_STORAGE_ENGINE
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
-DROP TABLE t1;
INSTALL PLUGIN example SONAME 'ha_example';
--replace_regex /\.dll/.so/
diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test
index 5e620654e0a..d7e838dbf94 100644
--- a/mysql-test/t/plugin_auth.test
+++ b/mysql-test/t/plugin_auth.test
@@ -3,6 +3,9 @@
--source include/mysql_upgrade_preparation.inc
--source include/have_innodb.inc
+SET GLOBAL SQL_MODE="";
+SET LOCAL SQL_MODE="";
+
query_vertical SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION
FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server';
@@ -60,7 +63,7 @@ disconnect plug_con_rightp;
--echo ## test no_auto_create_user sql mode with plugin users
SET @@sql_mode=no_auto_create_user;
GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
-SET @@sql_mode=default;
+SET @@sql_mode="";
DROP USER grant_user;
--echo ## test utf-8 user name
@@ -519,6 +522,8 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
+let $datadir= `select @@datadir`;
+remove_file $datadir/mysql_upgrade_info;
--echo #
@@ -580,4 +585,5 @@ disconnect bug12818542_con2;
DROP USER bug12818542@localhost;
DROP USER bug12818542_dest@localhost;
+SET GLOBAL SQL_MODE=default;
--echo End of 5.5 tests
diff --git a/mysql-test/t/plugin_auth_qa.test b/mysql-test/t/plugin_auth_qa.test
index 3a3921510e0..fce72a66702 100644
--- a/mysql-test/t/plugin_auth_qa.test
+++ b/mysql-test/t/plugin_auth_qa.test
@@ -3,6 +3,8 @@
--source include/have_plugin_auth.inc
--source include/not_embedded.inc
+set sql_mode="";
+
CREATE DATABASE test_user_db;
--sorted_result
@@ -332,5 +334,6 @@ DROP USER grant_user,plug_dest;
set @@sql_mode= @save_sql_mode;
#
DROP DATABASE test_user_db;
+
--exit
diff --git a/mysql-test/t/plugin_not_embedded.test b/mysql-test/t/plugin_not_embedded.test
index 3e3bd6e86ca..3b4129b6b6b 100644
--- a/mysql-test/t/plugin_not_embedded.test
+++ b/mysql-test/t/plugin_not_embedded.test
@@ -5,6 +5,7 @@
--echo # Bug#51770: UNINSTALL PLUGIN requires no privileges
--echo #
+CREATE USER bug51770@localhost;
GRANT INSERT ON mysql.plugin TO bug51770@localhost;
connect(con1,localhost,bug51770,,);
--replace_regex /\.dll/.so/
@@ -29,4 +30,3 @@ let $path = `select CONCAT_WS('/', '..', '$HA_EXAMPLE_SO')`;
--replace_regex /\.dll/.so/
--error ER_UDF_NO_PATHS
eval INSTALL PLUGIN example SONAME '$path';
-
diff --git a/mysql-test/t/processlist.test b/mysql-test/t/processlist.test
index a8f8a4ed64c..4734c75c8d3 100644
--- a/mysql-test/t/processlist.test
+++ b/mysql-test/t/processlist.test
@@ -50,3 +50,23 @@ select command, time < 5 from information_schema.processlist where id != connect
disconnect con1;
set debug_sync='reset';
+
+connection default;
+
+
+--echo #
+--echo # 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-7807 information_schema.processlist truncates queries with binary strings
+--echo #
+
+SET NAMES utf8;
+--vertical_results
+SELECT INFO, INFO_BINARY, 'xxx😎yyy' AS utf8mb4_string FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%xxx%yyy%';
+--horizontal_results
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index d60edf4f6a0..f7008f570b8 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1,5 +1,6 @@
-- source include/not_embedded.inc
-- source include/have_log_bin.inc
+
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
#
# SQL Syntax for Prepared Statements test
@@ -7,6 +8,7 @@ call mtr.add_suppression('Unsafe statement written to the binary log using state
--disable_warnings
drop table if exists t1,t2,t3,t4;
+drop database if exists mysqltest1;
# Avoid wrong warnings if mysql_client_test fails
drop database if exists client_test_db;
--enable_warnings
@@ -2223,24 +2225,32 @@ deallocate prepare abc;
create procedure proc_1() flush tables;
flush tables;
+--sorted_result
show open tables from mysql;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
call proc_1();
+--sorted_result
show open tables from mysql;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
call proc_1();
+--sorted_result
show open tables from mysql;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
call proc_1();
+--sorted_result
show open tables from mysql;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
flush tables;
delimiter |;
@@ -2260,24 +2270,31 @@ drop procedure proc_1;
flush tables;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
--enable_ps_protocol
prepare abc from "flush tables";
execute abc;
+--sorted_result
show open tables from mysql;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
execute abc;
+--sorted_result
show open tables from mysql;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
execute abc;
+--sorted_result
show open tables from mysql;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
+--sorted_result
show open tables from mysql;
flush tables;
deallocate prepare abc;
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index 0fa339229d1..9dfab0f07ba 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -497,11 +497,13 @@ prepare stmt1 from ' explain select a from t1 order by b ';
# PS protocol gives slightly different metadata
--disable_ps_protocol
--enable_metadata
+--replace_result 4096 4_OR_8_K 8192 4_OR_8_K
execute stmt1;
--disable_metadata
SET @arg00=1 ;
prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
--enable_metadata
+--replace_result 4096 4_OR_8_K 8192 4_OR_8_K
execute stmt1 using @arg00;
--disable_metadata
--enable_ps_protocol
diff --git a/mysql-test/t/ps_4heap.test b/mysql-test/t/ps_4heap.test
index f16d4599a74..2c0b64b1503 100644
--- a/mysql-test/t/ps_4heap.test
+++ b/mysql-test/t/ps_4heap.test
@@ -31,7 +31,8 @@ eval create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
- c13 date, c14 datetime, c15 timestamp, c16 time,
+ c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 varchar(100), c24 varchar(100),
c25 varchar(100), c26 varchar(100), c27 varchar(100), c28 varchar(100),
diff --git a/mysql-test/t/ps_5merge.test b/mysql-test/t/ps_5merge.test
index e6ce9bf42d3..adef6b51f0e 100644
--- a/mysql-test/t/ps_5merge.test
+++ b/mysql-test/t/ps_5merge.test
@@ -31,7 +31,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
- c13 date, c14 datetime, c15 timestamp, c16 time,
+ c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@@ -62,7 +62,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
- c13 date, c14 datetime, c15 timestamp, c16 time,
+ c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
diff --git a/mysql-test/t/ps_ddl.test b/mysql-test/t/ps_ddl.test
index 21355ca42b7..90226d379bf 100644
--- a/mysql-test/t/ps_ddl.test
+++ b/mysql-test/t/ps_ddl.test
@@ -2259,3 +2259,27 @@ EXECUTE stmt3;
EXECUTE stmt3;
DEALLOCATE PREPARE stmt3;
DROP TEMPORARY TABLES tm, t1;
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-10702 Crash in SET STATEMENT FOR EXECUTE
+--echo #
+CREATE TABLE t1 (a INT);
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (@@max_sort_length)';
+SET STATEMENT max_sort_length=2048 FOR EXECUTE stmt;
+SELECT * FROM t1;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=NEW.a + 1;
+SET STATEMENT max_sort_length=2048 FOR EXECUTE stmt;
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+SET STATEMENT max_sort_length=2048 FOR EXECUTE stmt;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 387dcd205bd..a97b0b1c815 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -4,7 +4,16 @@
#
# Tests with query cache
#
+SET GLOBAL query_cache_type= Off;
+SET LOCAL query_cache_type= Off;
+SET LOCAL query_cache_type= 0;
+--error ER_QUERY_CACHE_IS_GLOBALY_DISABLED
+SET LOCAL query_cache_type= on;
+--error ER_QUERY_CACHE_IS_GLOBALY_DISABLED
+SET LOCAL query_cache_type= 1;
set GLOBAL query_cache_size=1355776;
+SET GLOBAL query_cache_type= ON;
+SET LOCAL query_cache_type= ON;
# Reset query cache variables.
@@ -1204,9 +1213,8 @@ set global query_cache_size=102400;
set global query_cache_size=0;
set global query_cache_type=0;
show status like 'Qcache_free_blocks';
-
---error ER_QUERY_CACHE_DISABLED
set global query_cache_size=102400;
+show status like 'Qcache_free_blocks';
set global query_cache_type=on;
set session query_cache_type=on;
@@ -1260,6 +1268,8 @@ set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
set local query_cache_type=default;
+set GLOBAL query_cache_type=on;
+set local query_cache_type=on;
#
# Bug#33756 - query cache with concurrent_insert=0 appears broken
diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test
index 02a1689f807..cebe5b1c88f 100644
--- a/mysql-test/t/query_cache_debug.test
+++ b/mysql-test/t/query_cache_debug.test
@@ -3,6 +3,7 @@
--source include/have_debug_sync.inc
--source include/long_test.inc
+set global query_cache_type= ON;
#
# Bug #30887 Server crashes on SET GLOBAL query_cache_size=0
#
diff --git a/mysql-test/t/query_cache_merge.test b/mysql-test/t/query_cache_merge.test
index 189de8e4092..3046c4ecbfe 100644
--- a/mysql-test/t/query_cache_merge.test
+++ b/mysql-test/t/query_cache_merge.test
@@ -1,5 +1,8 @@
# Test query cache with many tables
+SET GLOBAL query_cache_type=ON;
+SET LOCAL query_cache_type=ON;
+
--source include/have_query_cache.inc
let $LIMIT=`SHOW VARIABLES LIKE 'open_files_limit'`;
let $MIN_LIMIT=600;
@@ -102,7 +105,8 @@ while ($c)
dec $c;
}
-SET @@global.query_cache_size = 0;
+SET @@global.query_cache_size = default;
SET @@global.table_definition_cache = @save_table_definition_cache;
+SET GLOBAL query_cache_type=default;
--echo End of 5.1 tests
diff --git a/mysql-test/t/query_cache_notembedded-master.opt b/mysql-test/t/query_cache_notembedded-master.opt
new file mode 100644
index 00000000000..871d6965726
--- /dev/null
+++ b/mysql-test/t/query_cache_notembedded-master.opt
@@ -0,0 +1 @@
+--query-cache-size=1355776
diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test
index edb6db43516..dff6c2a139b 100644
--- a/mysql-test/t/query_cache_notembedded.test
+++ b/mysql-test/t/query_cache_notembedded.test
@@ -8,7 +8,12 @@
#
# Tests with query cache
#
-set GLOBAL query_cache_size=1355776;
+set @sql_mode_save=@@global.sql_mode;
+set @query_cache_type_save=@@global.query_cache_type;
+set @query_cache_size_save=@@global.query_cache_size;
+
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
# Reset query cache variables.
@@ -270,7 +275,8 @@ DROP DATABASE bug30269;
disconnect bug30269;
DROP USER 'bug30269'@'localhost';
-set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
@@ -324,3 +330,7 @@ delimiter ;|
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
+SET GLOBAL query_cache_size=@query_cache_size_save;
+SET GLOBAL query_cache_type=@query_cache_type_save;
+set GLOBAL sql_mode=@sql_mode_save;
+
diff --git a/mysql-test/t/query_cache_with_views.test b/mysql-test/t/query_cache_with_views.test
index 97e37c53aa3..9b03d0e99d0 100644
--- a/mysql-test/t/query_cache_with_views.test
+++ b/mysql-test/t/query_cache_with_views.test
@@ -6,7 +6,8 @@
drop table if exists t1,t2,v1,v2,v3;
drop view if exists t1,t2,v1,v2,v3;
--enable_warnings
-
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
flush status;
create table t1 (a int, b int);
@@ -145,3 +146,4 @@ SET AUTOCOMMIT=DEFAULT;
# Reset default environment.
set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 7cd1c44ec24..30f4419bd7e 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -1786,3 +1786,74 @@ explain select * from t3, t2 where t2.a < t3.b and t3.a=1;
--echo # The second table should use 'range':
explain select * from t3, t2 where t3.b > t2.a and t3.a=1;
drop table t1,t2,t3;
+
+--echo #
+--echo # MDEV-6480: Remove conditions for which range optimizer returned SEL_ARG::IMPOSSIBLE.
+--echo #
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, b int, c int, key(a), key(b));
+insert into t2
+select
+ A.a + B.a* 10 + C.a * 100,
+ A.a + B.a* 10 + C.a * 100,
+ 12345
+from
+ t1 A, t1 B, t1 C;
+
+--echo # EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where (b > 25 and b < 15) or a<44;
+
+--echo # EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where a < 44 or (b > 25 and b < 15);
+
+--echo # Here, conditions b will not be removed, because "c<44" is not sargable
+--echo # and hence (b.. and .. b) part is not analyzed at all:
+explain extended select * from t2 where c < 44 or (b > 25 and b < 15);
+
+--echo # EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
+explain extended select * from t2 where (b > 25 and b < 15) or c < 44;
+
+--echo # Try a case where both OR parts produce SEL_ARG::IMPOSSIBLE:
+explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44);
+
+drop table t1,t2;
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8189 field<>const and const<>field are not symmetric
+--echo #
+CREATE TABLE t1 (a INT, b INT, KEY(a));
+INSERT INTO t1 (a) VALUES (10),(10),(10),(10),(10),(10),(10),(10),(10),(10),(70);
+EXPLAIN SELECT * FROM t1 WHERE a<>10;
+EXPLAIN SELECT * FROM t1 WHERE 10<>a;
+SELECT * FROM t1 WHERE a<>10;
+SELECT * FROM t1 WHERE 10<>a;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8613 Full table scan for WHERE indexed_varchar_column <=> 'bad-character'
+--echo #
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e');
+EXPLAIN SELECT * FROM t1 WHERE a<=>'😎';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in
+--echo # sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*)
+--echo #
+CREATE TABLE t1 (pk INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test
index 691c4104148..6b608dacf26 100644
--- a/mysql-test/t/read_only.test
+++ b/mysql-test/t/read_only.test
@@ -3,7 +3,6 @@
# should work with embedded server after mysqltest is fixed
--source include/not_embedded.inc
-
set @start_read_only= @@global.read_only;
# Save the initial number of concurrent sessions
@@ -16,6 +15,7 @@ DROP TABLE IF EXISTS t1,t2,t3;
# READ_ONLY does nothing to SUPER users
# so we use a non-SUPER one:
+create user test@localhost;
grant CREATE, SELECT, DROP on *.* to test@localhost;
--echo connect (con1,localhost,test,,test);
@@ -30,6 +30,7 @@ set global read_only=0;
connection con1;
create table t1 (a int);
+create trigger trg1 before insert on t1 for each row set @a:=1;
insert into t1 values(1);
@@ -56,6 +57,9 @@ create table t3 (a int);
--error ER_OPTION_PREVENTS_STATEMENT
insert into t1 values(1);
+--error ER_OPTION_PREVENTS_STATEMENT
+drop trigger trg1;
+
# if a statement, after parse stage, looks like it will update a
# non-temp table, it will be rejected, even if at execution it would
# have turned out that 0 rows would be updated
@@ -282,6 +286,7 @@ delete from mysql.tables_priv where User like 'mysqltest_%';
delete from mysql.columns_priv where User like 'mysqltest_%';
flush privileges;
+create user `mysqltest_u1`@`%`;
grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
create database mysqltest_db1;
grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
@@ -368,4 +373,3 @@ DROP TABLE t1;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
-
diff --git a/mysql-test/t/read_only_innodb.test b/mysql-test/t/read_only_innodb.test
index de237fecbb6..f404ba17579 100644
--- a/mysql-test/t/read_only_innodb.test
+++ b/mysql-test/t/read_only_innodb.test
@@ -13,6 +13,7 @@ DROP TABLE IF EXISTS table_11733 ;
# READ_ONLY does nothing to SUPER users
# so we use a non-SUPER one:
+create user test@localhost;
grant CREATE, SELECT, DROP on *.* to test@localhost;
connect (con1,localhost,test,,test);
@@ -47,6 +48,7 @@ disconnect con1;
# Bug #35732: read-only blocks SELECT statements in InnoDB
#
# Test 1: read only mode
+create user test@localhost;
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
connect(con1, localhost, test, , test);
@@ -251,3 +253,4 @@ connection default;
SET GLOBAL READ_ONLY = OFF;
DROP USER bug33669@localhost;
DROP DATABASE db1;
+
diff --git a/mysql-test/t/repair_symlink-5543.test b/mysql-test/t/repair_symlink-5543.test
index 6bdf72b4d40..4c120334d05 100644
--- a/mysql-test/t/repair_symlink-5543.test
+++ b/mysql-test/t/repair_symlink-5543.test
@@ -9,7 +9,9 @@
eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR';
insert t1 values (1);
--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD
---replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/
+--echo # Some systems fail with errcode 40, when doing openat, while others
+--echo # don't have openat and fail with errcode 20.
+--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /40/20/ /".*"/"<errmsg>"/
repair table t1;
drop table t1;
@@ -17,10 +19,9 @@ drop table t1;
eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR';
insert t2 values (1);
--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD
---replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/
+--replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /40/20/ /".*"/"<errmsg>"/
repair table t2;
drop table t2;
--list_files $MYSQL_TMP_DIR foobar5543
---system rm $MYSQL_TMP_DIR/t1.TMD $MYSQL_TMP_DIR/t2.TMD
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index fb49ce23644..1c1d1b00910 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -19,10 +19,12 @@ select (1,2,(3,4)) IN ((3,2,(3,4)), (1,2,(3,4)));
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,4));
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)));
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)));
+
SELECT (1,2,3)=(0,NULL,3);
SELECT (1,2,3)=(1,NULL,3);
-# here's something for Sanja to fix :)
SELECT (1,2,3)=(1,NULL,0);
SELECT ROW(1,2,3)=ROW(1,2,3);
@@ -285,3 +287,28 @@ SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
DROP TABLE t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8709 Row equality elements do not get propagated
+--echo #
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (10,10),(20,20);
+# Checking that the a>=10 part gets optimized away in both scalar and row notations
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-9369 IN operator with ( num, NULL ) gives inconsistent result
+--echo #
+SELECT (1,null) NOT IN ((2,2),(3,3)), (1,null) NOT IN ((2,2)), (1,null) NOT IN ((3,3));
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 2d75dc48f73..b207db042e6 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1814,7 +1814,7 @@ DROP TABLE t1;
# Test of bug with SUM(CASE...)
#
-CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
+CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
@@ -3260,7 +3260,7 @@ DROP TABLE t1;
#
# Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
#
-CREATE TABLE t1 (a INT, ts TIMESTAMP, KEY ts(ts));
+CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts));
INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00");
ANALYZE TABLE t1;
@@ -3832,7 +3832,7 @@ SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
DROP TABLE t1;
-CREATE TABLE t1(a TIMESTAMP NOT NULL);
+CREATE TABLE t1(a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES('2001-01-01');
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test
index 548ef295fb2..3e60f242083 100644
--- a/mysql-test/t/selectivity.test
+++ b/mysql-test/t/selectivity.test
@@ -848,6 +848,7 @@ set optimizer_use_condition_selectivity=1;
explain extended
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
+--sorted_result
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
@@ -855,6 +856,7 @@ set optimizer_use_condition_selectivity=3;
explain extended
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
+--sorted_result
select * from t1, t2, t1 as t3
where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000;
@@ -946,11 +948,11 @@ drop table t0,t1,t2;
--echo # Bug mdev-7316: a conjunct in WHERE with selectivity == 0
--echo #
-CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB;
+CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b));
INSERT INTO t1 VALUES
('USAChinese',10), ('USAEnglish',20), ('USAFrench',30);
-CREATE TABLE t2 (i int) ENGINE=INNODB;
+CREATE TABLE t2 (i int);
INSERT INTO t2 VALUES
(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4);
diff --git a/mysql-test/t/selectivity_innodb.test b/mysql-test/t/selectivity_innodb.test
index 25aa0abbc3b..e2dba034363 100644
--- a/mysql-test/t/selectivity_innodb.test
+++ b/mysql-test/t/selectivity_innodb.test
@@ -138,6 +138,39 @@ DROP TABLE t1,t2;
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-11060: sql/protocol.cc:532: void Protocol::end_statement(): Assertion `0' failed
+--echo #
+
+
+set optimizer_use_condition_selectivity=4;
+
+--disable_warnings
+drop view if exists v1;
+--enable_warnings
+
+create table t1 (a int not null, b int, c int) engine=InnoDB;
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+
+create table t2 (d int, e int) engine=InnoDB;
+update t1, t2 set a=NULL, b=2, c=NULL where b=d and e=200;
+
+create view v1 as select * from t1, t2 where d=2;
+--error ER_BAD_NULL_ERROR
+insert v1 (a,c) values (NULL, 20);
+
+drop table t1,t2;
+drop view v1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
+
set use_stat_tables= @tmp_ust;
set optimizer_use_condition_selectivity= @tmp_oucs;
SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/t/servers.test b/mysql-test/t/servers.test
index ee0fa637b87..645206c376e 100644
--- a/mysql-test/t/servers.test
+++ b/mysql-test/t/servers.test
@@ -1,4 +1,5 @@
# Generic tests for servers (do not require FEDERATED)
+set sql_mode="";
--echo #
--echo # MDEV-4594 - CREATE SERVER crashes embedded
@@ -6,3 +7,18 @@
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(HOST 'localhost');
SELECT * FROM mysql.servers;
DROP SERVER s1;
+
+CREATE SERVER s1 FOREIGN DATA WRAPPER foo OPTIONS(USER 'bar');
+SELECT * FROM mysql.servers;
+DROP SERVER s1;
+
+--error ER_CANT_CREATE_FEDERATED_TABLE
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(USER 'bar');
+
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(HOST 'bar');
+SELECT * FROM mysql.servers;
+DROP SERVER s1;
+
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(SOCKET 'bar');
+SELECT * FROM mysql.servers;
+DROP SERVER s1;
diff --git a/mysql-test/t/set_password_plugin-9835.test b/mysql-test/t/set_password_plugin-9835.test
index a10a339540f..6afccd74f9d 100644
--- a/mysql-test/t/set_password_plugin-9835.test
+++ b/mysql-test/t/set_password_plugin-9835.test
@@ -7,6 +7,8 @@
--enable_connect_log
+set global secure_auth=0;
+
# The hash (old and new) is for 'test'
create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
@@ -125,4 +127,5 @@ select current_user();
--connection default
drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
+set global secure_auth=default;
diff --git a/mysql-test/t/set_statement.test b/mysql-test/t/set_statement.test
new file mode 100644
index 00000000000..a91c53c8dee
--- /dev/null
+++ b/mysql-test/t/set_statement.test
@@ -0,0 +1,1134 @@
+--echo '# SET STATEMENT ..... FOR .... TEST'
+############################ STATEMENT_SET #############################
+# #
+# Testing working functionality of SET STATEMENT #
+# #
+# #
+# There is important documentation within #
+# #
+# #
+# Author: Joe Lukas #
+# Creation: #
+# 2009-08-02 Implement this test as part of #
+# WL#681 Per query variable settings #
+# #
+########################################################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS myProc;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+DROP PROCEDURE IF EXISTS p5;
+DROP PROCEDURE IF EXISTS p6;
+DROP VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS STATEMENT;
+--enable_warnings
+SET @save_binlog_format = @@binlog_format;
+SET @save_keep_files_on_create = @@keep_files_on_create;
+SET @save_max_join_size = @@max_join_size;
+SET @save_myisam_repair_threads = @@myisam_repair_threads;
+SET @save_myisam_sort_buffer_size = @@myisam_sort_buffer_size;
+SET @save_sort_buffer_size = @@sort_buffer_size;
+####################################################################
+#Set up current database
+####################################################################
+--echo '# Setup database'
+CREATE TABLE t1 (v1 INT, v2 INT);
+INSERT INTO t1 VALUES (1,2);
+INSERT INTO t1 VALUES (3,4);
+--echo ''
+--echo '#------------------ STATEMENT Test 1 -----------------------#'
+####################################################################
+# Checks with variable value type ulong #
+####################################################################
+--echo '# Initialize variables to known setting'
+SET SESSION sort_buffer_size=100000;
+--echo ''
+--echo '# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+SET STATEMENT sort_buffer_size=150000 FOR SELECT *,@@sort_buffer_size FROM t1;
+--echo ''
+--echo '# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+--echo ''
+--echo '#------------------ STATEMENT Test 2 -----------------------#'
+####################################################################
+# Checks for multiple set values inside STATEMENT ... FOR #
+####################################################################
+--echo '# Initialize variables to known setting'
+SET SESSION binlog_format=mixed;
+SET SESSION sort_buffer_size=100000;
+--echo '# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+SET STATEMENT sort_buffer_size=150000, binlog_format=row
+ FOR SELECT *,@@sort_buffer_size,@@binlog_format FROM t1;
+--echo '# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+
+--echo ''
+--echo '#------------------ STATEMENT Test 3 -----------------------#'
+####################################################################
+# Check current variable value is stored in using stored #
+# statements. #
+####################################################################
+--echo '# set initial variable value, make prepared statement
+SET SESSION binlog_format=row;
+PREPARE stmt1 FROM 'SET STATEMENT binlog_format=row FOR SELECT *,@@binlog_format FROM t1';
+--echo ''
+--echo '# Change variable setting'
+SET SESSION binlog_format=mixed;
+--echo ''
+--echo '# Pre-STATEMENT variable value'
+--echo ''
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+--echo ''
+EXECUTE stmt1;
+--echo ''
+--echo '# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'binlog_format';
+
+--echo ''
+DEALLOCATE PREPARE stmt1;
+--echo '#------------------ STATEMENT Test 4 -----------------------#'
+####################################################################
+# Check works with OPTIMIZE TABLE command #
+# Checks works with a variable value of type INT #
+# Checks works with variable type ULONGLONG #
+####################################################################
+--echo '# set initial variable value, make prepared statement
+SET SESSION myisam_sort_buffer_size=500000, myisam_repair_threads=1;
+--echo ''
+--echo '# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'myisam_sort_buffer_size';
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=800000,
+ myisam_repair_threads=2 FOR OPTIMIZE TABLE t1;
+--echo ''
+--echo '# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'myisam_sort_buffer_size';
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+
+--echo ''
+--echo '#------------------ STATEMENT Test 5 -----------------------#'
+####################################################################
+# Checks if variable reset after error in statement after FOR #
+####################################################################
+--echo '# Initialize variables to known setting'
+SET SESSION sort_buffer_size=100000;
+--echo ''
+--echo '# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+--echo ''
+--error ER_NO_SUCH_TABLE
+SET STATEMENT sort_buffer_size=150000 FOR SELECT * FROM t2;
+--echo ''
+--echo '# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+
+--echo ''
+--echo '#------------------ STATEMENT Test 6 -----------------------#'
+####################################################################
+# Checks works with variable type MY_BOOL #
+####################################################################
+--echo '# Initialize variables to known setting'
+SET SESSION keep_files_on_create=ON;
+--echo ''
+--echo '# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+--echo ''
+SET STATEMENT keep_files_on_create=OFF FOR SELECT *,@@keep_files_on_create FROM t1;
+--echo ''
+--echo '# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+
+--echo ''
+--echo '#------------------ STATEMENT Test 7 -----------------------#'
+####################################################################
+# Checks works with variable type HA_ROWS #
+####################################################################
+--echo '# Initialize variables to known setting'
+SET SESSION max_join_size=2222220000000;
+--echo ''
+--echo '# Pre-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+--echo ''
+SET STATEMENT max_join_size=1000000000000 FOR SELECT *,@@max_join_size FROM t1;
+--echo ''
+--echo '# Post-STATEMENT variable value'
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+
+--echo ''
+--echo '#------------------Test 8-----------------------#'
+####################################################################
+# Ensure variable of each type is set to proper value during #
+# statement after FOR execution #
+####################################################################
+--echo '# Initialize test variables'
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size = 200000,
+ max_join_size=2222220000000,
+ keep_files_on_create=ON;
+
+--echo ''
+--echo '# LONG '
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+SET STATEMENT sort_buffer_size = 100000
+ FOR SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+SHOW SESSION VARIABLES LIKE 'sort_buffer_size';
+--echo ''
+--echo '# MY_BOOL '
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+SET STATEMENT keep_files_on_create=OFF
+ FOR SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+SHOW SESSION VARIABLES LIKE 'keep_files_on_create';
+
+--echo ''
+--echo '# INT/LONG '
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+SET STATEMENT myisam_repair_threads=2
+ FOR SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+SHOW SESSION VARIABLES LIKE 'myisam_repair_threads';
+--echo ''
+--echo '# ULONGLONG '
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+SET STATEMENT max_join_size=2000000000000
+ FOR SHOW SESSION VARIABLES LIKE 'max_join_size';
+SHOW SESSION VARIABLES LIKE 'max_join_size';
+
+--echo ''
+--echo '#------------------Test 9-----------------------#'
+####################################################################
+# No 1 - Check works with CREATE ... BEGIN ... END command #
+# Display variables during execution #
+# No 2 - Test with DROP command #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+DELIMITER |;
+CREATE FUNCTION myProc (cost DECIMAL(10,2))
+ RETURNS DECIMAL(10,2)
+
+ SQL SECURITY DEFINER
+
+ tax: BEGIN
+ DECLARE order_tax DECIMAL(10,2);
+ SET order_tax = cost * .05 + @@sort_buffer_size;
+ RETURN order_tax;
+ END|
+DELIMITER ;|
+--echo ''
+--echo '# During Execution values
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ SELECT myProc(123.45);
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=300000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ SELECT myProc(123.45);
+--echo ''
+--echo '# Post-STATEMENT No 1 variable value Pre-STATEMENT for No 2'
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ DROP FUNCTION myProc;
+--echo ''
+--echo '# Post-STATEMENT No 2 variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+
+--echo ''
+--echo '#------------------Test 11-----------------------#'
+####################################################################
+# No 1 - Check with PREPARE statement #
+# check with different variable on inside PREPARE #
+# No 2 - Check with EXECUTE statement #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ PREPARE stmt1 FROM
+ 'SET STATEMENT binlog_format=row FOR SELECT *,@@binlog_format,@@sort_buffer_size FROM t1';
+--echo ''
+--echo 'Test No 1 Post Value & Test 2 Pre values'
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ EXECUTE stmt1;
+--echo ''
+--echo '# Post-STATEMENT No 2
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+--echo '#------------------Test 12-----------------------#'
+####################################################################
+# No 1 - Check with PROCEDURE (show variables in procedure) #
+# No 2 - Check with CALL statement show variables in PROCEDURE #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+DELIMITER |;
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ CREATE PROCEDURE p1() BEGIN
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ END|
+DELIMITER ;|
+--echo ''
+--echo 'Test No 1 Post Value & Test 2 Pre values'
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400001,
+ myisam_repair_threads=3,
+ sort_buffer_size=200001,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000001 FOR
+ CALL p1();
+--echo ''
+--echo '# Post-STATEMENT No 2
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+
+--echo '#------------------Test 13-----------------------#'
+####################################################################
+# Check PROCEDURE containing SET STATEMENT FOR #
+# p1() from test 12 will be used to display variables #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo ''
+DELIMITER |;
+CREATE PROCEDURE p2() BEGIN
+ SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=3,
+ sort_buffer_size=300000,
+ binlog_format=mixed,
+ keep_files_on_create=OFF,
+ max_join_size=3333330000000 FOR
+ CALL p1();
+ END|
+DELIMITER ;|
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ CALL p2();
+--echo ''
+--echo '# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+--echo '#------------------Test 14-----------------------#'
+####################################################################
+# Check PROCEDURE containing compound SET STATEMENT FOR #
+# p2() will be used as compounding statement from test 13 #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo ''
+DELIMITER |;
+CREATE PROCEDURE p3() BEGIN
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ SET STATEMENT myisam_sort_buffer_size=320000,
+ myisam_repair_threads=2,
+ sort_buffer_size=220022,
+ binlog_format=row,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000 FOR
+ CALL p2();
+ END|
+DELIMITER ;|
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ CALL p3();
+--echo ''
+--echo '# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+
+ --echo ''
+--echo ''
+--echo '#------------------Test 15-----------------------#'
+####################################################################
+# Check PROCEDURE containing compound SET STATEMENT FOR #
+# call multiple SET STATEMENT .. FOR showing SELECT #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo ''
+DELIMITER |;
+CREATE PROCEDURE p4() BEGIN
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ SET STATEMENT myisam_sort_buffer_size=320000,
+ myisam_repair_threads=2,
+ sort_buffer_size=220022,
+ binlog_format=row,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000 FOR
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ SET STATEMENT myisam_sort_buffer_size=320000,
+ myisam_repair_threads=2,
+ sort_buffer_size=220022,
+ binlog_format=row,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000 FOR
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ SET STATEMENT myisam_sort_buffer_size=320000,
+ myisam_repair_threads=2,
+ sort_buffer_size=220022,
+ binlog_format=row,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000 FOR
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ END|
+DELIMITER ;|
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ CALL p4();
+--echo ''
+--echo '# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+
+--echo ''
+--echo ''
+--echo '#------------------Test 16-----------------------#'
+####################################################################
+# Test Effect on parsing #
+####################################################################
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@sql_mode;
+--echo ''
+--echo ''
+SET STATEMENT sql_mode='ansi' FOR PREPARE stmt FROM 'SELECT "t1".* FROM t1';
+execute stmt;
+ALTER TABLE t1 ADD COLUMN v3 int;
+# repreparation with other mode cause an error
+--error ER_PARSE_ERROR
+execute stmt;
+ALTER TABLE t1 drop COLUMN v3;
+deallocate prepare stmt;
+--echo ''
+--echo '# Post-STATEMENT
+SELECT @@sql_mode;
+--echo check the same behaviour in normal set
+SET sql_mode='ansi';
+PREPARE stmt FROM 'SELECT "t1".* FROM t1';
+SET sql_mode=default;
+execute stmt;
+ALTER TABLE t1 ADD COLUMN v3 int;
+# repreparation with other mode cause an error
+--error ER_PARSE_ERROR
+execute stmt;
+ALTER TABLE t1 drop COLUMN v3;
+deallocate prepare stmt;
+# the above test about SP
+SELECT @@sql_mode;
+SET sql_mode='ansi';
+SELECT @@sql_mode;
+DELIMITER |;
+ CREATE PROCEDURE p6() BEGIN
+ SELECT @@sql_mode;
+ SELECT "t1".* FROM t1;
+ END|
+DELIMITER ;|
+SET sql_mode=default;
+call p6;
+ALTER TABLE t1 ADD COLUMN v3 int;
+#force SP stack invalidation
+create view v1 as select * from t1;
+drop view v1;
+call p6;
+ALTER TABLE t1 drop COLUMN v3;
+drop procedure p6;
+
+
+SELECT @@sql_mode;
+DELIMITER |;
+--echo # SET and the statement parsed as one unit before the SET takes effect
+--error ER_PARSE_ERROR
+SET STATEMENT sql_mode='ansi' FOR
+ CREATE PROCEDURE p6() BEGIN
+ SELECT @@sql_mode;
+ SELECT "t1".* FROM t1;
+ END|
+DELIMITER ;|
+#call p1;
+#ALTER TABLE t1 ADD COLUMN v3 int;
+#--echo # no reparsing for now
+#call p1;
+#ALTER TABLE t1 drop COLUMN v3;
+#drop procedure p1;
+
+
+# the above test about compound statement
+SELECT @@sql_mode;
+SET sql_mode='ansi';
+SELECT @@sql_mode;
+DELIMITER |;
+BEGIN NOT ATOMIC
+ SELECT @@sql_mode;
+ SELECT "t1".* FROM t1;
+END|
+DELIMITER ;|
+SET sql_mode=default;
+
+
+SELECT @@sql_mode;
+DELIMITER |;
+--echo # SET and the statement parsed as one unit before the SET takes effect
+--error ER_PARSE_ERROR
+SET STATEMENT sql_mode='ansi' FOR
+BEGIN NOT ATOMIC
+ SELECT @@sql_mode;
+ SELECT "t1".* FROM t1;
+END|
+SET STATEMENT sql_mode='ansi' FOR
+BEGIN NOT ATOMIC
+ SELECT @@sql_mode;
+ SELECT * FROM t1;
+ SELECT @@sql_mode;
+END|
+DELIMITER ;|
+--echo ''
+--echo ''
+--echo '#------------------Test 17-----------------------#'
+####################################################################
+# Test effect of SET STATEMENT FOR with SET SESSION modifying #
+# the same variables as the SET STATEMENT #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=320000,
+ myisam_repair_threads=2,
+ sort_buffer_size=220022,
+ binlog_format=row,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000
+ FOR SET SESSION
+ myisam_sort_buffer_size=260000,
+ myisam_repair_threads=3,
+ sort_buffer_size=230013,
+ binlog_format=row,
+ keep_files_on_create=ON,
+ max_join_size=2323230000000;
+
+--echo ''
+--echo '# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+
+--echo ''
+--echo ''
+--echo '#------------------Test 18-----------------------#'
+####################################################################
+# Test effect of SET SESSION inside a stored procedure with #
+# with a SET STATEMENT on outside variables #
+####################################################################
+--echo '# set initial variable values
+SET SESSION myisam_sort_buffer_size=500000,
+ myisam_repair_threads=1,
+ sort_buffer_size=100000,
+ binlog_format=mixed,
+ keep_files_on_create=ON,
+ max_join_size=2222220000000;
+--echo ''
+--echo '# Pre-STATEMENT variable value
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+--echo ''
+--echo ''
+DELIMITER |;
+CREATE PROCEDURE p5() BEGIN
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ SET SESSION
+ myisam_sort_buffer_size=260000,
+ myisam_repair_threads=3,
+ sort_buffer_size=230013,
+ binlog_format=row,
+ keep_files_on_create=ON,
+ max_join_size=2323230000000;
+ SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+ END|
+DELIMITER ;|
+--echo ''
+--echo ''
+SET STATEMENT myisam_sort_buffer_size=400000,
+ myisam_repair_threads=2,
+ sort_buffer_size=200000,
+ binlog_format=row,
+ keep_files_on_create=OFF,
+ max_join_size=4444440000000 FOR
+ CALL p5();
+
+--echo ''
+--echo '# Post-STATEMENT
+SELECT @@myisam_sort_buffer_size,
+ @@myisam_repair_threads,
+ @@sort_buffer_size,
+ @@binlog_format,
+ @@keep_files_on_create,
+ @@max_join_size;
+
+--echo ''
+--echo ''
+--echo '#------------------Test 19-----------------------#'
+#Test for bad syntax
+--error ER_PARSE_ERROR
+SET STATEMENT max_error_count=100 FOR;
+--error ER_PARSE_ERROR
+SET STATEMENT max_error_count=100 INSERT t1 VALUES (1,2);
+--error ER_PARSE_ERROR
+SET STATEMENT FOR INSERT INTO t1 VALUES (1,2);
+--error ER_PARSE_ERROR
+SET max_error_count=100 FOR INSERT INTO t1 VALUES (1,2);
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SET STATEMENT GLOBAL max_error_count=100 FOR INSERT INTO t1 VALUES (1,2);
+--error ER_PARSE_ERROR
+SET STATEMENT @@global.max_error_count=100 FOR INSERT INTO t1 VALUES (1,2);
+
+--echo ''
+--echo ''
+--echo '#------------------Test 20-----------------------#'
+#Test for global-only variables
+--error ER_GLOBAL_VARIABLE
+SET STATEMENT connect_timeout=100 FOR INSERT INTO t1 VALUES (1,2);
+
+--echo ''
+--echo ''
+--echo '#------------------Test 21-----------------------#'
+#Test for recursion
+SELECT @@myisam_sort_buffer_size, @@sort_buffer_size;
+SET STATEMENT myisam_sort_buffer_size = 700000, sort_buffer_size = 3000000
+ FOR SET STATEMENT myisam_sort_buffer_size=200000
+ FOR SELECT @@myisam_sort_buffer_size, @@sort_buffer_size;
+SELECT @@myisam_sort_buffer_size, @@sort_buffer_size;
+
+--echo ''
+--echo ''
+--echo '#------------------Test 22-----------------------#'
+#Test for STATEMENT keyword
+CREATE TABLE STATEMENT(a INT);
+DROP TABLE STATEMENT;
+
+--echo ''
+--echo '# Cleanup'
+DROP TABLE t1;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+
+#
+# Limitation of opening tables for set operation
+#
+CREATE TABLE t1 (v1 INT, v2 INT);
+insert into t1 values (1,1);
+DELIMITER |;
+CREATE FUNCTION myProc ()
+ RETURNS INT
+
+ SQL SECURITY DEFINER
+
+ BEGIN
+ DECLARE mx INT;
+ SET mx = (select max(v1) from t1);
+ RETURN mx;
+ END|
+DELIMITER ;|
+--error ER_SUBQUERIES_NOT_SUPPORTED
+SET STATEMENT myisam_repair_threads=(select max(v1) from t1) FOR
+ select 1;
+
+--error ER_SUBQUERIES_NOT_SUPPORTED
+SET STATEMENT myisam_repair_threads=myProc() FOR
+ select 1;
+drop function myProc;
+drop table t1;
+
+#
+# Prepared Statement
+#
+set session binlog_format=mixed;
+PREPARE stmt1 FROM 'SELECT @@binlog_format';
+execute stmt1;
+set statement binlog_format=row for execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+set statement binlog_format=row for PREPARE stmt1 FROM 'SELECT @@binlog_format';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+PREPARE stmt1 FROM 'set statement binlog_format=row for SELECT @@binlog_format';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+set session binlog_format=default;
+
+#
+# Percona server bug#1341438
+# SET SESSION statement combined with SET STATEMENT has no effect
+#
+set session binlog_format=mixed;
+SET STATEMENT sort_buffer_size=150000 FOR set session binlog_format=row;
+SELECT @@binlog_format;
+
+#
+# restore variables of original tests
+#
+SET @@binlog_format = @save_binlog_format;
+SET @@keep_files_on_create = @save_keep_files_on_create;
+SET @@max_join_size = @save_max_join_size;
+SET @@myisam_repair_threads = @save_myisam_repair_threads;
+SET @@myisam_sort_buffer_size = @save_myisam_sort_buffer_size;
+SET @@sort_buffer_size = @save_sort_buffer_size;
+
+#
+# Percona sever bug#1341606
+# SET STATEMENT incorrectly restore vaues of some variables
+#
+--echo #Correctly set timestamp
+set session timestamp=4646464;
+select @@timestamp != 4646464;
+select @@timestamp != 4646464;
+--echo #Correctly returned normal behaviour
+set session timestamp=default;
+select @@timestamp != 4646464;
+select @@timestamp != 4646464;
+--echo #here timestamp should be set only for the statement then restored default
+set statement timestamp=4646464 for select @@timestamp;
+set @save_tm=@@timestamp;
+select @@timestamp != 4646464;
+select @@timestamp != 4646464;
+let $wait_condition=select @@timestamp != @save_tm;
+source include/wait_condition.inc;
+eval $wait_condition;
+
+#
+# Test of temporary changing default storage engine
+#
+set @save_dfs=@@default_storage_engine;
+SET @@default_storage_engine=MyISAM;
+SET STATEMENT default_storage_engine=MEMORY for CREATE TABLE t1 (a int);
+SHOW CREATE TABLE t1;
+select @@default_storage_engine;
+drop table t1;
+SET STATEMENT default_storage_engine=MyISAM for CREATE TABLE t1 (a int);
+SHOW CREATE TABLE t1;
+drop table t1;
+SET @@default_storage_engine=@save_dfs;
+
+#
+# MDEV-6946:Assertion `0' failed in mysql_execute_command on SET STATEMENT
+# keycache1.key_buffer_size=.. FOR
+#
+--error ER_GLOBAL_VARIABLE
+SET STATEMENT keycache1.key_buffer_size=1024 FOR SELECT 1;
+
+
+#
+# MDEV-6940: SET STATEMENT executed after SET GLOBAL does not work
+#
+set @save_general_log=@@global.general_log;
+--echo # SET STATEMENT works (OK)
+set statement lock_wait_timeout=1 for select @@lock_wait_timeout;
+--echo # Setting a totally unrelated global variable
+set global general_log=0;
+--echo # SET STATEMENT should work
+set statement lock_wait_timeout=1 for select @@lock_wait_timeout;
+set global general_log=@save_general_log;
+
+--echo # MDEV-7006 MDEV-7007: SET statement and slow log
+
+set @save_long_query_time= @@long_query_time;
+set @save_slow_query_log= @@slow_query_log;
+set @save_log_output= @@log_output;
+
+set statement long_query_time=default for select @@long_query_time;
+set statement log_slow_filter=default for select @@log_slow_filter;
+set statement log_slow_verbosity=default for select @@log_slow_verbosity;
+set statement log_slow_rate_limit=default for select @@log_slow_rate_limit;
+set statement slow_query_log=default for select @@slow_query_log;
+
+truncate table mysql.slow_log;
+set slow_query_log= 1;
+set global log_output='TABLE';
+
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+set @@long_query_time=0.01;
+--echo #should be written
+select sleep(0.1);
+set @@long_query_time=@save_long_query_time;
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+--echo #---
+--echo #should be written
+set statement long_query_time=0.01 for select sleep(0.1);
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+--echo #---
+set @@long_query_time=0.01;
+--echo #should NOT be written
+set statement slow_query_log=0 for select sleep(0.1);
+set @@long_query_time=@save_long_query_time;
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+--echo #---
+--echo #should NOT be written
+set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1);
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+--echo #---
+--echo #should NOT be written
+set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1);
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+--echo #---
+--echo #should NOT be written
+set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1);
+select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
+--echo #---
+#
+# log_slow_verbosity is impossible to check because results are not written
+# in TABLE mode
+#
+
+set global log_output= @save_log_output;
+set @@slow_query_log= @save_slow_query_log;
+set @@long_query_time= @save_long_query_time;
+truncate table mysql.slow_log;
+
+
+#
+# Prohibited Variables
+#
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement autocommit=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement tx_isolation=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement skip_replication=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement sql_log_off=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement character_set_client=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement character_set_connection=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement character_set_filesystem=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement collation_connection=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement query_cache_type=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement wait_timeout=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement interactive_timeout=default for select 1;
+
+# MDEV-6996: SET STATEMENT default_week_format = .. has no effect
+set @save_week_format=@@default_week_format;
+set @@default_week_format=0;
+SET STATEMENT default_week_format = 2 FOR SELECT WEEK('2000-01-01');
+create table t1 (a date);
+insert t1 values ('2000-01-01');
+explain extended select week(a) from t1;
+prepare stmt1 from "select week(a) from t1";
+execute stmt1;
+set default_week_format = 2;
+execute stmt1;
+alter table t1 engine=myisam;
+execute stmt1;
+deallocate prepare stmt1;
+drop table t1;
+set @@default_week_format=@save_week_format;
+
+# MDEV-7015: SET STATEMENT old_passwords has no effect
+set @save_old_passwords=@@old_passwords;
+set @@old_passwords=0;
+set statement OLD_PASSWORDS = 0 for select password('test');
+set statement OLD_PASSWORDS = 1 for select password('test');
+set statement OLD_PASSWORDS = 0 for explain extended select password('test');
+set statement OLD_PASSWORDS = 1 for explain extended select password('test');
+create table t1 (a char(10));
+insert t1 values ('qwertyuiop');
+prepare stmt1 from "select password(a) from t1";
+execute stmt1;
+set old_passwords=1;
+execute stmt1;
+alter table t1 engine=myisam;
+execute stmt1;
+deallocate prepare stmt1;
+drop table t1;
+set @@old_passwords=@save_old_passwords;
+
+--echo #
+--echo #MDEV-6951:Erroneous SET STATEMENT produces two identical errors
+--echo #
+
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+set statement non_existing=1 for select 1;
+show errors;
+
+--echo #
+--echo # MDEV-6954: SET STATEMENT rand_seedX = ...FOR ... makes
+--echo # the next rand() to return 0
+--echo #
+set @rnd=1;
+let $1=10;
+--disable_query_log
+--echo # test that rand() is not always 0 after restoring rand_seed, rand_seed2...
+while ($1)
+{
+ --disable_result_log
+ set statement rand_seed1=1, rand_seed2=1 for select 1;
+ --enable_result_log
+ set @rnd= rand()=0 and @rnd;
+ dec $1;
+}
+--enable_query_log
+--echo # @rnd should be 0
+select @rnd;
diff --git a/mysql-test/t/set_statement_debug.test b/mysql-test/t/set_statement_debug.test
new file mode 100644
index 00000000000..a409370a61a
--- /dev/null
+++ b/mysql-test/t/set_statement_debug.test
@@ -0,0 +1,24 @@
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+set @save_debug_dbug= @@debug_dbug;
+
+# check that change debug_dbug visible in SELECT
+set statement debug_dbug="d,something" for select @@debug_dbug;
+set @@debug_dbug= @save_debug_dbug;
+
+#check that change debug_dbug has influence of hooks...
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+CALL mtr.add_suppression("Out of sort memory");
+--error ER_OUT_OF_SORTMEMORY
+SET statement debug_dbug= '+d,alloc_sort_buffer_fail' for SELECT * FROM t1 ORDER BY f1 ASC, f0;
+
+# ... and works only for one statement
+SELECT * FROM t1 ORDER BY f1 ASC, f0;
+
+DROP TABLE t1;
+set @@debug_dbug= @save_debug_dbug;
+
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement DEBUG_SYNC = 'now SIGNAL hi' for select 1;
diff --git a/mysql-test/t/set_statement_notembedded.test b/mysql-test/t/set_statement_notembedded.test
new file mode 100644
index 00000000000..7bb8f5e1aab
--- /dev/null
+++ b/mysql-test/t/set_statement_notembedded.test
@@ -0,0 +1,13 @@
+--source include/not_embedded.inc
+
+#
+# statement timeout
+#
+SELECT @@MAX_STATEMENT_TIME;
+SET STATEMENT MAX_STATEMENT_TIME=2 FOR SELECT SLEEP(1);
+SHOW STATUS LIKE "max_statement_time_exceeded";
+SET STATEMENT MAX_STATEMENT_TIME=2 FOR SELECT SLEEP(3);
+SHOW STATUS LIKE "max_statement_time_exceeded";
+SELECT @@MAX_STATEMENT_TIME;
+
+
diff --git a/mysql-test/t/set_statement_notembedded_binlog.test b/mysql-test/t/set_statement_notembedded_binlog.test
new file mode 100644
index 00000000000..62c351ed6f7
--- /dev/null
+++ b/mysql-test/t/set_statement_notembedded_binlog.test
@@ -0,0 +1,87 @@
+--source include/have_log_bin.inc
+--source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+drop view if exists t1;
+--enable_warnings
+
+--echo #
+--echo # MDEV-6948: SET STATEMENT gtid_domain_id = ... FOR has no effect
+--echo # (same for gtid_seq_no and server_id)
+--echo #
+reset master;
+create table t1 (i int);
+set gtid_domain_id = 10;
+insert into t1 values (1),(2);
+set statement gtid_domain_id = 20 for insert into t1 values (3),(4);
+
+--replace_column 1 x 2 x 3 x 4 x 5 x
+show binlog events limit 5,5;
+
+drop table t1;
+
+reset master;
+SET @a=11;
+
+create table t1 (a int not null auto_increment, c int, d int, primary key (a));
+create table t2 (b int);
+insert into t2 values (1),(2);
+
+DELIMITER |;
+CREATE function f1() returns int
+BEGIN
+ SET STATEMENT last_insert_id=@a for insert into t1 values (NULL, @a,
+ last_insert_id());
+ SET @a:=@a*100+13;
+ return @a;
+end|
+DELIMITER ;|
+
+
+call mtr.add_suppression("Unsafe statement written to the binary log using");
+select f1() from t2;
+
+--replace_column 1 x 2 x 3 x 4 x 5 x
+show binlog events limit 16, 100;
+
+select * from t1;
+
+drop function f1;
+drop table t1,t2;
+
+
+reset master;
+SET @a=11;
+
+create table t1 (a int not null auto_increment, c int, d int, primary key (a));
+create table t2 (b int);
+insert into t2 values (1),(2);
+
+DELIMITER |;
+CREATE function f1() returns int
+BEGIN
+ SET @save= @@last_insert_id;
+ SET session last_insert_id=@a;
+ insert into t1 values (NULL, @a, last_insert_id());
+ SET session last_insert_id=@save;
+ SET @a:=@a*100+13;
+ return @a;
+end|
+DELIMITER ;|
+
+select f1() from t2;
+
+--replace_column 1 x 2 x 3 x 4 x 5 x
+show binlog events limit 13, 100;
+
+select * from t1;
+
+drop function f1;
+drop table t1,t2;
+
+reset master;
+set statement last_insert_id = 112 for create table t1 as select last_insert_id();
+--replace_column 1 x 2 x 3 x 4 x 5 x
+show binlog events limit 4,1;
+drop table t1;
diff --git a/mysql-test/t/set_statement_profiling.test b/mysql-test/t/set_statement_profiling.test
new file mode 100644
index 00000000000..6ef64d2f18c
--- /dev/null
+++ b/mysql-test/t/set_statement_profiling.test
@@ -0,0 +1,9 @@
+source include/have_profiling.inc;
+
+#
+# Prohibited Variables
+#
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement profiling=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement profiling_history_size=default for select 1;
diff --git a/mysql-test/t/show.test b/mysql-test/t/show.test
new file mode 100644
index 00000000000..3101f443264
--- /dev/null
+++ b/mysql-test/t/show.test
@@ -0,0 +1,15 @@
+#
+# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
+# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
+# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
+#
+--error ER_PARSE_ERROR
+show statistics;
+--error ER_PARSE_ERROR
+show spatial_ref_sys
+--error ER_PARSE_ERROR
+show system_variables;
+--error ER_PARSE_ERROR
+show geometry_columns;
+--error ER_PARSE_ERROR
+show nonexistent;
diff --git a/mysql-test/t/show_check-master.opt b/mysql-test/t/show_check-master.opt
index a16d72855a2..af474d42e8d 100644
--- a/mysql-test/t/show_check-master.opt
+++ b/mysql-test/t/show_check-master.opt
@@ -1 +1 @@
---log-output=table,file --slow-query-log --log-queries-not-using-indexes --myisam-recover=""
+--log-output=table,file --slow-query-log --log-queries-not-using-indexes --myisam-recover-options=""
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index c43193d1b57..d9aed952fce 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -135,9 +135,11 @@ show create table t1;
drop table t1;
flush tables;
+--sorted_result
show open tables;
create table t1(n int);
insert into t1 values (1);
+--sorted_result
show open tables;
drop table t1;
@@ -168,7 +170,7 @@ type_numeric numeric(5,2),
empty_char char(0),
type_char char(2),
type_varchar varchar(10),
-type_timestamp timestamp not null,
+type_timestamp timestamp not null default current_timestamp on update current_timestamp,
type_date date not null default '0000-00-00',
type_time time not null default '00:00:00',
type_datetime datetime not null default '0000-00-00 00:00:00',
@@ -320,8 +322,11 @@ create database mysqltest;
show create database mysqltest;
create table mysqltest.t1(a int);
insert into mysqltest.t1 values(1);
+create user mysqltest_1@localhost;
grant select on `mysqltest`.* to mysqltest_1@localhost;
+create user mysqltest_2@localhost;
grant usage on `mysqltest`.* to mysqltest_2@localhost;
+create user mysqltest_3@localhost;
grant drop on `mysqltest`.* to mysqltest_3@localhost;
connect (con1,localhost,mysqltest_1,,mysqltest);
@@ -617,6 +622,7 @@ show databases;
show tables;
show events;
show table status;
+--sorted_result
show open tables;
show plugins;
show columns in t1;
@@ -987,6 +993,7 @@ create database mysqltest;
show create database mysqltest;
create table mysqltest.t1(a int);
insert into mysqltest.t1 values(1);
+create user mysqltest_4@localhost;
grant select on `mysqltest`.`t1` to mysqltest_4@localhost;
connect (con4,localhost,mysqltest_4,,mysqltest);
connection con4;
diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test
index 83c05d93007..6615ff66737 100644
--- a/mysql-test/t/show_explain.test
+++ b/mysql-test/t/show_explain.test
@@ -753,6 +753,7 @@ drop table t1,t3,t4;
--echo #
--echo # ---------- SHOW EXPLAIN and permissions -----------------
--echo #
+create user test2@localhost;
grant ALL on test.* to test2@localhost;
# Give the user SUPER privilege so it can set debug_dbug variable.
@@ -1201,4 +1202,3 @@ drop table t0,t1,t2;
connection default;
disconnect con1;
set debug_sync='RESET';
-
diff --git a/mysql-test/t/show_grants_with_plugin-7985.test b/mysql-test/t/show_grants_with_plugin-7985.test
index 339c75c7c49..9c05cb2e06d 100644
--- a/mysql-test/t/show_grants_with_plugin-7985.test
+++ b/mysql-test/t/show_grants_with_plugin-7985.test
@@ -138,7 +138,7 @@ show grants;
--echo #
--echo # Clear all passwords from the user.
--echo #
-GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password;
+set password for u1 = '';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
--echo #
diff --git a/mysql-test/t/single_delete_update.test b/mysql-test/t/single_delete_update.test
index e3ee13f891c..ec939641ea3 100644
--- a/mysql-test/t/single_delete_update.test
+++ b/mysql-test/t/single_delete_update.test
@@ -452,30 +452,3 @@ SELECT * FROM t2 WHERE c = 10 ORDER BY a DESC, b DESC;
DROP TABLE t1, t2;
-
---echo #
---echo # Bug #53742: UPDATEs have no effect after applying patch for bug 36569
---echo #
-
---disable_warnings
-CREATE TABLE t1 (
- pk INT NOT NULL AUTO_INCREMENT,
- c1_idx CHAR(1) DEFAULT 'y',
- c2 INT,
- PRIMARY KEY (pk),
- INDEX c1_idx (c1_idx)
-) ENGINE=InnoDB;
---enable_warnings
-
-INSERT INTO t1 VALUES (), (), (), ();
-
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
-
-DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
-SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
-
-DROP TABLE t1;
-
diff --git a/mysql-test/t/single_delete_update_innodb.test b/mysql-test/t/single_delete_update_innodb.test
new file mode 100644
index 00000000000..7e7817d4dd6
--- /dev/null
+++ b/mysql-test/t/single_delete_update_innodb.test
@@ -0,0 +1,30 @@
+#
+# Single table specific update/delete tests (mysql_update and mysql_delete)
+#
+--source include/have_innodb.inc
+
+
+--echo #
+--echo # Bug #53742: UPDATEs have no effect after applying patch for bug 36569
+--echo #
+
+CREATE TABLE t1 (
+ pk INT NOT NULL AUTO_INCREMENT,
+ c1_idx CHAR(1) DEFAULT 'y',
+ c2 INT,
+ PRIMARY KEY (pk),
+ INDEX c1_idx (c1_idx)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (), (), (), ();
+
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
+
+DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
+SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 77339478fdb..5f79404e7e4 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -132,3 +132,8 @@ select count(*) from information_schema.USER_PRIVILEGES;
select no_such_function(1);
--echo End of 5.1 tests
+
+#
+# MDEV-8280 crash in 'show global status' with --skip-grant-tables
+#
+show global status like 'Acl%';
diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test
index a14f3af5cd6..b0c5118f970 100644
--- a/mysql-test/t/skip_name_resolve.test
+++ b/mysql-test/t/skip_name_resolve.test
@@ -5,6 +5,7 @@
--source include/count_sessions.inc
# Bug#8471 IP address with mask fail when skip-name-resolve is on
+CREATE USER mysqltest_1@'127.0.0.1/255.255.255.255';
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
diff --git a/mysql-test/t/slowlog_enospace-10508.test b/mysql-test/t/slowlog_enospace-10508.test
new file mode 100644
index 00000000000..b2c26a5984d
--- /dev/null
+++ b/mysql-test/t/slowlog_enospace-10508.test
@@ -0,0 +1,24 @@
+#
+# MDEV-10508 Mariadb crash on out of disk space during dump import
+#
+--source include/have_sequence.inc
+--source include/have_debug.inc
+
+call mtr.add_suppression('Error writing file.*errno: 28 ');
+create table t1 (a int, b int) engine=memory;
+insert t1 select seq, seq+1 from seq_1_to_1000;
+set global general_log=0;
+set global log_queries_not_using_indexes=1;
+set debug_dbug='+d,simulate_file_write_error';
+--disable_result_log
+--let $run= 50
+while ($run)
+{
+ select * from t1 where a>10;
+ dec $run;
+}
+--enable_result_log
+set debug_dbug='';
+set global general_log=1;
+set global log_queries_not_using_indexes=default;
+drop table t1;
diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test
index 880bbce3d9d..6e19fd885e3 100644
--- a/mysql-test/t/sp-destruct.test
+++ b/mysql-test/t/sp-destruct.test
@@ -214,7 +214,6 @@ RENAME TABLE mysql.procs_priv TO procs_priv_backup;
FLUSH TABLE mysql.procs_priv;
# DROP FUNCTION used to cause an assert.
---error ER_NO_SUCH_TABLE
DROP FUNCTION f1;
SHOW WARNINGS;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 711e639191e..a47fbe7a372 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1766,11 +1766,10 @@ CREATE IF NOT EXISTS PROCEDURE bug14702()
BEGIN
END;
---error ER_PARSE_ERROR
CREATE PROCEDURE IF NOT EXISTS bug14702()
BEGIN
END;
-
+DROP PROCEDURE IF EXISTS bug14702;
#
# BUG#20953: create proc with a create view that uses local
@@ -2051,13 +2050,8 @@ delimiter ;|
--disable_warnings
drop function if exists bug20701;
--enable_warnings
-#
-# This was disabled in 5.1.12. See bug #20701
-# When collation support in SP is implemented, then this test should
-# be removed.
-#
---error ER_NOT_SUPPORTED_YET
create function bug20701() returns varchar(25) binary return "test";
+drop function bug20701;
create function bug20701() returns varchar(25) return "test";
drop function bug20701;
@@ -2612,7 +2606,7 @@ delimiter |;
CREATE PROCEDURE p1()
BEGIN
DECLARE c INT DEFAULT 0;
- DECLARE CONTINUE HANDLER FOR SQLWARNING SET c = c + 1;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '22007' SET c = c + 1;
CALL p2();
CALL p3();
CALL p4();
@@ -2647,7 +2641,7 @@ CREATE PROCEDURE p5()
CREATE PROCEDURE P6()
BEGIN
DECLARE c INT DEFAULT 0;
- DECLARE CONTINUE HANDLER FOR SQLWARNING SET c = c + 1;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '22007' SET c = c + 1;
CALL p5();
SELECT c;
END|
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index a2079e91440..a5df4859d6b 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -7,13 +7,13 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
-
connect (con1root,localhost,root,,);
connection con1root;
use test;
# Create user user1 with no particular access rights
+create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;
@@ -57,10 +57,13 @@ call stamp(1);
select * from t1;
select db();
+create user user1@'%';
grant execute on procedure db1_secret.stamp to user1@'%';
grant execute on function db1_secret.db to user1@'%';
+set sql_mode='';
grant execute on procedure db1_secret.stamp to ''@'%';
grant execute on function db1_secret.db to ''@'%';
+set sql_mode=default;
connect (con2user1,localhost,user1,,);
connect (con3anon,localhost,anon,,);
@@ -175,6 +178,7 @@ insert into t2 values (0);
grant usage on db2.* to user1@localhost;
grant select on db2.* to user1@localhost;
+create user user2@localhost;
grant usage on db2.* to user2@localhost;
grant select,insert,update,delete,create routine on db2.* to user2@localhost;
grant create routine on db2.* to user1@localhost;
@@ -263,8 +267,11 @@ flush privileges;
#
# Test the new security acls
#
+create user usera@localhost;
grant usage on *.* to usera@localhost;
+create user userb@localhost;
grant usage on *.* to userb@localhost;
+create user userc@localhost;
grant usage on *.* to userc@localhost;
create database sptest;
create table t1 ( u varchar(64), i int );
@@ -340,11 +347,13 @@ connection root;
--disable_warnings
drop function if exists bug_9503;
+drop user if exists user1@localhost;
--enable_warnings
delimiter //;
create database mysqltest//
use mysqltest//
create table t1 (s1 int)//
+create user user1@localhost//
grant select on t1 to user1@localhost//
create function bug_9503 () returns int sql security invoker begin declare v int;
select min(s1) into v from t1; return v; end//
@@ -420,6 +429,7 @@ begin
end//
delimiter ;//
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
connect (n1,localhost,mysqltest_1,,information_schema,$MASTER_MYPORT,$MASTER_MYSOCK);
@@ -1040,3 +1050,10 @@ drop database mysqltest_db;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
+set password=password('foobar');
+create procedure sp1() select 1;
+show grants;
+grant execute on procedure sp1 to current_user() identified by 'barfoo';
+show grants;
+drop procedure sp1;
+set password='';
diff --git a/mysql-test/t/sp-ucs2.test b/mysql-test/t/sp-ucs2.test
index f6f70c3c103..3532169e5a1 100644
--- a/mysql-test/t/sp-ucs2.test
+++ b/mysql-test/t/sp-ucs2.test
@@ -114,7 +114,7 @@ DROP FUNCTION f1|
#
# COLLATE with no CHARACTER SET in IN param
#
---error ER_NOT_SUPPORTED_YET
+--error ER_COLLATION_CHARSET_MISMATCH
CREATE FUNCTION f(f1 VARCHAR(64) COLLATE ucs2_unicode_ci)
RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
@@ -125,7 +125,7 @@ END|
#
# COLLATE with no CHARACTER SET in RETURNS
#
---error ER_NOT_SUPPORTED_YET
+--error ER_COLLATION_CHARSET_MISMATCH
CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci
BEGIN
@@ -136,7 +136,7 @@ END|
#
# COLLATE with no CHARACTER SET in DECLARE
#
---error ER_NOT_SUPPORTED_YET
+--error ER_COLLATION_CHARSET_MISMATCH
CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index c5d37d1017d..4b2230ea7da 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -4,7 +4,7 @@
# Test cases for bugs are added at the end. See template there.
#
# Some tests that require --error go into sp-error.test
-# Tests that require inndb go into sp_trans.test
+# Tests that require innodb go into sp_trans.test
# Tests that check privilege and security issues go to sp-security.test.
# Tests that require multiple connections, except security/privilege tests,
# go to sp-thread.
@@ -14,7 +14,6 @@
# Tests that require --with-geometry go into sp_gis.test
# Tests that require multibyte character sets, which are not always available,
# go into separate files (e.g. sp-ucs2.test)
-
use test;
# Test tables
@@ -4355,17 +4354,14 @@ begin
return f1;
end|
drop function bug9048|
-#
-# This was disabled in 5.1.12. See bug #20701
-# When collation support in SP is implemented, then this test should
-# be removed.
-#
---error ER_NOT_SUPPORTED_YET
+
create function bug9048(f1 char binary) returns char binary
begin
set f1= concat( 'hello', f1 );
return f1;
end|
+select collation(bug9048("foo"))|
+drop function bug9048|
# Bug #12849 Stored Procedure: Crash on procedure call with CHAR type
# 'INOUT' parameter
@@ -9462,3 +9458,300 @@ CALL SP_EXAMPLE_SELECT ();
drop procedure SP_EXAMPLE_SELECT;
drop view ENTITY_ACCESS;
drop table ANY_TABLE, SECURITY_PATH;
+--echo # End of 10.0 test
+
+DELIMITER |;
+CREATE FUNCTION f(f1 VARCHAR(64) COLLATE latin1_german2_ci)
+ RETURNS VARCHAR(64)
+BEGIN
+ RETURN 'str';
+END|
+DROP FUNCTION f|
+
+CREATE FUNCTION f(f1 VARCHAR(64))
+ RETURNS VARCHAR(64) COLLATE latin1_german2_ci
+BEGIN
+ RETURN 'str';
+END|
+DROP FUNCTION f|
+
+CREATE FUNCTION f(f1 VARCHAR(64))
+ RETURNS VARCHAR(64)
+BEGIN
+ DECLARE f2 VARCHAR(64) COLLATE latin1_german2_ci;
+ RETURN 'str';
+END|
+DROP FUNCTION f|
+DELIMITER ;|
+
+--echo #
+--echo # MDEV-7023: Error 2027: Malformed packet and assertion
+--echo # `field_types == 0 || field_types[field_pos] == MYSQL_TYPE_INT24 ||
+--echo #field_types[field_pos] == MYSQL_TYPE_LONG' failure in
+--echo #Protocol_text::store_long
+--echo #
+create table t1 (i int);
+create table t2 (i int);
+--delimiter |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze insert into t1 values (1);
+ return 1;
+end |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze insert t1 select * from t2;
+ return 1;
+end |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze delete from t1;
+ return 1;
+end |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze delete t1 from t1,t2;
+ return 1;
+end |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze update t1 set i=1;
+ return 1;
+end |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze update t1,t2 set i=1;
+ return 1;
+end |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze replace t1 set i=1;
+ return 1;
+end |
+--error ER_SP_NO_RETSET
+create function f() returns int
+begin
+ analyze replace t1 select * from t2;
+ return 1;
+end |
+--delimiter ;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-11584: GRANT inside an SP does not work well on 2nd execution
+--echo #
+
+CREATE PROCEDURE sp1()
+ GRANT ALL PRIVILEGES ON *.* TO 'foo'@'%' IDENTIFIED BY 'pass';
+CALL sp1();
+CALL sp1();
+drop user 'foo'@'%';
+drop procedure sp1;
+
+--echo #
+--echo # MDEV-10972: Insert from select / view / union --
+--echo # repeatable crash in 10.1, 10.2 Linux/Mac/Windows
+--echo #
+
+create table t (id int auto_increment primary key);
+insert into t values (9494),(9495),(9496),(9497),(9498),(9499),(9500),(9501),(9502),(9503);
+
+create VIEW v AS
+select id from t
+union
+select id from t
+;
+
+drop procedure if exists p;
+create procedure p()
+insert into tmp_t select t.id from (
+ select id from v
+ union
+ select id from v
+) sq
+inner join t on (sq.id = t.id);
+
+--error ER_NO_SUCH_TABLE
+CALL p();
+create table tmp_t (id int null);
+CALL p();
+
+drop procedure p;
+drop view v;
+drop table t, tmp_t;
+
+
+--echo #
+--echo # MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
+--echo #
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
+CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(i) FROM v1 );
+
+--error ER_NON_INSERTABLE_TABLE
+REPLACE INTO v1 VALUES (f1());
+SET @aux = f1();
+
+# Cleanup
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-14857: problem with 10.2.11 server crashing when
+--echo # executing stored procedure
+--echo #
+
+SET max_sp_recursion_depth=10;
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+
+delimiter ||;
+
+CREATE PROCEDURE proc_0()
+BEGIN
+ CALL empty_1();
+ CALL proc_1();
+END ||
+
+CREATE PROCEDURE proc_1()
+BEGIN
+ CALL proc_2();
+ CALL proc_3();
+ CALL proc_4();
+ CALL proc_5();
+END ||
+
+CREATE PROCEDURE proc_2()
+ CALL proc_6();
+||
+
+CREATE PROCEDURE proc_3()
+BEGIN
+ CALL empty_2();
+ CALL empty_3();
+END ||
+
+CREATE PROCEDURE proc_4()
+ CALL proc_7();
+||
+
+CREATE PROCEDURE proc_5()
+ CALL proc_select();
+||
+
+CREATE PROCEDURE proc_6()
+BEGIN
+ CALL empty_4();
+ CALL empty_5();
+ CALL empty_6();
+ CALL empty_7();
+ CALL proc_8();
+END ||
+
+CREATE PROCEDURE proc_7()
+ CALL proc_9('foo');
+||
+
+CREATE PROCEDURE proc_8()
+ CALL proc_10();
+||
+
+CREATE PROCEDURE proc_9(IN opt VARCHAR(40))
+ IF LEFT(opt,1) <> '_' THEN
+ CALL proc_11();
+ END IF;
+||
+
+CREATE PROCEDURE proc_10()
+ CALL proc_12();
+||
+
+CREATE PROCEDURE proc_11()
+BEGIN
+ CALL empty_8();
+ CALL empty_9();
+ CALL empty_10();
+ CALL proc_13();
+END ||
+
+CREATE PROCEDURE proc_12()
+BEGIN
+ CALL empty_11();
+ CALL empty_12();
+ CALL empty_13();
+END ||
+
+CREATE PROCEDURE proc_13()
+BEGIN
+ CALL proc_9('_bar');
+ CALL empty_14();
+END ||
+
+delimiter ;||
+
+CREATE PROCEDURE empty_1() BEGIN END ;
+CREATE PROCEDURE empty_2() BEGIN END ;
+CREATE PROCEDURE empty_3() BEGIN END ;
+CREATE PROCEDURE empty_4() BEGIN END ;
+CREATE PROCEDURE empty_5() BEGIN END ;
+CREATE PROCEDURE empty_6() BEGIN END ;
+CREATE PROCEDURE empty_7() BEGIN END ;
+CREATE PROCEDURE empty_8() BEGIN END ;
+CREATE PROCEDURE empty_9() BEGIN END ;
+CREATE PROCEDURE empty_10() BEGIN END ;
+CREATE PROCEDURE empty_11() BEGIN END ;
+CREATE PROCEDURE empty_12() BEGIN END ;
+CREATE PROCEDURE empty_13() BEGIN END ;
+CREATE PROCEDURE empty_14() BEGIN END ;
+
+CREATE PROCEDURE proc_select()
+ SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * FROM t2)
+;
+
+CALL proc_0();
+
+# Cleanup
+DROP PROCEDURE empty_1;
+DROP PROCEDURE empty_2;
+DROP PROCEDURE empty_3;
+DROP PROCEDURE empty_4;
+DROP PROCEDURE empty_5;
+DROP PROCEDURE empty_6;
+DROP PROCEDURE empty_7;
+DROP PROCEDURE empty_8;
+DROP PROCEDURE empty_9;
+DROP PROCEDURE empty_10;
+DROP PROCEDURE empty_11;
+DROP PROCEDURE empty_12;
+DROP PROCEDURE empty_13;
+DROP PROCEDURE empty_14;
+DROP PROCEDURE proc_0;
+DROP PROCEDURE proc_1;
+DROP PROCEDURE proc_2;
+DROP PROCEDURE proc_3;
+DROP PROCEDURE proc_4;
+DROP PROCEDURE proc_5;
+DROP PROCEDURE proc_6;
+DROP PROCEDURE proc_7;
+DROP PROCEDURE proc_8;
+DROP PROCEDURE proc_9;
+DROP PROCEDURE proc_10;
+DROP PROCEDURE proc_11;
+DROP PROCEDURE proc_12;
+DROP PROCEDURE proc_13;
+DROP PROCEDURE proc_select;
+DROP TABLE t1, t2;
+
+SET max_sp_recursion_depth=default;
+
+--echo #End of 10.1 tests
diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test
index 2a24ab3d005..d7aaaa4340f 100644
--- a/mysql-test/t/sp_notembedded.test
+++ b/mysql-test/t/sp_notembedded.test
@@ -219,6 +219,7 @@ delimiter ;|
drop procedure if exists bug15298_1;
drop procedure if exists bug15298_2;
--enable_warnings
+create user 'mysqltest_1'@'localhost';
grant all privileges on test.* to 'mysqltest_1'@'localhost';
create procedure 15298_1 () sql security definer show grants for current_user;
create procedure 15298_2 () sql security definer show grants;
@@ -486,6 +487,5 @@ drop user foo1@localhost;
#
set @@global.concurrent_insert= @old_concurrent_insert;
-
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index 39ac086071b..a9759b99269 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -5,6 +5,8 @@
-- source include/have_log_bin.inc
-- source include/have_innodb.inc
+set SQL_MODE="";
+
disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index b46da77554a..869bf45dbf3 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -93,7 +93,7 @@ set @@SQL_MODE=NULL;
set session sql_mode=ansi;
create table t1
(f1 integer auto_increment primary key,
- f2 timestamp default current_timestamp on update current_timestamp);
+ f2 timestamp not null default current_timestamp on update current_timestamp);
show create table t1;
set session sql_mode=no_field_options;
show create table t1;
diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test
index 67db668a1c2..f2ac288db7a 100644
--- a/mysql-test/t/ssl.test
+++ b/mysql-test/t/ssl.test
@@ -32,5 +32,10 @@ select 'still connected?';
connection default;
disconnect ssl_con;
+create user mysqltest_1@localhost;
+grant usage on mysqltest.* to mysqltest_1@localhost require cipher "AES256-SHA";
+--exec $MYSQL -umysqltest_1 --ssl-cipher=AES256-SHA -e "show status like 'ssl_cipher'" 2>&1
+drop user mysqltest_1@localhost;
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/ssl_7937.combinations b/mysql-test/t/ssl_7937.combinations
index 46a45686a9b..71b134e229a 100644
--- a/mysql-test/t/ssl_7937.combinations
+++ b/mysql-test/t/ssl_7937.combinations
@@ -1,3 +1,8 @@
+[x509v3]
+--loose-enable-ssl
+--loose-ssl-cert=$MYSQL_TEST_DIR/std_data/serversan-cert.pem
+--loose-ssl-key=$MYSQL_TEST_DIR/std_data/serversan-key.pem
+
[ssl]
--loose-enable-ssl
diff --git a/mysql-test/t/stack-crash.test b/mysql-test/t/stack-crash.test
index d5bdccc132d..e4feb95a332 100644
--- a/mysql-test/t/stack-crash.test
+++ b/mysql-test/t/stack-crash.test
@@ -32,7 +32,7 @@ CREATE TABLE t1 (
`sspo_lu_uid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`sspo_id`),
KEY `post_uid` (`sspo_uid`,`sspo_cr_date`)
-) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
+) AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES (1,2,'P','test1','',0,'','',NULL,'','','','','A','2013-09-30 00:19:32',2,'2013-09-30 00:19:32',2),(2,2,'P','bbb','',0,'','',NULL,'','','','','A','2013-10-02 15:06:35',2,'2013-10-02 15:06:35',2);
CREATE TABLE `t2` (
@@ -48,7 +48,7 @@ CREATE TABLE `t2` (
`spoo_lu_uid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`spoo_id`),
KEY `object_option_main_idx` (`spoo_user_type_id`,`spoo_uid`,`spoo_option_id`,`spoo_value`(255))
-) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8;
+) AUTO_INCREMENT=107 DEFAULT CHARSET=utf8;
INSERT INTO `t2` VALUES (19,1,2,6,'Dortmund','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2),(20,1,2,8,'49','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2);
SELECT Count(*)
diff --git a/mysql-test/t/stat_tables_par.test b/mysql-test/t/stat_tables_par.test
index 7305d1453a8..1866eb71d3b 100644
--- a/mysql-test/t/stat_tables_par.test
+++ b/mysql-test/t/stat_tables_par.test
@@ -44,7 +44,7 @@ select * from mysql.index_stats;
#
let $Q6=
-select sum(l_extendedprice*l_discount) as revenue
+select round(sum(l_extendedprice*l_discount),4) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
diff --git a/mysql-test/t/stat_tables_rbr.test b/mysql-test/t/stat_tables_rbr.test
index 4336c02c34b..29f7c4e6622 100644
--- a/mysql-test/t/stat_tables_rbr.test
+++ b/mysql-test/t/stat_tables_rbr.test
@@ -23,8 +23,7 @@ SET use_stat_tables = PREFERABLY;
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2;
ALTER TABLE t1 ANALYZE PARTITION p1;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
SET use_stat_tables = DEFAULT;
diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test
index 2c8dec307cc..3f08e2e133c 100644
--- a/mysql-test/t/statistics.test
+++ b/mysql-test/t/statistics.test
@@ -494,6 +494,17 @@ DELETE FROM mysql.table_stats;
DELETE FROM mysql.column_stats;
DELETE FROM mysql.index_stats;
+
+ANALYZE TABLE t1 PERSISTENT FOR COLUMNS(b) INDEXES();
+ANALYZE TABLE t1 PERSISTENT FOR columns(a,b) INDEXES();
+ANALYZE TABLE t1 PERSISTENT FOR columns(b) indexes(idx2);
+ANALYZE TABLE t1 PERSISTENT FOR columns() indexes(idx2);
+
+DELETE FROM mysql.table_stats;
+DELETE FROM mysql.column_stats;
+DELETE FROM mysql.index_stats;
+
+
DROP TABLE t1,t2;
set names utf8;
@@ -717,3 +728,40 @@ select db_name, table_name, column_name,
FROM mysql.column_stats;
drop table t1;
+
+--echo #
+--echo # MDEV-9590: Always print "Engine-independent statistic" warnings and
+--echo # might be filtering columns unintentionally from engines
+--echo #
+
+set use_stat_tables='NEVER';
+create table t1 (test blob);
+show variables like 'use_stat_tables';
+analyze table t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-10435 crash with bad stat tables
+--echo #
+
+set use_stat_tables='preferably';
+call mtr.add_suppression("Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted");
+
+rename table mysql.table_stats to test.table_stats;
+flush tables;
+create table t1 (a int);
+--error ER_NO_SUCH_TABLE
+rename table t1 to t2, t3 to t4;
+drop table t1;
+rename table test.table_stats to mysql.table_stats;
+
+rename table mysql.table_stats to test.table_stats;
+create table mysql.table_stats (a int);
+flush tables;
+create table t1 (a int);
+--error ER_NO_SUCH_TABLE
+rename table t1 to t2, t3 to t4;
+drop table t1, mysql.table_stats;
+rename table test.table_stats to mysql.table_stats;
+
+set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 9395323d32b..32b903c0265 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -281,6 +281,7 @@ create database db37908;
--enable_warnings
create table db37908.t1(f1 int);
insert into db37908.t1 values(1);
+create user mysqltest_1@localhost;
grant usage,execute on test.* to mysqltest_1@localhost;
delimiter |;
create procedure proc37908() begin select 1; end |
diff --git a/mysql-test/t/status_user.test b/mysql-test/t/status_user.test
deleted file mode 100644
index 9a51d0e1020..00000000000
--- a/mysql-test/t/status_user.test
+++ /dev/null
@@ -1,109 +0,0 @@
-#
-# Testing of user status (the userstat variable).
-# Note that this test requires a fresh restart to not have problems with the
-# old status values
-
--- source include/have_innodb.inc
--- source include/have_log_bin.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key;
-show columns from information_schema.client_statistics;
-show columns from information_schema.user_statistics;
-show columns from information_schema.index_statistics;
-show columns from information_schema.table_statistics;
-
-# Disable logging to get right number of writes into the tables.
-set @save_general_log=@@global.general_log;
-set @@global.general_log=0;
-set @@global.userstat=1;
-flush status;
-
-create table t1 (a int, primary key (a), b int default 0) engine=innodb;
-insert into t1 (a) values (1),(2),(3),(4);
-update t1 set b=1;
-update t1 set b=5 where a=2;
-delete from t1 where a=3;
-
-/* Empty query */
-select * from t1 where a=999;
-
-drop table t1;
-
-#
-# Test the commit and rollback are counted
-#
-
-create table t1 (a int, primary key (a), b int default 0) engine=innodb;
-begin;
-insert into t1 values(1,1);
-commit;
-begin;
-insert into t1 values(2,2);
-commit;
-begin;
-insert into t1 values(3,3);
-rollback;
-drop table t1;
-
-select sleep(1);
-
-show status like "rows%";
-show status like "ha%";
-select variable_value - @global_read_key as "handler_read_key" from information_schema.global_status where variable_name="handler_read_key";
-
-# Ensure that the following commands doesn't change statistics
-
-set @@global.userstat=0;
-
-#
-# Check that we got right statistics
-#
-select * from information_schema.index_statistics;
-select * from information_schema.table_statistics;
-show table_statistics;
-show index_statistics;
---query_vertical select TOTAL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;
---query_vertical select TOTAL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;
-flush table_statistics;
-flush index_statistics;
-select * from information_schema.index_statistics;
-select * from information_schema.table_statistics;
-show status like "%statistics%";
-
-#
-# Test that some variables are not 0
-#
-
-select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
- bytes_sent <> 0, binlog_bytes_written <> 0
- from information_schema.user_statistics;
-select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
- bytes_sent <> 0, binlog_bytes_written <> 0
- from information_schema.client_statistics;
-
-#
-# Test of in transaction
-#
-
-create table t1 (a int) engine=innodb;
-select @@in_transaction;
-begin;
-select @@in_transaction;
-insert into t1 values (1);
-select @@in_transaction;
-commit;
-select @@in_transaction;
-set @@autocommit=0;
-select @@in_transaction;
-insert into t1 values (2);
-select @@in_transaction;
-set @@autocommit=1;
-select @@in_transaction;
-drop table t1;
-
-# Cleanup
-set @@global.general_log=@save_general_log;
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 71b625e0843..93b31499bef 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -750,7 +750,7 @@ INSERT INTO t1 VALUES ('-101.55');
INSERT INTO t1 VALUES ('-1010.55');
--error 1264
INSERT INTO t1 VALUES ('-100E+1');
---error 1366
+--error WARN_DATA_TRUNCATED
INSERT INTO t1 VALUES ('-100E');
--error 1264
UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11;
@@ -764,7 +764,7 @@ INSERT INTO t1 (col1) VALUES ('');
#--error 1265
--error 1366
INSERT INTO t1 (col1) VALUES ('a59b');
---error 1366
+--error WARN_DATA_TRUNCATED
INSERT INTO t1 (col1) VALUES ('1a');
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
INSERT IGNORE INTO t1 values (1/0);
@@ -796,9 +796,9 @@ UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
--error 1365
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
---error 1265
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
INSERT INTO t1 (col1) VALUES ('');
---error 1265
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
INSERT INTO t1 (col1) VALUES ('a59b');
--error 1265
INSERT INTO t1 (col1) VALUES ('1a');
@@ -830,9 +830,9 @@ UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
--error 1365
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
---error 1265
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
INSERT INTO t1 (col1) VALUES ('');
---error 1265
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
INSERT INTO t1 (col1) VALUES ('a59b');
--error 1265
INSERT INTO t1 (col1) VALUES ('1a');
@@ -1132,11 +1132,11 @@ drop table t1;
#
set @@sql_mode='traditional';
-create table t1(a int, b timestamp);
+create table t1(a int, b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
alter table t1 add primary key(a);
show create table t1;
drop table t1;
-create table t1(a int, b timestamp default 20050102030405);
+create table t1(a int, b timestamp not null default 20050102030405);
alter table t1 add primary key(a);
show create table t1;
drop table t1;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 8c9a4893be2..717871db61d 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -569,8 +569,10 @@ drop table t1, t2;
create table t1 (a float);
-- error ER_NOT_SUPPORTED_YET
select 10.5 IN (SELECT * from t1 LIMIT 1);
--- error ER_NOT_SUPPORTED_YET
+-- error ER_WRONG_USAGE
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
+-- error ER_NOT_SUPPORTED_YET
+select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1);
drop table t1;
create table t1 (a int, b int, c varchar(10));
@@ -3598,7 +3600,7 @@ SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
---echo End of 5.0 tests.
+--echo # End of 5.0 tests.
#
# Test [NOT] IN truth table (both as top-level and general predicate).
@@ -4272,8 +4274,7 @@ SELECT * FROM (
# This was not allowed previously. Possibly, it should be allowed on the future.
# For now, the intent is to keep the fix as non-intrusive as possible.
---error ER_PARSE_ERROR
-SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a) q;
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
SELECT * FROM (SELECT 1 UNION SELECT 1) t1a;
--error ER_PARSE_ERROR
@@ -4308,7 +4309,7 @@ SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a;
# aliases after.
#
SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1;
---error ER_PARSE_ERROR
+--error ER_DERIVED_MUST_HAVE_ALIAS
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
--error ER_PARSE_ERROR
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
@@ -4400,8 +4401,9 @@ SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
--error ER_PARSE_ERROR
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
---error ER_PARSE_ERROR
+--error ER_DERIVED_MUST_HAVE_ALIAS
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ) a;
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
--error ER_PARSE_ERROR
@@ -4683,7 +4685,7 @@ select * from t2 where a=(select a from t1) and a='x';
drop table t1,t2;
---echo End of 5.1 tests
+--echo # End of 5.1 tests
--echo #
--echo # Bug #11765713 58705:
@@ -5154,7 +5156,7 @@ eval SELECT * FROM ( $subq ) AS alias3;
DROP TABLE t1,t2;
---echo End of 5.2 tests
+--echo # End of 5.2 tests
--echo #
--echo # BUG#779885: Crash in eliminate_item_equal with materialization=on in
@@ -6097,3 +6099,32 @@ SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
--echo End of 5.5 tests
+--echo # End of 10.0 tests
+
+--echo #
+--echo # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops
+--echo # with UNION in ALL subquery
+--echo #
+SET NAMES utf8;
+CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo');
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' );
+SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar');
+drop table t1;
+SET NAMES default;
+
+--echo #
+--echo # MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loops
+--echo #
+SET NAMES utf8;
+
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT UNSIGNED) ENGINE=MyISAM;
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo' UNION SELECT 'bar' );
+SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo');
+
+DROP TABLE t1, t2;
+SET NAMES default;
+
+--echo # End of 10.1 tests
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test
index e54308b5e46..d4ccbcf6f66 100644
--- a/mysql-test/t/subselect4.test
+++ b/mysql-test/t/subselect4.test
@@ -2034,3 +2034,13 @@ drop table t1,t2;
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;
+
+--echo #
+--echo # MDEV-10232 Scalar result of subquery changes after adding an outer select stmt
+--echo #
+
+create table t1(c1 int, c2 int, primary key(c2));
+insert into t1 values(2,1),(1,2);
+select (select c1 from t1 group by c1,c2 order by c1 limit 1) as x;
+(select c1 from t1 group by c1,c2 order by c1 limit 1);
+drop table t1;
diff --git a/mysql-test/t/subselect_cache.test b/mysql-test/t/subselect_cache.test
index 1276e546030..55da0000f13 100644
--- a/mysql-test/t/subselect_cache.test
+++ b/mysql-test/t/subselect_cache.test
@@ -24,6 +24,16 @@ select a, (select d from t2 where b=c) from t1;
show status like "subquery_cache%";
show status like '%Handler_read%';
+--source include/analyze-format.inc
+analyze format=json
+select a, (select d from t2 where b=c) from t1;
+--source include/analyze-format.inc
+analyze format=json
+select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1;
+explain format=json
+select a, (select d from t2 where b=c) from t1;
+explain format=json
+select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1;
set optimizer_switch='subquery_cache=off';
flush status;
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 2451bc60fee..544bcd994ed 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -576,3 +576,38 @@ from
t1;
drop table t1,t2;
+
+--echo #
+--echo # mdev-12931: semi-join in ON expression of STRAIGHT_JOIN
+--echo # joining a base table and a mergeable derived table
+--echo #
+
+CREATE TABLE t1 (f1 int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (3),(2);
+
+CREATE TABLE t2 (f2 int) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(4);
+
+CREATE TABLE t3 (f3 int) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (5),(6);
+
+CREATE TABLE t4 (f4 int) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (1),(8);
+
+SELECT *
+FROM t1
+ INNER JOIN
+ ( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
+ ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
+ ON ( f1 >= f2 );
+
+EXPLAIN EXTENDED
+SELECT *
+FROM t1
+ INNER JOIN
+ ( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
+ ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
+ ON ( f1 >= f2 );
+
+DROP TABLE t1,t2,t3,t4;
+
diff --git a/mysql-test/t/subselect_mat.test b/mysql-test/t/subselect_mat.test
index 09c6b3e1747..9c7c9683d0b 100644
--- a/mysql-test/t/subselect_mat.test
+++ b/mysql-test/t/subselect_mat.test
@@ -254,3 +254,19 @@ SELECT a, b, (a, b) NOT IN (SELECT a, b FROM t2) as sq
FROM t1;
drop table t1, t2;
+
+--echo #
+--echo # MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
+--echo # UNION ALL
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+INSERT INTO t1 VALUES (1),(2);
+
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) LIMIT 0 )
+UNION ALL
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) )
+;
+
+drop table t1, t2;
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index 16df4127b49..f90f1e2e927 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -2524,7 +2524,7 @@ CREATE TABLE t1 (
PRIMARY KEY (pk),
KEY col_int_key (col_int_key),
KEY col_varchar_key (col_varchar_key, col_int_key)
-) ENGINE=InnoDB;
+);
INSERT INTO t1 VALUES
(10,8,'x','x'),
diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test
index 6ed36083b33..5d6639a6d5a 100644
--- a/mysql-test/t/subselect_sj2.test
+++ b/mysql-test/t/subselect_sj2.test
@@ -1222,6 +1222,25 @@ WHERE alias3.d IN (
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
+# MDEV-8189 field<>const and const<>field are not symmetric
+# Do the same EXPLAIN SELECT and SELECT
+# with "alias3.c != alias5.c" instead of "alias5.c != alias3.c"
+
+EXPLAIN
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+ SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+ WHERE alias5.b = alias4.b
+ AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+
+SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
+WHERE alias3.d IN (
+ SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
+ WHERE alias5.b = alias4.b
+ AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
+);
+
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test
index c626d88e6ff..5fdcb56de54 100644
--- a/mysql-test/t/subselect_sj_mat.test
+++ b/mysql-test/t/subselect_sj_mat.test
@@ -2225,3 +2225,15 @@ EXECUTE stmt;
DROP TABLE t1,t2,t3;
+--echo #
+--echo # MDEV-10389: Query returns different results on a debug vs non-debug build of the same revision
+--echo #
+CREATE TABLE t1 (i1 INT, i2 INT NOT NULL);
+INSERT INTO t1 VALUES (1,4),(2,6);
+
+SELECT * FROM t1 AS alias1
+WHERE alias1.i1 IN (
+ SELECT i1 FROM t1 WHERE alias1.i2 IN ( SELECT i2 FROM t1 HAVING i2 <> 7 )
+);
+DROP TABLE t1;
+
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 7638061a8aa..cf95d4cb938 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -292,6 +292,8 @@ eval create table t1 (a int primary key) engine=myisam
index directory="$MYSQLTEST_VARDIR/run";
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select create_options from information_schema.tables where table_name='t1';
--echo # CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
--echo # options should not fail. Per documentation newly created table
--echo # should not inherit value of these options from the original table.
@@ -314,3 +316,28 @@ eval CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
DATA DIRECTORY "$MYSQLTEST_VARDIR/tmp";
DROP TABLE test.t1;
+use test;
+
+#
+# End of 5.5 tests
+#
+
+#
+# End of 10.0 tests
+#
+
+#
+# MDEV-13636 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options
+#
+replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
+eval
+create table t1(c1 int, c2 int, c3 varchar(100)) engine=MyISAM data directory='$MYSQL_TMP_DIR' index directory = '$MYSQL_TMP_DIR';
+insert t1 values (1,2,3), (2,3,4), (3,4,5), (4,5,6), (5,6,7), (6,7,8), (7,8,9);
+alter online table t1 delay_key_write=1;
+replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
+show create table t1;
+drop table t1;
+
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test
index fd452668a9e..dcc765ae132 100644
--- a/mysql-test/t/system_mysql_db_fix50117.test
+++ b/mysql-test/t/system_mysql_db_fix50117.test
@@ -45,9 +45,9 @@ CREATE TABLE IF NOT EXISTS plugin ( name char(64) binary DEFAULT '' NOT NULL, dl
CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table';
-CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
+CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
-CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
+CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url char(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics';
@@ -77,15 +77,12 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign
CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones';
-CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures';
+CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures';
-CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
+CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
-CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
-
-# MariaDB: don't:
-# CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
+CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
# Run the mysql_fix_privilege_tables.sql using "mysql --force"
--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test
index 717aecb42e2..8de4743b9fd 100644
--- a/mysql-test/t/table_elim.test
+++ b/mysql-test/t/table_elim.test
@@ -616,7 +616,7 @@ SET optimizer_switch=@save_optimizer_switch;
--echo # (just a testcase)
CREATE TABLE t1 (
PostID int(10) unsigned NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) DEFAULT CHARSET=utf8;
INSERT INTO t1 (PostID) VALUES (1), (2);
@@ -625,7 +625,7 @@ CREATE TABLE t2 (
EntityID int(10) unsigned NOT NULL,
UserID int(10) unsigned NOT NULL,
UNIQUE KEY EntityID (EntityID,UserID)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) DEFAULT CHARSET=utf8;
INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30);
diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test
index 1de0f086a5e..43621cf6ba1 100644
--- a/mysql-test/t/temp_table.test
+++ b/mysql-test/t/temp_table.test
@@ -323,3 +323,22 @@ DROP TABLES t1, t2, t3;
CREATE TEMPORARY TABLE t1 (a int);
RENAME TABLE t1 TO t2;
DROP TABLE t2;
+
+#
+# CREATE TEMPORARY TEMPORARY TABLE
+#
+--error ER_PARSE_ERROR
+create temporary temporary table t1 (a int);
+
+#
+# MDEV-7832 Add status variables to track CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE
+#
+flush status;
+create table t1 (a int);
+create temporary table t2 (a int);
+create temporary table t3 (a int);
+drop table t1;
+drop table t2;
+drop temporary table t3;
+show status like 'com_create%table';
+show status like 'com_drop%table';
diff --git a/mysql-test/t/temp_table_frm.test b/mysql-test/t/temp_table_frm.test
new file mode 100644
index 00000000000..178bd15004b
--- /dev/null
+++ b/mysql-test/t/temp_table_frm.test
@@ -0,0 +1,16 @@
+#
+# MDEV-4260 Don't create frm files for temporary tables
+#
+
+# Ensure we don't overflow the internal heap table size in the join
+set @@session.max_heap_table_size=16*1024*1024;
+create table t1 select * from information_schema.session_status where variable_name like 'Opened%';
+create temporary table t2 (a int) engine=memory;
+select variable_name, session_status.variable_value - t1.variable_value
+from information_schema.session_status join t1 using (variable_name);
+let $tmpdir= `select @@tmpdir`;
+--list_files $tmpdir/ #sql*
+truncate table t2;
+select variable_name, session_status.variable_value - t1.variable_value
+from information_schema.session_status join t1 using (variable_name);
+drop table t1;
diff --git a/mysql-test/t/timezone_grant.test b/mysql-test/t/timezone_grant.test
index 8013f2b04ce..a6dd6be695e 100644
--- a/mysql-test/t/timezone_grant.test
+++ b/mysql-test/t/timezone_grant.test
@@ -24,6 +24,7 @@ flush privileges;
create table t1 (a int, b datetime);
create table t2 (c int, d datetime);
+create user mysqltest_1@localhost;
grant all privileges on test.* to mysqltest_1@localhost;
connect (tzuser, localhost, mysqltest_1,,);
connection tzuser;
@@ -103,6 +104,7 @@ drop table t1, t2;
# Let us rely on that previous tests done proper cleanups
create table t1 (a int, b datetime);
insert into t1 values (1, 20010101000000), (2, 20020101000000);
+create user mysqltest_1@localhost;
grant all privileges on test.* to mysqltest_1@localhost;
connect (tzuser3, localhost, mysqltest_1,,);
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1;
diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test
index 8b360d16b98..c627d1a6040 100644
--- a/mysql-test/t/trigger-compat.test
+++ b/mysql-test/t/trigger-compat.test
@@ -19,7 +19,6 @@
#
# Prepare environment.
#
-
DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 4a1a3a6167c..ff6f38b719d 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -241,7 +241,6 @@ begin
end|
delimiter ;|
insert into t3 values (1);
---error ER_BAD_NULL_ERROR
insert into t1 values (4, "four", 1), (5, "five", 2);
select * from t1;
select * from t2;
@@ -2237,8 +2236,10 @@ drop table if exists t1;
create table t1 (i int, j int);
create trigger t1_bi before insert on t1 for each row begin end;
---error ER_NOT_SUPPORTED_YET
+--error ER_TRG_ALREADY_EXISTS
create trigger t1_bi before insert on t1 for each row begin end;
+--error ER_NOT_SUPPORTED_YET
+create trigger t1_bi2 before insert on t1 for each row begin end;
drop trigger t1_bi;
--error ER_TRG_DOES_NOT_EXIST
drop trigger t1_bi;
@@ -2611,3 +2612,49 @@ DROP TABLE t1, t2;
--echo End of 5.3 tests.
+#
+# MDEV-4829 BEFORE INSERT triggers dont issue 1406 error
+#
+
+SET @@session.sql_mode = 'STRICT_ALL_TABLES,STRICT_TRANS_TABLES';
+CREATE TABLE t1 (c CHAR(1) NOT NULL);
+DELIMITER |;
+CREATE TRIGGER t1_bi
+ BEFORE INSERT
+ ON t1
+ FOR EACH ROW
+ BEGIN
+ SET NEW.c = 'www';
+ END;
+|
+DELIMITER ;|
+SET @@session.sql_mode = default;
+--error ER_DATA_TOO_LONG
+INSERT INTO t1 VALUES ('a');
+DROP TRIGGER t1_bi;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
+--echo #
+
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
+CREATE TABLE t2 (a int);
+CREATE TABLE t3 (a int);
+
+create trigger trg after insert on t2 for each row
+ INSERT INTO t3 SELECT MAX(i) FROM v1 UNION SELECT MAX(i) FROM v1;
+
+drop table t1;
+
+--error ER_NO_SUCH_TABLE
+insert into t2 value (2);
+CREATE TABLE t1 (i INT);
+insert into t2 value (2);
+
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
+
+
+--echo End of 10.1 tests.
diff --git a/mysql-test/t/trigger_no_defaults-11698.test b/mysql-test/t/trigger_no_defaults-11698.test
new file mode 100644
index 00000000000..d7e391a8bb2
--- /dev/null
+++ b/mysql-test/t/trigger_no_defaults-11698.test
@@ -0,0 +1,40 @@
+#
+# MDEV-11698 Old Bug possibly not fixed; BEFORE INSERT Trigger on NOT NULL
+#
+set sql_mode='strict_all_tables';
+create table t1 (a int not null, b int);
+--error ER_NO_DEFAULT_FOR_FIELD
+insert t1 (b) values (1);
+delimiter |;
+create trigger trgi before insert on t1 for each row
+ case new.b
+ when 10 then
+ set new.a = new.b;
+ when 30 then
+ set new.a = new.a;
+ else
+ do 1;
+ end case|
+delimiter ;|
+insert t1 (b) values (10);
+--error ER_NO_DEFAULT_FOR_FIELD
+insert t1 (b) values (20);
+# arguably the statement below should fail too
+insert t1 (b) values (30);
+select * from t1;
+drop table t1;
+set sql_mode=default;
+
+#
+# MDEV-11842 Fail to insert on a table where a field has no default
+#
+create table t1 (
+ id int(11) not null auto_increment primary key,
+ data1 varchar(10) not null,
+ data2 varchar(10) not null
+);
+insert into t1 (data2) values ('x');
+create trigger test_trigger before insert on t1 for each row begin end;
+insert into t1 (data2) values ('y');
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test
index b4ce183e114..f0c565be41f 100644
--- a/mysql-test/t/trigger_notembedded.test
+++ b/mysql-test/t/trigger_notembedded.test
@@ -28,7 +28,6 @@
#
# Prepare environment.
#
-
DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
@@ -1019,6 +1018,7 @@ DROP DATABASE IF EXISTS mysqltest_db1;
CREATE DATABASE mysqltest_db1;
USE mysqltest_db1;
+CREATE USER mysqltest_u1@localhost;
GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost;
--connect(con1,localhost,mysqltest_u1,,mysqltest_db1)
diff --git a/mysql-test/t/trigger_null-8605.test b/mysql-test/t/trigger_null-8605.test
new file mode 100644
index 00000000000..34a57654b48
--- /dev/null
+++ b/mysql-test/t/trigger_null-8605.test
@@ -0,0 +1,389 @@
+#
+# MDEV-8605 MariaDB not use DEFAULT value even when inserted NULL for NOT NULLABLE column.
+#
+
+set sql_mode=strict_all_tables;
+set time_zone="+02:00";
+
+create table t1 (a int not null, b int, c int);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+
+# INSERT
+insert t1 values (10, NULL, 1);
+insert t1 values (NULL, 2, NULL);
+--error ER_BAD_NULL_ERROR
+insert t1 values (NULL, NULL, 20);
+--error ER_BAD_NULL_ERROR
+insert t1 values (1, 2, NULL);
+select * from t1;
+
+# INSERT IGNORE
+insert ignore t1 values (NULL, NULL, 30);
+insert ignore t1 values (1, 3, NULL);
+select * from t1;
+
+# fields in the value list
+insert t1 set a=NULL, b=4, c=a;
+select * from t1;
+delete from t1;
+
+#insert (column list)
+insert t1 (a,c) values (10, 1);
+insert t1 (a,b) values (NULL, 2);
+--error ER_BAD_NULL_ERROR
+insert t1 (a,c) values (NULL, 20);
+--error ER_BAD_NULL_ERROR
+insert t1 (a,b) values (1, 2);
+select * from t1;
+delete from t1;
+
+# insert select
+
+insert t1 select 10, NULL, 1;
+insert t1 select NULL, 2, NULL;
+--error ER_BAD_NULL_ERROR
+insert t1 select NULL, NULL, 20;
+--error ER_BAD_NULL_ERROR
+insert t1 select 1, 2, NULL;
+insert ignore t1 select NULL, NULL, 30;
+insert ignore t1 select 1, 3, NULL;
+select * from t1;
+delete from t1;
+
+# insert delayed
+insert delayed t1 values (10, NULL, 1);
+insert delayed t1 values (NULL, 2, NULL);
+--error ER_BAD_NULL_ERROR
+insert delayed t1 values (NULL, NULL, 20);
+--error ER_BAD_NULL_ERROR
+insert delayed t1 values (1, 2, NULL);
+select * from t1;
+insert delayed ignore t1 values (NULL, NULL, 30);
+insert delayed ignore t1 values (1, 3, NULL);
+flush table t1; # wait for inserts to finish
+select * from t1;
+delete from t1;
+
+# insert on dup key update
+alter table t1 add primary key (a);
+create trigger trgu before update on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+
+insert t1 values (100,100,100), (200,200,200), (300,300,300);
+insert t1 values (100,100,100) on duplicate key update a=10, b=NULL, c=1;
+insert t1 values (200,200,200) on duplicate key update a=NULL, b=2, c=NULL;
+--error ER_BAD_NULL_ERROR
+insert t1 values (300,300,300) on duplicate key update a=NULL, b=NULL, c=20;
+--error ER_BAD_NULL_ERROR
+insert t1 values (300,300,300) on duplicate key update a=1, b=2, c=NULL;
+select * from t1;
+delete from t1;
+
+# replace
+insert t1 values (1,100,1), (2,200,2);
+replace t1 values (10, NULL, 1);
+replace t1 values (NULL, 2, NULL);
+--error ER_BAD_NULL_ERROR
+replace t1 values (NULL, NULL, 30);
+--error ER_BAD_NULL_ERROR
+replace t1 values (1, 3, NULL);
+select * from t1;
+delete from t1;
+
+# update
+insert t1 values (100,100,100), (200,200,200), (300,300,300);
+update t1 set a=10, b=NULL, c=1 where a=100;
+update t1 set a=NULL, b=2, c=NULL where a=200;
+--error ER_BAD_NULL_ERROR
+update t1 set a=NULL, b=NULL, c=20 where a=300;
+--error ER_BAD_NULL_ERROR
+update t1 set a=1, b=2, c=NULL where a=300;
+select * from t1;
+# Test UPDATE with NULL violation in many rows
+--error ER_DUP_ENTRY
+set statement sql_mode='' for update t1 set a=1, b=2, c=NULL where a > 1;
+select * from t1;
+# fields in the value list
+update t1 set a=NULL, b=4, c=a where a=300;
+select * from t1;
+delete from t1;
+
+# multi-update
+
+create table t2 (d int, e int);
+insert t1 values (100,100,100), (200,200,200), (300,300,300);
+insert t2 select a,b from t1;
+update t1,t2 set a=10, b=NULL, c=1 where b=d and e=100;
+update t1,t2 set a=NULL, b=2, c=NULL where b=d and e=200;
+--error ER_BAD_NULL_ERROR
+update t1,t2 set a=NULL, b=NULL, c=20 where b=d and e=300;
+--error ER_BAD_NULL_ERROR
+update t1,t2 set a=1, b=2, c=NULL where b=d and e=300;
+select * from t1;
+# fields in the value list
+update t1,t2 set a=NULL, b=4, c=a where b=d and e=300;
+select * from t1;
+delete from t1;
+
+# view
+insert t2 values (2,2);
+create view v1 as select * from t1, t2 where d=2;
+insert v1 (a,c) values (10, 1);
+insert v1 (a,b) values (NULL, 2);
+--error ER_BAD_NULL_ERROR
+insert v1 (a,c) values (NULL, 20);
+--error ER_BAD_NULL_ERROR
+insert v1 (a,b) values (1, 2);
+select * from v1;
+delete from t1;
+drop view v1;
+drop table t2;
+
+# load data
+let $datadir=`select @@datadir`;
+--write_file $datadir/test/mdev8605.txt
+10,\N,1
+\N,2,\N
+\N,\N,20
+EOF
+--error ER_BAD_NULL_ERROR
+load data infile 'mdev8605.txt' into table t1 fields terminated by ',';
+select * from t1;
+drop table t1;
+
+# timestamps (on NULL = NOW())
+create table t1 (a timestamp, b int auto_increment primary key);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null, '2000-10-20 10:20:30', NULL);
+set statement timestamp=777777777 for insert t1 (a) values (NULL);
+set statement timestamp=888888888 for insert t1 (a) values ('1999-12-11 10:9:8');
+select b, a, unix_timestamp(a) from t1;
+set statement timestamp=999999999 for update t1 set b=3 where b=2;
+select b, a, unix_timestamp(a) from t1;
+create trigger trgu before update on t1 for each row set new.a='2011-11-11 11:11:11';
+update t1 set b=4 where b=3;
+select b, a, unix_timestamp(a) from t1;
+drop table t1;
+
+# auto-increment (on NULL = int)
+create table t1 (a int auto_increment primary key);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null, 5, NULL);
+insert t1 values (NULL);
+insert t1 values (10);
+select a from t1;
+drop table t1;
+
+# insert, all columns NULLable
+create table t1 (a int, b int, c int);
+create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c);
+insert t1 values (10, NULL, 1);
+insert t1 values (NULL, 2, NULL);
+insert t1 values (NULL, NULL, 20);
+insert t1 values (1, 2, NULL);
+select * from t1;
+drop table t1;
+
+# more load data: autoinc and timestamp, different load formats
+create table t1 (a1 tinyint not null, a2 timestamp not null,
+ a3 tinyint not null auto_increment primary key,
+ b tinyint, c int not null);
+delimiter |;
+create trigger trgi before insert on t1 for each row
+begin
+ if new.b=1 then set new.a1=if(new.c,new.c,null); end if;
+ if new.b=2 then set new.a2=if(new.c,new.c,null); end if;
+ if new.b=3 then set new.a3=if(new.c,new.c,null); end if;
+end|
+delimiter ;|
+
+--write_file $datadir/test/sep8605.txt
+1,2010-11-12 1:2:3,10,0,0
+\N,2010-11-12 1:2:3,11,1,2
+3,\N,12,0,0
+4,\N,13,2,908070605
+5,2010-11-12 1:2:3,14,2,0
+6,2010-11-12 1:2:3,\N,0,0
+7,2010-11-12 1:2:3,\N,3,20
+8,2010-11-12 1:2:3,30,3,0
+99,2010-11-12 1:2:3,0,1,0
+EOF
+
+--error ER_BAD_NULL_ERROR
+set statement timestamp=777777777 for
+load data infile 'sep8605.txt' into table t1 fields terminated by ',';
+select * from t1;
+delete from t1;
+
+--error ER_BAD_NULL_ERROR
+set statement timestamp=777777777 for
+load data infile 'sep8605.txt' into table t1 fields terminated by ','
+ (@a,a2,a3,b,c) set a1=100-@a;
+select 100-a1,a2,a3,b,c from t1;
+delete from t1;
+
+--write_file $datadir/test/fix8605.txt
+00012010-11-12 01:02:030010000000000000000
+00052010-11-12 01:02:030014000200000000000
+00082010-11-12 01:02:030030000300000000000
+00992010-11-12 01:02:030000000100000000000
+EOF
+
+--error ER_BAD_NULL_ERROR
+set statement timestamp=777777777 for
+load data infile 'fix8605.txt' into table t1 fields terminated by '';
+select * from t1;
+delete from t1;
+
+--write_file $datadir/test/xml8605.txt
+<data>
+ <row>
+ <field name="a1">1</field>
+ <field name="a2">2010-11-12 1:2:3</field>
+ <field name="a3">10</field>
+ <field name="b">0</field>
+ <field name="c">0</field>
+ </row>
+ <row>
+ <field name="a2">2010-11-12 1:2:3</field>
+ <field name="a3">11</field>
+ <field name="b">1</field>
+ <field name="c">2</field>
+ </row>
+ <row>
+ <field name="a1">3</field>
+ <field name="a3">12</field>
+ <field name="b">0</field>
+ <field name="c">0</field>
+ </row>
+ <row>
+ <field name="a1">4</field>
+ <field name="a3">13</field>
+ <field name="b">2</field>
+ <field name="c">908070605</field>
+ </row>
+ <row>
+ <field name="a1">5</field>
+ <field name="a2">2010-11-12 1:2:3</field>
+ <field name="a3">14</field>
+ <field name="b">2</field>
+ <field name="c">0</field>
+ </row>
+ <row>
+ <field name="a1">6</field>
+ <field name="a2">2010-11-12 1:2:3</field>
+ <field name="b">0</field>
+ <field name="c">0</field>
+ </row>
+ <row>
+ <field name="a1">7</field>
+ <field name="a2">2010-11-12 1:2:3</field>
+ <field name="b">3</field>
+ <field name="c">20</field>
+ </row>
+ <row>
+ <field name="a1">8</field>
+ <field name="a2">2010-11-12 1:2:3</field>
+ <field name="a3">30</field>
+ <field name="b">3</field>
+ <field name="c">0</field>
+ </row>
+ <row>
+ <field name="a1">99</field>
+ <field name="a2">2010-11-12 1:2:3</field>
+ <field name="a3">0</field>
+ <field name="b">1</field>
+ <field name="c">0</field>
+ </row>
+</data>
+EOF
+
+--error ER_BAD_NULL_ERROR
+set statement timestamp=777777777 for
+load xml infile 'xml8605.txt' into table t1 rows identified by '<row>';
+select * from t1;
+drop table t1;
+
+# explicit DEFAULT
+create table t1 (a int not null default 5, b int, c int);
+create trigger trgi before insert on t1 for each row set new.b=new.c;
+insert t1 values (DEFAULT,2,1);
+select * from t1;
+drop table t1;
+
+# Two statements, first fails, second uses an implicit default
+create table t1 (a int not null, b int not null default 5, c int);
+delimiter |;
+create trigger trgi before insert on t1 for each row
+begin
+ if new.c=1 then set new.a=1, new.b=1; end if;
+ if new.c=2 then set new.a=NULL, new.b=NULL; end if;
+ if new.c=3 then set new.a=2; end if;
+end|
+delimiter ;|
+
+insert t1 values (9, 9, 1);
+--error ER_BAD_NULL_ERROR
+insert t1 values (9, 9, 2);
+insert t1 (a,c) values (9, 3);
+select * from t1;
+drop table t1;
+
+#
+# MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
+#
+set session sql_mode ='no_auto_value_on_zero';
+create table t1 (id int unsigned auto_increment primary key);
+insert t1 values (0);
+select * from t1;
+delete from t1;
+create trigger t1_bi before insert on t1 for each row begin end;
+insert t1 values (0);
+--error ER_DUP_ENTRY
+insert t1 (id) values (0);
+drop table t1;
+
+#
+# MDEV-9500 Bug after upgrade to 10.1.10 (and 10.1.11)
+#
+create table t1 (a int not null, b int);
+create trigger trgi before update on t1 for each row do 1;
+insert t1 values (1,1),(2,2),(3,3),(1,4);
+create table t2 select a as c, b as d from t1;
+update t1 set a=(select count(c) from t2 where c+1=a+1 group by a);
+select * from t1;
+drop table t1, t2;
+
+#
+# MDEV-9535 Trigger doing "SET NEW.auctionStart = NOW();" on a timestamp kills MariaDB server.
+#
+create table t1 (a int not null);
+create table t2 (f1 int unsigned not null, f2 int);
+insert into t2 values (1, null);
+create trigger tr1 before update on t1 for each row do 1;
+create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
+update t2 set f2=1 where f1=1;
+drop table t1, t2;
+
+#
+# MDEV-9629 Disappearing PRI from Key column after creating a trigger
+#
+create table t1 (a int not null, primary key (a));
+insert into t1 (a) values (1);
+show columns from t1;
+create trigger t1bu before update on t1 for each row begin end;
+show columns from t1;
+insert into t1 (a) values (3);
+show columns from t1;
+drop table t1;
+
+#
+# MDEV-11551 Server crashes in Field::is_real_null
+#
+create table t1 (
+ pk int primary key,
+ i int,
+ v1 int as (i) virtual,
+ v2 int as (i) virtual
+);
+create trigger tr before update on t1 for each row set @a = 1;
+--error ER_BAD_NULL_ERROR
+insert into t1 (pk, i) values (null, null);
+drop table t1;
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 2ca608e76ff..01a610999bd 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -439,3 +439,22 @@ SELECT SUM(a) FROM t1 GROUP BY c, b, a;
DROP TABLE t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8867 Wrong field type or metadata for COALESCE(bit_column, 1)
+--echo #
+
+CREATE TABLE t1 (val bit(1));
+INSERT INTO t1 VALUES (0);
+CREATE TABLE t2 AS SELECT COALESCE(val, 1) AS c FROM t1;
+SELECT * FROM t2;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+--enable_metadata
+SELECT COALESCE(val, 1) FROM t1;
+--disable_metadata
+DROP TABLE t1;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 91f9774969b..8248386a93f 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -414,3 +414,178 @@ CREATE TABLE t1 (f1 DATE, f2 VARCHAR(1));
INSERT INTO t1 VALUES ('2003-04-27','a'),('1900-01-01','a');
SELECT GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3) FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+let type=DATE;
+let defval='0000-00-00';
+--source include/type_temporal_zero_default.inc
+
+--echo #
+--echo # MDEV-8722 The patch for MDEV-8688 disabled equal field propagation for temporal column and BETWEEN and IN
+--echo #
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a BETWEEN '2001-01-01' AND '2001-01-02';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a IN ('2001-01-01','2001-01-02');
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+--echo #
+# Trailing garbage in string literals
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+SELECT * FROM t1 WHERE a='2001-01-01x';
+SELECT * FROM t1 WHERE HEX(a)!='323030312D30312D3031';
+SELECT * FROM t1 WHERE HEX(a)!='323030312D30312D3031' AND a='2001-01-01x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE HEX(a)!='323030312D30312D3031' AND a='2001-01-01x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE HEX(a)!=CONCAT('xx',RAND()) AND a='2001-01-01x';
+DROP TABLE t1;
+
+# Leading spaces in string literals
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+SELECT * FROM t1 WHERE LENGTH(a)=11;
+SELECT * FROM t1 WHERE LENGTH(a)=11 AND a=' 2001-01-01';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=11 AND a=' 2001-01-01';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' 2001-01-01';
+# This should not propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' garbage ';
+DROP TABLE t1;
+
+# Numeric format in string literals
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='20010101';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='20010101';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8+RAND() AND a='20010101';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8706 Wrong result for SELECT..WHERE time_column=TIMESTAMP'2015-08-30 00:00:00' AND time_column='00:00:00'
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIME'00:00:00';
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00';
+DROP TABLE t1;
+
+# Special case: zero TIME part after conversion to DATETIME
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIME'24:00:00';
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'24:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'24:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'24:00:00';
+DROP TABLE t1;
+
+--echo # In this example '00:00:00' is not recognized as TIME'00:00:00'
+--echo # and is treated as DATE'0000-00-00'.
+--echo # This may change after MDEV-8322 Distinguish between time and date strings more carefully
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a='00:00:00';
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00';
+DROP TABLE t1;
+
+# DATETIME native literal
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00';
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00';
+DROP TABLE t1;
+
+# DATETIME native literal with non-zero time
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00.1';
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00.1';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00.1';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00.1';
+DROP TABLE t1;
+
+# DATETIME-alike string literal
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31');
+SELECT * FROM t1 WHERE a='2015-08-30 00:00:00';
+SELECT * FROM t1 WHERE LENGTH(a)=10;
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='2015-08-30 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='2015-08-30 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='2015-08-30 00:00:00';
+DROP TABLE t1;
+
+SET timestamp=DEFAULT;
+
+--echo #
+--echo # MDEV-8795 Equal expression propagation does not work for temporal literals
+--echo #
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=DATE'2001-01-01' AND COALESCE(a)>=DATE'2001-01-01';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8658 DATE(zerofill_column) and DATE(COALESCE(zerofill_column)) return different results
+--echo #
+CREATE TABLE t1 (a INT(6) ZEROFILL, b DECIMAL(6) ZEROFILL, c DOUBLE(6,0) ZEROFILL);
+INSERT INTO t1 VALUES (1,1,1);
+INSERT INTO t1 VALUES (10101,10101,10101);
+SELECT DATE(a), DATE(b), DATE(c) FROM t1;
+SELECT DATE(COALESCE(a)), DATE(COALESCE(b)), DATE(COALESCE(c)) FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT(6), b DECIMAL(6), c DOUBLE(6,0));
+INSERT INTO t1 VALUES (1,1,1);
+INSERT INTO t1 VALUES (10101,10101,10101);
+SELECT DATE(a), DATE(b), DATE(c) FROM t1;
+SELECT DATE(COALESCE(a)), DATE(COALESCE(b)), DATE(COALESCE(c)) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
+--echo #
+
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+SELECT d, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP HAVING CASE d WHEN '2017-05-25' THEN 0 ELSE 1 END;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index 3f96673c43f..6b752b1a978 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -32,7 +32,7 @@ drop table t1;
# Test insert of now() and curtime()
#
-CREATE TABLE t1 (a timestamp, b date, c time, d datetime);
+CREATE TABLE t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b date, c time, d datetime);
insert into t1 (b,c,d) values(now(),curtime(),now());
select date_format(a,"%Y-%m-%d")=b,right(a+0,6)=c+0,a=d+0 from t1;
drop table t1;
@@ -182,7 +182,7 @@ if (`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`)
# So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'.
--real_sleep 5
}
-create table t1 (f1 date, f2 datetime, f3 timestamp);
+create table t1 (f1 date, f2 datetime, f3 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1(f1) values(curdate());
select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
delete from t1;
@@ -201,7 +201,7 @@ drop table t1;
#
# Bug#16377: Wrong DATE/DATETIME comparison in BETWEEN function.
#
-create table t1 (f1 date, f2 datetime, f3 timestamp);
+create table t1 (f1 date, f2 datetime, f3 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
@@ -621,3 +621,85 @@ DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+let type=DATETIME;
+let defval='0000-00-00 00:00:00';
+--source include/type_temporal_zero_default.inc
+
+--echo #
+--echo # MDEV-8336 The meaning of NO_ZERO_DATE is not clear for DATETIME
+--echo #
+SET sql_mode='NO_ZERO_DATE';
+SELECT TIMESTAMP'0000-00-01 10:20:30';
+SELECT TIMESTAMP'0000-00-00 10:20:30';
+SELECT TIMESTAMP'0000-00-00 00:00:00.000001';
+CREATE TABLE t1 (a DATETIME);
+INSERT INTO t1 VALUES ('0000-00-00 10:20:30');
+SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00.000001');
+SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1;
+DROP TABLE t1;
+SELECT STR_TO_DATE('0000-00-00 10:20:30','%Y-%m-%d %h:%i:%s');
+SELECT STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f');
+SET old_mode=zero_date_time_cast;
+SELECT CAST(TIME'10:20:30' AS DATETIME);
+SELECT CAST(TIME'00:00:00.000001' AS DATETIME(6));
+SELECT CAST(CAST('10:20:30' AS TIME) AS DATETIME);
+SELECT CAST(CAST('00:00:00.000001' AS TIME(6)) AS DATETIME(6));
+SELECT CAST(CAST(TIMESTAMP'0000-00-00 10:20:30' AS TIME) AS DATETIME);
+SELECT CAST(CAST(TIMESTAMP'0000-00-00 00:00:00.000001' AS TIME(6)) AS DATETIME(6));
+SET old_mode=DEFAULT;
+SET sql_mode=DEFAULT;
+
+--echo #
+--echo # MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+--echo #
+--let $TYPE= DATETIME
+--source include/equal_fields_propagation_datetime.inc
+
+--echo #
+--echo # MDEV-8795 Equal expression propagation does not work for temporal literals
+--echo #
+CREATE TABLE t1 (a DATETIME);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-02 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIMESTAMP'2001-01-01 00:00:00' AND COALESCE(a)>=TIMESTAMP'2001-01-01 00:00:00';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8875 Wrong metadata for MAX(CAST(time_column AS DATETIME))
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2015-01-01 00:00:00');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:01:00');
+--disable_ps_protocol
+--enable_metadata
+SELECT MAX(CAST(a AS DATETIME)) FROM t1;
+--disable_metadata
+--enable_ps_protocol
+CREATE TABLE t2 AS SELECT MAX(CAST(a AS DATETIME)) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+--echo #
+--echo # MDEV-8860 Wrong result for WHERE 2016 < SOME (SELECT CAST(time_column AS DATETIME) FROM t1)
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2015-01-01 00:00:00');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:01:00');
+SELECT 1 FROM t1 WHERE 2016 > SOME (SELECT CAST(a AS DATETIME) FROM t1);
+SELECT * FROM t1 WHERE 2016 > CAST(a AS DATETIME);
+SELECT 1 FROM t1 WHERE 20160101 > SOME (SELECT CAST(a AS DATETIME) FROM t1);
+SELECT * FROM t1 WHERE 20160101 > CAST(a AS DATETIME);
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 9ce34c0b55b..314cb237dd3 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -357,3 +357,34 @@ DROP TABLE t1;
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8729 Wrong result for SELECT..WHERE HEX(enum_column)='61' AND enum_column='a '
+--echo #
+CREATE TABLE t1 (a ENUM('a','A') CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a ';
+SELECT * FROM t1 WHERE HEX(a)='61';
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+--echo # Can't propagate the equality into HEX(a), because binary collations still ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM('a','a ') CHARACTER SET BINARY);
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE a='a ';
+SELECT * FROM t1 WHERE HEX(a)='61';
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+--echo # Ok to propagate the equality into HEX(a), because "CHARACTER SET BINARY" does not ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index bb7a784553e..3717dc028ba 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -385,3 +385,76 @@ DROP TABLE t1,t2;
--echo #
--echo # End of 10.0 tests
--echo #
+
+
+--echo #
+--echo # MDEV-8704 Wrong result for SELECT..WHERE LENGTH(double_column)!=6 AND double_column=100e0
+--echo #
+
+# The original test case from the bug report
+CREATE TABLE t1 (a DOUBLE(9,2));
+INSERT INTO t1 VALUES (100),(110);
+SELECT * FROM t1 WHERE LENGTH(a)!=6;
+SELECT * FROM t1 WHERE LENGTH(a)!=6 AND a=100e0;
+DROP TABLE t1;
+
+# DOUBLE with no specific precision
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (100),(110);
+SELECT * FROM t1 WHERE LENGTH(a)!=6;
+SELECT * FROM t1 WHERE LENGTH(a)!=6 AND a=100e0;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=6 AND a=100e0;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=100e0;
+DROP TABLE t1;
+
+# The constant scale is bigger than the field scale
+CREATE TABLE t1 (a DOUBLE(10,1));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=3;
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10e0;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10e0;
+--echo # Notice 1.1 instead of 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0;
+DROP TABLE t1;
+
+# The constant scale is equal to the field scale
+CREATE TABLE t1 (a DOUBLE(10,2));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=4;
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10e0;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10e0;
+--echo # Notice 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0;
+DROP TABLE t1;
+
+# The constant scale is smaller than the field scale
+CREATE TABLE t1 (a DOUBLE(10,3));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=5;
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10e0;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10e0;
+--echo # Notice 1.100 rather than 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+--echo #
+CREATE TABLE t1 (a DOUBLE ZEROFILL);
+INSERT INTO t1 VALUES (2010),(2020);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010e0 AND a>=2010e0;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_int.test b/mysql-test/t/type_int.test
new file mode 100644
index 00000000000..e8b9b2cffcd
--- /dev/null
+++ b/mysql-test/t/type_int.test
@@ -0,0 +1,28 @@
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+--echo #
+
+CREATE TABLE t1 (a INT ZEROFILL);
+INSERT INTO t1 VALUES (2010),(2020);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=2010;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
+--echo #
+CREATE TABLE t1 (a INT ZEROFILL);
+INSERT INTO t1 VALUES (128),(129);
+SELECT * FROM t1 WHERE a=128;
+SELECT * FROM t1 WHERE hex(a)='80';
+SELECT * FROM t1 WHERE a=128 AND hex(a)='80';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=128 AND hex(a)='80';
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 09149253c67..6fb8fd4f97d 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1622,3 +1622,146 @@ DROP TABLE t1,t2;
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8703 Wrong result for SELECT..WHERE LENGTH(decimal_10_1_column)!=3 AND decimal_10_1_column=1.10
+--echo #
+
+# The constant scale is bigger than the field scale
+CREATE TABLE t1 (a DECIMAL(10,1));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=3;
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=3 AND a=1.10;
+--echo # Notice 1.1 instead of 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10;
+DROP TABLE t1;
+
+# The constant scale is equal to the field scale
+CREATE TABLE t1 (a DECIMAL(10,2));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=4;
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=4 AND a=1.10;
+--echo # Notice 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10;
+DROP TABLE t1;
+
+# The constant scale is smaller than the field scale
+CREATE TABLE t1 (a DECIMAL(10,3));
+INSERT INTO t1 VALUES (1.1),(1.2),(1.3);
+SELECT * FROM t1 WHERE LENGTH(a)!=5;
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=5 AND a=1.10;
+--echo # Notice 1.100 rather than 1.10 in the final WHERE condition
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+--echo #
+CREATE TABLE t1 (a DECIMAL(10,1) ZEROFILL);
+INSERT INTO t1 VALUES (2010),(2020);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010.0 AND a>=2010.0;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8635 Redundant warnings on WHERE decimal_column='ax'
+--echo #
+CREATE TABLE t1 (a DECIMAL, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+# Make sure this does not produce any warnings
+EXPLAIN SELECT * FROM t1 WHERE a='ax' ORDER BY a;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8502 DECIMAL accepts out of range DEFAULT values
+--echo #
+
+--error ER_INVALID_DEFAULT
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000);
+--error ER_INVALID_DEFAULT
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000.0);
+--error ER_INVALID_DEFAULT
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000e0);
+--error ER_INVALID_DEFAULT
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.0');
+--error ER_INVALID_DEFAULT
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.1');
+
+--echo #
+--echo # MDEV-10277 Redundant NOTE when inserting '0.00001 ' into a DECIMAL(2,1) column
+--echo #
+CREATE TABLE t1 (a DECIMAL(2,1));
+INSERT INTO t1 VALUES ('0.00001 ');
+INSERT INTO t1 VALUES ('1e-10000 ');
+INSERT INTO t1 VALUES ('0.1 ');
+INSERT INTO t1 VALUES ('0.111 ');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '1e-10000');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.1 ');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001 ');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001e0);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
+
+--echo #
+--echo # Bug#18408499 UNSIGNED BIGINT HIGH VALUES
+--echo # WRONG NUMERICAL COMPARISON RESULTS
+--echo #
+
+CREATE TABLE t1(value DECIMAL(24,0) NOT NULL);
+INSERT INTO t1(value)
+VALUES('100000000000000000000001'),
+ ('100000000000000000000002'),
+ ('100000000000000000000003');
+SELECT * FROM t1 WHERE value = '100000000000000000000002';
+SELECT * FROM t1 WHERE '100000000000000000000002' = value;
+SELECT * FROM t1 WHERE value + 0 = '100000000000000000000002';
+SELECT * FROM t1 WHERE value = 100000000000000000000002;
+SELECT * FROM t1 WHERE value + 0 = 100000000000000000000002;
+
+PREPARE stmt FROM 'SELECT * FROM t1 WHERE value = ?';
+set @a="100000000000000000000002";
+EXECUTE stmt using @a;
+set @a=100000000000000000000002;
+EXECUTE stmt using @a;
+DEALLOCATE PREPARE stmt;
+
+ALTER TABLE t1 ADD INDEX value (value);
+SELECT * FROM t1 WHERE value = '100000000000000000000002';
+DROP TABLE t1;
diff --git a/mysql-test/t/type_num.test b/mysql-test/t/type_num.test
new file mode 100644
index 00000000000..64242e34160
--- /dev/null
+++ b/mysql-test/t/type_num.test
@@ -0,0 +1,707 @@
+--echo #
+--echo # Start of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
+--echo #
+SET sql_mode='STRICT_ALL_TABLES';
+
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES ('1 ');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES ('1 ');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+INSERT INTO t1 VALUES ('1 ');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+INSERT INTO t1 VALUES ('1 ');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES ('1 ');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES ('1 ');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+INSERT INTO t1 VALUES ('1 ');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('x');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('x');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('x');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('x');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('x');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (' x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (' x');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (' x');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (' x');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (' x');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (' x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (' x');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('.');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('.');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('.');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('.');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('.');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('.');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('.');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('-');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('-');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('-');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('-');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('-');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('-');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('-');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('+');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('+');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('+');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('+');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('+');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('+');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ('+');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1x');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1x');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1x');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1x');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1x');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1E-');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1E-');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1E-');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1E-');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1E-');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1E-');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1E-');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1Ex');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1Ex');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1Ex');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1Ex');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1Ex');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1Ex');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1Ex');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+x');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+x');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+x');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+x');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+x');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES ('1e+x');
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a FLOAT);
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES ('1e1000');
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES ('1e1000');
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYINT);
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES ('1e1000');
+DROP TABLE t1;
+CREATE TABLE t1 (a SMALLINT);
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES ('1e1000');
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES ('1e1000');
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES ('1e1000');
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL);
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES ('1e1000');
+DROP TABLE t1;
+
+
+SET sql_mode=DEFAULT;
+
+CREATE TABLE t1 (
+ f4 FLOAT,
+ f8 DOUBLE,
+ i1 TINYINT,
+ i2 SMALLINT,
+ i4 INT,
+ i8 BIGINT,
+ d DECIMAL
+);
+
+INSERT INTO t1 VALUES ('1 ','1 ','1 ','1 ','1 ','1 ','1 ');
+INSERT INTO t1 VALUES ('','','','','','','');
+INSERT INTO t1 VALUES ('x','x','x','x','x','x','x');
+INSERT INTO t1 VALUES (' x',' x',' x',' x',' x',' x',' x');
+INSERT INTO t1 VALUES ('.','.','.','.','.','.','.');
+INSERT INTO t1 VALUES ('-','-','-','-','-','-','-');
+INSERT INTO t1 VALUES ('+','+','+','+','+','+','+');
+INSERT INTO t1 VALUES ('1x','1x','1x','1x','1x','1x','1x');
+INSERT INTO t1 VALUES ('1e','1e','1e','1e','1e','1e','1e');
+INSERT INTO t1 VALUES ('1e-','1e-','1e-','1e-','1e-','1e-','1e-');
+INSERT INTO t1 VALUES ('1E+','1E+','1E+','1E+','1E+','1E+','1E+');
+INSERT INTO t1 VALUES ('1e1000','1e1000','1e1000','1e1000','1e1000','1e1000','1e1000');
+
+DELETE FROM t1;
+INSERT INTO t1 VALUES (0,0,0,0,0,0,0);
+INSERT INTO t1 VALUES (0,0,0,0,0,0,0);
+INSERT INTO t1 VALUES (1,1,1,1,1,1,1);
+INSERT INTO t1 VALUES (1,1,1,1,1,1,1);
+INSERT INTO t1 VALUES (2,2,2,2,2,2,2);
+INSERT INTO t1 VALUES (2,2,2,2,2,2,2);
+INSERT INTO t1 VALUES (3,3,3,3,3,3,3);
+INSERT INTO t1 VALUES (3,3,3,3,3,3,3);
+INSERT INTO t1 VALUES (4,4,4,4,4,4,4);
+INSERT INTO t1 VALUES (4,4,4,4,4,4,4);
+INSERT INTO t1 VALUES (5,5,5,5,5,5,5);
+INSERT INTO t1 VALUES (5,5,5,5,5,5,5);
+
+SELECT COUNT(*) FROM t1 WHERE f4='1 ';
+SELECT COUNT(*) FROM t1 WHERE f8='1 ';
+SELECT COUNT(*) FROM t1 WHERE i1='1 ';
+SELECT COUNT(*) FROM t1 WHERE i2='1 ';
+SELECT COUNT(*) FROM t1 WHERE i4='1 ';
+SELECT COUNT(*) FROM t1 WHERE i8='1 ';
+SELECT COUNT(*) FROM t1 WHERE d='1 ';
+
+SELECT COUNT(*) FROM t1 WHERE f4='';
+SELECT COUNT(*) FROM t1 WHERE f8='';
+SELECT COUNT(*) FROM t1 WHERE i1='';
+SELECT COUNT(*) FROM t1 WHERE i2='';
+SELECT COUNT(*) FROM t1 WHERE i4='';
+SELECT COUNT(*) FROM t1 WHERE i8='';
+SELECT COUNT(*) FROM t1 WHERE d='';
+
+SELECT COUNT(*) FROM t1 WHERE f4='x';
+SELECT COUNT(*) FROM t1 WHERE f8='x';
+SELECT COUNT(*) FROM t1 WHERE i1='x';
+SELECT COUNT(*) FROM t1 WHERE i2='x';
+SELECT COUNT(*) FROM t1 WHERE i4='x';
+SELECT COUNT(*) FROM t1 WHERE i8='x';
+SELECT COUNT(*) FROM t1 WHERE d='x';
+
+SELECT COUNT(*) FROM t1 WHERE f4=' x';
+SELECT COUNT(*) FROM t1 WHERE f8=' x';
+SELECT COUNT(*) FROM t1 WHERE i1=' x';
+SELECT COUNT(*) FROM t1 WHERE i2=' x';
+SELECT COUNT(*) FROM t1 WHERE i4=' x';
+SELECT COUNT(*) FROM t1 WHERE i8=' x';
+SELECT COUNT(*) FROM t1 WHERE d=' x';
+
+SELECT COUNT(*) FROM t1 WHERE f4='.';
+SELECT COUNT(*) FROM t1 WHERE f8='.';
+SELECT COUNT(*) FROM t1 WHERE i1='.';
+SELECT COUNT(*) FROM t1 WHERE i2='.';
+SELECT COUNT(*) FROM t1 WHERE i4='.';
+SELECT COUNT(*) FROM t1 WHERE i8='.';
+SELECT COUNT(*) FROM t1 WHERE d='.';
+
+SELECT COUNT(*) FROM t1 WHERE f4='-';
+SELECT COUNT(*) FROM t1 WHERE f8='-';
+SELECT COUNT(*) FROM t1 WHERE i1='-';
+SELECT COUNT(*) FROM t1 WHERE i2='-';
+SELECT COUNT(*) FROM t1 WHERE i4='-';
+SELECT COUNT(*) FROM t1 WHERE i8='-';
+SELECT COUNT(*) FROM t1 WHERE d='-';
+
+SELECT COUNT(*) FROM t1 WHERE f4='+';
+SELECT COUNT(*) FROM t1 WHERE f8='+';
+SELECT COUNT(*) FROM t1 WHERE i1='+';
+SELECT COUNT(*) FROM t1 WHERE i2='+';
+SELECT COUNT(*) FROM t1 WHERE i4='+';
+SELECT COUNT(*) FROM t1 WHERE i8='+';
+SELECT COUNT(*) FROM t1 WHERE d='+';
+
+SELECT COUNT(*) FROM t1 WHERE f4='1x';
+SELECT COUNT(*) FROM t1 WHERE f8='1x';
+SELECT COUNT(*) FROM t1 WHERE i1='1x';
+SELECT COUNT(*) FROM t1 WHERE i2='1x';
+SELECT COUNT(*) FROM t1 WHERE i4='1x';
+SELECT COUNT(*) FROM t1 WHERE i8='1x';
+SELECT COUNT(*) FROM t1 WHERE d='1x';
+
+SELECT COUNT(*) FROM t1 WHERE f4='1e';
+SELECT COUNT(*) FROM t1 WHERE f8='1e';
+SELECT COUNT(*) FROM t1 WHERE i1='1e';
+SELECT COUNT(*) FROM t1 WHERE i2='1e';
+SELECT COUNT(*) FROM t1 WHERE i4='1e';
+SELECT COUNT(*) FROM t1 WHERE i8='1e';
+SELECT COUNT(*) FROM t1 WHERE d='1e';
+
+SELECT COUNT(*) FROM t1 WHERE f4='1e+';
+SELECT COUNT(*) FROM t1 WHERE f8='1e+';
+SELECT COUNT(*) FROM t1 WHERE i1='1e+';
+SELECT COUNT(*) FROM t1 WHERE i2='1e+';
+SELECT COUNT(*) FROM t1 WHERE i4='1e+';
+SELECT COUNT(*) FROM t1 WHERE i8='1e+';
+SELECT COUNT(*) FROM t1 WHERE d='1e+';
+
+SELECT COUNT(*) FROM t1 WHERE f4='1E-';
+SELECT COUNT(*) FROM t1 WHERE f8='1E-';
+SELECT COUNT(*) FROM t1 WHERE i1='1E-';
+SELECT COUNT(*) FROM t1 WHERE i2='1E-';
+SELECT COUNT(*) FROM t1 WHERE i4='1E-';
+SELECT COUNT(*) FROM t1 WHERE i8='1E-';
+SELECT COUNT(*) FROM t1 WHERE d='1E-';
+
+SELECT COUNT(*) FROM t1 WHERE f4='1Ex';
+SELECT COUNT(*) FROM t1 WHERE f8='1Ex';
+SELECT COUNT(*) FROM t1 WHERE i1='1Ex';
+SELECT COUNT(*) FROM t1 WHERE i2='1Ex';
+SELECT COUNT(*) FROM t1 WHERE i4='1Ex';
+SELECT COUNT(*) FROM t1 WHERE i8='1Ex';
+SELECT COUNT(*) FROM t1 WHERE d='1Ex';
+
+SELECT COUNT(*) FROM t1 WHERE f4='1e+x';
+SELECT COUNT(*) FROM t1 WHERE f8='1e+x';
+SELECT COUNT(*) FROM t1 WHERE i1='1e+x';
+SELECT COUNT(*) FROM t1 WHERE i2='1e+x';
+SELECT COUNT(*) FROM t1 WHERE i4='1e+x';
+SELECT COUNT(*) FROM t1 WHERE i8='1e+x';
+SELECT COUNT(*) FROM t1 WHERE d='1e+x';
+
+SELECT COUNT(*) FROM t1 WHERE f4='1e1000';
+SELECT COUNT(*) FROM t1 WHERE f8='1e1000';
+SELECT COUNT(*) FROM t1 WHERE i1='1e1000';
+SELECT COUNT(*) FROM t1 WHERE i2='1e1000';
+SELECT COUNT(*) FROM t1 WHERE i4='1e1000';
+SELECT COUNT(*) FROM t1 WHERE i8='1e1000';
+SELECT COUNT(*) FROM t1 WHERE d='1e1000';
+
+ALTER TABLE t1
+ ADD KEY f4(f4),
+ ADD KEY f8(f8),
+ ADD KEY i1(i1),
+ ADD KEY i2(i2),
+ ADD KEY i4(i4),
+ ADD KEY i8(i8),
+ ADD KEY d(d);
+
+SELECT COUNT(*) FROM t1 FORCE INDEX(f4) WHERE f4='1 ';
+SELECT COUNT(*) FROM t1 FORCE INDEX(f8) WHERE f8='1 ';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i1) WHERE i1='1 ';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i2) WHERE i2='1 ';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i4) WHERE i4='1 ';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i8) WHERE i8='1 ';
+SELECT COUNT(*) FROM t1 FORCE INDEX(d) WHERE d='1 ';
+
+SELECT COUNT(*) FROM t1 FORCE INDEX(f4) WHERE f4='';
+SELECT COUNT(*) FROM t1 FORCE INDEX(f8) WHERE f8='';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i1) WHERE i1='';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i2) WHERE i2='';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i4) WHERE i4='';
+SELECT COUNT(*) FROM t1 FORCE INDEX(i8) WHERE i8='';
+SELECT COUNT(*) FROM t1 FORCE INDEX(d) WHERE d='';
+
+# TODO: Add tests for all of the other tricky examples (see above) when
+# MDEV-8490 INT,DOUBLE,DECIMAL produce different warnings on comparison
+# is fixed
+
+DROP TABLE t1;
+
+SELECT
+ CAST('1 ' AS SIGNED),
+ CAST('1 ' AS UNSIGNED),
+ CAST('1 ' AS DECIMAL),
+ CAST('1 ' AS DOUBLE);
+
+SELECT
+ CAST('' AS SIGNED),
+ CAST('' AS UNSIGNED),
+ CAST('' AS DECIMAL),
+ CAST('' AS DOUBLE);
+
+SELECT
+ CAST('x' AS SIGNED),
+ CAST('x' AS UNSIGNED),
+ CAST('x' AS DECIMAL),
+ CAST('x' AS DOUBLE);
+
+SELECT
+ CAST(' x' AS SIGNED),
+ CAST(' x' AS UNSIGNED),
+ CAST(' x' AS DECIMAL),
+ CAST(' x' AS DOUBLE);
+
+SELECT
+ CAST('.' AS SIGNED),
+ CAST('.' AS UNSIGNED),
+ CAST('.' AS DECIMAL),
+ CAST('.' AS DOUBLE);
+
+SELECT
+ CAST('-' AS SIGNED),
+ CAST('-' AS UNSIGNED),
+ CAST('-' AS DECIMAL),
+ CAST('-' AS DOUBLE);
+
+SELECT
+ CAST('+' AS SIGNED),
+ CAST('+' AS UNSIGNED),
+ CAST('+' AS DECIMAL),
+ CAST('+' AS DOUBLE);
+
+SELECT
+ CAST('1x' AS SIGNED),
+ CAST('1x' AS UNSIGNED),
+ CAST('1x' AS DECIMAL),
+ CAST('1x' AS DOUBLE);
+
+SELECT
+ CAST('1e' AS SIGNED),
+ CAST('1e' AS UNSIGNED),
+ CAST('1e' AS DECIMAL),
+ CAST('1e' AS DOUBLE);
+
+SELECT
+ CAST('1e-' AS SIGNED),
+ CAST('1e-' AS UNSIGNED),
+ CAST('1e-' AS DECIMAL),
+ CAST('1e-' AS DOUBLE);
+
+SELECT
+ CAST('1E+' AS SIGNED),
+ CAST('1E+' AS UNSIGNED),
+ CAST('1E+' AS DECIMAL),
+ CAST('1E+' AS DOUBLE);
+
+# TODO: Uncomment this test when
+# MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
+# is fixed
+#SELECT
+# CAST('1e1000' AS SIGNED),
+# CAST('1e1000' AS UNSIGNED),
+# CAST('1e1000' AS DECIMAL),
+# CAST('1e1000' AS DOUBLE);
+
+
+--echo #
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+--echo #
+
+--disable_ps_protocol
+--enable_metadata
+SELECT NULL+1 AS c0,
+ COALESCE(NULL)+1 AS c2,
+ COALESCE(COALESCE(NULL))+1 AS c3,
+ ''+1 AS c4,
+ COALESCE('')+1 AS c5,
+ COALESCE(COALESCE(''))+1 AS c6;
+--disable_metadata
+--enable_ps_protocol
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_ranges.test b/mysql-test/t/type_ranges.test
index 4a897c1e440..44b0835fcae 100644
--- a/mysql-test/t/type_ranges.test
+++ b/mysql-test/t/type_ranges.test
@@ -22,7 +22,7 @@ CREATE TABLE t1 (
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
- time_stamp timestamp,
+ time_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_field date,
time_field time,
date_time datetime,
diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test
index 8b9da6962d5..16e4f42301d 100644
--- a/mysql-test/t/type_set.test
+++ b/mysql-test/t/type_set.test
@@ -185,3 +185,35 @@ DROP TABLE t1;
--echo #
--echo # End of 10.0 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8729 Wrong result for SELECT..WHERE HEX(enum_column)='61' AND enum_column='a '
+--echo #
+CREATE TABLE t1 (a SET('a','A') CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('A');
+SELECT * FROM t1 WHERE a='a ';
+SELECT * FROM t1 WHERE HEX(a)='61';
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+--echo # Can't propagate the equality into HEX(a), because binary collations still ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+DROP TABLE t1;
+
+CREATE TABLE t1 (a SET('a','a ') CHARACTER SET BINARY);
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT * FROM t1 WHERE a='a ';
+SELECT * FROM t1 WHERE HEX(a)='61';
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+--echo # Ok to propagate the equality into HEX(a), because "CHARACTER SET BINARY" does not ignore trailing spaces
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a ';
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_temporal_innodb.test b/mysql-test/t/type_temporal_innodb.test
new file mode 100644
index 00000000000..ac5daca6508
--- /dev/null
+++ b/mysql-test/t/type_temporal_innodb.test
@@ -0,0 +1,60 @@
+--source include/have_innodb.inc
+
+#
+# testing of temporal data types with InnoDB
+#
+
+
+--echo #
+--echo # MDEV-9604 crash in Item::save_in_field with empty enum value
+--echo #
+
+SELECT TIME'00:00:00'='';
+
+CREATE TABLE t1 (a ENUM('a'), b TIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','00:00:00',0);
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+DROP TABLE t1;
+
+
+SELECT DATE'0000-00-00'='';
+
+CREATE TABLE t1 (a ENUM('a'), b DATE, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00',0);
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+DROP TABLE t1;
+
+
+SELECT TIMESTAMP'0000-00-00 00:00:00'='';
+
+CREATE TABLE t1 (a ENUM('a'), b DATETIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00 00:00:00',0);
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+DROP TABLE t1;
diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test
index d36c6af65e8..27679b9ec5a 100644
--- a/mysql-test/t/type_time.test
+++ b/mysql-test/t/type_time.test
@@ -276,3 +276,453 @@ SET timestamp=DEFAULT;
--echo # End of 10.0 tests
--echo #
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+--echo #
+
+--echo # Trailing garbage in string literals
+
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00x';
+DROP TABLE t1;
+
+--echo # Trailing fractional digits in string literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00.000000';
+DROP TABLE t1;
+
+--echo # Trailing fractional digits in temporal literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00.000000';
+DROP TABLE t1;
+
+--echo # Trailing fractional digits in temporal literals, same precision
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00.000000';
+DROP TABLE t1;
+
+--echo # Leading spaces in string literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=' 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=' 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' 00:00:00';
+DROP TABLE t1;
+
+--echo # Numeric format in string literals
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='000000';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8766 Wrong result for SELECT..WHERE LENGTH(time_column)=8 AND time_column=TIMESTAMP'2001-01-01 10:20:31'
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 01:02:03');
+
+--echo # TIMESTAMP literal with the same scale, ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31';
+DROP TABLE t1;
+
+--echo # TIMESTAMP literal with a bigger scale and fractional second truncation
+--echo # Ok to propagate with precision truncation
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31.123';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+DROP TABLE t1;
+
+--echo # TIMESTAMP literal with a bigger scale and no fractional second truncation
+--echo # Ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31.000';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.000';
+DROP TABLE t1;
+
+--echo # TIMESTAMP literal with a smaller scale
+--echo # Ok to propagate
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:31.123';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.123';
+DROP TABLE t1;
+
+
+--echo # TIME literal with a bigger scale and fractional second truncation
+--echo # Ok to propagate with precision truncation
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIME'10:20:31.123';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.123';
+DROP TABLE t1;
+
+--echo # TIME literal with a bigger scale and no fractional second truncation
+--echo # Ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIME'10:20:31.000';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.000';
+DROP TABLE t1;
+
+--echo # TIME literal with a smaller scale
+--echo # Ok to propagate
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a=TIME'10:20:31.123';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.123';
+DROP TABLE t1;
+
+
+--echo # TIME-alike string literal with a bigger scale and fractional second truncation
+--echo # Ok to propagate with precision truncation
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a='10:20:31.123';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.123';
+DROP TABLE t1;
+
+--echo # TIME-alike string literal with a bigger scale and no fractional second truncation
+--echo # Ok to propagate
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a='10:20:31.000';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.000';
+DROP TABLE t1;
+
+--echo # TIME-alike string literal with a smaller scale
+--echo # Ok to propagate
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('10:20:31'),('-10:20:31');
+SELECT * FROM t1 WHERE a='10:20:31.123';
+SELECT * FROM t1 WHERE LENGTH(a)=8;
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.123';
+DROP TABLE t1;
+
+SET timestamp=DEFAULT;
+
+
+SET @@old_mode=zero_date_time_cast;
+--echo # TIMESTAMP literal, old mode
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('0000-00-00 10:20:30'),('0000-00-00 10:20:31');
+INSERT INTO t1 VALUES ('0000-00-01 10:20:30'),('0000-00-01 10:20:31');
+INSERT INTO t1 VALUES ('31 10:20:30'),('32 10:20:30'),('33 10:20:30'),('34 10:20:30');
+SELECT * FROM t1;
+
+--echo # Old mode, TIMESTAMP literal, zero YYYYMMDD, Ok to propagate
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30';
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=30+RAND();
+
+--echo # Old mode, TIMESTAMP literal, zon-zero YYYYMMDD, no propagation
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30';
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=30+RAND();
+
+--echo # Old mode, TIMESTAMP-alike string literal, zero YYYYMMDD, Ok to propagate
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30';
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=30+RAND();
+
+--echo # Old mode, TIMESTAMP-alike literal, zon-zero YYYYMMDD, no propagation
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30';
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=30+RAND();
+
+DROP TABLE t1;
+
+SET @@old_mode=DEFAULT;
+
+--echo #
+--echo # MDEV-8706 Wrong result for SELECT..WHERE time_column=TIMESTAMP'2015-08-30 00:00:00' AND time_column='00:00:00'
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00';
+SELECT * FROM t1 WHERE a='00:00:00';
+SELECT * FROM t1 WHERE a=TIMESTAMP'2015-08-30 00:00:00' AND a='00:00:00';
+SELECT * FROM t1 WHERE a>=TIMESTAMP'2015-08-30 00:00:00' AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a>=TIMESTAMP'2015-08-30 00:00:00' AND a='00:00:00';
+DROP TABLE t1;
+
+# TIMESTAMP literal with fractional seconds
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE DATE(a)<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE DATE(a)<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00.1';
+DROP TABLE t1;
+
+# DATE literal
+SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:00'),('00:00:01');
+SELECT * FROM t1 WHERE DATE(a)<=DATE'2015-08-30' AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE DATE(a)<=DATE'2015-08-30' AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=DATE'2015-08-30' AND a='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=DATE'2015-08-30' AND a='00:00:00.1';
+DROP TABLE t1;
+
+SET timestamp=DEFAULT;
+
+--echo #
+--echo # MDEV-8795 Equal expression propagation does not work for temporal literals
+--echo #
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('00:00:01'),('00:00:02');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:01' AND COALESCE(a)>=TIME'00:00:01';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8793 Wrong result set for SELECT ... WHERE COALESCE(time_column)=TIME('00:00:00') AND COALESCE(time_column)=DATE('2015-09-11')
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2015-09-11 20:20:20');
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES('10:20:30'),('00:00:00');
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00');
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11');
+
+--echo # TIME cast + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-09-11');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-09-11');
+
+--echo # TIME cast + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11';
+
+--echo # TIME literal + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+
+--echo # TIME literal + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+
+--echo # TIME-alike string literal + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11');
+
+--echo # TIME-alike string literal + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11';
+
+--echo # TIME-alike integer literal + DATE cast
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11');
+
+--echo # TIME-alike integer literal + DATE literal
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11';
+
+
+### Now test the opposite order of the two equality expressions
+
+--echo # DATE cast + TIME cast
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:00:00');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:00:00');
+
+--echo # DATE cast + TIME literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00';
+
+--echo # DATE cast + TIME-alike string literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00';
+
+--echo # DATE cast + TIME-alike integer literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
+
+--echo # DATE literal + TIME cast
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00');
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00');
+
+--echo # DATE literal + TIME literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:00';
+
+--echo # DATE literal + TIME-alike string literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)='00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)='00:00:00';
+
+--echo # DATE literal + TIME-alike integer literal
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=0;
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=0;
+
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+--echo #
+--echo # MDEV-8814 Wrong result for WHERE datetime_column > TIME('00:00:00')
+--echo #
+CREATE TABLE t1 (a DATETIME);
+INSERT INTO t1 VALUES ('2000-09-12 00:00:00'), ('2007-04-25 05:08:49');
+SELECT * FROM t1 WHERE a>TIME'00:00:00';
+SELECT * FROM t1 WHERE a>TIME('00:00:00');
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-8660 TIME(int_zerofill_column) returns a wrong result
+--echo #
+CREATE TABLE t1 (a BIGINT(15), b BIGINT(15) ZEROFILL);
+INSERT INTO t1 VALUES (9,9);
+SELECT TIME(a),TIME(b) FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT);
+INSERT INTO t1 VALUES (-9223372036854775808);
+SELECT CAST(a AS TIME), CAST(-9223372036854775808 AS TIME) FROM t1;
+DROP TABLE t1;
+
+# Make sure all numeric types produce the same TIME value
+CREATE TABLE t1 (a INT, b DECIMAL, c DOUBLE);
+INSERT INTO t1 VALUES (-9000000,-9000000,-9000000);
+INSERT INTO t1 VALUES (-1,-1,-1);
+INSERT INTO t1 VALUES (0,0,0),(1,1,1),(9,9,9);
+INSERT INTO t1 VALUES (9000000,9000000,9000000);
+SELECT a, TIME(a),TIME(b),TIME(c) FROM t1 ORDER BY a;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b DECIMAL, c DOUBLE);
+INSERT INTO t1 VALUES (0,0,0),(1,1,1),(9,9,9);
+INSERT INTO t1 VALUES (9000000,9000000,9000000);
+SELECT a, TIME(a),TIME(b),TIME(c) FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
+--echo #
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:10:10'),('10:20:30');
+SELECT MAX(a), MAX(COALESCE(a)) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 0ef0832602f..460769f8961 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -9,7 +9,7 @@ drop table if exists t1,t2;
# Set timezone to GMT-3, to make it possible to use "interval 3 hour"
set time_zone="+03:00";
-CREATE TABLE t1 (a int, t timestamp);
+CREATE TABLE t1 (a int, t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
CREATE TABLE t2 (a int, t datetime);
SET TIMESTAMP=1234;
insert into t1 values(1,NULL);
@@ -27,7 +27,7 @@ select * from t1;
drop table t1,t2;
SET TIMESTAMP=1234;
-CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp, PRIMARY KEY (id));
+CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id));
INSERT INTO t1 VALUES ("my value", "myKey","1999-04-02 00:00:00");
SELECT stamp FROM t1 WHERE id="myKey";
UPDATE t1 SET value="my value" WHERE id="myKey";
@@ -36,12 +36,12 @@ UPDATE t1 SET id="myKey" WHERE value="my value";
SELECT stamp FROM t1 WHERE id="myKey";
drop table t1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (now());
select date_format(a,"%Y %y"),year(a),year(now()) from t1;
drop table t1;
-create table t1 (ix timestamp);
+create table t1 (ix timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
select ix+0 from t1;
truncate table t1;
@@ -49,7 +49,7 @@ insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),(
select ix+0 from t1;
drop table t1;
-CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp);
+CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959);
INSERT INTO t1 VALUES ("1999-01-01","1999-01-01 00:00:00",19990101000000);
INSERT INTO t1 VALUES ("1999-09-09","1999-09-09 23:59:59",19990909235959);
@@ -71,7 +71,7 @@ drop table t1;
# Let us check if we properly treat wrong datetimes and produce proper warnings
# (for both strings and numbers)
#
-create table t1 (ix timestamp);
+create table t1 (ix timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
select ix+0 from t1;
truncate table t1;
@@ -100,7 +100,7 @@ drop table t1;
# Let us test TIMESTAMP auto-update behaviour
# Also we will test behaviour of TIMESTAMP field in SHOW CREATE TABLE and
# behaviour of DEFAULT literal for such fields
-create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
+create table t1 (t1 timestamp not null default '2003-01-01 00:00:00', t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
SET TIMESTAMP=1000000000;
insert into t1 values ();
SET TIMESTAMP=1000000001;
@@ -112,7 +112,7 @@ show create table t1;
show columns from t1;
drop table t1;
-create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
+create table t1 (t1 timestamp not null default now(), t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
SET TIMESTAMP=1000000002;
insert into t1 values ();
SET TIMESTAMP=1000000003;
@@ -124,7 +124,7 @@ show create table t1;
show columns from t1;
drop table t1;
-create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
+create table t1 (t1 timestamp not null default '2003-01-01 00:00:00' on update now(), t2 datetime);
SET TIMESTAMP=1000000004;
insert into t1 values ();
select * from t1;
@@ -137,7 +137,7 @@ show create table t1;
show columns from t1;
drop table t1;
-create table t1 (t1 timestamp default now() on update now(), t2 datetime);
+create table t1 (t1 timestamp not null default now() on update now(), t2 datetime);
SET TIMESTAMP=1000000006;
insert into t1 values ();
select * from t1;
@@ -150,7 +150,7 @@ show create table t1;
show columns from t1;
drop table t1;
-create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
+create table t1 (t1 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
SET TIMESTAMP=1000000007;
insert into t1 values ();
select * from t1;
@@ -166,7 +166,7 @@ drop table t1;
# Let us test if CURRENT_TIMESTAMP also works well as default value
# (Of course NOW and CURRENT_TIMESTAMP are same for parser but still just
# for demonstartion.)
-create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
+create table t1 (t1 timestamp not null default current_timestamp on update current_timestamp, t2 datetime);
SET TIMESTAMP=1000000009;
insert into t1 values ();
select * from t1;
@@ -196,21 +196,21 @@ drop table t1;
# Now let us test replace it should behave exactly like delete+insert
# Case where optimization is possible DEFAULT = ON UPDATE
-create table t1 (pk int primary key, t1 timestamp default current_timestamp on update current_timestamp, bulk int);
+create table t1 (pk int primary key, t1 timestamp not null default current_timestamp on update current_timestamp, bulk int);
insert into t1 values (1, '2004-04-01 00:00:00', 10);
SET TIMESTAMP=1000000013;
replace into t1 set pk = 1, bulk= 20;
select * from t1;
drop table t1;
# Case in which there should not be optimisation
-create table t1 (pk int primary key, t1 timestamp default '2003-01-01 00:00:00' on update current_timestamp, bulk int);
+create table t1 (pk int primary key, t1 timestamp not null default '2003-01-01 00:00:00' on update current_timestamp, bulk int);
insert into t1 values (1, '2004-04-01 00:00:00', 10);
SET TIMESTAMP=1000000014;
replace into t1 set pk = 1, bulk= 20;
select * from t1;
drop table t1;
# Other similar case
-create table t1 (pk int primary key, t1 timestamp default current_timestamp, bulk int);
+create table t1 (pk int primary key, t1 timestamp not null default current_timestamp on update current_timestamp, bulk int);
insert into t1 values (1, '2004-04-01 00:00:00', 10);
SET TIMESTAMP=1000000015;
replace into t1 set pk = 1, bulk= 20;
@@ -218,7 +218,7 @@ select * from t1;
drop table t1;
# Let us test alter now
-create table t1 (t1 timestamp default current_timestamp on update current_timestamp);
+create table t1 (t1 timestamp not null default current_timestamp on update current_timestamp);
insert into t1 values ('2004-04-01 00:00:00');
SET TIMESTAMP=1000000016;
alter table t1 add i int default 10;
@@ -266,7 +266,7 @@ drop table t1;
create table t1 (a bigint, b bigint);
insert into t1 values (NULL, NULL), (20030101000000, 20030102000000);
set timestamp=1000000019;
-alter table t1 modify a timestamp, modify b timestamp;
+alter table t1 modify a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modify b timestamp NOT NULL DEFAULT '0000-00-00 00:00:0';
select * from t1;
drop table t1;
@@ -274,7 +274,7 @@ drop table t1;
# Test for bug #4131, TIMESTAMP columns missing minutes and seconds when
# using GROUP BY in @@new=1 mode.
#
-create table t1 (a char(2), t timestamp);
+create table t1 (a char(2), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00'),
('b', '2004-02-01 00:00:00');
select max(t) from t1 group by a;
@@ -295,7 +295,7 @@ drop table t1;
#
# Bug#7806 - insert on duplicate key and auto-update of timestamp
#
-create table t1 (a int auto_increment primary key, b int, c timestamp);
+create table t1 (a int auto_increment primary key, b int, c timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 (a, b, c) values (1, 0, '2001-01-01 01:01:01'),
(2, 0, '2002-02-02 02:02:02'), (3, 0, '2003-03-03 03:03:03');
select * from t1;
@@ -333,8 +333,8 @@ drop table t1;
#
CREATE TABLE t1 ( f1 INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
- f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
- f3 TIMESTAMP);
+ f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ f3 TIMESTAMP NOT NULL default '0000-00-00 00:00:00');
INSERT INTO t1 (f2,f3) VALUES (NOW(), "0000-00-00 00:00:00");
INSERT INTO t1 (f2,f3) VALUES (NOW(), NULL);
INSERT INTO t1 (f2,f3) VALUES (NOW(), ASCII(NULL));
@@ -351,7 +351,7 @@ DROP TABLE t1;
--echo # Version "5.1.42 SUSE MySQL RPM"
--echo #
-CREATE TABLE t1 (a TIMESTAMP, KEY (a));
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY (a));
INSERT INTO t1 VALUES ('2000-01-01 00:00:00'), ('2000-01-01 00:00:00'),
('2000-01-01 00:00:01'), ('2000-01-01 00:00:01');
@@ -421,7 +421,7 @@ SELECT UNIX_TIMESTAMP('abc');
--echo
SET TIMESTAMP=0;
-CREATE TABLE t1(a timestamp);
+CREATE TABLE t1(a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES ('2008-02-23 09:23:45'), ('2010-03-05 11:08:02');
FLUSH TABLES t1;
SELECT MAX(a) FROM t1;
@@ -528,3 +528,30 @@ DROP TABLE t1,t2;
--echo End of 10.0 tests
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-7831 Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND)
+--echo #
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
+SELECT DATE_ADD(a, INTERVAL 10 SECOND) FROM t1;
+DROP TABLE t1;
+
+
+let type=TIMESTAMP;
+let defval='0000-00-00 00:00:00';
+--source include/type_temporal_zero_default.inc
+
+--echo #
+--echo # MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
+--echo #
+--let $TYPE=TIMESTAMP
+--source include/equal_fields_propagation_datetime.inc
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_timestamp_hires.test b/mysql-test/t/type_timestamp_hires.test
index 17a2c3e1f1f..0a49056294f 100644
--- a/mysql-test/t/type_timestamp_hires.test
+++ b/mysql-test/t/type_timestamp_hires.test
@@ -5,7 +5,7 @@ let type=timestamp;
set time_zone='+03:00';
set timestamp=unix_timestamp('2011-01-01 01:01:01') + 0.123456;
-create table t1 (a timestamp(5));
+create table t1 (a timestamp(5) DEFAULT CURRENT_TIMESTAMP);
#
# CREATE ... DEFAULT NOW(X)
#
diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test
index 909dc516703..edf60927a32 100644
--- a/mysql-test/t/type_varchar.test
+++ b/mysql-test/t/type_varchar.test
@@ -284,6 +284,42 @@ SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.c1=t2.c1;
EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.c1=t2.c1;
DROP TABLE IF EXISTS t1,t2;
+
+--echo #
+--echo # MDEV-6989 BINARY and COLLATE xxx_bin comparisions are not used for optimization in some cases
+--echo #
+CREATE TABLE t1 (c1 VARCHAR(20) CHARACTER SET latin1, PRIMARY KEY(c1));
+INSERT INTO t1 VALUES ('a'),('b'),('c'),('d');
+SELECT * FROM t1 WHERE c1=BINARY 'a';
+EXPLAIN SELECT * FROM t1 WHERE c1=BINARY 'a';
+SELECT * FROM t1 WHERE c1=_latin1'a' COLLATE latin1_bin;
+EXPLAIN SELECT * FROM t1 WHERE c1=_latin1'a' COLLATE latin1_bin;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a');
+CREATE TABLE t2 (c1 VARCHAR(10) CHARACTER SET latin1, PRIMARY KEY(c1));
+INSERT INTO t2 VALUES ('a'),('b');
+SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+EXPLAIN SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+ALTER TABLE t1 MODIFY c1 VARBINARY(10);
+SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+EXPLAIN SELECT * FROM t1, t2 WHERE t1.c1=t2.c1;
+DROP TABLE t1, t2;
+
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin);
+INSERT INTO t1 VALUES ('a'),('c');
+CREATE TABLE t2 (c1 VARCHAR(10) CHARACTER SET latin1, PRIMARY KEY(c1));
+INSERT INTO t2 VALUES ('a'),('b');
+SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+--echo # t2 should be eliminated
+EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+ALTER TABLE t1 MODIFY c1 VARBINARY(10);
+SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+--echo # t2 should be eliminated
+EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
+DROP TABLE t1,t2;
+
--echo #
--echo # End of 10.0 tests
--echo #
diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test
index 685587fe3c5..d9fa2af1eb4 100644
--- a/mysql-test/t/type_year.test
+++ b/mysql-test/t/type_year.test
@@ -188,3 +188,25 @@ drop table t1;
drop function y2k;
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010
+--echo #
+CREATE TABLE t1 (a YEAR);
+INSERT INTO t1 VALUES (2010),(2020);
+SELECT * FROM t1 WHERE a=2010 AND a>=2010;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=2010;
+SELECT * FROM t1 WHERE a=2010 AND a>=10;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=10;
+SELECT * FROM t1 WHERE a=10 AND a>=2010;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=2010;
+SELECT * FROM t1 WHERE a=10 AND a>=10;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=10;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 55d09a7d5ac..cbd19a73a80 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -26,8 +26,12 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
--error 1250
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
+select count(*) from (
+(select a,b from t1 limit 2) union all (select a,b from t2 order by a)) q;
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
select found_rows();
+select count(*) from (
+select a,b from t1 union all select a,b from t2) q;
select sql_calc_found_rows a,b from t1 union all select a,b from t2 limit 2;
select found_rows();
@@ -206,42 +210,73 @@ create table t2 (a int);
insert into t2 values (3),(4),(5);
# Test global limits
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1) UNION all (SELECT * FROM t2)) q;
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1;
select found_rows();
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2)) q;
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2;
select found_rows();
# Test cases where found_rows() should return number of returned rows
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2)) q;
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2);
select found_rows();
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1)) q;
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1);
select found_rows();
-# This used to work in 4.0 but not anymore in 4.1
---error 1064
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
-#select found_rows();
+select found_rows();
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q;
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
+select found_rows();
# In these case found_rows() should work
+--error ER_WRONG_USAGE
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
-select found_rows();
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2;
select found_rows();
# The following examples will not be exact
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION SELECT * FROM t2) q;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2;
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION all SELECT * FROM t2) q;
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all SELECT * FROM t2 LIMIT 2;
select found_rows();
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION all SELECT * FROM t2) q;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 100;
select found_rows();
+--error ER_WRONG_USAGE
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2;
-select found_rows();
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 100) UNION SELECT * FROM t2) q;
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100) UNION SELECT * FROM t2;
+--error ER_WRONG_USAGE
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2;
-select found_rows();
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q;
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2;
+--error ER_WRONG_USAGE
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2;
-select found_rows();
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q;
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 2;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2;
select found_rows();
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION SELECT * FROM t2) q;
+--error ER_WRONG_USAGE
SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2;
-select found_rows();
+SELECT COUNT(*) FROM (
+(SELECT * FROM t1 limit 2,2) UNION SELECT * FROM t2) q;
+(SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2) UNION SELECT * FROM t2;
# Test some limits with ORDER BY
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
@@ -255,7 +290,7 @@ create temporary table t1 select a from t1 union select a from t2;
drop temporary table t1;
--error ER_TABLE_EXISTS_ERROR
create table t1 select a from t1 union select a from t2;
---error 1054
+--error ER_TABLENAME_NOT_ALLOWED_HERE
select a from t1 union select a from t2 order by t2.a;
drop table t1,t2;
@@ -723,12 +758,12 @@ drop table t1;
# Enum merging test
#
CREATE TABLE t1 (
- a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
+ a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
b ENUM("one", "two") character set utf8,
c ENUM("one", "two")
);
show create table t1;
-insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
+insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
create table t2 select NULL union select a from t1;
show columns from t2;
drop table t2;
@@ -849,7 +884,7 @@ drop table t1;
#
# Bug#12185: Data type aggregation may produce wrong result
#
-create table t1(f1 char(1), f2 char(5), f3 binary(1), f4 binary(5), f5 timestamp, f6 varchar(1) character set utf8 collate utf8_general_ci, f7 text);
+create table t1(f1 char(1), f2 char(5), f3 binary(1), f4 binary(5), f5 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', f6 varchar(1) character set utf8 collate utf8_general_ci, f7 text);
create table t2 as select *, f6 as f8 from t1 union select *, f7 from t1;
show create table t2;
drop table t1, t2;
@@ -1085,13 +1120,12 @@ SELECT * FROM t1 UNION SELECT * FROM t1 ORDER BY a + 12;
--echo # Should not crash
---error ER_CANT_USE_OPTION_HERE
EXPLAIN EXTENDED
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
--echo # Should not crash
---error ER_CANT_USE_OPTION_HERE
+--sorted_result
SELECT * FROM t1 UNION SELECT * FROM t1
ORDER BY MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE);
@@ -1422,3 +1456,105 @@ UNION
(SELECT 2, 2);
--echo End of 5.5 tests
+
+--echo #
+--echo # WL#1763 Avoid creating temporary table in UNION ALL
+--echo #
+
+EXPLAIN SELECT 1 UNION ALL SELECT 1 LIMIT 1 OFFSET 1;
+
+--echo # Bug #17579498 CHANGES IN DATATYPE OF THE RESULT QUERY IN UNION.
+
+CREATE TABLE t1 (a TIME);
+CREATE TABLE t2 (b DATETIME);
+
+CREATE TABLE t3
+SELECT a FROM t1 UNION ALL SELECT b FROM t2;
+
+SELECT column_name, column_type
+FROM information_schema.columns
+WHERE TABLE_NAME='t3';
+
+DROP TABLE t1, t2, t3;
+
+--echo # Bug #17602922 RESULT DIFFERENCES IN UNION QUERIES WITH IN
+--echo # (SUBQUERY-UNION ALL)
+
+CREATE TABLE t1 (a VARCHAR(1));
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('j');
+INSERT INTO t1 VALUES ('k');
+INSERT INTO t1 VALUES ('r');
+INSERT INTO t1 VALUES ('r');
+INSERT INTO t1 VALUES ('h');
+
+SELECT a FROM t1 WHERE a IN (SELECT 'r' FROM t1 UNION ALL SELECT 'j');
+
+CREATE TABLE t2
+SELECT a FROM t1 WHERE a IN (SELECT 'r' FROM t1 UNION ALL SELECT 'j');
+
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1);
+
+SELECT a, SUM(a) FROM t2 UNION ALL SELECT a, MIN(a) FROM t1 ;
+
+SELECT FOUND_ROWS();
+
+DROP TABLE t1, t2;
+
+--echo # Bug #17669551 CRASH/ASSERT AT SELECT_CREATE::PREPARE2 AT
+--echo # SQL_INSERT.CC
+
+CREATE TABLE t1 (a INT);
+
+--error ER_DUP_FIELDNAME
+CREATE TABLE t2 SELECT a, a FROM t1 UNION ALL SELECT a, a FROM t1;
+
+DROP TABLE t1;
+
+--echo # Bug #17694956 RESULT DIFFERENCES IN UNION ALL QUERIES WITH LIMIT
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+
+(SELECT a FROM t1 ORDER BY a LIMIT 0) UNION ALL SELECT a FROM t1;
+
+DROP TABLE t1;
+
+--echo # Bug #17708480 FOUND_ROWS() VALUE DO NOT MATCH WITH UNION ALL QUERIES
+
+CREATE TABLE t1 (a INT) ENGINE=MEMORY;
+CREATE TABLE t2 (a INT) ENGINE=MEMORY;
+INSERT INTO t2 VALUES (1);
+
+SELECT COUNT(*) FROM (
+SELECT * FROM t2 UNION ALL SELECT * FROM t1) q;
+SELECT SQL_CALC_FOUND_ROWS * FROM t2 UNION ALL SELECT * FROM t1;
+SELECT FOUND_ROWS();
+
+SELECT COUNT(*) FROM (
+SELECT * FROM t1 UNION ALL SELECT * FROM t2) q;
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION ALL SELECT * FROM t2;
+SELECT FOUND_ROWS();
+
+DROP TABLE t1, t2;
+
+--echo # End of WL1763 tests
+
+--echo #
+--echo # Bug mdev-6874: crash with UNION ALL in a subquery
+--echo #
+
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 VALUES (1,1), (2,8);
+
+SELECT * FROM t1 t1_1 LEFT JOIN t1 t1_2 ON ( t1_2.b = t1_1.a )
+ WHERE t1_2.b NOT IN ( SELECT 4 UNION ALL SELECT 5 );
+
+DROP TABLE t1;
diff --git a/mysql-test/t/update_innodb.test b/mysql-test/t/update_innodb.test
index 059ae8abbb0..acc8aceab00 100644
--- a/mysql-test/t/update_innodb.test
+++ b/mysql-test/t/update_innodb.test
@@ -47,6 +47,31 @@ CREATE VIEW v1 AS SELECT * FROM t1;
CREATE TABLE t2 (b INT) ENGINE=InnoDB;
DELETE FROM v1 WHERE a IN ( SELECT a FROM t2 );
DELETE FROM v1 WHERE (a,a) IN ( SELECT a,a FROM t2 );
-
drop view v1;
drop table t1,t2;
+
+--echo #
+--echo # MDEV-10232 Scalar result of subquery changes after adding an outer select stmt
+--echo #
+
+CREATE TABLE t1 (
+ a_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ b_id INT(20) UNSIGNED NULL DEFAULT NULL,
+ c_id VARCHAR(255) NULL DEFAULT NULL,
+ PRIMARY KEY (a_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB;
+
+CREATE TABLE t2 (
+ b_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ c_id VARCHAR(255) NULL DEFAULT NULL,
+ PRIMARY KEY (b_id),
+ INDEX idx_c_id (c_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB;
+
+INSERT INTO t1 (b_id, c_id) VALUES (NULL, NULL);
+INSERT INTO t2 (c_id) VALUES (NULL);
+INSERT INTO t2 (c_id) VALUES (NULL);
+
+SELECT * FROM t1;
+SELECT t2.b_id FROM t1,t2 WHERE t2.c_id = t1.c_id;
+UPDATE t1 SET b_id = (SELECT t2.b_id FROM t2 t2 WHERE t2.c_id = t1.c_id);
+SELECT * FROM t1;
+drop table t1,t2;
diff --git a/mysql-test/t/user_limits.test b/mysql-test/t/user_limits.test
index 7c249f61686..ebb4fd4fb88 100644
--- a/mysql-test/t/user_limits.test
+++ b/mysql-test/t/user_limits.test
@@ -26,6 +26,7 @@ flush privileges;
--disable_ps_protocol
# Test of MAX_QUERIES_PER_HOUR limit
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
# This ensures that counters are reset and makes test scheduling independent
flush user_resources;
@@ -46,6 +47,7 @@ disconnect mqph;
disconnect mqph2;
# Test of MAX_UPDATES_PER_HOUR limit
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
flush user_resources;
connect (muph, localhost, mysqltest_1,,);
@@ -70,6 +72,7 @@ disconnect muph;
disconnect muph2;
# Test of MAX_CONNECTIONS_PER_HOUR limit
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
flush user_resources;
connect (mcph1, localhost, mysqltest_1,,);
@@ -97,6 +100,7 @@ drop user mysqltest_1@localhost;
# Test of MAX_USER_CONNECTIONS limit
# We need this to reset internal mqh_used variable
flush privileges;
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
flush user_resources;
connect (muc1, localhost, mysqltest_1,,);
@@ -150,6 +154,7 @@ set session max_user_connections= 2;
set global max_user_connections= 2;
select @@session.max_user_connections, @@global.max_user_connections;
# Let us check that global limit works
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
flush user_resources;
connect (muca1, localhost, mysqltest_1,,);
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 2c889c2cc0c..1e9b6a7bb14 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -1,7 +1,5 @@
# Initialise
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
+source include/have_sequence.inc;
--error 1054
set @a := foo;
@@ -501,3 +499,9 @@ eval select $tmp < $tmp2;
--enable_column_names
--enable_query_log
+#
+# MDEV-13897 SELECT @a := MAX(col) FROM t requires full index scan
+#
+explain select @a:=max(seq) from seq_1_to_1000000;
+
+# End of 10.1 tests
diff --git a/mysql-test/t/userstat.test b/mysql-test/t/userstat.test
new file mode 100644
index 00000000000..9ce3a32c442
--- /dev/null
+++ b/mysql-test/t/userstat.test
@@ -0,0 +1,116 @@
+#
+# Testing of user status (the userstat variable).
+# Note that this test requires a fresh restart to not have problems with the
+# old status values
+
+-- source include/have_innodb.inc
+-- source include/have_log_bin.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key;
+show columns from information_schema.client_statistics;
+show columns from information_schema.user_statistics;
+show columns from information_schema.index_statistics;
+show columns from information_schema.table_statistics;
+
+# Disable logging to get right number of writes into the tables.
+set @save_general_log=@@global.general_log;
+set @@global.general_log=0;
+set @@global.userstat=1;
+flush status;
+
+create table t1 (a int, primary key (a), b int default 0) engine=innodb;
+insert into t1 (a) values (1),(2),(3),(4);
+update t1 set b=1;
+update t1 set b=5 where a=2;
+delete from t1 where a=3;
+
+/* Empty query */
+select * from t1 where a=999;
+
+drop table t1;
+
+# test SSL connections
+--connect (ssl_con,localhost,root,,,,,SSL)
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
+--connection default
+
+#
+# Test the commit and rollback are counted
+#
+
+create table t1 (a int, primary key (a), b int default 0) engine=innodb;
+begin;
+insert into t1 values(1,1);
+commit;
+begin;
+insert into t1 values(2,2);
+commit;
+begin;
+insert into t1 values(3,3);
+rollback;
+drop table t1;
+
+select sleep(1);
+
+show status like "rows%";
+show status like "ha%";
+select variable_value - @global_read_key as "handler_read_key" from information_schema.global_status where variable_name="handler_read_key";
+
+--disconnect ssl_con
+
+# Ensure that the following commands doesn't change statistics
+
+set @@global.userstat=0;
+
+#
+# Check that we got right statistics
+#
+select * from information_schema.index_statistics;
+select * from information_schema.table_statistics;
+show table_statistics;
+show index_statistics;
+--query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;
+--query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;
+flush table_statistics;
+flush index_statistics;
+select * from information_schema.index_statistics;
+select * from information_schema.table_statistics;
+show status like "%generic%";
+
+#
+# Test that some variables are not 0
+#
+
+select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
+ bytes_sent <> 0, binlog_bytes_written <> 0
+ from information_schema.user_statistics;
+select connected_time <> 0, busy_time <> 0, bytes_received <> 0,
+ bytes_sent <> 0, binlog_bytes_written <> 0
+ from information_schema.client_statistics;
+
+#
+# Test of in transaction
+#
+
+create table t1 (a int) engine=innodb;
+select @@in_transaction;
+begin;
+select @@in_transaction;
+insert into t1 values (1);
+select @@in_transaction;
+commit;
+select @@in_transaction;
+set @@autocommit=0;
+select @@in_transaction;
+insert into t1 values (2);
+select @@in_transaction;
+set @@autocommit=1;
+select @@in_transaction;
+drop table t1;
+
+# Cleanup
+set @@global.general_log=@save_general_log;
diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test
index 471212bf38f..2aa77e1e254 100644
--- a/mysql-test/t/variables-notembedded.test
+++ b/mysql-test/t/variables-notembedded.test
@@ -58,9 +58,33 @@ SET @@session.relay_log= 'x';
SET @@global.relay_log= 'x';
#
--echo #
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW VARIABLES like 'relay_log_basename';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_basename;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SELECT @@global.relay_log_basename;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_basename= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_basename= 'x';
+#
+--echo #
+SHOW VARIABLES like 'log_bin_basename';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_bin_basename;
+SELECT @@global.log_bin_basename;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_bin_basename= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_bin_basename= 'x';
+#
+--echo #
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SHOW VARIABLES like 'relay_log_index';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_index;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SELECT @@global.relay_log_index;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.relay_log_index= 'x';
@@ -68,6 +92,16 @@ SET @@session.relay_log_index= 'x';
SET @@global.relay_log_index= 'x';
#
--echo #
+SHOW VARIABLES like 'log_bin_index';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_bin_index;
+SELECT @@global.log_bin_index;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_bin_index= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_bin_index= 'x';
+#
+--echo #
SHOW VARIABLES like 'relay_log_info_file';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_info_file;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 79cd5e1b24d..8f29528ac25 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -29,7 +29,6 @@ set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
set @my_net_read_timeout =@@global.net_read_timeout;
-set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
set @my_storage_engine =@@global.default_storage_engine;
@@ -314,7 +313,6 @@ set global max_delayed_threads=100;
set max_heap_table_size=100;
set max_join_size=100;
set max_sort_length=100;
-set max_tmp_tables=100;
set global max_user_connections=100;
select @@max_user_connections;
set global max_write_lock_count=100;
@@ -324,7 +322,6 @@ set net_read_timeout=100;
set net_write_timeout=100;
set read_buffer_size=100;
set read_rnd_buffer_size=100;
-set global rpl_recovery_rank=100;
set global server_id=100;
set global slow_launch_time=100;
set sort_buffer_size=100;
@@ -816,7 +813,6 @@ set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size;
set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout;
-set global rpl_recovery_rank =@my_rpl_recovery_rank;
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global default_storage_engine =@my_storage_engine;
@@ -1471,9 +1467,11 @@ drop function if exists t1_max;
drop function if exists t1_min;
--enable_warnings
+set sql_mode="";
--disable_warnings
create table t1 (a int) engine=innodb;
--enable_warnings
+set sql_mode=default;
insert into t1(a) values (0), (1);
create function t1_max() returns int return (select max(a) from t1);
create function t1_min() returns int return (select min(a) from t1);
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 4885dcc74c1..68adc6e19e1 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -732,6 +732,7 @@ drop table t2;
create table t1 (a int);
insert into t1 values (1), (2);
create view v1 as select 5 from t1 order by 1;
+show create view v1;
select * from v1;
drop view v1;
drop table t1;
@@ -2084,18 +2085,16 @@ drop table t1;
# Bug#12941
#
---disable_warnings
create table t1 (
r_object_id char(16) NOT NULL,
group_name varchar(32) NOT NULL
-) engine = InnoDB;
+);
create table t2 (
r_object_id char(16) NOT NULL,
i_position int(11) NOT NULL,
users_names varchar(32) default NULL
-) Engine = InnoDB;
---enable_warnings
+);
create view v1 as select r_object_id, group_name from t1;
create view v2 as select r_object_id, i_position, users_names from t2;
@@ -2807,11 +2806,12 @@ DROP VIEW IF EXISTS v1;
# Bug#21261 Wrong access rights was required for an insert to a view
#
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
CREATE DATABASE bug21261DB;
USE bug21261DB;
connect (root,localhost,root,,bug21261DB);
connection root;
-
CREATE TABLE t1 (x INT);
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
@@ -2841,6 +2841,8 @@ USE test;
disconnect root;
disconnect user21261;
+set GLOBAL sql_mode=default;
+set LOCAL sql_mode=default;
#
# Bug#15950 NOW() optimized away in VIEWs
@@ -4318,13 +4320,23 @@ INSERT INTO t1 VALUES
CREATE VIEW v1 AS SELECT * FROM t1;
+--echo # t1 and v1 should return the same result set
SELECT * FROM v1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
+SELECT * FROM t1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
+--echo # t1 and v1 should propagate constants in the same way
EXPLAIN EXTENDED
SELECT * FROM v1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV';
+--echo # t1 and v1 should return the same result set
SELECT * FROM v1 WHERE a > 'JJ' OR a AND a = 'VV';
+SELECT * FROM t1 WHERE a > 'JJ' OR a AND a = 'VV';
+--echo # t1 and v1 should propagate constants in the same way
EXPLAIN EXTENDED
SELECT * FROM v1 WHERE a > 'JJ' OR a AND a = 'VV';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE a > 'JJ' OR a AND a = 'VV';
DROP VIEW v1;
DROP TABLE t1;
@@ -5893,3 +5905,97 @@ USE test;
--echo # -- End of 10.0 tests.
--echo # -----------------------------------------------------------------
SET optimizer_switch=@save_optimizer_switch;
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8747 Wrong result for SELECT..WHERE derived_table_column='a' AND derived_table_column<>_latin1'A' COLLATE latin1_bin
+--echo #
+CREATE TABLE t1 (a varchar(10) character set cp1251 collate cp1251_ukrainian_ci, KEY (a)) ;
+INSERT INTO t1 VALUES ('DD'), ('ZZ'), ('ZZ'), ('KK'), ('FF'), ('HH'),('MM'),('`1');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a <> 0 AND a = ' 1';
+SELECT * FROM v1 WHERE a <> 0 AND a = ' 1';
+DROP VIEW v1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a='5' AND a<2;
+SELECT * FROM v1 WHERE a='5' AND a<2;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8749 Wrong result for SELECT..WHERE derived_table_enum_column='number' AND derived_table_enum_column OP number2
+--echo #
+CREATE TABLE t1 (a varchar(10) character set cp1251 collate cp1251_ukrainian_ci, KEY (a));
+INSERT INTO t1 VALUES ('DD'), ('ZZ'), ('ZZ'), ('KK'), ('FF'), ('HH'),('MM'),('`1');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a <> 0 AND a = ' 1';
+SELECT * FROM v1 WHERE a <> 0 AND a = ' 1';
+DROP VIEW v1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM('5','6'));
+INSERT INTO t1 VALUES ('5'),('6');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM t1 WHERE a='5' AND a<2;
+SELECT * FROM v1 WHERE a='5' AND a<2;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8742 Wrong result for SELECT..WHERE view_latin1_swedish_ci_field='a' COLLATE latin1_bin
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
+INSERT INTO t1 VALUES ('a'),('A');
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE a='a';
+SELECT * FROM v1 WHERE a=_latin1'a' COLLATE latin1_bin;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant
+--echo # produces invalid definition
+--echo #
+CREATE TABLE t1 ( i INT );
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE VIEW v1 AS
+SELECT 3 AS three, COUNT(*) FROM t1 GROUP BY three;
+
+show create view v1;
+
+SELECT * FROM v1;
+
+drop view v1;
+drop table t1;
+
+--echo #
+--echo # MDEV-12819: order by ordering expression changed to empty string
+--echo # when creatin view with union
+--echo #
+
+create table t1 (t1col1 int, t1col2 int,t1col3 int );
+create table t2 (t2col1 int, t2col2 int, t2col3 int);
+
+create view v1 as
+select t1col1,t1col2,t1col3 from t1
+union all
+select t2col1,t2col2,t2col3 from t2
+order by 2,3;
+
+show create view v1;
+
+select * from v1;
+
+drop view v1;
+drop table t1,t2;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/view_debug.test b/mysql-test/t/view_debug.test
new file mode 100644
index 00000000000..0e448ae2721
--- /dev/null
+++ b/mysql-test/t/view_debug.test
@@ -0,0 +1,36 @@
+
+--source include/have_debug.inc
+
+--echo #
+--echo #MDEV-8087:Server crashed in Time_and_counter_tracker::incr_loops
+--echo #
+
+CREATE PROCEDURE proc() SELECT * FROM v2;
+
+CREATE ALGORITHM = UNDEFINED VIEW v1 AS SELECT 1;
+CREATE ALGORITHM = TEMPTABLE VIEW v2 AS SELECT 3 FROM v1;
+DROP VIEW v1;
+
+--connect (con1,localhost,root,,test)
+
+--connect (con2,localhost,root,,test)
+
+--connection con1
+--error ER_VIEW_INVALID
+CALL proc();
+SET DEBUG_SYNC= 'after_cached_view_opened SIGNAL oppp WAIT_FOR created';
+send CALL proc();
+
+--connection con2
+SET DEBUG_SYNC= 'now WAIT_FOR oppp';
+SET DEBUG_SYNC= 'RESET';
+CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT 2;
+SET DEBUG_SYNC= 'now SIGNAL created';
+
+--connection con1
+--reap
+SET DEBUG_SYNC= 'RESET';
+
+
+drop procedure proc;
+drop view v1,v2;
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index 8907c726ae3..6d0cd8e5c28 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -11,6 +11,7 @@ drop view if exists v1,v2,v3;
# simple test of grants
+create user test@localhost;
grant create view on test.* to test@localhost;
show grants for test@localhost;
revoke create view on test.* from test@localhost;
@@ -29,6 +30,7 @@ create database mysqltest;
create table mysqltest.t1 (a int, b int);
create table mysqltest.t2 (a int, b int);
+create user mysqltest_1@localhost;
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
@@ -90,7 +92,7 @@ select d from mysqltest.v1;
connection root;
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+drop user mysqltest_1@localhost;
drop database mysqltest;
# TEMPORARY TABLE algorithm
@@ -100,6 +102,7 @@ create database mysqltest;
create table mysqltest.t1 (a int, b int);
create algorithm=temptable view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant select (c) on mysqltest.v1 to mysqltest_1@localhost;
connection user1;
@@ -110,7 +113,7 @@ select d from mysqltest.v1;
connection root;
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -129,6 +132,7 @@ create view mysqltest.v3 (c,d) as select a+1,b+1 from mysqltest.t2;
create algorithm=temptable view mysqltest.v4 (c,d) as select a+1,b+1 from mysqltest.t2;
# v5: SHOW VIEW, but no SELECT
create view mysqltest.v5 (c,d) as select a+1,b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant select on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.v2 to mysqltest_1@localhost;
grant select on mysqltest.v3 to mysqltest_1@localhost;
@@ -225,7 +229,7 @@ show create view mysqltest.v4;
connection root;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -244,6 +248,7 @@ create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant update (a) on mysqltest.v2 to mysqltest_1@localhost;
grant update on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
@@ -274,6 +279,7 @@ update v3 set a=a+c;
use test;
connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -291,6 +297,7 @@ insert into mysqltest.t2 values (3), (4), (5), (6);
create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
create view mysqltest.v2 (a,c) as select a, b+1 from mysqltest.t1;
+create user mysqltest_1@localhost;
grant delete on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
@@ -310,6 +317,7 @@ delete from v2 where c < 4;
use test;
connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -327,6 +335,7 @@ insert into mysqltest.t2 values (3,4);
create view mysqltest.v1 (a,c) as select a, b from mysqltest.t1;
create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
+create user mysqltest_1@localhost;
grant insert on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
@@ -346,6 +355,7 @@ insert into v2 select x,y from t2;
use test;
connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -359,6 +369,7 @@ create database mysqltest;
create table mysqltest.t1 (a int, b int);
create table mysqltest.t2 (a int, b int);
+create user mysqltest_1@localhost;
grant update on mysqltest.t1 to mysqltest_1@localhost;
grant update(b) on mysqltest.t2 to mysqltest_1@localhost;
grant create view,update on test.* to mysqltest_1@localhost;
@@ -407,6 +418,7 @@ create view v4 as select b+1 from mysqltest.t2;
connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
drop view v1,v2,v4;
@@ -418,6 +430,7 @@ connection root;
create database mysqltest;
--enable_warnings
create table mysqltest.t1 (a int);
+create user mysqltest_1@localhost;
grant all privileges on mysqltest.* to mysqltest_1@localhost;
connection user1;
@@ -427,6 +440,7 @@ use test;
connection root;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -439,6 +453,7 @@ create database mysqltest;
create table mysqltest.t1 (a int, b int);
+create user mysqltest_1@localhost;
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
@@ -455,6 +470,7 @@ select * from v1;
grant select on mysqltest.t1 to mysqltest_1@localhost;
select * from v1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop view v1;
drop database mysqltest;
@@ -482,6 +498,7 @@ create algorithm=MERGE view v2 as select f2() from t1;
create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
create SQL SECURITY INVOKER view v5 as select * from v4;
+create user mysqltest_1@localhost;
grant select on v1 to mysqltest_1@localhost;
grant select on v2 to mysqltest_1@localhost;
grant select on v3 to mysqltest_1@localhost;
@@ -506,6 +523,7 @@ drop function f2;
drop table t1, t2;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -529,6 +547,7 @@ delimiter //;
create function f2 () returns int begin declare v int; select s1 from t2
into v; return v; end//
delimiter ;//
+create user mysqltest_1@localhost;
grant select on t1 to mysqltest_1@localhost;
grant execute on function f2 to mysqltest_1@localhost;
grant create view on mysqltest.* to mysqltest_1@localhost;
@@ -558,6 +577,7 @@ drop function f2;
drop table t1, t2;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -572,6 +592,7 @@ use mysqltest;
create table t1 (a int);
create table v1 (a int);
insert into t1 values (1);
+create user mysqltest_1@localhost;
grant select on t1 to mysqltest_1@localhost;
grant select on v1 to mysqltest_1@localhost;
grant create view on mysqltest.* to mysqltest_1@localhost;
@@ -601,6 +622,7 @@ select * from v5;
drop table t1;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
@@ -617,6 +639,7 @@ create algorithm=MERGE view v2 as select *, a as b from t1;
create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
create SQL SECURITY INVOKER view v5 as select * from v4;
+create user mysqltest_1@localhost;
grant select on v1 to mysqltest_1@localhost;
grant select on v2 to mysqltest_1@localhost;
grant select on v3 to mysqltest_1@localhost;
@@ -640,6 +663,7 @@ drop view v1, v2, v3, v4, v5;
drop table t1;
use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
drop database mysqltest;
#
@@ -657,6 +681,7 @@ delete from mysql.user where user='';
flush privileges;
# Create the test user
+create user 'test14256'@'%';
grant all on test.* to 'test14256'@'%';
connect (test14256,localhost,test14256,,test);
@@ -702,6 +727,7 @@ use mysqltest;
CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
+create user mysqltest_1@localhost;
GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
connection user1;
@@ -1162,6 +1188,7 @@ INSERT INTO mysqltest1.t2 VALUES (21), (22), (23), (24);
INSERT INTO mysqltest1.t3 VALUES (31), (32), (33), (34);
INSERT INTO mysqltest1.t4 VALUES (41), (42), (43), (44);
+CREATE USER mysqltest_u1@localhost;
GRANT SELECT ON mysqltest1.t1 TO mysqltest_u1@localhost;
GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost;
GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost;
@@ -1237,6 +1264,7 @@ USE db1;
CREATE TABLE t1(f1 INT, f2 INT);
CREATE VIEW v1 AS SELECT f1, f2 FROM t1;
+CREATE USER foo;
GRANT SELECT (f1) ON t1 TO foo;
GRANT SELECT (f1) ON v1 TO foo;
diff --git a/mysql-test/t/warnings_engine_disabled.test b/mysql-test/t/warnings_engine_disabled.test
index 11b22135128..46c686aa6d6 100644
--- a/mysql-test/t/warnings_engine_disabled.test
+++ b/mysql-test/t/warnings_engine_disabled.test
@@ -12,9 +12,11 @@ if (!`SELECT count(*) FROM information_schema.engines WHERE
# Test for handler type, will select MyISAM and print a warning
# about that - since InnoDB is disabled
#
+set sql_mode="";
create table t1 (id int) engine=InnoDB;
alter table t1 engine=InnoDB;
drop table t1;
+set sql_mode=default;
#
# Bug#29263 disabled storage engines omitted in SHOW ENGINES
diff --git a/mysql-test/t/xa_sync.test b/mysql-test/t/xa_sync.test
new file mode 100644
index 00000000000..bb95af7c0ba
--- /dev/null
+++ b/mysql-test/t/xa_sync.test
@@ -0,0 +1,45 @@
+--source include/have_debug_sync.inc
+
+--echo #
+--echo # MDEV-7793 - Race condition between XA COMMIT/ROLLBACK and disconnect
+--echo #
+--echo # Note that this test is meaningful only with valgrind.
+let $op= XA COMMIT 'xatest';
+let $i= 2;
+while ($i)
+{
+ connect con1, localhost, root;
+ connect con2, localhost, root;
+
+ connection con1;
+ XA START 'xatest';
+ XA END 'xatest';
+ XA PREPARE 'xatest';
+
+ connection con2;
+ SET debug_sync='xa_after_search SIGNAL parked WAIT_FOR go';
+ send_eval $op;
+
+ connection default;
+ SET debug_sync='now WAIT_FOR parked';
+ disconnect con1;
+ disable_query_log;
+ echo # Waiting for thread to get deleted;
+ while (`SELECT count(*)!=2 FROM INFORMATION_SCHEMA.PROCESSLIST`)
+ {
+ real_sleep 0.1;
+ }
+ enable_query_log;
+ SET debug_sync='now SIGNAL go';
+
+ connection con2;
+ --error ER_XAER_NOTA
+ reap;
+ disconnect con2;
+
+ connection default;
+ SET debug_sync='RESET';
+
+ let $op= XA ROLLBACK 'xatest';
+ dec $i;
+}
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index e9e7864c418..c68790b7045 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -713,7 +713,7 @@ FROM t1;
SELECT UPDATEXML(txt, CONCAT('//', REPEAT('b', 63)), '63/63+') FROM t1;
DROP TABLE t1;
-# This will call my_str_realloc_mysqld()
+# This will call realloc()
CREATE TABLE t1 (a TEXT);
INSERT INTO t1 VALUES (CONCAT('<a><', REPEAT('b',128),'>b128</',REPEAT('b',128),'><',REPEAT('c',512),'>c512</',REPEAT('c',512),'></a>'));
SELECT ExtractValue (a, CONCAT('//',REPEAT('c',512))) AS c512 FROM t1;
diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests
index 4f74a7d744d..3010c5ddf79 100644
--- a/mysql-test/unstable-tests
+++ b/mysql-test/unstable-tests
@@ -23,173 +23,299 @@
#
##############################################################################
-main.count_distinct2 : MDEV-11768 - timeout
-main.create : Modified in 10.0.34
+main.alter_table : Modified in 10.1.29
+main.alter_table_trans : MDEV-12084 - timeout
+main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result
+main.auth_named_pipe : MDEV-14724 - System error 2
+main.bootstrap : Include files modified in 10.1.29
+main.case : Modified in 10.1.29
main.create_delayed : MDEV-10605 - failed with timeout
-main.ctype_utf8 : Modified in 10.0.34
-main.ctype_utf8mb4 : Modified in 10.0.34
-main.debug_sync : MDEV-10607 - internal error
-main.derived : Modified in 10.0.34
-main.derived_opt : MDEV-11768 - timeout
-main.dyncol : Modified in 10.0.34
-main.events_slowlog : MDEV-12821 - wrong result
-main.fulltext : Modified in 10.0.34
-main.func_isnull : Modified in 10.0.34
-main.func_misc : Modified in 10.0.34
-main.func_set : Modified in 10.0.34
-main.func_str : Modified in 10.0.34
-main.gis : MDEV-13411 - wrong result on P8
-main.group_by : Modified in 10.0.34
-main.having : Modified in 10.0.34
+main.ctype_gbk : Modified in 10.1.29
+main.ctype_latin1 : Modified in 10.1.29
+main.ctype_ucs : Modified in 10.1.29
+main.ctype_utf16le : MDEV-10675: timeout or extra warnings
+main.ctype_utf32 : Modified in 10.1.29
+main.ctype_utf8 : Modified in 10.1.30
+main.ctype_utf8mb4 : Modified in 10.1.30
+main.delete_returning : Modified in 10.1.29
+main.delimiter_command_case_sensitivity : Added in 10.1.29
+main.events_2 : MDEV-13277 - Server crash
+main.events_bugs : MDEV-12892 - Crash in fill_schema_processlist
+main.events_restart : MDEV-12236 - Server shutdown problem
+main.func_in : Modified in 10.1.29
+main.func_misc : Modified in 10.1.29
+main.func_regexp_pcre : Modified in 10.1.29
+main.func_set : Modified in 10.1.30
+main.func_str : Modified in 10.1.30
+main.func_time : Modified in 10.1.29
+main.gis-precise : Modified in 10.1.29
+main.group_by : Modified in 10.1.30
+main.having : Modified in 10.1.30
main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown
main.index_intersect_innodb : MDEV-10643 - failed with timeout
-main.index_merge_innodb : MDEV-7142 - wrong result
+main.index_merge_innodb : MDEV-7142 - Wrong execution plan, timeout with valgrind
+main.information_schema : Modified in 10.1.29
main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure
-main.join_cache : Modified in 10.0.34
-main.join_outer : Modified in 10.0.34
-main.kill_processlist-6619 : MDEV-10793 - wrong result
-main.log_tables-big : MDEV-13408 - wrong result
-main.mdev_14586 : Added in 10.0.34
+main.join_outer : Modified in 10.1.30
+main.kill_processlist-6619 : MDEV-10793 - wrong result in processlist
main.mdev-504 : MDEV-10607 - sporadic "can't connect"
+main.mdev13607 : Added in 10.1.29
main.mdev375 : MDEV-10607 - sporadic "can't connect"
-main.merge : MDEV-10607 - sporadic "can't connect"; modified in 10.0.34
-main.myisam_optimize : Modified in 10.0.34
-main.mysqlbinlog : Modified in 10.0.34
-main.mysqldump-nl : Modified in 10.0.34
-main.mysqlhotcopy_myisam : MDEV-10995 - test hangs on debug build
+main.merge : MDEV-10607 - sporadic "can't connect"
+main.myisam : Modified in 10.1.29
+main.mysql_upgrade_noengine : MDEV-14355 - Plugin is busy
+main.mysqlbinlog : Modified in 10.1.29
+main.mysqlslap : MDEV-11801 - timeout
main.mysqltest : MDEV-9269 - fails on Alpha
-main.mysql_client_test_nonblock : MDEV-15096 - exec failed
-main.order_by : Modified in 10.0.34
-main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; modified in 10.0.34
-main.query_cache_debug : Modified in 10.0.34
-main.repair : Modified in 10.0.34
-main.show_explain : MDEV-10674 - wrong result
-main.sp_notembedded : MDEV-10607 - internal error
+main.order_by_optimizer_innodb : MDEV-10683 - wrong execution plan
+main.partition_datatype : Modified in 10.1.29
+main.partition_example : Include files modified in 10.1.29
+main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings
+main.plugin : Include files modified in 10.1.29
+main.plugin_innodb : Include files modified in 10.1.29
+main.plugin_load : Include files modified in 10.1.29
+main.plugin_load_option : Include files modified in 10.1.29
+main.plugin_maturity : Include files modified in 10.1.29
+main.plugin_not_embedded : Include files modified in 10.1.29
+main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; modified in 10.1.29
+main.query_cache : MDEV-12895 - Wrong result
+main.range_vs_index_merge : Modified in 10.1.29
+main.range_vs_index_merge_innodb : MDEV-12637 - Timeout
+main.read_only : Modified in 10.1.29
+main.set_statement : MDEV-13183 - Wrong result
+main.show_explain : MDEV-10674 - sporadic failure
+main.show_function_with_pad_char_to_full_length : Added in 10.1.29
+main.sp : Modified in 10.1.30
main.sp-security : MDEV-10607 - sporadic "can't connect"
-main.stat_tables_par_innodb : MDEV-14155 - wrong rounding
-main.subselect : Modified in 10.0.34
-main.subselect_exists2in : Modified in 10.0.34
+main.status : MDEV-8510 - sporadic wrong result
+main.subselect_exists2in : Modified in 10.1.29
main.subselect_innodb : MDEV-10614 - sporadic wrong results
-main.symlink-aria-11902 : MDEV-15098 - error 40 from storage engine
-main.symlink-myisam-11902 : MDEV-15098 - error 40 from storage engine
-main.type_datetime : MDEV-14322 - wrong result
-main.union : Modified in 10.0.34
-main.view : Modified in 10.0.34
-main.xa : MDEV-11769 - lock wait timeout; modified in 10.0.34
+main.subselect_mat_cost_bugs : Modified in 10.1.29
+main.table_options-5867 : Include files modified in 10.1.29
+main.trigger : Modified in 10.1.30
+main.truncate_badse : Include files modified in 10.1.29
+main.type_bit : Modified in 10.1.29
+main.type_date : Modified in 10.1.29
+main.type_datetime_hires : MDEV-10687 - timeout
+main.type_varchar : Modified in 10.1.29
+main.user_var : Modified in 10.1.29
+main.view : Modified in 10.1.30
+main.xml : Modified in 10.1.30
#----------------------------------------------------------------
-archive.archive_bitfield : MDEV-11771 - table is marked as crashed
-archive.archive_symlink : MDEV-12170 - unexpected error on rmdir
-archive.discover : MDEV-10510 - table is marked as crashed
-archive.mysqlhotcopy_archive : MDEV-10995 - test hangs on debug build, MDEV-14726 - table is marked as crashed
+archive.discover : MDEV-10510 - Table is marked as crashed
+archive.mysqlhotcopy_archive : MDEV-14726 - Table is marked as crashed
#----------------------------------------------------------------
-binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed
-binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
+binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed
+binlog.binlog_flush_binlogs_delete_domain : MDEV-14431 - Wrong error code; added in 10.1.30
+binlog.binlog_gtid_delete_domain_debug : Added in 10.1.30
+binlog.binlog_killed : MDEV-12925 - Wrong result
+binlog.binlog_spurious_ddl_errors : Include files modified in 10.1.29
+binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
#----------------------------------------------------------------
-connect.json : Sporadic wrong result
-connect.zip : Sporadic wrong result
+binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint
+binlog_encryption.encrypted_master : MDEV-12906 - Failed to sync
+binlog_encryption.rpl_parallel : MDEV-10653 - Timeout
+binlog_encryption.rpl_semi_sync : MDEV-11220 - Wrong result, MDEV-11673 - Valgrind warning
+binlog_encryption.rpl_ssl : MDEV-14507 - Timeout on SLES 11.4
+binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL server during query
#----------------------------------------------------------------
-engines/rr_trx.* : MDEV-10998 - tests not maintained
+connect.json_java_2 : Include file modified in 10.1.29
+connect.json_java_3 : Include file modified in 10.1.29
+connect.json_mongo_c : Include file modified in 10.1.29
+connect.mongo_c : Include file modified in 10.1.29
+connect.mongo_java_2 : Include file modified in 10.1.29
+connect.mongo_java_3 : Include file modified in 10.1.29
+connect.tbl : MDEV-9844, MDEV-10179 - sporadic crashes, valgrind warnings, wrong results
+connect.tbl_thread : MDEV-9844, MDEV-10179, MDEV-14214 - sporadic crashes, valgrind warnings, wrong results
+connect.zip : MDEV-13884 - Wrong result
#----------------------------------------------------------------
-federated.federatedx : MDEV-10617 - Wrong checksum, timeouts
-federated.federated_bug_35333 : MDEV-13410 - Wrong result
+encryption.create_or_replace : MDEV-9359 - Assertion failure, MDEV-13516 - Assertion failure
+encryption.debug_key_management : MDEV-13841 - Timeout on wait condition
+encryption.encrypt_and_grep : MDEV-13765 - Wrong result
+encryption.encryption_force : Modified in 10.1.29
+encryption.filekeys_encfile : Include file modified in 10.1.29
+encryption.filekeys_encfile_file : Include file modified in 10.1.29
+encryption.innodb-bad-key-change2 : MDEV-12632 - Valgrind warnings
+encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate
+encryption.innodb-discard-import-change : MDEV-12632 - Valgrind warnings
+encryption.innodb-encryption-alter : Modified in 10.1.29
+encryption.innodb_encryption_discard_import : MDEV-12903 - Wrong result
+encryption.innodb_encryption_filekeys : MDEV-9962 - timeouts
+encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure
+encryption.innodb_encryption_tables : MDEV-9359 - Assertion failure
+encryption.innodb_first_page : MDEV-10689 - crashes
+encryption.innodb-first-page-read : MDEV-14356 - Timeout on wait condition
+encryption.innodb_lotoftables : MDEV-11531 - InnoDB error
+encryption.innodb-missing-key : MDEV-9359 - assertion failure
+encryption.innodb-page_encryption : MDEV-10641 - mutex problem
+encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup
+encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing
+encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing
+encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing
+
+#----------------------------------------------------------------
+
+engines/iuds.* : Not maintained in timely manner
+engines/funcs.* : Not maintained in timely manner
+
+#----------------------------------------------------------------
+
+federated.federated_bug_585688 : MDEV-12907 - Valgrind
federated.federated_innodb : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips
federated.federated_partition : MDEV-10417 - Fails on Mips
federated.federated_transactions : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips
+federated.federatedx : MDEV-10617 - Wrong checksum, timeouts
#----------------------------------------------------------------
-funcs_1.memory_views : MDEV-11773 - timeout
-funcs_1.processlist_val_ps : MDEV-12175 - Wrong result
-funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result
+funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result
+funcs_1.processlist_val_ps : MDEV-12175 - Wrong plan
+
+funcs_2.memory_charset : MDEV-10290 - Timeout
+funcs_2.myisam_charset : MDEV-11535 - Timeout
-funcs_2/charset.* : MDEV-10999 - test not maintained
+#----------------------------------------------------------------
+
+galera.* : The suite was enabled in 10.1.27 and is still unstable
+galera_3nodes.* : The suite has not been stabilized yet
+
+galera.galera_applier_ftwrl_table_alter : MDEV-13738 - MySQL server has gone away
+galera.galera_gcs_fc_limit : MDEV-13877 - Timeout
+galera.galera_suspend_slave : MDEV-13873 - Wrong error code
+galera.galera_toi_truncate : MDEV-13743 - query 'reap' succeeded
+galera.galera_unicode_identifiers : MDEV-13871 - Unknown database
+galera.galera_var_node_address : MDEV-13880 - Failed to start mysqld
+galera.galera_wan : MDEV-13879 - Stray state UUID msg warnings
+galera.galera_wsrep_log_conficts : MDEV-13874 - check-testcase failed
+galera.partition : MDEV-13881 - Wrong result
+galera.query_cache : MDEV-13883 - Wrong result
+galera.MW-328A : MDEV-13876 - Wrong result
#----------------------------------------------------------------
-innodb.binlog_consistent : MDEV-10618 - Server fails to start
-innodb.group_commit_crash : MDEV-11770 - checksum mismatch
-innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - checksum mismatch
-innodb.innodb : Modified in 10.0.34
-innodb.innodb-alter-table : MDEV-10619 - Testcase timeout
-innodb.innodb-autoinc : Modified in 10.0.34
-innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan
-innodb.innodb_bug48024 : MDEV-14352 - Assertion failure
-innodb.innodb-index-debug : Modified in 10.0.34
-innodb.innodb-index-online : Modified in 10.0.34
-innodb.innodb_monitor : MDEV-10939 - Testcase timeout
-innodb.innodb-replace-debug : Added in 10.0.34
-innodb.innodb-wl5522-debug : Modified in 10.0.34
-innodb.recovery_shutdown : Added in 10.0.34
-
-innodb_fts.innodb-fts-fic : MDEV-14154 - Assertion failure
-innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning
-
-innodb_zip.wl5522_debug_zip : Added in 10.0.34
+innodb.binlog_consistent : MDEV-10618 - Server fails to start
+innodb.doublewrite : MDEV-12905, MDEV-14205 - Lost connection to MySQL server
+innodb_fts.fulltext2 : MDEV-14727 - Long semaphore wait
+innodb.innodb-16k : Modified in 10.1.29
+innodb.innodb-32k : Modified in 10.1.29
+innodb.innodb-64k : Modified in 10.1.29
+innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup
+innodb.innodb-alter : Modified in 10.1.29
+innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS
+innodb.innodb-alter-table : MDEV-10619 - Testcase timeout; modified in 10.1.29
+innodb.innodb-autoinc : Modified in 10.1.30
+innodb.innodb-blob : MDEV-12053 - Client crash
+innodb.innodb_bug14147491 : MDEV-11808 - wrong error codes
+innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan
+innodb.innodb_bug48024 : MDEV-14352 - Assertion failure
+innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown
+innodb.innodb-get-fk : Modified in 10.1.29
+innodb.innodb-page_compression_lzma : MDEV-14353 - wrong result on Fedora 25
+innodb.innodb-page_compression_tables : Modified in 10.1.29
+innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem
+innodb.innodb-replace-debug : Added in 10.1.30
+innodb.innodb_stats : MDEV-10682 - wrong result
+innodb.innodb_sys_semaphore_waits : MDEV-10331 - wrong result
+innodb.innodb-table-online : Modified in 10.1.29
+innodb.innodb-wl5522-debug : Modified in 10.1.29
+innodb.innodb-wl5980-alter : Modified in 10.1.29
+innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks
+innodb.recovery_shutdown : Added in 10.1.30
+innodb.table_definition_cache_debug : MDEV-14206 - Extra warning; opt file modified in 10.1.30
+innodb.table_flags : MDEV-14363 - Operating system error number 2
+innodb.undo_log : Modified in 10.1.29
+
+innodb_fts.concurrent_insert : Added in 10.1.29
+innodb_fts.fulltext : Modified in 10.1.29
+innodb_fts.fulltext_misc : MDEV-12636 - Valgrind warnings
+
+innodb_zip.innodb_prefix_index_liftedlimit : Modified in 10.1.29
+innodb_zip.wl5522_debug_zip : Added in 10.1.29
#----------------------------------------------------------------
-maria.lock : Modified in 10.0.34
-maria.maria : MDEV-14430 - Wrong result; modified in 10.0.34
-maria.repair : Added in 10.0.34
+maria.maria : MDEV-14430 - Wrong result; modified in 10.1.29
#----------------------------------------------------------------
+mariabackup.compress_qpress : Added in 10.1.29
+mariabackup.data_directory : Added in 10.1.29
+mariabackup.incremental_backup : Modified in 10.1.29
+mariabackup.mdev-14447 : Added in 10.1.30
+mariabackup.partition_datadir : Added in 10.1.29
+
+#----------------------------------------------------------------
+
+mroonga.* : Many tests and include files added and modified in 10.1.29
+mroonga/storage.* : Many tests and include files added and modified in 10.1.29
+
mroonga/storage.column_datetime_32bit_2038 : Wrong result on Alpha
mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha
mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha
mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha
mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha
mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha
+mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - valgrind warnings
+mroonga/storage.repair_table_no_index_file : MDEV-9364 - wrong result
+mroonga/storage.variable_query_log_file_disabled_empty_value : Modified in 10.1.30
+mroonga/storage.variable_query_log_file_disabled_null_value : Modified in 10.1.30
+mroonga/storage.variable_query_log_file_enabled_empty_value : Modified in 10.1.30
+mroonga/storage.variable_query_log_file_enabled_null_value : Modified in 10.1.30
+mroonga/storage.variable_query_log_file_new_value : Modified in 10.1.30
+mroonga/storage.variable_query_log_file_same_value : Modified in 10.1.30
#----------------------------------------------------------------
multi_source.gtid : MDEV-10417 - Fails on Mips
-multi_source.info_logs : MDEV-10042 - Wrong result
+multi_source.info_logs : MDEV-10042 - Wrong result, MDEV-12629 - Valgrind warnings
multi_source.multisource : MDEV-10417 - Fails on Mips
-multi_source.reset_slave : MDEV-10690 - Wrong result
+multi_source.reset_slave : MDEV-10690 - wrong result
multi_source.simple : MDEV-4633 - Wrong slave status output
multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_heartbeats
#----------------------------------------------------------------
-parts.partition_alter_innodb : Added in 10.0.34
-parts.partition_alter_maria : Modified in 10.0.34
-parts.partition_alter_myisam : Added in 10.0.34
-parts.partition_auto_increment_maria : MDEV-14430 - wrong result
-parts.partition_debug_innodb : MDEV-15095 - table does not exist
-parts.partition_exch_qa_10 : MDEV-11765 - wrong result
+parts.partition_alter_innodb : Added in 10.1.30
+parts.partition_alter_maria : Modified in 10.1.30
+parts.partition_alter_myisam : Added in 10.1.30
+parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query
+parts.partition_auto_increment_maria : MDEV-14430 - Wrong result
+parts.partition_innodb_status_file : MDEV-12901 - Valgrind
#----------------------------------------------------------------
perfschema.func_file_io : MDEV-5708 - fails for s390x
perfschema.func_mutex : MDEV-5708 - fails for s390x
-perfschema.hostcache_ipv6_ssl : MDEV-10696 - crash on shutdown
+perfschema.misc : Modified in 10.1.30
+perfschema.privilege_table_io : MDEV-13184 - Extra lines
+perfschema.setup_actors : MDEV-10679 - rare crash
perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match
-perfschema.stage_mdl_procedure : MDEV-11545 - Wrong result
-
-perfschema_stress.* : MDEV-10996 - tests not maintained
+perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders
+perfschema.stage_mdl_table : MDEV-12638 - Wrong result
+perfschema.threads_mysql : MDEV-10677 - sporadic wrong result
#----------------------------------------------------------------
-plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url, MDEV-11118 - wrong result
-plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.0.34
-plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc, MDEV-14295 - wrong result; modified in 10.0.34
+plugins.binlog-simple_plugin_check : Added in 10.1.30
+plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url
+plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.1.29
+plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.1.29
#----------------------------------------------------------------
-roles.create_and_grant_role : MDEV-11772 - wrong result
-roles.flush_roles-12366 : Added in 10.0.34
-roles.set_role-13655 : Added in 10.0.34
+roles.definer : Modified in 10.1.29
+roles.flush_roles-12366 : Added in 10.1.30
+roles.set_role-13655 : Added in 10.1.30
#----------------------------------------------------------------
@@ -198,49 +324,85 @@ rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips
rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips
rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log
rpl.rpl_binlog_index : MDEV-9501 - Warning: failed registering on master
+rpl.rpl_checksum_cache : MDEV-12173 - Unexpected error
rpl.rpl_ddl : MDEV-10417 - Fails on Mips
+rpl.rpl_domain_id_filter_io_crash : MDEV-14357 - Wrong result
+rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result
+rpl.rpl_gtid_basic : MDEV-10681 - server startup problem
rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering on master
-rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown
+rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout in include; added in 10.1.30
+rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings
+rpl.rpl_gtid_reconnect : MDEV-14497 - Timeout
+rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings
rpl.rpl_gtid_until : MDEV-10625 - warnings in error log
rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips
rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x
rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x
+rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query
rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips
+rpl.rpl_mariadb_slave_capability : MDEV-11018 - sporadic wrong events in binlog
rpl.rpl_mdev6020 : MDEV-10630, MDEV-10417 - Timeouts, fails on Mips
+rpl.rpl_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed
+rpl.rpl_non_direct_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed
+rpl.rpl_non_direct_row_mixing_engines : MDEV-14491 - Long semaphore wait
+rpl.rpl_non_direct_stm_mixing_engines : MDEV-14489 - Sync slave with master failed
rpl.rpl_parallel : MDEV-10653 - Timeouts
rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure
rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout
+rpl.rpl_parallel_optimistic : MDEV-10511 - Timeout
+rpl.rpl_parallel_retry : MDEV-11119 - Server crash
rpl.rpl_parallel_temptable : MDEV-10356 - Crash in close_thread_tables
rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips
-rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start
-rpl.rpl_row_index_choice : MDEV-13409 - Server crash
+rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings
+rpl.rpl_plugin_load : Include files modified in 10.1.29
+rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result
+rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed
+rpl.rpl_row_img_eng_min : MDEV-13875 - command "diff_files" failed
+rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed
+rpl.rpl_row_log : Include file modified in 10.1.30
+rpl.rpl_row_log_innodb : Include file modified in 10.1.30
+rpl.rpl_row_mixing_engines : MDEV-14491 - Long semaphore wait
rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x
rpl.rpl_semi_sync : MDEV-11220 - Wrong result
+rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result
+rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result
+rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings
rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Wrong plugin status
-rpl.rpl_show_slave_hosts : MDEV-12171 - Server failed to start
+rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition
+rpl.rpl_show_slave_hosts : MDEV-10681 - server startup problem
rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha
rpl.rpl_slave_grp_exec : MDEV-10514 - Unexpected deadlock
+rpl.rpl_start_stop_slave : MDEV-13567 - Replication failure
+rpl.rpl_stm_log : Include file modified in 10.1.30
+rpl.rpl_stm_mixing_engines : MDEV-14489 - Sync slave with master failed
+rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion
rpl.rpl_sync : MDEV-10633 - Database page corruption
+rpl.rpl_table_options : Include files modified in 10.1.29
rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries
-
-rpl/extra/rpl_tests.* : MDEV-10994 - tests not maintained
+rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result
#----------------------------------------------------------------
spider.* : MDEV-9329 - tests are too memory-consuming
+spider.spider_fixes : MDEV-12900 - Valgrind
+spider.spider_fixes_part : MDEV-12900 - Valgrind
+
+spider/bg.basic_sql : MDEV-12900 - Valgrind
spider/bg.direct_aggregate : MDEV-7098 - Trying to unlock mutex that wasn't locked
spider/bg.direct_aggregate_part : MDEV-7098 - Trying to unlock mutex that wasn't locked
-spider/bg.spider3_fixes : MDEV-7098 - Trying to unlock mutex that wasn't locked
-spider/bg.spider_fixes_part : MDEV-7098 - Trying to unlock mutex that wasn't locked
-spider/bg.ha : MDEV-7914, MDEV-9329 - Crash, failures on s390x
-spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x
-spider/bg.spider_fixes : MDEV-7098, MDEV-9329 - Mutex problem, failures on s390x
+spider/bg.function : MDEV-12900 - Valgrind
+spider/bg.ha : MDEV-7914 - Crash, MDEV-9329 - failures on s390x
+spider/bg.ha_part : MDEV-7914 - Crash, MDEV-9329 - Fails on Ubuntu/s390x
+spider/bg.spider_fixes : MDEV-7098 -Mutex problem, MDEV-9329 - failures on s390x, MDEV-12900 - Valgrind
+spider/bg.spider3_fixes : MDEV-12639 - Packets out of order
spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x
+spider/handler.* : MDEV-10987, MDEV-10990 - Tests have not been maintained
+
#----------------------------------------------------------------
-sphinx.* : MDEV-10986 - sphinx tests fail in buildbot and outside
+sphinx.* : MDEV-10986 - Tests have not been maintained
#----------------------------------------------------------------
@@ -252,60 +414,61 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout
#----------------------------------------------------------------
-sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x
-sys_vars.innodb_buffer_pool_dump_now_basic : Modified in 10.0.34
-sys_vars.innodb_buffer_pool_dump_pct_basic : Modified in 10.0.34
-sys_vars.innodb_buffer_pool_load_now_basic : Modified in 10.0.34
-sys_vars.innodb_print_lock_wait_timeout_info_basic : Added in 10.0.34
-sys_vars.thread_cache_size_func : MDEV-11775 - wrong result
+sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x
+sys_vars.explicit_defaults_for_timestamp_off : Include file modified in 10.1.29
+sys_vars.explicit_defaults_for_timestamp_on : Include file modified in 10.1.29
+sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout
+sys_vars.innodb_buffer_pool_dump_now_basic : Modified in 10.1.29
+sys_vars.innodb_buffer_pool_dump_pct_basic : Modified in 10.1.29
+sys_vars.innodb_buffer_pool_load_now_basic : Modified in 10.1.29
+sys_vars.innodb_fatal_semaphore_wait_threshold : MDEV-10513 - crashes
+sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash
+sys_vars.rpl_init_slave_func : MDEV-10149 - wrong results
+sys_vars.sysvars_wsrep : MDEV-12522 - Dependency on specific wsrep_provider
+sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result
+sys_vars.wait_timeout_func : MDEV-12896 - Wrong result
#----------------------------------------------------------------
-tokudb.card_scale_percent : Modified in 10.0.34
-tokudb.change_column_all_1000_10 : MDEV-12640 - Lost connection during query
-tokudb.change_column_bin : MDEV-12640 - Lost connection during query
-tokudb.change_column_char : MDEV-12822 - Lost connection during query
+tokudb.change_column_all_1000_10 : MDEV-12640 - Crash
+tokudb.change_column_bin : MDEV-12640 - Crash
+tokudb.change_column_char : MDEV-12822 - Lost connection to MySQL server
+tokudb.cluster_filter : MDEV-10678 - Wrong execution plan
+tokudb.cluster_filter_hidden : MDEV-10678 - Wrong execution plan
tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan
-tokudb.dir_per_db : MDEV-11537 - wrong result
-tokudb.dir_per_db_rename_to_nonexisting_schema : MDEV-12823 - Valgrind
-tokudb.hotindex-insert-bigchar : MDEV-13870 - ASAN failures
-tokudb.hotindex-update-1 : MDEV-12640 - Lost connection during query
-tokudb.locking-read-repeatable-read-1 : Added in 10.0.34
-tokudb.locking-read-repeatable-read-2 : Added in 10.0.34
-tokudb.locks-select-update-1 : MDEV-13406 - Lock wait timeout
-tokudb.nonflushing_analyze_debug : Added in 10.0.34
-tokudb.rows-32m-rand-insert : MDEV-12640 - Lost connection during query
-tokudb.rows-32m-seq-insert : MDEV-12640 - Lost connection during query
-tokudb.row_format : Modified in 10.0.34
-
-tokudb_backup.* : MDEV-11001 - tests don't work
+tokudb.dir_per_db : MDEV-11537 - Wrong result
+tokudb.dir_per_db_rename_to_nonexisting_schema : MDEV-14359 - Directory not empty
+tokudb.hotindex-insert-bigchar : MDEV-12640 - Crash
+tokudb.hotindex-insert-1 : MDEV-13870 - Lost connection to MySQL server
+tokudb.hotindex-update-1 : MDEV-12640 - Crash
+tokudb.rows-32m-rand-insert : MDEV-12640 - Crash
+tokudb.rows-32m-seq-insert : MDEV-12640 - Crash
tokudb_bugs.checkpoint_lock : MDEV-10637 - Wrong processlist output
tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output
-tokudb_bugs.frm_store : MDEV-12823 - Valgrind
-tokudb_bugs.frm_store2 : MDEV-12823 - Valgrind
-tokudb_bugs.frm_store3 : MDEV-12823 - Valgrind
tokudb_bugs.xa : MDEV-11804 - Lock wait timeout
-tokudb_parts.nonflushing_analyze_debug : Added in 10.0.34
-
-tokudb_perfschema.crash_tokudb : Added in 10.0.34
-tokudb_perfschema.start_server_tokudb : Added in 10.0.34
-
-tokudb_rpl.* : MDEV-11001 - tests don't work
-tokudb_sys_vars.* : MDEV-11001 - tests don't work
+tokudb_mariadb.mdev6657 : MDEV-12737 - Wrong plan, valgrind warnings
-rpl-tokudb.* : MDEV-14354 - Tests fail with tcmalloc
+rpl-tokudb.rpl_tokudb_row_log : Include file modified in 10.1.30
+rpl-tokudb.rpl_tokudb_stm_log : Include file modified in 10.1.30
#----------------------------------------------------------------
-unit.lf : MDEV-12897 - Unexpected return code
+unit.lf : MDEV-12897 - Signal 11 thrown
unit.ma_test_loghandler : MDEV-10638 - record read not ok
-unit.pfs : MySQL:84457 - unittest pft-t failing
#----------------------------------------------------------------
vcol.not_supported : MDEV-10639 - Testcase timeout
vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout
+vcol.vcol_misc : Modified in 10.1.29
#----------------------------------------------------------------
+
+wsrep.binlog_format : MDEV-11532 - WSREP has not yet prepared node
+wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node
+wsrep.mdev_6832 : MDEV-14195 - Failure upon check-testcase
+wsrep.pool_of_threads : MDEV-12234 - Library problem on Power
+
+wsrep_info.plugin : MDEV-12909 - Wrong result
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 620bc958196..d5a8584669b 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -581,21 +581,6 @@
}
#
-# BUG#19940: NDB sends uninitialized parts of field buffers across the wire.
-# This is "works as designed"; the uninitialized part is not used at the
-# other end (but Valgrind cannot see this).
-#
-{
- bug19940
- Memcheck:Param
- socketcall.sendto(msg)
- fun:send
- fun:_ZN15TCP_Transporter6doSendEv
- fun:_ZN19TransporterRegistry11performSendEv
- fun:_ZN19TransporterRegistry14forceSendCheckEi
-}
-
-#
# Warning when printing stack trace (to suppress some not needed warnings)
#
@@ -1386,3 +1371,242 @@
obj:*/libssl.so.0.9.8
...
}
+
+{
+ vasprintf in OpenSuse 12.3
+ Memcheck:Leak
+ fun:malloc
+ fun:vasprintf
+ fun:asprintf
+ fun:dlerror
+}
+
+{
+ GitHub codership/galera#330
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:CRYPTO_malloc
+ fun:sk_new
+ obj:/usr/lib64/libssl.so.1.0.1e
+ fun:SSL_COMP_get_compression_methods
+ fun:SSL_library_init
+ fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_initC1Ev
+ fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_init8instanceEv
+ fun:_ZN4asio3ssl6detail12openssl_initILb1EEC1Ev
+ fun:_Z41__static_initialization_and_destruction_0ii.constprop.120
+ fun:call_init.part.0
+ fun:_dl_init
+ fun:dl_open_worker
+ fun:_dl_catch_error
+ fun:_dl_open
+ fun:dlopen_doit
+}
+{
+ GitHub codership/galera#330
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:CRYPTO_malloc
+ fun:sk_new
+ obj:/usr/lib64/libssl.so.1.0.1e
+ fun:SSL_COMP_get_compression_methods
+ fun:SSL_library_init
+ fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_initC1Ev
+ fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_init8instanceEv
+ fun:_ZN4asio3ssl6detail12openssl_initILb1EEC1Ev
+ fun:_Z41__static_initialization_and_destruction_0ii.constprop.120
+ fun:call_init.part.0
+ fun:_dl_init
+ fun:dl_open_worker
+ fun:_dl_catch_error
+ fun:_dl_open
+ fun:dlopen_doit
+}
+
+{
+ GitHub codership/mysql-wsrep#175
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:calloc
+ fun:do_lookup_x
+ fun:_dl_lookup_symbol_x
+ fun:_dl_relocate_object
+ fun:dl_open_worker
+ fun:_dl_catch_error
+ fun:_dl_open
+ fun:dlopen_doit
+ fun:_dl_catch_error
+ fun:_dlerror_run
+ fun:dlopen@@GLIBC_2.2.5
+ fun:wsrep_load
+ fun:_Z10wsrep_initv
+ fun:_Z18wsrep_init_startupb
+ fun:_ZL22init_server_componentsv
+ fun:_Z11mysqld_mainiPPc
+}
+
+{
+ galera/mysql-wsrep#147
+ Memcheck:Leak
+ match-leak-kinds: possible
+ fun:malloc
+ fun:_ZNK6galera13ReplicatorSMM9stats_getEv
+ fun:_ZL28export_wsrep_status_to_mysqlP3THD
+ fun:_Z17wsrep_show_statusP3THDP17st_mysql_show_varPc
+ fun:_ZL17show_status_arrayP3THDPKcP17st_mysql_show_var13enum_var_typeP17system_status_varS2_P5TABLEbP4Item
+ fun:_Z11fill_statusP3THDP10TABLE_LISTP4Item
+ fun:_ZL13do_fill_tableP3THDP10TABLE_LISTP13st_join_table
+ fun:_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state
+ fun:_ZN4JOIN14prepare_resultEPP4ListI4ItemE
+ fun:_ZN4JOIN4execEv
+ fun:_ZL20mysql_execute_selectP3THDP13st_select_lexb
+ fun:_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex
+ fun:_Z13handle_selectP3THDP13select_resultm
+ fun:_ZL21execute_sqlcom_selectP3THDP10TABLE_LIST
+ fun:_Z21mysql_execute_commandP3THD
+ fun:_Z11mysql_parseP3THDPcjP12Parser_state
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:DbugMalloc
+ fun:ListParse
+ fun:_gu_db_push_
+ fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+ fun:galera_parameters_set
+ fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+ fun:_ZN7sys_var6updateEP3THDP7set_var
+ fun:_ZN7set_var6updateEP3THD
+ fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+ fun:_Z21mysql_execute_commandP3THD
+ fun:_Z11mysql_parseP3THDPcjP12Parser_state
+ fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+ fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+ fun:_Z10do_commandP3THD
+ fun:_Z24do_handle_one_connectionP3THD
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:state_map_insert
+ fun:code_state
+ fun:_gu_db_push_
+ fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+ fun:galera_parameters_set
+ fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+ fun:_ZN7sys_var6updateEP3THDP7set_var
+ fun:_ZN7set_var6updateEP3THD
+ fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+ fun:_Z21mysql_execute_commandP3THD
+ fun:_Z11mysql_parseP3THDPcjP12Parser_state
+ fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+ fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+ fun:_Z10do_commandP3THD
+ fun:_Z24do_handle_one_connectionP3THD
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:DbugMalloc
+ fun:StrDup
+ fun:ListParse
+ fun:_gu_db_push_
+ fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+ fun:galera_parameters_set
+ fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+ fun:_ZN7sys_var6updateEP3THDP7set_var
+ fun:_ZN7set_var6updateEP3THD
+ fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+ fun:_Z21mysql_execute_commandP3THD
+ fun:_Z11mysql_parseP3THDPcjP12Parser_state
+ fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+ fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+ fun:_Z10do_commandP3THD
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:code_state
+ fun:_gu_db_push_
+ fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+ fun:galera_parameters_set
+ fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+ fun:_ZN7sys_var6updateEP3THDP7set_var
+ fun:_ZN7set_var6updateEP3THD
+ fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+ fun:_Z21mysql_execute_commandP3THD
+ fun:_Z11mysql_parseP3THDPcjP12Parser_state
+ fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+ fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+ fun:_Z10do_commandP3THD
+ fun:_Z24do_handle_one_connectionP3THD
+ fun:handle_one_connection
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:DbugMalloc
+ fun:PushState
+ fun:_gu_db_push_
+ fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+ fun:galera_parameters_set
+ fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+ fun:_ZN7sys_var6updateEP3THDP7set_var
+ fun:_ZN7set_var6updateEP3THD
+ fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+ fun:_Z21mysql_execute_commandP3THD
+ fun:_Z11mysql_parseP3THDPcjP12Parser_state
+ fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+ fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+ fun:_Z10do_commandP3THD
+ fun:_Z24do_handle_one_connectionP3THD
+}
+
+{
+ codership/galera#331
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:state_map_insert
+ fun:code_state
+ fun:_gu_db_keyword_
+ fun:_ZN6galera3ist6Sender4sendEll
+ fun:run_async_sender
+ fun:start_thread
+ fun:clone
+}
+
+{
+ codership/galera#331
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:code_state
+ fun:_gu_db_keyword_
+ fun:_ZN6galera3ist6Sender4sendEll
+ fun:run_async_sender
+ fun:start_thread
+ fun:clone
+}